@param string $path

@return array|bool
517688
public function getMimetype($path)
    {
        $meta = $this->getMetadata($path);

        return isset($meta['ContentType'])
            ? ['mimetype' => $meta['ContentType']] : false;
    }
991704
public function getMetadata($path)
    {
        $connection = $this->getConnection();

        if ($path === '') {
            return ['type' => 'dir', 'path' => ''];
        }

        if (@ftp_chdir($connection, $path) === true) {
            $this->setConnectionRoot();

            return ['type' => 'dir', 'path' => $path];
        }

        $listing = $this->ftpRawlist('-A', str_replace('*', '\\*', $path));

        if (empty($listing) || in_array('total 0', $listing, true)) {
            return false;
        }

        if (preg_match('/.* not found/', $listing[0])) {
            return false;
        }

        if (preg_match('/^total [0-9]*$/', $listing[0])) {
            array_shift($listing);
        }

        $filename = basename($path);
        $basePath = str_replace($filename, null, $path);
        $basePath = rtrim($basePath, '/');

        return $this->normalizeObject($listing[0], $basePath);
    }
937109
public function getClassesByPath($path)
    {
        $allClasses = [];
        foreach ($this->findAllClasses([$this->rootPath."/$path"], 'php') as $class){
            $allClasses[] = trim($class,"0\\");
        }

        return $allClasses;
    }
732190
public function checkPath($path)
    {
        $path = realpath($path);

        return ($path !== false && is_dir($path)) ? $path : false;
    }
1184708
public function findCommands($path)
	{
		if(($dir=@opendir($path))===false)
			return array();
		$commands=array();
		while(($name=readdir($dir))!==false)
		{
			$file=$path.DIRECTORY_SEPARATOR.$name;
			if(!strcasecmp(substr($name,-11),'Command.php') && is_file($file))
				$commands[strtolower(substr($name,0,-11))]=$file;
		}
		closedir($dir);
		return $commands;
	}
206615
public static function get($path)
    {
        $ext = strtolower(pathinfo($path, PATHINFO_EXTENSION));
        if (!isset(self::$fileTypes[$ext])) {
            return false;
        }
        return self::$fileTypes[$ext];
    }
1302947
public function getByPath($path)
    {
        if (isset($this->nodesByPath[$path])) {
            return $this->nodesByPath[$path];
        }

        return false;
    }
1294703
private function buildPath($path)
    {
        $result = [];
        foreach (explode('/', $path) as $value) {
            if (!empty($value)) {
                $result[] = (int) $value;
            }
        }
        return $result;
    }
740244
private function getFiles($path)
    {
        if (is_file($path)) {
            return [new SplFileInfo($path, '', '')];
        }

        return $this->finder->name('*.php')->in(realpath($path));
    }
705540
public function readStream($path)
    {
        $contents = $this->client->getObject($this->bucket, $path);

        if ($contents != null) {
            $stream = fopen('php://temp', 'w+b');
            fwrite($stream, $contents);
            rewind($stream);

            return ['path' => $path, 'stream' => $stream];
        }

        return false;
    }
808760
public function _pathAsArray($path)
    {
        $result = explode(self::PS, $path);
        // unset empty nodes
        foreach ($result as $key => $item) {
            if (!$item && $item !== "0") {
                unset($result[$key]);
            }
        }
        // re-index array
        $result = array_values($result);
        return $result;
    }
1373354
public function getFolder($path = '')
    {
        if (!array_key_exists($path,$this->folders)) {

            $this->folders[$path] = false;
            if (file_exists($this->baseFolder . '/' . $path)) {
                $result = ['folders' => $this->listSubFolder($path), 'files' => $this->listFiles($path)];

                $folder = new Folder($path, $result);

                $this->folders[$path] = $folder;

            }
        }

        return $this->folders[$path];

    }
873769
protected static function scandirJob(string $path): ?array
    {
        if (!\is_dir($path)) {
            return null;
        }
        
        $entries = @\glob($path . \DIRECTORY_SEPARATOR . '*', \GLOB_NOSORT);
        
        return ($entries === false) ? null : $entries;
    }
5297
private function parsePath($path)
    {
        $parts = array(
            'template' => null,
            'path' => null,
        );

        // strip out any query params
        if (preg_match('/^\/?(.*?)\/(.*)/', $path, $matches)) {
            $parts['template'] = $matches[1];
            $parts['path'] = $matches[2];
        }

        return $parts;
    }
490892
private function _list(string $path): array {
        $result = [];
        $scan = glob($path . '/*');
        foreach ($scan as $item) {
            if (is_dir($item)) {
                $result[basename($item)] = $this->_list($item);
            } else {
                $result[] = basename($item);
            }
        }
        return $result;
    }
58031
protected function getPath($path)
	{
		$paths = array();

		// If `$path` is an array
		if (is_array($path))
		{
			foreach ($path as $unverifiedPath)
			{
				$paths = array_merge($paths, $this->getPath($unverifiedPath));
			}

			return $paths;
		}

		// If `$path` is a directory
		if (is_dir($path))
		{
			$paths = glob($path . '/*.*');

			return $paths;
		}

		// If `$path` is a file
		if (file_exists($path))
		{
			$paths[] = $path;
		}

		return $paths;
	}
1148879
protected function getFileInfo($path)
    {
        return [
            'name' => substr($path, strrpos($path, '/') + 1),
            'path' => $path,
            'url'  => $this->getFileUrl($path),
        ];
    }