Get the configuration file nesting path.

@param  \Symfony\Component\Finder\SplFileInfo  $file
@return string
178109
private function getConfigurationNesting(SplFileInfo $file)
	{
		$directory = dirname($file->getPathname());

		if ($tree = trim(str_replace(config_path(), '', $directory), DIRECTORY_SEPARATOR))
		{
			$tree = str_replace(DIRECTORY_SEPARATOR, '.', $tree).'.';
		}

		return $tree;
	}
217807
public function getFilePath($file): string
    {
        if (null === ($fileObj = $this->container->get('huh.utils.file')->getFileFromUuid($file))) {
            return '';
        }

        return $fileObj->path;
    }
286568
private function resolve(SplFileInfo $file): Closure
    {
        return function(IServerRequest $request, IResponse $response, callable $next) use ($file)
        {
            return $this->container->call(import($file->getRealPath()),
            [
                'request' => $request,
                'response' => $response,
                'next' => $next,
                'config' => $this->config
            ]);
        };
    }
898893
public function getFileContents(\SplFileInfo $file)
    {
        if ($file->getExtension() === 'php') {
            $content = include $file->getPathname();
            return $content;
        }

        $level = error_reporting(0);
        $content = file_get_contents($file->getPathname());
        error_reporting($level);
        if (false === $content) {
            $error = error_get_last();
            throw new \RuntimeException($error['message']);
        }
        return $content;
    }
742397
protected function parse(\SplFileInfo $file): array
    {
        try {
            $config = \Toml::parseFile($file->getRealPath());
        } catch (\Exception $e) {
            throw new ConfigurationParseException('Unable to parse config file: ' . $e->getMessage());
        }

        return $config;
    }
982262
private function getFilenameFromFile(SplFileInfo $file) : string
    {
        return substr($file->getRelativePathname(), 0, -(strlen($this->fileExtension) + 1));
    }
1203071
public static function shortenPath($file)
    {
        $file = \array_values(\array_filter(\explode('/', \str_replace('\\', '/', $file)), 'strlen'));

        $longest_match = 0;
        $match = '/';

        foreach (self::$app_root_dirs as $path => $alias) {
            if (empty($path)) {
                continue;
            }

            $path = \array_values(\array_filter(\explode('/', \str_replace('\\', '/', $path)), 'strlen'));

            if (\array_slice($file, 0, \count($path)) === $path && \count($path) > $longest_match) {
                $longest_match = \count($path);
                $match = $alias;
            }
        }

        if ($longest_match) {
            $file = \array_merge(array($match), \array_slice($file, $longest_match));

            return \implode('/', $file);
        }

        // fallback to find common path with Kint dir
        $kint = \array_values(\array_filter(\explode('/', \str_replace('\\', '/', KINT_DIR)), 'strlen'));

        foreach ($file as $i => $part) {
            if (!isset($kint[$i]) || $kint[$i] !== $part) {
                return ($i ? '.../' : '/').\implode('/', \array_slice($file, $i));
            }
        }

        return '/'.\implode('/', $file);
    }
177634
protected function parseXml(SplFileInfo $file)
    {
        $dom = XmlUtils::loadFile($file, realpath(dirname(__DIR__) . DS . 'Schema' . DS . 'smarty_filter.xsd'));
        /** @var \Symfony\Component\DependencyInjection\SimpleXMLElement $xml */
        $xml = simplexml_import_dom($dom, '\\Symfony\\Component\\DependencyInjection\\SimpleXMLElement');

        $parsedConfig = [];
        /** @var \Symfony\Component\DependencyInjection\SimpleXMLElement $smartyFilterDefinition */
        foreach ($xml->smartyfilter as $smartyFilterDefinition) {
            $descriptive = [];
            /** @var \Symfony\Component\DependencyInjection\SimpleXMLElement $descriptiveDefinition */
            foreach ($smartyFilterDefinition->descriptive as $descriptiveDefinition) {
                $descriptive[] = [
                    'locale' => $descriptiveDefinition->getAttributeAsPhp('locale'),
                    'title' => (string)$descriptiveDefinition->title,
                    'description' => (string)$descriptiveDefinition->description,
                    'type' => (string)$descriptiveDefinition->type
                ];
            }

            $parsedConfig['smarty_filter'][] = [
                'code' => $smartyFilterDefinition->getAttributeAsPhp('code'),
                'descriptive' => $descriptive
            ];
        }


        return $parsedConfig;
    }
408751
private function getClassFullNameFromFile(SplFileInfo $file)
    {
        $targets = [
            realpath($this->namespaceDirectory).'/',
            '.php',
        ];

        $replaceValues = ['', ''];

        $className = str_replace($targets, $replaceValues, realpath($file->getPathname()));
        $className = str_replace('/', "\\", $className);

        return $this->namespace."\\".$className;
    }
441387
protected function getFilePath(SplFileInfo $file): string
    {
        $location = $file->getPathName();
        $path     = $this->removeBasePath($location);

        unset($location);

        return trim(str_replace('\\', '/', $path), '/');
    }
210444
protected function parseConfig($file)
    {
        $namespace = '';
        $directory = '';

        $config = file_get_contents($file);
        switch (pathinfo($file, PATHINFO_EXTENSION)) {
            case 'yml':
            case 'yaml':
                $config = Yaml::parse($config);
                if (isset($config['migrations_namespace'])) {
                    $namespace = $config['migrations_namespace'];
                }
                if (isset($config['migrations_directory'])) {
                    $directory = $config['migrations_directory'];
                }
                break;
            case 'xml':
                $doc = new \DOMDocument();
                $doc->loadXML($config);
                $list = $doc->getElementsByTagName('migrations-namespace');
                if ($list->length) {
                    $namespace = $list->item(0)->nodeValue;
                }
                $list = $doc->getElementsByTagName('migrations-directory');
                if ($list->length) {
                    $directory = $list->item(0)->nodeValue;
                }
                break;
        }

        return [
            'namespace' => $namespace && $namespace[0] == '\\' ? substr($namespace, 1) : $namespace,
            'directory' => $directory,
        ];
    }
1258392
public static function database_path(?string $file = null)
  {
    $file = (substr($file, 0, 1) == DIRECTORY_SEPARATOR ? substr($file, 1) : $file);
    return config('app.dir') . 'database' . DIRECTORY_SEPARATOR . $file;
  }
284958
protected function parse(\SplFileInfo $file): array
    {
        $config = @parse_ini_file($file->getRealPath());
        if ($config === false) {
            throw new ConfigurationParseException('Unable to parse configuration: invalid format');
        }

        return $config;
    }
90193
public function getCommonConfigVar($file)
    {
        $_config = [];

        $absFile = $this->appPath . 'config/' . $file . '.cfg.php';

        if (file_exists($absFile)) {
            include $absFile;
        }
        return $_config;
    }
743358
public static function public_path(?string $file = null)
  {
    $file = (substr($file, 0, 1) == DIRECTORY_SEPARATOR ? substr($file, 1) : $file);
    return config('app.dir') . 'storage' . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . $file;
  }
65596
public static function rpath(String $file = NULL) : String
    {
        $config = Config::get('Filesystem', 'file', self::$access);

        self::$access = NULL;

        if( $config['parentDirectoryAccess'] === false )
        {
            $file = str_replace('../', '', $file);
        }

        if( $config['realPath'] === true )
        {
            $file = Base::prefix(self::originpath($file), REAL_BASE_DIR);
        }

        return $file;
    }
906030
protected function getFileKey($basePath, \SplFileInfo $file)
    {
        $baseLength = strlen(rtrim($basePath, DIRECTORY_SEPARATOR));
        
        return substr($file->getPath(), $baseLength) . DIRECTORY_SEPARATOR 
                . $file->getBasename('.' . $file->getExtension());
    }