Bug #72950 [NEW]: file_put_contents: LOCK_EX unsupported for userland stream wrappers
| From: | cmb@php.net | Date: | Fri, 26 Aug 2016 16:36:40 +0000 |
| Subject: | Bug #72950 [NEW]: file_put_contents: LOCK_EX unsupported for userland stream wrappers | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-203589@lists.php.net to get a copy of this message | ||
From: cmb
Operating system: *
PHP version: 7.1Git-2016-08-26 (Git)
Package: Filesystem function related
Bug Type: Bug
Bug description:file_put_contents: LOCK_EX unsupported for userland stream wrappers
Description:
------------
When the LOCK_EX flag is passed to file_put_contents() with a
userland stream wrapper URL that supports locking, the function
fails.
This bug has been introduced with commit 17d22a5[1] to fix
bug #44501.
[1] <https://github.com/php/php-src/commit/17d22a5>
Test script:
---------------
See <https://gist.github.com/cmb69/c3492b5f3c827edbe656eac215b1fad0>.
Expected result:
----------------
bool(true)
line1
line2
line3
string(18) "line1
line2
line3
"
string(3) "foo"
Actual result:
--------------
bool(true)
line1
line2
line3
string(18) "line1
line2
line3
"
Warning: file_put_contents(): Exclusive locks may only be set for
regular files in /vagrant/varstream.php on line 118
string(18) "line1
line2
line3
"
--
Edit bug report at https://bugs.php.net/bug.php?id=72950&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72950&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72950&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72950&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72950&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72950&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72950&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72950&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72950&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72950&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72950&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72950&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72950&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72950&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72950&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72950&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72950&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72950&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72950&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72950&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72950&r=mysqlcfg