1
0
mirror of https://github.com/php/doc-fr.git synced 2026-03-24 07:02:06 +01:00
Files
2022-12-25 22:29:13 +00:00

126 lines
3.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: a7d00d0b9169ac0ca5e35dbed32ee288f4614586 Maintainer: dams Status: ready -->
<!-- Reviewed: yes -->
<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>Configure les options</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>
Configure les options.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>flags</parameter></term>
<listitem>
<para>
Les options à configurer.
Voir la liste des <link linkend="filesystemiterator.constants">constantes de <classname>FilesystemIterator</classname></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>Exemple avec <methodname>FilesystemIterator::key</methodname></title>
<para>
Cet exemple illustre la différence entre les options
<link linkend="filesystemiterator.constants.key-as-pathname">FilesystemIterator::KEY_AS_PATHNAME</link> et
<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 "Clé comme nom de chemin : \n";
foreach ($iterator as $key => $fileinfo) {
echo $key . "\n";
}
$iterator->setFlags(FilesystemIterator::KEY_AS_FILENAME);
echo "\nClé comme nom de fichier : \n";
foreach ($iterator as $key => $fileinfo) {
echo $key . "\n";
}
?>
]]>
</programlisting>
&example.outputs.82.similar;
<screen>
<![CDATA[
Clé comme nom de chemin :
/www/examples/.
/www/examples/..
/www/examples/apple.jpg
/www/examples/banana.jpg
/www/examples/example.php
Clé comme nom de fichier :
.
..
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
-->