[freeside-commits] freeside/FS/FS Mason.pm, 1.24, 1.25 ClientAPI.pm, 1.4, 1.5

Ivan,,, ivan at wavetail.420.am
Wed Jan 20 17:25:24 PST 2010


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv6365/FS/FS

Modified Files:
	Mason.pm ClientAPI.pm 
Log Message:
fix self-service fallout from RT 3.8, RT#6640

Index: ClientAPI.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ClientAPI.pm	5 Feb 2005 23:39:43 -0000	1.4
+++ ClientAPI.pm	21 Jan 2010 01:25:22 -0000	1.5
@@ -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 );
+
+ at 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 );

Index: Mason.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Mason.pm,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- Mason.pm	3 Jan 2010 03:07:29 -0000	1.24
+++ Mason.pm	21 Jan 2010 01:25:22 -0000	1.25
@@ -388,12 +388,17 @@
 
 =over 4
 
-=item mason_interps [ MODE ]
+=item mason_interps [ MODE [ OPTION => VALUE ... ] ]
 
 Returns a list consisting of two HTML::Mason::Interp objects, the first for
 Freeside pages, and the second for RT pages.
 
-#MODE can be 'apache' or 'standalone'.  If not specified, defaults to 'apache'.
+MODE can be 'apache' or 'standalone'.  If not specified, defaults to 'apache'.
+
+Options and values can be passed following mode.  Currently available options
+are:
+
+I<outbuf> should be set to a scalar reference in standalone mode.
 
 =cut
 
@@ -406,7 +411,7 @@
   my $request_class = 'FS::Mason::Request';
 
   #not entirely sure it belongs here, but what the hey
-  if ( %%%RT_ENABLED%%% ) {
+  if ( %%%RT_ENABLED%%% && $mode ne 'standalone' ) {
     RT::LoadConfig();
   }
 



More information about the freeside-commits mailing list