Get all of the configuration files for the directory.

@param string $directoryPath

@return array
336999
protected function getConfigurationFiles($directoryPath)
    {
        $files = [];

        if (is_dir($directoryPath)) {
            foreach (Finder::create()->files()->in($directoryPath) as $file) {
                $group = basename($file->getRealPath(), '.php');
                $files[$group] = $file->getRealPath();
            }
        }

        return $files;
    }
369304
private function _getFeatureFiles($featurePath)
    {
        $featureFiles = [];
        /* @var $featureNodes \Behat\Gherkin\Node\FeatureNode[] */
        $featureNodes = $this->container->get('gherkin')->load($featurePath);
        foreach ($featureNodes as $featureNode) {
            $featureFiles[] = $featureNode->getFile();
        }

        return $featureFiles;
    }
1183942
protected function readConfig($path)
    {
        if (!file_exists($path) || !is_file($path) || !is_readable($path)) {
            return array();
        }

        $yaml = new Parser();

        try {
            $config = (array) $yaml->parse(file_get_contents($path));
        } catch (ParseException $e) {
            return array();
        }

        // adjust relative paths
        foreach ($this->paths as $key) {
            if (isset($config[$key])) {
                $config[$key] = $this->normalizePath($config[$key]);
            }
        }

        return $config;
    }
975242
protected function getConfigurationDirectory()
    {
        $reflector = new \ReflectionClass($this);
        $fileName = $reflector->getFileName();

        if (!is_dir($directory = dirname($fileName) . $this->configDirectory)) {
            throw new \RuntimeException(sprintf('The configuration directory "%s" does not exists.', $directory));
        }

        return $directory;
    }
338654
public function getFilePath($filePath)
    {
        $composerFiles = [];
        foreach ($this->alias as $name => $path) {
            $composerFiles[] = $path . '/' . $filePath;
        }

        return FileHelper::getFirstExistingFileArray($composerFiles);
    }
1249478
public function getDirs($dir)
    {
        $dirArr = array();
        $files = ftp_rawlist($this->link, $dir);
        foreach ($files as $v) {
            $file = ltrim(strrchr($v, ' '), ' ');
            $path = "{$dir}/{$file}";
            if (preg_match('/^d/', $v)) {
                if (in_array($file, array('.', '..'))) {
                    continue;
                }
                if (preg_match('/^[a-zA-z0-9]+$/', $file)) { //file check
                    $dirArr[] = $path;
                    $dirArr = array_merge($dirArr, self::getDirs($path));
                }
            }
        }
        return $dirArr;
    }
1122903
private static function importFromPath(string $path): array
    {
        $conf = [];
        $paths = new DirectoryIterator($path);

        foreach ($paths as $path) {
            if ($path->isDot()) {
                continue;
            }

            if ($path->isDir()) {
                $conf[$path->getFileName()] = static::importFromPath($path->getPathName());
            }

            if ($path->isFile()) {
                if ($path->getExtension() === 'yml') {
                    $pathinfo = pathinfo($path->getFileName());

                    $conf[$pathinfo['filename']] = (array) static::readFile($path->getPathName(), []);

                    unset($pathinfo);
                }
            }
        }

        unset($paths);

        return $conf;
    }
1122543
protected function getConfigurationFiles($path)
	{
		$files = [];

		foreach (Finder::create()->files()->name('*.php')->in($path) as $file)
		{
			$files[basename($file->getRealPath(), '.php')] = $file->getRealPath();
		}

		return $files;
	}
325875
private function getConfigurationFiles()
    {
        $path = $this->configPath;

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

        $files = [];
        $phpFiles = Finder::create()->files()->name('*.php')->in($path)->depth(0);

        foreach ($phpFiles as $file) {
            $files[basename($file->getRealPath(), '.php')] = $file->getRealPath();
        }

        return $files;
    }
520860
protected function getFilesFromFolder($folderPath)
    {
        return FileHelper::findFiles($folderPath, [
            'recursive' => false,
            'caseSensitive' => false,
            'only' => ['*.php'],
            'filter' => function ($path) {
                return in_array(substr(basename($path), 0, 1), $this->ignorePrefix) ? false : null;
            }]);
    }
70279
private function loadDirectories($dirPath)
    {
        $locales = new LocaleCollection;

        foreach ($this->filesystem->directories($dirPath) as $path) {
            $excluded = in_array($key = basename($path), $this->excludedFolders);

            if ( ! $excluded) {
                $locales->addOne(
                    new Locale($key, $path, $this->loadLocaleFiles($path))
                );
            }
        }

        return $locales;
    }
350833
protected function getFileList($dirPath)
    {
        $fileList = array();

        $paths = $this->getFileDirs($dirPath);
        foreach ($paths as $filesPath) {
            if (file_exists($filesPath)) {
                $files = $this->getFileManager()->getFileList($filesPath, true, '', true, true);
                $fileList = array_merge($fileList, $files);
            }
        }

        //vendor file list
        $vendorFileList = $this->getVendorFileList('copy');
        if (!empty($vendorFileList)) {
            $fileList = array_merge($fileList, $vendorFileList);
        }

        return $fileList;
    }
1116435
private function buildPathes(string $projectPath): array
    {
        if (substr($projectPath, -1) !== DIRECTORY_SEPARATOR) {
            $projectPath .= DIRECTORY_SEPARATOR;
        }

        $pathes = [];
        foreach ($this->pathTypes as $pathType) {
            $pathes['stubbles.' . $pathType . '.path'] = $projectPath . $pathType;
        }

        return $pathes;
    }
188705
public function getResultFor($partialPath)
    {
        if (file_exists($partialPath) && is_dir($partialPath)) {
            $path = $partialPath;
        } else {
            $path = dirname($partialPath);
        }

        if (!file_exists($path) || !is_dir($path) || !is_readable($path)) {
            return array();
        }

        $finder = $this->newFinder()->maxDepth(1)->in($path);

        $paths = array();
        foreach ($finder as $file) {
            /** @var SplFileInfo $file */
            $filePath = $file->getPathname();
            if ($file->isDir()) {
                $filePath .= DIRECTORY_SEPARATOR;
            }
            if (DIRECTORY_SEPARATOR === $path && DIRECTORY_SEPARATOR === $partialPath) {
                $filePath = substr($filePath, 1);
            }
            $paths[] = preg_replace('#'.preg_quote(DIRECTORY_SEPARATOR, '#').'+#', DIRECTORY_SEPARATOR, $filePath);
        }
        return $paths;
    }
189893
protected function getConfigFromXmlFile($filepath)
	{
		$dom = new DOMDocument;
		$dom->loadXML(file_get_contents($filepath), LIBXML_NOCDATA);

		return $this->getElementConfig($dom->documentElement);
	}
1153383
public function getAllFiles($path){
        $fullpath = $this->getFullPath().$path;
        if(file_exists($fullpath)){
            $file = new \SplFileInfo($fullpath);
            if($file->isDir()){
                $r = array();
                // if($path != "/") $r[] = $this->folderParent($path);
                $finder = new Finder();
                $directories = $finder->notName($this->config['folder_thumb']);
                if (count($this->config['folder_excludes'])>0) {
                    foreach ($this->config['folder_excludes'] as $value) {
                        $directories = $finder->notName($value);
                    }
                }
                //$directories = $directories->notName('web.config')->notName('.htaccess')->depth(0)->sortByType();
                $directories = $directories->notName('web.config')->notName('.htaccess')->depth(0)->sort(
                    function ($a, $b) {return $b->getMTime() - $a->getMTime();}
                    );
                // $directories = $directories->files()->name('*.jpg');
                $directories = $directories->in($fullpath);
                foreach ($directories as $key => $directorie) {
                    $namefile = $directorie->getFilename();
                    if($directorie->isDir() && $this->validNameFile($namefile,false)){
                        $t = $this->dirInfo($directorie,$path);
                        if($t) $r[] = $t;
                    }elseif($directorie->isFile() && $this->validNameFile($namefile)){
                        $t = $this->fileInfo($directorie,$path);
                        if($t) $r[] = $t;
                    }
                }
                return $r;
            }elseif($file->isFile()){
                $t = $this->fileInfo($file,$path);
                if($t){
                    return $t;
                }else{
                    $result = array("query"=>"BE_GETFILEALL_NOT_LEIBLE","params"=>array());
                    $this->setInfo(array("msg"=>$result));
                    if( $this->config['debug'] ) $this->_log(__METHOD__." - Archivo no leible - $fullpath");
                    return;
                }
            }elseif($file->isLink()){
                $result = array("query"=>"BE_GETFILEALL_NOT_PERMITIDO","params"=>array());
                $this->setInfo(array("msg"=>$result));
                if( $this->config['debug'] ) $this->_log(__METHOD__." - path desconocido - $fullpath");
                return ;
            }
        }else{
            $result = array("query"=>"BE_GETFILEALL_NOT_EXISTED","params"=>array());
            $this->setInfo(array("msg"=>$result));
            if( $this->config['debug'] ) $this->_log(__METHOD__." - No existe el archivo - $fullpath");
            return ;
        }
    }
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;
    }