Example #1
0
 public static function cache__save($reload = false)
 {
     if ($reload) {
         $data = DatabaseData::reloadDb();
     } else {
         $data = DatabaseData::getInstance()->queries;
     }
     $uniq = uniqId();
     $output = array("uniq" => $uniq, "queries" => $data);
     $filePath = CACHE_FOLDER . CACHE_FILE . "." . CACHE_FILE_EXT;
     file_put_contents($filePath, Zend_Json_Encoder::encode($output));
     if ($reload) {
         echo "Cache updated. New id is " . $uniq . " (Time is = " . date("Y-m-d") . ")";
     }
 }