.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" 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 .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "HTTP::Server::Simple::Mason 3pm" .TH HTTP::Server::Simple::Mason 3pm "2022-11-20" "perl v5.36.0" "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" HTTP::Server::Simple::Mason \- An abstract baseclass for a standalone mason server .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& my $server = MyApp::Server\->new(); \& \& $server\->run; \& \& package MyApp::Server; \& use base qw/HTTP::Server::Simple::Mason/; \& \& sub mason_config { \& return ( comp_root => \*(Aq/tmp/mason\-pages\*(Aq ); \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" .SH "INTERFACE" .IX Header "INTERFACE" See HTTP::Server::Simple and the documentation below. .SS "mason_handler" .IX Subsection "mason_handler" Returns the server's \f(CW\*(C`HTML::Mason::CGIHandler\*(C'\fR object. The first time this method is called, it creates a new handler by calling \f(CW\*(C`new_handler\*(C'\fR. .SS "handle_request \s-1CGI\s0" .IX Subsection "handle_request CGI" Called with a \s-1CGI\s0 object. Invokes mason and runs the request .SS "handle_error \s-1ERROR\s0" .IX Subsection "handle_error ERROR" If the call to \f(CW\*(C`handle_request\*(C'\fR dies, \f(CW\*(C`handle_error\*(C'\fR is called with the exception (that is, \f(CW$@\fR). By default, it does nothing; it can be overridden by your subclass. .SS "new_handler" .IX Subsection "new_handler" Creates and returns a new \f(CW\*(C`HTML::Mason::CGIHandler\*(C'\fR, with configuration specified by the \f(CW\*(C`default_mason_config\*(C'\fR and \f(CW\*(C`mason_config\*(C'\fR methods. You don't need to call this method yourself; \f(CW\*(C`mason_handler\*(C'\fR will automatically call it the first time it is called. .SS "handler_class" .IX Subsection "handler_class" Returns the name of the Mason handler class invoked in \f(CW\*(C`new_handler\*(C'\fR. Defaults to HTML::Mason::CGIHandler, but in your subclass you may wish to change it to a subclass of HTML::Mason::CGIHandler. .ie n .SS "setup_escapes $handler" .el .SS "setup_escapes \f(CW$handler\fP" .IX Subsection "setup_escapes $handler" Sets up the Mason escapes for the handler \f(CW$handler\fR. For example, the \f(CW\*(C`h\*(C'\fR in .PP .Vb 1 \& <% $name | h %> .Ve .PP By default, sets \f(CW\*(C`h\*(C'\fR to \f(CW\*(C`HTTP::Server::Simple::Mason::escape_utf8\*(C'\fR and \f(CW\*(C`u\*(C'\fR to \f(CW\*(C`HTTP::Server::Simple::Mason::escape_uri\*(C'\fR, but you can override this in your subclass. .SS "mason_config" .IX Subsection "mason_config" Returns a subclass-defined mason handler configuration; you almost certainly want to override it and specify at least \f(CW\*(C`comp_root\*(C'\fR. .SS "default_mason_config" .IX Subsection "default_mason_config" Returns the default mason handler configuration (which can be overridden by entries in \f(CW\*(C`mason_config\*(C'\fR). .SS "escape_utf8 \s-1SCALARREF\s0" .IX Subsection "escape_utf8 SCALARREF" does a css-busting but minimalist escaping of whatever html you're passing in. .SS "escape_uri \s-1SCALARREF\s0" .IX Subsection "escape_uri SCALARREF" Escapes \s-1URI\s0 component according to \s-1RFC2396\s0 .SH "CONFIGURATION AND ENVIRONMENT" .IX Header "CONFIGURATION AND ENVIRONMENT" For most configuration, see HTTP::Server::Simple. .PP You can (and must) configure your mason \s-1CGI\s0 handler by subclassing this module and overriding the subroutine \f(CW\*(C`mason_config\*(C'\fR. It's most important that you set a component root (where your pages live) by adding .PP .Vb 1 \& comp_root => \*(Aq/some/absolute/path\*(Aq .Ve .PP See the Synopsis section or \f(CW\*(C`ex/sample_server.pl\*(C'\fR in the distribution for a complete example. .SH "DEPENDENCIES" .IX Header "DEPENDENCIES" HTTP::Server::Simple HTML::Mason .SH "INCOMPATIBILITIES" .IX Header "INCOMPATIBILITIES" None reported. .SH "BUGS AND LIMITATIONS" .IX Header "BUGS AND LIMITATIONS" Please report any bugs or feature requests to \&\f(CW\*(C`bug\-http\-server\-simple\-mason@rt.cpan.org\*(C'\fR, or through the web interface at . .SH "AUTHOR" .IX Header "AUTHOR" Jesse Vincent \f(CW\*(C`\*(C'\fR .SH "LICENCE AND COPYRIGHT" .IX Header "LICENCE AND COPYRIGHT" Copyright (c) 2001\-2005, Jesse Vincent \f(CW\*(C`\*(C'\fR. All rights reserved. .PP This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "DISCLAIMER OF WARRANTY" .IX Header "DISCLAIMER OF WARRANTY" \&\s-1BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE \*(L"AS IS\*(R" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.\s0 .PP \&\s-1IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE\s0 (\s-1INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE\s0), \s-1EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\s0