Add Config Vars from a new .ini file

@param string $path
549157
public function addConfigVars($path = 'config.ini') {
        if ($path === 'config.php') {
            $arrayIniParams = parse_ini_file(dirname(__FILE__).'/'.$path,true);
        } else {
            $arrayIniParams = parse_ini_file($path, true);
        }
        foreach ($arrayIniParams as $key => $iniParam) {
            $this->storage[$key] = $iniParam;
        }
    }
857157
protected function loadConstantsFrom($path, $namespace = null)
    {
        $constants = require $path;
        $prefix = $namespace ? "$namespace" : '';

        foreach ($constants as $constant => $value) {
            define(strtoupper("{$prefix}{$constant}"), $value);
        }
    }
12443
protected function _load($config, $path, $prefix = '')
    {
        if (file_exists($path)) {
            $config->load($path, $prefix);
        }

        $localConfig = preg_replace('/(.*)\.ini$/', '$1.local.ini', $path);
        if (file_exists($localConfig)) {
            $config->load($localConfig, $prefix);
        }
    }
1024567
private static function initializeConfigurations()
    {
        if (!is_readable(self::CONFIGURATION_PATH)) {
            throw new \RuntimeException("Cannot parse configurations file (config.ini)");
        }
        self::$configurationFile = new ConfigurationFile(self::CONFIGURATION_PATH);
    }
610747
def _addconfig(config, *paths):
    """"""

    for path in paths:
        if path is not None and exists(path):
            config.append(path)
971185
public static function addPath($path)
    {
        if (!in_array($path, self::$paths)) {
            array_unshift(self::$paths, $path);
        }
    }
829548
public function loadFile($path) {
        $config = null;
        $mode = defined('INI_SCANNER_TYPED') ? INI_SCANNER_TYPED : INI_SCANNER_NORMAL;

        try {
            $config = parse_ini_file($path, true, $mode);
        } catch (Exception $ex) {}

        if ( ! is_array($config)) {
            throw new InvalidConfigFormatException(
                s('IniConfigDriver expects config at path %s to be a valid ini file.', $path)
            );
        }

        return $config;
    }
873104
public function setPath($path): void
    {
        if (!is_dir($path)) {
            throw new ConfigException('Configuration directory is not exists');
        }
        $this->path = rtrim($path, '/');
    }
10027
public function createConfig($path = '') : Config
    {
        $path       = $path ?: getcwd() . DIRECTORY_SEPARATOR . CH::CONFIG;
        $json       = new Json($path);
        $fileExists = $json->exists();
        $config     = new Config($path, $fileExists);

        if ($fileExists) {
            $this->configure($config, $json->readAssoc());
        }

        return $config;
    }
1169902
protected function loadDefinitions($path)
    {
        if (file_exists($path)) {

            include $path;

            if (!empty($config['notification_definitions'])) {
                $this->notifications = array_merge($this->notifications, $config['notification_definitions']);
            }
        }
    }
887645
protected static function addPath($path)
    {
        $len = strlen(DIRECTORY_SEPARATOR);
        while (1) {
            if (!is_string($path)) {
                return;
            }

            if (substr($path, -$len) == DIRECTORY_SEPARATOR) {
                $path = substr($path, 0, -$len);
            } else {
                break;
            }
        }

        if (!in_array($path, self::$paths)) {
            self::$paths[] = $path;
        }
    }
590718
public function add_path(string $path)
    {
        $path = \trailingslashit($path);
        $this->paths[] = $path;
        $this->parse_files($path);
    }
164803
private function LoadFromPHP($path)
    {
        $this->definitions_path = rtrim($path, "/\\") . "/";
        $this->import_type = Type::PHP;
        
        // This variable is used by the php definition files to reference
        // this object and populate it with elements.
        $symbols =& $this->symbols;
        
        if(file_exists($this->definitions_path . "constants.php"))
        {
            $this->SendMessage(t("Loading constants.php"));
            include($this->definitions_path . "constants.php");
        }
        
        if(file_exists($this->definitions_path . "enumerations.php"))
        {
            $this->SendMessage(t("Loading enumerations.php"));
            include($this->definitions_path . "enumerations.php");
        }
        
        if(file_exists($this->definitions_path . "type_definitions.php"))
        {
            $this->SendMessage(t("Loading type_definitions.php"));
            include($this->definitions_path . "type_definitions.php");
        }
        
        if(file_exists($this->definitions_path . "variables.php"))
        {
            $this->SendMessage(t("Loading variables.php"));
            include($this->definitions_path . "variables.php");
        }
        
        if(file_exists($this->definitions_path . "functions.php"))
        {
            $this->SendMessage(t("Loading functions.php"));
            include($this->definitions_path . "functions.php");
        }
        
        if(file_exists($this->definitions_path . "classes.php"))
        {
            $this->SendMessage(t("Loading classes.php"));
            include($this->definitions_path . "classes.php");
        }
    }
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;
    }
1334355
public static function load($path)
    {
        if (is_dir($path)) {
            foreach (preg_grep('/^\.env$/', scandir($path)) as $filename) {
                $filePath = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $filename;
                if (is_readable($filePath)) {
                    foreach (parse_ini_file($filePath) as $envKey => $envValue) {
                        putenv($envKey . '=' . $envValue);
                    }
                }
            }
        } else {
            throw new BaseException('Your path does not directory.');
        }
    }
1357040
public function setConfigPath($path) 
    {
        if (file_exists($path)) {
            $this->configPath = $path;
        } else {
            throw new Exception(
                'Configuration file could not be found at ' .
                htmlspecialchars($path, ENT_QUOTES, 'UTF-8')
            );
        }
    }
860717
protected static function initPath($path)
    {
        // Fallback
        if (empty($path)) {
            $defaultDir = self::getProperty('application.startdir');
            $path = $defaultDir . DIRECTORY_SEPARATOR . self::DEFAULT_BUILD_FILENAME;
        }

        // Adding filename if necessary
        if (is_dir($path)) {
            $path .= DIRECTORY_SEPARATOR . self::DEFAULT_BUILD_FILENAME;
        }

        // Check if path is available
        $dirname = dirname($path);
        if (is_dir($dirname) && !is_file($path)) {
            return $path;
        }

        // Path is valid, but buildfile already exists
        if (is_file($path)) {
            throw new ConfigurationException('Buildfile already exists.');
        }

        throw new ConfigurationException('Invalid path for sample buildfile.');
    }