diff options
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | ext/standard/file.c | 5 |
2 files changed, 6 insertions, 0 deletions
@@ -10,6 +10,7 @@ PHP NEWS functions will use. (Derick) - Added pg_fetch_all_columns() function to fetch all values of a column from a result cursor. (Ilia) +- Added support for LOCK_EX flag for file_put_contents(). (Ilia) - Implemented feature request #33452 (Year belonging to ISO week). (Derick) - Fixed support for shared extensions on AIX. (Dmitry) - Fixed memory corruption in pg_copy_from() in case the as_null parameter was diff --git a/ext/standard/file.c b/ext/standard/file.c index 349b27bab7..cbb825198c 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -584,6 +584,11 @@ PHP_FUNCTION(file_put_contents) if (stream == NULL) { RETURN_FALSE; } + + if (flags & LOCK_EX && php_stream_lock(stream, LOCK_EX)) { + RETURN_FALSE; + } + switch (Z_TYPE_P(data)) { case IS_RESOURCE: { |