\Horde_Kolab_Storage_Driver_Base

The base driver definition for accessing Kolab storage drivers.

Copyright 2009-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Summary

Methods
Properties
Constants
__construct()
getBackend()
setBackend()
getParams()
getParam()
setParam()
getAuth()
getId()
getParameters()
hasCatenateSupport()
getModifiable()
getNamespace()
getStampFromToken()
getStamp()
fetchStructure()
fetchBodypart()
fetchComplete()
fetchHeaders()
No public properties found
No constants found
getFactory()
encodePath()
decodePath()
decodeList()
decodeListKeys()
_getAnnotateMoreEntry()
$_namespace
$charset
N/A
No private methods found
$_factory
$_params
$_backend
N/A

Properties

$charset

$charset : string

Charset used by this driver.

Type

string

$_params

$_params : array

Additional connection parameters.

Type

array

$_backend

$_backend : mixed

The backend to use.

Type

mixed

Methods

__construct()

__construct(\Horde_Kolab_Storage_Factory  $factory, array  $params = array()) 

Constructor.

Parameters

\Horde_Kolab_Storage_Factory $factory

A factory for helper objects.

array $params

Connection parameters.

getBackend()

getBackend() : mixed

Returns the actual backend driver.

If there is no driver set the driver should be constructed within this method.

Returns

mixed —

The backend driver.

setBackend()

setBackend(mixed  $backend) : NULL

Set the backend driver.

Parameters

mixed $backend

The driver that should be used.

Returns

NULL

getParams()

getParams() : array

Return all parameter settings for this connection.

Returns

array —

The parameters.

getParam()

getParam(string  $key, mixed  $default = null) : mixed

Return a parameter setting for this connection.

Parameters

string $key

The parameter key.

mixed $default

An optional default value.

Returns

mixed —

The parameter value.

setParam()

setParam(string  $key, mixed  $value) : NULL

Set a parameter setting for this connection.

Parameters

string $key

The parameter key.

mixed $value

The parameter value.

Returns

NULL

getAuth()

getAuth() : string

Return the id of the user currently authenticated.

Returns

string —

The id of the user that opened the IMAP connection.

getId()

getId() : string

Return the unique connection id.

Returns

string —

The connection id.

getParameters()

getParameters() : array

Return the connection parameters.

Returns

array —

The connection parameters.

hasCatenateSupport()

hasCatenateSupport() : boolean

Checks if the backend supports CATENATE.

Returns

boolean —

True if the backend supports CATENATE.

getModifiable()

getModifiable(string  $folder, string  $obid, array  $object) : \Horde_Kolab_Storage_Driver_Modifiable

Return a modifiable message object.

Parameters

string $folder

The folder to access.

string $obid

The backend ID of the object to retrieve from the folder.

array $object

The object data.

Returns

\Horde_Kolab_Storage_Driver_Modifiable —

The modifiable message object.

getNamespace()

getNamespace() : \Horde_Kolab_Storage_Folder_Namespace

Retrieve the namespace information for this connection.

Returns

\Horde_Kolab_Storage_Folder_Namespace

The initialized namespace handler.

getStampFromToken()

getStampFromToken(string  $folder, string  $token, array  $ids) : \Horde_Kolab_Storage_Folder_Stamp

Returns a stamp for the current folder status. This stamp can be used to identify changes in the folder data. This method, as opposed to self::getStamp(), uses the IMAP client's token to calculate the changes.

Parameters

string $folder

Return the stamp for this folder.

string $token

A sync token provided by the IMAP server.

array $ids

An array of UIDs that we know about.

Returns

\Horde_Kolab_Storage_Folder_Stamp

A stamp indicating the current folder status.

getStamp()

getStamp(string  $folder) : \Horde_Kolab_Storage_Folder_Stamp

Returns a stamp for the current folder status. This stamp can be used to identify changes in the folder data.

Parameters

string $folder

Return the stamp for this folder.

Returns

\Horde_Kolab_Storage_Folder_Stamp

A stamp indicating the current folder status.

fetchStructure()

fetchStructure(string  $mailbox, array  $uids) : \Horde_Mime_Part

Retrieves the messages for the given message ids.

Parameters

string $mailbox

The mailbox to fetch the messages from.

array $uids

The message UIDs.

Returns

\Horde_Mime_Part —

The message structure parsed into a Horde_Mime_Part instance.

fetchBodypart()

fetchBodypart(string  $mailbox, array  $uid, array  $id) : resource

Retrieves a bodypart for the given message ID and mime part ID.

Parameters

string $mailbox

The mailbox to fetch the messages from.

array $uid

The message UID.

array $id

The mime part ID.

Returns

resource —

The transfer-decoded body part data, as a stream resource presented as 8bit data.

fetchComplete()

fetchComplete(string  $folder, array  $uid) : array

Retrieves a complete message.

Parameters

string $folder

The folder to fetch the messages from.

array $uid

The message UID.

Returns

array —

The message encapsuled as an array that contains a Horde_Mime_Headers and a Horde_Mime_Part object.

fetchHeaders()

fetchHeaders(string  $folder, array  $uid) : \Horde_Mime_Headers

Retrieves the message headers.

Parameters

string $folder

The folder to fetch the message from.

array $uid

The message UID.

Returns

\Horde_Mime_Headers —

The message headers.

encodePath()

encodePath(string  $path) : string

Encode IMAP path names from UTF-8 to the driver charset.

Parameters

string $path

The UTF-8 encoded path name.

Returns

string —

The path name in the driver charset.

decodePath()

decodePath(string  $path) : string

Decode IMAP path names from the driver charset to UTF-8.

Parameters

string $path

The the driver charset encoded path name.

Returns

string —

The path name in UTF-8.

decodeList()

decodeList(array  $list) : array

Decode a list of IMAP path names from the driver charset to UTF-8.

Parameters

array $list

The the driver charset encoded path names.

Returns

array —

The path names in UTF-8.

decodeListKeys()

decodeListKeys(array  $list) : array

Decode the keys of a list of IMAP path names from the driver charset to UTF-8.

Parameters

array $list

The list with the driver charset encoded path names as keys.

Returns

array —

The list with path names in UTF-8 as keys.

_getAnnotateMoreEntry()

_getAnnotateMoreEntry(string  $name) : array

Split a name for the METADATA extension into the correct syntax for the older ANNOTATEMORE version.

Parameters

string $name

A name for a metadata entry.

Throws

\Horde_Imap_Client_Exception

Returns

array —

A list of two elements: The entry name and the value type.