src/Extension/Extension.php
/**
	 * Loads the configuration file and sets defaults for missing entries.
	 *
	 * @throws Exception
	 */
Loads the configuration file and sets defaults for missing entries.
@throws Exception
Loads the configuration file and sets defaults for missing entries . @throws Exception
protected function loadConfiguration() {
		$this->config = require($this->configFilePath);
		if (!is_array($this->config)) throw new Exception($this->path, 'Extension\'s main configuration file did not return an array.');
		if (is_null(array_get($this->config, 'name'))) throw new Exception($this->path, 'Extension name is required.');
		if (is_null(array_get($this->config, 'version'))) throw new Exception($this->path, 'Extension version is required.');
		if (!is_string(array_get($this->config, 'description'))) $this->config['description'] = '';
		if (!is_string(array_get($this->config, 'main'))) $this->config['main'] = null;
		if (!is_array(array_get($this->config, 'namespaces'))) $this->config['namespaces'] = array();
		if (!is_array(array_get($this->config, 'files'))) $this->config['files'] = array();
		if (!is_array(array_get($this->config, 'providers'))) $this->config['providers'] = array();
	}
protected function loadConfiguration ( ) { $ this -> config = require ( $ this -> configFilePath ) ; if ( ! is_array ( $ this -> config ) ) throw new Exception ( $ this -> path , 'Extension\'s main configuration file did not return an array.' ) ; if ( is_null ( array_get ( $ this -> config , 'name' ) ) ) throw new Exception ( $ this -> path , 'Extension name is required.' ) ; if ( is_null ( array_get ( $ this -> config , 'version' ) ) ) throw new Exception ( $ this -> path , 'Extension version is required.' ) ; if ( ! is_string ( array_get ( $ this -> config , 'description' ) ) ) $ this -> config [ 'description' ] = '' ; if ( ! is_string ( array_get ( $ this -> config , 'main' ) ) ) $ this -> config [ 'main' ] = null ; if ( ! is_array ( array_get ( $ this -> config , 'namespaces' ) ) ) $ this -> config [ 'namespaces' ] = array ( ) ; if ( ! is_array ( array_get ( $ this -> config , 'files' ) ) ) $ this -> config [ 'files' ] = array ( ) ; if ( ! is_array ( array_get ( $ this -> config , 'providers' ) ) ) $ this -> config [ 'providers' ] = array ( ) ; }
Loads the configuration file and sets defaults for missing entries.
Loads the configuration file and sets defaults for missing entries .
// Set defaults for incorrect or missing values