You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2002/08/15 14:45:31 UTC

Re: ModPerl::Registry root

Doug MacEachern wrote:
> On Wed, 29 May 2002, Stas Bekman wrote:
> 
> 
>>>if a subclass wants to keep the cache in its own package, it can do:
>>
>>but then it ends up not under 1 "root"
> 
> 
> right.  difference is, the subclass defined that behavior.  currently it 
> is not possible for a subclass to define where the cache lives.
>  
> 
>>Also to avoid confusion, I'd rather stay in ModPerl:: namespace, so my 
>>best choice is ModPerl::RegistryCache.
> 
> 
> that's fine.  so long as one can subclass to change the default to 
> whatever they choose.

It's done now. The core Registry packages all compile the scripts into 
ModPerl::RegistryROOT:: namespace and cache them in 
%ModPerl::RegistryCache. Both overridable by the sub-classes.


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: ModPerl::Registry root

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
> 
>> It's done now. The core Registry packages all compile the scripts into 
>> ModPerl::RegistryROOT:: namespace and cache them in 
>> %ModPerl::RegistryCache. Both overridable by the sub-classes.
> 
> 
> What I don't like about this change is that it's now impossible to use 
> two different registry modules to cache the same script. (of course 
> unless these modules override the default cache symbol table)
> e.g. I try to use RegistryLoader on the same script with different 
> registry modules and of course the second load will be skipped given 
> that the two compile to the same package name.

As I was afraid a single namespace for all compiled packaged proved to 
be a bad idea when using more than one registry handler on the same 
filename, since all sort of collissions started to happen. Therefore 
I've resorted to the following solution:

- all packages are compiled into:

join '::', 'ModPerl::ROOT', ref($self), $path_to_string

so now the same script /home/httpd/cgi-bin/env.pl gets compiled into:

ModPerl::ROOT::ModPerl::RegistryBB::home_httpd_cgi_2dbin_env_2epl
ModPerl::ROOT::ModPerl::Registry::home_httpd_cgi_2dbin_env_2epl
ModPerl::ROOT::ModPerl::RegistryFoo::home_httpd_cgi_2dbin_env_2epl

Should we kill the extra :: to make things a bit faster? As in

ModPerl::ROOT::ModPerl__RegistryBB_home_httpd_cgi_2dbin_env_2epl
ModPerl::ROOT::ModPerl__Registry_home_httpd_cgi_2dbin_env_2epl
ModPerl::ROOT::ModPerl__RegistryFoo_home_httpd_cgi_2dbin_env_2epl

I suppose that keeping the distinction between the registry handler and 
the script's path, will allow us to group the scripts by their registry 
handler in Apache::Status, so may be we should keep :: after all.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: ModPerl::Registry root

Posted by Stas Bekman <st...@stason.org>.
> It's done now. The core Registry packages all compile the scripts into 
> ModPerl::RegistryROOT:: namespace and cache them in 
> %ModPerl::RegistryCache. Both overridable by the sub-classes.

What I don't like about this change is that it's now impossible to use 
two different registry modules to cache the same script. (of course 
unless these modules override the default cache symbol table)
e.g. I try to use RegistryLoader on the same script with different 
registry modules and of course the second load will be skipped given 
that the two compile to the same package name.


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org