Permalink
Browse files

fix changes on cache class

  • Loading branch information...
1 parent a78bbbc commit b406f1e8a5d917b09bd1ceace0182266f58a5bee @acidvertigo acidvertigo committed Dec 28, 2011
Showing with 7 additions and 6 deletions.
  1. +7 −6 catalog/includes/functions/cache.php
@@ -54,18 +54,19 @@ function read_cache(&$var, $filename, $auto_expire = false){
}
}
-
+// try to open file
+ if ($fp = @fopen(gzinflate($filename, 'r'))) {
// read in serialized data
- $szdata = gzinflate(file_get_contents($filename));
-
+ $szdata = fread($fp, filesize($filename));
+ fclose($fp);
// unserialze the data
$var = json_decode(stripslashes(base64_decode($szdata)));
$success = true;
}
- unset($var);
- unset($szdata);
- return $success;
+ unset($var,$szdata);
+ return $success;
+ }
////
//! Get data from the cache or the database.
// get_db_cache checks the cache for cached SQL data in $filename

0 comments on commit b406f1e

Please sign in to comment.