Ejemplo n.º 1
0
 /**
  * 設定をリストアする
  */
 public static function restore($name)
 {
     $file = Context::singleton()->getCachePath("config", $name);
     $c = new Configuration($name);
     if (file_exists($file)) {
         $c->_config = unserialize(FileInfo::getContents($file));
     }
     return $c;
 }
Ejemplo n.º 2
0
 protected function initHandler(Hash $options)
 {
     $this->_stream = FileInfo::format($options->getVal('path', 'php://stdout'));
 }
Ejemplo n.º 3
0
 public function set($id, $value, $meta = [])
 {
     $data = ['meta' => array_merge(['time' => time()], $meta), 'data' => $value];
     FileInfo::putContents($path = $this->getFilePath($id), serialize($data));
     return $path;
 }