stas 2002/12/29 02:09:10 Modified: src/docs/2.0/api/ModPerl-Registry/ModPerl RegistryCooker.pod RegistryLoader.pod Log: update the registry docs, to sync with the recent code changes Revision Changes Path 1.5 +13 -0 modperl-docs/src/docs/2.0/api/ModPerl-Registry/ModPerl/RegistryCooker.pod Index: RegistryCooker.pod =================================================================== RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/ModPerl-Registry/ModPerl/RegistryCooker.pod,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- RegistryCooker.pod 28 Dec 2002 07:39:28 -0000 1.4 +++ RegistryCooker.pod 29 Dec 2002 10:09:10 -0000 1.5 @@ -80,6 +80,19 @@ =item * namespace_from() +If C<namespace_from_uri> 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() 1.3 +41 -11 modperl-docs/src/docs/2.0/api/ModPerl-Registry/ModPerl/RegistryLoader.pod Index: RegistryLoader.pod =================================================================== RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/ModPerl-Registry/ModPerl/RegistryLoader.pod,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- RegistryLoader.pod 28 Dec 2002 07:39:28 -0000 1.2 +++ RegistryLoader.pod 29 Dec 2002 10:09:10 -0000 1.3 @@ -2,7 +2,7 @@ ModPerl::RegistryLoader - Compile ModPerl::RegistryCooker scripts at server startup -=head1 SYNOPSIS +=head1 Synopsis # in startup.pl use ModPerl::RegistryLoader (); @@ -14,7 +14,8 @@ ); $rlbb->handler($uri, $filename); - + + ### # uri => filename mapping using a helper function sub trans { my $uri = shift; @@ -26,9 +27,12 @@ trans => \&trans, ); $rl->handler($uri); + + ### + $rlbb->handler($uri, $filename, $virtual_hostname); -=head1 DESCRIPTION +=head1 Description This modules allows compilation of scripts, running under packages derived from C<ModPerl::RegistryCooker>, at server startup. The @@ -37,7 +41,11 @@ the compiled copy with the parent and saving the overhead of script's compilation on the first request in every httpd instance. -=head1 METHODS +This module is of course useless for those running the +C<L<ModPerl::PerlRun>> handler, because the scripts get recompiled on +each request under this handler. + +=head1 Methods =over @@ -76,10 +84,10 @@ =item handler() - $rl->handler($uri, [$filename]); + $rl->handler($uri, [$filename, [$virtual_hostname]]); The handler() method takes argument of C<uri> and optionally of -C<filename>. +C<filename> and of C<virtual_hostname>. URI to filename translation normally doesn't happen until HTTP request time, so we're forced to roll our own translation. If the filename is @@ -143,16 +151,38 @@ } } +If C<$virtual_hostname> argument is passed it'll be used in the +creation of the package name the script will be compiled into for +those registry handlers that use I<namespace_from_uri()> method. See +also the notes on C<$ModPerl::RegistryCooker::NameWithVirtualHost> in +the C<L<ModPerl::RegistryCooker>> documentation. + +Also +explained in the C<L<ModPerl::RegistryLoader>> documentation, this +only has an effect at run time if +C<$ModPerl::RegistryCooker::NameWithVirtualHost> is set to true, +otherwise the C<$virtual_hostname> argument is ignored. + =back -=head1 AUTHORS +=head1 Implementation Notes -Doug MacEachern +C<ModPerl::RegistryLoader> performs a very simple job, at run time it +loads and sub-classes the module passed via the I<package> attribute +and overrides some of its functions, to emulate the run-time +environment. This allows to preload the same script into different +registry environments. -Stas Bekman +=head1 Authors -=head1 SEE ALSO +The original C<Apache::RegistryLoader> implemented by Doug MacEachern. -ModPerl::RegistryCooker(3), Apache(3), mod_perl(3) +Stas Bekman did the porting to the new registry framework based on +C<ModPerl::RegistryLoader>. + +=head1 SEE ALSO +C<L<ModPerl::RegistryCooker>>, C<L<ModPerl::Registry>>, +C<L<ModPerl::RegistryBB>>, C<L<ModPerl::PerlRun>>, Apache(3), +mod_perl(3)
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]