function checkPaths() { $version = explode('.', PHP_VERSION); $phptag = "php" . $version[0]; self::$phptag = "php" . $version[0]; self::$result1dir = "test-suite" . DIRECTORY_SEPARATOR . "results1-{$phptag}"; self::$result2dir = "test-suite" . DIRECTORY_SEPARATOR . "results2-{$phptag}"; self::$diffdir = "test-suite" . DIRECTORY_SEPARATOR . "diffs"; self::$testdir = "test-suite" . DIRECTORY_SEPARATOR . "tests"; self::$referencedir = "test-suite" . DIRECTORY_SEPARATOR . "references"; if (!file_exists(self::$result1dir)) { mkdir(self::$result1dir); } if (!file_exists(self::$result2dir)) { mkdir(self::$result2dir); } if (!file_exists(self::$diffdir)) { mkdir(self::$diffdir); } self::$compare = null; // NOTE: This path will change between systems... $compares = array("/usr/bin/compare", "/usr/local/bin/compare", "test-suite" . DIRECTORY_SEPARATOR . "tools" . DIRECTORY_SEPARATOR . "compare.exe"); foreach ($compares as $c) { if (file_exists($c) and is_executable($c)) { self::$compare = $c; break; } } if (!file_exists(self::$compare)) { throw new Exception("Compare path doesn't exist (or isn't executable) - do you have Imagemagick? \n"); } }