Stas Bekman wrote:
I see, that Philippe has found a nice trick to load Apache::PerlSections at the server startup, w/o actually doing that explicitly. He deployed the handlers automatic autoloading. Though this trick doesn't work for other things. I want to move the pre-loading of APR::Error to the the internals of mp2, but since it may reside in the Apache2/ subdir, we can't try loading it, before a user loads Apache2.pm. Which may not happen at all. And we may need to load other modules in the future as well (e.g. things that we discussed before - load Apache::RequestRec before handing user $r).

We can't force on user loading Apache2, since he may want to adjust @INC, before Apache2.pm is loaded.

I thought that moving APR/* packages out of Apache2/ will solve that problem, removing the dependancy on Apache2.pm, but as Joe suggested it's probably not the best approach, due to versioning...

So if you have ideas how to resolve that issue, I'm all ears.

So any ideas? We need to preload APR::Error to start with.

I'm thinking to force Apache2 loading as soon as perl boots, following by loading of other required modules, such as APR::Error. It'll create a problem for those who installed their mod_perl and/or third party modules into a location different from the core @INC (e.g. their $HOME). Before forcing Apache2 to be loaded as early as possible users could call:

use lib qw(my/libs);
use Apache2;

which now won't have this affect (a reminder: when Apache2 loads it checks @INC for Apache2 subdirs and pushes them in front of the existing @INC).

So I was thinking to solve the problem of loading 3rd party modules installed outside perl-core by folding the code that Apache2 loads into a sub and make it callable, in addition to calling it when the module boots. so if mp2 loads Apache2 early, users will be able to do:

use lib qw(my/libs);
Apache2::adjust_inc();

or similar.

But this won't handle the case if mp2 itself is installed outside the core, since Apache2.pm simply won't be found. This can probably be fixed with PerlSwitches

PerlSwitches -Imy/libs

as PERL5LIB is ignored with -T.

Thoughts?



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to