Parse le fichier de configuration.

@param $pathParametersFile
@return $this
977786
private function parseParametersFile($pathParametersFile)
    {
        $this->parameters = parse_ini_file($pathParametersFile, true);

        if (isset($this->parameters['environment'])) {
            $this->setEnvironment($this->parameters['environment']);
        }

        if (isset($this->parameters['login'])) {
            $this->setLogin($this->parameters['login']);
        }

        if (isset($this->parameters['password'])) {
            $password = $this->parameters['password'];
            if (empty($this->parameters['isEncryptedPassword'])
            || $this->parameters['isEncryptedPassword'] === false
            || $this->parameters['isEncryptedPassword'] === 'false') {
                $password = $this->encryptPassword($password);
            }

            $this->setPassword($password);
        }

        if (isset($this->parameters['api_key'])) {
            $this->setApiKey($this->parameters['api_key']);
        }

        if (isset($this->parameters['ssl_enabled'])) {
            $this->setEnabledSSL($this->parameters['ssl_enabled']);

            $this->setCertClientLocation($this->parameters['cert_client_location']);
            $this->setCaChainClientLocation($this->parameters['ca_chain_client_location']);
            $this->setPrivateKeyClientLocation($this->parameters['private_key_client_location']);
            $this->setPrivateKeyClientPassword($this->parameters['private_key_client_password']);
        }

        return $this;
    }
388695
protected static function getConfigParameters($parametersFile)
    {
        $ymlParser = new Parser();
        $config = $ymlParser->parse(file_get_contents($parametersFile));

        return isset($config['parameters']) ? $config['parameters'] : array();
    }
232706
protected function loadFromFile($path, ParserInterface $parser = null)
    {
        $paths      = $this->getValidPath($path);
        $this->data = [];

        foreach ($paths as $path) {
            if ($parser === null) {
                // Get file information
                $info      = pathinfo($path);
                $parts     = explode('.', $info['basename']);
                $extension = array_pop($parts);

                // Skip the `dist` extension
                if ($extension === 'dist') {
                    $extension = array_pop($parts);
                }

                // Get file parser
                $parser = $this->getParser($extension);

                // Try to load file
                $this->data = array_replace_recursive($this->data, $parser->parseFile($path));

                // Clean parser
                $parser = null;
            } else {
                // Try to load file using specified parser
                $this->data = array_replace_recursive($this->data, $parser->parseFile($path));
            }
        }
    }
159362
public function path($path)
    {
        $path = trim($path);

        if (str_empty($this->fileName)) {
            $this->fileName(basename($path));
        }

        if (str_empty($this->fileType)) {
            $this->fileType(mime_content_type($path));
        }

        $this->fileContent(fopen($path, 'r'));

        return $this;
    }
1065345
public function setPath($path) {
        if ($this->configured) throw new IllegalStateException('Configuration is frozen');
        if ($path[0] != '/')   throw new StrutsConfigException('<mapping'.($this->name ? ' name="'.$this->name.'"':'').' path="'.$path.'": Illegal path (value must start with a slash "/").');

        $this->path = $path;
        return $this;
    }
1109869
public function prepend($path) {
		$path = $this->normalizePath($path);
		
		$this->inputFiles->unshift($path);
		
		return $this;
	}
287922
public static function getInstance($configFile='config.yml')
    {
        static $instance = null;
        if (null === $instance) {
            $instance = new static();
        }

        $configuration = Yaml::parse(file_get_contents($configFile));
        $instance->setParams($configuration);

        return $instance;
    }
472218
public function setPath($path)
	{
		if($path !== false)
			$path = trim($path, '/');

		$this->setProperty('path', $path);

		return $this;
	}
606829
public function setFile($file): self
    {
        $this->file = $file;

        if (is_string($file)) {
            $this->pathToFile = $file;
            $this->setFileName(pathinfo($file, PATHINFO_BASENAME));
            $this->mediaName = pathinfo($file, PATHINFO_FILENAME);

            return $this;
        }

        if ($file instanceof UploadedFile) {
            $this->pathToFile = $file->getPath().'/'.$file->getFilename();
            $this->setFileName($file->getClientOriginalName());
            $this->mediaName = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);

            return $this;
        }

        if ($file instanceof SymfonyFile) {
            $this->pathToFile = $file->getPath().'/'.$file->getFilename();
            $this->setFileName(pathinfo($file->getFilename(), PATHINFO_BASENAME));
            $this->mediaName = pathinfo($file->getFilename(), PATHINFO_FILENAME);

            return $this;
        }

        throw UnknownType::create();
    }
1195329
protected function parsePath($path = null)
    {
        $this->dirname   = '';
        $this->basename  = '';
        $this->extension = '';
        $this->filename  = '';

        if (empty($path)) {
            return $this;
        }

        $parts = pathinfo($path);

        if (isset($parts['dirname'])) {
            $this->dirname = rtrim($parts['dirname'], '/');
        }

        if (isset($parts['basename'])) {
            $this->basename = $parts['basename'];
        }

        if (isset($parts['extension'])) {
            $this->extension = $parts['extension'];
        }

        if (isset($parts['filename'])) {
            $this->filename = $parts['filename'];
        }

        return $this;
    }
104247
protected function preloadConfiguration($configFile)
    {
        try {
            Configuration::config($configFile);
        } catch (ConfigurationException $e) {
            if ($e->getCode() == 404) {
                throw new ConfigurationException("Your configuration file `{$configFile}` could not be found.", 405);
            }
            throw $e;
        }
    }
967167
public function prependByPathContext($pathContext)
    {
        $this->pathContext($pathContext);

        foreach ($this->getPathNormalizers() as $field => $normalizer) {
            $this->path($field, $normalizer[ 'pathWithoutContext' ], $normalizer[ 'defaultValue' ]);
        }

        return $this;
    }
687618
public function loadConfigurationFile($file)
    {
        if (!file_exists($file)) {
            throw new \InvalidArgumentException(sprintf('Configuration file "%s" not found', $file));
        }
        $this->loadedConfig = Yaml::parse(file_get_contents($file));

        return $this;
    }
1115649
public function addConfigPath($path)
    {
        if (!file_exists($path) || !is_dir($path) || !is_readable($path)) {
            throw new Exception(
                'Invalid or unreadable path: '.$path,
                Exception::INVALID_PATH
            );
        }
        $this->configPaths[] = $path;

        return $this;
    }
1298368
public static function getConfigurationByConfigFile($configFile)
    {
        if (file_exists($configFile) === false) {
            $message = 'Configuration file "%s" not found or accessible.';
            $message = sprintf($message, $configFile);
            throw new \RuntimeException($message, 1415381521);
        }

        $config = Yaml::parse($configFile);
        $configuration = new Configuration($config);

        return $configuration;
    }
849954
private function parseConfigFile()
    {
        $lines = [];

        foreach ($this->lines() as $line) {
            $keys = $this->config()[$this->config];

            $lines[] = $this->parseLine($line, $keys);
        }

        $this->writeToEnv("\n");

        return implode('', $lines);
    }
210055
protected function getConfigurationNesting(SplFileInfo $file, $configPath)
    {
        $directory = $file->getPath();

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

        return $tree;
    }