Reads parameters from the configuration file.

@param string $configFilename The filename of the configuration file.
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'));
    }
  }
986184
protected function loadYamlFile( $fileName )
	{
		$array	= FS_File_YAML_Reader::load( $fileName );
		foreach( $array as $sectionName => $sectionData )
			foreach( $sectionData as $key => $value )
				$this->pairs[$sectionName.".".$key]	= $value;
	}
731097
public function load(string $filename)
  {
    # 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 SpinException('Invalid JSON file "'.$filename.'"');

      }
    }

    return $this;
  }
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)
            );
        }
    }
1340823
public function parseFile($filename, $config = NULL, $encoding = NULL, $use_include_path = false, $filename, $config = NULL, $encoding = NULL, $use_include_path = false)
    {
    }
711864
public static function configure($configFile)
    {
        $configuration = include($configFile);
        if ($configuration === false) {
            throw new PropelException("Unable to open configuration file: " . var_export($configFile, true));
        }
        self::setConfiguration($configuration);
    }
592021
private function loadXmlFile(string $configFile): array
    {
        $xml = simplexml_load_file($configFile);
        $configArr = [];

        if (isset($xml->name)) {
            $configArr['name'] = (string) $xml->name;
        }

        if (isset($xml->database['name'])) {
            $configArr['database'] = (string) $xml->database['name'];
        }

        if (isset($xml->collection['name'])) {
            $configArr['collection_name'] = (string) $xml->collection['name'];
        }

        if (isset($xml->{'migrations-namespace'})) {
            $configArr['migrations_namespace'] = (string) $xml->{'migrations-namespace'};
        }

        if (isset($xml->{'migrations-directory'})) {
            $configArr['migrations_directory'] = (string) $xml->{'migrations-directory'};
        }

        if (isset($xml->{'migrations-script-directory'})) {
            $configArr['migrations_script_directory'] = (string) $xml->{'migrations-script-directory'};
        }

        if (isset($xml->migrations->migration)) {
            foreach ($xml->migrations->migration as $migration) {
                $configArr['migrations'][] = [
                    'version' => $migration['version'],
                    'class' => $migration['class'],
                ];
            }
        }

        return $configArr;
    }
1114921
public function readConfig()
    {
        // by default, read local file: projectBase/config.php
        // in which only an array $config defined
        $config=[];
        if (file_exists($this->projectBase.'/config.php')) {
            require($this->projectBase . '/config.php');
        }
        $this->config=$config;
    }
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;
  }
634199
public static function write(string $fileName = '', $config = null): bool
    {
        $pathInfo = \pathinfo(static::normalizePath($fileName));
        if (!isset($pathInfo['extension'])) {
            $message = \sprintf(
                'Config file name "%s" is missing an extension and cannot be auto-detected',
                $pathInfo['filename']
            );

            throw new RuntimeException($message);
        }

        $extension = \strtolower($pathInfo['extension']);
        if (!\in_array($extension, static::$allowedExtensions)) {
            $message = \sprintf(
                'Unsupported config file type. Supported extension types are: %s',
                \implode(',', static::$allowedExtensions)
            );

            throw new RuntimeException($message);
        }

        if (!isset(static::$writers[$extension]) || !(static::$writers[$extension] instanceof AbstractWriter)) {
            static::$writers[$extension] = WriterManager::get($extension);
        }

        return static::$writers[$extension]->toFile($fileName, $config);
    }
653569
public function readParams($filename)
    {

        //We will only parse the file if it has not already been parsed!;
        if (!array_key_exists($filename, $this->namespace)) {
            if (file_exists($filename)) {
                if (($this->namespace[$filename] = parse_ini_file($filename, true)) === FALSE) {
                    throw new Exception("Could not Parse the ini file {$filename}");
                    return false;
                } else {
                    //Add the iniParams to $this->params;
                    return $this->namespace[$filename];
                }
            } else {
                // throw new Exception( sprintf("The configuration file (%s) does not exists",$filename ) );
                return [];
            }
        } else {
            return $this->namespace[$filename];
        }
    }
404246
public function parse( $filename ) {
		if( !is_readable($filename) ) {
			throw new ConfigException("Config file '{$filename}' not readable");
		}

		$dom = new \DOMDocument();
		if( @$dom->load($filename) === false ) {
			throw new ConfigException("Error parsing {$filename}");
		}

		$root = $dom->firstChild;
		if( !$root instanceof \DOMElement ) {
			throw new \RuntimeException('Needs a DOM element');
		}

		$docRoot = new Documentation\DocRoot([], []);
		if( $root->nodeName == 'mddoc' ) {
			$this->loadChildren($root, $docRoot);
		} else {
			if( $root->nodeName ) {
				throw new ConfigException("XML Root element `{$root->nodeName}` is invalid.");
			}

			throw new ConfigException("Error parsing {$filename}");
		}

		return $docRoot;
	}
332490
public function read($file)
    {
        $this->filePath = $file;
        $this->config = parse_ini_file($this->filePath);
    }
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;
  }
527919
public function readConfig($configFile) {
        $yamlParser   = new \Symfony\Component\Yaml\Parser();
        $userConfPath = ROOT . DS . 'app' . DS . 'config' . DS . 'modules' . DS . $configFile;
        $userCustomPath = ROOT. DS . 'app'. DS.'modules'.DS.$configFile;
        $composerConfPath = ROOT . DS . 'modules' . DS . $configFile;
        $libConfPath  = ROOT_LIB . DS . 'src' . DS . 'modules' . DS . $configFile;
        if (file_exists($userConfPath)) {
            $confPath = $userConfPath;
        } elseif (file_exists($userCustomPath)) {
            $confPath = $userCustomPath;
        } elseif (file_exists($composerConfPath)) {
            $confPath = $composerConfPath;
        } elseif (file_exists($libConfPath)) {
            $confPath = $libConfPath;
        } else {
            throw new ModuleException ("Module configuration file not found!");
        }

        try {
            $conf = $yamlParser->parse(file_get_contents($confPath));
        } catch (\Symfony\Component\Yaml\Exception\ParseException $e) {
            throw new ModuleException("Unable to parse module configuration
                                            file for AutomaticHeaderFooter module: " . $e->getMessage());
        }
        return $conf;
    }
906828
static void generateConfigFile(String configFilePath) throws ConfigurationException {
        String fileExtention = FilenameUtils.getExtension(configFilePath);
        ConfigProvider<Configuration> provider = getProviderByFileExtention(fileExtention);
        if (!AuditUtil.isFileExists(configFilePath)) {
            provider.generateConfig(Configuration.DEFAULT, configFilePath);
        }
    }
946330
public function loadConfigurationByFilename($filename)
    {

        // initialize the DOMDocument with the configuration file to be validated
        $configurationFile = new \DOMDocument();
        $configurationFile->load($filename);

        // substitute xincludes
        $configurationFile->xinclude(LIBXML_SCHEMA_CREATE);

        // create a DOMElement with the base.dir configuration
        $paramElement = $configurationFile->createElement('param', APPSERVER_BP);
        $paramElement->setAttribute('name', DirectoryKeys::BASE);
        $paramElement->setAttribute('type', ParamNode::TYPE_STRING);

        // create an XPath instance
        $xpath = new \DOMXpath($configurationFile);
        $xpath->registerNamespace('a', 'http://www.appserver.io/appserver');

        // for node data in a selected id
        $baseDirParam = $xpath->query(sprintf('/a:appserver/a:params/a:param[@name="%s"]', DirectoryKeys::BASE));
        if ($baseDirParam->length === 0) {
            // load the <params> node
            $paramNodes = $xpath->query('/a:appserver/a:params');

            // load the first item => the node itself
            if ($paramsNode = $paramNodes->item(0)) {
                // append the base.dir DOMElement
                $paramsNode->appendChild($paramElement);
            } else {
                // throw an exception, because we can't find a mandatory node
                throw new \Exception('Can\'t find /appserver/params node');
            }
        }

        // create a new DOMDocument with the merge content => necessary because else, schema validation fails!!
        $doc = new \DOMDocument();
        $doc->loadXML($configurationFile->saveXML());

        // return the XML document
        return $doc;
    }