cvs: phpdoc /en/reference/spl/globiterator construct.xml count.xml
| From: | Kalle Sommer Nielsen | Date: | Sun, 21 Jun 2009 12:14:36 +0000 |
| Subject: | cvs: phpdoc /en/reference/spl/globiterator construct.xml count.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-4178@lists.php.net to get a copy of this message | ||
kalle Sun Jun 21 12:14:36 2009 UTC
Modified files:
/phpdoc/en/reference/spl/globiterator construct.xml count.xml
Log:
Documented GlobIterator::__construct() and GlobIterator::count()
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/globiterator/construct.xml?r1=1.1&r2=1.2&diff_format=u
Index: phpdoc/en/reference/spl/globiterator/construct.xml
diff -u phpdoc/en/reference/spl/globiterator/construct.xml:1.1
phpdoc/en/reference/spl/globiterator/construct.xml:1.2
--- phpdoc/en/reference/spl/globiterator/construct.xml:1.1 Mon Mar 23 23:45:34 2009
+++ phpdoc/en/reference/spl/globiterator/construct.xml Sun Jun 21 12:14:35 2009
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
<refentry xml:id="globiterator.construct" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
@@ -12,14 +12,11 @@
<methodsynopsis>
<methodname>GlobIterator::__construct</methodname>
<methodparam><type>string</type><parameter>path</parameter></methodparam>
- <methodparam
choice="opt"><type>string</type><parameter>flags</parameter></methodparam>
+ <methodparam
choice="opt"><type>integer</type><parameter>flags</parameter><initializer>FilesystemIterator::KEY_AS_PATHNAME
| FilesystemIterator::CURRENT_AS_FILEINFO</initializer></methodparam>
</methodsynopsis>
<para>
Constructs a new directory iterator from a glob expression.
</para>
-
- &warn.undocumented.func;
-
</refsect1>
<refsect1 role="parameters">
@@ -38,7 +35,8 @@
<term><parameter>flags</parameter></term>
<listitem>
<para>
- Optional flags.
+ Option flags, the flags may be a bitmask of the
+ <classname>FilesystemIterator</classname> constants.
</para>
</listitem>
</varlistentry>
@@ -46,11 +44,52 @@
</para>
</refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title><classname>GlobIterator</classname> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$iterator = new GlobIterator('*.dll', FilesystemIterator::KEY_AS_FILENAME);
+
+if(!$iterator->count())
+{
+ echo 'No matches';
+}
+else
+{
+ $n = 0;
+
+ printf("Matched %d item(s)\r\n", $iterator->count());
+
+ foreach($iterator as $item)
+ {
+ printf("[%d] %s\r\n", ++$n, $iterator->key());
+ }
+}
+?>
+]]>
+ </programlisting>
+ &example.outputs.similar;
+ <screen>
+<![CDATA[
+Matched 2 item(s)
+[1] php5ts.dll
+[2] php_gd2.dll
+]]>
+ </screen>
+ </example>
+ </para>
+ </refsect1>
+
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><methodname>DirectoryIterator::__construct</methodname></member>
+ <member><methodname>GlobIterator::count</methodname></member>
<member><function>glob</function></member>
</simplelist>
</para>
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/globiterator/count.xml?r1=1.1&r2=1.2&diff_format=u
Index: phpdoc/en/reference/spl/globiterator/count.xml
diff -u phpdoc/en/reference/spl/globiterator/count.xml:1.1
phpdoc/en/reference/spl/globiterator/count.xml:1.2
--- phpdoc/en/reference/spl/globiterator/count.xml:1.1 Mon Mar 23 23:45:34 2009
+++ phpdoc/en/reference/spl/globiterator/count.xml Sun Jun 21 12:14:35 2009
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
<refentry xml:id="globiterator.count" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
@@ -17,9 +17,6 @@
Gets the number of directories and files found by
the glob expression.
</para>
-
- &warn.undocumented.func;
-
</refsect1>
<refsect1 role="parameters">
@@ -35,6 +32,41 @@
</para>
</refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title><methodname>GlobIterator::count</methodname> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$iterator = new GlobIterator('*.xml');
+
+printf("Matched %d item(s)\r\n", $iterator->count());
+?>
+]]>
+ </programlisting>
+ &example.outputs.similar;
+ <screen>
+<![CDATA[
+Matched 8 item(s)
+]]>
+ </screen>
+ </example>
+ </para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><methodname>GlobIterator::__construct</methodname></member>
+ <member><function>count</function></member>
+ <member><function>glob</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
</refentry>
<!-- Keep this comment at the end of the file