Author: stas
Date: Tue May 10 19:33:29 2005
New Revision: 169563

URL: http://svn.apache.org/viewcvs?rev=169563&view=rev
Log:
run the Apache2::MPM->is_threaded check and die only if running under 
the mod_perl environment. this will allow the version checking from the command 
line by tools like CPAN.pm

Modified:
    perl/modperl/trunk/ModPerl-Registry/lib/ModPerl/PerlRunPrefork.pm
    perl/modperl/trunk/ModPerl-Registry/lib/ModPerl/RegistryPrefork.pm

Modified: perl/modperl/trunk/ModPerl-Registry/lib/ModPerl/PerlRunPrefork.pm
URL: 
http://svn.apache.org/viewcvs/perl/modperl/trunk/ModPerl-Registry/lib/ModPerl/PerlRunPrefork.pm?rev=169563&r1=169562&r2=169563&view=diff
==============================================================================
--- perl/modperl/trunk/ModPerl-Registry/lib/ModPerl/PerlRunPrefork.pm (original)
+++ perl/modperl/trunk/ModPerl-Registry/lib/ModPerl/PerlRunPrefork.pm Tue May 
10 19:33:29 2005
@@ -7,10 +7,11 @@
 
 use base qw(ModPerl::PerlRun);
 
-use Apache2::MPM ();
-
-die "This package can't be used under threaded MPMs"
-    if Apache2::MPM->is_threaded;
+if ($ENV{MOD_PERL}) {
+    require Apache2::MPM;
+    die "This package can't be used under threaded MPMs"
+        if Apache2::MPM->is_threaded;
+}
 
 sub handler : method {
     my $class = (@_ >= 2) ? shift : __PACKAGE__;

Modified: perl/modperl/trunk/ModPerl-Registry/lib/ModPerl/RegistryPrefork.pm
URL: 
http://svn.apache.org/viewcvs/perl/modperl/trunk/ModPerl-Registry/lib/ModPerl/RegistryPrefork.pm?rev=169563&r1=169562&r2=169563&view=diff
==============================================================================
--- perl/modperl/trunk/ModPerl-Registry/lib/ModPerl/RegistryPrefork.pm 
(original)
+++ perl/modperl/trunk/ModPerl-Registry/lib/ModPerl/RegistryPrefork.pm Tue May 
10 19:33:29 2005
@@ -7,10 +7,11 @@
 
 use base qw(ModPerl::Registry);
 
-use Apache2::MPM ();
-
-die "This package can't be used under threaded MPMs"
-    if Apache2::MPM->is_threaded;
+if ($ENV{MOD_PERL}) {
+    require Apache2::MPM;
+    die "This package can't be used under threaded MPMs"
+        if Apache2::MPM->is_threaded;
+}
 
 sub handler : method {
     my $class = (@_ >= 2) ? shift : __PACKAGE__;


Reply via email to