2010-03-28 22:10:10 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 07:47:57 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-06-20 22:25:43 +00:00
|
|
|
<refentry xml:id="function.imap-get-quota" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
2007-01-14 15:37:21 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>imap_get_quota</refname>
|
|
|
|
<refpurpose>Retrieve the quota level settings, and usage statics per mailbox</refpurpose>
|
|
|
|
</refnamediv>
|
2007-01-15 00:05:59 +00:00
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2007-01-14 15:37:21 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>array</type><methodname>imap_get_quota</methodname>
|
|
|
|
<methodparam><type>resource</type><parameter>imap_stream</parameter></methodparam>
|
|
|
|
<methodparam><type>string</type><parameter>quota_root</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
2007-01-15 00:05:59 +00:00
|
|
|
<para>
|
|
|
|
Retrieve the quota level settings, and usage statics per mailbox.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
For a non-admin user version of this function,
|
|
|
|
please see the <function>imap_get_quotaroot</function> function of PHP.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
&imap.imap-stream.description;
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>quota_root</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
<parameter>quota_root</parameter> should normally be in the form of
|
|
|
|
<literal>user.name</literal> where name is the mailbox you wish to
|
|
|
|
retrieve information about.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
2007-01-14 15:37:21 +00:00
|
|
|
<para>
|
|
|
|
Returns an array with integer values limit and usage for the given
|
|
|
|
mailbox. The value of limit represents the total amount of space
|
|
|
|
allowed for this mailbox. The usage value represents the mailboxes
|
|
|
|
current level of capacity. Will return &false; in the case of failure.
|
|
|
|
</para>
|
|
|
|
<para>
|
2007-01-15 00:05:59 +00:00
|
|
|
As of PHP 4.3, the function more properly reflects the
|
2007-06-20 22:25:43 +00:00
|
|
|
functionality as dictated by the <link xlink:href="&url.rfc;2087">RFC2087</link>.
|
2007-01-15 00:05:59 +00:00
|
|
|
The array return value has changed to support an unlimited number of returned
|
|
|
|
resources (i.e. messages, or sub-folders) with each named resource receiving
|
|
|
|
an individual array key. Each key value then contains an another array with
|
|
|
|
the usage and limit values within it.
|
2007-01-14 15:37:21 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
2007-01-15 00:05:59 +00:00
|
|
|
For backwards compatibility reasons, the original access methods are
|
|
|
|
still available for use, although it is suggested to update.
|
2007-01-14 15:37:21 +00:00
|
|
|
</para>
|
2007-01-15 00:05:59 +00:00
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
2007-01-14 15:37:21 +00:00
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title><function>imap_get_quota</function> example</title>
|
|
|
|
<programlisting role="php">
|
2002-04-15 00:12:54 +00:00
|
|
|
<![CDATA[
|
2003-07-16 17:25:02 +00:00
|
|
|
<?php
|
2006-01-23 01:48:07 +00:00
|
|
|
$mbox = imap_open("{imap.example.org}", "mailadmin", "password", OP_HALFOPEN)
|
2003-12-15 16:55:22 +00:00
|
|
|
or die("can't connect: " . imap_last_error());
|
2007-01-14 15:37:21 +00:00
|
|
|
|
2002-04-15 00:12:54 +00:00
|
|
|
$quota_value = imap_get_quota($mbox, "user.kalowsky");
|
2003-12-15 16:55:22 +00:00
|
|
|
if (is_array($quota_value)) {
|
|
|
|
echo "Usage level is: " . $quota_value['usage'];
|
|
|
|
echo "Limit level is: " . $quota_value['limit'];
|
2007-01-14 15:37:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
imap_close($mbox);
|
2003-07-16 17:25:02 +00:00
|
|
|
?>
|
2002-04-15 00:12:54 +00:00
|
|
|
]]>
|
2007-01-14 15:37:21 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<example>
|
2007-01-15 00:05:59 +00:00
|
|
|
<title><function>imap_get_quota</function> 4.3 or greater example</title>
|
2007-01-14 15:37:21 +00:00
|
|
|
<programlisting role="php">
|
2002-07-29 18:06:17 +00:00
|
|
|
<![CDATA[
|
2003-07-16 17:25:02 +00:00
|
|
|
<?php
|
2006-01-23 01:48:07 +00:00
|
|
|
$mbox = imap_open("{imap.example.org}", "mailadmin", "password", OP_HALFOPEN)
|
2003-12-18 17:46:56 +00:00
|
|
|
or die("can't connect: " . imap_last_error());
|
2007-01-14 15:37:21 +00:00
|
|
|
|
2002-07-29 18:06:17 +00:00
|
|
|
$quota_values = imap_get_quota($mbox, "user.kalowsky");
|
2003-12-15 16:55:22 +00:00
|
|
|
if (is_array($quota_values)) {
|
2002-07-29 18:06:17 +00:00
|
|
|
$storage = $quota_values['STORAGE'];
|
2003-12-15 16:55:22 +00:00
|
|
|
echo "STORAGE usage level is: " . $storage['usage'];
|
|
|
|
echo "STORAGE limit level is: " . $storage['limit'];
|
2002-07-29 18:06:17 +00:00
|
|
|
|
2007-01-14 15:37:21 +00:00
|
|
|
$message = $quota_values['MESSAGE'];
|
2003-12-15 16:55:22 +00:00
|
|
|
echo "MESSAGE usage level is: " . $message['usage'];
|
|
|
|
echo "MESSAGE limit is: " . $message['limit'];
|
2002-07-29 18:06:17 +00:00
|
|
|
|
2007-01-14 15:37:21 +00:00
|
|
|
/* ... */
|
|
|
|
}
|
2002-07-29 18:06:17 +00:00
|
|
|
|
2007-01-14 15:37:21 +00:00
|
|
|
imap_close($mbox);
|
2003-07-16 17:25:02 +00:00
|
|
|
?>
|
2002-07-29 18:06:17 +00:00
|
|
|
]]>
|
2007-01-14 15:37:21 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
2007-01-15 00:05:59 +00:00
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
|
|
&reftitle.notes;
|
|
|
|
<para>
|
|
|
|
This function is currently only available to users of the c-client2000
|
|
|
|
or greater library.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
The given <parameter>imap_stream</parameter> must be opened as the mail
|
2009-01-01 19:42:10 +00:00
|
|
|
administrator, otherwise this function will fail.
|
2007-01-15 00:05:59 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
2007-01-14 15:37:21 +00:00
|
|
|
<para>
|
2007-01-15 00:05:59 +00:00
|
|
|
<simplelist>
|
|
|
|
<member><function>imap_open</function></member>
|
|
|
|
<member><function>imap_set_quota</function></member>
|
|
|
|
<member><function>imap_get_quotaroot</function></member>
|
|
|
|
</simplelist>
|
2007-01-14 15:37:21 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
2002-04-15 00:12:54 +00:00
|
|
|
|
|
|
|
<!-- 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
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2002-04-15 00:12:54 +00:00
|
|
|
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
|
|
|
|
-->
|