-
Notifications
You must be signed in to change notification settings - Fork 56
/
imap-get-quota.xml
176 lines (168 loc) · 5.62 KB
/
imap-get-quota.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 34892f82742329af7e7b4b22be6ad21418fd9768 Maintainer: hirokawa Status: ready -->
<!-- Credits: mumumu -->
<refentry xml:id="function.imap-get-quota" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>imap_get_quota</refname>
<refpurpose>クオータレベルの設定、メールボックス毎の使用状況を取得する</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>array</type><type>false</type></type><methodname>imap_get_quota</methodname>
<methodparam><type>IMAP\Connection</type><parameter>imap</parameter></methodparam>
<methodparam><type>string</type><parameter>quota_root</parameter></methodparam>
</methodsynopsis>
<para>
クオータレベルの設定、メールボックス毎の使用状況を取得します。
</para>
<para>
この関数の非管理者向けバージョンは、
PHP の <function>imap_get_quotaroot</function> 関数を参照ください。
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&imap.imap-parameter.imap;
<varlistentry>
<term><parameter>quota_root</parameter></term>
<listitem>
<para>
<parameter>quota_root</parameter> は、通常
<literal>user.name</literal> という形式にする必要があります。
name は、情報を取得したいメールボックスの名前です。
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
指定したメールボックスの limit と usage をキーとした整数値を配列として返します。
limit の値は、このメールボックスで最大使用可能な大きさを表します。
usage の値は、このメールボックスの現在の使用状況を示します。
失敗した場合に &false; を返します。
</para>
<para>
PHP 4.3 では、この関数は <link xlink:href="&url.rfc;2087">RFC2087</link>
で述べられている機能をより適切に反映するようになっています。
戻り値の配列からは、サポートするリソース
(例:メッセージ、あるいはサブフォルダ)数の制限をなくし、
名前つきリソースを独立した配列のキーとして受信するようにしました。
各キーの値は配列となっており、その中に usage と values
の値が格納されています。
</para>
<para>
過去との互換性を保つため、旧来のアクセス方法も使用可能です。
しかし新しい方法に変更することを推奨します。
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
&imap.changelog.imap-param;
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>imap_get_quota</function> の例</title>
<programlisting role="php">
<![CDATA[
<?php
$mbox = imap_open("{imap.example.org}", "mailadmin", "password", OP_HALFOPEN)
or die("接続できません: " . imap_last_error());
$quota_value = imap_get_quota($mbox, "user.kalowsky");
if (is_array($quota_value)) {
echo "Usage level is: " . $quota_value['usage'];
echo "Limit level is: " . $quota_value['limit'];
}
imap_close($mbox);
?>
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>4.3 以降のバージョンでの <function>imap_get_quota</function> の例</title>
<programlisting role="php">
<![CDATA[
<?php
$mbox = imap_open("{imap.example.org}", "mailadmin", "password", OP_HALFOPEN)
or die("接続できません: " . imap_last_error());
$quota_values = imap_get_quota($mbox, "user.kalowsky");
if (is_array($quota_values)) {
$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 is: " . $message['limit'];
/* ... */
}
imap_close($mbox);
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<para>
この関数は、現在、c-client2000 以降のライブラリを使用しているユーザーのみ使用可能です。
</para>
<para>
指定する <parameter>imap</parameter> は、
メールの管理者としてオープンしたものである必要があります。
そうでない場合は、この関数は失敗します。
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>imap_open</function></member>
<member><function>imap_set_quota</function></member>
<member><function>imap_get_quotaroot</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->