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; } }
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)); }
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; }