Storage/src/StreamWrapper.php
public static function register(StorageClient $client, $protocol = null)
    {
        $protocol = $protocol ?: self::DEFAULT_PROTOCOL;
        if (!in_array($protocol, stream_get_wrappers())) {
            if (!stream_wrapper_register($protocol, StreamWrapper::class, STREAM_IS_URL)) {
                throw new \RuntimeException("Failed to register '$protocol://' protocol");
            }
            self::$clients[$protocol] = $client;
            return true;
        }
        return false;
    }
public static function register(StorageClient $client, $protocol = null)
    {
        $protocol = $protocol ?: self::DEFAULT_PROTOCOL;
        if (!in_array($protocol, stream_get_wrappers())) {
            if (!stream_wrapper_register($protocol, StreamWrapper::class, STREAM_IS_URL)) {
                throw new \RuntimeException("Failed to register '$protocol://' protocol");
            }
            self::$clients[$protocol] = $client;
            return true;
        }
        return false;
    }
public static function register ( StorageClient $ client , $ protocol = null ) { $ protocol = $ protocol ? : self :: DEFAULT_PROTOCOL ; if ( ! in_array ( $ protocol , stream_get_wrappers ( ) ) ) { if ( ! stream_wrapper_register ( $ protocol , StreamWrapper :: class , STREAM_IS_URL ) ) { throw new \ RuntimeException ( "Failed to register '$protocol://' protocol" ) ; } self :: $ clients [ $ protocol ] = $ client ; return true ; } return false ; }
Register a StreamWrapper for reading and writing to Google Storage

@param StorageClient $client The StorageClient configuration to use.
@param string $protocol The name of the protocol to use. **Defaults to**
`gs`.
@throws \RuntimeException
Register a StreamWrapper for reading and writing to Google Storage