CakeFest 2024: The Official CakePHP Conference

imap_get_quotaroot

(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)

imap_get_quotarootKullanıcının kendi kota ayarlarını döndürür

Açıklama

imap_get_quotaroot(IMAP\Connection $imap, string $pk): array|false

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.

Bağımsız Değişkenler

imap

IMAP\Connection nesnesi.

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.

Sürüm Bilgisi

Sürüm: Açıklama
8.1.0 imap bağımsız değişkeni artık IMAP\Connection nesnesi kabul ediyor, evvelce resource türünde geçerli bir imap değeri kabul ederdi.

Ö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['STORAGE'];
echo
"Kullanılmış saklama alanı: " . $storage['usage'];
echo
"Saklama alanının azami boyutu: " . $storage['limit'];

$message = $quota['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

add a note

User Contributed Notes 3 notes

up
5
thomas dot hebinck at digionline dot de
20 years ago
['STORAGE']['usage'] and ['STORAGE']['limit'] are values in KB (1024 Bytes)
up
2
uphonesimon at gmail dot com
18 years ago
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
up
-4
rodrigo dot tsuru at tsuru dot net
19 years ago
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);
?>
To Top