## Apache Zeta Components Manual :: Docs For Class ezcWebdavBasicPathFactory

### Webdav::ezcWebdavBasicPathFactory

### Class ezcWebdavBasicPathFactory

Basic path factory.

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.

Source for this file: /Webdav/src/path_factories/basic.php

### Implements interfaces:

- ezcWebdavPathFactory

Version: | //autogentag//

### 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 |

##### Implementation of:

Method | Description
--- | ---
`ezcWebdavPathFactory::generateUriFromPath()` | Generates a URI from a local path.

#### 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 |

##### Implementation of:

Method | Description
--- | ---
`ezcWebdavPathFactory::parseUriToPath()` | Parses the given URI to a path suitable to be used in the backend.

Documentation generated by phpDocumentor 1.4.3