Read entire config and return as array.

@return array|boolean
197808
protected function readConfig()
    {
        $data = FileHelper::getFileContent($this->configFile);
        
        if ($data) {
            return Json::decode($data);
        }
        
        return false;
    }
113345
public function getArray()
    {
        $config = @include $this->location;
        if (!is_array($config)) {
            throw new \Exception('Config not found');
        }

        $this->config = $config;

        return $config;
    }
730147
public function getConfig() {
		if(!$this->config) {
			$this->config = $config = new \Asgard\Config\Config($this->getCache());
			if(file_exists($this->params['root'].'/config'))
				$config->loadDir($this->params['root'].'/config', $this->getEnv());
		}
		return $this->config;
	}
669225
protected function buildConfig()
    {
        if ($this->buildCache === null) {
            // Read the top config first:
            $built = [];
            $built = array_replace_recursive($built, $this->values['_top']);

            if (array_key_exists($this->environment, $this->values)) {
                $built = array_replace_recursive($built, $this->values[$this->environment]);
            }

            $this->buildCache = $built;
        }

        return $this->buildCache;
    }
370238
public static function getConfig()
    {
        if (static::$config !== null) {
            return static::$config;
        }

        $configs = Registry::get('config');

        return static::$config = isset($configs['cookie']) ? $configs['cookie'] : [];
    }
861356
public static function get() {

        $keys = func_get_args();
        $config = self::getConfig();
        $value = $config;

        if (!empty($config) && !empty($keys)) {

            foreach ($keys as $number => $name) {

                if (is_object($value)) {

                    $value = Format::objectToArray($value);
                }

                if ($number == 0 && isset($value[$name])) {

                    $value = $value[$keys[0]];
                } else if ($number != 0 && isset($value[$name])) {

                    $value = $value[$name];
                } else {

                    return false;
                }
            }

            return $value;
        } else if (!empty($config)) {

            return $config;
        }

        return false;
    }
1003733
public static function configMerge() {
        $result = array();
        $args = func_get_args();
        foreach ($args as $arg) {
            if (!is_array($arg)) {
                continue;
            }
            foreach ($arg as $key => $value) {
                if (is_numeric($key)) {
                    // Renumber numeric keys as array_merge() does.
                    $result[] = $value;
                } elseif (array_key_exists($key, $result) && is_array($result[$key]) && is_array($value)) {
                    // Recurse only when both values are arrays.
                    $result[$key] = ConfigServiceProvider::configMerge($result[$key], $value);
                } else {
                    // Otherwise, use the latter value.
                    $result[$key] = $value;
                }
            }
        }
        return $result;
    }
694747
public function getFiles()
    {

        // initialize the array with the files
        $files = array();

        // iterate over the file keys and read the configuration values
        foreach (FileKeys::getServerFileKeys() as $fileKey) {
            $files[$fileKey] = $this->getSystemConfiguration()->getParam($fileKey);
        }

        // return the array with the files
        return $files;
    }
1133290
public function loadConfig()
    {
        $path = $this->getConfigPath();

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

        $configs = Cache::remember("moduleConfig::{$path}", Carbon::now()->addMinutes(10), function () use ($path) {
            $configs = [];
            foreach (new \DirectoryIterator($path) as $file) {
                if ($file->isDot() or strpos($file->getFilename(), '.php') === false) {
                    continue;
                }
                $key = $file->getBasename('.php');
                $configs[$key] = array_merge_recursive(require $file->getPathname(), app('config')->get($key, []));
            }

            return $configs;
        });

        return $configs;
    }
524552
private static function getConfig() {

        if(!isset(self::$config)) {

            $default = Format::jsonToArray(File::get('../config/default.config.json'));
            $custom = Format::jsonToArray(File::get('../config/custom.config.json'));

            if ($default && $custom) {

                self::$config = self::merge($default, $custom);
            } else if ($default) {

                self::$config = $default;
            }
        }

        if(isset(self::$config)) {

            return self::$config;
        }        

        return false;
    }
1133343
public function allToArray()
    {
        $config = [];

        try {
            foreach ($this->findAll() as $object) {
                $key = $object->key_name;
                if ($object->group_name != 'config') {
                    $config[$object->group_name][$key] = $object->value;
                } else {
                    $config[$key] = $object->value;
                }
            }
        } catch (Exception $e) {
            Log::error($e->getMessage());
        }

        return $config;
    }
667262
protected function getProfileConfig()
    {
        $configCallable = $this->config;
        $config = $configCallable($this->getProfileConfigKey());

        if (!is_array($config)) {
            $config = [$config];
        }

        return array_filter($config);
    }
671747
public function getConfig(): array
    {
        if (empty($this->config)) {
            $yamlParser = new Parser();
            $files = $this->getFileNames();
            $config = [];
            foreach ($files as $file) {
                $fileConfig = $yamlParser->parseFile($file);
                $config = \array_merge($config, $fileConfig);
            }
            $this->config = $config;
        }
        return $this->config;
    }
656388
public static function configs()
    {
        $files = File::allFiles(base_path().'/plugins');
        $result = [];
        foreach ($files as $file){
            if($file->getBasename() == "config.json") {
                $result[] = json_decode(File::get($file->getPathname()));
            }
        }
        return $result;
    }
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;
    }
415742
private function readConfig()
    {
        // Logging
        if ($this->loadedLogger === null) {
            $logger = $this->loadedConfigurator->getConfig('logger', 'adapter');

            $this->setLogger($logger);

            if ($this->loadedLogger === null) {
                $this->setLogger(DummyLogger::class);
            }
        }

        // Caching
        if ($this->loadedCacheAdapter === null) {
            $cacheAdapter = $this->loadedConfigurator->getConfig('cache', 'adapter');

            $this->setCacheAdapter($cacheAdapter);

            if ($this->loadedCacheAdapter === null) {
                $this->setCacheAdapter(DummyCacheAdapter::class);
            }
        }

        $cacheTtl = $this->loadedConfigurator->getConfig('cache', 'ttl');

        $this->cacheTtl = is_numeric($cacheTtl) ? $cacheTtl : 3600;

        // Configuration loading
        // Look-up for assets_source
        $this->assetsSource = $this->loadedConfigurator->getConfig('assets_source');

        if (empty($this->assetsSource)) {
            $this->loadedLogger->warning('Could not load the "assets_source" setting.');
        }

        // "assets_source" can be an array of paths.
        $this->assetsSource = (array)$this->assetsSource;

        // Loading the filters
        $filters = $this->loadedConfigurator->getConfig('filters');

        if (is_array($filters)) {
            $this->filters = $filters;

            foreach ($filters as $extensionFilters) {
                foreach ($extensionFilters as $filter) {
                    $this->loadFilter($filter);
                }
            }
        } else {
            $this->loadedLogger->warning('"filters" setting is not an array; no filters loaded...');
        }

        // Loading the main or backup deployer
        $deployers = $this->loadedConfigurator->getConfig('deployers');

        if (is_array($deployers)) {
            if (isset($deployers['main'])) {
                $backupLoaded = $this->loadDeployer($deployers['main']);

                if (!$backupLoaded) {
                    $this->loadedLogger->warning('Could not load the main deployer ' . $deployers['main']);
                } else {
                    $this->loadedDeployer = $deployers['main'];

                    $this->loadedLogger->debug('Main deployer loaded: ' . $deployers['main']);
                }
            } else {
                $this->loadedLogger->warning('There is no main deployer set in configuration.');
            }

            if ($this->loadedDeployer === null) {
                if (isset($deployers['backup'])) {
                    $backupLoaded = $this->loadDeployer($deployers['backup']);

                    if (!$backupLoaded) {
                        $this->loadedLogger->warning('Could not load the backup deployer ' . $deployers['backup']);
                    } else {
                        $this->loadedDeployer = $deployers['backup'];

                        $this->loadedLogger->debug('Backup deployer loaded: ' . $deployers['backup']);
                    }
                } else {
                    $this->loadedLogger->warning('There is no backup deployer set in configuration.');
                }
            }
        } else {
            $this->loadedLogger->warning('"deployers" setting is not an array; no deployers loaded...');
        }

        // Mergers
        $assetsMergers = $this->loadedConfigurator->getConfig('mergers');

        if (is_array($assetsMergers)) {
            foreach ($assetsMergers as $ext => $assetsMerger) {
                if ($this->loadAssetsManager($assetsMerger)) {
                    $this->assetsMergersList[$ext] = $assetsMerger;
                }
            }
        }
    }
656789
private static function loadConfig()
    {
        $config = Config::get('placeholders');
        self::$longs = $config['longs'];
        self::$longModifiers = $config['longModifiers'];
        self::$placeholders = array();
        foreach ($config['placeholders'] as $placeholder) {
            self::$placeholders[$placeholder] = true;
        }
        self::$lModifiers = array();
        foreach ($config['modifiers'] as $modifier) {
            self::$lModifiers[$modifier] = false;
        }
        return true;
    }