cvs: pecl /phar config.m4 config.w32 phar.c phar_object.c

From: Date: Thu, 17 Jan 2008 03:59:06 +0000
Subject: cvs: pecl /phar config.m4 config.w32 phar.c phar_object.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-9531@lists.php.net to get a copy of this message
cellog Thu Jan 17 03:59:06 2008 UTC Modified files: /pecl/phar config.m4 config.w32 phar.c phar_object.c Log: remove HAVE_ZIP defines just as we removed HAVE_BZ2 defines and for the same reason update outdated description of phar in config.m4 make zip extension mandatory on windows for compiling purposes

http://cvs.php.net/viewvc.cgi/pecl/phar/config.m4?r1=1.24&r2=1.25&diff_format=u Index: pecl/phar/config.m4 diff -u pecl/phar/config.m4:1.24 pecl/phar/config.m4:1.25 --- pecl/phar/config.m4:1.24 Thu Jan 17 03:48:28 2008 +++ pecl/phar/config.m4 Thu Jan 17 03:59:06 2008 @@ -1,7 +1,7 @@ -dnl $Id: config.m4,v 1.24 2008/01/17 03:48:28 cellog Exp $ +dnl $Id: config.m4,v 1.25 2008/01/17 03:59:06 cellog Exp $ dnl config.m4 for extension phar -PHP_ARG_ENABLE(phar, for phar support/phar zlib support, +PHP_ARG_ENABLE(phar, for phar archive support, [ --enable-phar Enable phar support]) if test "$PHP_PHAR" != "no"; then http://cvs.php.net/viewvc.cgi/pecl/phar/config.w32?r1=1.20&r2=1.21&diff_format=u Index: pecl/phar/config.w32 diff -u pecl/phar/config.w32:1.20 pecl/phar/config.w32:1.21 --- pecl/phar/config.w32:1.20 Thu Jan 17 03:19:43 2008 +++ pecl/phar/config.w32 Thu Jan 17 03:59:06 2008 @@ -1,11 +1,11 @@ -// $Id: config.w32,v 1.20 2008/01/17 03:19:43 cellog Exp $ +// $Id: config.w32,v 1.21 2008/01/17 03:59:06 cellog Exp $ // vim:ft=javascript ARG_ENABLE("phar", "enable phar support", "no"); -ARG_WITH("phar-zip", "for zip-based phar support", "no"); if (PHP_PHAR != "no") { EXTENSION("phar", "tar.c zip.c stream.c dirstream.c func_interceptors.c phar.c phar_object.c phar_path_check.c"); + ADD_EXTENSION_DEP('phar', 'zip'); if (PHP_ZIP_SHARED) { ADD_FLAG("CFLAGS_PHAR", "/D COMPILE_DL_ZIP "); } @@ -13,7 +13,6 @@ ADD_FLAG("CFLAGS_PHAR", "/D COMPILE_DL_PHAR "); } if (PHP_ZIP != "no") { - ADD_EXTENSION_DEP('phar', 'zip', true); AC_DEFINE('HAVE_PHAR_ZIP', 1); } ADD_EXTENSION_DEP('phar', 'zlib', true); http://cvs.php.net/viewvc.cgi/pecl/phar/phar.c?r1=1.273&r2=1.274&diff_format=u Index: pecl/phar/phar.c diff -u pecl/phar/phar.c:1.273 pecl/phar/phar.c:1.274 --- pecl/phar/phar.c:1.273 Thu Jan 17 03:48:28 2008 +++ pecl/phar/phar.c Thu Jan 17 03:59:06 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: phar.c,v 1.273 2008/01/17 03:48:28 cellog Exp $ */ +/* $Id: phar.c,v 1.274 2008/01/17 03:59:06 cellog Exp $ */ #define PHAR_MAIN 1 #include "phar_internal.h" @@ -1363,13 +1363,6 @@ offset += entry.compressed_filesize; switch (entry.flags & PHAR_ENT_COMPRESSION_MASK) { case PHAR_ENT_COMPRESSED_GZ: -#if !HAVE_ZLIB - if (entry.metadata) { - zval_ptr_dtor(&entry.metadata); - } - efree(entry.filename); - MAPPHAR_FAIL("zlib extension is required for gz compressed .phar file \"%s\""); -#else if (!phar_has_zlib) { if (entry.metadata) { zval_ptr_dtor(&entry.metadata); @@ -1377,7 +1370,6 @@ efree(entry.filename); MAPPHAR_FAIL("zlib extension is required for gz compressed .phar file \"%s\""); } -#endif break; case PHAR_ENT_COMPRESSED_BZ2: if (!phar_has_bz2) { @@ -1651,9 +1643,6 @@ test = '\1'; pos = buffer+tokenlen; if (!memcmp(pos, gz_magic, 3)) { -#if !HAVE_ZLIB - MAPPHAR_ALLOC_FAIL("unable to decompress gzipped phar archive \"%s\" to temporary file, zlib disabled in phar compilation") -#else char err = 0; php_stream_filter *filter; php_stream *temp; @@ -1703,7 +1692,6 @@ /* now, start over */ test = '\0'; -#endif continue; } else if (!memcmp(pos, bz_magic, 3)) { php_stream_filter *filter; @@ -3285,7 +3273,7 @@ php_info_print_table_header(2, "Phar: PHP Archive support", "enabled"); php_info_print_table_row(2, "Phar EXT version", PHAR_EXT_VERSION_STR); php_info_print_table_row(2, "Phar API version", PHAR_API_VERSION_STR); - php_info_print_table_row(2, "CVS revision", "$Revision: 1.273 $"); + php_info_print_table_row(2, "CVS revision", "$Revision: 1.274 $"); php_info_print_table_row(2, "Phar-based phar archives", "enabled"); php_info_print_table_row(2, "Tar-based phar archives", "enabled"); #if HAVE_PHAR_ZIP @@ -3297,15 +3285,11 @@ #else php_info_print_table_row(2, "ZIP-based phar archives", "unavailable"); #endif -#if HAVE_ZLIB if (phar_has_zlib) { php_info_print_table_row(2, "gzip compression", "enabled"); } else { php_info_print_table_row(2, "gzip compression", "disabled (install ext/zlib)"); } -#else - php_info_print_table_row(2, "gzip compression", "unavailable"); -#endif if (phar_has_bz2) { php_info_print_table_row(2, "bzip2 compression", "enabled"); } else { @@ -3331,9 +3315,7 @@ #if HAVE_PHAR_ZIP ZEND_MOD_OPTIONAL_EX("zip", ">=", "1.8.11") #endif -#if HAVE_ZLIB ZEND_MOD_OPTIONAL("zlib") -#endif ZEND_MOD_OPTIONAL("bz2") #if HAVE_SPL ZEND_MOD_REQUIRED("spl") http://cvs.php.net/viewvc.cgi/pecl/phar/phar_object.c?r1=1.128&r2=1.129&diff_format=u Index: pecl/phar/phar_object.c diff -u pecl/phar/phar_object.c:1.128 pecl/phar/phar_object.c:1.129 --- pecl/phar/phar_object.c:1.128 Thu Jan 17 03:48:28 2008 +++ pecl/phar/phar_object.c Thu Jan 17 03:59:06 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: phar_object.c,v 1.128 2008/01/17 03:48:28 cellog Exp $ */ +/* $Id: phar_object.c,v 1.129 2008/01/17 03:59:06 cellog Exp $ */ #include "phar_internal.h" #include "func_interceptors.h" @@ -813,15 +813,11 @@ switch (method) { case PHAR_ENT_COMPRESSED_GZ: -#if HAVE_ZLIB if (phar_has_zlib) { RETURN_TRUE; } else { RETURN_FALSE; } -#else - RETURN_FALSE; -#endif case PHAR_ENT_COMPRESSED_BZ2: if (phar_has_bz2) { @@ -981,11 +977,9 @@ { array_init(return_value); -#if HAVE_ZLIB if (phar_has_zlib) { add_next_index_stringl(return_value, "GZ", 2, 1); } -#endif if (phar_has_bz2) { add_next_index_stringl(return_value, "BZIP2", 5, 1); } @@ -1693,7 +1687,6 @@ flags = PHAR_FILE_COMPRESSED_NONE; break; case PHAR_ENT_COMPRESSED_GZ: -#if HAVE_ZLIB if (!phar_has_zlib) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot compress entire archive with gzip, enable ext/zlib in php.ini"); @@ -1701,10 +1694,6 @@ } flags = PHAR_FILE_COMPRESSED_GZ; break; -#else - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, - "Cannot compress entire archive with gzip, support unavailable"); -#endif case PHAR_ENT_COMPRESSED_BZ2: if (!phar_has_bz2) { @@ -1852,7 +1841,6 @@ flags = PHAR_FILE_COMPRESSED_NONE; break; case PHAR_ENT_COMPRESSED_GZ: -#if HAVE_ZLIB if (!phar_has_zlib) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot compress entire archive with gzip, enable ext/zlib in php.ini"); @@ -1860,10 +1848,6 @@ } flags = PHAR_FILE_COMPRESSED_GZ; break; -#else - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, - "Cannot compress entire archive with gzip, support unavailable"); -#endif case PHAR_ENT_COMPRESSED_BZ2: if (!phar_has_bz2) { @@ -2274,17 +2258,11 @@ *(int *) argument = 0; } } -#if !HAVE_ZLIB - if (entry->flags & PHAR_ENT_COMPRESSED_GZ) { - *(int *) argument = 0; - } -#else if (!phar_has_zlib) { if (entry->flags & PHAR_ENT_COMPRESSED_GZ) { *(int *) argument = 0; } } -#endif return ZEND_HASH_APPLY_KEEP; } /* }}} */ @@ -2309,9 +2287,7 @@ */ PHP_METHOD(Phar, compressAllFilesGZ) { -#if HAVE_ZLIB char *error; -#endif PHAR_ARCHIVE_OBJECT(); if (PHAR_G(readonly)) { @@ -2319,7 +2295,6 @@ "Phar is readonly, cannot change compression"); return; } -#if HAVE_ZLIB if (!phar_has_zlib) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot compress with Gzip compression, zlib extension is not enabled"); @@ -2343,10 +2318,6 @@ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, error); efree(error); } -#else - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, - "Cannot compress with Gzip compression, zlib extension is not enabled"); -#endif } /* }}} */ @@ -3222,7 +3193,6 @@ */ PHP_METHOD(PharFileInfo, setCompressedGZ) { -#if HAVE_ZLIB char *error; PHAR_ENTRY_OBJECT(); @@ -3267,10 +3237,6 @@ efree(error); } RETURN_TRUE; -#else - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, - "Cannot compress with Gzip compression, zlib extension is not enabled"); -#endif } /* }}} */ @@ -3358,19 +3324,11 @@ "Cannot compress deleted file"); return; } -#if !HAVE_ZLIB - if (entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSED_GZ) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, - "Cannot uncompress Gzip-compressed file, zlib extension is not enabled"); - return; - } -#else if (!phar_has_zlib) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot uncompress Gzip-compressed file, zlib extension is not enabled"); return; } -#endif if (!phar_has_bz2) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot uncompress Bzip2-compressed file, bz2 extension is not enabled");
« previous php.pecl.cvs (#9531) next »