Webdav: ezcWebdavServerConfigurationManager
[ ]
[ Clients ] [ Plugin architecture ]
[ ]
[ ]
[ ]
[ ]
Class: ezcWebdavServerConfigurationManager
|
Manages and dispatches server configurations. [
source]
Implemented Interfaces
- ArrayAccess (internal interface)
- Iterator (internal interface)
An instance of this class is kept in the singleton instance of
ezcWebdavServer and keeps track of different server configurations to be used with different clients.
Several special configurations exist per default:
- MS InternetExplorer compatible
- GNOME Nautilus compatible
In addtion, a default configuration that behaves RFC compliant is included as fallback for any other client.
Configurations can be accessed by the ArrayAccess and Iterator interfaces. To insert new configurations, the method
insertBefore() should be used.
Member Variables
|
protected array(int=>ezcWebdavServerConfiguration) |
$configurations
= array()
Transport configurations to dispatch. |
Method Summary
|
public void |
__construct(
)
Creates a new dispatcher. |
|
protected void |
checkOffset(
$offset )
Checks the given $offset for validity. |
|
protected void |
checkValue(
$value )
Checks the given $value for validity. |
|
public void |
configure(
$server, $userAgent )
Configures the server for handling a request by the given User-Agent. |
|
public mixed |
current(
)
Implements current() for Iterator |
|
public void |
insertBefore(
$config, [$offset = 0] )
Inserts a configuration right before a certain offset. |
|
public int |
key(
)
Implements key() for Iterator |
|
public mixed |
next(
)
Implements next() for Iterator |
|
public void |
offsetSet(
$offset, $value )
Array set access. |
|
public void |
rewind(
)
Implements rewind() for Iterator |
|
public boolean |
valid(
)
Implements valid() for Iterator |
Methods
__construct
void __construct(
)
Creates a new dispatcher.
This creates a new manager object and registers the default
ezcWebdavServerConfiguration instances automatically. The last added configuration is the RFC compliant one, which matches for every client if no other configurations matched before. That means, all following should be added by
insertBefore() to ensure, this catchall will not break the transfer layer.
checkOffset
void checkOffset(
int|null
$offset )
Checks the given $offset for validity.
This method checks if the given $offset is either of type int, then larger 0 and not larger as the number of elements in $this->configurations, or null.
The method is primarily used in the ArrayAccess methods.
Parameters
| Name |
Type |
Description |
$offset |
int|null |
|
Throws
| Class | Description |
ezcBaseValueException |
if the given $offset is not an an int with the given criteria and not null. |
checkValue
Checks the given $value for validity.
The method is primarily used in the ArrayAccess methods.
Parameters
Throws
| Class | Description |
ezcBaseValueException |
if the given $value is not an instance of ezcWebdavServerConfiguration or null. |
configure
Configures the server for handling a request by the given User-Agent.
Parameters
Throws
| Class | Description |
ezcWebdavMissingTransportConfigurationException |
if no ezcWebdavServerConfiguration could be found that matches the given $userAgent. |
current
mixed current(
)
Implements current() for Iterator
insertBefore
Inserts a configuration right before a certain offset.
This method inserts a given $config right before the given $offset. The $offset must be of type integer and between 0 and the number of elements in $this->configurations minus 1.
Parameters
Throws
| Class | Description |
ezcBaseValueException |
if the given $offset is not an integer that is larger or equal to 0 and smaller than the number of elements in $this->configurations. |
key
int key(
)
Implements key() for Iterator
next
mixed next(
)
Implements next() for Iterator
offsetSet
void offsetSet(
string
$offset, string
$value )
Array set access.
Parameters
| Name |
Type |
Description |
$offset |
string |
|
$value |
string |
|
rewind
void rewind(
)
Implements rewind() for Iterator
valid
boolean valid(
)
Implements valid() for Iterator
Last updated: Mon, 29 Jun 2009