1HTML::Mason::Params(3)User Contributed Perl DocumentationHTML::Mason::Params(3)
2
3
4

NAME

6       HTML::Mason::Params - Mason configuration parameters
7

DESCRIPTION

9       This document lists all of the Mason configuration parameters that are
10       intended to be used by end users.
11

PERL AND APACHE NAMES

13       Each parameter has two names: a Perl version and an Apache version.
14       The Perl version uses "lowercase_with_underscores", while the Apache
15       version uses "StudlyCaps" with a "Mason" prefix. The conversion from
16       one version to the other is otherwise very predictable. For example,
17
18       ·   "autohandler_name" "<-->" "MasonAutohandlerName"
19
20       ·   "comp_root" "<-->" "MasonCompRoot"
21
22       ·   "data_cache_defaults" "<-->" "MasonDataCacheDefaults"
23
24   Where Apache Names Are Used
25       The Apache parameter names are used in the Apache configuration file in
26       an httpd-based configuration.
27
28   Where Perl Names Are Used
29       The Perl parameter names are used from Perl code, i.e. anywhere other
30       than the Apache configuration file. For example,
31
32       ·   In an custom wrapper-based configuration, you can pass most of
33           these parameters to the ApacheHandler constructor.
34
35       ·   In a standalone Mason script, you can pass most of these parameters
36           to the Interp constructor.
37
38       ·   When launching a subrequest, you can pass any of the
39           "HTML::Mason::Request" parameters to make_subrequest.
40

PARAMETERS

42   allow_globals
43       ·   Perl name:           allow_globals
44
45       ·   Apache name:         MasonAllowGlobals
46
47       ·   Type in httpd.conf:  list
48
49       ·   Default:             []
50
51       ·   Belongs to:          "HTML::Mason::Compiler"
52
53       List of variable names, complete with prefix ("$@%"), that you intend
54       to use as globals in components.  Normally global variables are
55       forbidden by "strict", but any variable mentioned in this list is
56       granted a reprieve via a "use vars" statement. For example:
57
58           allow_globals => [qw($DBH %session)]
59
60       In a mod_perl environment, $r (the request object) is automatically
61       added to this list.
62
63   apache_status_title
64       ·   Perl name:           apache_status_title
65
66       ·   Apache name:         MasonApacheStatusTitle
67
68       ·   Type in httpd.conf:  string
69
70       ·   Default:             HTML::Mason status
71
72       ·   Belongs to:          "HTML::Mason::ApacheHandler"
73
74       Title that you want this ApacheHandler to appear as under
75       Apache::Status.  Default is "HTML::Mason status".  This is useful if
76       you create more than one ApacheHandler object and want them all visible
77       via Apache::Status.
78
79   args_method
80       ·   Perl name:           args_method
81
82       ·   Apache name:         MasonArgsMethod
83
84       ·   Type in httpd.conf:  string
85
86       ·   Default:             mod_perl
87
88       ·   Belongs to:          "HTML::Mason::ApacheHandler"
89
90       Method to use for unpacking GET and POST arguments. The valid options
91       are 'CGI' and 'mod_perl'; these indicate that a "CGI.pm" or
92       "Apache::Request" object (respectively) will be created for the
93       purposes of argument handling.
94
95       'mod_perl' is the default under mod_perl-1 and requires that you have
96       installed the "Apache::Request" package.  Under mod_perl-2, the default
97       is 'CGI' because "Apache2::Request" is still in development.
98
99       If args_method is 'mod_perl', the $r global is upgraded to an
100       Apache::Request object. This object inherits all Apache methods and
101       adds a few of its own, dealing with parameters and file uploads.  See
102       "Apache::Request" for more information.
103
104       If the args_method is 'CGI', the Mason request object ($m) will have a
105       method called "cgi_object" available.  This method returns the CGI
106       object used for argument processing.
107
108       While Mason will load "Apache::Request" or "CGI" as needed at runtime,
109       it is recommended that you preload the relevant module either in your
110       httpd.conf or handler.pl file, as this will save some memory.
111
112   auto_send_headers
113       ·   Perl name:           auto_send_headers
114
115       ·   Apache name:         MasonAutoSendHeaders
116
117       ·   Type in httpd.conf:  boolean
118
119       ·   Default:             1
120
121       ·   Belongs to:          "HTML::Mason::Request::ApacheHandler"
122
123       True or false, default is true.  Indicates whether Mason should
124       automatically send HTTP headers before sending content back to the
125       client. If you set to false, you should call "$r->send_http_header"
126       manually.
127
128       See the sending HTTP headers section of the developer's manual for more
129       details about the automatic header feature.
130
131       NOTE: This parameter has no effect under mod_perl-2, since calling
132       "$r->send_http_header" is no longer needed.
133
134   autoflush
135       ·   Perl name:           autoflush
136
137       ·   Apache name:         MasonAutoflush
138
139       ·   Type in httpd.conf:  boolean
140
141       ·   Default:             0
142
143       ·   Belongs to:          "HTML::Mason::Request"
144
145       True or false, default is false. Indicates whether to flush the output
146       buffer ("$m->flush_buffer") after every string is output. Turn on
147       autoflush if you need to send partial output to the client, for example
148       in a progress meter.
149
150       As of Mason 1.3, autoflush will only work if enable_autoflush has been
151       set.  Components can be compiled more efficiently if they don't have to
152       check for autoflush. Before using autoflush you might consider whether
153       a few manual "$m->flush_buffer" calls would work nearly as well.
154
155   autohandler_name
156       ·   Perl name:           autohandler_name
157
158       ·   Apache name:         MasonAutohandlerName
159
160       ·   Type in httpd.conf:  string
161
162       ·   Default:             autohandler
163
164       ·   Belongs to:          "HTML::Mason::Interp"
165
166       File name used for autohandlers. Default is "autohandler".  If this is
167       set to an empty string ("") then autohandlers are turned off entirely.
168
169   buffer_preallocate_size
170       ·   Perl name:           buffer_preallocate_size
171
172       ·   Apache name:         MasonBufferPreallocateSize
173
174       ·   Type in httpd.conf:  string
175
176       ·   Default:             0
177
178       ·   Belongs to:          "HTML::Mason::Interp"
179
180       Number of bytes to preallocate in the output buffer for each request.
181       Defaults to 0. Setting this to, say, your maximum page size (or close
182       to it) can reduce the number of reallocations Perl performs as
183       components add to the output buffer.
184
185   code_cache_max_size
186       ·   Perl name:           code_cache_max_size
187
188       ·   Apache name:         MasonCodeCacheMaxSize
189
190       ·   Type in httpd.conf:  string
191
192       ·   Default:             unlimited
193
194       ·   Belongs to:          "HTML::Mason::Interp"
195
196       Specifies the maximum number of components that should be held in the
197       in-memory code cache. The default is 'unlimited', meaning no components
198       will ever be discarded; Mason can perform certain optimizations in this
199       mode. Setting this to zero disables the code cache entirely. See the
200       code cache section of the administrator's manual for further details.
201
202   comp_class
203       ·   Perl name:           comp_class
204
205       ·   Apache name:         MasonCompClass
206
207       ·   Type in httpd.conf:  string
208
209       ·   Default:             HTML::Mason::Component
210
211       ·   Belongs to:          "HTML::Mason::Compiler::ToObject"
212
213       The class into which component objects are blessed.  This defaults to
214       HTML::Mason::Component.
215
216   comp_root
217       ·   Perl name:           comp_root
218
219       ·   Apache name:         MasonCompRoot
220
221       ·   Type in httpd.conf:  list
222
223       ·   Default:             Varies
224
225       ·   Belongs to:          "HTML::Mason::Interp"
226
227       The component root marks the top of your component hierarchy and
228       defines how component paths are translated into real file paths. For
229       example, if your component root is /usr/local/httpd/docs, a component
230       path of /products/index.html translates to the file
231       /usr/local/httpd/docs/products/index.html.
232
233       Under Apache and CGI, comp_root defaults to the server's document root.
234       In standalone mode comp_root defaults to the current working directory.
235
236       This parameter may be either a scalar or an array reference.  If it is
237       a scalar, it should be a filesystem path indicating the component root.
238       If it is an array reference, it should be of the following form:
239
240        [ [ foo => '/usr/local/foo' ],
241          [ bar => '/usr/local/bar' ] ]
242
243       This is an array of two-element array references, not a hash.  The
244       "keys" for each path must be unique and their "values" must be
245       filesystem paths.  These paths will be searched in the provided order
246       whenever a component path is resolved. For example, given the above
247       component roots and a component path of /products/index.html, Mason
248       would search first for /usr/local/foo/products/index.html, then for
249       /usr/local/bar/products/index.html.
250
251       The keys are used in several ways. They help to distinguish component
252       caches and object files between different component roots, and they
253       appear in the "title()" of a component.
254
255       When you specify a single path for a component root, this is actually
256       translated into
257
258         [ [ MAIN => path ] ]
259
260       If you have turned on dynamic_comp_root, you may modify the component
261       root(s) of an interpreter between requests by calling
262       "$interp->comp_root" with a value. However, the path associated with
263       any given key may not change between requests. For example, if the
264       initial component root is
265
266        [ [ foo => '/usr/local/foo' ],
267          [ bar => '/usr/local/bar' ], ]
268
269       then it may not be changed to
270
271        [ [ foo => '/usr/local/bar' ],
272          [ bar => '/usr/local/baz' ],
273
274       but it may be changed to
275
276        [ [ foo   => '/usr/local/foo' ],
277          [ blarg => '/usr/local/blarg' ] ]
278
279       In other words, you may add or remove key/path pairs but not modify an
280       already-used key/path pair. The reason for this restriction is that the
281       interpreter maintains a component cache per key that would become
282       invalid if the associated paths were to change.
283
284   compiler_class
285       ·   Perl name:           compiler_class
286
287       ·   Apache name:         MasonCompilerClass
288
289       ·   Type in httpd.conf:  string
290
291       ·   Default:             HTML::Mason::Compiler::ToObject
292
293       ·   Belongs to:          "HTML::Mason::Interp"
294
295       The class to use when creating a compiler. Defaults to
296       HTML::Mason::Compiler::ToObject.
297
298   component_error_handler
299       ·   Perl name:           component_error_handler
300
301       ·   Apache name:         MasonComponentErrorHandler
302
303       ·   Type in httpd.conf:  code
304
305       ·   Default:             sub { package HTML::Mason::Exceptions; use
306           warnings; use strict 'refs'; my($err) = @_; return unless $err; if
307           (UNIVERSAL::can($err, 'rethrow')) { $err->rethrow; } elsif (ref
308           $err) { die $err; } 'HTML::Mason::Exception'->throw('error', $err);
309           }
310
311       ·   Belongs to:          "HTML::Mason::Request"
312
313       A code reference used to handle errors thrown during component
314       compilation or runtime. By default, this is a subroutine that turns
315       non-exception object errors in components into exceptions. If this
316       parameter is set to a false value, these errors are simply rethrown as-
317       is.
318
319       Turning exceptions into objects can be expensive, since this will cause
320       the generation of a stack trace for each error. If you are using
321       strings or unblessed references as exceptions in your code, you may
322       want to turn this off as a performance boost.
323
324   data_cache_api
325       ·   Perl name:           data_cache_api
326
327       ·   Apache name:         MasonDataCacheApi
328
329       ·   Type in httpd.conf:  string
330
331       ·   Default:             1.1
332
333       ·   Belongs to:          "HTML::Mason::Request"
334
335       The "$m->cache" API to use:
336
337       ·   '1.1', the default, indicates a "Cache::Cache" based API.
338
339       ·   'chi' indicates a "CHI" based API.
340
341       ·   '1.0' indicates the custom cache API used in Mason 1.0x and
342           earlier. This compatibility layer is provided as a convenience for
343           users upgrading from older versions of Mason, but will not be
344           supported indefinitely.
345
346   data_cache_defaults
347       ·   Perl name:           data_cache_defaults
348
349       ·   Apache name:         MasonDataCacheDefaults
350
351       ·   Type in httpd.conf:  hash_list
352
353       ·   Default:             None
354
355       ·   Belongs to:          "HTML::Mason::Request"
356
357       A hash reference of default options to use for the "$m->cache" command.
358       For example, to use Cache::Cache's "MemoryCache" implementation by
359       default:
360
361           data_cache_defaults => {cache_class => 'MemoryCache'}
362
363       To use the CHI "FastMmap" driver by default:
364
365           data_cache_api      => 'CHI',
366           data_cache_defaults => {driver => 'FastMmap'},
367
368       These settings are overridden by options given to particular
369       "$m->cache" calls.
370
371   data_dir
372       ·   Perl name:           data_dir
373
374       ·   Apache name:         MasonDataDir
375
376       ·   Type in httpd.conf:  string
377
378       ·   Default:             None
379
380       ·   Belongs to:          "HTML::Mason::Interp"
381
382       The data directory is a writable directory that Mason uses for various
383       features and optimizations: for example, component object files and
384       data cache files. Mason will create the directory on startup, if
385       necessary, and set its permissions according to the web server
386       User/Group.
387
388       Under Apache, data_dir defaults to a directory called "mason" under the
389       Apache server root. You will need to change this on certain systems
390       that assign a high-level server root such as /usr!
391
392       In non-Apache environments, data_dir has no default. If it is left
393       unspecified, Mason will not use object files, and the default data
394       cache class will be "MemoryCache" instead of "FileCache".
395
396   decline_dirs
397       ·   Perl name:           decline_dirs
398
399       ·   Apache name:         MasonDeclineDirs
400
401       ·   Type in httpd.conf:  boolean
402
403       ·   Default:             1
404
405       ·   Belongs to:          "HTML::Mason::ApacheHandler"
406
407       True or false, default is true. Indicates whether Mason should decline
408       directory requests, leaving Apache to serve up a directory index or a
409       "FORBIDDEN" error as appropriate. See the allowing directory requests
410       section of the administrator's manual for more information about
411       handling directories with Mason.
412
413   default_escape_flags
414       ·   Perl name:           default_escape_flags
415
416       ·   Apache name:         MasonDefaultEscapeFlags
417
418       ·   Type in httpd.conf:  string
419
420       ·   Default:             []
421
422       ·   Belongs to:          "HTML::Mason::Compiler"
423
424       Escape flags to apply to all <% %> expressions by default. The current
425       valid flags are
426
427           h - escape for HTML ('<' => '&lt;', etc.)
428           u - escape for URL (':' => '%3A', etc.)
429
430       The developer can override default escape flags on a per-expression
431       basis; see the escaping expressions section of the developer's manual.
432
433       If you want to set multiple flags as the default, this should be given
434       as a reference to an array of flags.
435
436   define_args_hash
437       ·   Perl name:           define_args_hash
438
439       ·   Apache name:         MasonDefineArgsHash
440
441       ·   Type in httpd.conf:  string
442
443       ·   Default:             auto
444
445       ·   Belongs to:          "HTML::Mason::Compiler::ToObject"
446
447       One of "always", "auto", or "never".  This determines whether or not an
448       %ARGS hash is created in components.  If it is set to "always", one is
449       always defined.  If set to "never", it is never defined.
450
451       The default, "auto", will cause the hash to be defined only if some
452       part of the component contains the string "ARGS".  This is somewhat
453       crude, and may result in some false positives, but this is preferable
454       to false negatives.
455
456       Not defining the args hash means that we can avoid copying component
457       arguments, which can save memory and slightly improve execution speed.
458
459   dhandler_name
460       ·   Perl name:           dhandler_name
461
462       ·   Apache name:         MasonDhandlerName
463
464       ·   Type in httpd.conf:  string
465
466       ·   Default:             dhandler
467
468       ·   Belongs to:          "HTML::Mason::Request"
469
470       File name used for dhandlers. Default is "dhandler".  If this is set to
471       an empty string ("") then dhandlers are turned off entirely.
472
473   dynamic_comp_root
474       ·   Perl name:           dynamic_comp_root
475
476       ·   Apache name:         MasonDynamicCompRoot
477
478       ·   Type in httpd.conf:  boolean
479
480       ·   Default:             0
481
482       ·   Belongs to:          "HTML::Mason::Interp"
483
484       True or false, defaults to false. Indicates whether the comp_root can
485       be modified on this interpreter between requests. Mason can perform a
486       few optimizations with a fixed component root, so you should only set
487       this to true if you actually need it.
488
489   enable_autoflush
490       ·   Perl name:           enable_autoflush
491
492       ·   Apache name:         MasonEnableAutoflush
493
494       ·   Type in httpd.conf:  boolean
495
496       ·   Default:             1
497
498       ·   Belongs to:          "HTML::Mason::Compiler"
499
500       True or false, default is true. Indicates whether components are
501       compiled with support for autoflush. The component can be compiled to a
502       more efficient form if it does not have to check for autoflush mode, so
503       you should set this to 0 if you can.
504
505   error_format
506       ·   Perl name:           error_format
507
508       ·   Apache name:         MasonErrorFormat
509
510       ·   Type in httpd.conf:  string
511
512       ·   Default:             Varies
513
514       ·   Belongs to:          "HTML::Mason::Request"
515
516       Indicates how errors are formatted. The built-in choices are
517
518       ·   brief - just the error message with no trace information
519
520       ·   text - a multi-line text format
521
522       ·   line - a single-line text format, with different pieces of
523           information separated by tabs (useful for log files)
524
525       ·   html - a fancy html format
526
527       The default format under Apache and CGI is either line or html
528       depending on whether the error mode is fatal or output, respectively.
529       The default for standalone mode is text.
530
531       The formats correspond to "HTML::Mason::Exception" methods named
532       as_format. You can define your own format by creating an appropriately
533       named method; for example, to define an "xml" format, create a method
534       "HTML::Mason::Exception::as_xml" patterned after one of the built-in
535       methods.
536
537   error_mode
538       ·   Perl name:           error_mode
539
540       ·   Apache name:         MasonErrorMode
541
542       ·   Type in httpd.conf:  string
543
544       ·   Default:             Varies
545
546       ·   Belongs to:          "HTML::Mason::Request"
547
548       Indicates how errors are returned to the caller.  The choices are
549       fatal, meaning die with the error, and output, meaning output the error
550       just like regular output.
551
552       The default under Apache and CGI is output, causing the error to be
553       displayed in the browser.  The default for standalone mode is fatal.
554
555   escape_flags
556       ·   Perl name:           escape_flags
557
558       ·   Apache name:         MasonEscapeFlags
559
560       ·   Type in httpd.conf:  hash_list
561
562       ·   Default:             None
563
564       ·   Belongs to:          "HTML::Mason::Interp"
565
566       A hash reference of escape flags to set for this object.  See the
567       section on the set_escape method for more details.
568
569   ignore_warnings_expr
570       ·   Perl name:           ignore_warnings_expr
571
572       ·   Apache name:         MasonIgnoreWarningsExpr
573
574       ·   Type in httpd.conf:  regex
575
576       ·   Default:             qr/Subroutine .* redefined/i
577
578       ·   Belongs to:          "HTML::Mason::Interp"
579
580       Regular expression indicating which warnings to ignore when loading
581       components. Any warning that is not ignored will prevent the component
582       from being loaded and executed. For example:
583
584           ignore_warnings_expr =>
585               'Global symbol.*requires explicit package'
586
587       If set to undef, all warnings are heeded. If set to '.', warnings are
588       turned off completely as a specially optimized case.
589
590       By default, this is set to 'Subroutine .* redefined'.  This allows you
591       to declare global subroutines inside <%once> sections and not receive
592       an error when the component is reloaded.
593
594   in_package
595       ·   Perl name:           in_package
596
597       ·   Apache name:         MasonInPackage
598
599       ·   Type in httpd.conf:  string
600
601       ·   Default:             HTML::Mason::Commands
602
603       ·   Belongs to:          "HTML::Mason::Compiler::ToObject"
604
605       This is the package in which a component's code is executed.  For
606       historical reasons, this defaults to "HTML::Mason::Commands".
607
608   interp_class
609       ·   Perl name:           interp_class
610
611       ·   Apache name:         MasonInterpClass
612
613       ·   Type in httpd.conf:  string
614
615       ·   Default:             HTML::Mason::Interp
616
617       ·   Belongs to:          "HTML::Mason::ApacheHandler"
618
619       The class to use when creating a interpreter. Defaults to
620       HTML::Mason::Interp.
621
622   lexer_class
623       ·   Perl name:           lexer_class
624
625       ·   Apache name:         MasonLexerClass
626
627       ·   Type in httpd.conf:  string
628
629       ·   Default:             HTML::Mason::Lexer
630
631       ·   Belongs to:          "HTML::Mason::Compiler"
632
633       The class to use when creating a lexer. Defaults to HTML::Mason::Lexer.
634
635   max_recurse
636       ·   Perl name:           max_recurse
637
638       ·   Apache name:         MasonMaxRecurse
639
640       ·   Type in httpd.conf:  string
641
642       ·   Default:             32
643
644       ·   Belongs to:          "HTML::Mason::Request"
645
646       The maximum recursion depth for the component stack, for the request
647       stack, and for the inheritance stack. An error is signalled if the
648       maximum is exceeded.  Default is 32.
649
650   named_component_subs
651       ·   Perl name:           named_component_subs
652
653       ·   Apache name:         MasonNamedComponentSubs
654
655       ·   Type in httpd.conf:  boolean
656
657       ·   Default:             0
658
659       ·   Belongs to:          "HTML::Mason::Compiler::ToObject"
660
661       When compiling a component, use uniquely named subroutines for the a
662       component's body, subcomponents, and methods. Doing this allows you to
663       effectively profile Mason components. Without this, all components
664       simply show up as __ANON__ or something similar in the profiler.
665
666   object_file_extension
667       ·   Perl name:           object_file_extension
668
669       ·   Apache name:         MasonObjectFileExtension
670
671       ·   Type in httpd.conf:  string
672
673       ·   Default:             .obj
674
675       ·   Belongs to:          "HTML::Mason::Interp"
676
677       Extension to add to the end of object files. Default is ".obj".
678
679   out_method
680       ·   Perl name:           out_method
681
682       ·   Apache name:         MasonOutMethod
683
684       ·   Type in httpd.conf:  code
685
686       ·   Default:             Print to STDOUT
687
688       ·   Belongs to:          "HTML::Mason::Request"
689
690       Indicates where to send output. If out_method is a reference to a
691       scalar, output is appended to the scalar.  If out_method is a reference
692       to a subroutine, the subroutine is called with each output string. For
693       example, to send output to a file called "mason.out":
694
695           my $fh = new IO::File ">mason.out";
696           ...
697           out_method => sub { $fh->print($_[0]) }
698
699       By default, out_method prints to standard output. Under Apache,
700       standard output is redirected to "$r->print".
701
702   plugins
703       ·   Perl name:           plugins
704
705       ·   Apache name:         MasonPlugins
706
707       ·   Type in httpd.conf:  list
708
709       ·   Default:             []
710
711       ·   Belongs to:          "HTML::Mason::Request"
712
713       An array of plugins that will be called at various stages of request
714       processing.  Please see HTML::Mason::Plugin for details.
715
716   postamble
717       ·   Perl name:           postamble
718
719       ·   Apache name:         MasonPostamble
720
721       ·   Type in httpd.conf:  string
722
723       ·   Default:             None
724
725       ·   Belongs to:          "HTML::Mason::Compiler::ToObject"
726
727       Text given for this parameter is placed at the end of each component.
728       See also preamble.  The request will be available as $m in postamble
729       code.
730
731   postprocess_perl
732       ·   Perl name:           postprocess_perl
733
734       ·   Apache name:         MasonPostprocessPerl
735
736       ·   Type in httpd.conf:  code
737
738       ·   Default:             None
739
740       ·   Belongs to:          "HTML::Mason::Compiler"
741
742       Sub reference that is called to postprocess the Perl portion of a
743       compiled component, just before it is assembled into its final
744       subroutine form.  The sub is called with a single parameter, a scalar
745       reference to the Perl portion of the component.  The sub is expected to
746       process the string in-place. See also preprocess and postprocess_text.
747
748   postprocess_text
749       ·   Perl name:           postprocess_text
750
751       ·   Apache name:         MasonPostprocessText
752
753       ·   Type in httpd.conf:  code
754
755       ·   Default:             None
756
757       ·   Belongs to:          "HTML::Mason::Compiler"
758
759       Sub reference that is called to postprocess the text portion of a
760       compiled component, just before it is assembled into its final
761       subroutine form.  The sub is called with a single parameter, a scalar
762       reference to the text portion of the component.  The sub is expected to
763       process the string in-place. See also preprocess and postprocess_perl.
764
765   preamble
766       ·   Perl name:           preamble
767
768       ·   Apache name:         MasonPreamble
769
770       ·   Type in httpd.conf:  string
771
772       ·   Default:             None
773
774       ·   Belongs to:          "HTML::Mason::Compiler::ToObject"
775
776       Text given for this parameter is placed at the beginning of each
777       component, but after the execution of any "<%once>" block. See also
778       postamble. The request will be available as $m in preamble code.
779
780   preloads
781       ·   Perl name:           preloads
782
783       ·   Apache name:         MasonPreloads
784
785       ·   Type in httpd.conf:  list
786
787       ·   Default:             None
788
789       ·   Belongs to:          "HTML::Mason::Interp"
790
791       A list of component paths, optionally with glob wildcards, to load when
792       the interpreter initializes. e.g.
793
794           preloads => ['/foo/index.html','/bar/*.pl']
795
796       Default is the empty list.  For maximum performance, this should only
797       be used for components that are frequently viewed and rarely updated.
798       See the preloading components section of the administrator's manual for
799       further details.
800
801       As mentioned in the developer's manual, a component's "<%once>" section
802       is executed when it is loaded.  For preloaded components, this means
803       that this section will be executed before a Mason or Apache request
804       exist, so preloading a component that uses $m or $r in a "<%once>"
805       section will fail.
806
807   preprocess
808       ·   Perl name:           preprocess
809
810       ·   Apache name:         MasonPreprocess
811
812       ·   Type in httpd.conf:  code
813
814       ·   Default:             None
815
816       ·   Belongs to:          "HTML::Mason::Compiler"
817
818       Sub reference that is called to preprocess each component before the
819       compiler does it's magic.  The sub is called with a single parameter, a
820       scalar reference to the script.  The sub is expected to process the
821       script in-place.   This is one way to extend the HTML::Mason syntax
822       with new tags, etc., although a much more flexible way is to subclass
823       the Lexer or Compiler class. See also postprocess_text and
824       postprocess_perl.
825
826   request_class
827       ·   Perl name:           request_class
828
829       ·   Apache name:         MasonRequestClass
830
831       ·   Type in httpd.conf:  string
832
833       ·   Default:             HTML::Mason::Request
834
835       ·   Belongs to:          "HTML::Mason::Interp"
836
837       The class to use when creating requests. Defaults to
838       HTML::Mason::Request.
839
840   resolver_class
841       ·   Perl name:           resolver_class
842
843       ·   Apache name:         MasonResolverClass
844
845       ·   Type in httpd.conf:  string
846
847       ·   Default:             HTML::Mason::Resolver::File
848
849       ·   Belongs to:          "HTML::Mason::Interp"
850
851       The class to use when creating a resolver. Defaults to
852       HTML::Mason::Resolver::File.
853
854   static_source
855       ·   Perl name:           static_source
856
857       ·   Apache name:         MasonStaticSource
858
859       ·   Type in httpd.conf:  boolean
860
861       ·   Default:             0
862
863       ·   Belongs to:          "HTML::Mason::Interp"
864
865       True or false, default is false. When false, Mason checks the timestamp
866       of the component source file each time the component is used to see if
867       it has changed. This provides the instant feedback for source changes
868       that is expected for development.  However it does entail a file stat
869       for each component executed.
870
871       When true, Mason assumes that the component source tree is unchanging:
872       it will not check component source files to determine if the memory
873       cache or object file has expired.  This can save many file stats per
874       request. However, in order to get Mason to recognize a component source
875       change, you must flush the memory cache and remove object files.  See
876       static_source_touch_file for one easy way to arrange this.
877
878       We recommend turning this mode on in your production sites if possible,
879       if performance is of any concern.
880
881   static_source_touch_file
882       ·   Perl name:           static_source_touch_file
883
884       ·   Apache name:         MasonStaticSourceTouchFile
885
886       ·   Type in httpd.conf:  string
887
888       ·   Default:             None
889
890       ·   Belongs to:          "HTML::Mason::Interp"
891
892       Specifies a filename that Mason will check once at the beginning of of
893       every request. When the file timestamp changes, Mason will (1) clear
894       its in-memory component cache, and (2) remove object files if they have
895       not already been deleted by another process.
896
897       This provides a convenient way to implement static_source mode.  All
898       you need to do is make sure that a single file gets touched whenever
899       components change. For Mason's part, checking a single file at the
900       beginning of a request is much cheaper than checking every component
901       file when static_source=0.
902
903   subcomp_class
904       ·   Perl name:           subcomp_class
905
906       ·   Apache name:         MasonSubcompClass
907
908       ·   Type in httpd.conf:  string
909
910       ·   Default:             HTML::Mason::Component::Subcomponent
911
912       ·   Belongs to:          "HTML::Mason::Compiler::ToObject"
913
914       The class into which subcomponent objects are blessed.  This defaults
915       to HTML::Mason::Component::Subcomponent.
916
917   use_object_files
918       ·   Perl name:           use_object_files
919
920       ·   Apache name:         MasonUseObjectFiles
921
922       ·   Type in httpd.conf:  boolean
923
924       ·   Default:             1
925
926       ·   Belongs to:          "HTML::Mason::Interp"
927
928       True or false, default is true.  Specifies whether Mason creates object
929       files to save the results of component parsing. You may want to turn
930       off object files for disk space reasons, but otherwise this should be
931       left alone.
932
933   use_source_line_numbers
934       ·   Perl name:           use_source_line_numbers
935
936       ·   Apache name:         MasonUseSourceLineNumbers
937
938       ·   Type in httpd.conf:  boolean
939
940       ·   Default:             1
941
942       ·   Belongs to:          "HTML::Mason::Compiler"
943
944       True or false, default is true. Indicates whether component line
945       numbers that appear in error messages, stack traces, etc. are in terms
946       of the source file instead of the object file. Mason does this by
947       inserting '#line' directives into compiled components.  While source
948       line numbers are more immediately helpful, object file line numbers may
949       be more appropriate for in-depth debugging sessions.
950
951   use_strict
952       ·   Perl name:           use_strict
953
954       ·   Apache name:         MasonUseStrict
955
956       ·   Type in httpd.conf:  boolean
957
958       ·   Default:             1
959
960       ·   Belongs to:          "HTML::Mason::Compiler::ToObject"
961
962       True or false, default is true. Indicates whether or not a given
963       component should "use strict".
964
965   use_warnings
966       ·   Perl name:           use_warnings
967
968       ·   Apache name:         MasonUseWarnings
969
970       ·   Type in httpd.conf:  boolean
971
972       ·   Default:             1
973
974       ·   Belongs to:          "HTML::Mason::Compiler::ToObject"
975
976       True or false, default is false. Indicates whether or not a given
977       component should "use warnings".
978
979
980
981perl v5.30.0                      2019-07-26            HTML::Mason::Params(3)
Impressum