Retrieve the contents of a .ini file and convert it to an array of
configuration options.

@return array Array of configuration options
188101
public function getArray()
    {
        $parsed = @parse_ini_file($this->context, true);

        if (! $parsed) {
            throw new InvalidFileException('Unable to parse invalid INI file at ' . $this->context);
        }

        return $parsed;
    }
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;
  }
937333
public function get_raw_config() {
		if(preg_match('/\.xml/', $this->configFile)) {
//			$rawConfig = _parseXml();
			$xml = new SimpleXMLElement(file_get_contents($this->configFile));
			$rawConfig = array();
			foreach($xml as $x => $y) {
				foreach($y as $i => $d) {
					$rawConfig["$x"]["$i"] = "$d";
				}
			}
		}
		elseif(preg_match('/\.ini/', strtolower($this->configFile))) {
			$rawConfig = parse_ini_file($this->configFile,true);
		}
		else {
			throw new exception(__METHOD__ .": unsupported filetype (". $this->configFile .")");
		}
		return $rawConfig;
	}
889142
public function getConfigFile()
    {
        $configPath = $this->appDir . '/config/' . self::CONFIG_FILE . '.php';
        if (!file_exists($configPath)) {
            // Internal base config file
            $configPath = VENDOR_KNOB_BASE_DIR . '/src/config/' . self::CONFIG_FILE . '.php';
        }

        if (null === $this->config && file_exists($configPath)) {
            $this->config = require($configPath);
            static::replaceParameters($this->config);
        }

        return $this->config;
    }
84790
private function getSettings()
    {
        $rootPath = $this->complement['path']['root'];
        $configFile = $rootPath . 'config/';

        if (is_dir($configFile) && $handle = scandir($configFile)) {
            $files = array_slice($handle, 2);

            foreach ($files as $file) {
                $content = require $configFile . $file;
                $merge = array_merge($this->complement, $content);
                $this->complement = $merge;
            }
        }

        $this->complement['path']['root'] = $rootPath;
        $this->complement['path']['config'] = $configFile;
    }
1351638
public function getOptionsDescriptions()
    {
        return array_merge_recursive(parent::getOptionsDescriptions(), [
            self::OPTION_BASE_PATH => ['Base path to look for the json file', []],
            self::OPTION_FILENAME => ['Name of the file to load', []],
            self::OPTION_TYPE => ['Name of the type', []],//e.g. body or headers
        ]);
    }
1116453
private static function convertConfigsToFile(): string
    {
        $content = '';
        $separator = self::$separator;

        /* Convert array to strings */
        foreach (self::$configs as $configName => $configValue) {
            $content .= $configName . $separator . $configValue . "\n";
        }

        return $content;
    }
200582
private function _init()
    {
        $path = $this->options->get('store');

        if (file_exists($path))
        {
            if ($temp = json_decode(file_get_contents($path), true))
            {
                return $temp;
            }
        }
        else
        {
            touch($path);
            chmod($path, 0777);
        }

        return array();
    }
1159917
private function properties(): Properties
    {
        static $properties = null;
        if (null === $properties) {
            $properties = new Properties();
            foreach ($this->resourceLoader->availableResourceUris('input/error/message.ini') as $resourceUri) {
                $properties = $properties->merge(Properties::fromFile($resourceUri));
            }
        }

        return $properties;
    }
651069
public static function phpini()
	{
		// disabled ?
		//
		if (!self::_debug())
		{
			return false;
		}

		if (!readable(get_cfg_var('cfg_file_path')))
		{
			return false;
		}

		// render it
		//
		?>
<div class="krumo-title">
This is a list of the configuration settings read from <code><b><?php echo get_cfg_var('cfg_file_path');?></b></code>.
</div>
		<?php
		return self::dump(parse_ini_file(get_cfg_var('cfg_file_path'), true));
	}
1370092
public function toArray()
    {
        return [
            'fileId' => $this->file->getId(),
            'fileVersion' => $this->file->getVersion(),
            'usageType' => $this->usageType,
            'usageId' => $this->usageId,
            'status' => $this->status,
        ];
    }
325875
private function getConfigurationFiles()
    {
        $path = $this->configPath;

        if (!is_dir($path)) {
            return [];
        }

        $files = [];
        $phpFiles = Finder::create()->files()->name('*.php')->in($path)->depth(0);

        foreach ($phpFiles as $file) {
            $files[basename($file->getRealPath(), '.php')] = $file->getRealPath();
        }

        return $files;
    }
632752
public function GetConfigFileContents()
	{
		if (!$this->configFileContents)
		{
			// get rid of windows-style carriage returns
			$this->configFileContents = str_replace("\r\n", "\n", file_get_contents($this->configFilePath) );
		}
		
		return $this->configFileContents;
	}
1178921
public static function getConfiguration()
    {
        if (self::$configuration === null && file_exists(self::$configFilePath)) {
//            $jsonConfig = file_get_contents(self::$configFilePath_depr);
//            self::$configuration = json_decode($jsonConfig);

            $settings = include __DIR__ . '/../../config/configuration.php';

            self::$configuration = DWDUtil::array_to_object($settings);

            if (DWDConfiguration::$configuration === null)
                throw new ParseError('Error, configuration file could not be found or contains invalid lines.');
        }
        return DWDConfiguration::$configuration;

    }
485255
public static function phpini()
    {
        // disabled
        if (!static::_debug()) {
            return false;
        }

        if (!is_readable(get_cfg_var('cfg_file_path'))) {
            return false;
        }

        // render it
        static::heading("This is a list of the configuration settings read from ", get_cfg_var('cfg_file_path'), ".");

        return static::dump(parse_ini_file(get_cfg_var('cfg_file_path'), true));
    }
959729
protected function getOptions()
    {
        return array(
            array('log-path', null, InputOption::VALUE_OPTIONAL, 'The path to directory storing the log files.', $this->reader->getLogPath()),
            array('file-name', null, InputOption::VALUE_OPTIONAL, 'The pattern of the log filenames.', $this->reader->getLogFilename()),
            array('level', null, InputOption::VALUE_OPTIONAL, 'Filter by level.', null),
            array('with-read', 'r', InputOption::VALUE_NONE, 'Include log entries that marked as read in request.'),
            array('order-by', null, InputOption::VALUE_OPTIONAL, 'Order by information.', 'date'),
            array('order-direction', null, InputOption::VALUE_OPTIONAL, 'Order by direction.', 'asc'),
            array('paginate', 'p', InputOption::VALUE_NONE, 'Paging the result.'),
            array('per-page', null, InputOption::VALUE_OPTIONAL, 'The number of log entries that you want to get per page.', 10),
            array('page', null, InputOption::VALUE_OPTIONAL, 'The page that you want to display from paging.', 1),
        );
    }
290223
public function getConfig(): array
    {
        $structure = [
            'locationMappings' => [],
            'defaultMappings' => [],
            'fallbackContentType' => $this->buildFallbackContentTypeStructure($this->fallbackContentType),
            'maxFileSize' => $this->maxFileSize,
        ];

        foreach ($this->locationMappings as $locationIdentifier => $locationConfiguration) {
            $structure['locationMappings'][$locationIdentifier] = [
                'contentTypeIdentifier' => $locationConfiguration['content_type_identifier'],
                'mimeTypeFilter' => $locationConfiguration['mime_type_filter'],
                'mappings' => [],
            ];

            foreach ($locationConfiguration['mappings'] as $mappingGroup) {
                $structure['locationMappings'][$locationIdentifier]['mappings'][] = $this->buildMappingGroupStructure($mappingGroup);
            }
        }

        foreach ($this->defaultMappings as $mappingGroup) {
            $structure['defaultMappings'][] = $this->buildMappingGroupStructure($mappingGroup);
        }

        return $structure;
    }