Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <benakamoorthi@fastmail.fm>2014-03-31 15:45:34 +0400
committerdiosmosis <benakamoorthi@fastmail.fm>2014-03-31 15:45:54 +0400
commit6a5980ce1968a313793de38357a2197471fb8f54 (patch)
tree6e98cbeb77e7240d19a17e8354920d54b0866989 /plugins
parentca996db2954c40c1584ed65888ce427a5e9933ae (diff)
Add ability to fake pecl module absence for tests.
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/UserCountry/LocationProvider/GeoIp/Pecl.php7
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');
}
/**