Plugin
extends ServerPlugin
in package
Partial update plugin (Patch method).
This plugin provides a way to modify only part of a target resource It may bu used to update a file chunk, upload big a file into smaller chunks or resume an upload.
$patchPlugin = new \Sabre\DAV\PartialUpdate\Plugin(); $server->addPlugin($patchPlugin);
Tags
Table of Contents
- RANGE_APPEND = 1
- RANGE_END = 3
- RANGE_START = 2
- $server : Server
- Reference to server.
- getFeatures() : array<string|int, mixed>
- Returns a list of features for the HTTP OPTIONS Dav: header.
- getHTTPMethods() : array<string|int, mixed>
- Use this method to tell the server this plugin defines additional HTTP methods.
- getHTTPUpdateRange() : array<string|int, mixed>|null
- Returns the HTTP custom range update header.
- getPluginInfo() : array<string|int, mixed>
- Returns a bunch of meta-data about the plugin.
- getPluginName() : string
- Returns a plugin name.
- getSupportedReportSet() : array<string|int, mixed>
- Returns a list of reports this plugin supports.
- httpPatch() : mixed
- Patch an uri.
- initialize() : mixed
- Initializes the plugin.
Constants
RANGE_APPEND
public
mixed
RANGE_APPEND
= 1
RANGE_END
public
mixed
RANGE_END
= 3
RANGE_START
public
mixed
RANGE_START
= 2
Properties
$server
Reference to server.
protected
Server
$server
Methods
getFeatures()
Returns a list of features for the HTTP OPTIONS Dav: header.
public
getFeatures() : array<string|int, mixed>
Return values
array<string|int, mixed> —getHTTPMethods()
Use this method to tell the server this plugin defines additional HTTP methods.
public
getHTTPMethods(string $uri) : array<string|int, mixed>
This method is passed a uri. It should only return HTTP methods that are available for the specified uri.
We claim to support PATCH method (partirl update) if and only if - the node exist - the node implements our partial update interface
Parameters
- $uri : string
Return values
array<string|int, mixed> —getHTTPUpdateRange()
Returns the HTTP custom range update header.
public
getHTTPUpdateRange(RequestInterface $request) : array<string|int, mixed>|null
This method returns null if there is no well-formed HTTP range request header. It returns array(1) if it was an append request, array(2, $start, $end) if it's a start and end range, lastly it's array(3, $endoffset) if the offset was negative, and should be calculated from the end of the file.
Examples:
null - invalid [1] - append [2,10,15] - update bytes 10, 11, 12, 13, 14, 15 [2,10,null] - update bytes 10 until the end of the patch body [3,-5] - update from 5 bytes from the end of the file.
Parameters
- $request : RequestInterface
Return values
array<string|int, mixed>|null —getPluginInfo()
Returns a bunch of meta-data about the plugin.
public
getPluginInfo() : array<string|int, mixed>
Providing this information is optional, and is mainly displayed by the Browser plugin.
The description key in the returned array may contain html and will not be sanitized.
Return values
array<string|int, mixed> —getPluginName()
Returns a plugin name.
public
getPluginName() : string
Using this name other plugins will be able to access other plugins using DAV\Server::getPlugin
Return values
string —getSupportedReportSet()
Returns a list of reports this plugin supports.
public
getSupportedReportSet(string $uri) : array<string|int, mixed>
This will be used in the {DAV:}supported-report-set property. Note that you still need to subscribe to the 'report' event to actually implement them
Parameters
- $uri : string
Return values
array<string|int, mixed> —httpPatch()
Patch an uri.
public
httpPatch(RequestInterface $request, ResponseInterface $response) : mixed
The WebDAV patch request can be used to modify only a part of an existing resource. If the resource does not exist yet and the first offset is not 0, the request fails
Parameters
- $request : RequestInterface
- $response : ResponseInterface
Return values
mixed —initialize()
Initializes the plugin.
public
initialize(Server $server) : mixed
This method is automatically called by the Server class after addPlugin.
Parameters
- $server : Server