cvs: phpdoc /en/reference/spl/splfileinfo openfile.xml
| From: | Philip Olson | Date: | Sat, 07 Mar 2009 02:51:31 +0000 |
| Subject: | cvs: phpdoc /en/reference/spl/splfileinfo openfile.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-3387@lists.php.net to get a copy of this message | ||
philip Sat Mar 7 02:51:31 2009 UTC
Modified files:
/phpdoc/en/reference/spl/splfileinfo openfile.xml
Log:
Documented this method as it previously contained ~all docgen generated text.
This commit includes changes to the methodsynopsis (added initializers).
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/splfileinfo/openfile.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/reference/spl/splfileinfo/openfile.xml
diff -u phpdoc/en/reference/spl/splfileinfo/openfile.xml:1.2
phpdoc/en/reference/spl/splfileinfo/openfile.xml:1.3
--- phpdoc/en/reference/spl/splfileinfo/openfile.xml:1.2 Mon Nov 17 15:57:33 2008
+++ phpdoc/en/reference/spl/splfileinfo/openfile.xml Sat Mar 7 02:51:31 2009
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<refentry xml:id="splfileinfo.openfile" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
@@ -11,12 +11,16 @@
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier>
<type>SplFileObject</type><methodname>SplFileInfo::openFile</methodname>
- <methodparam
choice="opt"><type>string</type><parameter>open_mode</parameter></methodparam>
- <methodparam
choice="opt"><type>bool</type><parameter>use_include_path</parameter></methodparam>
- <methodparam
choice="opt"><type>resource</type><parameter>context</parameter></methodparam>
+ <methodparam
choice="opt"><type>string</type><parameter>open_mode</parameter><initializer>r</initializer></methodparam>
+ <methodparam
choice="opt"><type>bool</type><parameter>use_include_path</parameter><initializer>false</initializer></methodparam>
+ <methodparam
choice="opt"><type>resource</type><parameter>context</parameter><initializer>null</initializer></methodparam>
</methodsynopsis>
<para>
- The method description goes here.
+ Creates an <classname>SplFileObject</classname> <type>object</type> of
+ the file. This is useful because <classname>SplFileObject</classname>
+ contains additional methods for manipulating the file whereas
+ <classname>SplFileInfo</classname> is only useful for gaining information,
+ like whether the file is writable.
</para>
</refsect1>
@@ -28,7 +32,9 @@
<term><parameter>open_mode</parameter></term>
<listitem>
<para>
- Description...
+ The mode for opening the file. See the <function>fopen</function>
+ documentation for descriptions of possible modes. The default
+ is read only.
</para>
</listitem>
</varlistentry>
@@ -36,7 +42,7 @@
<term><parameter>use_include_path</parameter></term>
<listitem>
<para>
- Description...
+ ¶meter.use_include_path;
</para>
</listitem>
</varlistentry>
@@ -44,19 +50,26 @@
<term><parameter>context</parameter></term>
<listitem>
<para>
- Description...
+ ¶meter.context;
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
-
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
- Description...
+ The opened file as an <classname>SplFileObject</classname>
<type>object</type>.
+ </para>
+ </refsect1>
+
+ <refsect1 role="errors">
+ &reftitle.errors;
+ <para>
+ A <classname>RuntimeException</classname> if the file cannot be
+ opened (e.g. insufficient access rights).
</para>
</refsect1>
@@ -64,20 +77,21 @@
&reftitle.examples;
<para>
<example>
- <title><function>SplFileInfo::openFile</function> example</title>
+ <title><methodname>SplFileInfo::openFile</methodname> example</title>
<programlisting role="php">
<![CDATA[
<?php
-/* ... */
+$fileinfo = new SplFileInfo('/tmp/foo.txt');
+
+if ($fileinfo->isWritable()) {
+
+ $fileobj = $fileinfo->openFile('a');
+
+ $fileobj->fwrite("appended this sample text");
+}
?>
]]>
</programlisting>
- &example.outputs.similar;
- <screen>
-<![CDATA[
-...
-]]>
- </screen>
</example>
</para>
</refsect1>
@@ -86,8 +100,9 @@
&reftitle.seealso;
<para>
<simplelist>
- <member>SplFileObject</member>
+ <member><classname>SplFileObject</classname></member>
<member><function>stream_context_create</function></member>
+ <member><function>fopen</function></member>
</simplelist>
</para>
</refsect1>