示例#1
0
 /**
  * Update folder details (use if name is changed)
  *
  * @returns $this
  * @throws FileManagerException
  */
 public function updateDetails()
 {
     $this->folder->dir = $this->url->pathToUrl($this->getPath()->relativePath());
     $this->folder->url = $this->url->forFolder($this->getPath(), $this->name());
     $this->folder->updated_at = date('Y-m-d H:i:s', stat($this->fullPath())['mtime']);
     $this->folder->bytes = FileSystem::dirSize($this->fullPath(), [$this->getPath()->thumbDirName()]);
     return $this;
 }
示例#2
0
 /**
  * Update file when path manager is set up
  *
  * @param Path $path
  */
 protected function onPathUpdate(Path $path)
 {
     $this->file->dir = $this->url->pathToUrl($path->relativePath());
     $this->thumb->setPath($path);
 }