Path

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


eZ Components 2007.2alpha1

Webdav: ezcWebdavServerConfiguration

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

Class: ezcWebdavServerConfiguration

Class containing the configuration for a transport. [source]
An instance of this class represents the configuration necessary to instanciate a new ezcWebdavTransport object. The ezcWebdavServerConfigurationManager holds a default set of such objects, representing the transport classes that are known by the Webdav component by default.
You can instanciate more objects of this class to add custom configurations and possibly even extend it to support more advanced features.
This base class instantiates a transport in the way that is suitable, when requested by the ezcWebdavServerConfigurationManager. The class may be extended to suite extended transport layer needs. The only premission is, that the getTransportInstance() method returns a functional ezcWebdavTransport instance.
The property $userAgentRegex determines the PCRE that is used to match against the User-Agent HTTP header. If the regex matches, the transport is instanciated and made responsible to handle the request. The default regex will match always and therefore always use the transport configured by this class.
The $transport property represents the class to be instanciated as the real transport. The default is ezcWebdavTransport, which is the RFC compliant transport implementation.
$xmlTool defaults to the ezcWebdavXmlTool class, but may be configured to be a class implementing the same interface or even an extended one. The premission is, that the transport is able to use the instance of this class for XML handling purposes.
The property $propertyHandler is responsible for extraction of and serialization to XML of dead and live properties. This may be replaced, if a transport needs or provides non-conform property XML.

Properties

ezcWebdavPathFactory read/write  $pathFactory
Object used to transform real paths into request paths. Default is ezcWebdavAutomaticPathFactory. This is the only place where an object is expected, since transport implementations should not rely on a specific path factory and that means 1 path factory can be used for all transport configurations.
string read/write  $propertyHandlerClass
This property defines the ezcWebdavPropertyHandler class to use, when instanciating the ezcWebdavTransport in $transport. The class given here will receive $xmlTool as a parameter, to work with.
string read/write  $transportClass
Transport class to instanciate when creating an instance of the transport layer configured in this object. If the desired extension of ezcWebdavTransport is compatible API with the basic RFC implementation, it can also be used here.
string read/write  $userAgentRegex
PCRE that is used to match against the User-Agent header. If this regex matches, this configuration object is used to create the transport layer classes for the current request, determined by the other properties.
string read/write  $xmlToolClass
This property defines the ezcWebdavXmlTool instance to be used with the ezcWebdavTransport class configured in $transport and the ezcWebdavPropertyHandler class configured in $propertyHandler.

Member Variables

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

Method Summary

public void __construct( [$userAgentRegex = '(.*)'], [$transportClass = 'ezcWebdavTransport'], [$xmlToolClass = 'ezcWebdavXmlTool'], [$propertyHandlerClass = 'ezcWebdavPropertyHandler'], [$headerHandlerClass = 'ezcWebdavHeaderHandler'], [$pathFactory = null] )
Creates a new instance.
protected void checkClasses( )
Checks the availability of all classes to instanciate.
public void configure( $server )
Configures the server for handling a request.

Methods

__construct

void __construct( [string $userAgentRegex = '(.*)'], [string $transportClass = 'ezcWebdavTransport'], [string $xmlToolClass = 'ezcWebdavXmlTool'], [string $propertyHandlerClass = 'ezcWebdavPropertyHandler'], [ $headerHandlerClass = 'ezcWebdavHeaderHandler'], [ezcWebdavPathFactory $pathFactory = null] )
Creates a new instance.
All parameters are strings, representing the specific classes to use.

Parameters

Name Type Description
$userAgentRegex string  
$transportClass string  
$xmlToolClass string  
$propertyHandlerClass string  
$pathFactory ezcWebdavPathFactory  
$headerHandlerClass  

checkClasses

void checkClasses( )
Checks the availability of all classes to instanciate.
This method checks all classes stored in $this->properties for existance and validity. If an error is found, an ezcBaseValueException is issued.

Throws

ClassDescription
ezcBaseValueException if a property does not contain a class valid to be used with this configuration class or if a given class does not exist.

configure

void configure( ezcWebdavServer $server )
Configures the server for handling a request.
This method takes the instance of ezcWebdavServer in $server and configures this instance according to the configuration stored in $this.
After calling this method, the ezcWebdavServer instance in $server is ready to handle a request.

Parameters

Name Type Description
$server ezcWebdavServer  

Last updated: Mon, 12 Nov 2007