PHP Class Horde_Kolab_Storage_Driver_Base, horde

Copyright 2009-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.
Inheritance: implements Horde_Kolab_Storage_Driver
ファイルを表示 Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_namespace Horde_Kolab_Storage_Folder_Namespace Memory cache for the namespace of this driver.
$charset string Charset used by this driver.

Public Methods

Method Description
__construct ( Horde_Kolab_Storage_Factory $factory, array $params = [] ) Constructor.
fetchBodypart ( string $mailbox, 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.
fetchHeaders ( string $folder, array $uid ) : Horde_Mime_Headers Retrieves the message headers.
fetchStructure ( string $mailbox, array $uids ) : Horde_Mime_Part Retrieves the messages for the given message ids.
getAuth ( ) : string Return the id of the user currently authenticated.
getBackend ( ) : mixed Returns the actual backend driver.
getId ( ) : string Return the unique connection id.
getModifiable ( string $folder, string $obid, array $object ) : Horde_Kolab_Storage_Driver_Modifiable Return a modifiable message object.
getNamespace ( ) : Horde_Kolab_Storage_Folder_Namespace Retrieve the namespace information for this connection.
getParam ( string $key, mixed $default = null ) : mixed Return a parameter setting for this connection.
getParameters ( ) : array Return the connection parameters.
getParams ( ) : array Return all parameter settings for this connection.
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.
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.
hasCatenateSupport ( ) : boolean Checks if the backend supports CATENATE.
setBackend ( mixed $backend ) : null Set the backend driver.
setParam ( string $key, mixed $value ) : null Set a parameter setting for this connection.

Protected Methods

Method Description
_getAnnotateMoreEntry ( string $name ) : array Split a name for the METADATA extension into the correct syntax for the older ANNOTATEMORE version.
decodeList ( array $list ) : array Decode a list of IMAP path names from the driver charset to UTF-8.
decodeListKeys ( array $list ) : array Decode the keys of a list of IMAP path names from the driver charset to UTF-8.
decodePath ( string $path ) : string Decode IMAP path names from the driver charset to UTF-8.
encodePath ( string $path ) : string Encode IMAP path names from UTF-8 to the driver charset.
getFactory ( ) : Horde_Kolab_Storage_Factory Return the factory.

Method Details

__construct() public method

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

_getAnnotateMoreEntry() protected method

Split a name for the METADATA extension into the correct syntax for the older ANNOTATEMORE version.
protected _getAnnotateMoreEntry ( string $name ) : array
$name string A name for a metadata entry.
return array A list of two elements: The entry name and the value type.

decodeList() protected method

Decode a list of IMAP path names from the driver charset to UTF-8.
protected decodeList ( array $list ) : array
$list array The the driver charset encoded path names.
return array The path names in UTF-8.

decodeListKeys() protected method

Decode the keys of a list of IMAP path names from the driver charset to UTF-8.
protected decodeListKeys ( array $list ) : array
$list array The list with the driver charset encoded path names as keys.
return array The list with path names in UTF-8 as keys.

decodePath() protected method

Decode IMAP path names from the driver charset to UTF-8.
protected decodePath ( string $path ) : string
$path string The the driver charset encoded path name.
return string The path name in UTF-8.

encodePath() protected method

Encode IMAP path names from UTF-8 to the driver charset.
protected encodePath ( string $path ) : string
$path string The UTF-8 encoded path name.
return string The path name in the driver charset.

fetchBodypart() public method

Retrieves a bodypart for the given message ID and mime part ID.
public fetchBodypart ( string $mailbox, array $uid, array $id ) : resource
$mailbox string The mailbox to fetch the messages from.
$uid array The message UID.
$id array The mime part ID.
return resource The transfer-decoded body part data, as a stream resource presented as 8bit data.

fetchComplete() public method

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.
return array The message encapsuled as an array that contains a Horde_Mime_Headers and a Horde_Mime_Part object.

fetchHeaders() public method

Retrieves the message headers.
public fetchHeaders ( string $folder, array $uid ) : Horde_Mime_Headers
$folder string The folder to fetch the message from.
$uid array The message UID.
return Horde_Mime_Headers The message headers.

fetchStructure() public method

Retrieves the messages for the given message ids.
public fetchStructure ( string $mailbox, array $uids ) : Horde_Mime_Part
$mailbox string The mailbox to fetch the messages from.
$uids array The message UIDs.
return Horde_Mime_Part The message structure parsed into a Horde_Mime_Part instance.

getAuth() public method

Return the id of the user currently authenticated.
public getAuth ( ) : string
return string The id of the user that opened the IMAP connection.

getBackend() public method

If there is no driver set the driver should be constructed within this method.
public getBackend ( ) : mixed
return mixed The backend driver.

getFactory() protected method

Return the factory.
protected getFactory ( ) : Horde_Kolab_Storage_Factory
return Horde_Kolab_Storage_Factory The factory.

getId() public method

Return the unique connection id.
public getId ( ) : string
return string The connection id.

getModifiable() public method

Return a modifiable message object.
public getModifiable ( string $folder, string $obid, array $object ) : Horde_Kolab_Storage_Driver_Modifiable
$folder string The folder to access.
$obid string The backend ID of the object to retrieve from the folder.
$object array The object data.
return Horde_Kolab_Storage_Driver_Modifiable The modifiable message object.

getNamespace() public method

Retrieve the namespace information for this connection.
public getNamespace ( ) : Horde_Kolab_Storage_Folder_Namespace
return Horde_Kolab_Storage_Folder_Namespace The initialized namespace handler.

getParam() public method

Return a parameter setting for this connection.
public getParam ( string $key, mixed $default = null ) : mixed
$key string The parameter key.
$default mixed An optional default value.
return mixed The parameter value.

getParameters() public method

Return the connection parameters.
public getParameters ( ) : array
return array The connection parameters.

getParams() public method

Return all parameter settings for this connection.
public getParams ( ) : array
return array The parameters.

getStamp() public method

Returns a stamp for the current folder status. This stamp can be used to identify changes in the folder data.
public getStamp ( string $folder ) : Horde_Kolab_Storage_Folder_Stamp
$folder string Return the stamp for this folder.
return Horde_Kolab_Storage_Folder_Stamp A stamp indicating the current folder status.

getStampFromToken() public method

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.
public getStampFromToken ( string $folder, string $token, array $ids ) : Horde_Kolab_Storage_Folder_Stamp
$folder string Return the stamp for this folder.
$token string A sync token provided by the IMAP server.
$ids array An array of UIDs that we know about.
return Horde_Kolab_Storage_Folder_Stamp A stamp indicating the current folder status.

hasCatenateSupport() public method

Checks if the backend supports CATENATE.
public hasCatenateSupport ( ) : boolean
return boolean True if the backend supports CATENATE.

setBackend() public method

Set the backend driver.
public setBackend ( mixed $backend ) : null
$backend mixed The driver that should be used.
return null

setParam() public method

Set a parameter setting for this connection.
public setParam ( string $key, mixed $value ) : null
$key string The parameter key.
$value mixed The parameter value.
return null

Property Details

$_namespace protected_oe property

Memory cache for the namespace of this driver.
protected Horde_Kolab_Storage_Folder_Namespace $_namespace
return Horde_Kolab_Storage_Folder_Namespace

$charset protected_oe property

Charset used by this driver.
protected string $charset
return string