php-doc-en/reference/imap/functions/imap-getmailboxes.xml
Mehdi Achour 3a2da7cbd8 Fill in the blanks in constants.xml
CS
Replaced <programlisting> ... with <listitem>
Added constant/parameter tags
Added See Also parts
Used &return.success;
Added some para to make the whole thing more easy to read
Removed redundancy


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@153120 c90b9560-bf6c-de11-be94-00142212c4b1
2004-03-08 09:18:45 +00:00

131 lines
4.3 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/imap.xml, last change in rev 1.2 -->
<refentry id="function.imap-getmailboxes">
<refnamediv>
<refname>imap_getmailboxes</refname>
<refpurpose>
Read the list of mailboxes, returning detailed information on
each one
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>imap_getmailboxes</methodname>
<methodparam><type>resource</type><parameter>imap_stream</parameter></methodparam>
<methodparam><type>string</type><parameter>ref</parameter></methodparam>
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
</methodsynopsis>
<para>
Returns an array of objects containing mailbox information. Each
object has the attributes <parameter>name</parameter>, specifying
the full name of the mailbox; <parameter>delimiter</parameter>,
which is the hierarchy delimiter for the part of the hierarchy
this mailbox is in; and
<parameter>attributes</parameter>. <parameter>Attributes</parameter>
is a bitmask that can be tested against:
<itemizedlist>
<listitem>
<simpara>
<constant>LATT_NOINFERIORS</constant> - This mailbox has no
"children" (there are no mailboxes below this one).
</simpara>
</listitem>
<listitem>
<simpara>
<constant>LATT_NOSELECT</constant> - This is only a container,
not a mailbox - you cannot open it.
</simpara>
</listitem>
<listitem>
<simpara>
<constant>LATT_MARKED</constant> - This mailbox is marked.
Only used by UW-IMAPD.
</simpara>
</listitem>
<listitem>
<simpara>
<constant>LATT_UNMARKED</constant> - This mailbox is not marked.
Only used by UW-IMAPD.
</simpara>
</listitem>
</itemizedlist>
</para>
<para>
Mailbox names containing international Characters outside the
printable ASCII range will be encoded and may be decoded by
<function>imap_utf7_decode</function>.
</para>
<para>
<parameter>ref</parameter> should normally be just the server
specification as described in <function>imap_open</function>, and
<parameter>pattern</parameter> specifies where in the mailbox
hierarchy to start searching. If you want all mailboxes, pass
'*' for <parameter>pattern</parameter>.
</para>
<para>
There are two special characters you can pass as part of the
<parameter>pattern</parameter>: '*' and '%'. '*' means to return
all mailboxes. If you pass <parameter>pattern</parameter> as '*',
you will get a list of the entire mailbox hierarchy. '%' means to
return the current level only. '%' as the
<parameter>pattern</parameter> parameter will return only the top
level mailboxes; '~/mail/%' on UW_IMAPD will return every mailbox
in the ~/mail directory, but none in subfolders of that
directory.
</para>
<para>
<example>
<title><function>imap_getmailboxes</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$mbox = imap_open("{your.imap.host}", "username", "password", OP_HALFOPEN)
or die("can't connect: " . imap_last_error());
$list = imap_getmailboxes($mbox, "{your.imap.host}", "*");
if (is_array($list)) {
reset($list);
while (list($key, $val) = each($list)) {
echo "($key) ";
echo imap_utf7_decode($val->name) . ",";
echo "'" . $val->delimiter . "',";
echo $val->attributes . "<br />\n";
}
} else {
echo "imap_getmailboxes failed: " . imap_last_error() . "\n";
}
imap_close($mbox);
?>
]]>
</programlisting>
</example>
</para>
<para>
See also <function>imap_getsubscribed</function>.
</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:"../../../../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
-->