document more PHP 5.1 changes

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@179348 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Nuno Lopes 2005-02-09 17:06:38 +00:00
parent 13dae10e90
commit ab6b36e104
2 changed files with 61 additions and 17 deletions

View file

@ -1,24 +1,26 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.21 $ -->
<!-- $Revision: 1.22 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.130 -->
<refentry id="function.file-get-contents">
<refnamediv>
<refname>file_get_contents</refname>
<refpurpose>Reads entire file into a string</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>file_get_contents</methodname>
<methodparam><type>string</type><parameter>filename</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>int</type><parameter>offset</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>maxlen</parameter></methodparam>
</methodsynopsis>
<para>
Identical to <function>file</function>, except that
<function>file_get_contents</function> returns the file in a string,
starting at the specified <parameter>offset</parameter>.
starting at the specified <parameter>offset</parameter> up to
<parameter>maxlen</parameter> bytes.
On failure, <function>file_get_contents</function> will return &false;.
</para>
<para>
@ -26,27 +28,63 @@
contents of a file into a string. It will use memory mapping techniques if
supported by your OS to enhance performance.
</para>
<note>
<simpara>
The <parameter>offset</parameter> parameter was added in PHP 5.1.0.
</simpara>
</note>
<note>
<para>
If you're opening a URI with special characters, such as spaces, you
need to encode the URI with <function>urlencode</function>.
</para>
</note>
</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>
Added the context support.
</entry>
</row>
<row>
<entry>5.1.0</entry>
<entry>
Added the <parameter>offset</parameter> and
<parameter>maxlen</parameter> parameters.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&note.bin-safe;
&tip.fopen-wrapper;
&note.context-support;
&warn.ssl-non-standard;
<simpara>
See also <function>fgets</function>, <function>file</function>,
<function>fread</function>, <function>include</function>,
<function>readfile</function> &listendand;
<function>file_put_contents</function>
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>file</function></member>
<member><function>fgets</function></member>
<member><function>fread</function></member>
<member><function>readfile</function></member>
<member><function>file_put_contents</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<refentry id="function.file-put-contents">
<refnamediv>
<refname>file_put_contents</refname>
@ -29,6 +29,12 @@
(not multi-dimension arrays). This is equivalent to
<literal>file_put_contents($filename, join('', $array))</literal>.
</para>
<para>
As of PHP 5.1.0, you may also pass a stream resource to the
<parameter>data</parameter> parameter. In result, the remaining buffer of
that stream will be copied to the specified file. This is similar with
using <function>stream_copy_to_stream</function>.
</para>
&note.bin-safe;
&tip.fopen-wrapper;
<simpara>