From 00c61e51058e44a07ea3a47acffba4a0e294d4fb Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 23 Apr 2003 23:15:02 +0000 Subject: [PATCH] compatible with mason 1.1! closes: bug#492 --- Makefile | 5 +++++ htetc/handler.pl | 27 ++++++++++++++++----------- httemplate/docs/install.html | 16 +++++++--------- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index cf9f6f5de..aac1d817a 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,8 @@ TEMPLATE = asp #TEMPLATE = mason ASP_GLOBAL = /usr/local/etc/freeside/asp-global +MASON_HANDLER = /usr/local/etc/freeside/handler.pl +MASONDATA = /usr/local/etc/freeside/masondata FREESIDE_DOCUMENT_ROOT = /var/www/freeside @@ -102,6 +104,9 @@ install-docs: docs [ "${TEMPLATE}" = "asp" -a ! -e ${ASP_GLOBAL} ] && mkdir ${ASP_GLOBAL} || true [ "${TEMPLATE}" = "asp" ] && chown -R freeside ${ASP_GLOBAL} || true [ "${TEMPLATE}" = "asp" ] && cp htetc/global.asa ${ASP_GLOBAL} || true + [ "${TEMPLATE}" = "mason" ] && cp htetc/handler.pl ${MASON_HANDLER} || true + [ "${TEMPLATE}" = "mason" -a ! -e ${MASONDATA} ] && mkdir ${MASONDATA} || true + [ "${TEMPLATE}" = "mason" ] && chown -R freeside ${MASONDATA} || true perl-modules: cd FS; \ diff --git a/htetc/handler.pl b/htetc/handler.pl index 49bcbc08c..3e37b7ef6 100644 --- a/htetc/handler.pl +++ b/htetc/handler.pl @@ -28,20 +28,25 @@ use strict; # Create Mason objects # -my $parser = new HTML::Mason::Parser; -my $interp = new HTML::Mason::Interp (parser=>$parser, - comp_root=>'/var/www/masondocs', - data_dir=>'/home/ivan/freeside_current/masondata', - out_mode=>'stream', - ); -my $ah = new HTML::Mason::ApacheHandler ( interp => $interp, - #auto_send_headers => 0, - ); + +#my $parser = new HTML::Mason::Parser; +#my $interp = new HTML::Mason::Interp (parser=>$parser, +# comp_root=>'/var/www/masondocs', +# data_dir=>'/usr/local/etc/freeside/masondata', +# out_mode=>'stream', +# ); +my $ah = new HTML::Mason::ApacheHandler ( + #interp => $interp, + #auto_send_headers => 0, + comp_root=>'/var/www/masonside', + data_dir=>'/usr/local/etc/freeside/masondata', + #out_mode=>'stream', +); # Activate the following if running httpd as root (the normal case). # Resets ownership of all files created by Mason at startup. # -chown (Apache->server->uid, Apache->server->gid, $interp->files_written); +#chown (Apache->server->uid, Apache->server->gid, $interp->files_written); sub handler { @@ -111,7 +116,7 @@ sub handler *CGI::redirect = sub { my( $self, $location ) = @_; - + use vars qw($m); #http://www.masonhq.com/docs/faq/#how_do_i_do_an_external_redirect $m->clear_buffer; # The next two lines are necessary to stop Apache from re-reading diff --git a/httemplate/docs/install.html b/httemplate/docs/install.html index 4d723119d..93bb24920 100644 --- a/httemplate/docs/install.html +++ b/httemplate/docs/install.html @@ -47,7 +47,7 @@ Before installing, you need:
  • Net-SSH
  • String-ShellQuote
  • Net-SCP -
  • Apache::ASP or HTML::Mason (use version 1.0x - Freeside is not yet compatible with version 1.1x) +
  • Apache::ASP or HTML::Mason
  • Tie-IxHash
  • Time-Duration
  • HTML-Widgets-SelectLayers @@ -63,7 +63,7 @@ Install the Freeside distribution: