this patch implements the PerlINC wrapper which does:
s/PerlSwitches -Ilib=foo/PerlINC foo/
Index: src/modules/perl/mod_perl.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
retrieving revision 1.93
diff -u -r1.93 mod_perl.c
--- src/modules/perl/mod_perl.c 2001/11/01 23:50:32 1.93
+++ src/modules/perl/mod_perl.c 2001/11/12 06:10:46
@@ -419,6 +419,7 @@
MP_CMD_SRV_ITERATE("PerlRequire", requires, "PerlRequire"),
MP_CMD_DIR_ITERATE("PerlOptions", options, "Perl Options"),
MP_CMD_DIR_ITERATE("PerlInitHandler", init_handlers, "Subroutine name"),
+ MP_CMD_DIR_ITERATE("PerlINC", perl_inc, "PerlINC"),
MP_CMD_DIR_TAKE2("PerlSetVar", set_var, "PerlSetVar"),
MP_CMD_DIR_ITERATE2("PerlAddVar", add_var, "PerlAddVar"),
MP_CMD_SRV_RAW_ARGS("<Perl", perl, "NOT YET IMPLEMENTED"),
Index: src/modules/perl/modperl_cmd.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.c,v
retrieving revision 1.14
diff -u -r1.14 modperl_cmd.c
--- src/modules/perl/modperl_cmd.c 2001/10/11 04:47:30 1.14
+++ src/modules/perl/modperl_cmd.c 2001/11/12 06:10:46
@@ -125,6 +125,15 @@
return modperl_cmd_post_read_request_handlers(parms, mconfig, arg);
}
+MP_CMD_SRV_DECLARE(perl_inc)
+{
+ char *newarg = apr_psprintf(parms->pool, "-Mlib=%s", arg);
+
+ MP_TRACE_d(MP_FUNC, "arg = %s\n", arg);
+ modperl_cmd_switches(parms, mconfig, newarg);
+ return NULL;
+}
+
MP_CMD_SRV_DECLARE(perl)
{
return "<Perl> sections not yet implemented in modperl-2.0";
Index: src/modules/perl/modperl_cmd.h
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.h,v
retrieving revision 1.16
diff -u -r1.16 modperl_cmd.h
--- src/modules/perl/modperl_cmd.h 2001/10/11 04:47:30 1.16
+++ src/modules/perl/modperl_cmd.h 2001/11/12 06:10:46
@@ -24,6 +24,7 @@
MP_CMD_SRV_DECLARE2(add_var);
MP_CMD_SRV_DECLARE(options);
MP_CMD_SRV_DECLARE(init_handlers);
+MP_CMD_SRV_DECLARE(perl_inc);
MP_CMD_SRV_DECLARE(perl);
#ifdef MP_COMPAT_1X
Index: t/response/TestDirective/perlrequire.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/response/TestDirective/perlrequire.pm,v
retrieving revision 1.3
diff -u -r1.3 perlrequire.pm
--- t/response/TestDirective/perlrequire.pm 2001/09/22 09:33:31 1.3
+++ t/response/TestDirective/perlrequire.pm 2001/11/12 06:10:47
@@ -56,10 +56,10 @@
</IfDefine>
# use test system's @INC
- PerlSwitches -Mlib=@serverroot@
+ PerlINC @serverroot@
PerlRequire "conf/modperl_startup.pl"
- PerlSwitches -Mlib=@documentroot@/testdirective/vh
+ PerlINC @documentroot@/testdirective/vh
PerlRequire "PerlRequireTest.pm"
<Location /TestDirective::perlrequire>
Index: todo/possible_new_features.txt
===================================================================
RCS file: /home/cvs/modperl-2.0/todo/possible_new_features.txt,v
retrieving revision 1.11
diff -u -r1.11 possible_new_features.txt
--- todo/possible_new_features.txt 2001/10/08 17:37:51 1.11
+++ todo/possible_new_features.txt 2001/11/12 06:10:47
@@ -22,10 +22,6 @@
- setuid/gid before running any Perl code
-- implement PerlINC (or similar) as a nicer interface for the working
- PerlSwitches -Mlib=/home/dev1/lib/perl, to set different @INC for
- different virtual hosts.
-
- a possible implementation of PerlOptions +Inherit, similar to
+Parent but which allows virtual hosts to inherit everything that
was loaded by the main server, at the point of their definition in
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:stas@stason.org http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
|