From c4266dab5a01340275d48736ac0dee871cb9de6b Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Tue, 5 Apr 2011 13:23:20 +0000 Subject: check if geoip lib is already there --- lib/Downloads.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') 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); -- cgit v1.2.1