Webdav: ezcWebdavServerConfiguration
[ ]
[ Clients ] [ Plugin architecture ]
[ ]
[ ]
[ ]
[ ]
Class: ezcWebdavServerConfiguration
|
Class containing the configuration for a specific client. [
source]
An instance of this class represents the configuration of
ezcWebdavServer for a specific client. The
ezcWebdavServerConfigurationManager holds a default set of such objects, representing the configurations that are known by the Webdav component by default.
You can instantiate more objects of this class to add custom configurations and possibly even extend it to support more advanced features.
The property $userAgentRegex determines the PCRE that is used to match against the User-Agent HTTP header. If the regex matches, the configuration is used to configure the
ezcWebdavServer instance. The default regex will match always and therefore always as the last fallback and will make the server act RFC conform.
The $transport property represents the class to be instantiated as the transport layer. The default is
ezcWebdavTransport, which is the RFC compliant transport implementation.
$xmlTool defaults to an instance of
ezcWebdavXmlTool, but may be configured to be a class implementing the same interface or even an extended one. The premission is, that the corresponding
ezcWebdavTransport and
ezcWebdavPropertyHandler are 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 incoming request URIs into request paths, that can be handled by the ezcWebdavBackend. 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
|
|
string |
read/write
|
$transportClass
Transport class to instantiate when creating an instance of the transport layer configured in this object. |
|
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 configure the ezcWebdavServer instance, according to the other properties. |
|
string |
read/write
|
$xmlToolClass
|
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 instantiate. |
|
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'], [string
$headerHandlerClass = 'ezcWebdavHeaderHandler'], [
ezcWebdavPathFactory
$pathFactory = null] )
Creates a new instance.
All parameters are strings, representing the specific classes to use, exception for $pathFactory, which must be a valid path factory instance. The classes defined in the other parameters will be set as properties and instantiated when a server configuration is requested through the
configure() method, by the
ezcWebdavServerConfigurationManager instance hold in
ezcWebdavServer.
Parameters
| Name |
Type |
Description |
$userAgentRegex |
string |
|
$transportClass |
string |
|
$xmlToolClass |
string |
|
$propertyHandlerClass |
string |
|
$headerHandlerClass |
string |
|
$pathFactory |
ezcWebdavPathFactory |
|
checkClasses
void checkClasses(
)
Checks the availability of all classes to instantiate.
This method checks all classes stored in the configuration for existance and validity. If an error is found, an
ezcBaseValueException is issued.
Throws
| Class | Description |
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
Configures the server for handling a request.
This method takes the instance of
ezcWebdavServer in $server and configures this instance according to the configuration represented. After calling this method, the
ezcWebdavServer instance in $server is ready to handle a request.
Parameters
Last updated: Mon, 10 Nov 2008