=head1 NAME
ModPerl::RegistryCooker - Cook mod_perl 2.0 Registry Modules
=head1 Synopsis
# shouldn't be used as-is but sub-classed first
# see ModPerl::Registry for an example
=head1 Description
C is used to create flexible and overridable
registry modules which emulate mod_cgi for Perl scripts. The concepts
are discussed in the manpage of the following modules:
C>, C> and
C>.
C has two purposes:
=over
=item *
Provide ingredients that can be used by registry sub-classes
=item *
Provide a default behavior, which can be overriden in sub-classed
META: in the future this functionality may move into a separate class.
=back
Here are the current overridable methods:
META: these are all documented in RegistryCooker.pm, though not using
pod. please help to port these to pod and move the descriptions here.
=over
=item * new()
create the class's object, bless it and return it
my $obj = $class->new($r);
C<$class> -- the registry class, usually C<__PACKAGE__> can be used.
C<$r> -- C object.
default: new()
=item * init()
initializes the data object's fields: C, C,
C. Called from the new().
default: init()
=item * default_handler()
default: default_handler()
=item * run()
default: run()
=item * can_compile()
default: can_compile()
=item * make_namespace()
default: make_namespace()
=item * namespace_root()
default: namespace_root()
=item * namespace_from()
If C is used and the script is called from the
virtual host, by default the virtual host name is prepended to the uri
when package name for the compiled script is created. Sometimes this
behavior is undesirable, e.g., when the same (physical) script is
accessed using the same path_info but different virtual hosts. In that
case you can make the script compiled only once for all vhosts, by
specifying:
$ModPerl::RegistryCooker::NameWithVirtualHost = 0;
The drawback is that it affects the global environment and all other
scripts will be compiled ignoring virtual hosts.
default: namespace_from()
=item * is_cached()
default: is_cached()
=item * should_compile()
default: should_compile()
=item * flush_namespace()
default: flush_namespace()
=item * cache_table()
default: cache_table()
=item * cache_it()
default: cache_it()
=item * read_script()
default: read_script()
=item * shebang_to_perl()
default: shebang_to_perl()
=item * get_script_name()
default: get_script_name()
=item * chdir_file()
default: chdir_file()
=item * get_mark_line()
default: get_mark_line()
=item * compile()
default: compile()
=item * error_check()
default: error_check()
=item * strip_end_data_segment()
default: strip_end_data_segment()
=item * convert_script_to_compiled_handler()
default: convert_script_to_compiled_handler()
=back
=head2 Special Predefined Functions
The following functions are implemented as constants.
=over
=item * NOP()
Use when the function shouldn't do anything.
=item * TRUE()
Use when a function should always return a true value.
=item * FALSE()
Use when a function should always return a false value.
=back
=head1 Sub-classing Techniques
To override the default C methods, first,
sub-class C or one of its existing
sub-classes, using C