cp htetc/handler.pl ${MASON_HANDLER}
perl -p -i -e "\
s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \
+ s'%%%FREESIDE_CONF%%%'${FREESIDE_CONF}'g; \
s'%%%RT_ENABLED%%%'${RT_ENABLED}'g; \
s'%%%MASONDATA%%%'${MASONDATA}'g;\
" ${MASON_HANDLER}
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;
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 = (
comp_root => [
[ 'freeside' => '%%%FREESIDE_DOCUMENT_ROOT%%%' ],
[ 'rt' => '%%%FREESIDE_DOCUMENT_ROOT%%%/rt' ],
+ @addl_comp_root,
],
);
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;