Main DAV server class
Located in /sources_custom/Sabre/DAV/Server.php (line 12)
| Class | Description |
|---|---|
| Sabre_CalDAV_Server | CalDAV server |
The base uri
This is a flag that allow or not showing file, line and code of the exception in the returned XML
This array contains a list of callbacks we should call when certain events are triggered
httpRequest
httpResponse
The list of plugins
The propertymap can be used to map properties from requests to property classes.
The tree object
This is a default list of namespaces.
If you are defining your own custom namespace, add it here to reduce bandwidth and improve legibility of xml bodies.
Sets up the server
If a Sabre_DAV_Tree object is passed as an argument, it will use it as the directory tree. If a Sabre_DAV_INode is passed, it will create a Sabre_DAV_ObjectTree and use the node as the root.
If nothing is passed, a Sabre_DAV_SimpleDirectory is created in a Sabre_DAV_ObjectTree.
Adds a plugin to the server
For more information, console the documentation of Sabre_DAV_ServerPlugin
Broadcasts an event
This method will call all subscribers. If one of the subscribers returns false, the process stops.
The arguments parameter will be sent to all subscribers
Calculates the uri for a request, making sure that the base uri is stripped out
This method checks the main HTTP preconditions.
Currently these are: * If-Match * If-None-Match * If-Modified-Since * If-Unmodified-Since
The method will return true if all preconditions are met The method will return false, or throw an exception if preconditions failed. If false is returned the operation should be aborted, and the appropriate HTTP response headers are already set.
Normally this method will throw 412 Precondition Failed for failures related to If-None-Match, If-Match and If-Unmodified Since. It will set the status to 304 Not Modified for If-Modified_since.
If the $handleAsGET argument is set to true, it will also return 304 Not Modified for failure of the If-None-Match precondition. This is the desired behaviour for HTTP GET and HTTP HEAD requests.
Use this method to create a new collection
The {DAV:}resourcetype is specified using the resourceType array. At the very least it must contain {DAV:}collection.
The properties array can contain a list of additional properties.
This method is invoked by sub-systems creating a new directory.
This method is invoked by sub-systems creating a new file.
Currently this is done by HTTP PUT and HTTP LOCK (in the Locks_Plugin). It was important to get this done through a centralized function, allowing plugins to intercept this using the beforeCreateFile event.
Starts the DAV Server
Generates a WebDAV propfind response body based on a list of nodes
Returns an array with all the supported HTTP methods for a specific uri.
Returns the base responding uri
Returns information about Copy and Move requests
This function is created to help getting information about the source and the destination for the WebDAV MOVE and COPY HTTP request. It also validates a lot of information and throws proper exceptions
The returned value is an array with the following keys: * destination - Destination path * destinationExists - Wether or not the destination is an existing url (and should therefore be overwritten)
Returns the HTTP depth header
This method returns the contents of the HTTP depth request header. If the depth header was 'infinity' it will return the Sabre_DAV_Server::DEPTH_INFINITY object It is possible to supply a default depth value, which is used when the depth header has invalid content, or is completely non-existant
Returns a list of HTTP headers for a particular resource
The generated http headers are based on properties provided by the resource. The method basically provides a simple mapping between DAV property and HTTP header.
The headers are intended to be used for HEAD and GET requests.
Returns the HTTP range header
This method returns null if there is no well-formed HTTP range request header or array($start, $end).
The first number is the offset of the first byte in the range. The second number is the offset of the last byte in the range.
If the second offset is null, it should be treated as the offset of the last byte of the entity If the first offset is null, the second offset should be used to retrieve the last x bytes of the entity
return $mixed
Returns an initialized plugin by it's classname.
This function returns null if the plugin was not found.
Returns a list of properties for a path
This is a simplified version getPropertiesForPath. if you aren't interested in status codes, but you just want to have a flat list of properties. Use this method.
Returns a list of properties for a given path
The path that should be supplied should have the baseUrl stripped out The list of properties should be supplied in Clark notation. If the list is empty 'allprops' is assumed.
If a depth of 1 is requested child elements will also be returned.
Gets the uri for the request, keeping the base uri into consideration
This method attempts to detect the base uri.
Only the PATH_INFO variable is considered.
If this variable is not set, the root (/) is assumed.
WebDAV HTTP COPY method
This method copies one uri to a different uri, and works much like the MOVE request A lot of the actual request processing is done in getCopyMoveInfo
HTTP Delete
The HTTP delete method, deletes a given uri
HTTP GET
This method simply fetches the contents of a uri, like normal
HTTP HEAD
This method is normally used to take a peak at a url, and only get the HTTP response headers, without the body This is used by clients to determine if a remote file was changed, so they can use a local cached version, instead of downloading it again
WebDAV MKCOL
The MKCOL method is used to create a new collection (directory) on the server
WebDAV HTTP MOVE method
This method moves one uri to a different uri. A lot of the actual request processing is done in getCopyMoveInfo
HTTP OPTIONS
WebDAV PROPFIND
This WebDAV method requests information about an uri resource, or a list of resources If a client wants to receive the properties for a single resource it will add an HTTP Depth: header with a 0 value If the value is 1, it means that it also expects a list of sub-resources (e.g.: files in a directory)
The request body contains an XML data structure that has a list of properties the client understands The response body is also an xml document, containing information about every uri resource and the requested properties
It has to return a HTTP 207 Multi-status status code
WebDAV PROPPATCH
This method is called to update properties on a Node. The request is an XML body with all the mutations. In this XML body it is specified which properties should be set/updated and/or deleted
HTTP PUT method
This HTTP method updates a file, or creates a new one.
If a new resource was created, a 201 Created status code should be returned. If an existing resource is updated, it's a 200 Ok
HTTP REPORT method implementation
Although the REPORT method is not part of the standard WebDAV spec (it's from rfc3253) It's used in a lot of extensions, so it made sense to implement it into the core.
Handles a http request, and execute a method based on its name
This method parses the PROPFIND request and returns its information
This will either be a list of properties, or an empty array; in which case an {DAV:}allprop was requested.
This method parses a PropPatch request
PropPatch changes the properties for a resource. This method returns a list of properties.
The keys in the returned array contain the property name (e.g.: {DAV:}displayname, and the value contains the property value. If a property is to be removed the value will be null.
Sets the base server uri
Subscribe to an event.
When the event is triggered, we'll call all the specified callbacks. It is possible to control the order of the callbacks through the priority argument.
This is for example used to make sure that the authentication plugin is triggered before anything else. If it's not needed to change this number, it is recommended to ommit.
This method updates a resource's properties
The properties array must be a list of properties. Array-keys are property names in clarknotation, array-values are it's values. If a property must be deleted, the value should be null.
Note that this request should either completely succeed, or completely fail.
The response is an array with statuscodes for keys, which in turn contain arrays with propertynames. This response can be used to generate a multistatus body.
DEPTH_INFINITY
= -1
(line 17)
Inifinity is used for some request supporting the HTTP Depth header and indicates that the operation should traverse the entire tree
NODE_DIRECTORY
= 2
(line 27)
Nodes that are directories, should use this value as the type property
NODE_FILE
= 1
(line 22)
Nodes that are files, should have this as the type property
NS_SABREDAV
= 'http://sabredav.org/ns'
(line 35)
XML namespace for all SabreDAV related elements
PROP_REMOVE
= 2
(line 30)
PROP_SET
= 1
(line 29)
Documentation generated on Sun, 02 Jan 2011 23:24:14 +0000 by phpDocumentor 1.4.3