Documentation

PDO
in package
implements BackendInterface

PropertyStorage PDO backend.

This backend class uses a PDO-enabled database to store webdav properties. Both sqlite and mysql have been tested.

The database structure can be found in the examples/sql/ directory.

Tags
copyright

Copyright (C) fruux GmbH (https://fruux.com/)

author

Evert Pot (http://evertpot.com/)

license

http://sabre.io/license/ Modified BSD License

Interfaces, Classes and Traits

BackendInterface
Propertystorage backend interface.

Table of Contents

VT_OBJECT  = 3
Value is stored as a property object.
VT_STRING  = 1
Value is stored as string.
VT_XML  = 2
Value is stored as XML fragment.
$tableName  : string
PDO table name we'll be using.
$pdo  : PDO
PDO.
__construct()  : mixed
Creates the PDO property storage engine.
delete()  : mixed
This method is called after a node is deleted.
move()  : mixed
This method is called after a successful MOVE.
propFind()  : mixed
Fetches properties for a path.
propPatch()  : mixed
Updates properties for a path.

Constants

VT_OBJECT

Value is stored as a property object.

public mixed VT_OBJECT = 3

VT_STRING

Value is stored as string.

public mixed VT_STRING = 1

VT_XML

Value is stored as XML fragment.

public mixed VT_XML = 2

Properties

$tableName

PDO table name we'll be using.

public string $tableName = 'propertystorage'

$pdo

PDO.

protected PDO $pdo

Methods

__construct()

Creates the PDO property storage engine.

public __construct(PDO $pdo) : mixed
Parameters
$pdo : PDO
Return values
mixed

delete()

This method is called after a node is deleted.

public delete(string $path) : mixed

This allows a backend to clean up all associated properties.

The delete method will get called once for the deletion of an entire tree.

Parameters
$path : string
Return values
mixed

move()

This method is called after a successful MOVE.

public move(string $source, string $destination) : mixed

This should be used to migrate all properties from one path to another. Note that entire collections may be moved, so ensure that all properties for children are also moved along.

Parameters
$source : string
$destination : string
Return values
mixed

propFind()

Fetches properties for a path.

public propFind(string $path, PropFind $propFind) : mixed

This method received a PropFind object, which contains all the information about the properties that need to be fetched.

Usually you would just want to call 'get404Properties' on this object, as this will give you the exact list of properties that need to be fetched, and haven't yet.

However, you can also support the 'allprops' property here. In that case, you should check for $propFind->isAllProps().

Parameters
$path : string
$propFind : PropFind
Return values
mixed

propPatch()

Updates properties for a path.

public propPatch(string $path, PropPatch $propPatch) : mixed

This method received a PropPatch object, which contains all the information about the update.

Usually you would want to call 'handleRemaining' on this object, to get; a list of all properties that need to be stored.

Parameters
$path : string
$propPatch : PropPatch
Return values
mixed

Search results