Returns an array with all directories of the directory.

@return Directory[] Array with `\Alexya\FileSystem\Directory` objects for each directory on the directory.
422647
public function getDirectories() : array
    {
        if(!$this->_isLoaded) {
            $this->load();
        }

        return array_map(function($directory) {
            return new Directory($this->getPath(). DIRECTORY_SEPARATOR .$directory);
        }, $this->_directories);
    }
679886
public function getArray()
    {
        $contents = [];

        foreach (new DirectoryIterator($this->context) as $file) {
            if ($file->isDot()) {
                continue;
            }

            $className = $file->isDir() ? 'Directory' : ucfirst(strtolower($file->getExtension()));
            $classPath = 'PHLAK\\Config\\Loaders\\' . $className;

            $loader = new $classPath($file->getPathname());

            try {
                $contents = array_merge($contents, $loader->getArray());
            } catch (InvalidFileException $e) {
                // Ignore it and continue
            }
        }

        return $contents;
    }
347706
public function getFileSets()
    {
        $filesets = [];
        foreach ($this->getFileSetIDs() as $fsID) {
            $fs = FileSet::getByID($fsID);
            if ($fs !== null) {
                $filesets[] = $fs;
            }
        }

        return $filesets;
    }
1207882
public function files($directory)
    {
        $this->checkDirectory($directory);

        $disk = $this->disk();

        // TODO: Add a feature to exclude unwanted files.
        $files = array_map(function ($filePath) use ($disk, $directory) {
            return [
                'name'         => str_replace("$directory/", '', $filePath),
                'path'         => $filePath,
                'url'          => $disk->url($filePath),
                'mimetype'     => $disk->mimeType($filePath),
                'lastModified' => Carbon::createFromTimestamp($disk->lastModified($filePath))->toDateTimeString(),
                'visibility'   => $disk->getVisibility($filePath),
                'size'         => $disk->size($filePath),
            ];
        }, $disk->files($directory));

        return FileCollection::make($files)->exclude($this->getExcludedFiles());
    }
657906
public function keys() {
    $root = $this->directory;
    if (file_exists($root) && is_readable($root)) {
      return array_diff(scandir($root), array('..', '.'));
    }
    return [];
  }
170897
public function toArray()
    {
        return [
            'key'      => $this->key(),
            'name'     => $this->name(),
            'script'   => $this->script(),
            'dir'      => $this->direction(),
            'native'   => $this->native(),
            'regional' => $this->regional(),
        ];
    }
1282719
public function getDirectories()
    {
        return array(
            DirectoryKeys::TMP     => $this->getTmpBase(),
            DirectoryKeys::DEPLOY  => $this->getDeployBase(),
            DirectoryKeys::WEBAPPS => $this->getAppBase()
        );
    }
846930
public function getFolders() {

		$result = [];
		$files = glob($this->path . '*', GLOB_ONLYDIR);

		if($files) {
			foreach($files as $f) {
				$result[] = self::getInstance($f);
			}
		}

		return $result;

	}
1288525
public function getFiles() : array
    {
        if(!$this->_isLoaded) {
            $this->load();
        }

        return array_map(function($file) {
            return new File($this->getPath(). DIRECTORY_SEPARATOR .$file);
        }, $this->_files);
    }
1225883
public static function all()
    {
        $it = new DirectoryIterator(themes_path());
        $it->rewind();

        $result = [];
        foreach ($it as $fileinfo) {
            if (!$fileinfo->isDir() || $fileinfo->isDot()) {
                continue;
            }

            $theme = static::load($fileinfo->getFilename());

            $result[] = $theme;
        }

        return $result;
    }
861726
public function dir_readdir()
  {
    $each = each($this->_dirFiles);

    if ($each === false) {
      $result = false;
    } else {
      $result = $each["value"];
    }

    return $result;
  }
993448
public function getDirectoryParts(): array
    {
        return $this->myAboveBaseLevel === 0 ? $this->myDirectoryParts : array_merge(array_fill(0, $this->myAboveBaseLevel, '..'), $this->myDirectoryParts);
    }
522505
protected function getPaths(): array
    {
        $paths = [
            base_path('app'),
            base_path('modules'),
            base_path('resources'),
            base_path('routes'),
        ];

        foreach ($paths as $i => $path) {
            if (!File::isDirectory($path)) {
                unset($paths[$i]);
            }
        }

        return $paths;
    }
667278
public function directories($directory = null, $recursive = false)
    {

        $directories = [ ];

        foreach (Finder::create()->in($directory)->directories() as $dir) {
            $directories[] = $dir->getPathname();
        }

        return $directories;
    }
147122
public function getDirectory()
    {
        if (!isset($this->directory)) {
            $this->setDirectory($this->getPHPCI()->buildPath);
        }
        return $this->directory;
    }
902934
public function fileList()
    {
        $result = array();

        $dirContent = opendir($this->_dirPath);
        while (($file = readdir($dirContent)) !== false) {
            if (($file == '..')||($file == '.')) {   continue;
            }

            if(!is_dir($this->_dirPath . '/' . $file) ) {
                $result[] = $file;
            }
        }
        closedir($dirContent);

        return $result;
    }
394237
public function directories($directory)
    {
        $directories = [];

        foreach (Finder::create()->in($directory)->directories()->depth(0)->sortByName() as $dir) {
            $directories[] = $dir->getPathname();
        }

        return $directories;
    }