From d8b22a05827249bdc6b3615042268b53f8f6bd25 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Mon, 27 Apr 2009 01:56:55 +0000 Subject: [PATCH] BUGFIX Disable Geoip if in CLI mode - this fixes the tests from breaking. The geoip command won't be available in CLI context git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75161 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- integration/Geoip.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/integration/Geoip.php b/integration/Geoip.php index a348f6415..1ce65b7e4 100755 --- a/integration/Geoip.php +++ b/integration/Geoip.php @@ -278,6 +278,9 @@ class Geoip extends Object { * @param boolean $codeOnly Returns just the country code */ static function ip2country($address, $codeOnly = false) { + // Return if in CLI, or you'll get this error: "sh: geoiplookup: command not found" + if(Director::is_cli()) return false; + $cmd = 'geoiplookup ' . escapeshellarg($address); exec($cmd, $result, $code); // Note: At time of writing, $result is always zero for this program