Webdav: ezcWebdavSimpleBackend
[ ]
[ Clients ] [ Plugin architecture ]
[ ]
[ ]
[ ]
[ ]
Class: ezcWebdavSimpleBackend
|
Abstract base class for common backend operations. [
source]
Implemented Interfaces
This base backend provides the generic handling of requests and dispatches the required actions to some basic manipulation methods, which you are required to implement, when extending this base class.
This backend does not provide support for extended Webdav features, like compression, or lock handling by the backend, therefore the
getFeatures() method is final. If you want to develop a backend which is capable of manual handling those features directly extend from
ezcWebdavBackend.
Parents
ezcWebdavBackend
|
--ezcWebdavSimpleBackend
Descendents
Inherited Constants
From
ezcWebdavBackend:
Method Summary
|
protected ezcWebdavErrorResponse|null |
checkIfMatchHeaders(
$req, $path )
Checks the If-Match and If-None-Match headers. |
|
public ezcWebdavResponse |
copy(
$request )
Serves COPY requests. |
|
protected abstract void |
createCollection(
$path )
Create a new collection. |
|
protected abstract void |
createResource(
$path, [$content = null] )
Create a new resource. |
|
public ezcWebdavResponse |
delete(
$request )
Serves DELETE requests. |
|
protected ezcWebdavMultistatusResponse |
fetchAllProperties(
$request )
Returns all available properties for a resource. |
|
protected ezcWebdavResponse |
fetchProperties(
$request )
Returns properties, fetched by name. |
|
protected ezcWebdavResponse |
fetchPropertyNames(
$request )
Returns names of all available properties for a resource. |
|
public ezcWebdavResponse |
get(
$request )
Serves GET requests. |
|
public abstract ezcWebdavPropertyStorage |
getAllProperties(
$path )
Returns all properties for a resource. |
|
protected abstract array(ezcWebdavResource|ezcWebdavCollection) |
getCollectionMembers(
$path )
Returns members of collection. |
|
protected void |
getETag(
$path )
Returns the etag representing the current state of $path. |
|
public int |
getFeatures(
)
Returns additional features supported by the backend. |
|
protected array(ezcWebdavResource|ezcWebdavCollection) |
getNodes(
$source, $depth )
Returns all child nodes. |
|
public abstract ezcWebdavProperty |
getProperty(
$path, $propertyName, [$namespace = 'DAV:'] )
Returns a property of a resource. |
|
protected abstract string |
getResourceContents(
$path )
Returns the content of a resource. |
|
public ezcWebdavResponse |
head(
$request )
Serves HEAD requests. |
|
protected abstract bool |
isCollection(
$path )
Returns if resource is a collection. |
|
public ezcWebdavResponse |
makeCollection(
$request )
Serves MKCOL (make collection) requests. |
|
public ezcWebdavResponse |
move(
$request )
Serves MOVE requests. |
|
protected abstract bool |
nodeExists(
$path )
Returns if a resource exists. |
|
public ezcWebdavOptionsResponse |
options(
$request )
Handles the OPTIONS request. |
|
protected abstract array(ezcWebdavErrorResponse) |
performCopy(
$fromPath, $toPath, [$depth = ezcWebdavRequest::DEPTH_INFINITY] )
Copies resources recursively from one path to another. |
|
protected abstract ezcWebdavMultitstatusResponse|null |
performDelete(
$path )
Deletes everything below a path. |
|
public ezcWebdavResponse |
propFind(
$request )
Serves PROPFIND requests. |
|
public ezcWebdavResponse |
propPatch(
$request )
Serves PROPPATCH requests. |
|
public ezcWebdavResponse |
put(
$request )
Serves PUT requests. |
|
public abstract bool |
removeProperty(
$path, $property )
Manually removes a property from a resource. |
|
public abstract bool |
resetProperties(
$path, $properties )
Resets the property storage for a resource. |
|
public abstract bool |
setProperty(
$path, $property )
Manually sets a property on a resource. |
|
protected abstract void |
setResourceContents(
$path, $content )
Changes contents of a resource. |
Inherited Methods
From
ezcWebdavBackend :
Methods
checkIfMatchHeaders
Checks the If-Match and If-None-Match headers.
Checks if the If-Match and If-None-Match headers (potentially) provided by $req are valid for the resource identified by $path.
Returns null if everything is alright, ezcWebdavErrorResponse if any ETag check failed.
Parameters
copy
Serves COPY requests.
Parameters
Redefined in descendants as
createCollection
void createCollection(
string
$path )
Create a new collection.
Creates a new collection at the given $path.
Parameters
| Name |
Type |
Description |
$path |
string |
|
Redefined in descendants as
createResource
void createResource(
string
$path, [string
$content = null] )
Create a new resource.
Creates a new resource at the given $path, optionally with the given $content.
Parameters
| Name |
Type |
Description |
$path |
string |
|
$content |
string |
|
Redefined in descendants as
delete
Serves DELETE requests.
Parameters
Redefined in descendants as
fetchAllProperties
Returns all available properties for a resource.
Fetches all available properties assigned to the reosource referenced in $request and, if the resource is a collection, also returns properties for its children, depending on the depth header of the $request. The instances of
ezcWebdavPropFindResponse generated by this method are encapsulated in a
ezcWebdavMultistatusResponse object.
Parameters
fetchProperties
Returns properties, fetched by name.
Fetch properties as defined by the passed $request for the resource referenced. Properties are fetched by their names.
This method checks also for each of the nodes affected by the request if authorization suceeds.
Parameters
fetchPropertyNames
Returns names of all available properties for a resource.
Fetches the names of all properties assigned to the reosource referenced in $request and, if the resozurce is a collection, also returns property names for its children, depending on the depth header of the $request.
Parameters
get
Serves GET requests.
Parameters
Redefinition of
Redefined in descendants as
getAllProperties
Returns all properties for a resource.
Parameters
| Name |
Type |
Description |
$path |
string |
|
Redefined in descendants as
getCollectionMembers
array(ezcWebdavResource|ezcWebdavCollection) getCollectionMembers(
string
$path )
Returns members of collection.
Returns an array with the members of the collection identified by $path. The returned array can contain
ezcWebdavCollection, and
ezcWebdavResource instances and might also be empty, if the collection has no members.
Parameters
| Name |
Type |
Description |
$path |
string |
|
Redefined in descendants as
getETag
void getETag(
mixed
$path )
Returns the etag representing the current state of $path.
Calculates and returns the ETag for the resource represented by $path. The ETag is calculated from the $path itself and the following properties, which are concatenated and md5 hashed:
- getcontentlength
- getlastmodified
This method can be overwritten in custom backend implementations to access the information needed directly without using the way around properties.
Custom backend implementations are encouraged to use the same mechanism (or this method itself) to determine and generate ETags.
Parameters
| Name |
Type |
Description |
$path |
mixed |
|
Redefined in descendants as
getFeatures
int getFeatures(
)
Returns additional features supported by the backend.
Returns a bitmap of additional features supported by the backend, referenced by constants from the basic
ezcWebdavBackend class.
Redefinition of
getNodes
array(ezcWebdavResource|ezcWebdavCollection) getNodes(
string
$source, int
$depth )
Returns all child nodes.
Get all nodes from the resource identified by $source up to the given depth. Reuses the method
getCollectionMembers(), but you may want to overwrite this implementation by somethings which fits better with your backend.
Parameters
| Name |
Type |
Description |
$source |
string |
|
$depth |
int |
|
getProperty
ezcWebdavProperty getProperty(
string
$path, string
$propertyName, [string
$namespace = 'DAV:'] )
Returns a property of a resource.
Returns the property with the given $propertyName, from the resource identified by $path. You may optionally define a $namespace to receive the property from.
Parameters
| Name |
Type |
Description |
$path |
string |
|
$propertyName |
string |
|
$namespace |
string |
|
Redefined in descendants as
getResourceContents
string getResourceContents(
string
$path )
Returns the content of a resource.
Returns the content of the resource identified by $path.
Parameters
| Name |
Type |
Description |
$path |
string |
|
Redefined in descendants as
head
Serves HEAD requests.
Parameters
Redefinition of
Redefined in descendants as
isCollection
bool isCollection(
string
$path )
Returns if resource is a collection.
Returns if the resource identified by $path is a collection resource (true) or a non-collection one (false).
Parameters
| Name |
Type |
Description |
$path |
string |
|
Redefined in descendants as
makeCollection
Serves MKCOL (make collection) requests.
Parameters
Redefined in descendants as
move
Serves MOVE requests.
Parameters
Redefined in descendants as
nodeExists
bool nodeExists(
string
$path )
Returns if a resource exists.
Returns if a the resource identified by $path exists.
Parameters
| Name |
Type |
Description |
$path |
string |
|
Redefined in descendants as
options
Handles the OPTIONS request.
Applies authorization checking to the OPTIONS request and returns the parent response.
Parameters
Redefinition of
performCopy
array(ezcWebdavErrorResponse) performCopy(
string
$fromPath, string
$toPath, [int
$depth = ezcWebdavRequest::DEPTH_INFINITY] )
Copies resources recursively from one path to another.
Returns an array with
ezcWebdavErrorResponses for all subtrees, where the copy operation failed. Errors for subsequent resources in a subtree should be ommitted.
If an empty array is return, the operation has been completed successfully.
Parameters
| Name |
Type |
Description |
$fromPath |
string |
|
$toPath |
string |
|
$depth |
int |
|
Redefined in descendants as
performDelete
ezcWebdavMultitstatusResponse|null performDelete(
string
$path )
Deletes everything below a path.
Deletes the resource identified by $path recursively. Returns an instance of
ezcWebdavMultistatusResponse if the deletion failed, and null on success.
Parameters
| Name |
Type |
Description |
$path |
string |
|
Redefined in descendants as
propFind
Serves PROPFIND requests.
The
ezcWebdavPropFindRequest object contains a definition to find one or more properties of a given collection or non-collection resource.
Parameters
Redefinition of
Redefined in descendants as
propPatch
Serves PROPPATCH requests.
Parameters
Redefinition of
Redefined in descendants as
put
Serves PUT requests.
Parameters
Redefined in descendants as
removeProperty
Manually removes a property from a resource.
Removes the given $property form the resource identified by $path.
Parameters
Redefined in descendants as
resetProperties
Resets the property storage for a resource.
Discardes the current
ezcWebdavPropertyStorage of the resource identified by $path and replaces it with the given $properties.
Parameters
Redefined in descendants as
setProperty
Manually sets a property on a resource.
Sets the given $propertyBackup for the resource identified by $path.
Parameters
Redefined in descendants as
setResourceContents
void setResourceContents(
string
$path, string
$content )
Changes contents of a resource.
This method is used to change the contents of the resource identified by $path to the given $content.
Parameters
| Name |
Type |
Description |
$path |
string |
|
$content |
string |
|
Redefined in descendants as
Last updated: Tue, 23 Mar 2010