yii\mongodb\file\StreamWrapper::register PHP Method

register() public static method

Registers this steam wrapper.
public static register ( string $protocol = 'gridfs', boolean $force = false )
$protocol string name of the protocol to be used.
$force boolean whether to register wrapper, even if protocol is already taken.
    public static function register($protocol = 'gridfs', $force = false)
    {
        if (in_array($protocol, stream_get_wrappers())) {
            if (!$force) {
                return;
            }
            stream_wrapper_unregister($protocol);
        }
        stream_wrapper_register($protocol, get_called_class(), STREAM_IS_URL);
    }