diff options
author | Dmitry Stogov <dmitry@zend.com> | 2013-02-21 15:55:20 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2013-02-21 15:55:20 +0400 |
commit | 7b113d789df26b2ad560e747cac0b1ed2043adec (patch) | |
tree | c267c95cd55b32be9a07c3a1a4e2ed0d19a4fbe6 /ext/phar/stream.c | |
parent | bc55a8eb9f1cf5e77b96a4eb2a1920ba0037e128 (diff) | |
download | php-git-7b113d789df26b2ad560e747cac0b1ed2043adec.tar.gz |
PHAR should modify entry timestamp when it's modified
Diffstat (limited to 'ext/phar/stream.c')
-rw-r--r-- | ext/phar/stream.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/phar/stream.c b/ext/phar/stream.c index 2c6810e558..0831b02341 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -458,8 +458,11 @@ static int phar_stream_flush(php_stream *stream TSRMLS_DC) /* {{{ */ { char *error; int ret; - if (stream->mode[0] == 'w' || (stream->mode[0] == 'r' && stream->mode[1] == '+')) { - ret = phar_flush(((phar_entry_data *)stream->abstract)->phar, 0, 0, 0, &error TSRMLS_CC); + phar_entry_data *data = (phar_entry_data *) stream->abstract; + + if (data->internal_file->is_modified) { + data->internal_file->timestamp = time(0); + ret = phar_flush(data->phar, 0, 0, 0, &error TSRMLS_CC); if (error) { php_stream_wrapper_log_error(stream->wrapper, REPORT_ERRORS TSRMLS_CC, "%s", error); efree(error); |