Load the local config file

@return mixed string the local config file name. false if local config does not exist
487053
public function loadLocalConfig()
    {
        $home_folder = getenv('HOME') ?: getenv('HOMEDRIVE') . getenv('HOMEPATH');
        $local_config_file = $home_folder . '/.grav/config';

        if (file_exists($local_config_file)) {
            $file = YamlFile::instance($local_config_file);
            $this->local_config = $file->content();
            $file->free();
            return $local_config_file;
        }

        return false;
    }
980105
public function loadConfig()
    {
        $config = [];

        $configDir = $this->getConfigDir();
        $distConfigDir = $this->getDistConfigDir();

        foreach ($this->configKeys as $configKey) {
            $fullPath = $configDir.'/'.$configKey.'.yml';
            $fullDistPath = $distConfigDir.'/'.$configKey.'.yml';
            $config[$configKey] = [];

            $userConfig = [];
            if ($this->filesystem->exists($fullPath)) {
                $userConfig = Yaml::parse(file_get_contents($fullPath));
            }

            if ($this->filesystem->exists($fullDistPath)) {
                $distConfig = Yaml::parse(file_get_contents($fullDistPath));
            } else {
                throw new \RuntimeException(sprintf(
                    'Could not find dist config at path (%s)',
                    $fullDistPath
                ));
            }

            $config[$configKey] = new Config(array_merge(
                $distConfig,
                $userConfig
            ));
        }

        $this->cachedConfig = $config;

        return $config;
    }
529049
public function loadConfig()
    {
        $result = $this->configStorage->lock();
        if ($result === false) {
            throw new \RuntimeException('Failed to lock the configStorage');
        }
        try {
            $result = $this->configStorage->load();
        } catch (\RuntimeException $e) {
            $this->configStorage->clear();
            throw $e;
        } finally {
            $this->configStorage->unlock();
        }

        $this->config = $result;
        return true;
    }
46954
protected function loadConfiguration()
    {
        $configuration = null;

        if (file_exists(self::CONFIGURATION_FILENAME)) {
            $configuration = json_decode(file_get_contents(self::CONFIGURATION_FILENAME), true);
        }

        return $configuration ?: array();
    }
1367053
static function load($name){

		if($name == ''){
			return self::$data;
		}
		$name = Loader::getName($name,'config');
		$key = $name->app.'.'.$name->class;
		
		if(!isset(static::$data[$key])){
			// file config is exist?
			if(!file_exists($name->path)){
				user_error('Config '.$name->path.' Not Found');
				exit;
			}
			self::$data[$key] = (require_once $name->path);
		}
		return self::$data[$key];
	}
464212
private function loadConfigFromCache()
    {
        /** @var \Core\Services\Contracts\Config $config */
        $config = DI::getInstance()->get('config');

        /** @noinspection PhpIncludeInspection */
        $config->set(null, require $this->cachedFile);

        return $config;
    }
825632
protected function loadConfig()
    {
        /** @var DiagnosticServiceInterface $service */
        $service = $this->getServiceLocator()->get(DiagnosticServiceInterface::SERVICE_ID);
        $config = $service->getDiagnosticJsConfig();
        $config['controller'] = 'CompatibilityChecker';
        return $config;
    }
718185
protected function readConfig()
    {
        if ($this->loaded == false) {
            $this->config = $this->loader->getDatas();
            $this->loaded = true;
        }

        return $this;
    }
711068
public function loadConfig()
    {
        $fileName = $this->getPath() . DIRECTORY_SEPARATOR . 'config/config.php';
        if(is_file($fileName))
        {
            $name = '@' . $this->moduleName;
            Config::removeConfig($name);
            Config::addConfig($name, include $fileName);
        }
    }
321935
private function load_host_config()
    {
        if (empty($this->prop['include_host_config'])) {
            return;
        }

        foreach (array('HTTP_HOST', 'SERVER_NAME', 'SERVER_ADDR') as $key) {
            $fname = null;
            $name  = $_SERVER[$key];

            if (!$name) {
                continue;
            }

            if (is_array($this->prop['include_host_config'])) {
                $fname = $this->prop['include_host_config'][$name];
            }
            else {
                $fname = preg_replace('/[^a-z0-9\.\-_]/i', '', $name) . '.inc.php';
            }

            if ($fname && $this->load_from_file($fname)) {
                return;
            }
        }
    }
250531
private function readConfigFile()
    {
        // Check config.json exists
        $this->info("Reading config");

        // look for config in main directory
        if(file_exists($this->tmpDirectory.'/config.json')) {
            $this->configContent = json_decode(File::get($this->tmpDirectory.'/config.json'));
            return $this;
        }

        // look for config in the first directory
        // useful in case the plugin is downloaded via http
        $directories = File::directories($this->tmpDirectory);
        if(isset($directories[0])) {
            $pluginPathSource = $directories[0];
            if (file_exists($pluginPathSource . '/config.json')) {
                $this->configContent = json_decode(File::get($pluginPathSource.'/config.json'));
                return $this;
            }
        }

        // no config.json found
        $this->cleanTmp();
        throw new \Exception('config.json file not found');
    }
166425
private function loadingConfig()
    {
        if ($_SERVER['HTTP_HOST'] == SERVER_DEVELOP) {
            if (!is_file(SYSTEM_ROOT . '/config/config.local.php'))
                @copy(SYSTEM_ROOT . '/config/config.sample.php', SYSTEM_ROOT . '/config/config.local.php');
            require_once('config/config.local.php');
        } else {
            if (!is_file(SYSTEM_ROOT . '/config/config.php'))
                @copy(SYSTEM_ROOT . '/config/config.sample.php', SYSTEM_ROOT . '/config/config.php');
            require_once('config/config.php');
        }
    }
518768
protected function loadConfig()
    {
        if (self::$config_path === null) {
            throw new \BadMethodCallException('Config path is null');
        }

        $key = "$this->cnab/$this->bank_code";

        if (!array_key_exists($key, self::$cache)) {
            $config_file = self::$config_path . "/cnab$key.yml";
            if (file_exists($config_file)) {
                self::$cache[$key] = Yaml::parseFile($config_file);
            } else {
                throw new \RuntimeException(sprintf(
                    "Config file for Bank '%s' in CNAB%s not found",
                    $this->bank_code,
                    $this->cnab
                ));
            }
        }

        $this->config = $key;
    }
73170
public function load($configFileName = null)
    {
        $configs = [];

        // load all local configs (config files that are not user-facing)
        $localConfig = [];
        foreach ($this->localConfigStack as $file) {
            $config = include $file;
            $localConfig = array_merge_recursive($localConfig, $config);
        }
        if (!empty($localConfig)) {
            $configs[] = $localConfig;
        }

        // load the current project's config file (user-facing)
        if (null === $configFileName) {
            $configFileName = $this->defaultFileName;
        }
        if ($this->projectFileSystem->has($configFileName)) {
            $configs[] = Yaml::parse($this->projectFileSystem->read($configFileName));
        }

        // validate and merge all configs
        $config = $this->processor->processConfiguration(
            $this->definition,
            $configs
        );

        return new $this->configClass($config);
    }
1289430
public function loadConfigurationCache(): bool
    {
        $cachePathAndFilename = $this->constructConfigurationCachePath();
        $configurations = @include $cachePathAndFilename;
        if ($configurations !== false) {
            $this->configurations = $configurations;
            return true;
        }

        return false;
    }
1037359
public function load()
    {
        $items = [];
        $directory = new DirectoryIterator(realpath($this->directory));

        foreach ($directory as $file) {
            if ($file->isFile() && $file->getExtension() == $this->extension) {
                $filename = $file->getFilename();
                $config = substr($filename, 0, strrpos($filename, '.'));

                $items[$config] = $this->translateFile($file->getPathname());
            }
        }

        return $items;
    }
351544
public function load()
    {
        if (!$this->esprima) {

            $this->esprima = $this->loadFile(
                $this->locator->locate($this->file)
            );
        }

        return $this->esprima;
    }