Hi, Am Donnerstag, 15. Januar 2004 01:41 schrieb Stas Bekman: > 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. >
This is very confusing and incomprehencible to me. My last mp2 application starts with: use mod_perl 1.99; use Apache::RequestRec (); use Apache::RequestIO (); use Apache::ServerUtil (); use Apache::RequestUtil (); use Apache::Util (); use APR::Date (); use APR::Table(); and im sure my next project start with this lines too. If someone ask why my answer is I do not know, but it does not work otherwise. perldoc does not know anything of the above. On startup, my handler get a RequestRec object, but to use parts of it I have to load another module 'Apache::RequestIO'. This powers my requestrec up, but why and how??? RequestIO is not inhereted from RequestRec. Also I have not created a object of type RequestIO they are just unrelated to eachother. I whould expect a full working object from the beginning. If my program does more than passing a obj ref around the I know I have to load this object's module. use Apache::RequestRec nothing more. This is the same for all other Apache::* modules, please do not populate others namespace without reason. Nor bother a user to load a module he did not use. > Why not replace: > > use ModPerl::Util; > my $callback = Apache::current_callback(); > > with: > > use ModPerl::Util; > my $callback = ModPerl::Util::current_callback(); please do so ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > then: > > use Apache::ServerUtil; > my $server_root = Apache::server_root; > > with: > > use Apache::ServerUtil; > my $server_root = Apache::ServerUtil::server_root; this is what I whould expect. > > etc. (there are many modules which install things into the Apache:: > namespace). i.e. try to use the same namespace as the module the function > lives in. > > The only obvious need-to-keep is Apache->server, which can really be made a > constant too. > > or do you think it's OK the way things are right now? The manpage suggests no, please not. > 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. > > The only real problem with this change suggestion is backwards > compatibility, which is nice to keep small. I think backwards compatibility is not of interest here, mod_perl2 is not released and nearly everything has a new name rightnow. The number of users that have really production mp2 applications is small and the one that runs a old source with Apache::compat can do so, he did not notice the changes anyway. > > > __________________________________________________________________ > 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] -- Boris --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]