[freeside-commits] freeside/htetc handler.pl,1.86.2.21,1.86.2.22

Ivan,,, ivan at wavetail.420.am
Mon Sep 21 20:09:30 PDT 2009


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

Modified Files:
      Tag: FREESIDE_1_7_BRANCH
	handler.pl 
Log Message:
add addl_comp_root.pl and addl_handler_use.pl config files, RT#4743

Index: handler.pl
===================================================================
RCS file: /home/cvs/cvsroot/freeside/htetc/handler.pl,v
retrieving revision 1.86.2.21
retrieving revision 1.86.2.22
diff -u -d -r1.86.2.21 -r1.86.2.22
--- handler.pl	25 Jul 2009 22:00:57 -0000	1.86.2.21
+++ handler.pl	22 Sep 2009 03:09:28 -0000	1.86.2.22
@@ -4,6 +4,7 @@
 
 use strict;
 use vars qw($r);
+use File::Slurp qw( slurp );
 use HTML::Mason 1.27; #http://www.masonhq.com/?ApacheModPerl2Redirect
 use HTML::Mason::Interp;
 use HTML::Mason::Compiler::ToObject;
@@ -32,6 +33,26 @@
  die $@ if $@;
 }
 
+# Some hooks supporting strange legacy ways people have added stuff on
+
+my @addl_comp_root = ();
+my $addl_comp_root_file = '%%%FREESIDE_CONF%%%/addl_comp_root.pl';
+if ( -e $addl_comp_root_file ) {
+  my $text = slurp( $addl_comp_root_file );
+  my @addl = eval $text;
+  if ( @addl && ! $@ ) {
+    @addl_comp_root = @addl;
+  } elsif ($@) {
+    warn "error parsing $addl_comp_root_file: $@\n";
+  }
+}
+
+$FS::Mason::addl_handler_use = '';
+my $addl_handler_use_file = '%%%FREESIDE_CONF%%%/addl_handler_use.pl';
+if ( -e $addl_handler_use_file ) {
+  $FS::Mason::addl_handler_use = slurp( $addl_handler_use_file );
+}
+
 # Create Mason objects
 
 my %interp = (
@@ -43,6 +64,7 @@
   comp_root            => [
                             [ 'freeside' => '%%%FREESIDE_DOCUMENT_ROOT%%%'    ],
                             [ 'rt'       => '%%%FREESIDE_DOCUMENT_ROOT%%%/rt' ],
+                            @addl_comp_root,
                           ],
 );
 
@@ -217,6 +239,11 @@
       use FS::reason;
       use FS::cust_main_note;
 
+      if ( $FS::Mason::addl_handler_use ) {
+        eval $FS::Mason::addl_handler_use;
+        die $@ if $@;
+      }
+
       if ( %%%RT_ENABLED%%% ) {
         eval '
           use RT::Tickets;



More information about the freeside-commits mailing list