dougm 2002/08/26 21:26:54 Modified: src/modules/perl modperl_cmd.c modperl_cmd.h mod_perl.c mod_perl.h Log: add LoadModule directive to support directive handlers Revision Changes Path 1.26 +27 -0 modperl-2.0/src/modules/perl/modperl_cmd.c Index: modperl_cmd.c =================================================================== RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- modperl_cmd.c 25 Aug 2002 23:04:55 -0000 1.25 +++ modperl_cmd.c 27 Aug 2002 04:26:54 -0000 1.26 @@ -297,6 +297,33 @@ return NULL; } +/* + * XXX: the name of this directive may or may not stay. + * need a way to note that a module has config directives. + * don't want to start mod_perl when we see a non-special PerlModule. + */ +MP_CMD_SRV_DECLARE(load_module) +{ + apr_pool_t *p = parms->pool; + server_rec *s = parms->server; + const char *errmsg; + + if (!strstr(arg, "::")) { + return DECLINE_CMD; /* let mod_so handle it */ + } + + MP_TRACE_d(MP_FUNC, "LoadModule %s\n", arg); + + /* we must init earlier than normal */ + modperl_run(p, s); + + if ((errmsg = modperl_cmd_modules(parms, mconfig, arg))) { + return errmsg; + } + + return modperl_module_add(p, s, arg); +} + #ifdef MP_COMPAT_1X MP_CMD_SRV_DECLARE_FLAG(taint_check) 1.18 +1 -0 modperl-2.0/src/modules/perl/modperl_cmd.h Index: modperl_cmd.h =================================================================== RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- modperl_cmd.h 19 Nov 2001 00:07:28 -0000 1.17 +++ modperl_cmd.h 27 Aug 2002 04:26:54 -0000 1.18 @@ -27,6 +27,7 @@ MP_CMD_SRV_DECLARE(options); MP_CMD_SRV_DECLARE(init_handlers); MP_CMD_SRV_DECLARE(perl); +MP_CMD_SRV_DECLARE(load_module); #ifdef MP_COMPAT_1X 1.134 +1 -0 modperl-2.0/src/modules/perl/mod_perl.c Index: mod_perl.c =================================================================== RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v retrieving revision 1.133 retrieving revision 1.134 diff -u -r1.133 -r1.134 --- mod_perl.c 24 Aug 2002 18:03:03 -0000 1.133 +++ mod_perl.c 27 Aug 2002 04:26:54 -0000 1.134 @@ -583,6 +583,7 @@ MP_CMD_DIR_TAKE2("PerlSetEnv", set_env, "PerlSetEnv"), MP_CMD_SRV_TAKE1("PerlPassEnv", pass_env, "PerlPassEnv"), MP_CMD_SRV_RAW_ARGS("<Perl", perl, "NOT YET IMPLEMENTED"), + MP_CMD_SRV_TAKE1("LoadModule", load_module, "A Perl module"), #ifdef MP_TRACE MP_CMD_SRV_TAKE1("PerlTrace", trace, "Trace level"), #endif 1.51 +1 -0 modperl-2.0/src/modules/perl/mod_perl.h Index: mod_perl.h =================================================================== RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.h,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- mod_perl.h 24 Aug 2002 18:03:03 -0000 1.50 +++ mod_perl.h 27 Aug 2002 04:26:54 -0000 1.51 @@ -66,6 +66,7 @@ #include "modperl_env.h" #include "modperl_cgi.h" #include "modperl_perl.h" +#include "modperl_module.h" void modperl_init(server_rec *s, apr_pool_t *p); int modperl_run(apr_pool_t *p, server_rec *s);