Stas Bekman wrote:
Please take a look at this new manpage http://perl.apache.org/docs/2.0/api/Apache.html
This issue of ghost Apache namespace troubles me. In mod_perl 1.0 it was OK to have functions like Apache::current_callback() because almost everything was preloaded. I don't think it's OK in mp2. It's absolutely not obvious which module needs to be loaded to get this API, and most people will try to load Apache, and it won't do the trick.
well, I agree with you about the Apache:: namespace. but the "not obvious" part applies to lots of other things as well - it's also "absolutely not obvious" that you need to load Apache::RequestUtil to get $r->dir_config to work :)
Right, but it make certain sense, as it contains Apache::Request in it, so it's easier to grok and it's somewhat intuitive (e.g. io methods belonging to the IO class, and slot accessor methods belonging to the Rec class (assuming you intimately know the C record struct.
Whereas Apache::foo makes little sense at all.
The only obvious need-to-keep is Apache->server,
if we're going to keep Apache->server around then I don't see a reason for changing other Apache:: class methods/functions - either remove the Apache namespace completely, or make it more intuitive by creating a real Apache class (.pm, .xs and other required glue) where all these obscure methods live.
it could be an idea. but we need to give it some better thought. Or may be ask Doug's reasoning for this choice. He promised to give one long long time ago, but never did I think.
or do you think it's OK the way things are right now? The manpage suggests to use http://perl.apache.org/docs/2.0/api/ModPerl/MethodLookup.html to figure what needs to be loaded, but it's not so intuitive.
MethodLookup is really sweet, but it's not intuitive that you need a separate module to tell you what to load.
Not a module but a command line run. Actually, since we already have mp2bug and mp2doc utils. I'm thinking to make ModPerl/MethodLookup more intuitive and add 3 more utils: mp2method, mp2module, mp2object to perform the equivalent of:
% perl -MApache2 -MModPerl::MethodLookup -e print_method % perl -MApache2 -MModPerl::MethodLookup -e print_module % perl -MApache2 -MModPerl::MethodLookup -e print_object
just like we have the cpan utility vs.
% perl -MCPAN -eshell
This will make it much more accessible/useful.
The only real problem with this change suggestion is backwards compatibility, which is nice to keep small.
well, I feel less strongly about this than you do. the few methods that live in Apache:: land are small compared to all the other adjustments users are already required to make.
I'm actually worried more about the users who have moved to mp2 already and would like to try not to break their code if possible.
__________________________________________________________________ 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]