Locking plugin
This plugin provides locking support to a WebDAV server. The easiest way to get started, is by hooking it up as such:
$lockBackend = new Sabre_DAV_Locks_Backend_FS('./my_lock_directory'); $lockPlugin = new Sabre_DAV_Locks_Plugin($lockBackend); $server->addPlugin($lockPlugin);
Located in /sources_custom/Sabre/DAV/Locks/Plugin.php (line 19)
Sabre_DAV_ServerPlugin | --Sabre_DAV_Locks_Plugin
This method is called after most properties have been found it allows us to add in any Lock-related properties
This method is called before the logic for any HTTP method is handled.
This plugin uses that feature to intercept access to locked resources.
Generates the response for successfull LOCK requests
Returns a list of features for the HTTP OPTIONS Dav: header.
In this case this is only the number 2. The 2 in the Dav: header indicates the server supports locks.
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.
This method is created to extract information from the WebDAV HTTP 'If:' header
The If header can be quite complex, and has a bunch of features. We're using a regex to extract all relevant information The function will return an array, containg structs with the following keys
* uri - the uri the condition applies to. This can be an empty string for 'every relevant url' * tokens - The lock token. another 2 dimensional array containg 2 elements (0 = true/false.. If this is a negative condition its set to false, 1 = the actual token) * etag - an etag, if supplied
Returns all lock information on a particular uri
This function should return an array with Sabre_DAV_Locks_LockInfo objects. If there are no locks on a file, return an empty array.
Additionally there is also the possibility of locks on parent nodes, so we'll need to traverse every part of the tree
Returns the contents of the HTTP Timeout header.
The method formats the header into an integer.
Locks an uri
The WebDAV lock request can be operated to either create a new lock on a file, or to refresh an existing lock If a new lock is created, a full XML body should be supplied, containing information about the lock such as the type of lock (shared or exclusive) and the owner of the lock
If a lock is to be refreshed, no body should be supplied and there should be a valid If header containing the lock
Additionally, a lock can be requested for a non-existant file. In these case we're obligated to create an empty file as per RFC4918:S7.3
Unlocks a uri
This WebDAV method allows you to remove a lock from a node. The client should provide a valid locktoken through the Lock-token http header The server should return 204 (No content) on success
Initializes the plugin
This method is automatically called by the Server class after addPlugin.
Locks a uri
All the locking information is supplied in the lockInfo object. The object has a suggested timeout, but this can be safely ignored It is important that if the existing timeout is ignored, the property is overwritten, as this needs to be sent back to the client
Parses a webdav lock xml body, and returns a new Sabre_DAV_Locks_LockInfo object
This method is called by the Server if the user used an HTTP method the server didn't recognize.
This plugin intercepts the LOCK and UNLOCK methods.
Unlocks a uri
This method removes a lock from a uri. It is assumed all the supplied information is correct and verified
validateLock should be called when a write operation is about to happen It will check if the requested url is locked, and see if the correct lock tokens are passed
Inherited From Sabre_DAV_ServerPlugin
Sabre_DAV_ServerPlugin::getFeatures()
Sabre_DAV_ServerPlugin::getHTTPMethods()
Sabre_DAV_ServerPlugin::initialize()
Documentation generated on Sun, 02 Jan 2011 23:22:18 +0000 by phpDocumentor 1.4.3