示例#1
0
 public function getTableDefinition($value)
 {
     $item = $this->cache->getItem('table-' . File::normalizeName($value));
     if ($item->isHit()) {
         return $item->get();
     } else {
         $result = $this->reader->getTableDefinition($value);
         $item->set($result, $this->expire);
         $this->cache->save($item);
         return $result;
     }
 }
示例#2
0
文件: File.php 项目: k42b3/psx-ws
 public function save($opEndpoint, Association $assoc)
 {
     $data = unserialize(FileObject::getContents($this->file));
     $key = md5($opEndpoint);
     $data[$key] = array('opEndpoint' => $opEndpoint, 'assocHandle' => $assoc->getAssocHandle(), 'assocType' => $assoc->getAssocType(), 'sessionType' => $assoc->getSessionType(), 'secret' => $assoc->getSecret(), 'expires' => $assoc->getExpire());
     FileObject::putContents($this->file, serialize($data));
 }
示例#3
0
文件: Record.php 项目: visapi/amun
 public function getFile()
 {
     if ($this->_file === null) {
         // check whether we have an absolute or relative path
         if ($this->mediaPath[0] == '/' || $this->mediaPath[1] == ':') {
             $file = $this->mediaPath;
         } else {
             $file = $this->_registry['media.path'] . '/' . $this->mediaPath;
         }
         if (!File::exists($file)) {
             throw new Exception('File not found', 404);
         }
         $this->_file = $file;
     }
     return $this->_file;
 }