eZPublish  3.9
eZWebDAVServer Class Reference

Virtual base class for implementing WebDAV servers. More...

+ Inheritance diagram for eZWebDAVServer:

Public Member Functions

 appendLogEntry ($logString, $label=false)
 
 copy ($source, $destination)
 
 delete ($target)
 
 eZWebDAVServer ()
 
 flushXMLBody ()
 
 get ($target)
 
 getCollectionContent ($collection, $depth, $properties)
 
 head ($target)
 
 mkcol ($target)
 
 move ($source, $destination)
 
 options ($target)
 
 processClientRequest ()
 
 put ($target, $tempFile)
 
 setServerRoot ($rootDir)
 
 setupXMLOutputCharset ()
 
 setXMLOutputCharset ($charset)
 
 xmlBody ()
 
 XMLOutputCharset ()
 

Static Public Member Functions

 dataCharset ()
 
 isLoggingEnabled ()
 
 recode ($string, $fromCharset, $toCharset, $stop=false)
 
 userAgentPattern ()
 
 userAgentSettings ()
 

Protected Member Functions

 handle ($status)
 
 headers ()
 
 outputCollectionContent ($collection, $requestedProperties)
 
 outputOptions ($options)
 
 outputSendDataToClient ($output, $headers_only=false)
 
 processURL ($url)
 
 storeUploadedFile ($target)
 

Private Attributes

 $ServerRootDir = ""
 
 $XMLBodyRead = false
 
 $XMLOutputCharset = 'utf-8'
 

Detailed Description

Virtual base class for implementing WebDAV servers.

Todo:
Add support for propall and propname

Member Function Documentation

eZWebDAVServer::copy (   $source,
  $destination 
)

Copies the element $source to destination $destination

Returns
The WebDAV status code

Referenced by processClientRequest(), and storeUploadedFile().

eZWebDAVServer::dataCharset ( )
static
Returns
charset of data. It's used as charset for outputted xml if other charset is not specified in 'userAgentSettings'.

Referenced by outputCollectionContent(), and setupXMLOutputCharset().

eZWebDAVServer::delete (   $target)

Removes the element $target.

Returns
The WebDAV status code
eZWebDAVServer::eZWebDAVServer ( )

Constructor of eZWebDAVServer; disables PHP error messages.

Referenced by eZWebDAVContentServer\eZWebDAVContentServer(), and eZWebDAVFileServer\eZWebDAVFileServer().

eZWebDAVServer::flushXMLBody ( )
Returns
The XML body text for the current request.

Referenced by processClientRequest().

eZWebDAVServer::get (   $target)

Fetches the data for the element $target

Returns
The contents of a given element, e.g. contents of a file.
eZWebDAVServer::getCollectionContent (   $collection,
  $depth,
  $properties 
)
Returns
An array with elements that belongs to the collection $collection
Parameters
$depthThe current depth, 0 for only current object, 1 for it's children
$propertiesWhich properties the client asked for, either an array with DAV property names, true for all properties or false for only property names.

Referenced by processClientRequest().

eZWebDAVServer::handle (   $status)
protected

Handles return values and sends necessary/corresponding headers.

Referenced by processClientRequest().

eZWebDAVServer::head (   $target)
Returns
Information on a given element
eZWebDAVServer::headers ( )
protected

This is called before each each request is processed and can be used to output some common headers.

Referenced by processClientRequest().

eZWebDAVServer::isLoggingEnabled ( )
static
Returns
true if WebDAV logging is enabled.

Referenced by appendLogEntry(), and eZWebDavCheckLogSetting().

eZWebDAVServer::mkcol (   $target)

Create a new collection (folder) named $target.

Returns
The WebDAV status code

Referenced by processClientRequest().

eZWebDAVServer::move (   $source,
  $destination 
)

Moves the element $source to destination $destination

Returns
The WebDAV status code

Referenced by processClientRequest().

eZWebDAVServer::options (   $target)

Reports WebDAV options which information on what the server supports.

Returns
An associative array with options, can contain:
  • methods - An array with methods it can handle, if not supplied it will use all possible methods.
  • versions - An array with versions this server supports, if not supplied it will use 1,2,http://apache.org/dav/propset/fs/1.

Referenced by processClientRequest().

eZWebDAVServer::outputCollectionContent (   $collection,
  $requestedProperties 
)
protected

Generates the WebDAV XML from $collection and outputs using print().

Parameters
$collectionAn array with elements (e.g dirs/files). Each element consists of:
  • ctime - The timestamp when the element was created
  • mtime - The timestamp when the element was last modified
  • mimetype - The type of element, use httpd/unix-directory for folder like entries
  • href - URL which points to the element
  • name - The name of the element
  • size - The size of the element in bytes, not needed for folders
Returns
The WebDAV status code

Referenced by processClientRequest().

eZWebDAVServer::outputOptions (   $options)
protected

Generates HTTP headers with information on what the server supports.

Parameters
$optionsAn array with the various options the server supports
  • methods - An array with methods it can handle, if not supplied it will report all possible methods.
  • versions - An array with versions this server supports, if not supplied it will return 1,2,http://apache.org/dav/propset/fs/1.
Returns
The WebDAV status code

Referenced by processClientRequest().

eZWebDAVServer::outputSendDataToClient (   $output,
  $headers_only = false 
)
protected

Outputs the data $output using print().

Parameters
$outputIs an array which can contain:
  • data - String or byte data
  • file - The path to the file, the contents of the file will be output
Returns
The WebDAV status code

Referenced by eZWebDAVContentServer\outputSendDataToClient(), and processClientRequest().

eZWebDAVServer::processClientRequest ( )

Server process function. Dumps a custom header, sets the path and finally checks what the clients wants. Calls the appropriate virtual function (based on the client request).

Referenced by eZWebDAVContentServer\processClientRequest().

eZWebDAVServer::processURL (   $url)
protected

This method will be called on all intercepted URLs and can be reimplemented to clean up the URL for further processing. A typical usage is when the server is running without rewrite rules and will have the .php file in the path.

Returns
The new URL which can safely be passed to the operation methods.

Referenced by processClientRequest().

eZWebDAVServer::put (   $target,
  $tempFile 
)

Tries to create/overwrite an element named $target with contents taken from $tempFile.

Returns
The WebDAV status code

Referenced by processClientRequest().

eZWebDAVServer::recode (   $string,
  $fromCharset,
  $toCharset,
  $stop = false 
)
static
Returns
recoded $string form $fromCharset to $toCharset

Referenced by outputCollectionContent().

eZWebDAVServer::setServerRoot (   $rootDir)
eZWebDAVServer::setupXMLOutputCharset ( )

Sets charset for outputted xml by 'userAgent'

Referenced by eZWebDAVServer().

eZWebDAVServer::setXMLOutputCharset (   $charset)

Sets charset for outputted xml.

Referenced by setupXMLOutputCharset().

eZWebDAVServer::storeUploadedFile (   $target)
protected

Will try to store the uploaded to a temporary location using $target for name.

Returns
The name of the temp file or false if it failed.

Referenced by processClientRequest().

eZWebDAVServer::userAgentPattern ( )
static
Returns
pattern for 'preg_match'. The pattern is built from 'userAgentSettings'.

Referenced by setupXMLOutputCharset().

eZWebDAVServer::userAgentSettings ( )
static
Returns
a list of different settings for known user-agents.

Referenced by setupXMLOutputCharset(), and userAgentPattern().

eZWebDAVServer::xmlBody ( )
Returns
The XML body text for the current request.

Referenced by processClientRequest().

eZWebDAVServer::XMLOutputCharset ( )
Returns
charset for outputted xml

Referenced by outputCollectionContent(), and setXMLOutputCharset().

Member Data Documentation

eZWebDAVServer::$ServerRootDir = ""
private
eZWebDAVServer::$XMLBodyRead = false
private
eZWebDAVServer::$XMLOutputCharset = 'utf-8'
private

Referenced by XMLOutputCharset().


The documentation for this class was generated from the following file: