Hi!
On 26 Jun 2001, at 14:17, Andrew Ho wrote:
> That's my script. The caveat is, that it will *never* be possible to
> simulate mod_perl entirely--that would be so complex that you might as
> well have everybody run a single-child Apache with mod_perl instead.
I agree if you are out for debugging mod_perl modules. But I want
to /use/ a Perl module - written for use with mod_perl - and run it
from the command line.
I have a rather complex Content Management System, running
under mod_perl, that uses PerlSetVar to set some often used
variables. I want to access some of its functionality from a normal
shell script. And to do this, I started to write Apache::FakeEnv (or
whatever it may be called when I release it).
The module is working quite well for my needs (i.e. parse the
apache config, make $r->dir_config return correct values), but I
thought I rather check (by starting a discussion here) if I missed
something (e.g. an easy way to parse Apache Config files or
access mod_perl data structures) before putting more work into it
or putting it on CPAN.
> The "best" way to do it would probably just be to write code for 'em all.
> I think many web developers have many of the pieces lying around anyway
> from web client libraries. The hard work is in faking out everything and
> matching the API.
That's indeed rather hard. What I am doing now is to implement the
methods I need, and catch the rest via AUTOLOAD and print a
error message ("method so-and-so not found"), so if somebody
would need this method, he can write a patch :-)
Thanks for the feedback!
--
D_omm
O_xyderkes http://domm.zsi.at
M_echanen
M_asteuei