cvs: phpdoc-fr /reference/filesystem/functions file-get-contents.xml file-put-contents.xml tmpfile.xml

From: Date: Mon, 25 Oct 2004 16:44:11 +0000
Subject: cvs: phpdoc-fr /reference/filesystem/functions file-get-contents.xml file-put-contents.xml tmpfile.xml
Groups: php.doc.fr 
Request: Send a blank email to doc-fr+get-3538@lists.php.net to get a copy of this message
dams Mon Oct 25 12:44:11 2004 EDT Modified files: /phpdoc-fr/reference/filesystem/functions file-get-contents.xml file-put-contents.xml tmpfile.xml Log: synch with en http://cvs.php.net/diff.php/phpdoc-fr/reference/filesystem/functions/file-get-contents.xml?r1=1.13&r2=1.14&ty=u Index: phpdoc-fr/reference/filesystem/functions/file-get-contents.xml diff -u phpdoc-fr/reference/filesystem/functions/file-get-contents.xml:1.13 phpdoc-fr/reference/filesystem/functions/file-get-contents.xml:1.14 --- phpdoc-fr/reference/filesystem/functions/file-get-contents.xml:1.13 Sat Aug 28 05:53:00 2004 +++ phpdoc-fr/reference/filesystem/functions/file-get-contents.xml Mon Oct 25 12:44:11 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.13 $ --> -<!-- EN-Revision: 1.18 Maintainer: dams Status: ready --> +<!-- $Revision: 1.14 $ --> +<!-- EN-Revision: 1.19 Maintainer: dams Status: ready --> <refentry id="function.file-get-contents"> <refnamediv> <refname>file_get_contents</refname> @@ -13,19 +13,28 @@ <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> </methodsynopsis> <para> <function>file_get_contents</function> est identique à la fonction <function>readfile</function>, hormis le fait que <function>file_get_contents</function> retourne le fichier - <parameter>filename</parameter> dans une chaîne. + <parameter>filename</parameter> dans une chaîne, à partir + de la position <parameter>offset</parameter>. + En cas d'erreur, <function>file_get_contents</function> retourne + &false;. </para> <para> Vous pouvez utiliser l'option <parameter>use_include_path</parameter> : en la mettant à "1", vous rechercherez aussi dans le dossier <link linkend="ini.include-path"><option>include_path</option></link>. </para> - <example> + <note> + <simpara> + Le paramètre <parameter>offset</parameter> a été ajouté en &php; 5.1.0. + </simpara> + </note> + <example> <title>Utilisation de la fonction <function>file_get_contents</function> avec une URI</title> <para> Si vous ouvrez une URI avec des caractères spéciaux, comme des espaces, vous devez encoder http://cvs.php.net/diff.php/phpdoc-fr/reference/filesystem/functions/file-put-contents.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/filesystem/functions/file-put-contents.xml diff -u phpdoc-fr/reference/filesystem/functions/file-put-contents.xml:1.5 phpdoc-fr/reference/filesystem/functions/file-put-contents.xml:1.6 --- phpdoc-fr/reference/filesystem/functions/file-put-contents.xml:1.5 Tue May 18 10:37:45 2004 +++ phpdoc-fr/reference/filesystem/functions/file-put-contents.xml Mon Oct 25 12:44:11 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.3 Maintainer: dams Status: ready --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.4 Maintainer: dams Status: ready --> <refentry id="function.file-put-contents"> <refnamediv> <refname>file_put_contents</refname> @@ -11,7 +11,7 @@ <methodsynopsis> <type>int</type><methodname>file_put_contents</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> - <methodparam><type>string</type><parameter>data</parameter></methodparam> + <methodparam><type>mixed</type><parameter>data</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam> <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> </methodsynopsis> @@ -28,6 +28,11 @@ <constant>FILE_APPEND</constant>, mais <constant>FILE_USE_INCLUDE_PATH</constant> doit être utilisé avec prudence. </simpara> + <para> + Vous pouvez aussi spécifier <parameter>data</parameter> comme un tableau. + Cela revient alors à : + <literal>file_put_contents($filename, join('', $array))</literal>. + </para> &note.bin-safe; &tip.fopen-wrapper; <simpara> http://cvs.php.net/diff.php/phpdoc-fr/reference/filesystem/functions/tmpfile.xml?r1=1.7&r2=1.8&ty=u Index: phpdoc-fr/reference/filesystem/functions/tmpfile.xml diff -u phpdoc-fr/reference/filesystem/functions/tmpfile.xml:1.7 phpdoc-fr/reference/filesystem/functions/tmpfile.xml:1.8 --- phpdoc-fr/reference/filesystem/functions/tmpfile.xml:1.7 Tue May 18 10:37:45 2004 +++ phpdoc-fr/reference/filesystem/functions/tmpfile.xml Mon Oct 25 12:44:11 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- EN-Revision: 1.4 Maintainer: dams Status: ready --> +<!-- $Revision: 1.8 $ --> +<!-- EN-Revision: 1.5 Maintainer: dams Status: ready --> <refentry id="function.tmpfile"> <refnamediv> <refname>tmpfile</refname> @@ -14,7 +14,8 @@ </methodsynopsis> <para> <function>tmpfile</function> crée un fichier temporaire - avec un nom unique, ouvert en écriture, et retourne un + avec un nom unique, ouvert en écriture et lecture + (<literal>w+</literal>), et retourne un pointeur de fichier, identique à ceux retournés par <function>fopen</function>. Ce fichier sera automatiquement effacé lorsqu'il sera @@ -32,12 +33,20 @@ <programlisting role="php"> <![CDATA[ <?php - $temp = tmpfile(); - fwrite($temp, "Ecriture dans le fichier temporaire"); - fclose($temp); // Ceci supprime le fichier temporaire +$temp = tmpfile(); +fwrite($temp, "Ecriture dans le fichier temporaire"); +fseek($temp, 0); +echo fread($temp, 1024); +fclose($temp); // Ceci supprime le fichier temporaire ?> ]]> </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Ecriture dans le fichier temporaire +]]> + </screen> </example> </para> <para>

« previous php.doc.fr (#3538) next »