Plugin
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.
- Full name:
\Sabre\DAV\Sync\Plugin
- Parent class:
\Sabre\DAV\ServerPlugin
Constants
Constant | Visibility | Type | Value |
---|---|---|---|
SYNCTOKEN_PREFIX |
public | 'http://sabre.io/ns/sync/' |
Properties
server
Reference to server object.
Methods
getPluginName
Returns a plugin name.
Using this name other plugins will be able to access other plugins using \Sabre\DAV\Server::getPlugin
initialize
Initializes the plugin.
This is when the plugin registers it's hooks.
Parameters:
Parameter | Type | Description |
---|---|---|
$server |
\Sabre\DAV\Server |
getSupportedReportSet
Returns a list of reports this plugin supports.
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:
Parameter | Type | Description |
---|---|---|
$uri |
string |
syncCollection
This method handles the {DAV:}sync-collection HTTP REPORT.
Parameters:
Parameter | Type | Description |
---|---|---|
$uri |
string | |
$report |
\Sabre\DAV\Xml\Request\SyncCollectionReport |
sendSyncCollectionResponse
Sends the response to a sync-collection request.
protected sendSyncCollectionResponse(string $syncToken, string $collectionUrl, array $added, array $modified, array $deleted, array $properties, bool $resultTruncated = false): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$syncToken |
string | |
$collectionUrl |
string | |
$added |
array | |
$modified |
array | |
$deleted |
array | |
$properties |
array | |
$resultTruncated |
bool |
propFind
This method is triggered whenever properties are requested for a node.
We intercept this to see if we must return a {DAV:}sync-token.
Parameters:
Parameter | Type | Description |
---|---|---|
$propFind |
\Sabre\DAV\PropFind | |
$node |
\Sabre\DAV\INode |
validateTokens
The validateTokens event is triggered before every request.
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:
Parameter | Type | Description |
---|---|---|
$request |
\Sabre\HTTP\RequestInterface | |
$conditions |
array |
getPluginInfo
Returns a bunch of meta-data about the plugin.
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.
Inherited methods
initialize
This initializes the plugin.
This function is called by Sabre\DAV\Server, after addPlugin is called.
This method should set up the required event subscriptions.
- This method is abstract.
Parameters:
Parameter | Type | Description |
---|---|---|
$server |
\Sabre\DAV\Server |
getFeatures
This method should return a list of server-features.
This is for example 'versioning' and is added to the DAV: header in an OPTIONS response.
getHTTPMethods
Use this method to tell the server this plugin defines additional HTTP methods.
This method is passed a uri. It should only return HTTP methods that are available for the specified uri.
Parameters:
Parameter | Type | Description |
---|---|---|
$path |
string |
getPluginName
Returns a plugin name.
Using this name other plugins will be able to access other plugins using \Sabre\DAV\Server::getPlugin
getSupportedReportSet
Returns a list of reports this plugin supports.
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:
Parameter | Type | Description |
---|---|---|
$uri |
string |
getPluginInfo
Returns a bunch of meta-data about the plugin.
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.
Automatically generated on 2025-03-18