cvs: phpdoc-zh /reference/dir/functions chdir.xml chroot.xml class.dir.xml closedir.xml getcwd.xml opendir.xml readdir.xml rewinddir.xml scandir.xml
/reference/filesystem/functions chmod.xml
| From: | Dallas Thunder | Date: | Wed, 31 Aug 2005 16:19:13 +0000 |
| Subject: | cvs: phpdoc-zh /reference/dir/functions chdir.xml chroot.xml class.dir.xml closedir.xml getcwd.xml opendir.xml readdir.xml rewinddir.xml scandir.xml /reference/filesystem/functions chmod.xml |
||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-2564@lists.php.net to get a copy of this message | ||
dallas Wed Aug 31 12:19:13 2005 EDT
Modified files:
/phpdoc-zh/reference/dir/functions chdir.xml chroot.xml
class.dir.xml closedir.xml
getcwd.xml opendir.xml
readdir.xml rewinddir.xml
scandir.xml
/phpdoc-zh/reference/filesystem/functions chmod.xml
Log:
Updated.
http://cvs.php.net/diff.php/phpdoc-zh/reference/dir/functions/chdir.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-zh/reference/dir/functions/chdir.xml diff -u phpdoc-zh/reference/dir/functions/chdir.xml:1.3 phpdoc-zh/reference/dir/functions/chdir.xml:1.4 --- phpdoc-zh/reference/dir/functions/chdir.xml:1.3 Sat Feb 22 07:31:42 2003 +++ phpdoc-zh/reference/dir/functions/chdir.xml Wed Aug 31 12:19:12 2005 @@ -1,27 +1,93 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> - <refentry id="function.chdir"> - <refnamediv> - <refname>chdir</refname> - <refpurpose>¸Ä±äĿ¼</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>bool</type><methodname>chdir</methodname> - <methodparam><type>string</type><parameter>directory</parameter></methodparam> - </methodsynopsis> - <para> - ½« PHP µÄµ±Ç°Ä¿Â¼¸ÄΪ - <parameter>directory</parameter>¡£&return.success; - </para> - <para> - ²Î¼û <function>getcwd</function>¡£ - </para> - </refsect1> - </refentry> +<!-- EN-Revision: 1.13 Maintainer: dallas Status: ready --> +<refentry id="function.chdir"> + <refnamediv> + <refname>chdir</refname> + <refpurpose>¸Ä±äĿ¼</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>bool</type><methodname>chdir</methodname> + <methodparam><type>string</type><parameter>directory</parameter></methodparam> + </methodsynopsis> + <para> + ½« PHP µÄµ±Ç°Ä¿Â¼¸ÄΪ + <parameter>directory</parameter>¡£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>directory</parameter></term> + <listitem> + <para> + еĵ±Ç°Ä¿Â¼ + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.success; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>chdir</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// current directory +echo getcwd() . "\n"; + +chdir('public_html'); + +// current directory +echo getcwd() . "\n"; + +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +/home/vincent +/home/vincent/public_html +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + ¬e.sm.uidcheck.dir; + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>getcwd</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/dir/functions/chroot.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-zh/reference/dir/functions/chroot.xml diff -u phpdoc-zh/reference/dir/functions/chroot.xml:1.6 phpdoc-zh/reference/dir/functions/chroot.xml:1.7 --- phpdoc-zh/reference/dir/functions/chroot.xml:1.6 Mon Aug 18 16:17:48 2003 +++ phpdoc-zh/reference/dir/functions/chroot.xml Wed Aug 31 12:19:12 2005 @@ -1,29 +1,57 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> - <refentry id="function.chroot"> - <refnamediv> - <refname>chroot</refname> - <refpurpose>¸Ä±ä¸ùĿ¼</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>bool</type><methodname>chroot</methodname> - <methodparam><type>string</type><parameter>directory</parameter></methodparam> - </methodsynopsis> - <para> - ½«µ±Ç°½ø³ÌµÄ¸ùĿ¼¸Ä±äΪ - <parameter>directory</parameter>¡£&return.success; - </para> - <para> - ±¾º¯Êý½öÔÚÄãµÄϵͳ֧³ÖÇÒÔËÐÐÓÚ CLI£¬CGI - »òǶÈë SAPI °æ±¾Ê±²ÅÄÜÕýÈ·¹¤×÷¡£ - </para> - ¬e.no-windows; - </refsect1> - </refentry> +<!-- EN-Revision: 1.11 Maintainer: dallas Status: ready --> +<refentry id="function.chroot"> + <refnamediv> + <refname>chroot</refname> + <refpurpose>¸Ä±ä¸ùĿ¼</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>bool</type><methodname>chroot</methodname> + <methodparam><type>string</type><parameter>directory</parameter></methodparam> + </methodsynopsis> + <para> + ½«µ±Ç°½ø³ÌµÄ¸ùĿ¼¸Ä±äΪ + <parameter>directory</parameter>¡£ + </para> + <para> + ±¾º¯Êý½öÔÚϵͳ֧³ÖÇÒÔËÐÐÓÚ CLI£¬CGI + »òǶÈë SAPI °æ±¾Ê±²ÅÄÜÕýÈ·¹¤×÷¡£´ËÍâ±¾º¯Êý»¹ÐèÒª root ȨÏÞ¡£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>directory</parameter></term> + <listitem> + <para> + ÐÂĿ¼ + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.success; + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + ¬e.no-windows; + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/dir/functions/class.dir.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-zh/reference/dir/functions/class.dir.xml diff -u phpdoc-zh/reference/dir/functions/class.dir.xml:1.4 phpdoc-zh/reference/dir/functions/class.dir.xml:1.5 --- phpdoc-zh/reference/dir/functions/class.dir.xml:1.4 Mon Aug 18 16:17:48 2003 +++ phpdoc-zh/reference/dir/functions/class.dir.xml Wed Aug 31 12:19:12 2005 @@ -1,75 +1,98 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> - <refentry id="class.dir"> - <refnamediv> - <refname>dir</refname> - <refpurpose>directory Àà</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <classsynopsis> - <ooclass><classname>dir</classname></ooclass> - <constructorsynopsis> - <methodname>dir</methodname> - <methodparam><type>string</type><parameter>directory</parameter></methodparam> - </constructorsynopsis> - <fieldsynopsis> - <type>string</type><varname>path</varname> - </fieldsynopsis> - <fieldsynopsis> - <type>resource</type><varname>handle</varname> - </fieldsynopsis> - <methodsynopsis><type>string</type><methodname>read</methodname><void/></methodsynopsis> - <methodsynopsis><type>void</type><methodname>rewind</methodname><void/></methodsynopsis> - <methodsynopsis><type>void</type><methodname>close</methodname><void/></methodsynopsis> - </classsynopsis> - <para> - ÕâÊǸö·Â̡̾Ïò¶ÔÏóµÄ»úÖÆÀ´¶Áȡһ¸öĿ¼¡£¸ø¶¨µÄ - <parameter>directory</parameter> ±»´ò¿ª¡£Ò»µ©Ä¿Â¼±»´ò¿ª£¬ÓÐÁ½¸öÊôÐÔ¿ÉÓá£handle - ÊôÐÔ¿ÉÒÔÓÃÔÚÆäËüĿ¼º¯ÊýÀýÈç - <function>readdir</function>£¬<function>rewinddir</function> ºÍ - <function>closedir</function> ÖС£path - ÊôÐÔ±»ÉèΪ±»´ò¿ªµÄĿ¼·¾¶¡£ÓÐÈý¸ö·½·¨¿ÉÓãºread£¬rewind ºÍ close¡£ - </para> +<!-- EN-Revision: 1.10 Maintainer: dallas Status: ready --> +<refentry id="class.dir"> + <refnamediv> + <refname>dir</refname> + <refpurpose>directory Àà</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <classsynopsis> + <ooclass><classname>dir</classname></ooclass> + <constructorsynopsis> + <methodname>dir</methodname> + <methodparam><type>string</type><parameter>directory</parameter></methodparam> + </constructorsynopsis> + <fieldsynopsis> + <type>string</type><varname>path</varname> + </fieldsynopsis> + <fieldsynopsis> + <type>resource</type><varname>handle</varname> + </fieldsynopsis> + <methodsynopsis><type>string</type><methodname>read</methodname><void/></methodsynopsis> + <methodsynopsis><type>void</type><methodname>rewind</methodname><void/></methodsynopsis> + <methodsynopsis><type>void</type><methodname>close</methodname><void/></methodsynopsis> + </classsynopsis> + <para> + ÕâÊǸö·Â̡̾Ïò¶ÔÏóµÄ»úÖÆÀ´¶Áȡһ¸öĿ¼¡£¸ø¶¨µÄ + <parameter>directory</parameter> ±»´ò¿ª¡£Ò»µ©Ä¿Â¼±»´ò¿ª£¬ÓÐÁ½¸öÊôÐÔ¿ÉÓá£handle + ÊôÐÔ¿ÉÒÔÓÃÔÚÆäËüĿ¼º¯ÊýÀýÈç + <function>readdir</function>£¬<function>rewinddir</function> ºÍ + <function>closedir</function> ÖС£path + ÊôÐÔ±»ÉèΪ±»´ò¿ªµÄĿ¼·¾¶¡£ÓÐÈý¸ö·½·¨¿ÉÓãºread£¬rewind ºÍ close¡£ + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>dir</function> Àý×Ó</title> <para> ÇëÁôÒâÏÂÃæÀý×ÓÖмì²é <function>dir</function> ·µ»ØÖµµÄ·ç¸ñ¡£ÎÒÃÇÃ÷È·µØ²âÊÔ·µ»ØÖµÊÇ·ñÈ«µÈÓÚ£¨ÖµºÍÀàÐͶ¼Ïàͬ £ ¸ü¶àÐÅÏ¢²Î¼û<link linkend="language.operators.comparison">±È½ÏÔËËã·û</link>£©&false;£¬·ñÔòÈκÎĿ¼ÏîµÄÃû³ÆÇóֵΪ &false; µÄ¶¼»áµ¼ÖÂÑ»·Í£Ö¹¡£ - <example> - <title><function>dir</function> Àý×Ó</title> - <programlisting role="php"> + </para> + <programlisting role="php"> <![CDATA[ <?php -$d = dir("/etc"); -echo "Handle: ".$d->handle."<br>\n"; -echo "Path: ".$d->path."<br>\n"; +$d = dir("/etc/php5"); +echo "Handle: " . $d->handle . "\n"; +echo "Path: " . $d->path . "\n"; while (false !== ($entry = $d->read())) { - echo $entry."<br>\n"; + echo $entry."\n"; } $d->close(); ?> ]]> - </programlisting> - </example> - </para> - <note> - <para> - read ·½·¨·µ»ØµÄĿ¼ÏîµÄ˳ÐòÒÀÀµÓÚϵͳ¡£ - </para> - </note> - <note> - <para> - ±¾º¯Êý¶¨ÒåÁËÄÚ²¿Àà - <classname>Directory</classname>£¬Òâζ×Ų»ÄÜÔÙÓÃͬÑùµÄÃû×Ö¶¨ÒåÓû§×Ô¼ºµÄÀà¡£PHP - Ô¤¶¨ÒåÀàµÄÍêÕûÁбí¼û<link - linkend="reserved.classes">Ô¤¶¨ÒåÀà</link>Ò»½Ú¡£ - </para> - </note> - </refsect1> - </refentry> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +Handle: Resource id #2 +Path: /etc/php5 +. +.. +apache +cgi +cli +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + read ·½·¨·µ»ØµÄĿ¼ÏîµÄ˳ÐòÒÀÀµÓÚϵͳ¡£ + </para> + </note> + <note> + <para> + ±¾º¯Êý¶¨ÒåÁËÄÚ²¿Àà + <classname>Directory</classname>£¬Òâζ×Ų»ÄÜÔÙÓÃͬÑùµÄÃû×Ö¶¨ÒåÓû§×Ô¼ºµÄÀà¡£PHP + Ô¤¶¨ÒåÀàµÄÍêÕûÁбí¼û<link + linkend="reserved.classes">Ô¤¶¨ÒåÀà</link>Ò»½Ú¡£ + </para> + </note> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/dir/functions/closedir.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/dir/functions/closedir.xml diff -u phpdoc-zh/reference/dir/functions/closedir.xml:1.2 phpdoc-zh/reference/dir/functions/closedir.xml:1.3 --- phpdoc-zh/reference/dir/functions/closedir.xml:1.2 Sun Sep 29 23:08:49 2002 +++ phpdoc-zh/reference/dir/functions/closedir.xml Wed Aug 31 12:19:12 2005 @@ -1,24 +1,66 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> - <refentry id="function.closedir"> - <refnamediv> - <refname>closedir</refname> - <refpurpose>¹Ø±ÕĿ¼¾ä±ú</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>void</type><methodname>closedir</methodname> - <methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam> - </methodsynopsis> - <para> - ¹Ø±ÕÓÉ <parameter>dir_handle</parameter> Ö¸¶¨µÄĿ¼Á÷¡£Á÷±ØÐë֮ǰ±» - <function>opendir</function> Ëù´ò¿ª¡£ - </para> - </refsect1> - </refentry> +<!-- EN-Revision: 1.7 Maintainer: dallas Status: ready --> +<refentry id="function.closedir"> + <refnamediv> + <refname>closedir</refname> + <refpurpose>¹Ø±ÕĿ¼¾ä±ú</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>void</type><methodname>closedir</methodname> + <methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam> + </methodsynopsis> + <para> + ¹Ø±ÕÓÉ <parameter>dir_handle</parameter> Ö¸¶¨µÄĿ¼Á÷¡£Á÷±ØÐë֮ǰ±» + <function>opendir</function> Ëù´ò¿ª¡£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>dir_handle</parameter></term> + <listitem> + <para> + Ŀ¼¾ä±úµÄ <type>resource</type>£¬Ö®Ç°ÓÉ + <function>opendir</function> Ëù´ò¿ªµÄ¡£ + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>closedir</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php +$dir = "/etc/php5/"; + +// Open a known directory, read directory into variable and then close +if (is_dir($dir)) { + if ($dh = opendir($dir)) { + $directory = readdir($dh); + closedir($dh); + } +} +?> +]]> + </programlisting> + </example> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/dir/functions/getcwd.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/dir/functions/getcwd.xml diff -u phpdoc-zh/reference/dir/functions/getcwd.xml:1.2 phpdoc-zh/reference/dir/functions/getcwd.xml:1.3 --- phpdoc-zh/reference/dir/functions/getcwd.xml:1.2 Sun Sep 29 23:08:49 2002 +++ phpdoc-zh/reference/dir/functions/getcwd.xml Wed Aug 31 12:19:12 2005 @@ -1,26 +1,76 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> - <refentry id="function.getcwd"> - <refnamediv> - <refname>getcwd</refname> - <refpurpose>È¡µÃµ±Ç°¹¤×÷Ŀ¼</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>string</type><methodname>getcwd</methodname> - <void/> - </methodsynopsis> - <para> - ·µ»Øµ±Ç°¹¤×÷Ŀ¼¡£ - </para> - <para> - ²Î¼û <function>chdir</function>¡£ - </para> - </refsect1> - </refentry> +<!-- EN-Revision: 1.11 Maintainer: dallas Status: ready --> +<refentry id="function.getcwd"> + <refnamediv> + <refname>getcwd</refname> + <refpurpose>È¡µÃµ±Ç°¹¤×÷Ŀ¼</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type><methodname>getcwd</methodname> + <void/> + </methodsynopsis> + <para> + È¡µÃµ±Ç°¹¤×÷Ŀ¼¡£ + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + ³É¹¦Ôò·µ»Øµ±Ç°¹¤×÷Ŀ¼£¬Ê§°Ü·µ»Ø &false;¡£ + </para> + <para> + ÔÚijЩ Unix µÄ±äÖÖÏ£¬Èç¹ûÈκθ¸Ä¿Â¼Ã»ÓÐÉ趨¿É¶Á»òËÑË÷ģʽ£¬¼´Ê¹µ±Ç°Ä¿Â¼É趨ÁË£¬<function>getcwd</function> + »¹Êǻ᷵»Ø &false;¡£ÓйØÄ£Ê½ÓëȨÏ޵ĸü¶àÐÅÏ¢¼û <function>chmod</function>¡£ + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>getcwd</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// current directory +echo getcwd() . "\n"; + +chdir('cvs'); + +// current directory +echo getcwd() . "\n"; + +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +/home/didou +/home/didou/cvs +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>chdir</function></member> + <member><function>chmod</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/dir/functions/opendir.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-zh/reference/dir/functions/opendir.xml diff -u phpdoc-zh/reference/dir/functions/opendir.xml:1.5 phpdoc-zh/reference/dir/functions/opendir.xml:1.6 --- phpdoc-zh/reference/dir/functions/opendir.xml:1.5 Mon Aug 18 16:17:48 2003 +++ phpdoc-zh/reference/dir/functions/opendir.xml Wed Aug 31 12:19:12 2005 @@ -1,63 +1,146 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> - <refentry id="function.opendir"> - <refnamediv> - <refname>opendir</refname> - <refpurpose>´ò¿ªÄ¿Â¼¾ä±ú</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>resource</type><methodname>opendir</methodname> - <methodparam><type>string</type><parameter>path</parameter></methodparam> - </methodsynopsis> - <para> - ·µ»ØÒ»¸öĿ¼¾ä±ú£¬¿ÉÒÔÔÚÖ®ºóÓÃÔÚ - <function>closedir</function>£¬<function>readdir</function> ºÍ - <function>rewinddir</function> µ÷ÓÃÖС£ - </para> - <para> - Èç¹û <parameter>path</parameter> - ²»ÊÇÒ»¸öºÏ·¨µÄĿ¼»òÕßÒòΪȨÏÞÏÞÖÆ»òÎļþϵͳ´íÎó¶ø²»ÄÜ´ò¿ªÄ¿Â¼£¬<function>opendir</function> - ·µ»Ø &false; ²¢²úÉúÒ»¸ö <link linkend="errorfunc.constants">E_WARNING</link> - ¼¶±ðµÄ PHP ´íÎóÐÅÏ¢¡£¿ÉÒÔÔÚ <function>opendir</function> - Ç°Ãæ¼ÓÉÏ¡°<link linkend="language.operators.errorcontrol">@</link>¡±·ûºÅÀ´ÒÖÖÆ´íÎóÐÅÏ¢µÄÊä³ö¡£ - </para> - <para> - <example> - <title><function>opendir</function> Àý×Ó</title> - <programlisting role="php"> +<!-- EN-Revision: 1.15 Maintainer: dallas Status: ready --> +<refentry id="function.opendir"> + <refnamediv> + <refname>opendir</refname> + <refpurpose>´ò¿ªÄ¿Â¼¾ä±ú</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>resource</type><methodname>opendir</methodname> + <methodparam><type>string</type><parameter>path</parameter></methodparam> + <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> + </methodsynopsis> + <para> + ´ò¿ªÒ»¸öĿ¼¾ä±ú£¬¿ÉÓÃÓÚÖ®ºóµÄ + <function>closedir</function>£¬<function>readdir</function> ºÍ + <function>rewinddir</function> µ÷ÓÃÖС£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>path</parameter></term> + <listitem> + <para> + Òª´ò¿ªµÄĿ¼·¾¶ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>context</parameter></term> + <listitem> + <para> + <parameter>context</parameter> ²ÎÊýµÄ˵Ã÷¼ûÊÖ²áÖÐµÄ + <link linkend="ref.stream">Streams API</link> Ò»Õ¡£ + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Èç¹û³É¹¦Ôò·µ»ØÄ¿Â¼¾ä±úµÄ <type>resource</type>£¬Ê§°ÜÔò·µ»Ø &false;¡£ + </para> + <para> + Èç¹û <parameter>path</parameter> + ²»ÊÇÒ»¸öºÏ·¨µÄĿ¼»òÕßÒòΪȨÏÞÏÞÖÆ»òÎļþϵͳ´íÎó¶ø²»ÄÜ´ò¿ªÄ¿Â¼£¬<function>opendir</function> + ·µ»Ø &false; ²¢²úÉúÒ»¸ö <link linkend="errorfunc.constants">E_WARNING</link> + ¼¶±ðµÄ PHP ´íÎóÐÅÏ¢¡£¿ÉÒÔÔÚ <function>opendir</function> + Ç°Ãæ¼ÓÉÏ¡°<link linkend="language.operators.errorcontrol">@</link>¡±·ûºÅÀ´ÒÖÖÆ´íÎóÐÅÏ¢µÄÊä³ö¡£ + </para> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>5.0.0</entry> + <entry> + <parameter>path</parameter> Ö§³Ö <literal>ftp://</literal> + URL wrapper + </entry> + </row> + <row> + <entry>4.3.0</entry> + <entry> + <parameter>path</parameter> ¿ÉÒÔÊÇÈκÎÖ§³ÖĿ¼ÁбíµÄ + URL£¬²»¹ýÔÚ PHP 4 ÖÐÖ»ÓÐ <literal>file://</literal> + URL wrapper Ö§³Ö´Ë¹¦ÄÜ + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>opendir</function> Àý×Ó</title> + <programlisting role="php"> <![CDATA[ <?php -$dir = "/tmp/"; +$dir = "/etc/php5/"; + // Open a known directory, and proceed to read its contents if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { - print "filename: $file : filetype: " . filetype($dir . $file) . "\n"; + echo "filename: $file : filetype: " . filetype($dir . $file) . "\n"; } closedir($dh); } } ?> ]]> - </programlisting> - </example> - </para> - <para> - ×Ô <literal>PHP 4.3.0</literal> Æð <parameter>path</parameter> - Ò²¿ÉÒÔÊÇÈκÎÖ§³ÖĿ¼ÁбíµÄ URL£¬µ«ÊÇÔÚ <literal>PHP 4.3</literal> - ÖÐÖ»Ö§³Ö <literal>file://</literal> url ÐÒé¡£×Ô <literal>PHP 5.0.0</literal> - Æð£¬Ò²°üÀ¨ÁË <literal>ftp://</literal> url ÐÒéµÄÖ§³Ö¡£ - </para> - <para> - ²Î¼û <function>is_dir</function>£¬<function>readdir</function> - ºÍ <link linkend="class.dir">Dir</link>¡£ - </para> - </refsect1> - </refentry> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +filename: . : filetype: dir +filename: .. : filetype: dir +filename: apache : filetype: dir +filename: cgi : filetype: dir +filename: cli : filetype: dir +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>is_dir</function></member> + <member><function>readdir</function></member> + <member><link linkend="class.dir">Dir</link></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/dir/functions/readdir.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-zh/reference/dir/functions/readdir.xml diff -u phpdoc-zh/reference/dir/functions/readdir.xml:1.4 phpdoc-zh/reference/dir/functions/readdir.xml:1.5 --- phpdoc-zh/reference/dir/functions/readdir.xml:1.4 Mon Aug 18 16:17:48 2003 +++ phpdoc-zh/reference/dir/functions/readdir.xml Wed Aug 31 12:19:12 2005 @@ -1,34 +1,64 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> - <refentry id="function.readdir"> - <refnamediv> - <refname>readdir</refname> - <refpurpose>´ÓĿ¼¾ä±úÖжÁÈ¡ÌõÄ¿</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>string</type><methodname>readdir</methodname> - <methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam> - </methodsynopsis> - <para> - ·µ»ØÄ¿Â¼ÖÐÏÂÒ»¸öÎļþµÄÎļþÃû¡£ÎļþÃûÒÔÔÚÎļþϵͳÖеÄÅÅÐò·µ»Ø¡£ - </para> +<!-- EN-Revision: 1.9 Maintainer: dallas Status: ready --> +<refentry id="function.readdir"> + <refnamediv> + <refname>readdir</refname> + <refpurpose>´ÓĿ¼¾ä±úÖжÁÈ¡ÌõÄ¿</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type><methodname>readdir</methodname> + <methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam> + </methodsynopsis> + <para> + ·µ»ØÄ¿Â¼ÖÐÏÂÒ»¸öÎļþµÄÎļþÃû¡£ÎļþÃûÒÔÔÚÎļþϵͳÖеÄÅÅÐò·µ»Ø¡£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>dir_handle</parameter></term> + <listitem> + <para> + Ŀ¼¾ä±úµÄ <type>resource</type>£¬Ö®Ç°ÓÉ + <function>opendir</function> ´ò¿ª + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + ³É¹¦Ôò·µ»ØÎļþÃû£¬Ê§°Ü·µ»Ø &false;¡£ + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>ÁгöĿ¼ÖеÄËùÓÐÎļþ</title> <para> ÇëÁôÒâÏÂÃæÀý×ÓÖмì²é <function>readdir</function> - ·µ»ØÖµµÄ·ç¸ñ¡£ÎÒÃÇÃ÷È·µØ²âÊÔ·µ»ØÖµÊÇ·ñÈ«µÈÓÚ£¨ÖµºÍÀàÐͶ¼Ïàͬ £ ¸ü¶àÐÅÏ¢²Î¼û<link + ·µ»ØÖµµÄ·ç¸ñ¡£ÕâÀïÃ÷È·µØ²âÊÔ·µ»ØÖµÊÇ·ñÈ«µÈÓÚ£¨ÖµºÍÀàÐͶ¼Ïàͬ¡ª¡ª¸ü¶àÐÅÏ¢²Î¼û<link linkend="language.operators.comparison">±È½ÏÔËËã·û</link>£©&false;£¬·ñÔòÈκÎĿ¼ÏîµÄÃû³ÆÇóֵΪ &false; µÄ¶¼»áµ¼ÖÂÑ»·Í£Ö¹£¨ÀýÈçÒ»¸öĿ¼ÃûΪ¡°0¡±£©¡£ </para> - <para> - <example> - <title>ÁгöĿ¼ÖеÄËùÓÐÎļþ</title> - <programlisting role="php"> + <programlisting role="php"> <![CDATA[ <?php // ×¢ÒâÔÚ 4.0.0-RC2 ֮ǰ²»´æÔÚ !== ÔËËã·û + if ($handle = opendir('/path/to/files')) { echo "Directory handle: $handle\n"; echo "Files:\n"; @@ -47,18 +77,13 @@ } ?> ]]> - </programlisting> - </example> - </para> - <para> - ×¢Òâ <function>readdir</function> ½«»á·µ»Ø <literal>.</literal> ºÍ - <literal>..</literal> ÌõÄ¿¡£Èç¹û²»ÏëÒªËüÃÇ£¬Ö»Òª¹ýÂ˵ô¼´¿É£º - <example> - <title> - Áгöµ±Ç°Ä¿Â¼µÄËùÓÐÎļþ²¢È¥µô <literal>.</literal> - ºÍ <literal>..</literal> - </title> - <programlisting role="php"> + </programlisting> + </example> + </para> + <para> + <example> + <title>Áгöµ±Ç°Ä¿Â¼µÄËùÓÐÎļþ²¢È¥µô <literal>.</literal> ºÍ <literal>..</literal></title> + <programlisting role="php"> <![CDATA[ <?php if ($handle = opendir('.')) { @@ -71,14 +96,21 @@ } ?> ]]> - </programlisting> - </example> - </para> - <para> - ²Î¼û <function>is_dir</function> ºÍ <function>glob</function>¡£ - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>is_dir</function></member> + <member><function>glob</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/dir/functions/rewinddir.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/dir/functions/rewinddir.xml diff -u phpdoc-zh/reference/dir/functions/rewinddir.xml:1.2 phpdoc-zh/reference/dir/functions/rewinddir.xml:1.3 --- phpdoc-zh/reference/dir/functions/rewinddir.xml:1.2 Sun Sep 29 23:08:49 2002 +++ phpdoc-zh/reference/dir/functions/rewinddir.xml Wed Aug 31 12:19:12 2005 @@ -1,24 +1,41 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> - <refentry id="function.rewinddir"> - <refnamediv> - <refname>rewinddir</refname> - <refpurpose>µ¹»ØÄ¿Â¼¾ä±ú</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>void</type><methodname>rewinddir</methodname> - <methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam> - </methodsynopsis> - <para> - ½« <parameter>dir_handle</parameter> Ö¸¶¨µÄĿ¼Á÷ÖØÖõ½Ä¿Â¼µÄ¿ªÍ·¡£ - </para> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<refentry id="function.rewinddir"> + <refnamediv> + <refname>rewinddir</refname> + <refpurpose>µ¹»ØÄ¿Â¼¾ä±ú</refpurpose> + </refnamediv> - </refsect1> - </refentry> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>void</type><methodname>rewinddir</methodname> + <methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam> + </methodsynopsis> + <para> + ½« <parameter>dir_handle</parameter> Ö¸¶¨µÄĿ¼Á÷ÖØÖõ½Ä¿Â¼µÄ¿ªÍ·¡£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>dir_handle</parameter></term> + <listitem> + <para> + Ŀ¼¾ä±úµÄ <type>resource</type>£¬Ö®Ç°ÓÉ + <function>opendir</function> ´ò¿ª + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/dir/functions/scandir.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-zh/reference/dir/functions/scandir.xml diff -u phpdoc-zh/reference/dir/functions/scandir.xml:1.1 phpdoc-zh/reference/dir/functions/scandir.xml:1.2 --- phpdoc-zh/reference/dir/functions/scandir.xml:1.1 Sun Aug 24 16:35:05 2003 +++ phpdoc-zh/reference/dir/functions/scandir.xml Wed Aug 31 12:19:12 2005 @@ -1,36 +1,79 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.1 Maintainer: dallas Status: ready --> - <refentry id="function.scandir"> - <refnamediv> - <refname>scandir</refname> - <refpurpose> - ÁгöÖ¸¶¨Â·¾¶ÖеÄÎļþºÍĿ¼ - </refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>array</type><methodname>scandir</methodname> - <methodparam><type>string</type><parameter>directory</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>sorting_order</parameter></methodparam> - </methodsynopsis> - <para> - ·µ»ØÒ»¸ö <type>array</type>£¬°üº¬ÓÐ - <parameter>directory</parameter> ÖеÄÎļþºÍĿ¼¡£Èç¹û - <parameter>directory</parameter> ²»ÊÇÒ»¸öĿ¼£¬Ôò·µ»Ø²¼¶ûÖµ - &false;£¬²¢²úÉúÒ»Ìõ - <constant>E_WARNING</constant> ¼¶±ðµÄ´íÎó¡£ - </para> - <para> - ĬÈÏÇé¿öÏ£¬·µ»ØÖµÊǰ´ÕÕ×Öĸ˳ÐòÉýÐòÅÅÁеġ£Èç¹ûʹÓÃÁË¿ÉÑ¡²ÎÊý - <parameter>sorting_order</parameter>£¨ÉèΪ 1£©£¬Ôò°´ÕÕ×Öĸ˳Ðò½µÐòÅÅÁС£ - </para> - <para> - <example> - <title>¼òµ¥µÄ <function>scandir</function> Àý×Ó</title> - <programlisting role="php"> +<!-- EN-Revision: 1.9 Maintainer: dallas Status: ready --> +<refentry id="function.scandir"> + <refnamediv> + <refname>scandir</refname> + <refpurpose>ÁгöÖ¸¶¨Â·¾¶ÖеÄÎļþºÍĿ¼</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>array</type><methodname>scandir</methodname> + <methodparam><type>string</type><parameter>directory</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>sorting_order</parameter></methodparam> + <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> + </methodsynopsis> + <para> + ·µ»ØÒ»¸ö <type>array</type>£¬°üº¬ÓÐ + <parameter>directory</parameter> ÖеÄÎļþºÍĿ¼¡£ + </para> + + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>directory</parameter></term> + <listitem> + <para> + Òª±»ä¯ÀÀµÄĿ¼ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>sorting_order</parameter></term> + <listitem> + <para> + ĬÈϵÄÅÅÐò˳ÐòÊǰ´×ÖĸÉýÐòÅÅÁС£Èç¹ûʹÓÃÁË¿ÉÑ¡²ÎÊý + <parameter>sorting_order</parameter>£¨ÉèΪ + 1£©£¬ÔòÅÅÐò˳ÐòÊǰ´×Öĸ½µÐòÅÅÁС£ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>context</parameter></term> + <listitem> + <para> + <parameter>context</parameter> ²ÎÊýµÄ˵Ã÷¼ûÊÖ²áÖÐµÄ + <link linkend="ref.stream">Streams API</link> Ò»Õ¡£ + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + ³É¹¦Ôò·µ»Ø°üº¬ÓÐÎļþÃûµÄ <type>array</type>£¬Èç¹ûʧ°ÜÔò·µ»Ø + &false;¡£Èç¹û <parameter>directory</parameter> + ²»ÊǸöĿ¼£¬Ôò·µ»Ø²¼¶ûÖµ &false; ²¢Éú³ÉÒ»Ìõ + <constant>E_WARNING</constant> ¼¶µÄ´íÎó¡£ + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Ò»¸ö¼òµ¥µÄ <function>scandir</function> Àý×Ó</title> + <programlisting role="php"> <![CDATA[ <?php $dir = '/tmp'; @@ -39,8 +82,12 @@ print_r($files1); print_r($files2); - -/* Outputs something like: +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ Array ( [0] => . @@ -57,16 +104,14 @@ [3] => .. [4] => . ) -*/ -?> ]]> - </programlisting> - </example> - </para> - <para> - <example> - <title><function>scandir</function> ÔÚ PHP 4 ÖеÄʵÏÖ</title> - <programlisting role="php"> + </screen> + </example> + </para> + <para> + <example> + <title><function>scandir</function> ÔÚ PHP 4 ÖеÄʵÏÖ</title> + <programlisting role="php"> <![CDATA[ <?php $dir = "/tmp"; @@ -83,7 +128,12 @@ print_r($files); -/* Outputs something like: +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ Array ( [0] => . @@ -100,18 +150,30 @@ [3] => .. [4] => . ) -*/ -?> ]]> - </programlisting> - </example> - </para> - <para> - ²Î¼û <function>opendir</function>£¬<function>readdir</function>£¬<function>glob</function>£¬<function>is_dir</function> - ºÍ <function>sort</function>¡£ - </para> - </refsect1> - </refentry> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + &tip.fopen-wrapper; + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>opendir</function></member> + <member><function>readdir</function></member> + <member><function>glob</function></member> + <member><function>is_dir</function></member> + <member><function>sort</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/filesystem/functions/chmod.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-zh/reference/filesystem/functions/chmod.xml diff -u phpdoc-zh/reference/filesystem/functions/chmod.xml:1.5 phpdoc-zh/reference/filesystem/functions/chmod.xml:1.6 --- phpdoc-zh/reference/filesystem/functions/chmod.xml:1.5 Tue Aug 16 10:24:58 2005 +++ phpdoc-zh/reference/filesystem/functions/chmod.xml Wed Aug 31 12:19:13 2005 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.5 $ --> -<!-- $Author: lm92 $ --> -<!-- EN-Revision: 1.12 Maintainer: dallas Status: ready --> +<!-- $Revision: 1.6 $ --> +<!-- $Author: dallas $ --> +<!-- EN-Revision: 1.13 Maintainer: dallas Status: ready --> <refentry id="function.chmod"> <refnamediv> <refname>chmod</refname> @@ -67,14 +67,15 @@ </para> <note> <para> - µ±Ç°Óû§Ö¸µÄÊÇÖ´ÐÐ PHP µÄÓû§¡£ºÜ¿ÉÄܺÍͨ³£µÄ shell »òÕß FTP Óû§²»ÊÇͬһ¸ö¡£ + µ±Ç°Óû§Ö¸µÄÊÇÖ´ÐÐ PHP µÄÓû§¡£ºÜ¿ÉÄܺÍͨ³£µÄ shell »òÕß FTP + Óû§²»ÊÇͬһ¸ö¡£ÔÚ´ó¶àÊýϵͳÏÂÎļþģʽֻÄܱ»ÎļþËùÓÐÕßµÄÓû§¸Ä±ä¡£ </para> </note> ¬e.no-remote; <note> <simpara> µ± &safemode; ´ò¿ªµÄʱºò£¬PHP »á¼ì²éËù²Ù×÷µÄÎļþÊÇ·ñºÍÕýÔÚÖ´ÐеĽű¾¾ßÓÐÏàͬµÄ - UID £¨ËùÓÐÕߣ©¡£Òª×¢ÒâµÄÊÇ£¬Äã²¢²»ÄÜÐÞ¸Ä SUID¡¢SGID ºÍ sticky bits¡£ + UID £¨ËùÓÐÕߣ©¡£Òª×¢ÒâµÄÊÇ£¬²»ÄÜÐÞ¸Ä SUID¡¢SGID ºÍ sticky bits¡£ </simpara> </note> <para>
http://cvs.php.net/diff.php/phpdoc-zh/reference/dir/functions/chdir.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-zh/reference/dir/functions/chdir.xml diff -u phpdoc-zh/reference/dir/functions/chdir.xml:1.3 phpdoc-zh/reference/dir/functions/chdir.xml:1.4 --- phpdoc-zh/reference/dir/functions/chdir.xml:1.3 Sat Feb 22 07:31:42 2003 +++ phpdoc-zh/reference/dir/functions/chdir.xml Wed Aug 31 12:19:12 2005 @@ -1,27 +1,93 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> - <refentry id="function.chdir"> - <refnamediv> - <refname>chdir</refname> - <refpurpose>¸Ä±äĿ¼</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>bool</type><methodname>chdir</methodname> - <methodparam><type>string</type><parameter>directory</parameter></methodparam> - </methodsynopsis> - <para> - ½« PHP µÄµ±Ç°Ä¿Â¼¸ÄΪ - <parameter>directory</parameter>¡£&return.success; - </para> - <para> - ²Î¼û <function>getcwd</function>¡£ - </para> - </refsect1> - </refentry> +<!-- EN-Revision: 1.13 Maintainer: dallas Status: ready --> +<refentry id="function.chdir"> + <refnamediv> + <refname>chdir</refname> + <refpurpose>¸Ä±äĿ¼</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>bool</type><methodname>chdir</methodname> + <methodparam><type>string</type><parameter>directory</parameter></methodparam> + </methodsynopsis> + <para> + ½« PHP µÄµ±Ç°Ä¿Â¼¸ÄΪ + <parameter>directory</parameter>¡£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>directory</parameter></term> + <listitem> + <para> + еĵ±Ç°Ä¿Â¼ + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.success; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>chdir</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// current directory +echo getcwd() . "\n"; + +chdir('public_html'); + +// current directory +echo getcwd() . "\n"; + +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +/home/vincent +/home/vincent/public_html +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + ¬e.sm.uidcheck.dir; + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>getcwd</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/dir/functions/chroot.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-zh/reference/dir/functions/chroot.xml diff -u phpdoc-zh/reference/dir/functions/chroot.xml:1.6 phpdoc-zh/reference/dir/functions/chroot.xml:1.7 --- phpdoc-zh/reference/dir/functions/chroot.xml:1.6 Mon Aug 18 16:17:48 2003 +++ phpdoc-zh/reference/dir/functions/chroot.xml Wed Aug 31 12:19:12 2005 @@ -1,29 +1,57 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> - <refentry id="function.chroot"> - <refnamediv> - <refname>chroot</refname> - <refpurpose>¸Ä±ä¸ùĿ¼</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>bool</type><methodname>chroot</methodname> - <methodparam><type>string</type><parameter>directory</parameter></methodparam> - </methodsynopsis> - <para> - ½«µ±Ç°½ø³ÌµÄ¸ùĿ¼¸Ä±äΪ - <parameter>directory</parameter>¡£&return.success; - </para> - <para> - ±¾º¯Êý½öÔÚÄãµÄϵͳ֧³ÖÇÒÔËÐÐÓÚ CLI£¬CGI - »òǶÈë SAPI °æ±¾Ê±²ÅÄÜÕýÈ·¹¤×÷¡£ - </para> - ¬e.no-windows; - </refsect1> - </refentry> +<!-- EN-Revision: 1.11 Maintainer: dallas Status: ready --> +<refentry id="function.chroot"> + <refnamediv> + <refname>chroot</refname> + <refpurpose>¸Ä±ä¸ùĿ¼</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>bool</type><methodname>chroot</methodname> + <methodparam><type>string</type><parameter>directory</parameter></methodparam> + </methodsynopsis> + <para> + ½«µ±Ç°½ø³ÌµÄ¸ùĿ¼¸Ä±äΪ + <parameter>directory</parameter>¡£ + </para> + <para> + ±¾º¯Êý½öÔÚϵͳ֧³ÖÇÒÔËÐÐÓÚ CLI£¬CGI + »òǶÈë SAPI °æ±¾Ê±²ÅÄÜÕýÈ·¹¤×÷¡£´ËÍâ±¾º¯Êý»¹ÐèÒª root ȨÏÞ¡£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>directory</parameter></term> + <listitem> + <para> + ÐÂĿ¼ + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.success; + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + ¬e.no-windows; + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/dir/functions/class.dir.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-zh/reference/dir/functions/class.dir.xml diff -u phpdoc-zh/reference/dir/functions/class.dir.xml:1.4 phpdoc-zh/reference/dir/functions/class.dir.xml:1.5 --- phpdoc-zh/reference/dir/functions/class.dir.xml:1.4 Mon Aug 18 16:17:48 2003 +++ phpdoc-zh/reference/dir/functions/class.dir.xml Wed Aug 31 12:19:12 2005 @@ -1,75 +1,98 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> - <refentry id="class.dir"> - <refnamediv> - <refname>dir</refname> - <refpurpose>directory Àà</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <classsynopsis> - <ooclass><classname>dir</classname></ooclass> - <constructorsynopsis> - <methodname>dir</methodname> - <methodparam><type>string</type><parameter>directory</parameter></methodparam> - </constructorsynopsis> - <fieldsynopsis> - <type>string</type><varname>path</varname> - </fieldsynopsis> - <fieldsynopsis> - <type>resource</type><varname>handle</varname> - </fieldsynopsis> - <methodsynopsis><type>string</type><methodname>read</methodname><void/></methodsynopsis> - <methodsynopsis><type>void</type><methodname>rewind</methodname><void/></methodsynopsis> - <methodsynopsis><type>void</type><methodname>close</methodname><void/></methodsynopsis> - </classsynopsis> - <para> - ÕâÊǸö·Â̡̾Ïò¶ÔÏóµÄ»úÖÆÀ´¶Áȡһ¸öĿ¼¡£¸ø¶¨µÄ - <parameter>directory</parameter> ±»´ò¿ª¡£Ò»µ©Ä¿Â¼±»´ò¿ª£¬ÓÐÁ½¸öÊôÐÔ¿ÉÓá£handle - ÊôÐÔ¿ÉÒÔÓÃÔÚÆäËüĿ¼º¯ÊýÀýÈç - <function>readdir</function>£¬<function>rewinddir</function> ºÍ - <function>closedir</function> ÖС£path - ÊôÐÔ±»ÉèΪ±»´ò¿ªµÄĿ¼·¾¶¡£ÓÐÈý¸ö·½·¨¿ÉÓãºread£¬rewind ºÍ close¡£ - </para> +<!-- EN-Revision: 1.10 Maintainer: dallas Status: ready --> +<refentry id="class.dir"> + <refnamediv> + <refname>dir</refname> + <refpurpose>directory Àà</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <classsynopsis> + <ooclass><classname>dir</classname></ooclass> + <constructorsynopsis> + <methodname>dir</methodname> + <methodparam><type>string</type><parameter>directory</parameter></methodparam> + </constructorsynopsis> + <fieldsynopsis> + <type>string</type><varname>path</varname> + </fieldsynopsis> + <fieldsynopsis> + <type>resource</type><varname>handle</varname> + </fieldsynopsis> + <methodsynopsis><type>string</type><methodname>read</methodname><void/></methodsynopsis> + <methodsynopsis><type>void</type><methodname>rewind</methodname><void/></methodsynopsis> + <methodsynopsis><type>void</type><methodname>close</methodname><void/></methodsynopsis> + </classsynopsis> + <para> + ÕâÊǸö·Â̡̾Ïò¶ÔÏóµÄ»úÖÆÀ´¶Áȡһ¸öĿ¼¡£¸ø¶¨µÄ + <parameter>directory</parameter> ±»´ò¿ª¡£Ò»µ©Ä¿Â¼±»´ò¿ª£¬ÓÐÁ½¸öÊôÐÔ¿ÉÓá£handle + ÊôÐÔ¿ÉÒÔÓÃÔÚÆäËüĿ¼º¯ÊýÀýÈç + <function>readdir</function>£¬<function>rewinddir</function> ºÍ + <function>closedir</function> ÖС£path + ÊôÐÔ±»ÉèΪ±»´ò¿ªµÄĿ¼·¾¶¡£ÓÐÈý¸ö·½·¨¿ÉÓãºread£¬rewind ºÍ close¡£ + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>dir</function> Àý×Ó</title> <para> ÇëÁôÒâÏÂÃæÀý×ÓÖмì²é <function>dir</function> ·µ»ØÖµµÄ·ç¸ñ¡£ÎÒÃÇÃ÷È·µØ²âÊÔ·µ»ØÖµÊÇ·ñÈ«µÈÓÚ£¨ÖµºÍÀàÐͶ¼Ïàͬ £ ¸ü¶àÐÅÏ¢²Î¼û<link linkend="language.operators.comparison">±È½ÏÔËËã·û</link>£©&false;£¬·ñÔòÈκÎĿ¼ÏîµÄÃû³ÆÇóֵΪ &false; µÄ¶¼»áµ¼ÖÂÑ»·Í£Ö¹¡£ - <example> - <title><function>dir</function> Àý×Ó</title> - <programlisting role="php"> + </para> + <programlisting role="php"> <![CDATA[ <?php -$d = dir("/etc"); -echo "Handle: ".$d->handle."<br>\n"; -echo "Path: ".$d->path."<br>\n"; +$d = dir("/etc/php5"); +echo "Handle: " . $d->handle . "\n"; +echo "Path: " . $d->path . "\n"; while (false !== ($entry = $d->read())) { - echo $entry."<br>\n"; + echo $entry."\n"; } $d->close(); ?> ]]> - </programlisting> - </example> - </para> - <note> - <para> - read ·½·¨·µ»ØµÄĿ¼ÏîµÄ˳ÐòÒÀÀµÓÚϵͳ¡£ - </para> - </note> - <note> - <para> - ±¾º¯Êý¶¨ÒåÁËÄÚ²¿Àà - <classname>Directory</classname>£¬Òâζ×Ų»ÄÜÔÙÓÃͬÑùµÄÃû×Ö¶¨ÒåÓû§×Ô¼ºµÄÀà¡£PHP - Ô¤¶¨ÒåÀàµÄÍêÕûÁбí¼û<link - linkend="reserved.classes">Ô¤¶¨ÒåÀà</link>Ò»½Ú¡£ - </para> - </note> - </refsect1> - </refentry> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +Handle: Resource id #2 +Path: /etc/php5 +. +.. +apache +cgi +cli +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + read ·½·¨·µ»ØµÄĿ¼ÏîµÄ˳ÐòÒÀÀµÓÚϵͳ¡£ + </para> + </note> + <note> + <para> + ±¾º¯Êý¶¨ÒåÁËÄÚ²¿Àà + <classname>Directory</classname>£¬Òâζ×Ų»ÄÜÔÙÓÃͬÑùµÄÃû×Ö¶¨ÒåÓû§×Ô¼ºµÄÀà¡£PHP + Ô¤¶¨ÒåÀàµÄÍêÕûÁбí¼û<link + linkend="reserved.classes">Ô¤¶¨ÒåÀà</link>Ò»½Ú¡£ + </para> + </note> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/dir/functions/closedir.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/dir/functions/closedir.xml diff -u phpdoc-zh/reference/dir/functions/closedir.xml:1.2 phpdoc-zh/reference/dir/functions/closedir.xml:1.3 --- phpdoc-zh/reference/dir/functions/closedir.xml:1.2 Sun Sep 29 23:08:49 2002 +++ phpdoc-zh/reference/dir/functions/closedir.xml Wed Aug 31 12:19:12 2005 @@ -1,24 +1,66 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> - <refentry id="function.closedir"> - <refnamediv> - <refname>closedir</refname> - <refpurpose>¹Ø±ÕĿ¼¾ä±ú</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>void</type><methodname>closedir</methodname> - <methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam> - </methodsynopsis> - <para> - ¹Ø±ÕÓÉ <parameter>dir_handle</parameter> Ö¸¶¨µÄĿ¼Á÷¡£Á÷±ØÐë֮ǰ±» - <function>opendir</function> Ëù´ò¿ª¡£ - </para> - </refsect1> - </refentry> +<!-- EN-Revision: 1.7 Maintainer: dallas Status: ready --> +<refentry id="function.closedir"> + <refnamediv> + <refname>closedir</refname> + <refpurpose>¹Ø±ÕĿ¼¾ä±ú</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>void</type><methodname>closedir</methodname> + <methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam> + </methodsynopsis> + <para> + ¹Ø±ÕÓÉ <parameter>dir_handle</parameter> Ö¸¶¨µÄĿ¼Á÷¡£Á÷±ØÐë֮ǰ±» + <function>opendir</function> Ëù´ò¿ª¡£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>dir_handle</parameter></term> + <listitem> + <para> + Ŀ¼¾ä±úµÄ <type>resource</type>£¬Ö®Ç°ÓÉ + <function>opendir</function> Ëù´ò¿ªµÄ¡£ + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>closedir</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php +$dir = "/etc/php5/"; + +// Open a known directory, read directory into variable and then close +if (is_dir($dir)) { + if ($dh = opendir($dir)) { + $directory = readdir($dh); + closedir($dh); + } +} +?> +]]> + </programlisting> + </example> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/dir/functions/getcwd.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/dir/functions/getcwd.xml diff -u phpdoc-zh/reference/dir/functions/getcwd.xml:1.2 phpdoc-zh/reference/dir/functions/getcwd.xml:1.3 --- phpdoc-zh/reference/dir/functions/getcwd.xml:1.2 Sun Sep 29 23:08:49 2002 +++ phpdoc-zh/reference/dir/functions/getcwd.xml Wed Aug 31 12:19:12 2005 @@ -1,26 +1,76 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> - <refentry id="function.getcwd"> - <refnamediv> - <refname>getcwd</refname> - <refpurpose>È¡µÃµ±Ç°¹¤×÷Ŀ¼</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>string</type><methodname>getcwd</methodname> - <void/> - </methodsynopsis> - <para> - ·µ»Øµ±Ç°¹¤×÷Ŀ¼¡£ - </para> - <para> - ²Î¼û <function>chdir</function>¡£ - </para> - </refsect1> - </refentry> +<!-- EN-Revision: 1.11 Maintainer: dallas Status: ready --> +<refentry id="function.getcwd"> + <refnamediv> + <refname>getcwd</refname> + <refpurpose>È¡µÃµ±Ç°¹¤×÷Ŀ¼</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type><methodname>getcwd</methodname> + <void/> + </methodsynopsis> + <para> + È¡µÃµ±Ç°¹¤×÷Ŀ¼¡£ + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + ³É¹¦Ôò·µ»Øµ±Ç°¹¤×÷Ŀ¼£¬Ê§°Ü·µ»Ø &false;¡£ + </para> + <para> + ÔÚijЩ Unix µÄ±äÖÖÏ£¬Èç¹ûÈκθ¸Ä¿Â¼Ã»ÓÐÉ趨¿É¶Á»òËÑË÷ģʽ£¬¼´Ê¹µ±Ç°Ä¿Â¼É趨ÁË£¬<function>getcwd</function> + »¹Êǻ᷵»Ø &false;¡£ÓйØÄ£Ê½ÓëȨÏ޵ĸü¶àÐÅÏ¢¼û <function>chmod</function>¡£ + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>getcwd</function> Àý×Ó</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// current directory +echo getcwd() . "\n"; + +chdir('cvs'); + +// current directory +echo getcwd() . "\n"; + +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +/home/didou +/home/didou/cvs +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>chdir</function></member> + <member><function>chmod</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/dir/functions/opendir.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-zh/reference/dir/functions/opendir.xml diff -u phpdoc-zh/reference/dir/functions/opendir.xml:1.5 phpdoc-zh/reference/dir/functions/opendir.xml:1.6 --- phpdoc-zh/reference/dir/functions/opendir.xml:1.5 Mon Aug 18 16:17:48 2003 +++ phpdoc-zh/reference/dir/functions/opendir.xml Wed Aug 31 12:19:12 2005 @@ -1,63 +1,146 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> - <refentry id="function.opendir"> - <refnamediv> - <refname>opendir</refname> - <refpurpose>´ò¿ªÄ¿Â¼¾ä±ú</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>resource</type><methodname>opendir</methodname> - <methodparam><type>string</type><parameter>path</parameter></methodparam> - </methodsynopsis> - <para> - ·µ»ØÒ»¸öĿ¼¾ä±ú£¬¿ÉÒÔÔÚÖ®ºóÓÃÔÚ - <function>closedir</function>£¬<function>readdir</function> ºÍ - <function>rewinddir</function> µ÷ÓÃÖС£ - </para> - <para> - Èç¹û <parameter>path</parameter> - ²»ÊÇÒ»¸öºÏ·¨µÄĿ¼»òÕßÒòΪȨÏÞÏÞÖÆ»òÎļþϵͳ´íÎó¶ø²»ÄÜ´ò¿ªÄ¿Â¼£¬<function>opendir</function> - ·µ»Ø &false; ²¢²úÉúÒ»¸ö <link linkend="errorfunc.constants">E_WARNING</link> - ¼¶±ðµÄ PHP ´íÎóÐÅÏ¢¡£¿ÉÒÔÔÚ <function>opendir</function> - Ç°Ãæ¼ÓÉÏ¡°<link linkend="language.operators.errorcontrol">@</link>¡±·ûºÅÀ´ÒÖÖÆ´íÎóÐÅÏ¢µÄÊä³ö¡£ - </para> - <para> - <example> - <title><function>opendir</function> Àý×Ó</title> - <programlisting role="php"> +<!-- EN-Revision: 1.15 Maintainer: dallas Status: ready --> +<refentry id="function.opendir"> + <refnamediv> + <refname>opendir</refname> + <refpurpose>´ò¿ªÄ¿Â¼¾ä±ú</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>resource</type><methodname>opendir</methodname> + <methodparam><type>string</type><parameter>path</parameter></methodparam> + <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> + </methodsynopsis> + <para> + ´ò¿ªÒ»¸öĿ¼¾ä±ú£¬¿ÉÓÃÓÚÖ®ºóµÄ + <function>closedir</function>£¬<function>readdir</function> ºÍ + <function>rewinddir</function> µ÷ÓÃÖС£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>path</parameter></term> + <listitem> + <para> + Òª´ò¿ªµÄĿ¼·¾¶ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>context</parameter></term> + <listitem> + <para> + <parameter>context</parameter> ²ÎÊýµÄ˵Ã÷¼ûÊÖ²áÖÐµÄ + <link linkend="ref.stream">Streams API</link> Ò»Õ¡£ + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Èç¹û³É¹¦Ôò·µ»ØÄ¿Â¼¾ä±úµÄ <type>resource</type>£¬Ê§°ÜÔò·µ»Ø &false;¡£ + </para> + <para> + Èç¹û <parameter>path</parameter> + ²»ÊÇÒ»¸öºÏ·¨µÄĿ¼»òÕßÒòΪȨÏÞÏÞÖÆ»òÎļþϵͳ´íÎó¶ø²»ÄÜ´ò¿ªÄ¿Â¼£¬<function>opendir</function> + ·µ»Ø &false; ²¢²úÉúÒ»¸ö <link linkend="errorfunc.constants">E_WARNING</link> + ¼¶±ðµÄ PHP ´íÎóÐÅÏ¢¡£¿ÉÒÔÔÚ <function>opendir</function> + Ç°Ãæ¼ÓÉÏ¡°<link linkend="language.operators.errorcontrol">@</link>¡±·ûºÅÀ´ÒÖÖÆ´íÎóÐÅÏ¢µÄÊä³ö¡£ + </para> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>5.0.0</entry> + <entry> + <parameter>path</parameter> Ö§³Ö <literal>ftp://</literal> + URL wrapper + </entry> + </row> + <row> + <entry>4.3.0</entry> + <entry> + <parameter>path</parameter> ¿ÉÒÔÊÇÈκÎÖ§³ÖĿ¼ÁбíµÄ + URL£¬²»¹ýÔÚ PHP 4 ÖÐÖ»ÓÐ <literal>file://</literal> + URL wrapper Ö§³Ö´Ë¹¦ÄÜ + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>opendir</function> Àý×Ó</title> + <programlisting role="php"> <![CDATA[ <?php -$dir = "/tmp/"; +$dir = "/etc/php5/"; + // Open a known directory, and proceed to read its contents if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { - print "filename: $file : filetype: " . filetype($dir . $file) . "\n"; + echo "filename: $file : filetype: " . filetype($dir . $file) . "\n"; } closedir($dh); } } ?> ]]> - </programlisting> - </example> - </para> - <para> - ×Ô <literal>PHP 4.3.0</literal> Æð <parameter>path</parameter> - Ò²¿ÉÒÔÊÇÈκÎÖ§³ÖĿ¼ÁбíµÄ URL£¬µ«ÊÇÔÚ <literal>PHP 4.3</literal> - ÖÐÖ»Ö§³Ö <literal>file://</literal> url ÐÒé¡£×Ô <literal>PHP 5.0.0</literal> - Æð£¬Ò²°üÀ¨ÁË <literal>ftp://</literal> url ÐÒéµÄÖ§³Ö¡£ - </para> - <para> - ²Î¼û <function>is_dir</function>£¬<function>readdir</function> - ºÍ <link linkend="class.dir">Dir</link>¡£ - </para> - </refsect1> - </refentry> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +filename: . : filetype: dir +filename: .. : filetype: dir +filename: apache : filetype: dir +filename: cgi : filetype: dir +filename: cli : filetype: dir +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>is_dir</function></member> + <member><function>readdir</function></member> + <member><link linkend="class.dir">Dir</link></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/dir/functions/readdir.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-zh/reference/dir/functions/readdir.xml diff -u phpdoc-zh/reference/dir/functions/readdir.xml:1.4 phpdoc-zh/reference/dir/functions/readdir.xml:1.5 --- phpdoc-zh/reference/dir/functions/readdir.xml:1.4 Mon Aug 18 16:17:48 2003 +++ phpdoc-zh/reference/dir/functions/readdir.xml Wed Aug 31 12:19:12 2005 @@ -1,34 +1,64 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> - <refentry id="function.readdir"> - <refnamediv> - <refname>readdir</refname> - <refpurpose>´ÓĿ¼¾ä±úÖжÁÈ¡ÌõÄ¿</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>string</type><methodname>readdir</methodname> - <methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam> - </methodsynopsis> - <para> - ·µ»ØÄ¿Â¼ÖÐÏÂÒ»¸öÎļþµÄÎļþÃû¡£ÎļþÃûÒÔÔÚÎļþϵͳÖеÄÅÅÐò·µ»Ø¡£ - </para> +<!-- EN-Revision: 1.9 Maintainer: dallas Status: ready --> +<refentry id="function.readdir"> + <refnamediv> + <refname>readdir</refname> + <refpurpose>´ÓĿ¼¾ä±úÖжÁÈ¡ÌõÄ¿</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type><methodname>readdir</methodname> + <methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam> + </methodsynopsis> + <para> + ·µ»ØÄ¿Â¼ÖÐÏÂÒ»¸öÎļþµÄÎļþÃû¡£ÎļþÃûÒÔÔÚÎļþϵͳÖеÄÅÅÐò·µ»Ø¡£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>dir_handle</parameter></term> + <listitem> + <para> + Ŀ¼¾ä±úµÄ <type>resource</type>£¬Ö®Ç°ÓÉ + <function>opendir</function> ´ò¿ª + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + ³É¹¦Ôò·µ»ØÎļþÃû£¬Ê§°Ü·µ»Ø &false;¡£ + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>ÁгöĿ¼ÖеÄËùÓÐÎļþ</title> <para> ÇëÁôÒâÏÂÃæÀý×ÓÖмì²é <function>readdir</function> - ·µ»ØÖµµÄ·ç¸ñ¡£ÎÒÃÇÃ÷È·µØ²âÊÔ·µ»ØÖµÊÇ·ñÈ«µÈÓÚ£¨ÖµºÍÀàÐͶ¼Ïàͬ £ ¸ü¶àÐÅÏ¢²Î¼û<link + ·µ»ØÖµµÄ·ç¸ñ¡£ÕâÀïÃ÷È·µØ²âÊÔ·µ»ØÖµÊÇ·ñÈ«µÈÓÚ£¨ÖµºÍÀàÐͶ¼Ïàͬ¡ª¡ª¸ü¶àÐÅÏ¢²Î¼û<link linkend="language.operators.comparison">±È½ÏÔËËã·û</link>£©&false;£¬·ñÔòÈκÎĿ¼ÏîµÄÃû³ÆÇóֵΪ &false; µÄ¶¼»áµ¼ÖÂÑ»·Í£Ö¹£¨ÀýÈçÒ»¸öĿ¼ÃûΪ¡°0¡±£©¡£ </para> - <para> - <example> - <title>ÁгöĿ¼ÖеÄËùÓÐÎļþ</title> - <programlisting role="php"> + <programlisting role="php"> <![CDATA[ <?php // ×¢ÒâÔÚ 4.0.0-RC2 ֮ǰ²»´æÔÚ !== ÔËËã·û + if ($handle = opendir('/path/to/files')) { echo "Directory handle: $handle\n"; echo "Files:\n"; @@ -47,18 +77,13 @@ } ?> ]]> - </programlisting> - </example> - </para> - <para> - ×¢Òâ <function>readdir</function> ½«»á·µ»Ø <literal>.</literal> ºÍ - <literal>..</literal> ÌõÄ¿¡£Èç¹û²»ÏëÒªËüÃÇ£¬Ö»Òª¹ýÂ˵ô¼´¿É£º - <example> - <title> - Áгöµ±Ç°Ä¿Â¼µÄËùÓÐÎļþ²¢È¥µô <literal>.</literal> - ºÍ <literal>..</literal> - </title> - <programlisting role="php"> + </programlisting> + </example> + </para> + <para> + <example> + <title>Áгöµ±Ç°Ä¿Â¼µÄËùÓÐÎļþ²¢È¥µô <literal>.</literal> ºÍ <literal>..</literal></title> + <programlisting role="php"> <![CDATA[ <?php if ($handle = opendir('.')) { @@ -71,14 +96,21 @@ } ?> ]]> - </programlisting> - </example> - </para> - <para> - ²Î¼û <function>is_dir</function> ºÍ <function>glob</function>¡£ - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>is_dir</function></member> + <member><function>glob</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/dir/functions/rewinddir.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/dir/functions/rewinddir.xml diff -u phpdoc-zh/reference/dir/functions/rewinddir.xml:1.2 phpdoc-zh/reference/dir/functions/rewinddir.xml:1.3 --- phpdoc-zh/reference/dir/functions/rewinddir.xml:1.2 Sun Sep 29 23:08:49 2002 +++ phpdoc-zh/reference/dir/functions/rewinddir.xml Wed Aug 31 12:19:12 2005 @@ -1,24 +1,41 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> - <refentry id="function.rewinddir"> - <refnamediv> - <refname>rewinddir</refname> - <refpurpose>µ¹»ØÄ¿Â¼¾ä±ú</refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>void</type><methodname>rewinddir</methodname> - <methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam> - </methodsynopsis> - <para> - ½« <parameter>dir_handle</parameter> Ö¸¶¨µÄĿ¼Á÷ÖØÖõ½Ä¿Â¼µÄ¿ªÍ·¡£ - </para> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<refentry id="function.rewinddir"> + <refnamediv> + <refname>rewinddir</refname> + <refpurpose>µ¹»ØÄ¿Â¼¾ä±ú</refpurpose> + </refnamediv> - </refsect1> - </refentry> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>void</type><methodname>rewinddir</methodname> + <methodparam><type>resource</type><parameter>dir_handle</parameter></methodparam> + </methodsynopsis> + <para> + ½« <parameter>dir_handle</parameter> Ö¸¶¨µÄĿ¼Á÷ÖØÖõ½Ä¿Â¼µÄ¿ªÍ·¡£ + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>dir_handle</parameter></term> + <listitem> + <para> + Ŀ¼¾ä±úµÄ <type>resource</type>£¬Ö®Ç°ÓÉ + <function>opendir</function> ´ò¿ª + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/dir/functions/scandir.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-zh/reference/dir/functions/scandir.xml diff -u phpdoc-zh/reference/dir/functions/scandir.xml:1.1 phpdoc-zh/reference/dir/functions/scandir.xml:1.2 --- phpdoc-zh/reference/dir/functions/scandir.xml:1.1 Sun Aug 24 16:35:05 2003 +++ phpdoc-zh/reference/dir/functions/scandir.xml Wed Aug 31 12:19:12 2005 @@ -1,36 +1,79 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.1 Maintainer: dallas Status: ready --> - <refentry id="function.scandir"> - <refnamediv> - <refname>scandir</refname> - <refpurpose> - ÁгöÖ¸¶¨Â·¾¶ÖеÄÎļþºÍĿ¼ - </refpurpose> - </refnamediv> - <refsect1> - <title>˵Ã÷</title> - <methodsynopsis> - <type>array</type><methodname>scandir</methodname> - <methodparam><type>string</type><parameter>directory</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>sorting_order</parameter></methodparam> - </methodsynopsis> - <para> - ·µ»ØÒ»¸ö <type>array</type>£¬°üº¬ÓÐ - <parameter>directory</parameter> ÖеÄÎļþºÍĿ¼¡£Èç¹û - <parameter>directory</parameter> ²»ÊÇÒ»¸öĿ¼£¬Ôò·µ»Ø²¼¶ûÖµ - &false;£¬²¢²úÉúÒ»Ìõ - <constant>E_WARNING</constant> ¼¶±ðµÄ´íÎó¡£ - </para> - <para> - ĬÈÏÇé¿öÏ£¬·µ»ØÖµÊǰ´ÕÕ×Öĸ˳ÐòÉýÐòÅÅÁеġ£Èç¹ûʹÓÃÁË¿ÉÑ¡²ÎÊý - <parameter>sorting_order</parameter>£¨ÉèΪ 1£©£¬Ôò°´ÕÕ×Öĸ˳Ðò½µÐòÅÅÁС£ - </para> - <para> - <example> - <title>¼òµ¥µÄ <function>scandir</function> Àý×Ó</title> - <programlisting role="php"> +<!-- EN-Revision: 1.9 Maintainer: dallas Status: ready --> +<refentry id="function.scandir"> + <refnamediv> + <refname>scandir</refname> + <refpurpose>ÁгöÖ¸¶¨Â·¾¶ÖеÄÎļþºÍĿ¼</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>array</type><methodname>scandir</methodname> + <methodparam><type>string</type><parameter>directory</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>sorting_order</parameter></methodparam> + <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> + </methodsynopsis> + <para> + ·µ»ØÒ»¸ö <type>array</type>£¬°üº¬ÓÐ + <parameter>directory</parameter> ÖеÄÎļþºÍĿ¼¡£ + </para> + + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>directory</parameter></term> + <listitem> + <para> + Òª±»ä¯ÀÀµÄĿ¼ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>sorting_order</parameter></term> + <listitem> + <para> + ĬÈϵÄÅÅÐò˳ÐòÊǰ´×ÖĸÉýÐòÅÅÁС£Èç¹ûʹÓÃÁË¿ÉÑ¡²ÎÊý + <parameter>sorting_order</parameter>£¨ÉèΪ + 1£©£¬ÔòÅÅÐò˳ÐòÊǰ´×Öĸ½µÐòÅÅÁС£ + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>context</parameter></term> + <listitem> + <para> + <parameter>context</parameter> ²ÎÊýµÄ˵Ã÷¼ûÊÖ²áÖÐµÄ + <link linkend="ref.stream">Streams API</link> Ò»Õ¡£ + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + ³É¹¦Ôò·µ»Ø°üº¬ÓÐÎļþÃûµÄ <type>array</type>£¬Èç¹ûʧ°ÜÔò·µ»Ø + &false;¡£Èç¹û <parameter>directory</parameter> + ²»ÊǸöĿ¼£¬Ôò·µ»Ø²¼¶ûÖµ &false; ²¢Éú³ÉÒ»Ìõ + <constant>E_WARNING</constant> ¼¶µÄ´íÎó¡£ + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Ò»¸ö¼òµ¥µÄ <function>scandir</function> Àý×Ó</title> + <programlisting role="php"> <![CDATA[ <?php $dir = '/tmp'; @@ -39,8 +82,12 @@ print_r($files1); print_r($files2); - -/* Outputs something like: +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ Array ( [0] => . @@ -57,16 +104,14 @@ [3] => .. [4] => . ) -*/ -?> ]]> - </programlisting> - </example> - </para> - <para> - <example> - <title><function>scandir</function> ÔÚ PHP 4 ÖеÄʵÏÖ</title> - <programlisting role="php"> + </screen> + </example> + </para> + <para> + <example> + <title><function>scandir</function> ÔÚ PHP 4 ÖеÄʵÏÖ</title> + <programlisting role="php"> <![CDATA[ <?php $dir = "/tmp"; @@ -83,7 +128,12 @@ print_r($files); -/* Outputs something like: +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ Array ( [0] => . @@ -100,18 +150,30 @@ [3] => .. [4] => . ) -*/ -?> ]]> - </programlisting> - </example> - </para> - <para> - ²Î¼û <function>opendir</function>£¬<function>readdir</function>£¬<function>glob</function>£¬<function>is_dir</function> - ºÍ <function>sort</function>¡£ - </para> - </refsect1> - </refentry> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + &tip.fopen-wrapper; + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>opendir</function></member> + <member><function>readdir</function></member> + <member><function>glob</function></member> + <member><function>is_dir</function></member> + <member><function>sort</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/filesystem/functions/chmod.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-zh/reference/filesystem/functions/chmod.xml diff -u phpdoc-zh/reference/filesystem/functions/chmod.xml:1.5 phpdoc-zh/reference/filesystem/functions/chmod.xml:1.6 --- phpdoc-zh/reference/filesystem/functions/chmod.xml:1.5 Tue Aug 16 10:24:58 2005 +++ phpdoc-zh/reference/filesystem/functions/chmod.xml Wed Aug 31 12:19:13 2005 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.5 $ --> -<!-- $Author: lm92 $ --> -<!-- EN-Revision: 1.12 Maintainer: dallas Status: ready --> +<!-- $Revision: 1.6 $ --> +<!-- $Author: dallas $ --> +<!-- EN-Revision: 1.13 Maintainer: dallas Status: ready --> <refentry id="function.chmod"> <refnamediv> <refname>chmod</refname> @@ -67,14 +67,15 @@ </para> <note> <para> - µ±Ç°Óû§Ö¸µÄÊÇÖ´ÐÐ PHP µÄÓû§¡£ºÜ¿ÉÄܺÍͨ³£µÄ shell »òÕß FTP Óû§²»ÊÇͬһ¸ö¡£ + µ±Ç°Óû§Ö¸µÄÊÇÖ´ÐÐ PHP µÄÓû§¡£ºÜ¿ÉÄܺÍͨ³£µÄ shell »òÕß FTP + Óû§²»ÊÇͬһ¸ö¡£ÔÚ´ó¶àÊýϵͳÏÂÎļþģʽֻÄܱ»ÎļþËùÓÐÕßµÄÓû§¸Ä±ä¡£ </para> </note> ¬e.no-remote; <note> <simpara> µ± &safemode; ´ò¿ªµÄʱºò£¬PHP »á¼ì²éËù²Ù×÷µÄÎļþÊÇ·ñºÍÕýÔÚÖ´ÐеĽű¾¾ßÓÐÏàͬµÄ - UID £¨ËùÓÐÕߣ©¡£Òª×¢ÒâµÄÊÇ£¬Äã²¢²»ÄÜÐÞ¸Ä SUID¡¢SGID ºÍ sticky bits¡£ + UID £¨ËùÓÐÕߣ©¡£Òª×¢ÒâµÄÊÇ£¬²»ÄÜÐÞ¸Ä SUID¡¢SGID ºÍ sticky bits¡£ </simpara> </note> <para>