Added in a bit of documentation for the imap_get_quota and imap_set_quota functions. Please review, revise, and comment on.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@42279 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Dan Kalowsky 2001-02-28 01:01:42 +00:00
parent 4a138a69d6
commit 165f4ef9c6

View file

@ -1046,6 +1046,63 @@ imap_close($mbox);
</refsect1>
</refentry>
<refentry id="function.imap-get-quota">
<refnamediv>
<refname>imap_get_quota</refname>
<refpurpose>
Retrieve the quota level settings, and usage statics per mailbox
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>array <function>imap_get_quota</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>string <parameter>quota_root</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<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>
This function is currently only available to users of the c-client2000
library.
</para>
<para>
<parameter>imap_stream</parameter> should be the value returned from
an <function>imap_status</function> call. This stream is required to
be opened as the mail admin user for the quota function to work.
<parameter>quota_root</parameter> should normally be in the form of
user.name where name is the mailbox you wish to retrieve information
about.
</para>
<para>
<example>
<title><function>imap_get_quota</function> example</title>
<programlisting role="php">
$mbox = imap_open("{your.imap.host}","mailadmin","password",OP_HALFOPEN)
|| die("can't connect: ".imap_last_error());
$quota_value = imap_get_quota($mbox, "user.kalowsky");
if(is_array($quota_value)) {
print "Usage level is: " . $quota_value['usage'];
print "Limit level is: " . $quota_value['limit'];
}
imap_close($mbox);
</programlisting>
</example>
</para>
<para>
See also <function>imap_open</function>, <function>imap_set_quota</function>.
</para>
</refsect1>
</refentry>
<refentry id="function.imap-listsubscribed">
<refnamediv>
<refname>imap_listsubscribed</refname>
@ -1455,6 +1512,64 @@ imap_close($mbox);
</refsect1>
</refentry>
<refentry id="function.imap-set-quota">
<refnamediv>
<refname>imap_set_quota</refname>
<refpurpose>Sets a quota for a given mailbox</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>imap_set_quota</function></funcdef>
<paramdef>int <parameter>imap_stream</parameter></paramdef>
<paramdef>string <parameter>quota_root</parameter></paramdef>
<paramdef>int <parameter>quota_limit</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
Sets an upper limit quota on a per mailbox basis. This function
requires the <parameter>imap_stream</parameter> to have been opened
as the mail administrator account. It will not work if opened as
any other user.
</para>
<para>
This function is currently only available to users of the c-client2000
library.
</para>
<para>
<parameter>imap_stream</parameter> is the stream pointer returned from
a <function>imap_open</function> call. This stream must be opened as
the mail administrator, other wise this function will fail.
<parameter>quota_root</parameter> is the mailbox to have a quota set. This
should follow the IMAP standard format for a mailbox, 'user.name'.
<parameter>quota_limit</parameter> is the maximum size (in KB) for
the <parameter>quota_root</parameter>.
</para>
<para>
Returns true on success and false on error.
</para>
<para>
<example>
<title><function>imap_set_quota</function> example</title>
<programlisting role="php">
$mbox = imap_open ("{your.imap.host:143}", "mailadmin", "password");
if(!imap_set_quota($mbox, "user.kalowsky", 3000)) {
print "Error in setting quota\n";
return;
}
imap_close($mbox);
</programlisting>
</example>
</para>
<para>
See also <function>imap_open</function>, <function>imap_set_quota</function>.
</para>
</refsect1>
</refentry>
<refentry id="function.imap-subscribe">
<refnamediv>
<refname>imap_subscribe</refname>