Reads the directories inside the plugins/ directory and returns their names in an array

@return array
484132
public function readPluginsDirectory()
    {
        $result = array();
        foreach (self::getPluginsDirectories() as $pluginsDir) {
            $pluginsName = _glob($pluginsDir . '*', GLOB_ONLYDIR);
            if ($pluginsName != false) {
                foreach ($pluginsName as $path) {
                    if (self::pluginStructureLooksValid($path)) {
                        $result[] = basename($path);
                    }
                }
            }
        }

        sort($result);

        return $result;
    }
682939
protected function _getPaths()
    {
        $directories = $this->_createDirectoryIterator($this->_getRootDir());
        $flattened   = $this->_createRecursiveIteratorIterator($directories);
        $flattened->setMaxDepth($this->_getMaxDepth());
        $filter = $this->_createFilterIterator($flattened, function (SplFileInfo $current, $key, Iterator $iterator) {
            return $this->_filterFile($current);
        });

        return $filter;
    }
1068617
public static function all()
    {
        $plugins = Grav::instance()['plugins'];
        $list = [];

        foreach ($plugins as $instance) {
            $name = $instance->name;
            $result = self::get($name);

            if ($result) {
                $list[$name] = $result;
            }
        }

        return $list;
    }
500007
public function getFilenames()
    {
        $files = [];
        foreach ($this->classList->getClasses() as $class) {
            // Push interfaces before classes if not already loaded
            try {
                $r = new \ReflectionClass($class);
                foreach ($r->getInterfaces() as $inf) {
                    $name = $inf->getFileName();
                    if ($name && !in_array($name, $files)) {
                        $files[] = $name;
                    }
                }
                if (!in_array($r->getFileName(), $files)) {
                    $files[] = $r->getFileName();
                }
            } catch (\ReflectionException $e) {
                // We ignore all exceptions related to reflection because in
                // some cases class doesn't need to exist. We're ignoring all
                // problems with classes, interfaces and traits.
            }
        }

        return $files;
    }
885839
public function getParentDirectories()
    {
        if ($this->isCurrentDirectoryBase()) {
            return [];
        }

        $currentDir = $this->currentDir;
        $dirs = [];
        do {
            $dir = dirname($currentDir);
            $dirs[] = $this->getPathRelativeToBaseDir($dir)
                ?: DIRECTORY_SEPARATOR;
            $currentDir = $dir;
        } while ($dir !== $this->baseDir);

        return array_reverse($dirs);
    }
1195526
public function getFiles()
    {
        $finders = [
            MainConfigurationFinder::class,
            ContextualConfigurationFinder::class,
            PluginsConfigurationFinder::class,
        ];

        // Filter out non-existing folders
        $folders = $this->getFolders();
        if (!$folders) {
            return [];
        }

        $files = [];
        foreach ($folders as $folder) {
            foreach ($finders as $finder) {
                /** @var AbstractConfigurationFinder $finder */
                $finder = new $finder($this->files, $folder);
                $files = array_merge($files, $finder->getFiles());
            }
        }

        // Load consolidated configuration
        $folder = $this->paths->getRocketeerPath();
        if ($this->files->has($folder)) {
            $consolidated = new ConsolidatedConfigurationFinder($this->files, $folder);
            $files = array_merge($files, $consolidated->getFiles());
        }

        return $files;
    }
755557
public static function getPluginsDirectories()
    {
        $dirs = array(self::getPluginsDirectory());

        if (!empty($GLOBALS['MATOMO_PLUGIN_DIRS'])) {
            $extraDirs = array_map(function ($dir) {
                return rtrim($dir['pluginsPathAbsolute'], '/') . '/';
            }, $GLOBALS['MATOMO_PLUGIN_DIRS']);
            $dirs = array_merge($dirs, $extraDirs);
        }

        return $dirs;
    }
1302939
protected function _list($name = null)
    {
        if ($name === null) {
            $pluginsList = Plugin::loaded();
        } else {
            if (!Plugin::isLoaded($name)) {
                $this->err(sprintf('Plugin %s is not loaded.', $name));

                return [];
            }
            $pluginsList = [$name];
        }

        $plugins = [];

        foreach ($pluginsList as $plugin) {
            $path = Plugin::path($plugin) . 'webroot';
            if (!is_dir($path)) {
                $this->verbose('', 1);
                $this->verbose(
                    sprintf('Skipping plugin %s. It does not have webroot folder.', $plugin),
                    2
                );
                continue;
            }

            $link = Inflector::underscore($plugin);
            $dir = WWW_ROOT;
            $namespaced = false;
            if (strpos($link, '/') !== false) {
                $namespaced = true;
                $parts = explode('/', $link);
                $link = array_pop($parts);
                $dir = WWW_ROOT . implode(DIRECTORY_SEPARATOR, $parts) . DIRECTORY_SEPARATOR;
            }

            $plugins[$plugin] = [
                'srcPath' => Plugin::path($plugin) . 'webroot',
                'destDir' => $dir,
                'link' => $link,
                'namespaced' => $namespaced
            ];
        }

        return $plugins;
    }
846930
public function getFolders() {

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

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

		return $result;

	}
799744
public function dir_readdir()
    {
        if (!$this->childIterator->valid()) {
            return false;
        }

        $name = $this->childIterator->current();

        $this->childIterator->next();

        return $name;
    }
409231
public function getFiles() : array
    {
        Filesystem::checkExists($this->path);
        Filesystem::checkReadable($this->path);
        $contents = [];

        $files = scandir($this->path);
        foreach ($files as $file) {
            if($file != '.' && $file != '..') {
                $contents[] = Filesystem::get("$this->path/$file");
            }
        }
        return $contents;
    }
387046
private function get_all_plugin_names() {
		$names = array();
		foreach ( get_plugins() as $file => $details ) {
			$names[] = Utils\get_plugin_name( $file );
		}

		return $names;
	}
927632
public static function getList(): array
    {
        $result = [];
        $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Types';
        $dir = new Folder($path);

        $files = $dir->find('.*\.php');

        if (empty($files)) {
            return $result;
        }

        foreach ($files as $file) {
            $name = str_replace('.php', '', $file);
            $value = Inflector::underscore($name);
            $result[$value] = $name;
        }

        return $result;
    }
1305613
public function getPaths()
    {
        if (strpos('@PHP-BIN@', '@PHP-BIN') === 0) {
            $dataDir = dirname(__FILE__) . '/../';
            $phpDir = dirname(__FILE__) . '/';
        } else {
            $dataDir = '@DATA-DIR@/Phrozn/';
            $phpDir = '@PEAR-DIR@/Phrozn/';
        }
        return array(
            'data_dir'      => $dataDir,
            'php_dir'       => $phpDir,
            'configs'   => $dataDir . 'configs/',
            'skeleton'  => $dataDir . 'skeleton/',
            'library'   => $phpDir,
        );
    }
722614
protected function get_paths() {
		return [
			WP_LANG_DIR . '/' . $this->textdomain . '-' . get_locale() . '.mo',
			dirname( KIRKI_PLUGIN_FILE ) . '/languages/' . $this->textdomain . '-' . get_locale() . '.mo',
		];
	}
127602
public function content(): array
    {
        $dirs = collect($this->storage->allDirectories($this->root));
        $output = [];

        $dirs->filter(function ($dir) {
            $parts = $this->split($dir);
            return !in_array($parts[0], $this->exclude);
        })->each(function ($dir) use (&$output) {
            $curr = &$output;
            foreach ($this->split($dir) as $name) {
                if (!collect($curr)->contains('name', $name)) {
                    $curr[] = [
                        'path' => $this->dirToPath($dir),
                        'name' => $name,
                        'children' => []
                    ];
                } else {
                    foreach ($curr as $key => $item) {
                        if ($item['name'] === $name)
                            $curr = &$curr[$key]['children'];
                    }
                }
            }
        });

        return $output;
    }
910960
public function getInternalPlugins()
    {
        // Return only plugins with no custom url
        $plugins = [];
        foreach ($this->getPlugins() as $name => $url) {
            if (empty($url)) {
                $plugins[] = $name;
            }
        }
        return $plugins;
    }