Reads parameters from the configuration file.

@param string $configFilename

@return array
540532
protected function readConfigFile(string $configFilename): array
  {
    $settings = parse_ini_file($configFilename, true);

    $this->phpStratumMetadataFilename = self::getSetting($settings, true, 'loader', 'metadata');
    $this->sourcePattern              = self::getSetting($settings, true, 'loader', 'sources');
    $this->sqlMode                    = self::getSetting($settings, true, 'loader', 'sql_mode');
    $this->characterSet               = self::getSetting($settings, true, 'loader', 'character_set');
    $this->collate                    = self::getSetting($settings, true, 'loader', 'collate');
    $this->constantClassName          = self::getSetting($settings, false, 'constants', 'class');
    $this->nameMangler                = self::getSetting($settings, false, 'wrapper', 'mangler_class');

    return $settings;
  }
65249
public function loadConfig($configFile = 'config.user.php', $configPath = 'app/config') {
        $completePath = ROOT . DS . $configPath . DS . $configFile;

        if (!file_exists($completePath)) {
            throw new ConfigException("Specified config file does not exist: " . $completePath);
        }

        include($completePath);

        if (isset($pffConfig) && is_array($pffConfig)) {
            $this->_config = array_merge($this->_config, $pffConfig);
        } else {
            throw new ConfigException("Failed to load configuration file!
                                            The file seems to be corrupted: " . $completePath);
        }
    }
158657
public static function read( $fileName )
	{
		$list	= array();
		if( !file_exists( $fileName ) )
			throw new RuntimeException( 'File "'.$fileName.'" is not existing' );
		$reader	= new FS_File_Reader( $fileName );
		$lines	= $reader->readArray();
		foreach( $lines as $line )
			if( $line = trim( $line ) )
				if( !preg_match( self::$commentPattern, $line ) )
					$list[]	= $line;
		return $list;
	}
1021574
public function get($key, $configFile = '')
    {
        $config = $this->load((empty($configFile)) ? $this->_configFile : $configFile);

        return $this->sift($config, explode('.', $key));
    }
1003722
public function read($fallbackToDefault = false)
    {
        $configFile = Config::FILENAME;

        if (!is_file($configFile)) {
            if ($fallbackToDefault === false) {
                return null;
            }

            $configFile = __DIR__ . '/magedeploy2.default.php';
        }

        $data = include $configFile;

        $config = new Config($data);

        return $config;
    }
1144098
public static function readConfigFile($file = self::DEFAULT_CONFIG_FILE)
    {
        if (!is_string($file)) {
            throw new InvalidArgumentException('The config file path must be a string, type passed "'.gettype($file).'".');
        }

        $baseDir = realpath(dirname($file));
        $searchDirs = array(
            $baseDir.'/',
            $baseDir.'/../',
            $baseDir.'/../../',
            $baseDir.'/config/',
            $baseDir.'/../config/',
            $baseDir.'/../../config/'
        );

        $filename = basename($file);

        $configFile = null;
        foreach ($searchDirs as $dir) {
            if (realpath($dir.$filename) and is_readable($dir.$filename)) {
                $configFile = realpath($dir.$filename);
                break;
            }
        }

        if (is_null($configFile) and $file !== self::DEFAULT_CONFIG_FILE) {
            throw new InvalidArgumentException('The config file "'.$file.'" cannot be found or read.');
        }

        if (!$configFile) {
            return static::$config;
        }

        // Try to parse the contents
        try {
            $yaml = Yaml\Yaml::parse(file_get_contents($configFile));
        } catch (Yaml\Exception\ParseException $e) {
            throw new Exception('Unable to parse the config file: '.$e->getMessage());
        }

        return static::$config = $yaml;
    }
1306878
public function loadConfig($configFiles)
    {
        if (!is_array($configFiles)) {
            $configFiles = array($configFiles);
        }

        $this->configFiles = $configFiles;

        foreach ($configFiles as $configFile) {
            $this->config = array_merge(
                $this->config,
                $this->loadConfigFile($configFile)
            );
        }
    }
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;
    }
572341
public static function getData($configName)
    {
        $path = __DIR__ . DIRECTORY_SEPARATOR . self::CONFIG_PATH . DIRECTORY_SEPARATOR . $configName . self::CONFIG_EXT;
        if (is_file($path) && file_exists($path)) {
            return require($path);
        }

        return [];
    }
774370
private function readConfigurationFile(string $configFilename): void
  {
    // Read the configuration file.
    $settings = parse_ini_file($configFilename, true);

    // Set default values.
    if (!isset($settings['wrapper']['lob_as_string']))
    {
      $settings['wrapper']['lob_as_string'] = false;
    }

    if (!isset($settings['wrapper']['strict_types']))
    {
      $settings['wrapper']['strict_types'] = true;
    }

    $this->wrapperClassName = self::getSetting($settings, false, 'wrapper', 'wrapper_class');
    if ($this->wrapperClassName!==null)
    {
      $this->parentClassName  = self::getSetting($settings, true, 'wrapper', 'parent_class');
      $this->nameMangler      = self::getSetting($settings, true, 'wrapper', 'mangler_class');
      $this->wrapperFilename  = self::getSetting($settings, true, 'wrapper', 'wrapper_file');
      $this->lobAsString      = !empty(self::getSetting($settings, true, 'wrapper', 'lob_as_string'));
      $this->metadataFilename = self::getSetting($settings, true, 'loader', 'metadata');
      $this->wrapperClassType = self::getSetting($settings, true, 'wrapper', 'wrapper_type');
      $this->strictTypes      = !empty(self::getSetting($settings, true, 'wrapper', 'strict_types'));
    }
  }
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;
    }
318991
public function load(string $filename): \Nofuzz\Config\Config
  {
    # Attempt to load config file
    if ( file_exists($filename) ) {
      # Set filename
      $this->filename = $filename;
      # Load the config
      $configArray = json_decode( file_get_contents($filename), true);
      if ($configArray) {
        // $configArray = $this->array_change_key_case_recursive($configArray); // Lowercase the keys
        # Merge the Config with existing config
        // $this->confValues = array_replace_recursive($this->confValues, $configArray);
        $this->confValues = $configArray;
      } else {
        throw new \RunTimeException('Invalid JSON file "'.$filename.'"');

      }
    } else {
      throw new \RunTimeException('Config file "'.$filename.'" not found');

    }

    return $this;
  }
117896
private function readConfigFile()
    {
        // reading the config file to be stored in the 'configurations' variable below
        $configurations = $this->config_reader->get('api');
        $this->mappers_base_namespace = $configurations['mappers'];
        $this->limit = $configurations['limit'];
    }
670156
public function parse($configFile = '')
    {
        // Load default configuration
        $defaultConfigFile = $this->getConfigFile($configFile, 'default');
        $defaultConfigArray = parent::parse($defaultConfigFile) ?: [];

        // Load environment configuration
        $envConfigFile = $this->getConfigFile($configFile, $this->app->getEnvironment());
        $envConfigArray = parent::parse($envConfigFile) ?: [];

        // Merge environment config to default and set to application
        return ArrayHelper::merge($defaultConfigArray, $envConfigArray, $deep = true);
    }
649597
public function load() : array
    {
        if (!$this->exists()){
            throw new ConfigFileNotFoundException($this);
        }
        if (!$this->canRead()){
            throw new ConfigFileNotReadableException($this);
        }
    
        $contents = NULL;
        try{
            $contents = $this->getContents();
        }
        catch( FileSystemExceptionInterface $e ){
            throw new ConfigFileInputException($this, $e);
        }
        
        $data = Yaml::parse($contents);
        
        return $data;
    }
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;
    }
619509
public function load($filename)
    {
        if (!class_exists('Symfony\\Component\\Yaml\\Yaml')) {
            throw new \RuntimeException('Unable to read yaml as the Symfony Yaml Component is not installed.');
        }
        $config = Yaml::parse(file_get_contents($filename));

        return $config ?: [];
    }