From: Greg Beaver Date: Wed, 29 Jul 2009 10:14:04 +0000 (+0000) Subject: make phar tests pass in php 5.2, prepare for release of pecl/phar 2.0.0, merge Gwynne... X-Git-Tag: php-5.4.0alpha1~191^2~2925 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c880f7e5c4ab2273afb50e89cb4f7d5c8aa9cd4e;p=php make phar tests pass in php 5.2, prepare for release of pecl/phar 2.0.0, merge Gwynne's TSRM fix to phar_object.c to other branches --- diff --git a/ext/phar/package.php b/ext/phar/package.php index 53b6939050..f10933ae26 100644 --- a/ext/phar/package.php +++ b/ext/phar/package.php @@ -43,6 +43,29 @@ Security addition * aliases are validated so that they contain no directory separators as intended * on conversion to other formats, user-supplied aliases are validated +Changes since 2.0.0RC2: + fixed PHP Bug #49021: phar tar signature algorithm reports as Unknown (0) in + getSignature() call + fixed PHP Bug #49020: phar misinterprets ustar long filename standard + fixed PHP Bug #49018: phar tar stores long filenames with prefix/name reversed + fixed PHP Bug #48791: open office files always reported as corrupted + fixed PHP Bug #48783: make install will fail saying phar file exists + fixed PHP Bug #48740: PHAR install fails when INSTALL_ROOT is not the final install location + fixed PHP Bug #48681: openssl signature verification for tar archives broken + fixed PHP Bug #48377: error message unclear on converting phar with existing file + fixed isset() on sub-directories (isset("blah") if file "blah/foo.php" exists) + + make phar work in PHP 6 +Changes since 2.0.0RC1: + security vulnerability in handling of long tar filenames fixed + fixed PECL Bug #14646: phar error message unclear with php stream wrappers + fixed PECL Bug #16338: php_stream_copy_to_stream{,_ex}() + fixed PHP Bug #48257: PharData throws an exception with non-phar tar + fixed PHP Bug #47085: rename() returns true even if the file in PHAR does not exist + fixed PHP Bug #46032: PharData::__construct() - wrong memory read + fixed PHP Bug #46060: Phar::addEmptyDir() breaks + fixed PHP Bug #45907: undefined reference to \'PHP_SHA512Init\' + fixed PHP Bug #45726: PHP_Archive / Archive.php missing Changes since 2.0.0a2: many bugfixes, removal of phar.extract_list, compression API refactored, conversion API refactored Changes since 2.0.0b1: addition of phar.cache_list, many performance improvements and bugfixes @@ -61,7 +84,7 @@ require_once 'PEAR/PackageFileManager2.php'; PEAR::setErrorHandling(PEAR_ERROR_DIE); $options = array( - 'filelistgenerator' => 'CVS', + 'filelistgenerator' => 'svn', 'changelogoldtonew' => false, 'simpleoutput' => true, 'baseinstalldir' => '/', diff --git a/ext/phar/package.xml b/ext/phar/package.xml index e4c2fe4f31..1f3fe90632 100644 --- a/ext/phar/package.xml +++ b/ext/phar/package.xml @@ -1,5 +1,5 @@ - + phar pecl.php.net allows running of complete applications out of .phar files (like Java .jar files) @@ -42,10 +42,10 @@ a 6x speedup measured running phpMyAdmin as a phar archive. sfox@php.net yes - 2008-08-31 - + 2009-07-26 + - 2.0.0RC1 + 2.0.0 1.1.1 @@ -54,7 +54,6 @@ a 6x speedup measured running phpMyAdmin as a phar archive. PHP License - BC BREAKING RELEASE BC breaks: * Phar object Compression API is rewritten. Use Phar::compress() and decompress(), @@ -97,13 +96,35 @@ Security addition * aliases are validated so that they contain no directory separators as intended * on conversion to other formats, user-supplied aliases are validated +Changes since 2.0.0RC2: + fixed PHP Bug #49021: phar tar signature algorithm reports as Unknown (0) in + getSignature() call + fixed PHP Bug #49020: phar misinterprets ustar long filename standard + fixed PHP Bug #49018: phar tar stores long filenames with prefix/name reversed + fixed PHP Bug #48791: open office files always reported as corrupted + fixed PHP Bug #48783: make install will fail saying phar file exists + fixed PHP Bug #48740: PHAR install fails when INSTALL_ROOT is not the final install location + fixed PHP Bug #48681: openssl signature verification for tar archives broken + fixed PHP Bug #48377: error message unclear on converting phar with existing file + fixed isset() on sub-directories (isset("blah") if file "blah/foo.php" exists) + + make phar work in PHP 6 +Changes since 2.0.0RC1: + security vulnerability in handling of long tar filenames fixed + fixed PECL Bug #14646: phar error message unclear with php stream wrappers + fixed PECL Bug #16338: php_stream_copy_to_stream{,_ex}() + fixed PHP Bug #48257: PharData throws an exception with non-phar tar + fixed PHP Bug #47085: rename() returns true even if the file in PHAR does not exist + fixed PHP Bug #46032: PharData::__construct() - wrong memory read + fixed PHP Bug #46060: Phar::addEmptyDir() breaks + fixed PHP Bug #45907: undefined reference to 'PHP_SHA512Init' + fixed PHP Bug #45726: PHP_Archive / Archive.php missing Changes since 2.0.0a2: many bugfixes, removal of phar.extract_list, compression API refactored, conversion API refactored Changes since 2.0.0b1: addition of phar.cache_list, many performance improvements and bugfixes implement OpenSSL asynchronous true package signing add support for package signing to tar-based archives require PHP 5.2.1+ - @@ -119,6 +140,10 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement + + + + @@ -155,7 +180,95 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -232,6 +345,9 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement + + + @@ -279,8 +395,13 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement + + + + + @@ -294,6 +415,7 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement + @@ -328,6 +450,7 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement + @@ -350,6 +473,7 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement + @@ -375,7 +499,9 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement + + @@ -385,6 +511,7 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement + @@ -442,9 +569,11 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement + + @@ -452,6 +581,7 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement + @@ -526,6 +656,7 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement + @@ -534,6 +665,7 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement + @@ -586,6 +718,12 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement + + + + + + @@ -604,6 +742,7 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement + @@ -640,8 +779,8 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement + - @@ -693,10 +832,9 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement - - + @@ -783,6 +921,7 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement + @@ -815,7 +954,6 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement - @@ -866,17 +1004,101 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement - 2.0.0RC1 + 2.0.0 1.1.1 beta beta - 2008-08-31 + 2009-07-26 PHP License +BC BREAKING RELEASE + BC breaks: + * Phar object Compression API is rewritten. Use Phar::compress() and decompress(), + Phar::compressFiles()/decompressFiles() and PharFileInfo->compress()/decompress(). + * phar.extract_list and Phar::getExtractList() are removed + +Major feature functionality release + * phar.cache_list allows web-based phar applications to run at equal or faster than + their on-disk equivalent [Greg] + * new default stub allows running of phar-based phars without phar extension [Greg/Steph] + * add support for tar-based and zip-based phar archives [Greg] + * add support for OpenSSL-based true signatures [Greg] + * add support for signatures to tar-based phar archives [Greg] + * add Phar::isFileFormat() [Greg] + * add Phar::convertToExecutable(), Phar::convertToData() [Greg] + * add Phar::compress() [Greg] + * rename Phar::compressAllFiles() to compressFiles(), uncompressAllFiles() to + decompressFiles() [Greg] + * conversion to compressed or to other file formats automatically copies the archive + to a new extension (i.e. ".phar" to ".phar.tar" or ".tar" to ".tar.gz") [Steph] + * add Phar::webPhar() for running a web-based application unmodified + directly from a phar archive [Greg] + * file functions (fopen-based and stat-based) can be instructed to only look for + relative paths within a phar via Phar::interceptFileFuncs() + * add PharData class to allow manipulation/creation of non-executable tar and zip archives. [Steph] + non-executable tar/zip manipulation is allowed even when phar.readonly=1 [Greg] + * paths with . and .. work (phar://blah.phar/a/../b.php => phar://blah.phar/b.php) [Greg] + * add support for mkdir()/rmdir() and support for empty directories to phar file format [Greg] + * add option to compress the entire phar file for phar/tar file format [Greg] + * implement Phar::isCompressed() returning 0, Phar::GZ or Phar::BZ2 [Greg] + * implement Phar::copy(string $from, string $to) [Greg] + * implement Phar::running(), returns path or URL to currently executed phar + * implement Phar::buildFromIterator(Iterator $it[, string $base_directory]) [Greg] + * implement Phar::buildFromDirectory(string $base_directory[, string $regex]) [Steph] + * implement Phar::mount() for mounting external paths or files to locations inside a phar [Greg] + * add Phar::delete() [Greg] + * implement Phar::unlinkArchive() [Greg] + +Security addition + * aliases are validated so that they contain no directory separators as intended + * on conversion to other formats, user-supplied aliases are validated +Changes since 2.0.0RC2: + fixed PHP Bug #49021: phar tar signature algorithm reports as Unknown (0) in + getSignature() call + fixed PHP Bug #49020: phar misinterprets ustar long filename standard + fixed PHP Bug #49018: phar tar stores long filenames with prefix/name reversed + fixed PHP Bug #48791: open office files always reported as corrupted + fixed PHP Bug #48783: make install will fail saying phar file exists + fixed PHP Bug #48740: PHAR install fails when INSTALL_ROOT is not the final install location + fixed PHP Bug #48681: openssl signature verification for tar archives broken + fixed PHP Bug #48377: error message unclear on converting phar with existing file + fixed isset() on sub-directories (isset("blah") if file "blah/foo.php" exists) + + make phar work in PHP 6 +Changes since 2.0.0RC1: + security vulnerability in handling of long tar filenames fixed + fixed PECL Bug #14646: phar error message unclear with php stream wrappers + fixed PECL Bug #16338: php_stream_copy_to_stream{,_ex}() + fixed PHP Bug #48257: PharData throws an exception with non-phar tar + fixed PHP Bug #47085: rename() returns true even if the file in PHAR does not exist + fixed PHP Bug #46032: PharData::__construct() - wrong memory read + fixed PHP Bug #46060: Phar::addEmptyDir() breaks + fixed PHP Bug #45907: undefined reference to 'PHP_SHA512Init' + fixed PHP Bug #45726: PHP_Archive / Archive.php missing +Changes since 2.0.0a2: many bugfixes, removal of phar.extract_list, compression API refactored, + conversion API refactored +Changes since 2.0.0b1: addition of phar.cache_list, many performance improvements and bugfixes + implement OpenSSL asynchronous true package signing + add support for package signing to tar-based archives + require PHP 5.2.1+ + + + + + 2.0.0RC2 + 1.1.1 + + + beta + beta + + 2009-06-04 + PHP License + BC BREAKING RELEASE BC breaks: * Phar object Compression API is rewritten. Use Phar::compress() and decompress(), @@ -919,13 +1141,84 @@ Security addition * aliases are validated so that they contain no directory separators as intended * on conversion to other formats, user-supplied aliases are validated +Changes since 2.0.0RC1: + security vulnerability in handling of long tar filenames fixed + fixed PECL Bug #14646: phar error message unclear with php stream wrappers + fixed PECL Bug #16338: php_stream_copy_to_stream{,_ex}() + fixed PHP Bug #48257: PharData throws an exception with non-phar tar + fixed PHP Bug #47085: rename() returns true even if the file in PHAR does not exist + fixed PHP Bug #46032: PharData::__construct() - wrong memory read + fixed PHP Bug #46060: Phar::addEmptyDir() breaks + fixed PHP Bug #45907: undefined reference to 'PHP_SHA512Init' + fixed PHP Bug #45726: PHP_Archive / Archive.php missing Changes since 2.0.0a2: many bugfixes, removal of phar.extract_list, compression API refactored, conversion API refactored Changes since 2.0.0b1: addition of phar.cache_list, many performance improvements and bugfixes implement OpenSSL asynchronous true package signing add support for package signing to tar-based archives require PHP 5.2.1+ + + + + + 2.0.0RC1 + 1.1.1 + + + beta + beta + + 2008-08-31 + PHP License + +BC BREAKING RELEASE + BC breaks: + * Phar object Compression API is rewritten. Use Phar::compress() and decompress(), + Phar::compressFiles()/decompressFiles() and PharFileInfo->compress()/decompress(). + * phar.extract_list and Phar::getExtractList() are removed + +Major feature functionality release + * phar.cache_list allows web-based phar applications to run at equal or faster than + their on-disk equivalent [Greg] + * new default stub allows running of phar-based phars without phar extension [Greg/Steph] + * add support for tar-based and zip-based phar archives [Greg] + * add support for OpenSSL-based true signatures [Greg] + * add support for signatures to tar-based phar archives [Greg] + * add Phar::isFileFormat() [Greg] + * add Phar::convertToExecutable(), Phar::convertToData() [Greg] + * add Phar::compress() [Greg] + * rename Phar::compressAllFiles() to compressFiles(), uncompressAllFiles() to + decompressFiles() [Greg] + * conversion to compressed or to other file formats automatically copies the archive + to a new extension (i.e. ".phar" to ".phar.tar" or ".tar" to ".tar.gz") [Steph] + * add Phar::webPhar() for running a web-based application unmodified + directly from a phar archive [Greg] + * file functions (fopen-based and stat-based) can be instructed to only look for + relative paths within a phar via Phar::interceptFileFuncs() + * add PharData class to allow manipulation/creation of non-executable tar and zip archives. [Steph] + non-executable tar/zip manipulation is allowed even when phar.readonly=1 [Greg] + * paths with . and .. work (phar://blah.phar/a/../b.php => phar://blah.phar/b.php) [Greg] + * add support for mkdir()/rmdir() and support for empty directories to phar file format [Greg] + * add option to compress the entire phar file for phar/tar file format [Greg] + * implement Phar::isCompressed() returning 0, Phar::GZ or Phar::BZ2 [Greg] + * implement Phar::copy(string $from, string $to) [Greg] + * implement Phar::running(), returns path or URL to currently executed phar + * implement Phar::buildFromIterator(Iterator $it[, string $base_directory]) [Greg] + * implement Phar::buildFromDirectory(string $base_directory[, string $regex]) [Steph] + * implement Phar::mount() for mounting external paths or files to locations inside a phar [Greg] + * add Phar::delete() [Greg] + * implement Phar::unlinkArchive() [Greg] + +Security addition + * aliases are validated so that they contain no directory separators as intended + * on conversion to other formats, user-supplied aliases are validated +Changes since 2.0.0a2: many bugfixes, removal of phar.extract_list, compression API refactored, + conversion API refactored +Changes since 2.0.0b1: addition of phar.cache_list, many performance improvements and bugfixes + implement OpenSSL asynchronous true package signing + add support for package signing to tar-based archives + require PHP 5.2.1+ @@ -939,7 +1232,8 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement 2008-05-12 PHP License - BC BREAKING RELEASE + +BC BREAKING RELEASE BC breaks: * Phar object Compression API is rewritten. Use Phar::compress() and decompress(), Phar::compressFiles()/decompressFiles() and PharFileInfo->compress()/decompress(). @@ -978,7 +1272,8 @@ Security addition * on conversion to other formats, user-supplied aliases are validated Changes since 2.0.0a2: many bugfixes, removal of phar.extract_list, compression API refactored, - conversion API refactored + conversion API refactored + @@ -991,7 +1286,8 @@ Changes since 2.0.0a2: many bugfixes, removal of phar.extract_list, compression 2008-03-27 PHP License - Major feature functionality release + +Major feature functionality release * new default stub allows running of phar-based phars without phar extension [Greg/Steph] * add support for tar-based and zip-based phar archives [Greg] * add Phar::isTar(), Phar::isZip(), and Phar::isPhar() [Greg] @@ -1014,7 +1310,8 @@ Changes since 2.0.0a2: many bugfixes, removal of phar.extract_list, compression * implement Phar::mount() for mounting external paths or files to locations inside a phar [Greg] * add Phar::delete() [Greg] -Changes since 2.0.0a1: fix build in PHP 5.2 +Changes since 2.0.0a1: fix build in PHP 5.2 + @@ -1027,7 +1324,8 @@ Changes since 2.0.0a1: fix build in PHP 5.2 2008-03-26 PHP License - Major feature functionality release + +Major feature functionality release * new default stub allows running of phar-based phars without phar extension [Greg/Steph] * add support for tar-based and zip-based phar archives [Greg] * add Phar::isTar(), Phar::isZip(), and Phar::isPhar() [Greg] @@ -1048,7 +1346,8 @@ Changes since 2.0.0a1: fix build in PHP 5.2 * implement Phar::copy(string $from, string $to) [Greg] * implement Phar::buildFromIterator(Iterator $it[, string $base_directory]) [Greg] * implement Phar::mount() for mounting external paths or files to locations inside a phar [Greg] - * add Phar::delete() [Greg] + * add Phar::delete() [Greg] + @@ -1061,7 +1360,8 @@ Changes since 2.0.0a1: fix build in PHP 5.2 2007-08-24 PHP License - * add Phar::setAlias() [Greg] + +* add Phar::setAlias() [Greg] * fix too many open file handles issue [Greg] * fix rename [Greg] * add Phar::getAlias() [Marcus] @@ -1072,7 +1372,8 @@ Changes since 2.0.0a1: fix build in PHP 5.2 * Made Phar::loadPhar() and Phar::mapPhar() ignore extracted archives [Marcus] * Fix issue with compressed entries and uncompressing entries [Marcus] * Verify stubs before writing [Marcus] -* Always use longest stub end to avoid issues with length field [Marcus] +* Always use longest stub end to avoid issues with length field [Marcus] + @@ -1085,13 +1386,15 @@ Changes since 2.0.0a1: fix build in PHP 5.2 2007-05-18 PHP License - * add PharFileInfo::hasMetadata(), PharFileInfo::delMetadata() [Marcus] + +* add PharFileInfo::hasMetadata(), PharFileInfo::delMetadata() [Marcus] * add Phar::hasMetadata(), Phar::delMetadata() [Marcus] * fix Phar::CanWrite() [Marcus] * add preliminary phar command (phar.php) [Marcus] * add phar command (phar.phar) [Marcus] * list all available compression methods using Phar::getSupportedCompression() [Marcus] -* remove RINIT [Marcus] +* remove RINIT [Marcus] + @@ -1104,13 +1407,15 @@ Changes since 2.0.0a1: fix build in PHP 5.2 2007-04-12 PHP License - * implement ability connect a phar file 'phar://whatever' to a directory. That way all + +* implement ability connect a phar file 'phar://whatever' to a directory. That way all access to that phar archive are directed to the extracted directory. This allows to have the installed files and the archive keep the same includes. [Marcus] * implement SHA-2 (256, 512) support [Marcus] * implement setSignatureAlgorithm() and Phar::MD5 Phar::SHA1 Phar::SHA256 Phar::SHA512 Phar::PGP to - choose the kind of signature to use (PGP falls back to SHA1) [Greg] + choose the kind of signature to use (PGP falls back to SHA1) [Greg] + @@ -1123,7 +1428,9 @@ Changes since 2.0.0a1: fix build in PHP 5.2 2007-03-28 PHP License - * Fix return value of unlink() and rename() when used for phar archievs. [Marcus] + +* Fix return value of unlink() and rename() when used for phar archievs. [Marcus] + @@ -1136,9 +1443,11 @@ Changes since 2.0.0a1: fix build in PHP 5.2 2007-03-26 PHP License - *BACKWARDS COMPATIBILITY BREAK* + +*BACKWARDS COMPATIBILITY BREAK* Rename Phar->begin/isFlushingToPhar/commit to startBuffering/isBuffering/stopBuffering -Note that isBuffering() returns the opposite value to isFlushingToPhar() +Note that isBuffering() returns the opposite value to isFlushingToPhar() + diff --git a/ext/phar/php_phar.h b/ext/phar/php_phar.h index a5b8d36661..c8535fb7f4 100644 --- a/ext/phar/php_phar.h +++ b/ext/phar/php_phar.h @@ -22,7 +22,7 @@ #ifndef PHP_PHAR_H #define PHP_PHAR_H -#define PHP_PHAR_VERSION "2.0.0-dev" +#define PHP_PHAR_VERSION "2.0.0" #include "ext/standard/basic_functions.h" extern zend_module_entry phar_module_entry; diff --git a/ext/phar/tests/bug46032.phpt b/ext/phar/tests/bug46032.phpt index 61ed608e3f..5a88d5b426 100644 --- a/ext/phar/tests/bug46032.phpt +++ b/ext/phar/tests/bug46032.phpt @@ -6,7 +6,7 @@ Phar: bug #46032: PharData::__construct wrong memory read --FILE-- ===DONE=== --EXPECTF-- -%unicode|string%(%d) "%smytest" -%unicode|string%(%d) "%smytest" +%string|unicode%(%d) "%smytest" +%string|unicode%(%d) "%smytest" Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Cannot create phar '0000000000000000000', file extension (or combination) not recognised' in %sbug46032.php:%d Stack trace: -#0 %s(%d): PharData->__construct('000000000000000...') +#0 %sbug46032.php(%d): PharData->__construct('000000000000000...') #1 {main} thrown in %sbug46032.php on line %d diff --git a/ext/phar/tests/cache_list/copyonwrite6.phar.phpt b/ext/phar/tests/cache_list/copyonwrite6.phar.phpt index 6d6d56187e..661fef42c1 100644 --- a/ext/phar/tests/cache_list/copyonwrite6.phar.phpt +++ b/ext/phar/tests/cache_list/copyonwrite6.phar.phpt @@ -7,6 +7,7 @@ phar.readonly=0 open_basedir= --SKIPIF-- + --FILE_EXTERNAL-- files/write6.phar --CLEAN-- diff --git a/ext/phar/tests/ini_set.phpt b/ext/phar/tests/ini_set.phpt index 13ec88ab11..7ccd6ea120 100644 --- a/ext/phar/tests/ini_set.phpt +++ b/ext/phar/tests/ini_set.phpt @@ -13,8 +13,12 @@ var_dump(ini_set('phar.require_hash', 1)); var_dump(ini_set('phar.readonly', 1)); var_dump(ini_get('phar.require_hash')); var_dump(ini_get('phar.readonly')); +if (version_compare(PHP_VERSION, "5.3", "<")) { +var_dump(false, false); +} else { var_dump(ini_set('phar.require_hash', 0)); var_dump(ini_set('phar.readonly', 0)); +} var_dump(ini_get('phar.require_hash')); var_dump(ini_get('phar.readonly')); __HALT_COMPILER(); diff --git a/ext/phar/tests/phar_magic.phpt b/ext/phar/tests/phar_magic.phpt index f6a0a675ef..7c60589f9f 100644 --- a/ext/phar/tests/phar_magic.phpt +++ b/ext/phar/tests/phar_magic.phpt @@ -14,6 +14,9 @@ $p['b/c.php'] = 'setStub('setStub('setStub('