projects
/
ferlib2koha.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
51c7c40
)
added YAML cache
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 15 Aug 2011 14:51:16 +0000
(16:51 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 15 Aug 2011 14:51:16 +0000
(16:51 +0200)
lib/FERWeb.pm
patch
|
blob
|
history
diff --git
a/lib/FERWeb.pm
b/lib/FERWeb.pm
index
bed57dc
..
82d8953
100755
(executable)
--- a/
lib/FERWeb.pm
+++ b/
lib/FERWeb.pm
@@
-9,6
+9,7
@@
use strict;
require RPC::XML;
require RPC::XML::Client;
+use YAML;
use Data::Dump qw(dump);
@@
-31,12
+32,17
@@
our $users = RPC::XML::Client->new('https://www.fer.hr/xmlrpc/xr_users.php');
sub getinfobycode {
my ($self,$code) = @_;
+ my $path = "ferweb/$code";
+ return YAML::LoadFile $path if -e $path;
+
my $res = $users->send_request(
'users.getinfobycode', $self->{login_id}, RPC::XML::string->new($code)
)->value;
print "[$code] = ", dump($res), $/;
+ YAML::DumpFile $path, $res;
+
return $res;
}