diff options
| author | Dmitry Stogov <dmitry@zend.com> | 2013-02-21 16:08:07 +0400 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@zend.com> | 2013-02-21 16:08:07 +0400 |
| commit | 8b7222e22f560fe052c534190cc33c2e9dc5edb3 (patch) | |
| tree | da1850e11d8f91fab9bb5d84fb5f93446751a905 | |
| parent | ead2e1708d3781a71a460f44e326becfd8b5e360 (diff) | |
| parent | b5d267aa95aec1e89dc34f0bcc3c46576354cd26 (diff) | |
| download | php-git-8b7222e22f560fe052c534190cc33c2e9dc5edb3.tar.gz | |
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
PHAR should modify entry timestamp when it's modified
| -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 612a9765e7..924138d8fa 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); |
