示例#1
0
 public function activate()
 {
     $path = $this->config('location') ? $this->config('location') : sys_get_temp_dir();
     $name = $this->config('name') ? (string) $this->config('name') : '';
     if (!$this->config('name')) {
         $file = tempnam($path, 'store_');
     } else {
         $file = $path . DIRECTORY_SEPARATOR . $name;
     }
     $filesystem = new FileSystem(array('mode' => 'c+', 'filter' => 'file'));
     if ($filesystem->open($file)) {
         $this->_source = $filesystem;
     }
     if (!$this->_source) {
         $this->status(self::STATUS_FAILED_INIT);
     } else {
         $this->status(self::STATUS_SUCCESSFUL_INIT);
     }
 }