public static function register(ServerInterface $server)
    {
        self::$server = $server;

        $wrappers = stream_get_wrappers();

        foreach (['http', 'https'] as $protocol) {
            if (in_array($protocol, $wrappers, true)) {
                stream_wrapper_unregister($protocol);
            }

            stream_wrapper_register($protocol, self::class, STREAM_IS_URL);
        }
    }
public static function register(ServerInterface $server)
    {
        self::$server = $server;

        $wrappers = stream_get_wrappers();

        foreach (['http', 'https'] as $protocol) {
            if (in_array($protocol, $wrappers, true)) {
                stream_wrapper_unregister($protocol);
            }

            stream_wrapper_register($protocol, self::class, STREAM_IS_URL);
        }
    }
public static function register ( ServerInterface $ server ) { self :: $ server = $ server ; $ wrappers = stream_get_wrappers ( ) ; foreach ( [ 'http' , 'https' ] as $ protocol ) { if ( in_array ( $ protocol , $ wrappers , true ) ) { stream_wrapper_unregister ( $ protocol ) ; } stream_wrapper_register ( $ protocol , self :: class , STREAM_IS_URL ) ; } }
Registers the stream wrapper.

The given {@see ServerInterface} will be used to handle all HTTP requests. All subsequent filesystem function
calls over HTTP will use this stream wrapper. Also, if a custom wrapper was already registered, it will be
replaced.

The wrapper can be unregistered using {@see unregister()} method. Note that this will restore the PHP built-in
wrapper; if you want to use another custom wrapper, you will have to register it again.

@param ServerInterface $server
Registers the stream wrapper .