Ejemplo n.º 1
0
 /**
  * @param string $item_name
  * @return \Crip\FileManager\Data\File|\Crip\FileManager\Data\Folder
  */
 private function readItem($item_name)
 {
     $item_path = FileSystem::join($this->sys_path, $item_name);
     if (is_dir($item_path)) {
         return $this->readAsFolder($item_name);
     } else {
         return $this->readAsFile($item_name);
     }
 }
Ejemplo n.º 2
0
 /**
  * Get url to folder content
  *
  * @param Path $path
  * @param null|string $name
  * @return string
  */
 public function forFolder(Path $path, $name = null)
 {
     $folder_path = FileSystem::join($path->relativePath(), $name);
     return action($this->dir_action, $this->pathToUrl($folder_path));
 }
Ejemplo n.º 3
0
 /**
  * Get thumb File or folder full system path
  *
  * @param $size
  * @param File|null $file
  * @return string
  */
 public function thumbPath($size, File $file = null)
 {
     $thumb_path = [$this->sys_path, $this->thumbDirName(), Str::slug($size)];
     if (!is_null($file)) {
         $thumb_path[] = $file->fullName();
     }
     return FileSystem::join($thumb_path);
 }
Ejemplo n.º 4
0
 /**
  * Get current folder system path
  *
  * @return string
  * @throws FileManagerException
  */
 public function fullPath()
 {
     return FileSystem::join($this->getPath()->path(), $this->name());
 }