Mail_IMAP::getQuota()

bool|array getQuota([str $folder = NULL [, bool $rtn = TRUE]])

Retrieves quota information for the current mailbox using imap_get_quotaroot.

The $folder argument specified which folder on the server Mail_IMAP::getQuota should retrieve a quota from. If the $folder argument is empty, Mail_IMAP::getQuota looks in the $mailboxInfo property for a 'folder' indice. This indice is set automatically if you passed a URI syntax to Mail_IMAP::Mail_IMAP or to Mail_IMAP::connect. If neither the $folder argument or $mailboxInfo['folder'] property have a value, the folder defaults to 'INBOX'.

If the $rtn argument is set to FALSE, the quota information is merged into the $mailboxInfo property, otherwise Mail_IMAP::getQuota returns a multidimensional array of quota information.

Warning: Not all mail servers support quota retrieval.

Quotas are returned in the simpliest form of measurment with the unit of measurement appended, this is done by passing the quota values to Mail_IMAP::convertBytes. The quota is split into two aspects of Quota usage, STORAGE and MESSAGE. The STORAGE is itself split into two classifications, usage and limit, the storage array is structured as $quota['STORAGE']['usage'] and $quota['STORAGE']['limit'] respectively. Likewise the MESSAGE quota is structured similarly as $quota['MESSAGE']['usage'] and $quota['MESSAGE']['limit'].

Method summary:

param str $folder (optional) See above.
param bool $rtn (optional) See above.
return bool|array
throws ErrorStack: Quota not available for this server. The server does not support quota retrieval.
access public
see imap_get_quotaroot
Execution time: 0.07 seconds