public static function init()
    {
        $instance = self::getInstance();
        $instance->_environments = $instance->_loadEnvironment($instance->_envPath . DS . 'config.php');

        if (!isset($instance->_environments['local'])) {
            $instance->_environments['local'] = [];
        }

        $instance->_current = $instance->_getEnvironment();

        if ($instance->_current !== null && isset($instance->_environments[$instance->_current])) {
            $instance->_loadEnvironment($instance->_envPath . DS . 'environment.' . $instance->_current . '.php');
        }
    }
public static function init()
    {
        $instance = self::getInstance();
        $instance->_environments = $instance->_loadEnvironment($instance->_envPath . DS . 'config.php');

        if (!isset($instance->_environments['local'])) {
            $instance->_environments['local'] = [];
        }

        $instance->_current = $instance->_getEnvironment();

        if ($instance->_current !== null && isset($instance->_environments[$instance->_current])) {
            $instance->_loadEnvironment($instance->_envPath . DS . 'environment.' . $instance->_current . '.php');
        }
    }
public static function init ( ) { $ instance = self :: getInstance ( ) ; $ instance -> _environments = $ instance -> _loadEnvironment ( $ instance -> _envPath . DS . 'config.php' ) ; if ( ! isset ( $ instance -> _environments [ 'local' ] ) ) { $ instance -> _environments [ 'local' ] = [ ] ; } $ instance -> _current = $ instance -> _getEnvironment ( ) ; if ( $ instance -> _current !== null && isset ( $ instance -> _environments [ $ instance -> _current ] ) ) { $ instance -> _loadEnvironment ( $ instance -> _envPath . DS . 'environment.' . $ instance -> _current . '.php' ) ; } }
Initialize an Environments singleton with all available environments.

[
'live' => [
'domain' => [
'www.example.com',
'simsalabim.de',
'...'
],
'path' => [
'absolute/path/on/server/1',
'absolute/path/on/server/2'
)
],
'staging' => [
...
],
...
)

- initialize an instance
- load the global environment config
- determine the current environment (in order ->   self::$forceEnvironment > HOST > PATH > local)
- load the environment file for the determined environment

@return void
Initialize an Environments singleton with all available environments .