Path

ez components / documentation / api reference / 2007.2alpha1 / webdav


eZ Components 2007.2alpha1

Webdav: ezcWebdavServer

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcWebdavServer

Base class for creating a webdav server, capable of serving webdav requests. [source]
 1.  $server ezcWebdavServer::getInstance();
 2.  
 3.  // Server data using file backend with data in "path/"
 4.   $server->backend new ezcWebdavBackendFile'/path' );
 5.  
 6.  // Optionally register aditional transport handlers
 7.  
 8.  // This step is only required, when a user wants to provide own
 9.  // implementations for special clients.
10.   $server->configurationsi[new ezcWebdavServerConfiguration(
11.      // Regular expression to match client name
12.           '(Microsoft.*Webdav\s+XP)i',
13.      // Class name of transport handler, extending ezcWebdavTransportHandler
14.           'ezcWebdavMicrosoftTransport'
15.  );
16.  $server->configurationsi[new ezcWebdavServerConfiguration(
17.      // Regular expression to match client name
18.           '(.*Firefox.*)i',
19.      // Class name of transport handler, extending ezcWebdavTransportHandler
20.           'customWebdavMozillaTransport',
21.      // A custom implementation of <a href="../Webdav/ezcWebdavXmlTool.html">ezcWebdavXmlTool</a>
22.           'customWebdavXmlTool',
23.      // A custom implementation of <a href="../Webdav/ezcWebdavPropertyHandler.html">ezcWebdavPropertyHandler</a>
24.           'customWebdavPropertyHandler',
25.      // A custom path factory
26.           new customWebdavPathFactory()
27.  );
28.  
29.  // Serve requests
30.   $server->handle();

Member Variables

protected ezcWebdavServer $instance
Singleton instance.
protected array(string=>mixed) $properties = array()
Properties.

Method Summary

protected void __construct( )
Creates a new instance.
public static void getInstance( )
Singleton retrieval.
public void handle( $backend )
Makes the Webdav server handle the current request.
public void init( $pathFactory, $xmlTool, $propertyHandler, $headerHandler, $transport )
Initialize the server with the given objects.
public void reset( )
Reset the server to its initial state.

Methods

__construct

void __construct( )
Creates a new instance.
The constructor is private due to singleton reasons. Use self::getInstance() and then use the properties of the server to adjust it's configuration.

getInstance

void getInstance( )
Singleton retrieval.
The instantiation of 2 WebDAV servers at the same time does not make sense. Therefore the server is a singleton and its only instance must be retrieved using this method.

handle

void handle( ezcWebdavBackend $backend )
Makes the Webdav server handle the current request.
This method is the absolute heart of the Webdav component. It is called to make the server instance handle the current request. This means, a ezcWebdavTransport is selected and instantiated through the ezcWebdavServerConfigurationManager in $this->configurations.

Parameters

Name Type Description
$backend ezcWebdavBackend  

init

void init( ezcWebdavPathFactory $pathFactory, ezcWebdavXmlTool $xmlTool, ezcWebdavPropertyHandler $propertyHandler, ezcWebdavHeaderHandler $headerHandler, ezcWebdavTransport $transport )
Initialize the server with the given objects.
This method is marked proteced, because it is intended to be used by by ezcWebdavServerConfiguration instances and instances of derived classes, but not directly.

Parameters

Name Type Description
$pathFactory ezcWebdavPathFactory  
$xmlTool ezcWebdavXmlTool  
$propertyHandler ezcWebdavPropertyHandler  
$transport ezcWebdavTransport  
$headerHandler ezcWebdavHeaderHandler  

reset

void reset( )
Reset the server to its initial state.
Resets the internal server state as if a new instance has just been constructed.

Last updated: Mon, 12 Nov 2007