Plugin
extends ServerPlugin
in package
This plugin all WebDAV-sync capabilities to the Server.
WebDAV-sync is defined by rfc6578
The sync capabilities only work with collections that implement Sabre\DAV\Sync\ISyncCollection.
Tags
Table of Contents
- SYNCTOKEN_PREFIX = 'http://sabre.io/ns/sync/'
- $server : Server
- Reference to server object.
- getFeatures() : array<string|int, mixed>
- This method should return a list of server-features.
- getHTTPMethods() : array<string|int, mixed>
- Use this method to tell the server this plugin defines additional HTTP methods.
- 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.
- initialize() : mixed
- Initializes the plugin.
- propFind() : mixed
- This method is triggered whenever properties are requested for a node.
- syncCollection() : mixed
- This method handles the {DAV:}sync-collection HTTP REPORT.
- validateTokens() : mixed
- The validateTokens event is triggered before every request.
- sendSyncCollectionResponse() : mixed
- Sends the response to a sync-collection request.
Constants
SYNCTOKEN_PREFIX
public
mixed
SYNCTOKEN_PREFIX
= 'http://sabre.io/ns/sync/'
Properties
$server
Reference to server object.
protected
Server
$server
Methods
getFeatures()
This method should return a list of server-features.
public
getFeatures() : array<string|int, mixed>
This is for example 'versioning' and is added to the DAV: header in an OPTIONS response.
Return values
array<string|int, mixed> —getHTTPMethods()
Use this method to tell the server this plugin defines additional HTTP methods.
public
getHTTPMethods(string $path) : array<string|int, mixed>
This method is passed a uri. It should only return HTTP methods that are available for the specified uri.
Parameters
- $path : string
Return values
array<string|int, mixed> —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 \Sabre\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> —initialize()
Initializes the plugin.
public
initialize(Server $server) : mixed
This is when the plugin registers it's hooks.
Parameters
- $server : Server
Return values
mixed —propFind()
This method is triggered whenever properties are requested for a node.
public
propFind(PropFind $propFind, INode $node) : mixed
We intercept this to see if we must return a {DAV:}sync-token.
Parameters
Return values
mixed —syncCollection()
This method handles the {DAV:}sync-collection HTTP REPORT.
public
syncCollection(string $uri, SyncCollectionReport $report) : mixed
Parameters
- $uri : string
- $report : SyncCollectionReport
Return values
mixed —validateTokens()
The validateTokens event is triggered before every request.
public
validateTokens(RequestInterface $request, array<string|int, mixed> &$conditions) : mixed
It's a moment where this plugin can check all the supplied lock tokens in the If: header, and check if they are valid.
Parameters
- $request : RequestInterface
- $conditions : array<string|int, mixed>
Return values
mixed —sendSyncCollectionResponse()
Sends the response to a sync-collection request.
protected
sendSyncCollectionResponse(string $syncToken, string $collectionUrl, array<string|int, mixed> $added, array<string|int, mixed> $modified, array<string|int, mixed> $deleted, array<string|int, mixed> $properties) : mixed
Parameters
- $syncToken : string
- $collectionUrl : string
- $added : array<string|int, mixed>
- $modified : array<string|int, mixed>
- $deleted : array<string|int, mixed>
- $properties : array<string|int, mixed>