diff options
author | ivan <ivan> | 2010-01-21 01:25:22 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-01-21 01:25:22 +0000 |
commit | bcff37f04c502c60fea1e2824841eb2007a07ccd (patch) | |
tree | 4434a08cc109bd01f060e4523bbc820d66c97ef9 /FS/FS/ClientAPI.pm | |
parent | f256ef47d91090695a8cda27671e47e938f6a998 (diff) |
fix self-service fallout from RT 3.8, RT#6640
Diffstat (limited to 'FS/FS/ClientAPI.pm')
-rw-r--r-- | FS/FS/ClientAPI.pm | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/FS/FS/ClientAPI.pm b/FS/FS/ClientAPI.pm index 902f58b..1677fcc 100644 --- a/FS/FS/ClientAPI.pm +++ b/FS/FS/ClientAPI.pm @@ -1,29 +1,34 @@ package FS::ClientAPI; use strict; -use vars qw(%handler $domain $DEBUG); +use base 'Exporter'; +use vars qw( @EXPORT_OK %handler $domain $DEBUG ); + +@EXPORT_OK = qw( load_clientapi_modules ); $DEBUG = 0; %handler = (); -#find modules -foreach my $INC ( @INC ) { - my $glob = "$INC/FS/ClientAPI/*.pm"; - warn "FS::ClientAPI: searching $glob" if $DEBUG; - foreach my $file ( glob($glob) ) { - $file =~ /\/(\w+)\.pm$/ or do { - warn "unrecognized ClientAPI file: $file"; - next - }; - my $mod = $1; - warn "using FS::ClientAPI::$mod" if $DEBUG; - eval "use FS::ClientAPI::$mod;"; - die "error using FS::ClientAPI::$mod: $@" if $@; +sub load_clientapi_modules { + + #find modules + foreach my $INC ( @INC ) { + my $glob = "$INC/FS/ClientAPI/*.pm"; + warn "FS::ClientAPI: searching $glob" if $DEBUG; + foreach my $file ( glob($glob) ) { + $file =~ /\/(\w+)\.pm$/ or do { + warn "unrecognized ClientAPI file: $file"; + next + }; + my $mod = $1; + warn "using FS::ClientAPI::$mod" if $DEBUG; + eval "use FS::ClientAPI::$mod;"; + die "error using FS::ClientAPI::$mod: $@" if $@; + } } -} -#--- +} sub dispatch { my ( $self, $name ) = ( shift, shift ); |