Files
php-doc-ru/reference/imap/functions/imap-getmailboxes.xml
Alexey Pyltsyn 500b85ee44 IMAP: review
git-svn-id: https://svn.php.net/repository/phpdoc/ru/trunk@344677 c90b9560-bf6c-de11-be94-00142212c4b1
2018-04-16 09:08:34 +00:00

147 lines
5.2 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: d790375863dca4df7aa449786bb110c9cd80abdf Maintainer: rjhdby Status: ready -->
<!-- $Revision$ -->
<!-- Reviewed: yes Maintainer: lex -->
<refentry xml:id="function.imap-getmailboxes" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>imap_getmailboxes</refname>
<refpurpose>Прочитать список почтовых ящиков, возвращая подробную информацию по каждому из них</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<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>
Получает информацию о почтовых ящиков.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&imap.imap-stream.description;
<varlistentry>
<term><parameter>ref</parameter></term>
<listitem>
<para>
<parameter>ref</parameter> обычно должен быть только специфицикацией сервера, как описано в <function>imap_open</function>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>pattern</parameter></term>
<listitem>
&imap.pattern;
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Возвращает массив объектов, содержащих информацию о ящиках.
Каждый объект имеет свойства: <parameter>name</parameter>, содержащее
полное имя ящика; <parameter>delimiter</parameter>,
содержащее разделитель для той части иерархии, в которой
содержится ящик; и <parameter>attributes</parameter>.
Параметр <parameter>Attributes</parameter> является битовой маской,
следующих допустимых констант:
<itemizedlist>
<listitem>
<para>
<constant>LATT_NOINFERIORS</constant> - этот ящик не имеет и не может иметь
потомков (содержать вложенные ящики). Вызов функции
<function>imap_createmailbox</function> не будет работать для этого ящика.
</para>
</listitem>
<listitem>
<para>
<constant>LATT_NOSELECT</constant> - это только контейнер, а не почтовый ящик.
Вы не можете его открыть.
</para>
</listitem>
<listitem>
<para>
<constant>LATT_MARKED</constant> - Этот ящик помечен. Означает, что в нем могут
быть новые письма, появившиеся с момента последней проверки. Работает не со всеми
серверами IMAP.
</para>
</listitem>
<listitem>
<para>
<constant>LATT_UNMARKED</constant> - Этот ящик не помечен, т.е. в нем нет
новых писем. Если один из флагов <constant>MARKED</constant> или
<constant>UNMARKED</constant> выставлен - можете считать, что сервер поддержимвает
этот функционал.
</para>
</listitem>
</itemizedlist>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Пример использования <function>imap_getmailboxes</function></title>
<programlisting role="php">
<![CDATA[
<?php
$mbox = imap_open("{imap.example.org}", "username", "password", OP_HALFOPEN)
or die("не удалось подключиться: " . imap_last_error());
$list = imap_getmailboxes($mbox, "{imap.example.org}", "*");
if (is_array($list)) {
foreach ($list as $key => $val) {
echo "($key) ";
echo imap_utf7_decode($val->name) . ",";
echo "'" . $val->delimiter . "',";
echo $val->attributes . "<br />\n";
}
} else {
echo "вызов imap_getmailboxes завершился с ошибкой: " . imap_last_error() . "\n";
}
imap_close($mbox);
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>imap_getsubscribed</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
-->