Make mod_perl optional
[apache2-authen-passphrase.git] / lib / Apache2 / Authen / Passphrase.pm
index bea2bca35a2fb3e1728ac4cc4a4c2c5e1f9ffc49..e8a157991eba0dfd3c30549583feae52326eee4b 100644 (file)
@@ -6,6 +6,7 @@ use 5.014000;
 use strict;
 use warnings;
 use parent qw/Exporter/;
+use subs qw/OK HTTP_UNAUTHORIZED/;
 
 use constant +{
   USER_REGEX => qr/^\w{2,20}$/pa,
@@ -14,9 +15,9 @@ use constant +{
   BAD_PASSWORD => "bad-password\n",
 };
 
-use Apache2::RequestRec;
-use Apache2::Access;
-use Apache2::Const qw/OK HTTP_UNAUTHORIZED/;
+use if $ENV{MOD_PERL}, 'Apache2::RequestRec';
+use if $ENV{MOD_PERL}, 'Apache2::Access';
+use if $ENV{MOD_PERL}, 'Apache2::Const' => qw/OK HTTP_UNAUTHORIZED/;
 use Authen::Passphrase;
 use Authen::Passphrase::BlowfishCrypt;
 use YAML::Any qw/LoadFile DumpFile/;
This page took 0.009554 seconds and 4 git commands to generate.