These settings are overriden by options given to particular
C<$m-E<gt>cache> calls.
=head2 data_dir
=over 4
=item * Perl name: data_dir
=item * Apache name: MasonDataDir
=item * Type in httpd.conf: string
=item * Default: None
=item * Belongs to: L<HTML::Mason::Interp|HTML::Mason::Interp>
=back
The data directory is a writable directory that Mason uses for various
features and optimizations: for example, component object files and
data cache files. Mason will create the directory on startup, if necessary, and set its
permissions according to the web server User/Group.
Under L<Apache|HTML::Mason::ApacheHandler>, data_dir defaults to a
directory called "mason" under the Apache server root. You will
need to change this on certain systems that assign a high-level
server root such as F</usr>!
In non-Apache environments, data_dir has no default. If it is left
unspecified, Mason will not use L<object files|HTML::Mason::Admin/object files>, and the default
L<data cache class|HTML::Mason::Request/item_cache> will be
C<MemoryCache> instead of C<FileCache>.
=head2 decline_dirs
=over 4
=item * Perl name: decline_dirs
=item * Apache name: MasonDeclineDirs
=item * Type in httpd.conf: boolean
=item * Default: 1
=item * Belongs to: L<HTML::Mason::ApacheHandler|HTML::Mason::ApacheHandler>
=back
True or false, default is true. Indicates whether Mason should decline
directory requests, leaving Apache to serve up a directory index or a
C<FORBIDDEN> error as appropriate. See the L<allowing directory requests|HTML::Mason::Admin/allowing directory requests> section of the administrator's manual
for more information about handling directories with Mason.
=head2 default_escape_flags
=over 4
=item * Perl name: default_escape_flags
=item * Apache name: MasonDefaultEscapeFlags
=item * Type in httpd.conf: string
=item * Default: []
=item * Belongs to: L<HTML::Mason::Compiler|HTML::Mason::Compiler>
=back
Escape flags to apply to all <% %> expressions by default. The current
valid flags are
h - escape for HTML ('<' => '<', etc.)
u - escape for URL (':' => '%3A', etc.)
The developer can override default escape flags on a per-expression
basis; see the L<escaping expressions|HTML::Mason::Devel/escaping expressions> section of the developer's manual.
If you want to set I<multiple> flags as the default, this should be
given as a reference to an array of flags.
=head2 define_args_hash
=over 4
=item * Perl name: define_args_hash
=item * Apache name: MasonDefineArgsHash
=item * Type in httpd.conf: string
=item * Default: auto
=item * Belongs to: L<HTML::Mason::Compiler::ToObject|HTML::Mason::Compiler::ToObject>
=back
One of "always", "auto", or "never". This determines whether or not
an C<%ARGS> hash is created in components. If it is set to "always",
one is always defined. If set to "never", it is never defined.
The default, "auto", will cause the hash to be defined only if some
part of the component contains the string "ARGS". This is somewhat
crude, and may result in some false positives, but this is preferable
to false negatives.
Not defining the args hash means that we can avoid copying component
arguments, which can save memory and slightly improve execution speed.
=head2 dhandler_name
=over 4
=item * Perl name: dhandler_name
=item * Apache name: MasonDhandlerName
=item * Type in httpd.conf: string
=item * Default: dhandler
=item * Belongs to: L<HTML::Mason::Request|HTML::Mason::Request>
=back
File name used for L<dhandlers|HTML::Mason::Devel/dhandlers>. Default
is "dhandler". If this is set to an empty string ("") then dhandlers
are turned off entirely.
=head2 error_format
=over 4
=item * Perl name: error_format
=item * Apache name: MasonErrorFormat
=item * Type in httpd.conf: string
=item * Default: Varies
=item * Belongs to: L<HTML::Mason::Request|HTML::Mason::Request>
=back
Indicates how errors are formatted. The built-in choices are
=over
=item *
I<brief> - just the error message with no trace information
=item *
I<text> - a multi-line text format
=item *
I<line> - a single-line text format, with different pieces of information separated by tabs (useful for log files)
=item *
I<html> - a fancy html format
=back
The default format under L<Apache|HTML::Mason::ApacheHandler> and
L<CGI|HTML::Mason::CGIHandler> is either I<line> or I<html> depending
on whether the error mode is I<fatal> or I<output>, respectively. The
default for standalone mode is I<text>.
The formats correspond to C<HTML::Mason::Exception> methods named
as_I<format>. You can define your own format by creating an
appropriately named method; for example, to define an "xml" format,
create a method C<HTML::Mason::Exception::as_xml> patterned after one of
the built-in methods.
=head2 error_mode
=over 4
=item * Perl name: error_mode
=item * Apache name: MasonErrorMode
=item * Type in httpd.conf: string
=item * Default: Varies
=item * Belongs to: L<HTML::Mason::Request|HTML::Mason::Request>
=back
Indicates how errors are returned to the caller. The choices are
I<fatal>, meaning die with the error, and I<output>, meaning output
the error just like regular output.
The default under L<Apache|HTML::Mason::ApacheHandler> and
L<CGI|HTML::Mason::CGIHandler> is I<output>, causing the error to be
displayed in the browser. The default for standalone mode is
I<fatal>.
=head2 escape_flags
=over 4
=item * Perl name: escape_flags
=item * Apache name: MasonEscapeFlags
=item * Type in httpd.conf: hash_list
=item * Default: None
=item * Belongs to: L<HTML::Mason::Interp|HTML::Mason::Interp>
=back
A hash reference of escape flags to set for this object. See the
section on the L<set_escape
method|HTML::Mason::Interp/item_set_escape> for more details.
=head2 ignore_warnings_expr
=over 4
=item * Perl name: ignore_warnings_expr
=item * Apache name: MasonIgnoreWarningsExpr
=item * Type in httpd.conf: regex
=item * Default: qr/Subroutine .* redefined/i
=item * Belongs to: L<HTML::Mason::Interp|HTML::Mason::Interp>
=back
Regular expression indicating which warnings to ignore when loading
components. Any warning that is not ignored will prevent the
component from being loaded and executed. For example:
ignore_warnings_expr =>
'Global symbol.*requires explicit package'
If set to undef, all warnings are heeded. If set to '.', warnings
are turned off completely as a specially optimized case.
By default, this is set to 'Subroutine .* redefined'. This allows you
to declare global subroutines inside <%once> sections and not receive
an error when the component is reloaded.
=head2 in_package
=over 4
=item * Perl name: in_package
=item * Apache name: MasonInPackage
=item * Type in httpd.conf: string
=item * Default: HTML::Mason::Commands
=item * Belongs to: L<HTML::Mason::Compiler::ToObject|HTML::Mason::Compiler::ToObject>
=back
This is the package in which a component's code is executed. For
historical reasons, this defaults to C<HTML::Mason::Commands>.
=head2 interp_class
=over 4
=item * Perl name: interp_class
=item * Apache name: MasonInterpClass
=item * Type in httpd.conf: string
=item * Default: HTML::Mason::Interp
=item * Belongs to: L<HTML::Mason::ApacheHandler|HTML::Mason::ApacheHandler>
=back
The class to use when creating a interpreter. Defaults to
L<HTML::Mason::Interp|HTML::Mason::Interp>.
=head2 lexer_class
=over 4
=item * Perl name: lexer_class
=item * Apache name: MasonLexerClass
=item * Type in httpd.conf: string
=item * Default: HTML::Mason::Lexer
=item * Belongs to: L<HTML::Mason::Compiler|HTML::Mason::Compiler>
=back
The class to use when creating a lexer. Defaults to L<HTML::Mason::Lexer|HTML::Mason::Lexer>.
=head2 max_recurse
=over 4
=item * Perl name: max_recurse
=item * Apache name: MasonMaxRecurse
=item * Type in httpd.conf: string
=item * Default: 32
=item * Belongs to: L<HTML::Mason::Request|HTML::Mason::Request>
=back
The maximum recursion depth for the component stack, for the request
stack, and for the inheritance stack. An error is signalled if the
maximum is exceeded. Default is 32.
=head2 out_method
=over 4
=item * Perl name: out_method
=item * Apache name: MasonOutMethod
=item * Type in httpd.conf: code
=item * Default: Print to STDOUT
=item * Belongs to: L<HTML::Mason::Request|HTML::Mason::Request>
=back
Indicates where to send output. If out_method is a reference to a
scalar, output is appended to the scalar. If out_method is a
reference to a subroutine, the subroutine is called with each output
string. For example, to send output to a file called "mason.out":
my $fh = new IO::File ">mason.out";
...
out_method => sub { $fh->print($_[0]) }
By default, out_method prints to standard output. Under
L<Apache|HTML::Mason::ApacheHandler>, standard output is
redirected to C<< $r->print >>.
=head2 postamble
=over 4
=item * Perl name: postamble
=item * Apache name: MasonPostamble
=item * Type in httpd.conf: string
=item * Default: None
=item * Belongs to: L<HTML::Mason::Compiler::ToObject|HTML::Mason::Compiler::ToObject>
=back
Text given for this parameter is placed at the end of each component. See also L<preamble|HTML::Mason::Params/preamble>.
=head2 postprocess_perl
=over 4
=item * Perl name: postprocess_perl
=item * Apache name: MasonPostprocessPerl
=item * Type in httpd.conf: code
=item * Default: None
=item * Belongs to: L<HTML::Mason::Compiler|HTML::Mason::Compiler>
=back
Sub reference that is called to postprocess the Perl portion of a
compiled component, just before it is assembled into its final
subroutine form. The sub is called with a single parameter, a scalar
reference to the Perl portion of the component. The sub is expected
to process the string in-place. See also
L<preprocess|HTML::Mason::Params/preprocess> and L<postprocess_text|HTML::Mason::Params/postprocess_text>.
=head2 postprocess_text
=over 4
=item * Perl name: postprocess_text
=item * Apache name: MasonPostprocessText
=item * Type in httpd.conf: code
=item * Default: None
=item * Belongs to: L<HTML::Mason::Compiler|HTML::Mason::Compiler>
=back
Sub reference that is called to postprocess the text portion of a
compiled component, just before it is assembled into its final
subroutine form. The sub is called with a single parameter, a scalar
reference to the text portion of the component. The sub is expected
to process the string in-place. See also
L<preprocess|HTML::Mason::Params/preprocess> and L<postprocess_perl|HTML::Mason::Params/postprocess_perl>.
=head2 preamble
=over 4
=item * Perl name: preamble
=item * Apache name: MasonPreamble
=item * Type in httpd.conf: string
=item * Default: None
=item * Belongs to: L<HTML::Mason::Compiler::ToObject|HTML::Mason::Compiler::ToObject>
=back
Text given for this parameter is placed at the beginning of each component. See also L<postamble|HTML::Mason::Params/postamble>.
=head2 preloads
=over 4
=item * Perl name: preloads
=item * Apache name: MasonPreloads
=item * Type in httpd.conf: list
=item * Default: None
=item * Belongs to: L<HTML::Mason::Interp|HTML::Mason::Interp>
=back
A list of component paths, optionally with glob wildcards, to load
when the interpreter initializes. e.g.
preloads => ['/foo/index.html','/bar/*.pl']
Default is the empty list. For maximum performance, this should only
be used for components that are frequently viewed and rarely updated.
See the L<preloading components|HTML::Mason::Admin/preloading components> section of the administrator's manual for further details.
As mentioned in the developer's manual, a component's C<< <%once> >>
section is executed when it is loaded. For preloaded components, this
means that this section will be executed before a Mason or Apache
request exist, so preloading a component that uses C<$m> or C<$r> in a
C<< <%once> >> section will fail.
=head2 preprocess
=over 4
=item * Perl name: preprocess
=item * Apache name: MasonPreprocess
=item * Type in httpd.conf: code
=item * Default: None
=item * Belongs to: L<HTML::Mason::Compiler|HTML::Mason::Compiler>
=back
Sub reference that is called to preprocess each component before the compiler does
it's magic. The sub is called with a single parameter, a scalar reference
to the script. The sub is expected to process the script in-place. This is
one way to extend the HTML::Mason syntax with new tags, etc., although a much
more flexible way is to subclass the Lexer or Compiler class. See also
L<postprocess_text|HTML::Mason::Params/postprocess_text> and L<postprocess_perl|HTML::Mason::Params/postprocess_perl>.
=head2 request_class
=over 4
=item * Perl name: request_class
=item * Apache name: MasonRequestClass
=item * Type in httpd.conf: string
=item * Default: HTML::Mason::Request
=item * Belongs to: L<HTML::Mason::Interp|HTML::Mason::Interp>
=back
The class to use when creating requests. Defaults to
L<HTML::Mason::Request|HTML::Mason::Request>.
=head2 resolver_class
=over 4
=item * Perl name: resolver_class
=item * Apache name: MasonResolverClass
=item * Type in httpd.conf: string
=item * Default: HTML::Mason::Resolver::File
=item * Belongs to: L<HTML::Mason::Interp|HTML::Mason::Interp>
=back
The class to use when creating a resolver. Defaults to