php-doc-en/reference/imap/functions/imap-getmailboxes.xml
Markus Fischer 2d23ddfe59 - Sync most protos with current source.
- Move alised documented to their real function name and document what an
  alias is.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@99005 c90b9560-bf6c-de11-be94-00142212c4b1
2002-10-09 14:55:05 +00:00

128 lines
4.2 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- 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>
LATT_NOINFERIORS - This mailbox has no "children" (there are
no mailboxes below this one).
</simpara>
</listitem>
<listitem>
<simpara>
LATT_NOSELECT - This is only a container, not a mailbox - you
cannot open it.
</simpara>
</listitem>
<listitem>
<simpara>
LATT_MARKED - This mailbox is marked. Only used by UW-IMAPD.
</simpara>
</listitem>
<listitem>
<simpara>
LATT_UNMARKED - 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[
$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))
{
print "($key) ";
print imap_utf7_decode($val->name).",";
print "'".$val->delimiter."',";
print $val->attributes."<br>\n";
}
} else
print "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
-->