diff options
author | Romain d'Alverny <rda@mageia.org> | 2011-04-05 13:23:20 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2011-04-05 13:23:20 +0000 |
commit | c4266dab5a01340275d48736ac0dee871cb9de6b (patch) | |
tree | 58dfabd0af5d2cbe03e69ebdccfd1299cc69ca7b | |
parent | 3b3097a39ed6320300512e4a85823f93b9e89a51 (diff) | |
download | www-c4266dab5a01340275d48736ac0dee871cb9de6b.tar www-c4266dab5a01340275d48736ac0dee871cb9de6b.tar.gz www-c4266dab5a01340275d48736ac0dee871cb9de6b.tar.bz2 www-c4266dab5a01340275d48736ac0dee871cb9de6b.tar.xz www-c4266dab5a01340275d48736ac0dee871cb9de6b.zip |
check if geoip lib is already there
-rw-r--r-- | lib/Downloads.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Downloads.php b/lib/Downloads.php index eca318db4..a8ecc109d 100644 --- a/lib/Downloads.php +++ b/lib/Downloads.php @@ -156,7 +156,9 @@ class Downloads if ($ip == '127.0.0.1' || $ip == '::1') return null; - require_once '../../lib/maxmind/geoip/geoip.inc.php'; + if (!defined('geoip_open')) { + require_once '../../lib/maxmind/geoip/geoip.inc.php'; + } $gi = geoip_open(realpath('../../lib/maxmind/geoip/GeoIP.dat'), GEOIP_STANDARD); $loc = geoip_country_code_by_addr($gi, $ip); |