mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Removed a redundant use of LOCK_EX with FILE_APPEND in an example.
Addresses bug #49329. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@288122 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
b0b269785c
commit
14e0c3062d
1 changed files with 2 additions and 4 deletions
|
@ -186,10 +186,8 @@ file_put_contents($file, $current);
|
|||
$file = 'people.txt';
|
||||
// The new person to add to the file
|
||||
$person = "John Smith\n";
|
||||
// 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);
|
||||
// Append the contents of $person to the file named by $file.
|
||||
file_put_contents($file, $person, FILE_APPEND);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
|
Loading…
Reference in a new issue