Return the directories where to find the configuration file.

@param  string $fileName
@return array
161656
private function getDirs($fileName)
    {
        if (is_file($fileName)) {
            return [];
        }

        $currentDir = getcwd();

        if (is_dir($fileName)) {
            $currentDir = $fileName;
        }

        $dirs[] = $currentDir;
        if (is_dir($currentDir.'/conf')) {
            $dirs[] = $currentDir.'/conf';
        }
        if (is_dir($currentDir.'/config')) {
            $dirs[] = $currentDir.'/config';
        }

        return $dirs;
    }
115351
private function getFinder($fileName, ContainerBuilder $container)
    {
        $finder       = (new Finder())->files()->name($fileName);
        $resourcesDir = 'Resources'.DIRECTORY_SEPARATOR.'config';

        if (self::$directoriesCache) {
            return $finder->in(self::$directoriesCache);
        }

        foreach ($container->getParameter('kernel.bundles') as $name => $pathToBundle) {
            try {
                $reflector = new \ReflectionClass($pathToBundle);
            } catch (\ReflectionException $e) {
                continue;
            }

            $fileName = $reflector->getFileName();
            $fileName = str_replace($name.'.php', $resourcesDir, $fileName);

            try {
                $finder->in($fileName);
                self::$directoriesCache[$name] = $fileName;
            } catch (\InvalidArgumentException $e) {
                // remove invalid directories
                unset(self::$directoriesCache[$name]);
            }
        }

        return $finder;
    }
575147
private function getDirectories($dir, $directoryName = null)
    {
        $finder = new Finder();
        $finder->directories()->in($dir);

        if (null !== $directoryName) {
            $finder->name($directoryName);
        }

        if (iterator_count($finder) > 0) {
            return iterator_to_array($finder);
        }

        return false;
    }
1156747
public static function getIcon($filename): array
    {
        $fileExtention = self::extractFileExtension($filename);
        if (isset(self::$cache[$fileExtention])) {
            return self::$cache[$fileExtention];
        }

        $fileTypeIcon = new FileTypeIcon($fileExtention);

        self::$cache[$fileExtention] = [
            'src' => $fileTypeIcon->path(),
            'alt' => $fileTypeIcon->alt()
        ];

        return self::$cache[$fileExtention];
    }
79101
private function readConfigFile(string $configFilename): array
  {
    $settings = parse_ini_file($configFilename, true);

    $this->constantsFilename = self::getSetting($settings, false, 'constants', 'columns');
    $this->className         = self::getSetting($settings, false, 'constants', 'class');

    return $settings;
  }
1146365
protected function getTrans($filename)
    {
        if (is_file($filename)) {
            $trans = Yaml::parse(file_get_contents($filename));
        } else {
            $trans = array();
        }

        $keys = array('breadcrumb', 'list', 'filter', 'show', 'form');
        foreach ($keys as $key) {
            if (!array_key_exists($key, $trans)) {
                $trans[$key] = array();
            }
        }

        return $trans;
    }
26959
public function findPath($filename)
    {
        if (!isset($this->_paths[$filename])) {
            foreach ($this->_search_paths as $path) {
                $file = $path.'/'.$filename;
                if ($this->findFile($file)) {
                    $this->_paths[$filename] = $file;
                    return $file;
                }
            }

            $this->_paths[$filename] = false;
        }

        return $this->_paths[$filename];
    }
20603
public function getFileContents($filename)
    {

        $cachecontents = $this->get($this->cachefilekey($filename));
//        $timestamp = $this->get($this->cachefiletskey($filename));

        if ($cachecontents !== false && is_array($cachecontents)) {

            $contents = array_key_exists('v', $cachecontents)?$cachecontents['v']:false;
            $timestamp = array_key_exists('t', $cachecontents)?$cachecontents['t']:false;

            if (filemtime($filename) === (int)$timestamp)
                return $contents;
        }

        $contents = file_get_contents($filename);
        $ts = filemtime($filename);

        // Populate all caches.
        $this->put($this->cachefilekey($filename), array('v' => $contents, 't'=> $ts), 0);
//        $this->put($this->cachefiletskey($filename), "{$filename};{$ts}", 0);

        return $contents;
    }
1354309
private function _findFile(string $dirName, string $fileName): ?FileHandler {
        $dirs = glob($dirName . '*');
        $file = null;
        foreach ($dirs as $d) {
            if (is_file($d)) {
                $pathInfo = \pathinfo($d);
                $pathInfo2 = \pathinfo($fileName);

                if (isset($pathInfo2["extension"])) {
                    $condition = $pathInfo["basename"] === $pathInfo2["basename"];
                } else {
                    $condition = $pathInfo["filename"] === $pathInfo2["filename"];
                }

                if ($condition) {
                    return new FileHandler($dirName . "/" . $pathInfo["basename"]);
                }
            } else if (is_dir($d)) {
                $tmp = $this->_findFile($d . "/", $fileName);
                if (null !== $tmp) {
                    $file = $tmp;
                }
            }
        }
        return $file;
    }
1261413
protected function getData( $filename )
    {

        $matches = [];

        $regex = '/(.+)-([0-9_]+)x([0-9_]+)(-resize)*(\-\[([\-\d\.]+)x([\-\d\.]+)\])*\.([A-z]+)$/';

        preg_match( $regex, $filename, $matches );


        $path = $matches[1];
        $extension = $matches[8];
        $imagePath = sprintf( '%s/%s.%s', dirname( $filename ), basename( $path ), $extension );

        $width = $matches[2];
        $height = $matches[3];

        $focusX = $matches[6];
        $focusY = $matches[7];

        return [
            'filepath'=> $imagePath,
            'resize'=> $matches[4] != '',

            'width'=> $width != '_' ? $width : null,
            'height'=> $height != '_' ? $height : null,

            'focusX' => $focusX != '' ? $focusX : null,
            'focusY' => $focusY != '' ? $focusY : null,
        ];

    }
473644
public function getFilePaths()
    {
        $files = [];
        foreach ($this->config->getIncludedPaths() as $path) {
            $files[] = $this->getAllFilesFromGit($this->getGitRepositoryFor($path));
        }

        return array_merge(...$files);
    }
602139
public static function load($directoryName = 'filters'): array
    {
        $files = static::getFilePattern($directoryName);

        return collect(glob($files))
            ->map(function ($filename) {
                return include $filename;
            })
            ->flatten(1)
            ->toArray();
    }
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;
    }
354525
public function get($filename)
    {
        if ($this->exists($filename) && $this->isFile($filename)) {
            return file_get_contents($filename);
        }

        throw new FileNotFoundException('File not found in the path [ ' . $filename . ' ].');
    }
114745
public function locateName($fileName)
    {
        $list = $this->zip->listContent();
        $listCount = count($list);
        $list_index = -1;
        for ($i = 0; $i < $listCount; ++$i) {
            if (strtolower($list[$i]["filename"]) == strtolower($fileName) ||
                strtolower($list[$i]["stored_filename"]) == strtolower($fileName)) {
                $list_index = $i;
                break;
            }
        }
        return ($list_index > -1);
    }
728389
protected function getContent(string $filename): string
    {
        return \file_get_contents($this->getSafepath($this->rootDir . DIRECTORY_SEPARATOR . $filename));
    }
167603
public function getTemplateFileContents($filename)
    {
        $templatePath = rtrim($this->config->get('templatepath', 'backend'), '\\/');
        if (empty($templatepath)) {
            $templatePath = $this->templatesPath;
        }

        return file_get_contents(
            "{$templatePath}/{$this->name}/{$filename}"
        );
    }