\Horde_Kolab_Storage_Driver

The driver definition for accessing Kolab storage.

Copyright 2004-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
Constants
createBackend()
getBackend()
setBackend()
getAuth()
getId()
getParameters()
hasCatenateSupport()
listFolders()
create()
delete()
rename()
hasAclSupport()
getAcl()
getMyAcl()
setAcl()
deleteAcl()
listAnnotation()
getAnnotation()
setAnnotation()
getNamespace()
getStamp()
status()
getUids()
fetchStructure()
fetchBodypart()
fetchComplete()
fetchHeaders()
appendMessage()
deleteMessages()
moveMessage()
expunge()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

createBackend()

createBackend() : mixed

Create the backend driver.

Returns

mixed —

The backend driver.

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

getAuth()

getAuth() : string

Return the id of the user currently authenticated.

Returns

string —

The id of the user that opened the 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.

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(string  $folder) : array

Retrieve the access rights for a folder.

Parameters

string $folder

The folder to retrieve the ACL for.

Returns

array —

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

getNamespace()

getNamespace() : \Horde_Kolab_Storage_Driver_Namespace

Retrieve the namespace information for this connection.

Returns

\Horde_Kolab_Storage_Driver_Namespace —

The initialized namespace handler.

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.

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' and 'uidnext'.

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.

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

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|string —

The body part, as a stream resource or string.

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.

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