public static function register($protocol = 'gridfs') { if (in_array($protocol, stream_get_wrappers())) { stream_wrapper_unregister($protocol); } stream_wrapper_register($protocol, get_called_class(), \STREAM_IS_URL); }
/** * Registers the GridFS stream wrapper if it is not already registered. */ private function registerStreamWrapper() { if (in_array(self::$streamWrapperProtocol, stream_get_wrappers())) { return; } StreamWrapper::register(self::$streamWrapperProtocol); }