eZ Publish  [4.2]
eZWebDAVServer Class Reference

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

+ Inheritance diagram for eZWebDAVServer:

List of all members.

Public Member Functions

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

Static Public Member Functions

static appendLogEntry ($logString, $label=false)
 dataCharset ()
static isLoggingEnabled ()
 recode ($string, $fromCharset, $toCharset, $stop=false)
static rootDirectory ()
static tempDirectory ()
 userAgentPattern ()
 userAgentSettings ()

Public Attributes

 $ServerRootDir = ""
 $XMLBodyRead = false
 $XMLOutputCharset = 'utf-8'
const CTIME_FORMAT = "Y-m-d\\TH:i:s\\Z"
const FAILED_BAD_GATEWAY = 36
const FAILED_CONFLICT = 33
const FAILED_EXISTS = 32
const FAILED_FORBIDDEN = 30
const FAILED_LOCKED = 35
const FAILED_NOT_FOUND = 31
const FAILED_PRECONDITION = 34
const FAILED_STORAGE_FULL = 37
const FAILED_UNSUPPORTED = 38
const MTIME_FORMAT = "D, d M Y H:i:s"
const OK = 10
const OK_CREATED = 12
const OK_OVERWRITE = 13
const OK_SILENT = 11
const TEMP_FILE_PREFIX = "eZWebDAVUpload_"

Protected Member Functions

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

Detailed Description

Virtual base class for implementing WebDAV servers.

Todo:
Add support for propall and propname

Definition at line 74 of file ezwebdavserver.php.


Member Function Documentation

eZWebDAVServer::copy ( source,
destination 
)

Copies the element $source to destination $destination

Returns:
The WebDAV status code

Reimplemented in eZWebDAVFileServer.

Definition at line 779 of file ezwebdavserver.php.

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'.

Definition at line 997 of file ezwebdavserver.php.

Referenced by outputCollectionContent(), and setupXMLOutputCharset().

eZWebDAVServer::delete ( target)

Removes the element $target.

Returns:
The WebDAV status code

Reimplemented in eZWebDAVContentServer, and eZWebDAVFileServer.

Definition at line 797 of file ezwebdavserver.php.

eZWebDAVServer::eZWebDAVServer ( )

Constructor of eZWebDAVServer; disables PHP error messages.

Definition at line 104 of file ezwebdavserver.php.

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

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

Definition at line 686 of file ezwebdavserver.php.

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.

Reimplemented in eZWebDAVFileServer, and eZWebDAVContentServer.

Definition at line 752 of file ezwebdavserver.php.

eZWebDAVServer::getCollectionContent ( collection,
depth = false,
properties = false 
)
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.

Reimplemented in eZWebDAVFileServer, and eZWebDAVContentServer.

Definition at line 735 of file ezwebdavserver.php.

Referenced by processClientRequest().

eZWebDAVServer::handle ( status) [protected]

Handles return values and sends necessary/corresponding headers.

Definition at line 805 of file ezwebdavserver.php.

Referenced by processClientRequest().

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

Reimplemented in eZWebDAVContentServer, and eZWebDAVFileServer.

Definition at line 743 of file ezwebdavserver.php.

eZWebDAVServer::headers ( ) [protected]

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

Reimplemented in eZWebDAVContentServer.

Definition at line 711 of file ezwebdavserver.php.

Referenced by processClientRequest().

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

Definition at line 937 of file ezwebdavserver.php.

Referenced by appendLogEntry(), and eZWebDavCheckLogSetting().

eZWebDAVServer::mkcol ( target)

Create a new collection (folder) named $target.

Returns:
The WebDAV status code

Reimplemented in eZWebDAVContentServer, and eZWebDAVFileServer.

Definition at line 770 of file ezwebdavserver.php.

Referenced by processClientRequest().

eZWebDAVServer::move ( source,
destination 
)

Moves the element $source to destination $destination

Returns:
The WebDAV status code

Reimplemented in eZWebDAVContentServer, and eZWebDAVFileServer.

Definition at line 788 of file ezwebdavserver.php.

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>.

Reimplemented in eZWebDAVContentServer.

Definition at line 724 of file ezwebdavserver.php.

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

Definition at line 367 of file ezwebdavserver.php.

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

Definition at line 334 of file ezwebdavserver.php.

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

Reimplemented in eZWebDAVContentServer.

Definition at line 553 of file ezwebdavserver.php.

Referenced by 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).

Reimplemented in eZWebDAVContentServer.

Definition at line 128 of file ezwebdavserver.php.

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.

Reimplemented in eZWebDAVContentServer.

Definition at line 701 of file ezwebdavserver.php.

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

Reimplemented in eZWebDAVContentServer, and eZWebDAVFileServer.

Definition at line 761 of file ezwebdavserver.php.

Referenced by processClientRequest().

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

Definition at line 1041 of file ezwebdavserver.php.

Referenced by outputCollectionContent().

static eZWebDAVServer::rootDirectory ( ) [static]

Definition at line 1072 of file ezwebdavserver.php.

eZWebDAVServer::setServerRoot ( rootDir)

Definition at line 109 of file ezwebdavserver.php.

eZWebDAVServer::setupXMLOutputCharset ( )

Sets charset for outputted xml by 'userAgent'

Definition at line 951 of file ezwebdavserver.php.

Referenced by eZWebDAVServer().

eZWebDAVServer::setXMLOutputCharset ( charset)

Sets charset for outputted xml.

Definition at line 972 of file ezwebdavserver.php.

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.

Definition at line 648 of file ezwebdavserver.php.

Referenced by processClientRequest().

static eZWebDAVServer::tempDirectory ( ) [static]
Returns:
the path to the WebDAV temporary directory

If the directory does not exist yet, it will be created first.

Definition at line 1056 of file ezwebdavserver.php.

Referenced by storeUploadedFile().

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

Definition at line 1008 of file ezwebdavserver.php.

Referenced by setupXMLOutputCharset().

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

Definition at line 1030 of file ezwebdavserver.php.

Referenced by setupXMLOutputCharset(), and userAgentPattern().

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

Definition at line 675 of file ezwebdavserver.php.

Referenced by processClientRequest().

eZWebDAVServer::XMLOutputCharset ( )
Returns:
charset for outputted xml

Definition at line 987 of file ezwebdavserver.php.

Referenced by outputCollectionContent(), and setXMLOutputCharset().


Member Data Documentation

eZWebDAVServer::$ServerRootDir = ""

Definition at line 1083 of file ezwebdavserver.php.

eZWebDAVServer::$XMLBodyRead = false

Definition at line 1084 of file ezwebdavserver.php.

eZWebDAVServer::$XMLOutputCharset = 'utf-8'

Definition at line 1085 of file ezwebdavserver.php.

const eZWebDAVServer::CTIME_FORMAT = "Y-m-d\\TH:i:s\\Z"

Definition at line 95 of file ezwebdavserver.php.

Referenced by outputCollectionContent().

Definition at line 89 of file ezwebdavserver.php.

Referenced by handle().

Definition at line 88 of file ezwebdavserver.php.

Referenced by handle().

Definition at line 87 of file ezwebdavserver.php.

Referenced by handle().

Definition at line 90 of file ezwebdavserver.php.

Referenced by handle().

const eZWebDAVServer::MTIME_FORMAT = "D, d M Y H:i:s"

Definition at line 96 of file ezwebdavserver.php.

Referenced by outputCollectionContent().

Definition at line 80 of file ezwebdavserver.php.

Referenced by handle().

const eZWebDAVServer::TEMP_FILE_PREFIX = "eZWebDAVUpload_"

Definition at line 99 of file ezwebdavserver.php.


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