'Geo::IP' dependency is now optional.
authorshort <>
Tue, 19 Oct 2004 14:51:51 +0000 (14:51 +0000)
committershort <>
Tue, 19 Oct 2004 14:51:51 +0000 (14:51 +0000)
Web.pm

diff --git a/Web.pm b/Web.pm
index ea6f32f..2c720f3 100644 (file)
--- a/Web.pm
+++ b/Web.pm
@@ -69,8 +69,9 @@ use Carp qw(cluck confess);
 use URI::Escape;
 require HTTP::BrowserDetect;
 require HTTP::Negotiate;
 use URI::Escape;
 require HTTP::BrowserDetect;
 require HTTP::Negotiate;
-require Geo::IP;
+my $have_Geo_IP; BEGIN { $have_Geo_IP=eval { require Geo::IP; 1; }; }
 require CGI;
 require CGI;
+require Apache2;
 
 
 # Undo 'www/engine/httpd-restart' as it may use obsolete Perl for 'mod_perl'
 
 
 # Undo 'www/engine/httpd-restart' as it may use obsolete Perl for 'mod_perl'
@@ -436,6 +437,7 @@ sub remote_ip ()
 
 sub is_cz ()
 {
 
 sub is_cz ()
 {
+       return 0 if !$have_Geo_IP;
        return "CZ" eq Geo::IP->new()->country_code_by_addr(remote_ip());
 }
 
        return "CZ" eq Geo::IP->new()->country_code_by_addr(remote_ip());
 }