luya\base\Boot::getConfigArray PHP Method

getConfigArray() public method

Get the config array from the configFile path with the predefined values.
public getConfigArray ( ) : array
return array The array which will be injected into the Application Constructor.
    public function getConfigArray()
    {
        if ($this->_configArray === null) {
            if (!file_exists($this->configFile)) {
                throw new Exception("Unable to load the config file '" . $this->configFile . "'.");
            }
            $config = (require $this->configFile);
            if (!is_array($config)) {
                throw new Exception("config file '" . $this->configFile . "' found but no array returning.");
            }
            // adding default configuration timezone if not set
            if (!array_key_exists('timezone', $config)) {
                $config['timezone'] = 'Europe/Berlin';
            }
            $this->_configArray = $config;
        }
        return $this->_configArray;
    }