Zeta Components - high quality PHP components

Zeta Components Manual :: Docs For Class ezcWebdavServerConfigurationManager

Webdav::ezcWebdavServerConfigurationManager

Class ezcWebdavServerConfigurationManager

Manages and dispatches server configurations.

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.

Source for this file: /Webdav/src/server_configuration_manager.php

Implements interfaces:

  • ArrayAccess (internal interface)
  • Iterator (internal interface)
Version:   //autogen//

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
Exceptions:
Type Description
ezcBaseValueException if the given $offset is not an an int with the given criteria and not null.

checkValue

void checkValue( ezcWebdavServerConfiguration|null $value )

Checks the given $value for validity.

This method checks if the given $value is either an instance of ezcWebdavServerConfiguration or null.

The method is primarily used in the ArrayAccess methods.

Parameters:
Name Type Description
$value ezcWebdavServerConfiguration|null
Exceptions:
Type Description
ezcBaseValueException if the given $value is not an instance of ezcWebdavServerConfiguration or null.

configure

void configure( ezcWebdavServer $server , mixed $userAgent )

Configures the server for handling a request by the given User-Agent.

This method is used by ezcWebdavServer to determine the correct ezcWebdavTransport for the current request. It returns the ezcWebdavTransport created by the ezcWebdavServerConfiguration which matched the submitted User-Agent header first.

Per default, the RFC compliant default implementation ezcWebdavTransport is configured to catch all User-Agent headers for which no specific implementation could be found. If this configuration has been removed or manipulated incorrectly, an ezcWebdavMissingTransportConfigurationException might be thrown.

Parameters:
Name Type Description
$server ezcWebdavServer
$userAgent mixed
Exceptions:
Type Description
ezcWebdavMissingTransportConfigurationException if no ezcWebdavServerConfiguration could be found that matches the given $userAgent.

current

mixed current( )

Implements current() for Iterator

Implementation of:
Method Description
Iterator::current

insertBefore

void insertBefore( ezcWebdavServerConfiguration $config , [int $offset = 0] )

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.

If these preconditions do not match for the given $offset, an ezcBaseValueException is thrown.

Parameters:
Name Type Description
$config ezcWebdavServerConfiguration
$offset int
Exceptions:
Type 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

Implementation of:
Method Description
Iterator::key

next

mixed next( )

Implements next() for Iterator

Implementation of:
Method Description
Iterator::next

offsetSet

void offsetSet( string $offset , string $value )

Array set access.

Parameters:
Name Type Description
$offset string
$value string
Implementation of:
Method Description
ArrayAccess::offsetSet

rewind

void rewind( )

Implements rewind() for Iterator

Implementation of:
Method Description
Iterator::rewind

valid

boolean valid( )

Implements valid() for Iterator

Implementation of:
Method Description
Iterator::valid
Documentation generated by phpDocumentor 1.4.3