mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Padded out SPL FilesystemIterator skeleton docs
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@282867 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
8e2d30a3bd
commit
899cc40f7d
8 changed files with 370 additions and 39 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
|
||||
<phpdoc:classref xml:id="class.filesystemiterator" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
|
@ -48,6 +48,68 @@
|
|||
</oointerface>
|
||||
</classsynopsisinfo>
|
||||
<!-- }}} -->
|
||||
|
||||
<classsynopsisinfo role="comment">Constants</classsynopsisinfo>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="filesystemiterator.constants.current-as-pathname">FilesystemIterator::CURRENT_AS_PATHNAME</varname>
|
||||
<initializer>32</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="filesystemiterator.constants.current-as-fileinfo">FilesystemIterator::CURRENT_AS_FILEINFO</varname>
|
||||
<initializer>0</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="filesystemiterator.constants.current-as-self">FilesystemIterator::CURRENT_AS_SELF</varname>
|
||||
<initializer>16</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="filesystemiterator.constants.current-mode-mask">FilesystemIterator::CURRENT_MODE_MASK</varname>
|
||||
<initializer>240</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="filesystemiterator.constants.key-as-pathname">FilesystemIterator::KEY_AS_PATHNAME</varname>
|
||||
<initializer>0</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="filesystemiterator.constants.key-as-filename">FilesystemIterator::KEY_AS_FILENAME</varname>
|
||||
<initializer>256</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="filesystemiterator.constants.key-mode-mask">FilesystemIterator::KEY_MODE_MASK</varname>
|
||||
<initializer>3840</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="filesystemiterator.constants.new-current-and-key">FilesystemIterator::NEW_CURRENT_AND_KEY</varname>
|
||||
<initializer>256</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="filesystemiterator.constants.skip-dots">FilesystemIterator::SKIP_DOTS</varname>
|
||||
<initializer>4096</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="filesystemiterator.constants.unix-paths">FilesystemIterator::UNIX_PATHS</varname>
|
||||
<initializer>8192</initializer>
|
||||
</fieldsynopsis>
|
||||
|
||||
<classsynopsisinfo role="comment">Methods</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.filesystemiterator')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
||||
|
@ -59,6 +121,74 @@
|
|||
<!-- }}} -->
|
||||
|
||||
</section>
|
||||
|
||||
<!-- {{{ FilesystemIterator constants -->
|
||||
<section xml:id="filesystemiterator.constants">
|
||||
&reftitle.constants;
|
||||
<variablelist>
|
||||
<varlistentry xml:id="filesystemiterator.constants.current-as-pathname">
|
||||
<term><constant>FilesystemIterator::CURRENT_AS_PATHNAME</constant></term>
|
||||
<listitem>
|
||||
<para>Makes <methodname>FilesystemIterator::current</methodname> return the pathname.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="filesystemiterator.constants.current-as-fileinfo">
|
||||
<term><constant>FilesystemIterator::CURRENT_AS_FILEINFO</constant></term>
|
||||
<listitem>
|
||||
<para>Makes <methodname>FilesystemIterator::current</methodname> return an <classname>SplFileInfo</classname> instance.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="filesystemiterator.constants.current-as-self">
|
||||
<term><constant>FilesystemIterator::CURRENT_AS_SELF</constant></term>
|
||||
<listitem>
|
||||
<para>Makes <methodname>FilesystemIterator::current</methodname> return $this (the FilesystemIterator).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="filesystemiterator.constants.current-mode-mask">
|
||||
<term><constant>FilesystemIterator::CURRENT_MODE_MASK</constant></term>
|
||||
<listitem>
|
||||
<para>Masks <methodname>FilesystemIterator::current</methodname></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="filesystemiterator.constants.key-as-pathname">
|
||||
<term><constant>FilesystemIterator::KEY_AS_PATHNAME</constant></term>
|
||||
<listitem>
|
||||
<para>Makes <methodname>FilesystemIterator::key</methodname> return the pathname.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="filesystemiterator.constants.key-as-filename">
|
||||
<term><constant>FilesystemIterator::KEY_AS_FILENAME</constant></term>
|
||||
<listitem>
|
||||
<para>Makes <methodname>FilesystemIterator::key</methodname> return the filename.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="filesystemiterator.constants.key-mode-mask">
|
||||
<term><constant>FilesystemIterator::KEY_MODE_MASK</constant></term>
|
||||
<listitem>
|
||||
<para>Masks <methodname>FilesystemIterator::key</methodname></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="filesystemiterator.constants.new-current-and-key">
|
||||
<term><constant>FilesystemIterator::NEW_CURRENT_AND_KEY</constant></term>
|
||||
<listitem>
|
||||
<para>Same as <literal>FilesystemIterator::KEY_AS_FILENAME | FilesystemIterator::CURRENT_AS_FILEINFO</literal>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="filesystemiterator.constants.skip-dots">
|
||||
<term><constant>FilesystemIterator::SKIP_DOTS</constant></term>
|
||||
<listitem>
|
||||
<para>Skips dot files (<literal>.</literal> and <literal>..</literal>).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="filesystemiterator.constants.unix-paths">
|
||||
<term><constant>FilesystemIterator::UNIX_PATHS</constant></term>
|
||||
<listitem>
|
||||
<para>Makes paths use Unix-style forward slash irrespective of system default.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
</partintro>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
|
||||
<refentry xml:id="filesystemiterator.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
|
@ -12,14 +12,12 @@
|
|||
<methodsynopsis>
|
||||
<methodname>FilesystemIterator::__construct</methodname>
|
||||
<methodparam><type>string</type><parameter>path</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>flags</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Constructs a new filesystem iterator from the <parameter>path</parameter>.
|
||||
</para>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -30,7 +28,7 @@
|
|||
<term><parameter>path</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The path.
|
||||
The path of the filesystem item to be iterated over.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -38,7 +36,9 @@
|
|||
<term><parameter>flags</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The desired flags.
|
||||
Flags may be provided which will affect the behavior of some methods.
|
||||
A list of the flags can found under <link linkend="filesystemiterator.constants">FilesystemIterator predefined constants</link>.
|
||||
They can also be set later with <methodname>FilesystemIterator::setFlags</methodname>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -46,6 +46,48 @@
|
|||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.void;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="errors">
|
||||
&reftitle.errors;
|
||||
<para>
|
||||
Throws an <classname>UnexpectedValueException</classname>
|
||||
if the <parameter>path</parameter> cannot be found.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>FilesystemIterator::__construct</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$it = new FilesystemIterator(dirname(__FILE__));
|
||||
foreach ($it as $fileinfo) {
|
||||
echo $fileinfo->getFilename() . "\n";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
apples.jpg
|
||||
banana.jpg
|
||||
example.php
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
|
||||
<refentry xml:id="filesystemiterator.current" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
|
@ -10,14 +10,12 @@
|
|||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type> <methodname>FilesystemIterator::current</methodname>
|
||||
<modifier>public</modifier> <type>mixed</type><methodname>FilesystemIterator::current</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Get file information of the current element.
|
||||
</para>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
</refsect1>
|
||||
|
||||
|
@ -29,7 +27,38 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
The Filename, File information, or $this depending on the set flags.
|
||||
The filename, file information, or $this depending on the set flags.
|
||||
See the <link linkend="filesystemiterator.constants">FilesystemIterator constants</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><methodname>FilesystemIterator::current</methodname> example</title>
|
||||
<para>
|
||||
This example will list the contents of the directory containing the script.
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$iterator = new FilesystemIterator(dirname(__FILE__), FilesystemIterator::CURRENT_AS_PATHNAME);
|
||||
foreach ($iterator as $fileinfo) {
|
||||
echo $iterator->current() . "\n";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
/www/examples/apple.jpg
|
||||
/www/examples/banana.jpg
|
||||
/www/examples/example.php
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -37,6 +66,7 @@
|
|||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><link linkend="filesystemiterator.constants">FilesystemIterator constants</link></member>
|
||||
<member><methodname>DirectoryIterator::current</methodname></member>
|
||||
<member><methodname>DirectoryIterator::getFileName</methodname></member>
|
||||
</simplelist>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
|
||||
<refentry xml:id="filesystemiterator.getflags" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
|
@ -14,11 +14,9 @@
|
|||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Gets the handling flags, as set in <methodname>FilesystemIterator::__construct</methodname>.
|
||||
Gets the handling flags, as set in <methodname>FilesystemIterator::__construct</methodname> or <methodname>FilesystemIterator::setFlags</methodname>.
|
||||
</para>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -29,7 +27,7 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
The value of the set flags.
|
||||
The integer value of the set flags.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -38,6 +36,7 @@
|
|||
<para>
|
||||
<simplelist>
|
||||
<member><methodname>FilesystemIterator::__construct</methodname></member>
|
||||
<member><methodname>FilesystemIterator::setFlags</methodname></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
|
|
@ -1,21 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
|
||||
<refentry xml:id="filesystemiterator.key" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>FilesystemIterator::key</refname>
|
||||
<refpurpose>Retrieve the file name</refpurpose>
|
||||
<refpurpose>Retrieve the key for the current file</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>FilesystemIterator::key</methodname>
|
||||
<modifier>public</modifier> <type>string</type><methodname>FilesystemIterator::key</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -26,7 +23,38 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns the Pathname or Filename depending on the set flags.
|
||||
Returns the pathname or filename depending on the set flags.
|
||||
See the <link linkend="filesystemiterator.constants">FilesystemIterator constants</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><methodname>FilesystemIterator::key</methodname> example</title>
|
||||
<para>
|
||||
This example will list the contents of the directory containing the script.
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$iterator = new FilesystemIterator(dirname(__FILE__), FilesystemIterator::KEY_AS_FILENAME);
|
||||
foreach ($iterator as $fileinfo) {
|
||||
echo $iterator->key() . "\n";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
apple.jpg
|
||||
banana.jpg
|
||||
example.php
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -34,6 +62,7 @@
|
|||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><link linkend="filesystemiterator.constants">FilesystemIterator constants</link></member>
|
||||
<member><methodname>DirectoryIterator::key</methodname></member>
|
||||
<member><methodname>DirectoryIterator::getFilename</methodname></member>
|
||||
<member><methodname>DirectoryIterator::getPathname</methodname></member>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
|
||||
<refentry xml:id="filesystemiterator.next" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>FilesystemIterator::next</refname>
|
||||
<refpurpose>Move to the next entry</refpurpose>
|
||||
<refpurpose>Move to the next file</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
|
@ -14,11 +14,8 @@
|
|||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Move to the next entry.
|
||||
Move to the next file.
|
||||
</para>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -33,6 +30,37 @@
|
|||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><methodname>FilesystemIterator::next</methodname> example</title>
|
||||
<para>
|
||||
List the contents of a directory using a while loop.
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$iterator = new FilesystemIterator(dirname(__FILE__));
|
||||
while($iterator->valid()) {
|
||||
echo $iterator->getFilename() . "\n";
|
||||
$iterator->next();
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
apple.jpg
|
||||
banana.jpg
|
||||
example.php
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
|
||||
<refentry xml:id="filesystemiterator.rewind" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>FilesystemIterator::rewind</refname>
|
||||
<refpurpose>Rewinds dir</refpurpose>
|
||||
<refpurpose>Rewinds back to the beginning</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
|
@ -16,9 +16,6 @@
|
|||
<para>
|
||||
Rewinds the directory back to the start.
|
||||
</para>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -33,6 +30,38 @@
|
|||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><methodname>FilesystemIterator::rewind</methodname> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$iterator = new FilesystemIterator(dirname(__FILE__), FilesystemIterator::KEY_AS_FILENAME);
|
||||
|
||||
echo $iterator->key() . "\n";
|
||||
|
||||
$iterator->next();
|
||||
echo $iterator->key() . "\n";
|
||||
|
||||
$iterator->rewind();
|
||||
echo $iterator->key() . "\n";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
apple.jpg
|
||||
banana.jpg
|
||||
apple.jpg
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
|
||||
<refentry xml:id="filesystemiterator.setflags" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
|
@ -11,14 +11,12 @@
|
|||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>void</type><methodname>FilesystemIterator::setFlags</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>flags</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Sets handling flags.
|
||||
</para>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -30,6 +28,7 @@
|
|||
<listitem>
|
||||
<para>
|
||||
The handling flags to set.
|
||||
See the <link linkend="filesystemiterator.constants">FilesystemIterator constants</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -44,6 +43,51 @@
|
|||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><methodname>FilesystemIterator::key</methodname> example</title>
|
||||
<para>
|
||||
This example demonstrates the difference between the
|
||||
<link linkend="filesystemiterator.constants.key-as-pathname">FilesystemIterator::KEY_AS_PATHNAME</link> and
|
||||
<link linkend="filesystemiterator.constants.key-as-filename">FilesystemIterator::KEY_AS_FILENAME</link> flags.
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$iterator = new FilesystemIterator(dirname(__FILE__), FilesystemIterator::KEY_AS_PATHNAME);
|
||||
echo "Key as Pathname:\n";
|
||||
foreach ($iterator as $key => $fileinfo) {
|
||||
echo $key . "\n";
|
||||
}
|
||||
|
||||
$iterator->setFlags(FilesystemIterator::KEY_AS_FILENAME);
|
||||
echo "\nKey as Filename:\n";
|
||||
foreach ($iterator as $key => $fileinfo) {
|
||||
echo $key . "\n";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Key as Pathname:
|
||||
/www/examples/apple.jpg
|
||||
/www/examples/banana.jpg
|
||||
/www/examples/example.php
|
||||
|
||||
Key as Filename:
|
||||
apple.jpg
|
||||
banana.jpg
|
||||
example.php
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
|
|
Loading…
Reference in a new issue