just to make a note for all the people that are wondering the differences between $quota['STORAGE'] and $quot['MESSAGE']
the $quot['STORAGE'] is the size of the mailbox in KB
but $quota['MESSAGE'] is actually the number of messages stored in the mailbox and the up limit of the total messages allowed
imap_get_quotaroot
(PHP 4 >= 4.3.0, PHP 5)
imap_get_quotaroot — Kullanıcının kendi kota ayarlarını döndürür
Açıklama
$imap_akımı
, string $pk
)Kullanıcının kota ayarlarını döndürür. 'limit' değeri kullanıcının posta kutusu için izin verilen azami toplam kullanım alanını gösterir. 'usage' değeri ise kullanıcının o anki toplam posta kutusu kullanımını gösterir.
Değiştirgeler
-
imap_akımı -
imap_open() işlevinden dönen bir IMAP akımı.
-
pk -
Normalde posta kutusunun ismidir (örneğin, INBOX).
Dönen Değerler
Belirtilen posta kutusunun kapasitesi ile ilgili bilgileri bir ilişkisel dizi içinde döndürür. Tüm değerler bir özkaynağın adını anahtar olarak alan birer dizidir ve bu alt diziler 'usage' ve 'limit' indisli değerler içerir.
Bir hata durumunda FALSE, sunucudan alınan yanıt çözümlenemezse bağlantı
hakkında bilgi içeren bir dizi döner.
Örnekler
Örnek 1 - imap_get_quotaroot() örneği
<?php
$mbox = imap_open("{imap.example.org}", "kalowsky", "password", OP_HALFOPEN)
or die("bağlanılamadı: " . imap_last_error());
$quota = imap_get_quotaroot($mbox, "INBOX");
if (is_array($quota)) {
$storage = $quota_values['STORAGE'];
echo "Kullanılmış saklama alanı: " . $storage['usage'];
echo "Saklama alanının azami boyutu: " . $storage['limit'];
$message = $quota_values['MESSAGE'];
echo "İletinin uzunluğu: " . $message['usage'];
echo "İleti için azami uzunluk: " . $message['limit'];
/* ... */
}
imap_close($mbox);
?>
Notlar
Bu işlev sadece c-client2000 ve üstü kütüphane sürümleriyle kullanılabilir.
imap_akımı posta kutusu kotasına bakılacak kullanıcı
için açılmış olmalıdır.
Ayrıca Bakınız
- imap_open() - Belirtilen posta kutusuna yeni bir IMAP akımı açar
- imap_set_quota() - Belirtilen posta kutusu için bir kota tanımlar
- imap_get_quota() - Belirtilen kullanıcının kota ayarlarını döndürür
The example above isn't right. Replace with this:
<?php
$mbox = imap_open("{your.imap.host}", "kalowsky", "password", OP_HALFOPEN)
or die("can't connect: " . imap_last_error());
$quota = imap_get_quotaroot($mbox, "INBOX");
if (is_array($quota)) {
$storage = $quota['STORAGE'];
echo "STORAGE usage level is: " . $storage['usage'];
echo "STORAGE limit level is: " . $storage['limit'];
$message = $quota['MESSAGE'];
echo "MESSAGE usage level is: " . $message['usage'];
echo "MESSAGE usage level is: " . $message['limit'];
/* ... */
}
imap_close($mbox);
?>
['STORAGE']['usage'] and ['STORAGE']['limit'] are values in KB (1024 Bytes)
