getContentsTree() public method

Get the contents of a given cabin/directory, recursively
public getContentsTree ( string $cabin, string $base, string $thisDir ) : array
$cabin string
$base string
$thisDir string
return array
Ejemplo n.º 1
0
 /**
  * Move/Rename a directory
  *
  * @param string $path
  * @param string $cabin
  */
 protected function commonMoveDir(string $path, string $cabin)
 {
     if (!$this->permCheck()) {
         \Airship\redirect($this->airship_cabin_prefix);
     }
     list($publicPath, $root) = $this->loadCommonData($path, $cabin);
     if (empty($root)) {
         \Airship\redirect($this->airship_cabin_prefix);
     }
     $forParent = \Airship\chunk($path);
     $dir_name = \array_pop($forParent);
     $parent = \implode('/', $forParent);
     $contents = $this->files->getContentsTree($cabin, $this->root_dir, $path);
     $post = $this->post(new MoveDirFilter());
     if (!empty($post)) {
         if ($this->files->moveDir($cabin, $this->root_dir, $path, $post)) {
             \Airship\redirect($this->airship_cabin_prefix . '/' . $this->path_middle . '/' . $cabin, ['dir' => $parent]);
         }
     }
     $ignore = $path . '/';
     $this->lens('files/move_dir', ['cabins' => $this->getCabinNamespaces(), 'root_dir' => $this->root_dir, 'dir_contents' => $contents, 'all_dirs' => $this->files->getDirectoryTree($cabin, $this->root_dir, $ignore), 'parent_dir' => $parent, 'dir' => $path, 'dir_name' => $dir_name, 'cabin' => $cabin, 'pathinfo' => $publicPath]);
 }