[freeside-commits] freeside/FS/FS/part_export voipnow_did.pm, 1.1, 1.2
Mark Wells
mark at wavetail.420.am
Mon Feb 28 20:38:33 PST 2011
Update of /home/cvs/cvsroot/freeside/FS/FS/part_export
In directory wavetail.420.am:/tmp/cvs-serv11681/FS/FS/part_export
Modified Files:
voipnow_did.pm
Log Message:
VoipNow export, minor fixes
Index: voipnow_did.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_export/voipnow_did.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- voipnow_did.pm 1 Mar 2011 04:09:22 -0000 1.1
+++ voipnow_did.pm 1 Mar 2011 04:38:31 -0000 1.2
@@ -5,7 +5,6 @@
use FS::Record qw(qsearch qsearchs dbh);
use FS::part_export;
use FS::areacode;
-use XML::Writer;
use XML::Simple 'XMLin';
use Net::SSLeay 'post_https';
use Cache::FileCache;
@@ -19,6 +18,7 @@
'login' => { label=>'VoipNow client login' },
'password' => { label=>'VoipNow client password' },
'country' => { label=>'Country (two-letter code)' },
+ 'cache_time' => { label=>'Cache lifetime (seconds)' },
;
%info = (
@@ -38,7 +38,8 @@
my $self = shift;
$CACHE ||= new Cache::FileCache( {
'namespace' => __PACKAGE__,
- 'default_expires_in' => 300,
+ 'default_expires_in' => $self->option('cache_time') || 300,
+ 'cache_root' => $FS::UID::cache_dir.'/cache'.$FS::UID::datasrc,
} );
return $CACHE->get($self->exportnum) || $self->reload_cache;
}
@@ -259,6 +260,9 @@
my $host = $self->machine;
my $path = "/soap2/${endpoint}_agent.php";
+ eval "use XML::Writer";
+ die $@ if $@;
+
warn "[$method] constructing request\n" if $DEBUG;
my $soap_request;
my $writer = XML::Writer->new(
More information about the freeside-commits
mailing list