cellog Fri Jun 20 04:50:11 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/phar phar.c
Log:
revert really bad solution to the zend_init_rsrc_list/zend_destroy_rsrc_list
problem, replace with real solution
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar.c?r1=1.370.2.22&r2=1.370.2.23&diff_format=u
Index: php-src/ext/phar/phar.c
diff -u php-src/ext/phar/phar.c:1.370.2.22 php-src/ext/phar/phar.c:1.370.2.23
--- php-src/ext/phar/phar.c:1.370.2.22 Wed Jun 18 15:06:50 2008
+++ php-src/ext/phar/phar.c Fri Jun 20 04:50:11 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: phar.c,v 1.370.2.22 2008/06/18 15:06:50 sfox Exp $ */
+/* $Id: phar.c,v 1.370.2.23 2008/06/20 04:50:11 cellog Exp $ */
#define PHAR_MAIN 1
#include "phar_internal.h"
@@ -115,7 +115,9 @@
/* fake request startup */
PHAR_GLOBALS->request_init = 1;
- //zend_init_rsrc_list(TSRMLS_C);
+ if (zend_hash_init(&EG(regular_list), 0, NULL, list_entry_destructor,
0) == SUCCESS) {
+ EG(regular_list).nNextFreeElement=1; /* we don't want
resource id 0 */
+ }
PHAR_G(has_bz2) = zend_hash_exists(&module_registry, "bz2",
sizeof("bz2"));
PHAR_G(has_zlib) = zend_hash_exists(&module_registry, "zlib",
sizeof("zlib"));
/* these two are dummies and will be destroyed later */
@@ -149,8 +151,8 @@
PHAR_GLOBALS->phar_alias_map.arBuckets = 0;
zend_hash_destroy(&cached_phars);
zend_hash_destroy(&cached_alias);
- //zend_destroy_rsrc_list(&EG(regular_list)
TSRMLS_CC);
- //memset(&EG(regular_list), 0,
sizeof(HashTable));
+
zend_hash_graceful_reverse_destroy(&EG(regular_list));
+ memset(&EG(regular_list), 0, sizeof(HashTable));
/* free cached manifests */
PHAR_GLOBALS->request_init = 0;
return;
@@ -172,8 +174,8 @@
cached_alias = PHAR_GLOBALS->phar_alias_map;
PHAR_GLOBALS->phar_fname_map.arBuckets = 0;
PHAR_GLOBALS->phar_alias_map.arBuckets = 0;
- //zend_destroy_rsrc_list(&EG(regular_list) TSRMLS_CC);
- //memset(&EG(regular_list), 0, sizeof(HashTable));
+ zend_hash_graceful_reverse_destroy(&EG(regular_list));
+ memset(&EG(regular_list), 0, sizeof(HashTable));
efree(tmp);
}
/* }}} */
@@ -3358,7 +3360,7 @@
php_info_print_table_header(2, "Phar: PHP Archive support", "enabled");
php_info_print_table_row(2, "Phar EXT version", PHP_PHAR_VERSION);
php_info_print_table_row(2, "Phar API version", PHP_PHAR_API_VERSION);
- php_info_print_table_row(2, "CVS revision", "$Revision: 1.370.2.22 $");
+ php_info_print_table_row(2, "CVS revision", "$Revision: 1.370.2.23 $");
php_info_print_table_row(2, "Phar-based phar archives", "enabled");
php_info_print_table_row(2, "Tar-based phar archives", "enabled");
php_info_print_table_row(2, "ZIP-based phar archives", "enabled");
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php