Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
eZWebDAVContentBackend Class Reference

Provides access to Exponential kernel using WebDAV. Based on the eZ Components Webdav component. More...

Inheritance diagram for eZWebDAVContentBackend:

## Public Member Functions
| __construct ()
| lock ( $waitTime, $timeout)
| unlock ()
| getProperty ( $path, $propertyName, $namespace='DAV:')
| getAllProperties ( $path)
| get (ezcWebdavGetRequest $request)
| head (ezcWebdavHeadRequest $request)
| propFind (ezcWebdavPropFindRequest $request)
| propPatch (ezcWebdavPropPatchRequest $request)
| setProperty ( $path, ezcWebdavProperty $property)
| removeProperty ( $path, ezcWebdavProperty $property)
| resetProperties ( $path, ezcWebdavPropertyStorage $storage)
| put (ezcWebdavPutRequest $request)
| delete (ezcWebdavDeleteRequest $request)
| checkDeleteRecursive ( $target)
| copy (ezcWebdavCopyRequest $request)
| copyRecursive ( $source, $destination, $depth=ezcWebdavRequest::DEPTH_INFINITY)
| moveRecursive ( $source, $destination, $depth=ezcWebdavRequest::DEPTH_INFINITY)
| move (ezcWebdavMoveRequest $request)
| makeCollection (ezcWebdavMakeCollectionRequest $request)
| options (ezcWebdavOptionsRequest $request)
| setCurrentSite ( $site)
| currentSiteFromPath ( $path)

## Static Public Member Functions
static | appendLogEntry ( $logString, $label=false)
static | virtualContentFolderName ()
static | virtualMediaFolderName ()

## Public Attributes
const | VIRTUAL_CONTENT_FOLDER_NAME = 'Content'
const | VIRTUAL_MEDIA_FOLDER_NAME = 'Media'
const | WEBDAV_INI_FILE = "webdav.ini"
const | DIRECTORY_MIMETYPE = 'httpd/unix-directory'
const | DEFAULT_MIMETYPE = "application/octet-stream"
const | DEFAULT_SIZE = 0

## Protected Member Functions
| acquireLock ( $readOnly=false)
| freeLock ()
| getNodes ( $requestUri, $depth)
| getResourceContents ( $target)
| getCollectionMembers ( $path, $depth=ezcWebdavRequest::DEPTH_INFINITY)
| getNodeInfo ( $requestUri, $source=null)
| getPropertyStorage ( $path)
| nodeExists ( $path)
| isCollection ( $path)
| storeProperties ( $path, ezcWebdavBasicPropertyStorage $storage)
| createResource ( $path, $content=null)
| setResourceContents ( $path, $content)
| performDelete ( $target)
| performCopy ( $source, $destination, $depth=ezcWebdavRequest::DEPTH_INFINITY)
| fetchNodeInfo ( $target, &$node)
| getVirtualFolderData ( $result, $currentSite, $target, $fullPath)
| getContentNodeData ( $result, $currentSite, $virtualFolder, $target, $fullPath)
| getCollectionContent ( $collection, $depth=false, $properties=false)
| fetchContainerNodeInfo ( $fullPath, $site, $nodeName)
| fetchVirtualSiteContent ( $target, $site, $depth, $properties)
| getVirtualFolderCollection ( $currentSite, $collection, $fullPath, $depth, $properties)
| getContentTreeCollection ( $currentSite, $virtualFolder, $collection, $fullPath, $depth, $properties)
| fetchContentList ( $fullPath, &$node, $target, $depth, $properties)
| fetchSiteListContent ( $target, $depth, $properties)
| fetchNodeByTranslation ( $nodePathString)
| fetchParentNodeByTranslation ( $nodePathString)
| createCollection ( $target)
| mkcolVirtualFolder ( $currentSite, $target)
| mkcolContent ( $currentSite, $virtualFolder, $target)
| createFolder ( $parentNode, $target)
| deleteVirtualFolder ( $currentSite, $target)
| deleteContent ( $currentSite, $virtualFolder, $target)
| putVirtualFolderData ( $currentSite, $target, $tempFile)
| putContentData ( $currentSite, $virtualFolder, $target, $tempFile)
| copyVirtualFolder ( $sourceSite, $destinationSite, $source, $destination)
| copyContent ( $sourceSite, $destinationSite, $sourceVFolder, $destinationVFolder, $source, $destination)
| copyObject ( $object, $newParentNode)
| copyObjectSameDirectory ( $object, $newParentNode, $destinationName=null)
| moveVirtualFolder ( $sourceSite, $destinationSite, $source, $destination, $fullSource, $fullDestination)
| moveContent ( $sourceSite, $destinationSite, $sourceVFolder, $destinationVFolder, $source, $destination, $fullSource, $fullDestination)
| isObjectFolder ( $object, $class)
| storeUploadedFile ( $target, $contents)
| fileBasename ( $name)
| internalNodePath ( $virtualFolder, $collection)
| splitFirstPathElement ( $path, &$element)
| splitLastPathElement ( $path, &$element)
| encodeResponse (ezcWebdavResponse $response)

## Static Protected Member Functions
static | tempDirectory ()
static | recode ( $string, $fromCharset, $toCharset, $stop=false)

## Protected Attributes
| $handledLiveProperties
| $FolderClasses = null
| $availableSites = array()
| $cachedNodes = array()
| $cachedProperties = array()

## Static Protected Attributes
static | $useLogging

## Detailed Description

Provides access to Exponential kernel using WebDAV. Based on the eZ Components Webdav component.

WebDAV backend for Exponential, based on eZ Components Webdav component.

Todo:

  Replace direct path manipulation with path factory from ezcWebdav

  Fix appendLogEntry to write in only one log file

  Fix using [0] for content object attributes (could be another index in some classes)

  Add lock/unlock calls in setProperty and removeProperty

  Use PathPrefix, PathPrefixExclude (site.ini) and StartNode (webdav.ini) in all functions where necessary

  Remove all todos.

Definition at line 30 of file ezwebdavcontentbackend.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZWebDAVContentBackend::__construct | ( |  | ) |

Creates a new backend instance.

Definition at line 120 of file ezwebdavcontentbackend.php.

References $ini.

## Member Function Documentation

## ◆ acquireLock()

eZWebDAVContentBackend::acquireLock | ( |  | $readOnly = `false` | ) |
| protected

Wait and get lock for complete directory tree.

Acquire lock for the complete tree for read or write operations. This does not implement any priorities for operations, or check if several read operation may run in parallel. The plain locking should / could be extended by something more sophisticated.

If the tree already has been locked, the method waits until the lock can be acquired.

The optional second parameter $readOnly indicates wheather a read only lock should be acquired. This may be used by extended implementations, but it is not used in this implementation.

Parameters

  bool | $readOnly |

Definition at line 181 of file ezwebdavcontentbackend.php.

Referenced by copy(), delete(), get(), head(), makeCollection(), move(), propFind(), propPatch(), and put().

## ◆ appendLogEntry()

static eZWebDAVContentBackend::appendLogEntry | ( |  | $logString,
|  |  | $label = `false`
| ) |  |
| static

Logs to var/log/webdav.log AND var/<site_name>/log/webdav.log.

From Exponential.

Parameters

  string | $logString | String to record
  string | $label | Label to put in front of $logString

Definition at line 3086 of file ezwebdavcontentbackend.php.

References $fileName, file_exists(), eZDir\mkdir(), and eZSys\varDirectory().

Referenced by eZWebDAVContentBackendAuth\authenticateBasic(), fetchNodeInfo(), getContentNodeData(), moveContent(), setCurrentSite(), and setResourceContents().

## ◆ checkDeleteRecursive()

eZWebDAVContentBackend::checkDeleteRecursive | ( |  | $target | ) |

Returns if everything below a path can be deleted recursively.

Checks files and directories recursively and returns if everything can be deleted. Returns an empty array if no errors occured, and an array with the files which caused errors otherwise.

Parameters

  string | $source |

Returns
  array

Definition at line 930 of file ezwebdavcontentbackend.php.

References splitFirstPathElement().

Referenced by performDelete().

## ◆ copy()

eZWebDAVContentBackend::copy | ( | ezcWebdavCopyRequest | $request | ) |

Serves COPY requests.

The method receives a ezcWebdavCopyRequest objects containing all relevant information obout the clients request and will return an instance of ezcWebdavErrorResponse on error or {} on success. If only some operations failed, this method may return an instance of ezcWebdavMultistatusResponse}. This method acquires the internal lock of the backend, dispatches to ezcWebdavSimpleBackend} to perform the operation and releases the lock afterwards. ezcWebdavCopyRequest $request ezcWebdavResponse

Definition at line 1029 of file ezwebdavcontentbackend.php.

References acquireLock(), and freeLock().

## ◆ copyContent()

eZWebDAVContentBackend::copyContent | ( |  | $sourceSite,
|  |  | $destinationSite,
|  |  | $sourceVFolder,
|  |  | $destinationVFolder,
|  |  | $source,
|  |  | $destination
| ) |  |
| protected

Copies the node specified by the path $source to $destination.

Parameters

  string | $sourceSite | Eg. 'plain_site_user'
  string | $destinationSite | Eg. 'plain_site_user'
  string | $sourceVFolder | Eg. 'Content'
  string | $destinationVFolder | Eg. 'Content'
  string | $source | Eg. 'Folder1/file1.txt'
  string | $destination | Eg. 'Folder2/file1.txt'

Returns
  bool

Definition at line 2550 of file ezwebdavcontentbackend.php.

References copyObject(), copyObjectSameDirectory(), fetchNodeByTranslation(), fetchParentNodeByTranslation(), fileBasename(), internalNodePath(), and splitLastPathElement().

Referenced by copyVirtualFolder().

## ◆ copyObject()

eZWebDAVContentBackend::copyObject | ( |  | $object,
|  |  | $newParentNode
| ) |  |
| protected

Copies the specified object as a child to the node $newParentNode.

Parameters

  eZContentObject | $object |
  eZContentObject | $newParentNode |

Returns
  bool

Definition at line 2630 of file ezwebdavcontentbackend.php.

References $db.

Referenced by copyContent().

## ◆ copyObjectSameDirectory()

eZWebDAVContentBackend::copyObjectSameDirectory | ( |  | $object,
|  |  | $newParentNode,
|  |  | $destinationName = `null`
| ) |  |
| protected

Copies the specified object to the same folder, with optional $destinationName.

Parameters

  eZContentObject | $object |
  eZContentObject | $newParentNode |
  string | $destinationName |

Returns
  bool

Definition at line 2690 of file ezwebdavcontentbackend.php.

References $db.

Referenced by copyContent().

## ◆ copyRecursive()

eZWebDAVContentBackend::copyRecursive | ( |  | $source,
|  |  | $destination,
|  |  | $depth = `ezcWebdavRequest::DEPTH_INFINITY`
| ) |  |

Recursively copy a file or directory.

Recursively copy a file or directory in $source to the given $destination. If a $depth is given, the operation will stop as soon as the given recursion depth is reached. A depth of -1 means no limit, while a depth of 0 means, that only the current file or directory will be copied, without any recursion.

Returns an empty array if no errors occured, and an array with the files which caused errors otherwise.

Parameters

  string | $source |
  string | $destination |
  int | $depth |

Returns
  array

Definition at line 1120 of file ezwebdavcontentbackend.php.

References $sourceSite, copyVirtualFolder(), getCollectionMembers(), isCollection(), and splitFirstPathElement().

Referenced by performCopy().

## ◆ copyVirtualFolder()

eZWebDAVContentBackend::copyVirtualFolder | ( |  | $sourceSite,
|  |  | $destinationSite,
|  |  | $source,
|  |  | $destination
| ) |  |
| protected

Handles copying on the virtual folder level.

It will check if the target is below a content folder in which it calls copyContent().

Parameters

  string | $sourceSite | Eg. 'plain_site_user'
  string | $destinationSite | Eg. 'plain_site_user'
  string | $source | Eg. 'Content/Folder1/file1.txt'
  string | $destination | Eg. 'Content/Folder2/file1.txt'

Returns
  bool

Definition at line 2502 of file ezwebdavcontentbackend.php.

References $sourceSite, copyContent(), and splitFirstPathElement().

Referenced by copyRecursive().

## ◆ createCollection()

eZWebDAVContentBackend::createCollection | ( |  | $target | ) |
| protected

Creates a new collection (folder) at the given path $target.

Parameters

  string | $target | Eg. '/plain_site_user/Content/Folder1'

Returns
  bool

Definition at line 2196 of file ezwebdavcontentbackend.php.

References mkcolVirtualFolder(), and splitFirstPathElement().

## ◆ createFolder()

eZWebDAVContentBackend::createFolder | ( |  | $parentNode,
|  |  | $target
| ) |  |
| protected

Creates a new folder under the given $target path.

Parameters

  eZContentObject | $parentNode |
  string | $target | Eg. 'Folder1'

Returns
  bool

Definition at line 2287 of file ezwebdavcontentbackend.php.

References $db, and $version.

Referenced by mkcolContent().

## ◆ createResource()

eZWebDAVContentBackend::createResource | ( |  | $path,
|  |  | $content = `null`
| ) |  |
| protected

Creates a new resource.

Creates a new resource at the given $path, optionally with the given content. If $content is empty, an empty resource will be created.

Parameters

  string | $path |
  string | $content |

Definition at line 853 of file ezwebdavcontentbackend.php.

## ◆ currentSiteFromPath()

eZWebDAVContentBackend::currentSiteFromPath | ( |  | $path | ) |

Detects a possible/valid site-name in start of a path.

From Exponential.

Parameters

  string | $path | Eg. '/plain_site_user/Content/Folder1/file1.txt'

Returns
  string The name of the site that was detected (eg. 'plain_site_user') or false if not site could be detected

Todo:
  remove or move in another class?

Definition at line 1383 of file ezwebdavcontentbackend.php.

References eZSys\indexDir().

## ◆ delete()

eZWebDAVContentBackend::delete | ( | ezcWebdavDeleteRequest | $request | ) |

Serves DELETE requests.

The method receives a ezcWebdavDeleteRequest objects containing all relevant information obout the clients request and will return an instance of ezcWebdavErrorResponse on error or {} on success. This method acquires the internal lock of the backend, dispatches to ezcWebdavSimpleBackend} to perform the operation and releases the lock afterwards. ezcWebdavDeleteRequest $request ezcWebdavResponse

Definition at line 911 of file ezwebdavcontentbackend.php.

References acquireLock(), and freeLock().

## ◆ deleteContent()

eZWebDAVContentBackend::deleteContent | ( |  | $currentSite,
|  |  | $virtualFolder,
|  |  | $target
| ) |  |
| protected

Handles deletion on the content tree level.

It will try to find the node with the path $target and then try to remove it (ie. move to trash) if the user is allowed.

Parameters

  string | $currentSite | Eg. 'plain_site_user'
  string | $virtualFolder | Eg. 'Content'
  string | $target | Eg. 'Folder1/file1.txt'

Returns
  bool

Definition at line 2367 of file ezwebdavcontentbackend.php.

References fetchNodeByTranslation(), and internalNodePath().

Referenced by deleteVirtualFolder().

## ◆ deleteVirtualFolder()

eZWebDAVContentBackend::deleteVirtualFolder | ( |  | $currentSite,
|  |  | $target
| ) |  |
| protected

Handles deletion on the virtual folder level.

It will check if the target is below a content folder in which it calls deleteContent().

Parameters

  string | $currentSite | Eg. 'plain_site_user'
  string | $target | Eg. 'Content/Folder1/file1.txt'

Returns
  bool

Definition at line 2331 of file ezwebdavcontentbackend.php.

References deleteContent(), and splitFirstPathElement().

Referenced by performDelete().

## ◆ encodeResponse()

eZWebDAVContentBackend::encodeResponse | ( | ezcWebdavResponse | $response | ) |
| protected

Encodes the path stored in $response in order to be displayed properly in WebDAV clients.

Parameters

  ezcWebdavResponse | $response |

Returns
  ezcWebdavResponse

Definition at line 3151 of file ezwebdavcontentbackend.php.

References $response.

## ◆ fetchContainerNodeInfo()

eZWebDAVContentBackend::fetchContainerNodeInfo | ( |  | $fullPath,
|  |  | $site,
|  |  | $nodeName
| ) |  |
| protected

Same as fetchVirtualSiteContent(), but only one entry is returned (Content or Media).

An entry in the the returned array is of this form: `array( 'name' => node name (eg. 'Group picture'), 'size' => storage size of the_node in bytes (eg. 57123), 'mimetype' => mime type of the node (eg. 'image/jpeg'), 'ctime' => creation time as timestamp, 'mtime' => latest modification time as timestamp, 'href' => the path to the node (eg. '/plain_site_user/Content/Folder1/file1.jpg')`

Parameters

  string | $fullPath | Eg. '/plain_site_user/Content/Folder1'
  string | $site | Eg. 'plain_site_user'
  string | $nodeName | Eg. 'Folder1'

Returns
  array(array(string=>mixed))

Definition at line 1742 of file ezwebdavcontentbackend.php.

References DIRECTORY_MIMETYPE.

Referenced by getNodeInfo().

## ◆ fetchContentList()

eZWebDAVContentBackend::fetchContentList | ( |  | $fullPath,
|  | & | $node,
|  |  | $target,
|  |  | $depth,
|  |  | $properties
| ) |  |
| protected

Gets and returns the content of an actual node.

List of other nodes belonging to the target node (one level below it) will be returned as well.

An entry in the the returned array is of this form: `array( 'name' => node name (eg. 'Content'), 'size' => storage size of the_node in bytes (eg. 4096 for collections), 'mimetype' => mime type of the node (eg. 'httpd/unix-directory'), 'ctime' => creation time as timestamp, 'mtime' => latest modification time as timestamp, 'href' => the path to the node (eg. '/plain_site_user/Content/')`

Parameters

  string | $fullPath | Eg. '/plain_site_user/Content/'
  eZContentObject | &$node | The note corresponding to $fullPath
  string | $target | Eg. 'Content'
  string | $depth | One of -1 (infinite), 0, 1
  | array(string) | $properties Currently not used

Returns
  array(array(string=>mixed))

Definition at line 1969 of file ezwebdavcontentbackend.php.

References fetchNodeInfo().

Referenced by getContentTreeCollection().

## ◆ fetchNodeByTranslation()

eZWebDAVContentBackend::fetchNodeByTranslation | ( |  | $nodePathString | ) |
| protected

Attempts to fetch a possible node by translating the provided string/path to a node-number.

Parameters

  string | $nodePathString | Eg. 'Folder1/file1.txt'

Returns
  eZContentObject Eg. the node of 'Folder1/file1.txt'

Definition at line 2085 of file ezwebdavcontentbackend.php.

References $ini, and fileBasename().

Referenced by copyContent(), deleteContent(), getContentNodeData(), getContentTreeCollection(), mkcolContent(), moveContent(), and putContentData().

## ◆ fetchNodeInfo()

eZWebDAVContentBackend::fetchNodeInfo | ( |  | $target,
|  | & | $node
| ) |  |
| protected

Gathers information about a given node specified as parameter.

The format of the returned array is: `array( 'name' => node name (eg. 'Group picture'), 'size' => storage size of the_node in bytes (eg. 57123), 'mimetype' => mime type of the node (eg. 'image/jpeg'), 'ctime' => creation time as timestamp, 'mtime' => latest modification time as timestamp, 'href' => the path to the node (eg. '/plain_site_user/Content/Folder1/file1.jpg')`

Parameters

  string | $target | Eg. '/plain_site_user/Content/Folder1/file1.jpg
  eZContentObject | &$node | The node corresponding to $target

Returns
  array(string=>mixed)

Todo:

  remove/replace .ini calls, eZContentUpload, eZMimeType, eZSys RequestURI

  handle articles as files

Definition at line 1424 of file ezwebdavcontentbackend.php.

References $file, $filePath, $name, $suffix, appendLogEntry(), DIRECTORY_MIMETYPE, eZClusterFileHandler\instance(), isObjectFolder(), and eZFile\suffix().

Referenced by fetchContentList(), and getContentNodeData().

## ◆ fetchParentNodeByTranslation()

eZWebDAVContentBackend::fetchParentNodeByTranslation | ( |  | $nodePathString | ) |
| protected

Attempts to fetch a possible node by translating the provided string/path to a node-number.

The last section of the path is removed before the actual translation: hence, the PARENT node is returned.

Parameters

  string | $nodePathString | Eg. 'Folder1/file1.txt'

Returns
  eZContentObject Eg. the node of 'Folder1'

Definition at line 2137 of file ezwebdavcontentbackend.php.

References $element, $ini, fileBasename(), and splitLastPathElement().

Referenced by copyContent(), mkcolContent(), moveContent(), and putContentData().

## ◆ fetchSiteListContent()

eZWebDAVContentBackend::fetchSiteListContent | ( |  | $target,
|  |  | $depth,
|  |  | $properties
| ) |  |
| protected

Builds a content-list of available sites and returns it.

An entry in the the returned array is of this form: `array( 'name' => node name (eg. 'plain_site_user'), 'size' => storage size of the_node in bytes (eg. 4096 for collections), 'mimetype' => mime type of the node (eg. 'httpd/unix-directory'), 'ctime' => creation time as timestamp, 'mtime' => latest modification time as timestamp, 'href' => the path to the node (eg. '/plain_site_user/')`

Parameters

  string | $target | Eg. '/'
  string | $depth | One of -1 (infinite), 0, 1
  | array(string) | $properties Currently not used

Returns
  array(array(string=>mixed))

Definition at line 2022 of file ezwebdavcontentbackend.php.

References DIRECTORY_MIMETYPE.

Referenced by getCollectionContent(), getCollectionMembers(), and getNodeInfo().

## ◆ fetchVirtualSiteContent()

eZWebDAVContentBackend::fetchVirtualSiteContent | ( |  | $target,
|  |  | $site,
|  |  | $depth,
|  |  | $properties
| ) |  |
| protected

Builds and returns the content of the virtual start folder for a site.

The virtual startfolder is an intermediate step between the site-list and actual content. This directory contains the "content" folder which leads to the site's actual content.

An entry in the the returned array is of this form: `array( 'name' => node name (eg. 'Group picture'), 'size' => storage size of the_node in bytes (eg. 57123), 'mimetype' => mime type of the node (eg. 'image/jpeg'), 'ctime' => creation time as timestamp, 'mtime' => latest modification time as timestamp, 'href' => the path to the node (eg. '/plain_site_user/Content/Folder1/file1.jpg')`

Parameters

  string | $target | Eg. '/plain_site_user/Content/Folder1'
  string | $site | Eg. 'plain_site_user
  string | $depth | One of -1 (infinite), 0, 1
  | array(string) | $properties Currently not used

Returns
  array(array(string=>mixed))

Definition at line 1780 of file ezwebdavcontentbackend.php.

References $name, and DIRECTORY_MIMETYPE.

Referenced by getNodeInfo(), and getVirtualFolderCollection().

## ◆ fileBasename()

eZWebDAVContentBackend::fileBasename | ( |  | $name | ) |
| protected

Returns $name without the final suffix (.jpg, .gif etc.).

Parameters

  string | $name |

Returns
  string

Todo:
  remove or replace

Definition at line 2964 of file ezwebdavcontentbackend.php.

References $name.

Referenced by copyContent(), fetchNodeByTranslation(), fetchParentNodeByTranslation(), and moveContent().

## ◆ freeLock()

eZWebDAVContentBackend::freeLock | ( |  | ) |
| protected

Free lock.

Frees the lock after the operation has been finished.

Definition at line 191 of file ezwebdavcontentbackend.php.

Referenced by copy(), delete(), get(), head(), makeCollection(), move(), propFind(), propPatch(), and put().

## ◆ get()

eZWebDAVContentBackend::get | ( | ezcWebdavGetRequest | $request | ) |

Serves GET requests.

The method receives a ezcWebdavGetRequest object containing all relevant information obout the clients request and will return an {} instance on error or an instance of { ezcWebdavGetResourceResponse} or ezcWebdavGetCollectionResponse} on success, depending on the type of resource that is referenced by the request. This method acquires the internal lock of the backend, dispatches to ezcWebdavSimpleBackend} to perform the operation and releases the lock afterwards. ezcWebdavGetRequest $request ezcWebdavResponse

Definition at line 610 of file ezwebdavcontentbackend.php.

References acquireLock(), and freeLock().

## ◆ getAllProperties()

eZWebDAVContentBackend::getAllProperties | ( |  | $path | ) |

Returns all properties for a resource.

Returns all properties for the resource identified by $path as a {}. string $path ezcWebdavPropertyStorage

Definition at line 524 of file ezwebdavcontentbackend.php.

References getProperty(), and getPropertyStorage().

Referenced by getCollectionMembers(), and getNodes().

## ◆ getCollectionContent()

eZWebDAVContentBackend::getCollectionContent | ( |  | $collection,
|  |  | $depth = `false`,
|  |  | $properties = `false`
| ) |  |
| protected

Produces the collection content.

Builds either the virtual start folder with the virtual content folder in it (and additional files). OR: if we're browsing within the content folder: it gets the content of the target/given folder.

Parameters

  string | $collection | Eg. '/plain_site_user/Content/Folder1'
  int | $depth | One of -1 (infinite), 0, 1
  | array(string) | $properties Currently not used

Returns
  array(string=>array())

Definition at line 1708 of file ezwebdavcontentbackend.php.

References fetchSiteListContent(), getVirtualFolderCollection(), and splitFirstPathElement().

Referenced by getNodeInfo().

## ◆ getCollectionMembers()

eZWebDAVContentBackend::getCollectionMembers | ( |  | $path,
|  |  | $depth = `ezcWebdavRequest::DEPTH_INFINITY`
| ) |  |
| protected

Returns members of collection.

Returns an array with the members of the collection identified by $path. The returned array can contain ezcWebdavCollection, and {} instances and might also be empty, if the collection has no members. Added $depth. string $path int $depth Added by array(ezcWebdavResource|ezcWebdavCollection)

Definition at line 303 of file ezwebdavcontentbackend.php.

References $contents, $handledLiveProperties, fetchSiteListContent(), getAllProperties(), getVirtualFolderCollection(), and splitFirstPathElement().

Referenced by copyRecursive(), getNodes(), and moveRecursive().

## ◆ getContentNodeData()

eZWebDAVContentBackend::getContentNodeData | ( |  | $result,
|  |  | $currentSite,
|  |  | $virtualFolder,
|  |  | $target,
|  |  | $fullPath
| ) |  |
| protected

Handles data retrival on the content tree level.

The format of the returned array is the same as $result: `array( 'isFile' => bool, 'isCollection' => bool, 'file' => path to the storage file which contain the contents );`

Parameters

  | array(string=>mixed) | $result
  string | $currentSite | Eg. 'plain_site_user'
  string | $virtualFolder | Eg. 'Content'
  string | $target | Eg. 'Folder1/file1.txt'
  string | $fullPath | Eg. '/plain_site_user/Content/Folder1/file1.txt'

Returns
  array(string=>mixed) Or false if an error appeared

Todo:
  remove/replace eZContentUpload

Definition at line 1650 of file ezwebdavcontentbackend.php.

References $result, appendLogEntry(), fetchNodeByTranslation(), fetchNodeInfo(), internalNodePath(), and isObjectFolder().

Referenced by getVirtualFolderData().

## ◆ getContentTreeCollection()

eZWebDAVContentBackend::getContentTreeCollection | ( |  | $currentSite,
|  |  | $virtualFolder,
|  |  | $collection,
|  |  | $fullPath,
|  |  | $depth,
|  |  | $properties
| ) |  |
| protected

Handles collections on the content tree level.

Depending on the virtual folder we will generate a node path url and fetch the nodes for that path.

An entry in the the returned array is of this form: `array( 'name' => node name (eg. 'Folder1'), 'size' => storage size of the_node in bytes (eg. 4096 for collections), 'mimetype' => mime type of the node (eg. 'httpd/unix-directory'), 'ctime' => creation time as timestamp, 'mtime' => latest modification time as timestamp, 'href' => the path to the node (eg. '/plain_site_user/Content/Folder1/')`

Parameters

  string | $site | Eg. 'plain_site_user
  string | $virtualFolder | Eg. 'Content'
  string | $collection | Eg. 'Folder1'
  string | $fullPath | Eg. '/plain_site_user/Content/Folder1/'
  string | $depth | One of -1 (infinite), 0, 1
  | array(string) | $properties Currently not used

Returns
  array(array(string=>mixed))

Definition at line 1926 of file ezwebdavcontentbackend.php.

References fetchContentList(), fetchNodeByTranslation(), and internalNodePath().

Referenced by getVirtualFolderCollection().

## ◆ getNodeInfo()

eZWebDAVContentBackend::getNodeInfo | ( |  | $requestUri,
|  |  | $source = `null`
| ) |  |
| protected

Returns an array with information about the node with path $path.

The returned array is of this form: `array( 'nodeExists' => boolean, 'isCollection' => boolean )`

Parameters

  string | $path |

Returns
  array(string=>boolean)

Definition at line 359 of file ezwebdavcontentbackend.php.

References DIRECTORY_MIMETYPE, fetchContainerNodeInfo(), fetchSiteListContent(), fetchVirtualSiteContent(), getCollectionContent(), and splitFirstPathElement().

Referenced by getNodes(), getProperty(), isCollection(), and nodeExists().

## ◆ getNodes()

eZWebDAVContentBackend::getNodes | ( |  | $requestUri,
|  |  | $depth
| ) |  |
| protected

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

  string | $source |
  int | $depth |

Returns
  array(ezcWebdavResource|ezcWebdavCollection)

Definition at line 208 of file ezwebdavcontentbackend.php.

References $i, getAllProperties(), getCollectionMembers(), and getNodeInfo().

## ◆ getProperty()

eZWebDAVContentBackend::getProperty | ( |  | $path,
|  |  | $propertyName,
|  |  | $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

  string | $path |
  string | $propertyName |
  string | $namespace |

Returns
  ezcWebdavProperty

Definition at line 426 of file ezwebdavcontentbackend.php.

References $item, $name, $size, $timestamp, DEFAULT_MIMETYPE, DEFAULT_SIZE, DIRECTORY_MIMETYPE, getNodeInfo(), and getPropertyStorage().

Referenced by getAllProperties().

## ◆ getPropertyStorage()

eZWebDAVContentBackend::getPropertyStorage | ( |  | $path | ) |
| protected

Returns the property storage for a resource.

Returns the ezcWebdavPropertyStorage instance containing the properties for the resource identified by $path.

Parameters

  string | $path |

Returns
  ezcWebdavBasicPropertyStorage

Definition at line 548 of file ezwebdavcontentbackend.php.

Referenced by getAllProperties(), getProperty(), and performCopy().

## ◆ getResourceContents()

eZWebDAVContentBackend::getResourceContents | ( |  | $target | ) |
| protected

Returns the contents of a resource.

This method returns the content of the resource identified by $path as a string.

Parameters

  string | $target |

Returns
  string

Definition at line 272 of file ezwebdavcontentbackend.php.

References $file, $result, getVirtualFolderData(), eZClusterFileHandler\instance(), and splitFirstPathElement().

## ◆ getVirtualFolderCollection()

eZWebDAVContentBackend::getVirtualFolderCollection | ( |  | $currentSite,
|  |  | $collection,
|  |  | $fullPath,
|  |  | $depth,
|  |  | $properties
| ) |  |
| protected

Handles collections on the virtual folder level, if no virtual folder elements are accessed it lists the virtual folders.

An entry in the the returned array is of this form: `array( 'name' => node name (eg. 'Group picture'), 'size' => storage size of the_node in bytes (eg. 57123), 'mimetype' => mime type of the node (eg. 'image/jpeg'), 'ctime' => creation time as timestamp, 'mtime' => latest modification time as timestamp, 'href' => the path to the node (eg. '/plain_site_user/Content/Folder1/file1.jpg')`

Parameters

  string | $site | Eg. 'plain_site_user
  string | $collection | Eg. 'Folder1'
  string | $fullPath | Eg. '/plain_site_user/Content/Folder1'
  string | $depth | One of -1 (infinite), 0, 1
  | array(string) | $properties Currently not used

Returns
  array(array(string=>mixed))

Definition at line 1849 of file ezwebdavcontentbackend.php.

References $ini, $item, fetchVirtualSiteContent(), getContentTreeCollection(), and splitFirstPathElement().

Referenced by getCollectionContent(), and getCollectionMembers().

## ◆ getVirtualFolderData()

eZWebDAVContentBackend::getVirtualFolderData | ( |  | $result,
|  |  | $currentSite,
|  |  | $target,
|  |  | $fullPath
| ) |  |
| protected

Handles data retrival on the virtual folder level.

The format of the returned array is the same as $result: `array( 'isFile' => bool, 'isCollection' => bool, 'file' => path to the storage file which contain the contents );`

Parameters

  | array(string=>mixed) | $result
  string | $currentSite | Eg. 'plain_site_user'
  string | $target | Eg. 'Content/Folder1/file1.txt'
  string | $fullPath | Eg. '/plain_site_user/Content/Folder1/file1.txt'

Returns
  array(string=>mixed) Or false if an error appeared

Definition at line 1610 of file ezwebdavcontentbackend.php.

References $result, getContentNodeData(), and splitFirstPathElement().

Referenced by getResourceContents().

## ◆ head()

eZWebDAVContentBackend::head | ( | ezcWebdavHeadRequest | $request | ) |

Serves HEAD requests.

The method receives a ezcWebdavHeadRequest object containing all relevant information obout the clients request and will return an {} instance on error or an instance of { ezcWebdavHeadResponse} on success. This method acquires the internal lock of the backend, dispatches to ezcWebdavSimpleBackend} to perform the operation and releases the lock afterwards. ezcWebdavHeadRequest $request ezcWebdavResponse

Definition at line 634 of file ezwebdavcontentbackend.php.

References acquireLock(), and freeLock().

## ◆ internalNodePath()

eZWebDAVContentBackend::internalNodePath | ( |  | $virtualFolder,
|  |  | $collection
| ) |  |
| protected

Returns a path that corresponds to the internal path of nodes.

Parameters

  string | $virtualFolder |
  string | $collection |

Returns
  string

Todo:
  remove or replace

Definition at line 2982 of file ezwebdavcontentbackend.php.

Referenced by copyContent(), deleteContent(), getContentNodeData(), getContentTreeCollection(), mkcolContent(), moveContent(), and putContentData().

## ◆ isCollection()

eZWebDAVContentBackend::isCollection | ( |  | $path | ) |
| protected

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

  string | $path |

Returns
  bool

Definition at line 583 of file ezwebdavcontentbackend.php.

References getNodeInfo().

Referenced by copyRecursive(), and moveRecursive().

## ◆ isObjectFolder()

eZWebDAVContentBackend::isObjectFolder | ( |  | $object,
|  |  | $class
| ) |  |
| protected

Returns whether $class is an folder class.

Parameters

  resource | $object |
  resource | $class |

Definition at line 2901 of file ezwebdavcontentbackend.php.

Referenced by fetchNodeInfo(), and getContentNodeData().

## ◆ lock()

eZWebDAVContentBackend::lock | ( |  | $waitTime,
|  |  | $timeout
| ) |  |

Locks the backend.

Tries to lock the backend. If the lock is already owned by this process, locking is successful. If $timeout is reached before a lock could be acquired, an ezcWebdavLockTimeoutException is thrown. Waits $waitTime microseconds between attempts to lock the backend.

Parameters

  int | $waitTime |
  int | $timeout |

Returns
  void

Definition at line 149 of file ezwebdavcontentbackend.php.

## ◆ makeCollection()

eZWebDAVContentBackend::makeCollection | ( | ezcWebdavMakeCollectionRequest | $request | ) |

Serves MKCOL (make collection) requests.

The method receives a ezcWebdavMakeCollectionRequest objects containing all relevant information obout the clients request and will return an instance of ezcWebdavErrorResponse on error or {} on success. This method acquires the internal lock of the backend, dispatches to ezcWebdavSimpleBackend} to perform the operation and releases the lock afterwards. ezcWebdavMakeCollectionRequest $request ezcWebdavResponse

Definition at line 1288 of file ezwebdavcontentbackend.php.

References acquireLock(), and freeLock().

## ◆ mkcolContent()

eZWebDAVContentBackend::mkcolContent | ( |  | $currentSite,
|  |  | $virtualFolder,
|  |  | $target
| ) |  |
| protected

Handles collection creation on the content tree level.

It will try to find the parent node of the wanted placement and create a new collection (folder etc.) as a child.

Parameters

  string | $currentSite | Eg. 'plain_site_user'
  string | $virtualFolder | Eg. 'Content'
  string | $target | Eg. 'Folder1'

Returns
  bool

Definition at line 2255 of file ezwebdavcontentbackend.php.

References createFolder(), fetchNodeByTranslation(), fetchParentNodeByTranslation(), and internalNodePath().

Referenced by mkcolVirtualFolder().

## ◆ mkcolVirtualFolder()

eZWebDAVContentBackend::mkcolVirtualFolder | ( |  | $currentSite,
|  |  | $target
| ) |  |
| protected

Handles collection creation on the virtual folder level.

It will check if the target is below a content folder in which it calls mkcolContent().

Parameters

  string | $currentSite | Eg. 'plain_site_user'
  string | $target | Eg. 'Content/Folder1'

Returns
  bool

Definition at line 2219 of file ezwebdavcontentbackend.php.

References mkcolContent(), and splitFirstPathElement().

Referenced by createCollection().

## ◆ move()

eZWebDAVContentBackend::move | ( | ezcWebdavMoveRequest | $request | ) |

Serves MOVE requests.

The method receives a ezcWebdavMoveRequest objects containing all relevant information obout the clients request and will return an instance of ezcWebdavErrorResponse on error or {} on success. If only some operations failed, this method may return an instance of ezcWebdavMultistatusResponse}. This method acquires the internal lock of the backend, dispatches to ezcWebdavSimpleBackend} to perform the operation and releases the lock afterwards. ezcWebdavMoveRequest $request ezcWebdavResponse

Definition at line 1264 of file ezwebdavcontentbackend.php.

References acquireLock(), and freeLock().

## ◆ moveContent()

eZWebDAVContentBackend::moveContent | ( |  | $sourceSite,
|  |  | $destinationSite,
|  |  | $sourceVFolder,
|  |  | $destinationVFolder,
|  |  | $source,
|  |  | $destination,
|  |  | $fullSource,
|  |  | $fullDestination
| ) |  |
| protected

Moves the node specified by the path $source to $destination.

Parameters

  string | $sourceSite | Eg. 'plain_site_user'
  string | $destinationSite | Eg. 'plain_site_user'
  string | $sourceVFolder | Eg. 'Content'
  string | $destinationVFolder | Eg. 'Content'
  string | $source | Eg. 'Folder1/file1.txt'
  string | $destination | Eg. 'Folder2/file1.txt'

Returns
  bool

Definition at line 2811 of file ezwebdavcontentbackend.php.

References appendLogEntry(), fetchNodeByTranslation(), fetchParentNodeByTranslation(), fileBasename(), internalNodePath(), and splitLastPathElement().

Referenced by moveVirtualFolder().

## ◆ moveRecursive()

eZWebDAVContentBackend::moveRecursive | ( |  | $source,
|  |  | $destination,
|  |  | $depth = `ezcWebdavRequest::DEPTH_INFINITY`
| ) |  |

Recursively move a file or directory.

Recursively move a file or directory in $source to the given $destination. If a $depth is given, the operation will stop as soon as the given recursion depth is reached. A depth of -1 means no limit, while a depth of 0 means, that only the current file or directory will be copied, without any recursion.

Returns an empty array if no errors occured, and an array with the files which caused errors otherwise.

Parameters

  string | $source |
  string | $destination |
  int | $depth |

Returns
  array

Definition at line 1192 of file ezwebdavcontentbackend.php.

References $sourceSite, getCollectionMembers(), isCollection(), moveVirtualFolder(), and splitFirstPathElement().

Referenced by performCopy().

## ◆ moveVirtualFolder()

eZWebDAVContentBackend::moveVirtualFolder | ( |  | $sourceSite,
|  |  | $destinationSite,
|  |  | $source,
|  |  | $destination,
|  |  | $fullSource,
|  |  | $fullDestination
| ) |  |
| protected

Handles moving on the virtual folder level.

It will check if the target is below a content folder in which it calls moveContent().

Parameters

  string | $sourceSite | Eg. 'plain_site_user'
  string | $destinationSite | Eg. 'plain_site_user'
  string | $source | Eg. 'Content/Folder1/file1.txt'
  string | $destination | Eg. 'Content/Folder2/file1.txt'

Returns
  bool

Definition at line 2769 of file ezwebdavcontentbackend.php.

References $sourceSite, moveContent(), setCurrentSite(), and splitFirstPathElement().

Referenced by moveRecursive().

## ◆ nodeExists()

eZWebDAVContentBackend::nodeExists | ( |  | $path | ) |
| protected

Returns if a resource exists.

Returns if a the resource identified by $path exists.

Parameters

  string | $path |

Returns
  bool

Definition at line 564 of file ezwebdavcontentbackend.php.

References getNodeInfo().

## ◆ options()

eZWebDAVContentBackend::options | ( | ezcWebdavOptionsRequest | $request | ) |

Required method to serve OPTIONS requests.

The method receives a ezcWebdavOptionsRequest object containing all relevant information obout the clients request and should either return an error by returning an ezcWebdavErrorResponse object, or any other ezcWebdavResponse objects.

Parameters

  ezcWebdavOptionsRequest | $request |

Returns
  ezcWebdavResponse

Definition at line 1309 of file ezwebdavcontentbackend.php.

References $response.

## ◆ performCopy()

eZWebDAVContentBackend::performCopy | ( |  | $source,
|  |  | $destination,
|  |  | $depth = `ezcWebdavRequest::DEPTH_INFINITY`
| ) |  |
| protected

Copies resources recursively from one path to another.

Copies the resourced identified by $fromPath recursively to $toPath with the given $depth, where $depth is one of {}, ezcWebdavRequest::DEPTH_ONE}, ezcWebdavRequest::DEPTH_INFINITY}. Returns an array with ezcWebdavErrorResponse}s 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. In case performCopy() was called from a MOVE operation, do a real move operation, because the move() function from ezcWebdavSimpleBackend calls performCopy() and performDelete(). string $fromPath string $toPath int $depth array(ezcWebdavErrorResponse)

Definition at line 1062 of file ezwebdavcontentbackend.php.

References $error, copyRecursive(), getPropertyStorage(), moveRecursive(), and storeProperties().

## ◆ performDelete()

eZWebDAVContentBackend::performDelete | ( |  | $target | ) |
| protected

Deletes everything below a path.

Deletes the resource identified by $path recursively. Returns an instance of ezcWebdavErrorResponse if the deletion failed, and null on success.

In case performDelete() was called from a MOVE operation, it does not delete anything, because the move() function in ezcWebdavSimpleBackend first calls performDelete(), which deletes the destination if the source and destination are the same in URL alias terms.

Parameters

  string | $path |

Returns
  ezcWebdavErrorResponse

Definition at line 977 of file ezwebdavcontentbackend.php.

References $status, checkDeleteRecursive(), deleteVirtualFolder(), and splitFirstPathElement().

## ◆ propFind()

eZWebDAVContentBackend::propFind | ( | ezcWebdavPropFindRequest | $request | ) |

Serves PROPFIND requests.

The method receives a ezcWebdavPropFindRequest object containing all relevant information obout the clients request and will either return an instance of ezcWebdavErrorResponse to indicate an error or a ezcWebdavPropFindResponse on success. If the referenced resource is a collection or if some properties produced errors, an instance of ezcWebdavMultistatusResponse may be returned.

The ezcWebdavPropFindRequest object contains a definition to find one or more properties of a given collection or non-collection resource.

This method acquires the internal lock of the backend, dispatches to ezcWebdavSimpleBackend to perform the operation and releases the lock afterwards.

This method is an overwrite of the propFind method from ezcWebdavSimpleBackend, a hack necessary to permit correct output of Exponential nodes. The array of ezcWebdavPropFindResponse objects returned by ezcWebdavSimpleBackend::propFind is iterated and the paths of the nodes in the ezcWebdavPropFindResponse objects are encoded properly, in order to be displayed correctly in WebDAV clients. The encoding is from the ini setting Charset in [CharacterSettings] in i18n.ini.

Parameters

  ezcWebdavPropFindRequest | $request |

Returns
  ezcWebdavResponse

Definition at line 673 of file ezwebdavcontentbackend.php.

References $ini, $pathArray, $response, acquireLock(), and freeLock().

## ◆ propPatch()

eZWebDAVContentBackend::propPatch | ( | ezcWebdavPropPatchRequest | $request | ) |

Serves PROPPATCH requests.

The method receives a ezcWebdavPropPatchRequest object containing all relevant information obout the clients request and will return an instance of ezcWebdavErrorResponse on error or a ezcWebdavPropPatchResponse response on success. If the referenced resource is a collection or if only some properties produced errors, an instance of ezcWebdavMultistatusResponse may be returned.

This method acquires the internal lock of the backend, dispatches to ezcWebdavSimpleBackend to perform the operation and releases the lock afterwards.

Parameters

  ezcWebdavPropPatchRequest | $request |

Returns
  ezcWebdavResponse

Definition at line 724 of file ezwebdavcontentbackend.php.

References acquireLock(), and freeLock().

## ◆ put()

eZWebDAVContentBackend::put | ( | ezcWebdavPutRequest | $request | ) |

Serves PUT requests.

The method receives a ezcWebdavPutRequest objects containing all relevant information obout the clients request and will return an instance of ezcWebdavErrorResponse on error or {} on success. This method acquires the internal lock of the backend, dispatches to ezcWebdavSimpleBackend} to perform the operation and releases the lock afterwards. ezcWebdavPutRequest $request ezcWebdavResponse

Definition at line 835 of file ezwebdavcontentbackend.php.

References acquireLock(), and freeLock().

## ◆ putContentData()

eZWebDAVContentBackend::putContentData | ( |  | $currentSite,
|  |  | $virtualFolder,
|  |  | $target,
|  |  | $tempFile
| ) |  |
| protected

Handles data storage on the content tree level.

It will try to find the parent node of the wanted placement and create a new object with data from $tempFile.

Parameters

  string | $currentSite | Eg. 'plain_site_user'
  string | $virtualFolder | Eg. 'Content'
  string | $target | Eg. 'Folder1/file1.txt'
  string | $tempFile | The temporary file holding the contents

Returns
  bool

Todo:
  remove/replace eZContentUpload

Definition at line 2452 of file ezwebdavcontentbackend.php.

References $result, fetchNodeByTranslation(), fetchParentNodeByTranslation(), and internalNodePath().

Referenced by putVirtualFolderData().

## ◆ putVirtualFolderData()

eZWebDAVContentBackend::putVirtualFolderData | ( |  | $currentSite,
|  |  | $target,
|  |  | $tempFile
| ) |  |
| protected

Handles data storage on the content tree level.

It will check if the target is below a content folder in which it calls putContentData().

Parameters

  string | $currentSite | Eg. 'plain_site_user'
  string | $target | Eg. 'Content/Folder1/file1.txt'
  string | $tempFile | The temporary file holding the contents

Returns
  bool

Definition at line 2413 of file ezwebdavcontentbackend.php.

References $result, putContentData(), and splitFirstPathElement().

Referenced by setResourceContents().

## ◆ recode()

static eZWebDAVContentBackend::recode | ( |  | $string,
|  |  | $fromCharset,
|  |  | $toCharset,
|  |  | $stop = `false`
| ) |  |
| static protected

Recodes $string from charset $fromCharset to charset $toCharset.

Parameters

  string | $string |
  string | $fromCharset |
  string | $toCharset |
  bool | $stop |

Returns
  string

Definition at line 3133 of file ezwebdavcontentbackend.php.

References eZTextCodec\instance().

## ◆ removeProperty()

eZWebDAVContentBackend::removeProperty | ( |  | $path,
|  | ezcWebdavProperty | $property
| ) |  |

Manually removes a property from a resource.

Removes the given $property form the resource identified by $path.

Parameters

  string | $path |
  ezcWebdavProperty | $property |

Returns
  bool

Definition at line 799 of file ezwebdavcontentbackend.php.

## ◆ resetProperties()

eZWebDAVContentBackend::resetProperties | ( |  | $path,
|  | ezcWebdavPropertyStorage | $storage
| ) |  |

Resets the property storage for a resource.

Discards the current ezcWebdavPropertyStorage of the resource identified by $path and replaces it with the given $properties.

Parameters

  string | $path |
  ezcWebdavPropertyStorage | $storage |

Returns
  bool

Definition at line 815 of file ezwebdavcontentbackend.php.

References storeProperties().

## ◆ setCurrentSite()

eZWebDAVContentBackend::setCurrentSite | ( |  | $site | ) |

Sets the current site.

From Exponential.

Parameters

  string | $site | Eg. 'plain_site_user'

Todo:
  remove or move in another class?

Definition at line 1357 of file ezwebdavcontentbackend.php.

References $access, appendLogEntry(), eZSiteAccess\change(), eZSiteAccess\TYPE_STATIC, and eZDebugSetting\writeDebug().

Referenced by moveVirtualFolder().

## ◆ setProperty()

eZWebDAVContentBackend::setProperty | ( |  | $path,
|  | ezcWebdavProperty | $property
| ) |  |

Manually sets a property on a resource.

Sets the given $propertyBackup for the resource identified by $path.

Parameters

  string | $path |
  ezcWebdavProperty | $property |

Returns
  bool

Definition at line 758 of file ezwebdavcontentbackend.php.

References storeProperties().

## ◆ setResourceContents()

eZWebDAVContentBackend::setResourceContents | ( |  | $path,
|  |  | $content
| ) |  |
| protected

Sets the contents of a resource.

This method replaces the content of the resource identified by $path with the submitted $content.

Parameters

  string | $path |
  string | $content |

Definition at line 867 of file ezwebdavcontentbackend.php.

References $content, $result, appendLogEntry(), eZDir\cleanupEmptyDirectories(), putVirtualFolderData(), splitFirstPathElement(), and storeUploadedFile().

## ◆ splitFirstPathElement()

eZWebDAVContentBackend::splitFirstPathElement | ( |  | $path,
|  | & | $element
| ) |  |
| protected

Takes the first path element from $path and removes it from the path, the extracted part will be placed in $name.

`$path = '/path/to/item/'; $newPath = self::splitFirstPathElement( $path, $root ); print( $root ); // prints 'path', $newPath is now 'to/item/' $newPath = self::splitFirstPathElement( $newPath, $second ); print( $second ); // prints 'to', $newPath is now 'item/' $newPath = self::splitFirstPathElement( $newPath, $third ); print( $third ); // prints 'item', $newPath is now ''`

Parameters

  string | $path | A path of elements delimited by a slash, if the path ends with a slash it will be removed
  string | &$element | The name of the first path element without any slashes

Returns
  string The rest of the path without the ending slash

Todo:
  remove or replace

Definition at line 3019 of file ezwebdavcontentbackend.php.

References $element.

Referenced by checkDeleteRecursive(), copyRecursive(), copyVirtualFolder(), createCollection(), deleteVirtualFolder(), getCollectionContent(), getCollectionMembers(), getNodeInfo(), getResourceContents(), getVirtualFolderCollection(), getVirtualFolderData(), mkcolVirtualFolder(), moveRecursive(), moveVirtualFolder(), performDelete(), putVirtualFolderData(), and setResourceContents().

## ◆ splitLastPathElement()

eZWebDAVContentBackend::splitLastPathElement | ( |  | $path,
|  | & | $element
| ) |  |
| protected

Takes the last path element from $path and removes it from the path, the extracted part will be placed in $name.

`$path = '/path/to/item/'; $newPath = self::splitLastPathElement( $path, $root ); print( $root ); // prints 'item', $newPath is now '/path/to' $newPath = self::splitLastPathElement( $newPath, $second ); print( $second ); // prints 'to', $newPath is now '/path' $newPath = self::splitLastPathElement( $newPath, $third ); print( $third ); // prints 'path', $newPath is now ''`

Parameters

  string | $path | A path of elements delimited by a slash, if the path ends with a slash it will be removed
  string | &$element | The name of the first path element without any slashes

Returns
  string The rest of the path without the ending slash

Todo:
  remove or replace

Definition at line 3057 of file ezwebdavcontentbackend.php.

References $element.

Referenced by copyContent(), fetchParentNodeByTranslation(), and moveContent().

## ◆ storeProperties()

eZWebDAVContentBackend::storeProperties | ( |  | $path,
|  | ezcWebdavBasicPropertyStorage | $storage
| ) |  |
| protected

Stores properties for a resource.

Creates a new property storage file and stores the properties given for the resource identified by $path. This depends on the affected resource and the actual properties in the property storage.

Parameters

  string | $path |
  ezcWebdavBasicPropertyStorage | $storage |

Definition at line 743 of file ezwebdavcontentbackend.php.

Referenced by performCopy(), resetProperties(), and setProperty().

## ◆ storeUploadedFile()

eZWebDAVContentBackend::storeUploadedFile | ( |  | $target,
|  |  | $contents
| ) |  |
| protected

Stores $contents to a temporary location under the file name $target.

Parameters

  string | $target |
  string | $contents |

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

Todo:
  remove or replace with eZ Components functionality

Definition at line 2916 of file ezwebdavcontentbackend.php.

References $contents, $dir, $filePath, $result, file_exists(), eZDir\mkdir(), and tempDirectory().

Referenced by setResourceContents().

## ◆ tempDirectory()

static eZWebDAVContentBackend::tempDirectory | ( |  | ) |
| static protected

Returns the path to the WebDAV temporary directory.

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

Returns
  string

Todo:
  remove or replace with eZ Components functionality

Definition at line 2947 of file ezwebdavcontentbackend.php.

References eZDir\directoryPermission(), file_exists(), eZDir\mkdir(), and eZSys\varDirectory().

Referenced by storeUploadedFile().

## ◆ unlock()

eZWebDAVContentBackend::unlock | ( |  | ) |

Removes the lock.

Returns
  void

Definition at line 159 of file ezwebdavcontentbackend.php.

## ◆ virtualContentFolderName()

static eZWebDAVContentBackend::virtualContentFolderName | ( |  | ) |
| static

The name of the content folder in Exponential, translated.

Returns
  string

Definition at line 3162 of file ezwebdavcontentbackend.php.

## ◆ virtualMediaFolderName()

static eZWebDAVContentBackend::virtualMediaFolderName | ( |  | ) |
| static

The name of the media folder in Exponential, translated.

Returns
  string

Definition at line 3172 of file ezwebdavcontentbackend.php.

## Member Data Documentation

## ◆ $availableSites

eZWebDAVContentBackend::$availableSites = array()
| protected

Definition at line 92 of file ezwebdavcontentbackend.php.

## ◆ $cachedNodes

eZWebDAVContentBackend::$cachedNodes = array()
| protected

Definition at line 99 of file ezwebdavcontentbackend.php.

## ◆ $cachedProperties

eZWebDAVContentBackend::$cachedProperties = array()
| protected

Definition at line 106 of file ezwebdavcontentbackend.php.

## ◆ $FolderClasses

eZWebDAVContentBackend::$FolderClasses = null
| protected

Definition at line 85 of file ezwebdavcontentbackend.php.

## ◆ $handledLiveProperties

eZWebDAVContentBackend::$handledLiveProperties
| protected

Initial value:
= array(
'getcontentlength',
'getlastmodified',
'creationdate',
'displayname',
'getetag',
'getcontenttype',
'resourcetype',
'supportedlock',
'lockdiscovery',
)

Definition at line 68 of file ezwebdavcontentbackend.php.

Referenced by getCollectionMembers().

## ◆ $useLogging

eZWebDAVContentBackend::$useLogging
| static protected

Definition at line 115 of file ezwebdavcontentbackend.php.

## ◆ DEFAULT_MIMETYPE

const eZWebDAVContentBackend::DEFAULT_MIMETYPE = "application/octet-stream"

Mimetype for Exponential objects which don't have a mimetype.

Definition at line 55 of file ezwebdavcontentbackend.php.

Referenced by getProperty().

## ◆ DEFAULT_SIZE

const eZWebDAVContentBackend::DEFAULT_SIZE = 0

Default size in bytes for Exponential objects which don't have a size.

Definition at line 60 of file ezwebdavcontentbackend.php.

Referenced by getProperty().

## ◆ DIRECTORY_MIMETYPE

const eZWebDAVContentBackend::DIRECTORY_MIMETYPE = 'httpd/unix-directory'

Mimetype for directories.

Definition at line 50 of file ezwebdavcontentbackend.php.

Referenced by fetchContainerNodeInfo(), fetchNodeInfo(), fetchSiteListContent(), fetchVirtualSiteContent(), getNodeInfo(), and getProperty().

## ◆ VIRTUAL_CONTENT_FOLDER_NAME

const eZWebDAVContentBackend::VIRTUAL_CONTENT_FOLDER_NAME = 'Content'

The name of the content folder in Exponential.

Definition at line 35 of file ezwebdavcontentbackend.php.

## ◆ VIRTUAL_MEDIA_FOLDER_NAME

const eZWebDAVContentBackend::VIRTUAL_MEDIA_FOLDER_NAME = 'Media'

The name of the media folder in Exponential.

Definition at line 40 of file ezwebdavcontentbackend.php.

## ◆ WEBDAV_INI_FILE

const eZWebDAVContentBackend::WEBDAV_INI_FILE = "webdav.ini"

The ini file which holds settings for WebDAV.

Definition at line 45 of file ezwebdavcontentbackend.php.

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

- ezwebdavcontentbackend.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.