PHP Class IMP_Imap, horde

Author: Michael Slusarz ([email protected])
Inheritance: implements Serializable
Show file Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_backends array Cached backend configuration.
$_changed boolean Has this object changed?
$_config IMP_Imap_Config Backend config.
$_id string Object identifier.
$_ob Horde_Imap_Client_Base The IMAP client object.
$_temp array Temporary data cache (destroyed at end of request).

Public Methods

Method Description
__call ( string $method, array $params ) : mixed All other calls to this class are routed to the underlying Horde_Imap_Client_Base object.
__construct ( string $id ) Constructor.
__get ( $key )
__toString ( )
access ( integer $right ) : boolean Checks access rights for a server.
accessCompose ( integer $right, integer $data ) : boolean Checks compose access rights for a server.
createBaseImapObject ( string $username, string $password, string $skey ) : Horde_Imap_Client_Base Create the base Horde_Imap_Client object (from an entry in backends.php).
createImapObject ( array $config, boolean $imap = true ) : Horde_Imap_Client_Base Create a Horde_Imap_Client object.
doPostLoginTasks ( ) Perform post-login tasks.
getCacheId ( string $mailbox, array $addl = [] ) : string Return the cache ID for this mailbox.
getNamespace ( string $mailbox, boolean $personal = false ) : mixed Get namespace info for a full mailbox path.
getSlices ( string $mbox, Horde_Imap_Client_Ids $ids, integer $size = 5242880 ) : array Returns a list of messages, split into slices based on the total message size.
isImap ( ) : boolean Determine if this is a connection to an IMAP server.
isPop3 ( ) : boolean Determine if this is a connection to an IMAP server.
loadServerConfig ( string $server = null ) : mixed Loads the IMP server configuration from backends.php.
parseCacheId ( string $id ) : array Parses the cache ID for this mailbox.
serialize ( )
unserialize ( $data )
updateFetchIgnore ( ) Update the list of mailboxes to ignore when caching FETCH data in the IMAP client object.

Protected Methods

Method Description
_copy ( ) Handle copy() calls that hit multiple servers.
_getPerm ( string $perm ) : string Get the full permission name for a permission.
_renameMailbox ( ) Handle copy() calls. This call may hit multiple servers, so need to handle separately from other IMAP calls.
_search ( string $mailbox, Horde_Imap_Client_Search_Query $query = null, array $opts = [] ) : array Prepares an IMAP search query. Needed because certain configuration parameters may need to be dynamically altered before passed to the Imap_Client object.
_status ( $args ) Handle status() calls. This call may hit multiple servers.

Method Details

__call() public method

All other calls to this class are routed to the underlying Horde_Imap_Client_Base object.
public __call ( string $method, array $params ) : mixed
$method string Method name.
$params array Method parameters.
return mixed The return from the requested method.

__construct() public method

Constructor.
public __construct ( string $id )
$id string Object identifier.

__get() public method

public __get ( $key )

__toString() public method

public __toString ( )

_copy() protected method

Handle copy() calls that hit multiple servers.
protected _copy ( )

_getPerm() protected method

Get the full permission name for a permission.
protected _getPerm ( string $perm ) : string
$perm string The permission.
return string The full (backend-specific) permission name.

_renameMailbox() protected method

Handle copy() calls. This call may hit multiple servers, so need to handle separately from other IMAP calls.
protected _renameMailbox ( )

_status() protected method

Handle status() calls. This call may hit multiple servers.
protected _status ( $args )

access() public method

Checks access rights for a server.
public access ( integer $right ) : boolean
$right integer Access right.
return boolean Does the access right exist?

accessCompose() public method

Checks compose access rights for a server.
public accessCompose ( integer $right, integer $data ) : boolean
$right integer Access right.
$data integer Data required to check the rights: - ACCESS_COMPOSE_BODYSIZE The size of the body data. - ACCESS_COMPOSE_RECIPIENTS - ACCESS_COMPOSE_TIMELIMIT The number of e-mail recipients.
return boolean Is the access allowed?

createBaseImapObject() public method

Create the base Horde_Imap_Client object (from an entry in backends.php).
public createBaseImapObject ( string $username, string $password, string $skey ) : Horde_Imap_Client_Base
$username string The username to authenticate with.
$password string The password to authenticate with.
$skey string Create a new object using this server key.
return Horde_Imap_Client_Base Client object.

createImapObject() public method

Create a Horde_Imap_Client object.
public createImapObject ( array $config, boolean $imap = true ) : Horde_Imap_Client_Base
$config array The IMAP configuration.
$imap boolean True if IMAP connection, false if POP3.
return Horde_Imap_Client_Base Client object.

doPostLoginTasks() public method

Perform post-login tasks.
public doPostLoginTasks ( )

getCacheId() public method

Return the cache ID for this mailbox.
public getCacheId ( string $mailbox, array $addl = [] ) : string
$mailbox string The mailbox name (UTF-8).
$addl array Local IMP metadata to add to the cache ID.
return string The cache ID.

getNamespace() public method

Get namespace info for a full mailbox path.
public getNamespace ( string $mailbox, boolean $personal = false ) : mixed
$mailbox string The mailbox path. (self:NS_DEFAULT will return the default personal namespace.)
$personal boolean If true, will return empty namespace only if it is a personal namespace.
return mixed The namespace info for the mailbox path or null if the path doesn't exist.

getSlices() public method

Returns a list of messages, split into slices based on the total message size.
public getSlices ( string $mbox, Horde_Imap_Client_Ids $ids, integer $size = 5242880 ) : array
$mbox string IMAP mailbox.
$ids Horde_Imap_Client_Ids ID list.
$size integer Maximum size of a slice.
return array An array of Horde_Imap_Client_Ids objects.

isImap() public method

Determine if this is a connection to an IMAP server.
public isImap ( ) : boolean
return boolean True if connected to IMAP server.

isPop3() public method

Determine if this is a connection to an IMAP server.
public isPop3 ( ) : boolean
return boolean True if connected to IMAP server.

loadServerConfig() public static method

Loads the IMP server configuration from backends.php.
public static loadServerConfig ( string $server = null ) : mixed
$server string Returns this labeled entry only.
return mixed If $server is set return this entry; else, return the entire servers array. Returns false on error.

parseCacheId() public method

Parses the cache ID for this mailbox.
public parseCacheId ( string $id ) : array
$id string Cache ID generated by getCacheId().
return array Two element array: - date: (integer) Date information (day of year), if embedded in cache ID. - token: (string) Mailbox sync token.

serialize() public method

public serialize ( )

unserialize() public method

public unserialize ( $data )

updateFetchIgnore() public method

Update the list of mailboxes to ignore when caching FETCH data in the IMAP client object.
public updateFetchIgnore ( )

Property Details

$_backends protected static property

Cached backend configuration.
protected static array $_backends
return array

$_changed protected property

Has this object changed?
protected bool $_changed
return boolean

$_config protected property

Backend config.
protected IMP_Imap_Config $_config
return IMP_Imap_Config

$_id protected property

Object identifier.
protected string $_id
return string

$_ob protected property

The IMAP client object.
protected Horde_Imap_Client_Base $_ob
return Horde_Imap_Client_Base

$_temp protected property

Temporary data cache (destroyed at end of request).
protected array $_temp
return array