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_Driver_Namespace

Retrieve the namespace information for this connection.

Returns

\Horde_Kolab_Storage_Driver_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  $folder, array  $uids) : array

Retrieves the messages for the given message ids.

Parameters

string $folder

The folder to fetch the messages from.

array $uids

The message UIDs.

Returns

array —

An array of message structures parsed into Horde_Mime_Part instances.

fetchBodypart()

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

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

Parameters

string $folder

The folder to fetch the messages from.

array $uid

The message UID.

array $id

The mime part ID.

Returns

resource —

The body part, as a stream resource. The contents are already transfer decoded and 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.

createBackend()

createBackend() : mixed

Create the backend driver.

Returns

mixed —

The backend driver.

listFolders()

listFolders() : array

Retrieves a list of folders from the server.

Returns

array —

The list of folders.

create()

create(string  $folder) : NULL

Create the specified folder.

Parameters

string $folder

The folder to create.

Returns

NULL

delete()

delete(string  $folder) : NULL

Delete the specified folder.

Parameters

string $folder

The folder to delete.

Returns

NULL

rename()

rename(string  $old, string  $new) : NULL

Rename the specified folder.

Parameters

string $old

The folder to rename.

string $new

The new name of the folder.

Returns

NULL

hasAclSupport()

hasAclSupport() : boolean

Does the backend support ACL?

Returns

boolean —

True if the backend supports ACLs.

getAcl()

getAcl(\Horde_Kolab_Storage_Folder  $folder) : \An

Retrieve the access rights for a folder.

Parameters

\Horde_Kolab_Storage_Folder $folder

The folder to retrieve the ACL for.

Returns

\An —

array of rights.

getMyAcl()

getMyAcl(string  $folder) : string

Retrieve the access rights the current user has on a folder.

Parameters

string $folder

The folder to retrieve the user ACL for.

Returns

string —

The user rights.

setAcl()

setAcl(string  $folder, string  $user, string  $acl) : NULL

Set the access rights for a folder.

Parameters

string $folder

The folder to act upon.

string $user

The user to set the ACL for.

string $acl

The ACL.

Returns

NULL

deleteAcl()

deleteAcl(string  $folder, string  $user) : NULL

Delete the access rights for user on a folder.

Parameters

string $folder

The folder to act upon.

string $user

The user to delete the ACL for

Returns

NULL

listAnnotation()

listAnnotation(string  $annotation) : array

Retrieves the specified annotation for the complete list of folders.

Parameters

string $annotation

The name of the annotation to retrieve.

Returns

array —

An associative array combining the folder names as key with the corresponding annotation value.

getAnnotation()

getAnnotation(string  $folder, string  $annotation) : string

Fetches the annotation from a folder.

Parameters

string $folder

The name of the folder.

string $annotation

The annotation to get.

Returns

string —

The annotation value.

setAnnotation()

setAnnotation(string  $folder, string  $annotation, array  $value) : NULL

Sets the annotation on a folder.

Parameters

string $folder

The name of the folder.

string $annotation

The annotation to set.

array $value

The values to set

Returns

NULL

select()

select(string  $folder,   $mode = \Horde_Imap_Client::OPEN_AUTO) : NULL

Opens the given folder.

Parameters

string $folder

The folder to open

$mode

Returns

NULL

status()

status(string  $folder) : array

Returns the status of the current folder.

Parameters

string $folder

Check the status of this folder.

Returns

array —

An array that contains 'uidvalidity', 'uidnext', and 'token'.

sync()

sync(string  $folder, string  $token, array  $ids = array()) : array

Synchrozine using a token provided by the IMAP client.

Parameters

string $folder

The folder to synchronize.

string $token

The sync token provided by the IMAP client.

array $ids

The list of IMAP message UIDs we currently know about. If omitted, the server will return VANISHED data only if it supports QRESYNC.

Returns

array —

An array containing the following keys and values: Horde_Kolab_Storage_Folder_Stamp_Uids::DELETED - Contains the UIDs that have VANISHED from the IMAP server. Horde_Kolab_Storage_Folder_Stamp_Uids::ADDED - Contains the UIDs that have been added to the IMAP server since the last sync.

getUids()

getUids(string  $folder) : array

Returns the message ids of the messages in this folder.

Parameters

string $folder

Check the status of this folder.

Returns

array —

The message ids.

appendMessage()

appendMessage(string  $folder, resource  $msg) : mixed

Appends a message to the given folder.

Parameters

string $folder

The folder to append the message(s) to.

resource $msg

The message to append.

Returns

mixed —

True or the UID of the new message in case the backend supports UIDPLUS.

deleteMessages()

deleteMessages(string  $folder, integer  $uids) : NULL

Deletes messages from the specified folder.

Parameters

string $folder

The folder to delete messages from.

integer $uids

IMAP message ids.

Returns

NULL

moveMessage()

moveMessage(integer  $uid, string  $old_folder, string  $new_folder) : NULL

Moves a message to a new folder.

Parameters

integer $uid

IMAP message id.

string $old_folder

Source folder.

string $new_folder

Target folder.

Returns

NULL

expunge()

expunge(string  $folder) : NULL

Expunges messages in the current folder.

Parameters

string $folder

The folder to expunge.

Returns

NULL

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.