WebDAV
WebDAV
Abstract WebDAV controller.
class WebDAV extends \Hazaar\Controller\BasicExtends: Hazaar\Controller\Basic
This controller provides a protocol-aware base for WebDAV endpoints backed by Hazaar file managers. It dispatches incoming HTTP verbs to matching WebDAV handlers, validates allowed methods, and generates standards-aligned metadata responses (such as OPTIONS and PROPFIND).
Subclasses can extend method handlers to implement storage-specific behavior while reusing shared request routing and response shaping logic.
Properties
manager
Active storage manager selected for the current media source.
protected Manager $managerType: Hazaar\File\Manager
__propset
DAV property-set identifier advertised in OPTIONS responses.
private string $__propset = '<http://apache.org/dav/propset/fs/1>'Type: string
__dav_classes
private array $__dav_classes = array (
0 => 1,
)Type: array
__allowed_methods
private array $__allowed_methods = array (
0 => 'OPTIONS',
1 => 'GET',
2 => 'HEAD',
3 => 'POST',
4 => 'DELETE',
5 => 'TRACE',
6 => 'PROPFIND',
7 => 'PROPPATCH',
8 => 'COPY',
9 => 'MOVE',
10 => 'LOCK',
)Type: array
Methods
runAction
Executes the specified action for the WebDAV controller.
public runAction(string $actionName, array $actionArgs, bool $namedActionArgs): ResponseReturns: Hazaar\Controller\Response
Parameters
| Parameter | Type | Description |
|---|---|---|
$actionName | string | the name of the action to execute |
$actionArgs | array | Optional. The arguments to pass to the action. Default is an empty array. |
$namedActionArgs | bool | Optional. Whether the action arguments are named. Default is false. |
options
Handles the OPTIONS HTTP method for the WebDAV controller.
public options(): ResponseReturns: Hazaar\Controller\Response
This method generates a response indicating the allowed HTTP methods and the WebDAV capabilities supported by the server.
propfind
Handles the PROPFIND request for WebDAV.
public propfind(): ResponseReturns: Hazaar\Controller\Response
This method processes a PROPFIND request, which is used to retrieve properties for a resource identified by the request URI. It supports Depth headers of 0 and 1, but throws an exception for Depth headers of "infinity".
proppatch
Handles the PROPPATCH WebDAV method.
public proppatch(): ResponseReturns: Hazaar\Controller\Response
lock
Handles the LOCK WebDAV method.
public lock(): ResponseReturns: Hazaar\Controller\Response
post
Handles the POST WebDAV method.
public post(): ResponseReturns: Hazaar\Controller\Response
copy
Handles the COPY WebDAV method.
public copy(): ResponseReturns: Hazaar\Controller\Response
move
Handles the MOVE WebDAV method.
public move(): ResponseReturns: Hazaar\Controller\Response
delete
Handles the DELETE WebDAV method.
public delete(): ResponseReturns: Hazaar\Controller\Response
trace
Handles the TRACE HTTP method.
public trace(): ResponseReturns: Hazaar\Controller\Response
writeObjectStatusResponse
Generates and writes the XML response for a given Dir or File object.
private writeObjectStatusResponse(Dir|File $object, Element $xml): ElementReturns: Hazaar\XML\Element
This method constructs an XML response that includes various properties of the provided Dir or File object, such as its full path, creation date, last modified date, content length (for files), and more. The response adheres to the WebDAV protocol.
Parameters
| Parameter | Type | Description |
|---|---|---|
$object | Hazaar\File\Dir | Hazaar\File |
$xml | Hazaar\XML\Element | the XML element to which the response is added |
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:16 +0000