Airship\Cabin\Bridge\Landing\Proto\FileManager::loadCommonData PHP Method

loadCommonData() protected method

Reduce code duplication
protected loadCommonData ( string $path, string $cabin ) : array
$path string
$cabin string
return array (array $publicPath, int|null $root)
    protected function loadCommonData(string $path, string $cabin) : array
    {
        if (!$this->permCheck()) {
            \Airship\redirect($this->airship_cabin_prefix);
        }
        $root = null;
        $publicPath = \Airship\chunk($path);
        $pathInfo = $this->getPath($path);
        if (!empty($pathInfo)) {
            try {
                $root = $this->files->getDirectoryId($pathInfo, $cabin);
            } catch (FileNotFound $ex) {
                \Airship\redirect($this->airship_cabin_prefix);
            }
        }
        // return [$pathInfo, $publicPath, $root];
        return [$publicPath, $root];
    }