perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Wichitill <ma...@gmx.de>
Subject [PATCH] Show Apache and Perl environment in Apache::Status 2.x
Date Sat, 15 Jan 2005 03:13:04 GMT
Index: lib/Apache/Status.pm
===================================================================
--- lib/Apache/Status.pm	(revision 125243)
+++ lib/Apache/Status.pm	(working copy)
@@ -345,12 +345,12 @@
  sub status_env {
      my ($r) = shift;

+    # show perl environment
      my @retval = ("<p>\n");
-
      if ($r->handler eq 'modperl') {
          # the handler can be executed under the "modperl" handler
          push @retval,
-            qq{<b>Under the "modperl" handler, the environment is:</b>};
+            qq{<b>Under the "modperl" handler, the Perl %ENV is:</b>};
          # XXX: I guess we could call $r->subprocess_env; and show how
          # would it look like under the 'perl-script' environment, but
          # under the 'modperl' handler %ENV doesn't get reset,
@@ -359,13 +359,22 @@
      } else {
          # the handler can be executed under the "perl-script" handler
          push @retval,
-            qq{<b>Under the "perl-script" handler, the environment is</b>:};
+            qq{<b>Under the "perl-script" handler, the Perl %ENV is:</b>};
      }
      push @retval, "\n</p>\n";
      push @retval, "<pre>",
          (map "$_ = " . escape_html($ENV{$_}||'') . "\n",
              sort keys %ENV), "</pre>";

+    # show apache environment
+    my $ap_env = $r->subprocess_env();
+    push @retval, "\n<p>\n";
+    push @retval, qq{<b>The Apache subprocess_env is:</b>};
+    push @retval, "\n</p>\n";
+    push @retval, "<pre>",
+        (map "$_ = " . escape_html($ap_env->{$_}||'') . "\n",
+            sort keys %$ap_env), "</pre>";
+
      \@retval;
  }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message