You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@hyperreal.org on 1998/11/19 05:33:39 UTC
cvs commit: modperl/t/net/perl api.pl
dougm 98/11/18 20:33:39
Modified: . Changes ToDo
src/modules/perl Apache.xs mod_perl.c mod_perl.h
t/conf httpd.conf.pl
t/docs startup.pl
t/net/perl api.pl
Log:
new Apache->define method works like IfDefine
Revision Changes Path
1.199 +2 -0 modperl/Changes
Index: Changes
===================================================================
RCS file: /export/home/cvs/modperl/Changes,v
retrieving revision 1.198
retrieving revision 1.199
diff -u -r1.198 -r1.199
--- Changes 1998/11/19 03:28:03 1.198
+++ Changes 1998/11/19 04:33:34 1.199
@@ -8,6 +8,8 @@
=item 1.16_01-dev
+new Apache->define method works like IfDefine
+
PerlRequire/PerlModule will start Perl if it is not already running
(undocumented) $Apache::ReadConfig variable renamed $Apache::Server::SaveConfig
1.116 +0 -2 modperl/ToDo
Index: ToDo
===================================================================
RCS file: /export/home/cvs/modperl/ToDo,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -r1.115 -r1.116
--- ToDo 1998/11/19 03:28:04 1.115
+++ ToDo 1998/11/19 04:33:34 1.116
@@ -3,8 +3,6 @@
(well, close to it anyhow)
---------------------------------------------------------------------------
-- <IfDefine> for <Perl> sections?
-
- stronghold patches [Todd R. Eigenschink <to...@tekinteractive.com>]
- Andrew Ford's Apache::FakeRequest patch
1.64 +23 -0 modperl/src/modules/perl/Apache.xs
Index: Apache.xs
===================================================================
RCS file: /export/home/cvs/modperl/src/modules/perl/Apache.xs,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- Apache.xs 1998/11/12 20:22:47 1.63
+++ Apache.xs 1998/11/19 04:33:35 1.64
@@ -278,6 +278,24 @@
(r->hostname ? r->hostname : r->server->server_hostname)
#endif
+#if MODULE_MAGIC_NUMBER >= MMN_131
+static int mod_perl_define(SV *sv, char *name)
+{
+ char **defines;
+ int i;
+
+ defines = (char **)ap_server_config_defines->elts;
+ for (i = 0; i < ap_server_config_defines->nelts; i++) {
+ if (strcmp(defines[i], name) == 0) {
+ return 1;
+ }
+ }
+ return 0;
+}
+#else
+#define mod_perl_define(sv,name) 0
+#endif
+
static int sv_str_header(void *arg, const char *k, const char *v)
{
SV *sv = (SV*)arg;
@@ -425,6 +443,11 @@
CODE:
perl_stash_rgy_endav(r->uri, sv);
+
+I32
+mod_perl_define(sv, name)
+ SV *sv
+ char *name
I32
module(sv, name)
1.54 +11 -3 modperl/src/modules/perl/mod_perl.c
Index: mod_perl.c
===================================================================
RCS file: /export/home/cvs/modperl/src/modules/perl/mod_perl.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- mod_perl.c 1998/10/15 08:44:46 1.53
+++ mod_perl.c 1998/11/19 04:33:36 1.54
@@ -433,6 +433,15 @@
}
#endif
+static void mp_server_notstarting(void *data)
+{
+ Apache__ServerStarting(FALSE);
+}
+
+#define Apache__ServerStarting_on() \
+ Apache__ServerStarting(PERL_RUNNING()); \
+ register_cleanup(p, NULL, mp_server_notstarting, mod_perl_noop)
+
#define MP_APACHE_VERSION 1.25
void mp_check_version(void)
@@ -518,6 +527,7 @@
else if(perl_is_running < PERL_DONE_STARTUP) {
/* skip the -HUP at server-startup */
perl_is_running++;
+ Apache__ServerStarting_on();
MP_TRACE_g(fprintf(stderr, "perl_startup: perl aleady running...ok\n"));
return;
}
@@ -611,7 +621,7 @@
(void)GvHV_init("mod_perl::UNIMPORT");
Apache__ServerReStarting(FALSE); /* just for -w */
- Apache__ServerStarting(PERL_RUNNING());
+ Apache__ServerStarting_on();
#ifdef PERL_STACKED_HANDLERS
if(!stacked_handlers) {
@@ -651,7 +661,6 @@
"mod_perl: PerlModule,PerlRequire postponed\n"));
my_setenv("PERL_STARTUP_DONE", "1");
saveINC;
- Apache__ServerStarting(FALSE);
return;
}
@@ -687,7 +696,6 @@
#endif
saveINC;
- Apache__ServerStarting(FALSE);
#if MODULE_MAGIC_NUMBER >= MMN_130
if(perl_module.dynamic_load_handle)
register_cleanup(p, NULL, mp_dso_unload, null_cleanup);
1.60 +1 -0 modperl/src/modules/perl/mod_perl.h
Index: mod_perl.h
===================================================================
RCS file: /export/home/cvs/modperl/src/modules/perl/mod_perl.h,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- mod_perl.h 1998/11/13 21:38:58 1.59
+++ mod_perl.h 1998/11/19 04:33:36 1.60
@@ -422,6 +422,7 @@
/* once 1.3.0 is here, we can toss most of this junk */
#define MMN_130 19980527
+#define MMN_131 19980713
#define MMN_132 19980806
#if MODULE_MAGIC_NUMBER >= MMN_130
#define HAVE_APACHE_V_130
1.23 +7 -0 modperl/t/conf/httpd.conf.pl
Index: httpd.conf.pl
===================================================================
RCS file: /export/home/cvs/modperl/t/conf/httpd.conf.pl,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- httpd.conf.pl 1998/11/08 01:21:12 1.22
+++ httpd.conf.pl 1998/11/19 04:33:37 1.23
@@ -30,8 +30,15 @@
use Apache::Registry ();
use Apache::RegistryNG ();
+for (qw(TEST NOCHANCE)) {
+ if(Apache->define($_)) {
+ print "IfDefine $_\n";
+ }
+}
+
Apache::Server->register_cleanup(sub {
warn "Apache::Server registered cleanup called for $$\n";
+ 0;
});
if($ENV{TEST_PERL_DIRECTIVES}) {
1.25 +4 -1 modperl/t/docs/startup.pl
Index: startup.pl
===================================================================
RCS file: /export/home/cvs/modperl/t/docs/startup.pl,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- startup.pl 1998/10/01 19:31:21 1.24
+++ startup.pl 1998/11/19 04:33:38 1.25
@@ -62,7 +62,10 @@
*Apache::READ = \&Apache::new_read;
}
-$ENV{KeyForPerlSetEnv} eq "OK" or warn "PerlSetEnv is broken\n";
+unless($ENV{KeyForPerlSetEnv} and
+ $ENV{KeyForPerlSetEnv} eq "OK") {
+ warn "PerlSetEnv is broken\n";
+}
%net::callback_hooks = ();
require "net/config.pl";
1.32 +9 -1 modperl/t/net/perl/api.pl
Index: api.pl
===================================================================
RCS file: /export/home/cvs/modperl/t/net/perl/api.pl,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- api.pl 1998/11/13 21:39:01 1.31
+++ api.pl 1998/11/19 04:33:38 1.32
@@ -16,7 +16,7 @@
my $is_xs = ($r->uri =~ /_xs/);
-my $tests = 50;
+my $tests = 53;
my $is_win32 = WIN32;
$tests += 2 unless $is_win32;
my $test_get_set = Apache->can('set_handlers') && ($tests += 4);
@@ -49,6 +49,8 @@
test ++$i, -d $Apache::Server::CWD;
print "\$Apache::Server::CWD == $Apache::Server::CWD\n";
print "\$0 == $0\n";
+test ++$i, not $Apache::Server::Starting;
+test ++$i, not $Apache::Server::ReStarting;
unless ($is_win32) {
my $ft_s = -s $INC{'Apache.pm'};
@@ -150,6 +152,12 @@
my $str = "ok $i\n";
$r->print(\$str);
+test ++$i, $r->define("FOO") || 1; #just make sure we can call it
+for (qw(TEST NOCHANCE)) {
+ if(Apache->define($_)) {
+ print "IfDefine $_\n";
+ }
+}
test ++$i, $r->module("Apache");
test ++$i, not Apache->module("Not::A::Chance");
test ++$i, Apache->module("Apache::Constants");