dir is a function creating an instance of Directory class

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@321886 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jakub Vrana 2012-01-07 23:06:29 +00:00
parent d67138cdb8
commit 53b6f116ed
9 changed files with 279 additions and 29 deletions

View file

@ -314,7 +314,7 @@
<term><classname>Directory</classname></term>
<listitem>
<simpara>
The class from which <link linkend="class.dir">dir</link> is instantiated.
Created by <function>dir</function>.
</simpara>
</listitem>
</varlistentry>

View file

@ -16,6 +16,7 @@
&reference.dir.setup;
&reference.dir.constants;
&reference.dir.directory;
&reference.dir.reference;
</book>

107
reference/dir/directory.xml Normal file
View file

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<phpdoc:classref xml:id="class.directory" 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">
<title>The Directory class</title>
<titleabbrev>Directory</titleabbrev>
<partintro>
<!-- {{{ Directory intro -->
<section xml:id="directory.intro">
&reftitle.intro;
<para>
Instances of <classname>Directory</classname> are created by calling the
<function>dir</function> function, not by the <link
linkend="language.oop5.basic.new">new</link> operator.
</para>
</section>
<!-- }}} -->
<section xml:id="directory.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>Directory</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>Directory</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">&Properties;</classsynopsisinfo>
<fieldsynopsis>
<modifier>public</modifier>
<type>string</type>
<varname linkend="directory.props.path">path</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<type>resource</type>
<varname linkend="directory.props.handle">handle</varname>
</fieldsynopsis>
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.directory')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
<!-- }}} -->
</section>
<!-- {{{ directory properties -->
<section xml:id="directory.props">
&reftitle.properties;
<variablelist>
<varlistentry xml:id="directory.props.path">
<term><varname>path</varname></term>
<listitem>
<para>
The directory that was opened.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="directory.props.handle">
<term><varname>handle</varname></term>
<listitem>
<para>
Can be used with other directory functions such as
<function>readdir</function>, <function>rewinddir</function> and
<function>closedir</function>.
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<!-- }}} -->
</partintro>
&reference.dir.entities.directory;
</phpdoc:classref>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="directory.close" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Directory::close</refname>
<refpurpose>Close directory handle</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>Directory::close</methodname>
<methodparam choice="opt"><type>resource</type><parameter>dir_handle</parameter></methodparam>
</methodsynopsis>
<para>
Same as <function>closedir</function>, only <parameter>
dir_handle</parameter> defaults to <varname>$this</varname>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="directory.read" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Directory::read</refname>
<refpurpose>Read entry from directory handle</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>string</type><methodname>Directory::read</methodname>
<methodparam choice="opt"><type>resource</type><parameter>dir_handle</parameter></methodparam>
</methodsynopsis>
<para>
Same as <function>readdir</function>, only <parameter>
dir_handle</parameter> defaults to <varname>$this</varname>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="directory.rewind" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Directory::rewind</refname>
<refpurpose>Rewind directory handle</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>Directory::rewind</methodname>
<methodparam choice="opt"><type>resource</type><parameter>dir_handle</parameter></methodparam>
</methodsynopsis>
<para>
Same as <function>rewinddir</function>, only <parameter>
dir_handle</parameter> defaults to <varname>$this</varname>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- splitted from ./en/functions/dir.xml, last change in rev 1.2 -->
<refentry xml:id="class.dir" xmlns="http://docbook.org/ns/docbook">
<refentry xml:id="function.dir" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>dir</refname>
<refpurpose>Return an instance of the Directory class</refpurpose>
@ -9,32 +9,45 @@
<refsect1 role="description">
&reftitle.description;
<classsynopsis>
<ooclass><classname>Directory</classname></ooclass>
<classsynopsisinfo>
<ooclass>
<classname>Directory</classname>
</ooclass>
</classsynopsisinfo>
<fieldsynopsis>
<type>string</type><varname>path</varname>
</fieldsynopsis>
<fieldsynopsis>
<type>resource</type><varname>handle</varname>
</fieldsynopsis>
<methodsynopsis><type>string</type><methodname>Directory::read</methodname><void/></methodsynopsis>
<methodsynopsis><type>void</type><methodname>Directory::rewind</methodname><void/></methodsynopsis>
<methodsynopsis><type>void</type><methodname>Directory::close</methodname><void/></methodsynopsis>
</classsynopsis>
<methodsynopsis>
<type>Directory</type><methodname>dir</methodname>
<methodparam><type>string</type><parameter>directory</parameter></methodparam>
<methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam>
</methodsynopsis>
<para>
A pseudo-object oriented mechanism for reading a directory. The
given <parameter>directory</parameter> is opened. Two properties
are available once the directory has been opened. The handle
property can be used with other directory functions such as
<function>readdir</function>, <function>rewinddir</function> and
<function>closedir</function>. The path property is set to path
the directory that was opened. Three methods are available:
read, rewind and close.
given <parameter>directory</parameter> is opened.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>directory</parameter></term>
<listitem>
<para>
Directory to open
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>context</parameter></term>
<listitem>
<para>
&note.context-support;
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an instance of <classname>Directory</classname>, or &null; with
wrong parameters, or &false; in case of another error.
</para>
</refsect1>
@ -44,7 +57,7 @@
<example>
<title><function>dir</function> example</title>
<para>
Please note the fashion in which <function>dir::read</function>'s
Please note the fashion in which <function>Directory::read</function>'s
return value is checked in the example below. We are explicitly
testing whether the return value is identical to (equal to and of
the same type as - see <link linkend="language.operators.comparison">

View file

@ -140,7 +140,7 @@ filename: cli : filetype: dir
<simplelist>
<member><function>is_dir</function></member>
<member><function>readdir</function></member>
<member><link linkend="class.dir">Dir</link></member>
<member><function>dir</function></member>
</simplelist>
</para>
</refsect1>

View file

@ -89,7 +89,7 @@ bool(true)
<para>
<simplelist>
<member><function>chdir</function></member>
<member><link linkend="class.dir">dir</link></member>
<member><function>dir</function></member>
<member><function>opendir</function></member>
<member><function>is_file</function></member>
<member><function>is_link</function></member>