1
0
mirror of https://github.com/php/doc-ru.git synced 2026-03-24 15:52:13 +01:00
Files
Sergey Panteleev 6d43fd64d7 Исправление форматирования
[skip-spellcheck]
[skip-lint]
2022-12-27 03:42:36 +03:00

126 lines
3.4 KiB
XML
Raw Permalink 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: a7d00d0b9169ac0ca5e35dbed32ee288f4614586 Maintainer: tmn Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="filesystemiterator.setflags" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>FilesystemIterator::setFlags</refname>
<refpurpose>Задание флагов обработки</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="FilesystemIterator">
<modifier>public</modifier> <type>void</type><methodname>FilesystemIterator::setFlags</methodname>
<methodparam><type>int</type><parameter>flags</parameter></methodparam>
</methodsynopsis>
<para>
Задаёт настройки итератора.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>flags</parameter></term>
<listitem>
<para>
Флаги, которые необходимо установить. Смотрите
<link linkend="filesystemiterator.constants">Константы FilesystemIterator</link>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Пример использования <methodname>FilesystemIterator::key</methodname></title>
<para>
Пример демонстрирует различия между флагами
<link linkend="filesystemiterator.constants.key-as-pathname">FilesystemIterator::KEY_AS_PATHNAME</link> и
<link linkend="filesystemiterator.constants.key-as-filename">FilesystemIterator::KEY_AS_FILENAME</link>.
</para>
<programlisting role="php">
<![CDATA[
<?php
$iterator = new FilesystemIterator(dirname(__FILE__), FilesystemIterator::KEY_AS_PATHNAME);
echo "Ключом является путь к файлу:\n";
foreach ($iterator as $key => $fileinfo) {
echo $key . "\n";
}
$iterator->setFlags(FilesystemIterator::KEY_AS_FILENAME);
echo "\nКлючом является имя файла:\n";
foreach ($iterator as $key => $fileinfo) {
echo $key . "\n";
}
?>
]]>
</programlisting>
&example.outputs.82.similar;
<screen>
<![CDATA[
Ключом является путь к файлу:
/www/examples/.
/www/examples/..
/www/examples/apple.jpg
/www/examples/banana.jpg
/www/examples/example.php
Ключом является имя файла:
.
..
apple.jpg
banana.jpg
example.php
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><methodname>FilesystemIterator::__construct</methodname></member>
<member><methodname>FilesystemIterator::getFlags</methodname></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
-->