Path

ez components / documentation / api reference / trunk / webdav


eZ Components trunk

Webdav: ezcWebdavBasicPathFactory

[ Tutorial ] [ Clients ] [ Plugin architecture ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcWebdavBasicPathFactory

Basic path factory. [source]

Implemented Interfaces

An object of this class is meant to be used in ezcWebdavTransportOptions as the $pathFactory property. The instance of ezcWebdavTransport utilizes the path factory to translate between external paths/URIs and internal path representations.
This simple implementation of a path factory expects the base URI it should be working on as the constructor parameter. It will translate all incoming URIs to internal paths and the other way round based on this URI.
You may want to provide custome implementations for different mappings. The ezcWebdavAutomaticPathFactory is a more advanced implementation, which automatically "guesses" the server configuration and should be suitable for almost every case.

Member Variables

protected array(string=>string) $baseUriParts
Result of parse_url() for the $baseUri submitted to the ctor.
protected array(string=>bool) $collectionPathes = array()
Caches paths that are a collection.

Those will get a '/' appended on re-serialization. Works only if they had been unserialized before.

Method Summary

public void __construct( [$baseUri = ''] )
Creates a new path factory.
public string generateUriFromPath( $path )
Generates a URI from a local path.
public string parseUriToPath( $uri )
Parses the given URI to a path suitable to be used in the backend.

Methods

__construct

void __construct( [string $baseUri = ''] )
Creates a new path factory.
Creates a new object to parse URIs to local paths and vice versa. The URL given as a parameter is used to strip URL and path parts from incoming URIs parseUriToPath() and to add the specific parts to outgoing ones generateUriFromPath().

Parameters

Name Type Description
$baseUri string  

generateUriFromPath

string generateUriFromPath( string $path )
Generates a URI from a local path.
This method receives a local $path string, representing a resource in the ezcWebdavBackend and translates it into a full qualified URI to be used as external reference.

Parameters

Name Type Description
$path string  

parseUriToPath

string parseUriToPath( string $uri )
Parses the given URI to a path suitable to be used in the backend.
This method retrieves a URI (either full qualified or relative) and translates it into a local path, which can be understood by the ezcWebdavBackend instance used in the ezcWebdavServer.
A locally understandable path MUST NOT contain a trailing slash, but MUST always contain a starting slash. For the root URI the path "/" MUST be used.

Parameters

Name Type Description
$uri string  

Last updated: Mon, 21 Dec 2009