public static function getProjSpecs($wkid) { $contents = null; $projCache = new DiskCache(Kurogo::getSiteVar('PROJ_CACHE', 'maps'), null, true); $projCache->setSuffix('.proj4'); $projCache->preserveFormat(); $filename = $wkid; if (!$projCache->isFresh($filename)) { $file = fopen(DATA_DIR . '/maps/proj_list.txt', 'r'); $wkidID = "<{$wkid}>"; $strlen = strlen($wkidID); while ($line = fgets($file)) { if (substr($line, 0, $strlen) == $wkidID) { preg_match("/<\\d+> (.+) <>/", $line, $matches); $contents = $matches[1]; break; } } fclose($file); if ($contents) { $projCache->write($contents, $filename); } else { // TODO get config for logging Kurogo::LOG(LOG_WARNING, "{$wkid} is not a known projection", 'maps'); } } else { $contents = $projCache->read($filename); } return $contents; }