Example #1
0
 private function save_cache($file, $cache)
 {
     $is_writable = wpt_is_writable($file);
     if ($is_writable) {
         file_put_contents($file, $cache);
     } else {
         set_transient('wpt_cache', $cache, $this->defaults['cache_expire']);
     }
 }
Example #2
0
 private function delete_cache($file)
 {
     $is_writable = wpt_is_writable($file);
     if ($is_writable) {
         unlink($file);
     } else {
         delete_transient('wpt_cache');
     }
 }