Author: stas
Date: Fri Dec  3 08:58:48 2004
New Revision: 109702

URL: http://svn.apache.org/viewcvs?view=rev&rev=109702
Log:
Based on Apache::ServerUtil::restart_count() implement
$Apache::Server::Starting and $Apache::Server::ReStarting in
Apache::compat

Modified:
   perl/modperl/trunk/Changes
   perl/modperl/trunk/lib/Apache/compat.pm
   perl/modperl/trunk/t/response/TestCompat/apache.pm

Modified: perl/modperl/trunk/Changes
Url: 
http://svn.apache.org/viewcvs/perl/modperl/trunk/Changes?view=diff&rev=109702&p1=perl/modperl/trunk/Changes&r1=109701&p2=perl/modperl/trunk/Changes&r2=109702
==============================================================================
--- perl/modperl/trunk/Changes  (original)
+++ perl/modperl/trunk/Changes  Fri Dec  3 08:58:48 2004
@@ -14,7 +14,9 @@
 
 new API Apache::ServerUtil::restart_count() which can be used to tell
 whether the server is starting/restarting/gracefully
-restarting/etc. [Stas]
+restarting/etc. Based on this feature implement
+$Apache::Server::Starting and $Apache::Server::ReStarting in
+Apache::compat [Stas]
 
 provide perl glue for the mod_perl's base_server_pool
 via Apache::ServerUtil::base_server_pool() [Geoff, Stas]

Modified: perl/modperl/trunk/lib/Apache/compat.pm
Url: 
http://svn.apache.org/viewcvs/perl/modperl/trunk/lib/Apache/compat.pm?view=diff&rev=109702&p1=perl/modperl/trunk/lib/Apache/compat.pm&r1=109701&p2=perl/modperl/trunk/lib/Apache/compat.pm&r2=109702
==============================================================================
--- perl/modperl/trunk/lib/Apache/compat.pm     (original)
+++ perl/modperl/trunk/lib/Apache/compat.pm     Fri Dec  3 08:58:48 2004
@@ -72,6 +72,9 @@
     $INC{'Apache/Table.pm'} = __FILE__;
 }
 
+($Apache::Server::Starting, $Apache::Server::ReStarting) =
+    Apache::ServerUtil::restart_count() == 1 ? (1, 0) : (0, 1);
+
 # api => "overriding code"
 # the overriding code, needs to "return" the original CODE reference
 # when eval'ed , so that it can be restored later

Modified: perl/modperl/trunk/t/response/TestCompat/apache.pm
Url: 
http://svn.apache.org/viewcvs/perl/modperl/trunk/t/response/TestCompat/apache.pm?view=diff&rev=109702&p1=perl/modperl/trunk/t/response/TestCompat/apache.pm&r1=109701&p2=perl/modperl/trunk/t/response/TestCompat/apache.pm&r2=109702
==============================================================================
--- perl/modperl/trunk/t/response/TestCompat/apache.pm  (original)
+++ perl/modperl/trunk/t/response/TestCompat/apache.pm  Fri Dec  3 08:58:48 2004
@@ -19,7 +19,7 @@
 sub handler {
     my $r = shift;
 
-    plan $r, tests => 22;
+    plan $r, tests => 24;
 
     $r->send_http_header('text/plain');
 
@@ -114,7 +114,9 @@
     ok t_cmp(Apache->unescape_url_info("/foo+bar%20baz"),
              '/foo bar baz',
              'Apache->unescape_url_info');
-    
+
+    ok t_cmp $Apache::Server::Starting,   0, '$Apache::Server::Starting';
+    ok t_cmp $Apache::Server::ReStarting, 1, '$Apache::Server::ReStarting';
 
     OK;
 }

Reply via email to