예제 #1
0
파일: net.php 프로젝트: poppa/PLib
 /**
  * Look up the cache file and if it exists and hasn't expired return the
  * path to the cache file.
  *
  * @param string $header
  *  The raw request header
  * @return string|bool
  */
 protected function get_cache($header)
 {
     $key = $this->create_cache_key($header);
     $file = Net::tmpdir() . "/{$key}.cache";
     if (file_exists($file)) {
         $mtime = filemtime($file);
         if (time() < $mtime + $this->cache) {
             $this->cache = 0;
             return $file;
         } else {
             unlink($file);
         }
     }
     return false;
 }