@param string $configFile

@return null|string
558032
protected function getConfigFilename($configFile)
    {
        foreach ($this->configDirectories as $configDirectory) {
            $configPathname = sprintf('%s/%s', $configDirectory, $configFile);
            if (file_exists($configPathname)) {
                return $configPathname;
            }
        }

        return null;
    }
79101
private function readConfigFile(string $configFilename): array
  {
    $settings = parse_ini_file($configFilename, true);

    $this->constantsFilename = self::getSetting($settings, false, 'constants', 'columns');
    $this->className         = self::getSetting($settings, false, 'constants', 'class');

    return $settings;
  }
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;
    }
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;
    }
297554
func ConfigFile(filename string) *File {
	f, err := ReadFile(filename)
	if err != nil {
		panic(err)
	}
	return f
}
250459
public static function read($sConfigFile)
    {
        $sConfigFile = realpath($sConfigFile);
        if(!is_readable($sConfigFile))
        {
            throw new \Jaxon\Config\Exception\File(jaxon_trans('config.errors.file.access', array('path' => $sConfigFile)));
        }
        $aConfigOptions = include($sConfigFile);
        if(!is_array($aConfigOptions))
        {
            throw new \Jaxon\Config\Exception\File(jaxon_trans('config.errors.file.content', array('path' => $sConfigFile)));
        }

        return $aConfigOptions;
    }
74345
protected function bootConfigFiles($configFiles = null, $path = null)
    {
        if ($configFiles === null) {
            $configFiles = $this->configFiles;
        }
        if (!is_array($configFiles)) {
            $configFiles = [$configFiles];
        }
        if (isset($this->rootDir, $configFiles)) {
            foreach ($configFiles as $fileName) {
                $filePath = $path === null ? $this->resolvePath('configPath') : path_join($path, $fileName);
                $this->publishes([$filePath => config_path($fileName.'.php')], 'config');
            }
        }
    }
514980
public static function getInfo($imgfile)
    {
        $imageInfo = getimagesize($imgfile);
        if ($imageInfo !== false) {
            $imageType = strtolower(substr(image_type_to_extension($imageInfo[2]), 1));
            $imageSize = filesize($imgfile);
            $info      = array(
                "width"  => $imageInfo[0],
                "height" => $imageInfo[1],
                "type"   => $imageType,
                "size"   => $imageSize,
                "mime"   => $imageInfo['mime'],
            );
            return $info;
        } else {
            return false;
        }
    }
803548
protected function getFileName($strFile, $strFolder)
    {
        if (!file_exists(TL_ROOT . '/' . $strFolder . '/' . $strFile)) {
            return $strFile;
        }

        $offset = 1;
        $pathinfo = pathinfo($strFile);
        $name = $pathinfo['filename'];

        $arrAll = scan(TL_ROOT . '/' . $strFolder);
        $arrFiles = preg_grep('/^' . preg_quote($name, '/') . '.*\.' . preg_quote($pathinfo['extension'], '/') . '/', $arrAll);

        foreach ($arrFiles as $file) {
            if (preg_match('/__[0-9]+\.' . preg_quote($pathinfo['extension'], '/') . '$/', $file)) {
                $file = str_replace('.' . $pathinfo['extension'], '', $file);
                $intValue = intval(substr($file, (strrpos($file, '_') + 1)));

                $offset = max($offset, $intValue);
            }
        }

        return str_replace($name, $name . '__' . ++$offset, $strFile);
    }
1193552
public function override($configFile, $strict = false) {
        parent::override($this->_parse($configFile, $strict));
    }
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;
        }
    }
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;
  }
1070997
public function writeConfig(string $configFile, array $data): bool
    {
        $path = '/Private/Config/' . ucfirst(Str::lowerCase($configFile)) . '.php';
        if (!File::exist($path) || !File::writable($path)) {
            return false;
        }

        $saveData = '<?php return ' . Arr::exportVar($data) . ';';
        File::write($path, $saveData);
        // overload config values if changed
        $this->load($configFile, true);
        return true;
    }
801351
private function configure($configFile) {
    if (!file_exists($configFile)) {
      throw new ConfigurationException('Configuration file '.$configFile.' not found');
    }
    $config = parse_ini_file($configFile, true);

    // default settings
    if (isset($config[self::ROOT_SECTION_NAME])) {
      $rootConfig = $config[self::ROOT_SECTION_NAME];
      self::$defaultLevel = isset($rootConfig['level']) ?
              constant('Monolog\Logger::'.strtoupper($rootConfig['level'])) :
              self::$defaultLevel;
      self::$logTarget = isset($rootConfig['target']) ?
              $rootConfig['target'] : WCMF_BASE.self::$logTarget;
    }

    // log levels
    self::$levels = isset($config[self::LOGGER_SECTION_NAME]) ?
            $config[self::LOGGER_SECTION_NAME] : [];
    foreach (self::$levels as $key => $val) {
      self::$levels[$key] = constant('Monolog\Logger::'.strtoupper($val));
    }
  }
1154289
public function setConfigFile($configFile = '')
    {
        if (!is_readable($configFile)) {
            $this->activeConfig = [];

            throw ParserException::forFileUnreadable($configFile);
        }

        $this->configFile = $configFile;
        if (!$this->parseConfigFile()) {
            throw InvalidConfigException::forEmptyConfig($configFile);
        }

        return $this;
    }
232875
private function parseFile($configFilePath) {
		$configFileText = file_get_contents ( $configFilePath );
		
		// Now split each line on carriage return
		$lines = explode ( "\n", $configFileText );
		
		// Now loop through each line, attempting a split by equals sign to get key value pairs out.
		foreach ( $lines as $line ) {
			
			// Firstly split lines on # to ensure that comments are ignored
			$splitComment = explode ( "#", $line );
			
			$propertyLine = trim ( $splitComment [0] );
			
			//  if the first entry is zero length when trimmed we know the line is a comment so we ignore the whole line
			// Otherwise continue and use the bit before any potential comment
			if (strlen ( $propertyLine ) > 0) {
				
				// Now split into key, value on =
				$positionOfFirstEquals = strpos ( $propertyLine, "=" );
				
				// If there are not 2 or more array entries at this point we should complain unless we meet a blank line.
				if ($positionOfFirstEquals) {
					$this->parameters [trim ( substr ( $propertyLine, 0, $positionOfFirstEquals ) )] = trim ( substr ( $propertyLine, $positionOfFirstEquals + 1 ) );
				} else {
					throw new Exception ( "Error in config file: Parameter '" . $propertyLine . "' Does not have a value" );
				}
			
			}
		}
	}
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);
    }