.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "HTML::Mason::ApacheHandler 3pm" .TH HTML::Mason::ApacheHandler 3pm "2017-11-06" "perl v5.26.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" HTML::Mason::ApacheHandler \- Mason/mod_perl interface .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use HTML::Mason::ApacheHandler; \& \& my $ah = HTML::Mason::ApacheHandler\->new (..name/value params..); \& ... \& sub handler { \& my $r = shift; \& $ah\->handle_request($r); \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The ApacheHandler object links Mason to mod_perl (version 1 or 2), running components in response to \s-1HTTP\s0 requests. It is controlled primarily through parameters to the \fInew()\fR constructor. .SH "PARAMETERS TO THE \fInew()\fP CONSTRUCTOR" .IX Header "PARAMETERS TO THE new() CONSTRUCTOR" .IP "apache_status_title" 4 .IX Item "apache_status_title" Title that you want this ApacheHandler to appear as under Apache::Status. Default is \*(L"HTML::Mason status\*(R". This is useful if you create more than one ApacheHandler object and want them all visible via Apache::Status. .IP "args_method" 4 .IX Item "args_method" Method to use for unpacking \s-1GET\s0 and \s-1POST\s0 arguments. The valid options are '\s-1CGI\s0' and 'mod_perl'; these indicate that a \f(CW\*(C`CGI.pm\*(C'\fR or \&\f(CW\*(C`Apache::Request\*(C'\fR object (respectively) will be created for the purposes of argument handling. .Sp \&'mod_perl' is the default under mod_perl\-1 and requires that you have installed the \f(CW\*(C`Apache::Request\*(C'\fR package. Under mod_perl\-2, the default is '\s-1CGI\s0' because \f(CW\*(C`Apache2::Request\*(C'\fR is still in development. .Sp If args_method is 'mod_perl', the \f(CW$r\fR global is upgraded to an Apache::Request object. This object inherits all Apache methods and adds a few of its own, dealing with parameters and file uploads. See \&\f(CW\*(C`Apache::Request\*(C'\fR for more information. .Sp If the args_method is '\s-1CGI\s0', the Mason request object (\f(CW$m\fR) will have a method called \f(CW\*(C`cgi_object\*(C'\fR available. This method returns the \s-1CGI\s0 object used for argument processing. .Sp While Mason will load \f(CW\*(C`Apache::Request\*(C'\fR or \f(CW\*(C`CGI\*(C'\fR as needed at runtime, it is recommended that you preload the relevant module either in your \&\fIhttpd.conf\fR or \fIhandler.pl\fR file, as this will save some memory. .IP "decline_dirs" 4 .IX Item "decline_dirs" True or false, default is true. Indicates whether Mason should decline directory requests, leaving Apache to serve up a directory index or a \&\f(CW\*(C`FORBIDDEN\*(C'\fR error as appropriate. See the allowing directory requests section of the administrator's manual for more information about handling directories with Mason. .IP "interp" 4 .IX Item "interp" The interpreter object to associate with this compiler. By default a new object of the specified interp_class will be created. .IP "interp_class" 4 .IX Item "interp_class" The class to use when creating a interpreter. Defaults to HTML::Mason::Interp. .SH "ACCESSOR METHODS" .IX Header "ACCESSOR METHODS" All of the above properties, except interp_class, have standard accessor methods of the same name: no arguments retrieves the value, and one argument sets it, except for args_method, which is not settable. For example: .PP .Vb 3 \& my $ah = HTML::Mason::ApacheHandler\->new; \& my $decline_dirs = $ah\->decline_dirs; \& $ah\->decline_dirs(1); .Ve .SH "OTHER METHODS" .IX Header "OTHER METHODS" The ApacheHandler object has a few other publicly accessible methods that may be of interest to end users. .IP "handle_request ($r)" 4 .IX Item "handle_request ($r)" This method takes an Apache or Apache::Request object representing a request and translates that request into a form Mason can understand. Its return value is an Apache status code. .Sp Passing an Apache::Request object is useful if you want to set Apache::Request parameters, such as \s-1POST_MAX\s0 or \s-1DISABLE_UPLOADS.\s0 .IP "prepare_request ($r)" 4 .IX Item "prepare_request ($r)" This method takes an Apache object representing a request and returns a new Mason request object or an Apache status code. If it is a request object you can manipulate that object as you like, and then call the request object's \f(CW\*(C`exec\*(C'\fR method to have it generate output. .Sp If this method returns an Apache status code, that means that it could not create a Mason request object. .Sp This method is useful if you would like to have a chance to decline a request based on properties of the Mason request object or a component object. For example: .Sp .Vb 3 \& my $req = $ah\->prepare_request($r); \& # $req must be an Apache status code if it\*(Aqs not an object \& return $req unless ref($req); \& \& return DECLINED \& unless $req\->request_comp\->source_file =~ /\e.html$/; \& \& $req\->exec; .Ve .IP "request_args ($r)" 4 .IX Item "request_args ($r)" Given an Apache request object, this method returns a three item list. The first item is a hash reference containing the arguments passed by the client's request. .Sp The second is an Apache request object. This is returned for backwards compatibility from when this method was responsible for turning a plain Apache object into an Apache::Request object. .Sp The third item may be a \s-1CGI\s0.pm object or \f(CW\*(C`undef\*(C'\fR, depending on the value of the args_method parameter.