diff options
author | diosmosis <benakamoorthi@fastmail.fm> | 2014-03-31 15:45:34 +0400 |
---|---|---|
committer | diosmosis <benakamoorthi@fastmail.fm> | 2014-03-31 15:45:54 +0400 |
commit | 6a5980ce1968a313793de38357a2197471fb8f54 (patch) | |
tree | 6e98cbeb77e7240d19a17e8354920d54b0866989 /plugins | |
parent | ca996db2954c40c1584ed65888ce427a5e9933ae (diff) |
Add ability to fake pecl module absence for tests.
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/UserCountry/LocationProvider/GeoIp/Pecl.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/UserCountry/LocationProvider/GeoIp/Pecl.php b/plugins/UserCountry/LocationProvider/GeoIp/Pecl.php index 69daf467c1..32b30b6abc 100755 --- a/plugins/UserCountry/LocationProvider/GeoIp/Pecl.php +++ b/plugins/UserCountry/LocationProvider/GeoIp/Pecl.php @@ -24,6 +24,11 @@ class Pecl extends GeoIp const TITLE = 'GeoIP (PECL)'; /** + * For tests. + */ + public static $forceDisable = false; + + /** * Uses the GeoIP PECL module to get a visitor's location based on their IP address. * * This function will return different results based on the data available. If a city @@ -105,7 +110,7 @@ class Pecl extends GeoIp */ public function isAvailable() { - return function_exists('geoip_db_avail'); + return !self::$forceDisable && function_exists('geoip_db_avail'); } /** |