Gets the current environment name, a setting associated with the current environment, or the entire configuration array for the current environment.

Parameters

  • string $name The name of the environment setting to retrieve, or the name of an environment, if that environment's entire configuration is to be retrieved. If retrieving the current environment name, `$name` should not be passed.

Returns

mixed If `$name` is unspecified, returns the name of the current environment name as a string (i.e. `'production'`). If an environment name is specified, returns that environment's entire configuration as an array.

Source

						public static function get($name = null) {
		$cur = static::$_current;

		if (!$name) {
			return $cur;
		}
		if ($name === true) {
			return isset(static::$_configurations[$cur]) ? static::$_configurations[$cur] : null;
		}
		if (isset(static::$_configurations[$name])) {
			return static::_processDotPath($name, static::$_configurations);
		}
		if (!isset(static::$_configurations[$cur])) {
			return static::_processDotPath($name, static::$_configurations);
		}

		return static::_processDotPath($name, static::$_configurations[$cur]);
	}