Exemplo n.º 1
0
 public function read()
 {
     $this->_open('r');
     $lock = new Lock($this);
     $lock->sh();
     if ($this->ttl > 0) {
         if (time() - filemtime($this->fileName) >= $this->ttl) {
             $lock->unlock();
             $this->_close();
             unlink($this->fileName);
             return false;
         }
     }
     $content = false;
     while (!feof($this->handle)) {
         $content .= fread($this->handle, 4012);
     }
     $lock->unlock();
     $this->_close();
     return $content;
 }