Generate a list of all folders from all the trees.

@return Collection
@return string[]
170956
private function allMediaFolders(): Collection
    {
        $base_folders = DB::table('gedcom_setting')
            ->where('setting_name', '=', 'MEDIA_DIRECTORY')
            ->select(DB::raw("setting_value || 'dummy.jpeg' AS path"));

        return DB::table('media_file')
            ->join('gedcom_setting', 'gedcom_id', '=', 'm_file')
            ->where('setting_name', '=', 'MEDIA_DIRECTORY')
            ->where('multimedia_file_refn', 'LIKE', '%/%')
            ->where('multimedia_file_refn', 'NOT LIKE', 'http://%')
            ->where('multimedia_file_refn', 'NOT LIKE', 'https://%')
            ->select(DB::raw('setting_value || multimedia_file_refn AS path'))
            ->union($base_folders)
            ->pluck('path')
            ->map(static function (string $path): string {
                return dirname($path) . '/';
            })
            ->unique()
            ->sort()
            ->mapWithKeys(static function (string $path): array {
                return [$path => $path];
            });
    }
147247
public function getListingFolders() {
		$folders = imap_list($this->getImapStream(), $this->imapPath, "*");
		foreach ($folders as $key => $folder)
		{
			$folder = str_replace($this->imapPath, "", imap_utf7_decode($folder));
			$folders[$key] = $folder;
		}
		return $folders;
	}
634466
public function GetAll() {
      $CategoryData = $this->SQL
         ->Select('c.*')
         ->From('Category c')
         ->OrderBy('TreeLeft', 'asc')
         ->Get();
         
      $this->AddCategoryColumns($CategoryData);
      return $CategoryData;
   }
698617
public function getFolders($recursive = false)
    {
        return $this->appendIterator(
            function ($path) use ($recursive) {
                return Filesystem::folders((string) $path, $recursive);
            }
        );
    }
846930
public function getFolders() {

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

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

		return $result;

	}
94904
private function getRootNodes()
    {
        $output = array();
        foreach( $this->nodes as $node )
            if (! $node->parentCount() )
                $output[] = $node;
        return $output;
    }
872575
private function allFolders(Tree $tree): array
    {
        $folders = DB::table('media_file')
            ->where('m_file', '=', $tree->id())
            ->where('multimedia_file_refn', 'NOT LIKE', 'http:%')
            ->where('multimedia_file_refn', 'NOT LIKE', 'https:%')
            ->where('multimedia_file_refn', 'LIKE', '%/%')
            ->pluck('multimedia_file_refn', 'multimedia_file_refn')
            ->map(static function (string $path): string {
                return dirname($path);
            })
            ->unique()
            ->sort()
            ->all();

        // Ensure we have an empty (top level) folder.
        array_unshift($folders, '');

        return array_combine($folders, $folders);
    }
793379
public function getFiles()
    {
        $dir = WINDWALKER_CACHE . '/profiler';

        if (!is_dir($dir)) {
            return [];
        }

        return new \RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir, \FilesystemIterator::SKIP_DOTS));
    }
1022447
public function getAllPaths()
    {
        $paths = [];

        foreach ($this as $endpoint) {
            foreach ($endpoint->getPaths() as $path) {
                $paths[] = $path;
            }
        }

        return $paths;
    }
145732
public function getFileList()
    {
        $allfiles = [];

        foreach ($this->filesets as $fs) {
            $ds = $fs->getDirectoryScanner($this->project);

            $files = $ds->getIncludedFiles();

            // We need to store these files keyed by the basedir from DirectoryScanner
            // so that we can resolve the fullpath of the file later.
            if (isset($allfiles[$ds->getBasedir()])) {
                $allfiles[$ds->getBasedir()] = array_merge($allfiles[$ds->getBasedir()], $files);
            } else {
                $allfiles[$ds->getBasedir()] = $files;
            }
        }

        $struc = [];

        foreach ($allfiles as $basedir => $files) {
            foreach ($files as $file) {
                // paths are relative to $basedir above
                $path = strtr(dirname($file), DIRECTORY_SEPARATOR, '/');

                if (!$path || $path == '.') {
                    $path = '/'; // for array index
                }

                $parts = explode('.', basename($file));
                $ext = array_pop($parts);
                if (strlen($ext) == strlen($file)) {
                    $ext = '';
                }

                $f = new PhingFile($basedir, $file);

                $struc[$path][] = [
                    'file' => basename($file),
                    'ext' => $ext,
                    'path' => (($path == '/') ? basename($file) : $path . '/' . basename($file)),
                    'fullpath' => $f->getAbsolutePath()
                ];
            }
        }

        uksort($struc, 'strnatcasecmp');
        foreach ($struc as $key => $ind) {
            usort($ind, [$this, 'sortfiles']);
            $struc[$key] = $ind;
        }

        $tempstruc = $struc;
        $struc = ['/' => $tempstruc['/']];
        $bv = 0;
        foreach ($tempstruc as $key => $ind) {
            $save = $key;
            if ($key != '/') {
                $struc['/'] = $this->setupDirs($struc['/'], explode('/', $key), $tempstruc[$key]);
            }
        }
        uksort($struc['/'], [$this, 'mystrucsort']);

        return $struc;
    }
341501
public function getTree($categories = [])
    {
        /** @var $category Category */
        foreach ($this as $category) {
            $categories[] = $category;
            $categories = $category->getChildren()->notDeleted()->findAll()->getTree($categories);
        }

        return $categories;
    }
784690
public function getDirectoryTreeList()
    {
        $finder = new Finder();
        $finder->in($this->rootPath)->directories();

        $directories = array();


        $rootFinder = new Finder();
        $rootFinder->in($this->rootPath)->depth(0);

        //Add root directory
        $directories[] = new Directory($this->virtualRootPath, $rootFinder->directories()->count(), $rootFinder->files()->count());

        foreach($finder as $dir){
            $dirFinder = new Finder();
            $dirFinder->in($dir->getPathname())->depth(0);

            $virtualAbsolutePath = substr($this->fs->makePathRelative($dir->getPathname(), $this->rootPath), 0, -1); //substring to remove last /

            $directories[] = new Directory($this->virtualRootPath .'/' . $virtualAbsolutePath, $dirFinder->files()->count(), $dirFinder->directories()->count());
        }

        return $directories;
    }
389304
protected function getConfigTree(): array
    {
        $tree = [$this->getConfig()];
        $parent = $this->container;
        while ($parent = $parent->getParent()) {
            $tree[] = $parent->getConfig()->getConfig();
        }

        return $tree;
    }
107878
public function actionDataFolders()
    {
        return $this->getOrSetHasCache('storageApiDataFolders', function () {
            $folders = [];
            foreach (Yii::$app->storage->findFolders() as $key => $folder) {
                $folders[$key] = $folder->toArray();
                $folders[$key]['toggle_open'] = (int) Yii::$app->adminuser->identity->setting->get('foldertree.'.$folder->id);
                $folders[$key]['subfolder'] = Yii::$app->storage->getFolder($folder->id)->hasChild();
            }
            return $folders;
        }, 0, new DbDependency(['sql' => 'SELECT MAX(id) FROM {{%admin_storage_folder}} WHERE is_deleted=false']));
    }
31188
public function getOtherDirectories()
    {
        $directories = array();
        foreach ($this->otherDirectories as $directory) {
            $directories[] = sprintf('%s/%s', $this->getHost()->getPath(), $directory);
        }

        return $directories;
    }
424416
public function getTreePathRows()
    {
        $parts = array($this);
        $upperRow = $this;
        while (!is_null($upperRow = $upperRow->getParentNode())) {
            $parts[] = $upperRow;
        }
        return array_reverse($parts);
    }
1362045
public function toArray()
    {
        return [
            'folderId' => $this->folder->getId(),
            'usageType' => $this->usageType,
            'usageId' => $this->usageId,
            'status' => $this->status,
        ];
    }