public static function init(Container $container = null)
    {
        if (empty(self::$_instance)) {

            // 环境检测
            if (version_compare(PHP_VERSION, '5.6.0', '<')) {
                throw new \ErrorException('NONSUPPORT_PHP_VERSION');
            }
            if (is_null($container)) {
                $container = Container::instance();
            }

            self::$_instance = new self($container->getContainer());
        }

        return self::$_instance;
    }
public static function init(Container $container = null)
    {
        if (empty(self::$_instance)) {

            // 环境检测
            if (version_compare(PHP_VERSION, '5.6.0', '<')) {
                throw new \ErrorException('NONSUPPORT_PHP_VERSION');
            }
            if (is_null($container)) {
                $container = Container::instance();
            }

            self::$_instance = new self($container->getContainer());
        }

        return self::$_instance;
    }
public static function init ( Container $ container = null ) { if ( empty ( self :: $ _instance ) ) { // 环境检测 if ( version_compare ( PHP_VERSION , '5.6.0' , '<' ) ) { throw new \ ErrorException ( 'NONSUPPORT_PHP_VERSION' ) ; } if ( is_null ( $ container ) ) { $ container = Container :: instance ( ) ; } self :: $ _instance = new self ( $ container -> getContainer ( ) ) ; } return self :: $ _instance ; }
Initialize the server object.

@param Container $container

@throws \ErrorException

@return Server
Initialize the server object .