svn: /phpdoc/en/trunk/reference/filesystem/functions/ file-put-contents.xml
| From: | Gustavo André dos Santos Lopes | Date: | Wed, 08 Sep 2010 00:17:00 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/filesystem/functions/ file-put-contents.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-7073@lists.php.net to get a copy of this message | ||
cataphract Wed, 08 Sep 2010 00:17:00 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=303153
Log:
- Reversing changes from revisions 288122 and 282711, which addressed bug #49329 and bug #48522
(bogus bugs).
- Closes bug #52767.
Bugs: http://bugs.php.net/49329 (Closed) file_put_contents()
Example #2 : FILE_APPEND and LOCK_EX are exclusive
http://bugs.php.net/48522 (Closed) file_put_contents()
flags FILE_APPEND and LOCK_EX are mutually exclusive
http://bugs.php.net/52767 (Open) Invalid doc of
FILE_APPEND|LOCK_EX for file_put_contents caused by #48522
Changed paths:
UU phpdoc/en/trunk/reference/filesystem/functions/file-put-contents.xml
Modified: phpdoc/en/trunk/reference/filesystem/functions/file-put-contents.xml
===================================================================
--- phpdoc/en/trunk/reference/filesystem/functions/file-put-contents.xml 2010-09-08 00:15:17 UTC
(rev 303152)
+++ phpdoc/en/trunk/reference/filesystem/functions/file-put-contents.xml 2010-09-08 00:17:00 UTC
(rev 303153)
@@ -63,8 +63,8 @@
<listitem>
<para>
The value of <parameter>flags</parameter> can be any combination of
- the following flags (with some restrictions), joined with the binary OR
- (<literal>|</literal>) operator.
+ the following flags, joined with the binary OR (<literal>|</literal>)
+ operator.
</para>
<para>
<table>
@@ -93,9 +93,7 @@
</entry>
<entry>
If file <parameter>filename</parameter> already exists, append
- the data to the file instead of overwriting it. Mutually
- exclusive with LOCK_EX since appends are atomic and thus there
- is no reason to lock.
+ the data to the file instead of overwriting it.
</entry>
</row>
<row>
@@ -104,7 +102,7 @@
</entry>
<entry>
Acquire an exclusive lock on the file while proceeding to the
- writing. Mutually exclusive with FILE_APPEND.
+ writing.
</entry>
</row>
<!-- FIXME PHP_6
@@ -188,8 +186,10 @@
$file = 'people.txt';
// The new person to add to the file
$person = "John Smith\n";
-// Append the contents of $person to the file named by $file.
-file_put_contents($file, $person, FILE_APPEND);
+// Write the contents to the file,
+// using the FILE_APPEND flag to append the content to the end of the file
+// and the LOCK_EX flag to prevent anyone else writing to the file at the same time
+file_put_contents($file, $person, FILE_APPEND | LOCK_EX);
?>
]]>
</programlisting>
Property changes on: phpdoc/en/trunk/reference/filesystem/functions/file-put-contents.xml
___________________________________________________________________
Modified: cvs2svn:cvs-rev
- 1.28
+ 1.28