PHP Класс Horde_Kolab_Storage_Driver_Mock, horde

Copyright 2010-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Автор: Gunnar Wrobel ([email protected])
Наследование: extends Horde_Kolab_Storage_Driver_Base
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( Horde_Kolab_Storage_Factory $factory, array $params = [] ) Constructor.
appendMessage ( string $folder, resource $msg ) : mixed Appends a message to the given folder.
create ( string $folder ) : null Create the specified folder.
createBackend ( ) : mixed Create the backend driver.
delete ( string $folder ) : null Delete the specified folder.
deleteAcl ( string $folder, string $user ) : null Delete the access rights for user on a folder.
deleteMessages ( string $folder, integer $uids ) : null Deletes messages from the specified folder.
expunge ( string $folder ) : null Expunges messages in the current folder.
fetchBodypart ( string $folder, array $uid, array $id ) : resource Retrieves a bodypart for the given message ID and mime part ID.
fetchComplete ( string $folder, array $uid ) : array Retrieves a complete message.
fetchStructure ( string $folder, array $uids ) : array Retrieves the messages for the given message ids.
getAcl ( string $folder ) : array Retrieve the access rights for a folder.
getAnnotation ( string $folder, string $annotation ) : string Fetches the annotation from a folder.
getId ( ) : string Return the unique connection id.
getMyAcl ( string $folder ) : string Retrieve the access rights the current user has on a folder.
getUids ( string $folder ) : array Returns the message ids of the messages in this folder.
hasAclSupport ( ) : boolean Does the backend support ACL?
listAnnotation ( string $annotation ) : array Retrieves the specified annotation for the complete list of folders.
listFolders ( ) : array Retrieves a list of folders on the server.
moveMessage ( integer $uid, string $old_folder, string $new_folder ) : null Moves a message to a new folder.
rename ( string $old, string $new ) : null Rename the specified folder.
select ( string $folder ) : null Opens the given folder.
setAcl ( string $folder, string $user, string $acl ) : null Set the access rights for a folder.
setAnnotation ( string $folder, string $annotation, array $value ) : null Sets the annotation on a folder.
setGroups ( array $groups ) : null Set a group list.
status ( string $folder ) : array Returns the status of the current folder.

Приватные методы

Метод Описание
_convertToExternal ( string $mbox ) : string Convert the internal folder name into an external folder id.
_convertToInternal ( string $folder ) : string Convert the external folder id to an internal folder name.
_failOnMissingFolder ( string $folder ) : null Error out in case the provided folder is missing.
_failOnNoAdmin ( string $folder ) : null Error out in case the user is no admin of the specified folder.
_folderAdmin ( string $folder, string $user ) : boolean Is the user a folder admin (or one of the global groups)?
_folderAdminForGroup ( string $folder, string $user ) : boolean Is the folder visible to a group the user belongs to?
_folderAdminForUnique ( string $folder, string $user ) : boolean Is the exact specified user an admin for the folder?
_folderMissing ( string $folder ) : null Error out indicating that the user does not have the required permissions.
_folderVisible ( string $folder, string $user ) : boolean Is the folder visible to the specified user (or a global group)?
_folderVisibleToGroup ( string $folder, string $user ) : boolean Is the folder visible to a group the user belongs to?
_folderVisibleToUnique ( string $folder, string $user ) : boolean Is the folder visible to exactly the specified user?
_permissionDenied ( ) : null Error out indicating that the user does not have the required permissions.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( Horde_Kolab_Storage_Factory $factory, array $params = [] )
$factory Horde_Kolab_Storage_Factory A factory for helper objects.
$params array Connection parameters.

appendMessage() публичный Метод

Appends a message to the given folder.
public appendMessage ( string $folder, resource $msg ) : mixed
$folder string The folder to append the message(s) to.
$msg resource The message to append.
Результат mixed True or the UID of the new message in case the backend supports UIDPLUS.

create() публичный Метод

Create the specified folder.
public create ( string $folder ) : null
$folder string The folder to create.
Результат null

createBackend() публичный Метод

Create the backend driver.
public createBackend ( ) : mixed
Результат mixed The backend driver.

delete() публичный Метод

Delete the specified folder.
public delete ( string $folder ) : null
$folder string The folder to delete.
Результат null

deleteAcl() публичный Метод

Delete the access rights for user on a folder.
public deleteAcl ( string $folder, string $user ) : null
$folder string The folder to act upon.
$user string The user to delete the ACL for
Результат null

deleteMessages() публичный Метод

Deletes messages from the specified folder.
public deleteMessages ( string $folder, integer $uids ) : null
$folder string The folder to delete messages from.
$uids integer IMAP message ids.
Результат null

expunge() публичный Метод

Expunges messages in the current folder.
public expunge ( string $folder ) : null
$folder string The folder to expunge.
Результат null

fetchBodypart() публичный Метод

Retrieves a bodypart for the given message ID and mime part ID.
public fetchBodypart ( string $folder, array $uid, array $id ) : resource
$folder string The folder to fetch the messages from.
$uid array The message UID.
$id array The mime part ID.
Результат resource The body part, as a stream resource.

fetchComplete() публичный Метод

Retrieves a complete message.
public fetchComplete ( string $folder, array $uid ) : array
$folder string The folder to fetch the messages from.
$uid array The message UID.
Результат array The message encapsuled as an array that contains a Horde_Mime_Headers and a Horde_Mime_Part object.

fetchStructure() публичный Метод

Retrieves the messages for the given message ids.
public fetchStructure ( string $folder, array $uids ) : array
$folder string The folder to fetch the messages from.
$uids array The message UIDs.
Результат array An array of message structures parsed into Horde_Mime_Part instances.

getAcl() публичный Метод

Retrieve the access rights for a folder.
public getAcl ( string $folder ) : array
$folder string The folder to retrieve the ACL for.
Результат array An array of rights.

getAnnotation() публичный Метод

Fetches the annotation from a folder.
public getAnnotation ( string $folder, string $annotation ) : string
$folder string The name of the folder.
$annotation string The annotation to get.
Результат string The annotation value.

getId() публичный Метод

Return the unique connection id.
public getId ( ) : string
Результат string The connection id.

getMyAcl() публичный Метод

Retrieve the access rights the current user has on a folder.
public getMyAcl ( string $folder ) : string
$folder string The folder to retrieve the user ACL for.
Результат string The user rights.

getUids() публичный Метод

Returns the message ids of the messages in this folder.
public getUids ( string $folder ) : array
$folder string Check the status of this folder.
Результат array The message ids.

hasAclSupport() публичный Метод

Does the backend support ACL?
public hasAclSupport ( ) : boolean
Результат boolean True if the backend supports ACLs.

listAnnotation() публичный Метод

Retrieves the specified annotation for the complete list of folders.
public listAnnotation ( string $annotation ) : array
$annotation string The name of the annotation to retrieve.
Результат array An associative array combining the folder names as key with the corresponding annotation value.

listFolders() публичный Метод

Retrieves a list of folders on the server.
public listFolders ( ) : array
Результат array The list of folders.

moveMessage() публичный Метод

Moves a message to a new folder.
public moveMessage ( integer $uid, string $old_folder, string $new_folder ) : null
$uid integer IMAP message id.
$old_folder string Source folder.
$new_folder string Target folder.
Результат null

rename() публичный Метод

Rename the specified folder.
public rename ( string $old, string $new ) : null
$old string The folder to rename.
$new string The new name of the folder.
Результат null

select() публичный Метод

Opens the given folder.
public select ( string $folder ) : null
$folder string The folder to open
Результат null

setAcl() публичный Метод

Set the access rights for a folder.
public setAcl ( string $folder, string $user, string $acl ) : null
$folder string The folder to act upon.
$user string The user to set the ACL for.
$acl string The ACL.
Результат null

setAnnotation() публичный Метод

Sets the annotation on a folder.
public setAnnotation ( string $folder, string $annotation, array $value ) : null
$folder string The name of the folder.
$annotation string The annotation to set.
$value array The values to set
Результат null

setGroups() публичный Метод

Set a group list.
public setGroups ( array $groups ) : null
$groups array A list of groups. User names are the keys, an array of group names are the values.
Результат null

status() публичный Метод

Returns the status of the current folder.
public status ( string $folder ) : array
$folder string Check the status of this folder.
Результат array An array that contains 'uidvalidity', 'uidnext', and 'token'.