public static function init($key = null)
    {
        $instance = Injector::inst()->get(__CLASS__);

        if (empty($key)) {
            user_error(
                'HybridSession::init() was not given a $key. Disabling cookie-based storage',
                E_USER_WARNING
            );
        } else {
            $instance->setKey($key);
        }

        session_set_save_handler($instance, true);

        self::$enabled = true;
    }
public static function init($key = null)
    {
        $instance = Injector::inst()->get(__CLASS__);

        if (empty($key)) {
            user_error(
                'HybridSession::init() was not given a $key. Disabling cookie-based storage',
                E_USER_WARNING
            );
        } else {
            $instance->setKey($key);
        }

        session_set_save_handler($instance, true);

        self::$enabled = true;
    }
public static function init ( $ key = null ) { $ instance = Injector :: inst ( ) -> get ( __CLASS__ ) ; if ( empty ( $ key ) ) { user_error ( 'HybridSession::init() was not given a $key. Disabling cookie-based storage' , E_USER_WARNING ) ; } else { $ instance -> setKey ( $ key ) ; } session_set_save_handler ( $ instance , true ) ; self :: $ enabled = true ; }
Register the session handler as the default

@param string $key Desired session key
Register the session handler as the default