lithium\core\Libraries::_configure()

protected static method

Configures the application environment based on a library's settings, including appending to the include path, loading a bootstrap file, and registering a loader with SPL's autoloading system.

Parameters

  • array $config

    The new library's configuration array.

Returns

void

Source

	protected static function _configure($config) {
		if ($config['includePath']) {
			$path = ($config['includePath'] === true) ? $config['path'] : $config['includePath'];
			set_include_path(get_include_path() . PATH_SEPARATOR . $path);
		}
		if ($config['bootstrap'] === true) {
			$path = "{$config['path']}/config/bootstrap.php";
			$config['bootstrap'] = file_exists($path) ? 'config/bootstrap.php' : false;
		}
		if ($config['bootstrap']) {
			require "{$config['path']}/{$config['bootstrap']}";
		}
		if (!empty($config['loader'])) {
			spl_autoload_register($config['loader']);
		}
	}