function readCache($cacheName) { if (!$this->isCached($cacheName)) { return false; } $file = new File($this->cacheDirectory . "/" . $cacheName); if (!$file->isFile() || !$file->isReadable()) { return false; } return $file->getIndex(); }
public static function getPatternFromResource($resourceName, $patternId) { if (!ResourceManager::resourceExists($resourceName)) { return false; } $resource = ResourceManager::getResource($resourceName); if (!$resource->doesExist($patternId)) { return false; } $resourcePath = $resource->findByName($patternId); $resourceFile = new File($resourcePath); return new Pattern($resourceFile->getIndex()); }