/** * get cache * * @param Charcoal_String $cache_key identify cache * @param Charcoal_File $source config file * * @return mixed configure data */ public function getCache(Charcoal_String $cache_key, Charcoal_File $source) { $cache_dir = $this->getSandbox()->getProfile()->getString('CACHE_DIR'); $cache_dir = new Charcoal_File(s($cache_dir)); $cache_file = new Charcoal_File(s($cache_key), $cache_dir); if (!$cache_file->isFile()) { return FALSE; } if ($source->isFile()) { $lm_cache = $cache_file->getLastModified(); $lm_source = $source->getLastModified(); if ($lm_cache === FALSE || $lm_source === FALSE) { return FALSE; } if ($lm_cache >= $lm_source) { return FALSE; } } return unserialize($cache_file->getContents()); }