diff --git a/caches/FileCache.php b/caches/FileCache.php index 594343d3..7120007c 100644 --- a/caches/FileCache.php +++ b/caches/FileCache.php @@ -1,14 +1,20 @@ isPrepareCache(); - $datas = json_decode(file_get_contents($this->getCacheFile()),true); + $datas = include( $this->getCacheFile() ); $items = array(); foreach($datas as $aData){ $item = new \Item(); @@ -24,7 +30,7 @@ class FileCache extends CacheAbstract{ public function saveData($datas){ $this->isPrepareCache(); - file_put_contents($this->getCacheFile(), json_encode($datas)); + file_put_contents($this->getCacheFile(), 'isPrepareCache(); $stringToEncode = $_SERVER['REQUEST_URI'] . http_build_query($this->param); - return hash('sha1', $stringToEncode) . '.cache'; + return hash($this->hash_algo , $stringToEncode) . '.cache.php'; } -} \ No newline at end of file +}