PHP
downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

imap_getacl> <imap_get_quota
Last updated: Fri, 30 Jan 2009

view this page in

imap_get_quotaroot

(PHP 4 >= 4.3.0, PHP 5)

imap_get_quotarootユーザ単位のクォータ設定を取得する

説明

array imap_get_quotaroot ( resource $imap_stream , string $quota_root )

ユーザ単位のクォータ設定を取得します。 limit の値は、このユーザがメールボックスで使用可能な総容量を表します。 usage の値は、ユーザが現在メールボックスで使用している容量を表します。

パラメータ

imap_stream

imap_open() が返す IMAP ストリーム。

quota_root

quota_root はどのメールボックスを調べるかを 指定します(例: INBOX)。

返り値

指定したユーザのメールボックスに関連する整数値を配列で返します。 すべての値にはリソース名に基づいたキーがつけられており、 usage および limit 値を保持する配列が関連付けられています。

コールが失敗した場合、およびサーバからの応答内容をパースできなかった場合には この関数は FALSE を返します。

例1 imap_get_quotaroot() の例

<?php
$mbox 
imap_open("{imap.example.org}""kalowsky""password"OP_HALFOPEN)
      or die(
"接続できません: " imap_last_error());

$quota imap_get_quotaroot($mbox"INBOX");
if (
is_array($quota)) {
   
$storage $quota_values['STORAGE'];
   echo 
"STORAGE usage level is: " .  $storage['usage'];
   echo 
"STORAGE limit level is: " .  $storage['limit'];

   
$message $quota_values['MESSAGE'];
   echo 
"MESSAGE usage level is: " .  $message['usage'];
   echo 
"MESSAGE limit level is: " .  $message['limit'];

   
/* ...  */

}

imap_close($mbox);
?>

注意

この関数は、現在は c-client2000 以降のライブラリを使用しているユーザのみ利用可能です。

imap_stream は、 調べたいメールボックスを所有するユーザがオープンしなければなりません。

参考

  • imap_open() - メールボックスへの IMAP ストリームをオープンする
  • imap_set_quota() - 指定したメールボックスにクォータを設定する
  • imap_get_quota() - クオータレベルの設定、メールボックス毎の使用状況を取得する



imap_getacl> <imap_get_quota
Last updated: Fri, 30 Jan 2009
 
add a note add a note User Contributed Notes
imap_get_quotaroot
uphonesimon at gmail dot com
22-Sep-2005 02:37
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
rodrigo dot tsuru at tsuru dot net
15-Sep-2004 09:07
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);
?>
thomas dot hebinck at digionline dot de
30-Aug-2003 05:55
['STORAGE']['usage'] and ['STORAGE']['limit'] are values in KB (1024 Bytes)

imap_getacl> <imap_get_quota
Last updated: Fri, 30 Jan 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites