Esempio n. 1
0
 public function save($path, $newName = null)
 {
     FilesystemStorage::copy($this->getFullPath(), $path);
     $this->full_path = $path;
     if (!is_null($newName)) {
         $this->name = $newName;
     }
 }
Esempio n. 2
0
 /**
  * @param IFile $file
  * @param $path
  * @return IFile
  */
 public function publishFile(IFile $file, $path)
 {
     $onlyPath = dirname($path);
     if (!file_exists($onlyPath)) {
         FilesystemStorage::mkdir($onlyPath, 0777, true);
     }
     $file->save($path);
     return $file;
 }