From: Greg Beaver Date: Fri, 4 Jan 2008 17:04:41 +0000 (+0000) Subject: use zip_free() instead of zip_close(), and don't add a stub if it already exists... X-Git-Tag: RELEASE_2_0_0a1~1032 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=67688371f710e79f6e64e999b31651352048a9c1;p=php use zip_free() instead of zip_close(), and don't add a stub if it already exists in phar_zip_flush(), update TODO --- diff --git a/ext/phar/TODO b/ext/phar/TODO index e7669b614b..b0f3f57919 100644 --- a/ext/phar/TODO +++ b/ext/phar/TODO @@ -60,16 +60,14 @@ Version 1.2.1 Version 1.3.0 - * Provide an additional header that allows better compatibility with PHP 4 - __HALT_COMPILER();function __HALT_COMPILER(){}$a=<<match('mime-type', 'image/jpeg') as $file) + X tar support [Greg] + X zip support [Greg] X Phar::copy($from, $to); [Greg] X Phar::delete($what) [Greg] X Phar::buildFromIterator(Iterator $it[, string $base_directory]) [Greg] * Layout: Option to compress all content rather than single files. - That excludes stub and manifest haeder. + That excludes stub and manifest haeder. (tar only) X clean crap paths like phar://blah.phar/file//../to\\here.php [Greg] diff --git a/ext/phar/phar.c b/ext/phar/phar.c index c68edf4165..f3f7396e28 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -208,7 +208,7 @@ static void phar_destroy_phar_data(phar_archive_data *data TSRMLS_DC) /* {{{ */ { #if HAVE_PHAR_ZIP if (data->zip) { - zip_close(data->zip); + _zip_free(data->zip); data->zip = 0; } #endif @@ -3256,7 +3256,7 @@ int phar_zip_flush(phar_archive_data *archive, char *user_stub, long len, char * efree(user_stub); } } else { - if (archive->is_brandnew) { + if (-1 != phar_stub_index) { struct zip_source *source; /* this is a brand new phar, add the stub */ if (NULL == (source = zip_source_buffer(archive->zip, newstub, sizeof(newstub) - 1, 0)) || -1 == zip_add(archive->zip, ".phar/stub.php", source)) { diff --git a/ext/phar/tests/frontcontroller1.phpt b/ext/phar/tests/frontcontroller1.phpt index 2c5e35c141..0cff6e6f3d 100644 --- a/ext/phar/tests/frontcontroller1.phpt +++ b/ext/phar/tests/frontcontroller1.phpt @@ -5,6 +5,8 @@ Phar front controller --INI-- phar.require_hash=0 phar.readonly=0 +--ENV-- +REQUEST_URI=/frontcontroller1.phar.php/a.jpg --FILE--