Webdav: ezcWebdavServer
[ ]
[ Plugin architecture ]
[ ]
[ ]
[ ]
[ ]
Class: ezcWebdavServer
|
Base class for creating a webdav server, capable of serving webdav requests. [
source]
1. $server = ezcWebdavServer::getInstance();
2.
3. // Optionally register aditional transport handlers
4.
5. // This step is only required, when a user wants to provide own
6. // implementations for special clients.
7. $server->configurations[] = new ezcWebdavServerConfiguration(
8. // Regular expression to match client name
9. '(Microsoft.*Webdav\s+XP)i',
10. // Class name of transport handler, extending ezcWebdavTransportHandler
11. 'ezcWebdavMicrosoftTransport'
12. );
13. $server->configurations[] = new ezcWebdavServerConfiguration(
14. // Regular expression to match client name
15. '(.*Firefox.*)i',
16. // Class name of transport handler, extending ezcWebdavTransportHandler
17. 'customWebdavMozillaTransport',
18. // A custom implementation of <a href="../Webdav/ezcWebdavXmlTool.html">ezcWebdavXmlTool</a>
19. 'customWebdavXmlTool',
20. // A custom implementation of <a href="../Webdav/ezcWebdavPropertyHandler.html">ezcWebdavPropertyHandler</a>
21. 'customWebdavPropertyHandler',
22. // A custom path factory
23. new customWebdavPathFactory()
24. );
25.
26. // Server data using file backend with data in "path/"
27. $backend = new ezcWebdavBackendFile( '/path' );
28.
29. // Serve requests
30. $server->handle( $backend );
Member Variables
Method Summary
|
protected void |
__construct(
)
Creates a new instance. |
|
public static void |
getInstance(
)
Singleton retrieval. |
|
public void |
handle(
$backend, [$uri = null], $uri
)
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
Makes the Webdav server handle the current request.
The method receives at least an instance of
ezcWebdavBackend, which is used to server the request.
Parameters
init
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
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: Wed, 28 Nov 2007