[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c /ext/spl/tests bug48493.phpt
scottmacTue Jun 9 01:58:07 2009 UTC Added files: (Branch: PHP_5_3) /php-src/ext/spl/tests bug48493.phpt Modified files: /php-src/ext/splphp_spl.c Log: MFH Fix bug #48493 - spl_autoload_register can leave the HT in an inconsistent way. Need to point the second elements previous item to head so we can traverse upwards. http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.17.2.36r2=1.52.2.28.2.17.2.37diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.36 php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.37 --- php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.36 Mon Apr 20 14:20:20 2009 +++ php-src/ext/spl/php_spl.c Tue Jun 9 01:58:07 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.52.2.28.2.17.2.36 2009/04/20 14:20:20 colder Exp $ */ +/* $Id: php_spl.c,v 1.52.2.28.2.17.2.37 2009/06/09 01:58:07 scottmac Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -415,6 +415,7 @@ (ht)-pListTail-pListNext = (ht)-pListHead; \ (ht)-pListHead = (ht)-pListTail; \ (ht)-pListTail = (ht)-pListHead-pListLast; \ + (ht)-pListHead-pListNext-pListLast = (ht)-pListHead;\ (ht)-pListTail-pListNext = NULL; \ (ht)-pListHead-pListLast = NULL; http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/bug48493.phpt?view=markuprev=1.1 Index: php-src/ext/spl/tests/bug48493.phpt +++ php-src/ext/spl/tests/bug48493.phpt --TEST-- SPL: Bug #48493 spl_autoload_unregister() can't handle prepended functions --FILE-- ?php function autoload1() {} function autoload2() {} spl_autoload_register('autoload2'); spl_autoload_register('autoload1', true, true); var_dump(spl_autoload_functions()); spl_autoload_unregister('autoload2'); var_dump(spl_autoload_functions()); ? --EXPECT-- array(2) { [0]= unicode(9) autoload1 [1]= unicode(9) autoload2 } array(1) { [0]= unicode(9) autoload1 } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c php_spl.h
colder Mon Jan 26 11:38:03 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/splphp_spl.c php_spl.h Log: MFH: Improve spl_object_hash() http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.17.2.34r2=1.52.2.28.2.17.2.35diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.34 php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.35 --- php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.34 Wed Dec 31 11:15:43 2008 +++ php-src/ext/spl/php_spl.c Mon Jan 26 11:38:03 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.52.2.28.2.17.2.34 2008/12/31 11:15:43 sebastian Exp $ */ +/* $Id: php_spl.c,v 1.52.2.28.2.17.2.35 2009/01/26 11:38:03 colder Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -39,7 +39,9 @@ #include spl_heap.h #include zend_exceptions.h #include zend_interfaces.h -#include ext/standard/md5.h +#include ext/standard/php_rand.h +#include ext/standard/php_lcg.h +#include main/snprintf.h #ifdef COMPILE_DL_SPL ZEND_GET_MODULE(spl) @@ -669,34 +671,41 @@ PHP_FUNCTION(spl_object_hash) { zval *obj; - char* md5str; + char* hash; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, o, obj) == FAILURE) { return; } - md5str = emalloc(33); - php_spl_object_hash(obj, md5str TSRMLS_CC); + hash = emalloc(33); + php_spl_object_hash(obj, hash TSRMLS_CC); - RETVAL_STRING(md5str, 0); + RETVAL_STRING(hash, 0); } /* }}} */ -PHPAPI void php_spl_object_hash(zval *obj, char *md5str TSRMLS_DC) /* {{{*/ +PHPAPI void php_spl_object_hash(zval *obj, char *result TSRMLS_DC) /* {{{*/ { - int len; - char *hash; - PHP_MD5_CTX context; - unsigned char digest[16]; - - len = spprintf(hash, 0, %p:%d, Z_OBJ_HT_P(obj), Z_OBJ_HANDLE_P(obj)); - - md5str[0] = '\0'; - PHP_MD5Init(context); - PHP_MD5Update(context, (unsigned char*)hash, len); - PHP_MD5Final(digest, context); - make_digest(md5str, digest); - efree(hash); + intptr_t hash_handle, hash_handlers; + char *hex; + + if (!SPL_G(hash_mask_init)) { + if (!BG(mt_rand_is_seeded)) { + php_mt_srand(GENERATE_SEED() TSRMLS_CC); + } + + SPL_G(hash_mask_handle) = (intptr_t)(php_mt_rand(TSRMLS_C) 1); + SPL_G(hash_mask_handlers) = (intptr_t)(php_mt_rand(TSRMLS_C) 1); + SPL_G(hash_mask_init) = 1; + } + + hash_handle = SPL_G(hash_mask_handle)^(intptr_t)Z_OBJ_HANDLE_P(obj); + hash_handlers = SPL_G(hash_mask_handlers)^(intptr_t)Z_OBJ_HT_P(obj); + + spprintf(hex, 32, %016x%016x, hash_handle, hash_handlers); + + strlcpy(result, hex, 33); + efree(hex); } /* }}} */ @@ -844,6 +853,7 @@ SPL_G(autoload_extensions) = NULL; SPL_G(autoload_extensions_len) = 0; SPL_G(autoload_functions) = NULL; + SPL_G(hash_mask_init) = 0; return SUCCESS; } /* }}} */ @@ -859,6 +869,9 @@ FREE_HASHTABLE(SPL_G(autoload_functions)); SPL_G(autoload_functions) = NULL; } + if (SPL_G(hash_mask_init)) { + SPL_G(hash_mask_init) = 0; + } return SUCCESS; } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.h?r1=1.17.2.1.2.3.2.6r2=1.17.2.1.2.3.2.7diff_format=u Index: php-src/ext/spl/php_spl.h diff -u php-src/ext/spl/php_spl.h:1.17.2.1.2.3.2.6 php-src/ext/spl/php_spl.h:1.17.2.1.2.3.2.7 --- php-src/ext/spl/php_spl.h:1.17.2.1.2.3.2.6 Wed Dec 31 11:15:43 2008 +++ php-src/ext/spl/php_spl.h Mon Jan 26 11:38:03 2009 @@ -62,6 +62,9 @@ HashTable * autoload_functions; int autoload_running; int autoload_extensions_len; + intptr_t hash_mask_handle; + intptr_t hash_mask_handlers; + int hash_mask_init; ZEND_END_MODULE_GLOBALS(spl) #ifdef ZTS -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c
bjori Sun Nov 30 00:12:29 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/splphp_spl.c Log: MFH: Fix proto http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.17.2.31r2=1.52.2.28.2.17.2.32diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.31 php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.32 --- php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.31 Thu Nov 27 19:01:23 2008 +++ php-src/ext/spl/php_spl.c Sun Nov 30 00:12:29 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.52.2.28.2.17.2.31 2008/11/27 19:01:23 dmitry Exp $ */ +/* $Id: php_spl.c,v 1.52.2.28.2.17.2.32 2008/11/30 00:12:29 bjori Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -85,7 +85,7 @@ return *ce; } -/* {{{ proto array class_parents(object instance) +/* {{{ proto array class_parents(object instance [, boolean autoload = true]) Return an array containing the names of all parent classes */ PHP_FUNCTION(class_parents) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c
bjori Sun Nov 30 00:23:06 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/splphp_spl.c Log: Fix arginfo http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.17.2.32r2=1.52.2.28.2.17.2.33diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.32 php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.33 --- php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.32 Sun Nov 30 00:12:29 2008 +++ php-src/ext/spl/php_spl.c Sun Nov 30 00:23:06 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.52.2.28.2.17.2.32 2008/11/30 00:12:29 bjori Exp $ */ +/* $Id: php_spl.c,v 1.52.2.28.2.17.2.33 2008/11/30 00:23:06 bjori Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -760,6 +760,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_parents, 0, 0, 1) ZEND_ARG_INFO(0, instance) + ZEND_ARG_INFO(0, autoload) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_implements, 0, 0, 1) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c /ext/standard basic_functions.c /ext/standard/tests/array array_map_object2.phpt ZendEngine2 zend_API.c zend_API.h zend_execute_API.c zend_interfa
dmitry Thu Jul 24 09:42:21 2008 UTC Added files: (Branch: PHP_5_3) /ZendEngine2/tests lsb_021.phpt lsb_022.phpt Modified files: /ZendEngine2zend_API.c zend_API.h zend_execute_API.c zend_interfaces.c zend_vm_def.h zend_vm_execute.h /ZendEngine2/tests bug45186.phpt bug45186_2.phpt lsb_015.phpt lsb_019.phpt lsb_020.phpt objects_027.phpt /php-src/ext/splphp_spl.c /php-src/ext/standard basic_functions.c /php-src/ext/standard/tests/array array_map_object2.phpt Log: LSB parent/self forwarding http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.296.2.27.2.34.2.40r2=1.296.2.27.2.34.2.41diff_format=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.296.2.27.2.34.2.40 ZendEngine2/zend_API.c:1.296.2.27.2.34.2.41 --- ZendEngine2/zend_API.c:1.296.2.27.2.34.2.40 Mon Jul 14 12:18:20 2008 +++ ZendEngine2/zend_API.c Thu Jul 24 09:42:15 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: zend_API.c,v 1.296.2.27.2.34.2.40 2008/07/14 12:18:20 dmitry Exp $ */ +/* $Id: zend_API.c,v 1.296.2.27.2.34.2.41 2008/07/24 09:42:15 dmitry Exp $ */ #include zend.h #include zend_execute.h @@ -2305,21 +2305,69 @@ } /* }}} */ -static int zend_is_callable_check_func(int check_flags, zval ***zobj_ptr_ptr, zend_class_entry *ce_org, zval *callable, zend_class_entry **ce_ptr, zend_function **fptr_ptr, char **error TSRMLS_DC) /* {{{ */ +static int zend_is_callable_check_class(char *name, int name_len, zend_fcall_info_cache *fcc, char **error TSRMLS_DC) /* {{{ */ { + int ret = 0; + zend_class_entry **pce; + char *lcname = zend_str_tolower_dup(name, name_len); + + if (name_len == sizeof(self) - 1 + !memcmp(lcname, self, sizeof(self) - 1)) { + if (!EG(scope)) { + if (error) *error = estrdup(cannot access self:: when no class scope is active); + } else { + fcc-called_scope = EG(called_scope); + fcc-calling_scope = EG(scope); + ret = 1; + } + } else if (name_len == sizeof(parent) - 1 + !memcmp(lcname, parent, sizeof(parent) - 1)) { + if (!EG(scope)) { + if (error) *error = estrdup(cannot access parent:: when no class scope is active); + } else if (!EG(scope)-parent) { + if (error) *error = estrdup(cannot access parent:: when current class scope has no parent); + } else { + fcc-called_scope = EG(called_scope); + fcc-calling_scope = EG(scope)-parent; + ret = 1; + } + } else if (name_len == sizeof(static) - 1 + !memcmp(lcname, static, sizeof(static) - 1)) { + if (!EG(called_scope)) { + if (error) *error = estrdup(cannot access static:: when no class scope is active); + } else { + fcc-called_scope = EG(called_scope); + fcc-calling_scope = EG(called_scope); + ret = 1; + } + } else if (zend_lookup_class_ex(name, name_len, 1, pce TSRMLS_CC) == SUCCESS) { + fcc-called_scope = fcc-calling_scope = *pce; + ret = 1; + } else { + if (error) zend_spprintf(error, 0, class '%.*s' not found, name_len, name); + } + efree(lcname); + return ret; +} +/* }}} */ + + +static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fcall_info_cache *fcc, char **error TSRMLS_DC) /* {{{ */ +{ + zend_class_entry *ce_org = fcc-calling_scope; int retval; char *lmname, *colon; int clen, mlen; - zend_function *fptr; zend_class_entry *last_scope; HashTable *ftable; + int call_via_handler = 0; if (error) { *error = NULL; } - *ce_ptr = NULL; - *fptr_ptr = NULL; + fcc-calling_scope = NULL; + fcc-function_handler = NULL; if (!ce_org) { /* Skip leading :: */ @@ -2334,8 +2382,7 @@ } /* Check if function with given name exists. * This may be a compound name that includes namespace name */ - if (zend_hash_find(EG(function_table), lmname, mlen+1, (void**)fptr) == SUCCESS) { - *fptr_ptr = fptr; + if (zend_hash_find(EG(function_table), lmname, mlen+1, (void**)fcc-function_handler) == SUCCESS) { efree(lmname); return 1; } @@ -2363,15 +2410,16 @@ if (ce_org) { EG(scope) = ce_org; } -
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c
helly Sun Jul 13 21:45:07 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/splphp_spl.c Log: - Use new helper http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.17.2.21r2=1.52.2.28.2.17.2.22diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.21 php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.22 --- php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.21 Sat Jul 12 14:58:41 2008 +++ php-src/ext/spl/php_spl.c Sun Jul 13 21:45:07 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.52.2.28.2.17.2.21 2008/07/12 14:58:41 helly Exp $ */ +/* $Id: php_spl.c,v 1.52.2.28.2.17.2.22 2008/07/13 21:45:07 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -388,10 +388,9 @@ zend_hash_get_current_key_ex(SPL_G(autoload_functions), func_name, func_name_len, dummy, 0, function_pos); zend_hash_get_current_data_ex(SPL_G(autoload_functions), (void **) alfi, function_pos); zend_call_method(alfi-obj ? alfi-obj : NULL, alfi-ce, alfi-func_ptr, func_name, func_name_len, retval, 1, class_name, NULL TSRMLS_CC); + zend_exception_set_previous(exception TSRMLS_CC); if (EG(exception)) { - if (exception) { - zend_update_property(zend_exception_get_default(TSRMLS_C), EG(exception), previous, sizeof(previous)-1, exception TSRMLS_CC); - } + zend_exception_set_previous(exception TSRMLS_CC); exception = EG(exception); EG(exception) = NULL; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c /ext/spl/tests spl_autoload_012.phpt
helly Sat Jul 12 14:58:41 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/spl/tests spl_autoload_012.phpt Modified files: /php-src/ext/splphp_spl.c Log: - MFH Allow multiple exceptions in spl's autoload http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.17.2.20r2=1.52.2.28.2.17.2.21diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.20 php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.21 --- php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.20 Thu Jul 3 01:55:47 2008 +++ php-src/ext/spl/php_spl.c Sat Jul 12 14:58:41 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.52.2.28.2.17.2.20 2008/07/03 01:55:47 felipe Exp $ */ +/* $Id: php_spl.c,v 1.52.2.28.2.17.2.21 2008/07/12 14:58:41 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -379,14 +379,22 @@ if (SPL_G(autoload_functions)) { int l_autoload_running = SPL_G(autoload_running); + zval *exception = NULL; SPL_G(autoload_running) = 1; class_name_len = Z_STRLEN_P(class_name); lc_name = zend_str_tolower_dup(Z_STRVAL_P(class_name), class_name_len); zend_hash_internal_pointer_reset_ex(SPL_G(autoload_functions), function_pos); - while(zend_hash_has_more_elements_ex(SPL_G(autoload_functions), function_pos) == SUCCESS !EG(exception)) { + while(zend_hash_has_more_elements_ex(SPL_G(autoload_functions), function_pos) == SUCCESS) { zend_hash_get_current_key_ex(SPL_G(autoload_functions), func_name, func_name_len, dummy, 0, function_pos); zend_hash_get_current_data_ex(SPL_G(autoload_functions), (void **) alfi, function_pos); zend_call_method(alfi-obj ? alfi-obj : NULL, alfi-ce, alfi-func_ptr, func_name, func_name_len, retval, 1, class_name, NULL TSRMLS_CC); + if (EG(exception)) { + if (exception) { + zend_update_property(zend_exception_get_default(TSRMLS_C), EG(exception), previous, sizeof(previous)-1, exception TSRMLS_CC); + } + exception = EG(exception); + EG(exception) = NULL; + } if (retval) { zval_ptr_dtor(retval); } @@ -395,6 +403,7 @@ } zend_hash_move_forward_ex(SPL_G(autoload_functions), function_pos); } + EG(exception) = exception; efree(lc_name); SPL_G(autoload_running) = l_autoload_running; } else { http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/spl_autoload_012.phpt?view=markuprev=1.1 Index: php-src/ext/spl/tests/spl_autoload_012.phpt +++ php-src/ext/spl/tests/spl_autoload_012.phpt --TEST-- SPL: spl_autoload() capturing multiple Exceptions in __autoload --FILE-- ?php function autoload_first($name) { echo __METHOD__ . \n; throw new Exception('first'); } function autoload_second($name) { echo __METHOD__ . \n; throw new Exception('second'); } spl_autoload_register('autoload_first'); spl_autoload_register('autoload_second'); class_exists('ThisClassDoesNotExist'); ? ===DONE=== --EXPECTF-- autoload_first autoload_second Fatal error: Uncaught exception 'Exception' with message 'first' in %sspl_autoload_012.php:%d Stack trace: #0 [internal function]: autoload_first('ThisClassDoesNo...') #1 [internal function]: spl_autoload_call('ThisClassDoesNo...') #2 %sspl_autoload_012.php(%d): class_exists('ThisClassDoesNo...') #3 {main} Next exception 'Exception' with message 'second' in %sspl_autoload_012.php:%d Stack trace: #0 [internal function]: autoload_second('ThisClassDoesNo...') #1 [internal function]: spl_autoload_call('ThisClassDoesNo...') #2 %sspl_autoload_012.php(%d): class_exists('ThisClassDoesNo...') #3 {main} thrown in %sspl_autoload_012.php on line %d -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c /ext/spl/tests spl_autoload_010.phpt spl_autoload_011.phpt
colder Sun May 25 12:22:38 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/spl/tests spl_autoload_010.phpt spl_autoload_011.phpt Modified files: /php-src/ext/splphp_spl.c Log: MFH: Add a prepend param to spl_autoload_register http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.17.2.16r2=1.52.2.28.2.17.2.17diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.16 php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.17 --- php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.16 Tue Apr 29 09:18:26 2008 +++ php-src/ext/spl/php_spl.c Sun May 25 12:22:37 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.52.2.28.2.17.2.16 2008/04/29 09:18:26 dmitry Exp $ */ +/* $Id: php_spl.c,v 1.52.2.28.2.17.2.17 2008/05/25 12:22:37 colder Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -401,7 +401,14 @@ } } /* }}} */ -/* {{{ proto bool spl_autoload_register([mixed autoload_function = spl_autoload [, throw = true]]) +#define HT_MOVE_TAIL_TO_HEAD(ht) \ + (ht)-pListTail-pListNext = (ht)-pListHead; \ + (ht)-pListHead = (ht)-pListTail; \ + (ht)-pListTail = (ht)-pListHead-pListLast; \ + (ht)-pListTail-pListNext = NULL; \ + (ht)-pListHead-pListLast = NULL; + +/* {{{ proto bool spl_autoload_register([mixed autoload_function = spl_autoload [, throw = true [, prepend]]]) Register given function as __autoload() implementation */ PHP_FUNCTION(spl_autoload_register) { @@ -410,11 +417,12 @@ char *lc_name = NULL; zval *zcallable = NULL; zend_bool do_throw = 1; + zend_bool prepend = 0; zend_function *spl_func_ptr; autoload_func_info alfi; zval **obj_ptr; - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, |zb, zcallable, do_throw) == FAILURE) { + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, |zbb, zcallable, do_throw, prepend) == FAILURE) { return; } @@ -507,9 +515,17 @@ spl_alfi.obj = NULL; spl_alfi.ce = NULL; zend_hash_add(SPL_G(autoload_functions), spl_autoload, sizeof(spl_autoload), spl_alfi, sizeof(autoload_func_info), NULL); + if (prepend SPL_G(autoload_functions)-nNumOfElements 1) { + /* Move the newly created element to the head of the hashtable */ + HT_MOVE_TAIL_TO_HEAD(SPL_G(autoload_functions)); + } } zend_hash_add(SPL_G(autoload_functions), lc_name, func_name_len+1, alfi.func_ptr, sizeof(autoload_func_info), NULL); + if (prepend SPL_G(autoload_functions)-nNumOfElements 1) { + /* Move the newly created element to the head of the hashtable */ + HT_MOVE_TAIL_TO_HEAD(SPL_G(autoload_functions)); + } skip: efree(lc_name); } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/spl_autoload_010.phpt?view=markuprev=1.1 Index: php-src/ext/spl/tests/spl_autoload_010.phpt +++ php-src/ext/spl/tests/spl_autoload_010.phpt --TEST-- SPL: spl_autoload() and prepend --INI-- include_path=. --FILE-- ?php function autoloadA($name) { echo A - $name\n; } function autoloadB($name) { echo B - $name\n; } function autoloadC($name) { echo C - $name\n; class C{} } spl_autoload_register('autoloadA'); spl_autoload_register('autoloadB', true, true); spl_autoload_register('autoloadC'); new C; ? ===DONE=== ?php exit(0); ? --EXPECTF-- B - C A - C C - C ===DONE=== http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/spl_autoload_011.phpt?view=markuprev=1.1 Index: php-src/ext/spl/tests/spl_autoload_011.phpt +++ php-src/ext/spl/tests/spl_autoload_011.phpt --TEST-- SPL: spl_autoload() and object freed --INI-- include_path=. --FILE-- ?php class A { public $var = 1; public function autoload() { echo var:.$this-var.\n; } public function __destruct() { echo __destruct__\n; } } $a = new A; $a-var = 2; spl_autoload_register(array($a, 'autoload')); unset($a); var_dump(class_exists(C, true)); ? ===DONE=== ?php exit(0); ? --EXPECTF-- var:2 bool(false) ===DONE=== __destruct__ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c
dmitry Tue Apr 29 09:18:26 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/splphp_spl.c Log: Added missing lazy initialization http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.17.2.15r2=1.52.2.28.2.17.2.16diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.15 php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.16 --- php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.15 Sun Mar 16 21:06:53 2008 +++ php-src/ext/spl/php_spl.c Tue Apr 29 09:18:26 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.52.2.28.2.17.2.15 2008/03/16 21:06:53 helly Exp $ */ +/* $Id: php_spl.c,v 1.52.2.28.2.17.2.16 2008/04/29 09:18:26 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -243,6 +243,9 @@ if (new_op_array) { EG(return_value_ptr_ptr) = result; EG(active_op_array) = new_op_array; + if (!EG(active_symbol_table)) { + zend_rebuild_symbol_table(TSRMLS_C); + } zend_execute(new_op_array TSRMLS_CC); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c /ext/spl/tests bug40091.phpt
colder Fri Feb 29 13:55:23 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/splphp_spl.c /php-src/ext/spl/tests bug40091.phpt Log: MFH: Fix #44144 (object methods as spl autoload functions returned correctly) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.17.2.13r2=1.52.2.28.2.17.2.14diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.13 php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.14 --- php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.13 Mon Feb 25 23:39:08 2008 +++ php-src/ext/spl/php_spl.c Fri Feb 29 13:55:23 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.52.2.28.2.17.2.13 2008/02/25 23:39:08 colder Exp $ */ +/* $Id: php_spl.c,v 1.52.2.28.2.17.2.14 2008/02/29 13:55:23 colder Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -587,8 +587,9 @@ Return all registered __autoload() functionns */ PHP_FUNCTION(spl_autoload_functions) { - zend_function *fptr, **func_ptr_ptr; + zend_function *fptr; HashPosition function_pos; + autoload_func_info *alfi; if (!EG(autoload_func)) { if (zend_hash_find(EG(function_table), ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME), (void **) fptr) == SUCCESS) { @@ -605,17 +606,22 @@ array_init(return_value); zend_hash_internal_pointer_reset_ex(SPL_G(autoload_functions), function_pos); while(zend_hash_has_more_elements_ex(SPL_G(autoload_functions), function_pos) == SUCCESS) { - zend_hash_get_current_data_ex(SPL_G(autoload_functions), (void **) func_ptr_ptr, function_pos); - if ((*func_ptr_ptr)-common.scope) { + zend_hash_get_current_data_ex(SPL_G(autoload_functions), (void **) alfi, function_pos); + if (alfi-func_ptr-common.scope) { zval *tmp; MAKE_STD_ZVAL(tmp); array_init(tmp); - add_next_index_string(tmp, (*func_ptr_ptr)-common.scope-name, 1); - add_next_index_string(tmp, (*func_ptr_ptr)-common.function_name, 1); + if (alfi-obj) { + Z_ADDREF_P(alfi-obj); + add_next_index_zval(tmp, alfi-obj); + } else { + add_next_index_string(tmp, alfi-ce-name, 1); + } + add_next_index_string(tmp, alfi-func_ptr-common.function_name, 1); add_next_index_zval(return_value, tmp); } else - add_next_index_string(return_value, (*func_ptr_ptr)-common.function_name, 1); + add_next_index_string(return_value, alfi-func_ptr-common.function_name, 1); zend_hash_move_forward_ex(SPL_G(autoload_functions), function_pos); } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/bug40091.phpt?r1=1.1.2.1r2=1.1.2.1.2.1diff_format=u Index: php-src/ext/spl/tests/bug40091.phpt diff -u php-src/ext/spl/tests/bug40091.phpt:1.1.2.1 php-src/ext/spl/tests/bug40091.phpt:1.1.2.1.2.1 --- php-src/ext/spl/tests/bug40091.phpt:1.1.2.1 Wed Jan 10 18:14:37 2007 +++ php-src/ext/spl/tests/bug40091.phpt Fri Feb 29 13:55:23 2008 @@ -25,13 +25,19 @@ ( [0] = Array ( -[0] = MyAutoloader +[0] = MyAutoloader Object +( +) + [1] = autoload ) [1] = Array ( -[0] = MyAutoloader +[0] = MyAutoloader Object +( +) + [1] = autoload ) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c /ext/spl/tests dit_001.phpt spl_autoload_007.phpt
helly Mon Feb 4 17:07:07 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/splphp_spl.c /php-src/ext/spl/tests dit_001.phpt spl_autoload_007.phpt Log: - MFH Fix messages and tests http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.17.2.11r2=1.52.2.28.2.17.2.12diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.11 php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.12 --- php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.11 Sat Feb 2 23:09:38 2008 +++ php-src/ext/spl/php_spl.c Mon Feb 4 17:07:06 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.52.2.28.2.17.2.11 2008/02/02 23:09:38 helly Exp $ */ +/* $Id: php_spl.c,v 1.52.2.28.2.17.2.12 2008/02/04 17:07:06 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -378,7 +378,7 @@ zend_hash_get_current_data_ex(SPL_G(autoload_functions), (void **) alfi, function_pos); zend_call_method(alfi-obj ? alfi-obj : NULL, alfi-ce, alfi-func_ptr, func_name, func_name_len, retval, 1, class_name, NULL TSRMLS_CC); if (retval) { - zval_ptr_dtor(retval); + zval_ptr_dtor(retval); } if (zend_hash_exists(EG(class_table), lc_name, class_name_len + 1)) { break; @@ -435,7 +435,7 @@ RETURN_FALSE; } else if (do_throw) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, Passed array does not specify %s %smethod, (%s), alfi.func_ptr ? a callable : an existing, !obj_ptr ? static : , error); + zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, Passed array does not specify %s %smethod (%s), alfi.func_ptr ? a callable : an existing, !obj_ptr ? static : , error); } if (error) { efree(error); http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/dit_001.phpt?r1=1.3.6.2r2=1.3.6.3diff_format=u Index: php-src/ext/spl/tests/dit_001.phpt diff -u php-src/ext/spl/tests/dit_001.phpt:1.3.6.2 php-src/ext/spl/tests/dit_001.phpt:1.3.6.3 --- php-src/ext/spl/tests/dit_001.phpt:1.3.6.2 Thu Jan 31 07:44:01 2008 +++ php-src/ext/spl/tests/dit_001.phpt Mon Feb 4 17:07:07 2008 @@ -15,7 +15,7 @@ object(DirectoryIterator)#%d (3) { %spathName%sSplFileInfo:private]= %s(1) . - %sglob%sRecursiveDirectoryIterator:private]= + %sglob%sDirectoryIterator:private]= bool(false) %ssubPathName%sRecursiveDirectoryIterator:private]= %s(0) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/spl_autoload_007.phpt?r1=1.1.2.2.4.1r2=1.1.2.2.4.2diff_format=u Index: php-src/ext/spl/tests/spl_autoload_007.phpt diff -u php-src/ext/spl/tests/spl_autoload_007.phpt:1.1.2.2.4.1 php-src/ext/spl/tests/spl_autoload_007.phpt:1.1.2.2.4.2 --- php-src/ext/spl/tests/spl_autoload_007.phpt:1.1.2.2.4.1 Sat Feb 2 03:20:51 2008 +++ php-src/ext/spl/tests/spl_autoload_007.phpt Mon Feb 4 17:07:07 2008 @@ -76,7 +76,7 @@ [1]= string(8) notExist } -Passed array does not specify an existing static method, (class 'MyAutoLoader' does not have a method 'notexist') +Passed array does not specify an existing static method (class 'MyAutoLoader' does not have a method 'notexist') array(2) { [0]= @@ -84,7 +84,7 @@ [1]= string(8) noAccess } -Passed array does not specify a callable static method, (cannot access protected method MyAutoLoader::noAccess()) +Passed array does not specify a callable static method (cannot access protected method MyAutoLoader::noAccess()) array(2) { [0]= @@ -109,7 +109,7 @@ [1]= string(8) notExist } -Passed array does not specify an existing method, (class 'MyAutoLoader' does not have a method 'notexist') +Passed array does not specify an existing method (class 'MyAutoLoader' does not have a method 'notexist') array(2) { [0]= @@ -118,7 +118,7 @@ [1]= string(8) noAccess } -Passed array does not specify a callable method, (cannot access protected method MyAutoLoader::noAccess()) +Passed array does not specify a callable method (cannot access protected method MyAutoLoader::noAccess()) array(2) { [0]= -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c
helly Fri Feb 1 23:46:36 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/splphp_spl.c Log: - Fix build, thanks Christian Rodriguez for noticing # I wonder why the other machine didn't catch this http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.17.2.9r2=1.52.2.28.2.17.2.10diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.9 php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.10 --- php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.9Sun Jan 27 15:04:41 2008 +++ php-src/ext/spl/php_spl.c Fri Feb 1 23:46:36 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.52.2.28.2.17.2.9 2008/01/27 15:04:41 helly Exp $ */ +/* $Id: php_spl.c,v 1.52.2.28.2.17.2.10 2008/02/01 23:46:36 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -395,7 +395,7 @@ Register given function as __autoload() implementation */ PHP_FUNCTION(spl_autoload_register) { - char *func_name; + char *func_name, *error = NULL; int func_name_len; char *lc_name = NULL; zval *zcallable = NULL; @@ -420,34 +420,49 @@ } } - if (!zend_is_callable_ex(zcallable, IS_CALLABLE_STRICT, func_name, func_name_len, alfi.ce, alfi.func_ptr, obj_ptr TSRMLS_CC)) { + if (!zend_is_callable_ex(zcallable, IS_CALLABLE_STRICT, func_name, func_name_len, alfi.ce, alfi.func_ptr, obj_ptr, error TSRMLS_CC)) { if (Z_TYPE_P(zcallable) == IS_ARRAY) { if (!obj_ptr alfi.func_ptr !(alfi.func_ptr-common.fn_flags ZEND_ACC_STATIC)) { if (do_throw) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, Passed array specifies a non static method but no object); + zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, Passed array specifies a non static method but no object (%s), error); + } + if (error) { + efree(error); } efree(func_name); RETURN_FALSE; } else if (do_throw) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, Passed array does not specify %s %smethod, alfi.func_ptr ? a callable : an existing, !obj_ptr ? static : ); + zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, Passed array does not specify %s %smethod, (%s), alfi.func_ptr ? a callable : an existing, !obj_ptr ? static : , error); + } + if (error) { + efree(error); } efree(func_name); RETURN_FALSE; } else if (Z_TYPE_P(zcallable) == IS_STRING) { if (do_throw) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, Function '%s' not %s, func_name, alfi.func_ptr ? callable : found); + zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, Function '%s' not %s (%s), func_name, alfi.func_ptr ? callable : found, error); + } + if (error) { + efree(error); } efree(func_name); RETURN_FALSE; } else { if (do_throw) { - zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, Illegal value passed); + zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, Illegal value passed (%s), error); + } + if (error) { + efree(error); } efree(func_name); RETURN_FALSE; } } + if (error) { + efree(error); + } lc_name = safe_emalloc(func_name_len, 1, sizeof(long) + 1); zend_str_tolower_copy(lc_name, func_name, func_name_len); @@ -501,7 +516,7 @@ Unregister given function as __autoload() implementation */
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c php_spl.h /ext/tidy php_tidy.h tidy.c
helly Sun Jan 27 15:04:41 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/splphp_spl.c php_spl.h /php-src/ext/tidy php_tidy.h tidy.c Log: - MFH revert over constfying http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.17.2.8r2=1.52.2.28.2.17.2.9diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.8 php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.9 --- php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.8Fri Jan 25 20:29:48 2008 +++ php-src/ext/spl/php_spl.c Sun Jan 27 15:04:41 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.52.2.28.2.17.2.8 2008/01/25 20:29:48 nlopess Exp $ */ +/* $Id: php_spl.c,v 1.52.2.28.2.17.2.9 2008/01/27 15:04:41 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -764,7 +764,7 @@ /* {{{ spl_module_entry */ -const zend_module_entry spl_module_entry = { +zend_module_entry spl_module_entry = { #ifdef HAVE_SIMPLEXML STANDARD_MODULE_HEADER_EX, NULL, spl_deps, http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.h?r1=1.17.2.1.2.3.2.3r2=1.17.2.1.2.3.2.4diff_format=u Index: php-src/ext/spl/php_spl.h diff -u php-src/ext/spl/php_spl.h:1.17.2.1.2.3.2.3 php-src/ext/spl/php_spl.h:1.17.2.1.2.3.2.4 --- php-src/ext/spl/php_spl.h:1.17.2.1.2.3.2.3 Fri Jan 25 20:29:48 2008 +++ php-src/ext/spl/php_spl.h Sun Jan 27 15:04:41 2008 @@ -28,7 +28,7 @@ #define SPL_DEBUG(x) #endif -extern const zend_module_entry spl_module_entry; +extern zend_module_entry spl_module_entry; #define phpext_spl_ptr spl_module_entry #ifdef PHP_WIN32 http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/php_tidy.h?r1=1.26.2.1.2.5.2.2r2=1.26.2.1.2.5.2.3diff_format=u Index: php-src/ext/tidy/php_tidy.h diff -u php-src/ext/tidy/php_tidy.h:1.26.2.1.2.5.2.2 php-src/ext/tidy/php_tidy.h:1.26.2.1.2.5.2.3 --- php-src/ext/tidy/php_tidy.h:1.26.2.1.2.5.2.2Fri Jan 25 20:29:48 2008 +++ php-src/ext/tidy/php_tidy.h Sun Jan 27 15:04:41 2008 @@ -16,12 +16,12 @@ +--+ */ -/* $Id: php_tidy.h,v 1.26.2.1.2.5.2.2 2008/01/25 20:29:48 nlopess Exp $ */ +/* $Id: php_tidy.h,v 1.26.2.1.2.5.2.3 2008/01/27 15:04:41 helly Exp $ */ #ifndef PHP_TIDY_H #define PHP_TIDY_H -extern const zend_module_entry tidy_module_entry; +extern zend_module_entry tidy_module_entry; #define phpext_tidy_ptr tidy_module_entry #define TIDY_METHOD_MAP(name, func_name, arg_types) \ http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.66.2.8.2.24.2.4r2=1.66.2.8.2.24.2.5diff_format=u Index: php-src/ext/tidy/tidy.c diff -u php-src/ext/tidy/tidy.c:1.66.2.8.2.24.2.4 php-src/ext/tidy/tidy.c:1.66.2.8.2.24.2.5 --- php-src/ext/tidy/tidy.c:1.66.2.8.2.24.2.4 Fri Jan 25 20:29:48 2008 +++ php-src/ext/tidy/tidy.c Sun Jan 27 15:04:41 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tidy.c,v 1.66.2.8.2.24.2.4 2008/01/25 20:29:48 nlopess Exp $ */ +/* $Id: tidy.c,v 1.66.2.8.2.24.2.5 2008/01/27 15:04:41 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -351,7 +351,7 @@ static zend_object_handlers tidy_object_handlers_doc; static zend_object_handlers tidy_object_handlers_node; -const zend_module_entry tidy_module_entry = { +zend_module_entry tidy_module_entry = { STANDARD_MODULE_HEADER, tidy, tidy_functions, @@ -998,7 +998,7 @@ php_info_print_table_start(); php_info_print_table_header(2, Tidy support, enabled); php_info_print_table_row(2, libTidy Release, (char *)tidyReleaseDate()); - php_info_print_table_row(2, Extension Version, PHP_TIDY_MODULE_VERSION ($Id: tidy.c,v 1.66.2.8.2.24.2.4 2008/01/25 20:29:48 nlopess Exp $)); + php_info_print_table_row(2, Extension Version, PHP_TIDY_MODULE_VERSION ($Id: tidy.c,v 1.66.2.8.2.24.2.5 2008/01/27 15:04:41 helly Exp $)); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c php_spl.h /ext/tidy php_tidy.h tidy.c
Confirmed, gave me a headache today ... - Markus Antony Dovgal wrote: On 25.01.2008 23:29, Nuno Lopes wrote: -zend_module_entry spl_module_entry = { +const zend_module_entry spl_module_entry = { -zend_module_entry tidy_module_entry = { +const zend_module_entry tidy_module_entry = { This makes PHP to crash right after the start. Please revert. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c php_spl.h /ext/tidy php_tidy.h tidy.c
On 25.01.2008 23:29, Nuno Lopes wrote: -zend_module_entry spl_module_entry = { +const zend_module_entry spl_module_entry = { -zend_module_entry tidy_module_entry = { +const zend_module_entry tidy_module_entry = { This makes PHP to crash right after the start. Please revert. Ah damn.. Sorry for the breakage and thanks for letting me know about this. (I though I had tested everything...) Tomorrow I'll fix it (today I'm just too tired). Thanks, Nuno -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c php_spl.h /ext/tidy php_tidy.h tidy.c
On 25.01.2008 23:29, Nuno Lopes wrote: -zend_module_entry spl_module_entry = { +const zend_module_entry spl_module_entry = { -zend_module_entry tidy_module_entry = { +const zend_module_entry tidy_module_entry = { This makes PHP to crash right after the start. Please revert. -- Wbr, Antony Dovgal -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c php_spl.h /ext/tidy php_tidy.h tidy.c
nlopess Fri Jan 25 20:29:48 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/splphp_spl.c php_spl.h /php-src/ext/tidy php_tidy.h tidy.c Log: more const kewywording remove spl_functions_none var (wast used anywhere http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.17.2.7r2=1.52.2.28.2.17.2.8diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.7 php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.8 --- php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.7Tue Jan 15 09:38:15 2008 +++ php-src/ext/spl/php_spl.c Fri Jan 25 20:29:48 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.52.2.28.2.17.2.7 2008/01/15 09:38:15 colder Exp $ */ +/* $Id: php_spl.c,v 1.52.2.28.2.17.2.8 2008/01/25 20:29:48 nlopess Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -48,13 +48,6 @@ #define SPL_DEFAULT_FILE_EXTENSIONS .inc,.php -/* {{{ spl_functions_none - */ -const zend_function_entry spl_functions_none[] = { - {NULL, NULL, NULL} -}; -/* }}} */ - /* {{{ PHP_GINIT_FUNCTION */ static PHP_GINIT_FUNCTION(spl) @@ -771,7 +764,7 @@ /* {{{ spl_module_entry */ -zend_module_entry spl_module_entry = { +const zend_module_entry spl_module_entry = { #ifdef HAVE_SIMPLEXML STANDARD_MODULE_HEADER_EX, NULL, spl_deps, http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.h?r1=1.17.2.1.2.3.2.2r2=1.17.2.1.2.3.2.3diff_format=u Index: php-src/ext/spl/php_spl.h diff -u php-src/ext/spl/php_spl.h:1.17.2.1.2.3.2.2 php-src/ext/spl/php_spl.h:1.17.2.1.2.3.2.3 --- php-src/ext/spl/php_spl.h:1.17.2.1.2.3.2.2 Mon Dec 31 07:17:14 2007 +++ php-src/ext/spl/php_spl.h Fri Jan 25 20:29:48 2008 @@ -28,7 +28,7 @@ #define SPL_DEBUG(x) #endif -extern zend_module_entry spl_module_entry; +extern const zend_module_entry spl_module_entry; #define phpext_spl_ptr spl_module_entry #ifdef PHP_WIN32 http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/php_tidy.h?r1=1.26.2.1.2.5.2.1r2=1.26.2.1.2.5.2.2diff_format=u Index: php-src/ext/tidy/php_tidy.h diff -u php-src/ext/tidy/php_tidy.h:1.26.2.1.2.5.2.1 php-src/ext/tidy/php_tidy.h:1.26.2.1.2.5.2.2 --- php-src/ext/tidy/php_tidy.h:1.26.2.1.2.5.2.1Mon Dec 31 07:17:16 2007 +++ php-src/ext/tidy/php_tidy.h Fri Jan 25 20:29:48 2008 @@ -16,12 +16,12 @@ +--+ */ -/* $Id: php_tidy.h,v 1.26.2.1.2.5.2.1 2007/12/31 07:17:16 sebastian Exp $ */ +/* $Id: php_tidy.h,v 1.26.2.1.2.5.2.2 2008/01/25 20:29:48 nlopess Exp $ */ #ifndef PHP_TIDY_H #define PHP_TIDY_H -extern zend_module_entry tidy_module_entry; +extern const zend_module_entry tidy_module_entry; #define phpext_tidy_ptr tidy_module_entry #define TIDY_METHOD_MAP(name, func_name, arg_types) \ http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.66.2.8.2.24.2.3r2=1.66.2.8.2.24.2.4diff_format=u Index: php-src/ext/tidy/tidy.c diff -u php-src/ext/tidy/tidy.c:1.66.2.8.2.24.2.3 php-src/ext/tidy/tidy.c:1.66.2.8.2.24.2.4 --- php-src/ext/tidy/tidy.c:1.66.2.8.2.24.2.3 Mon Dec 31 07:17:16 2007 +++ php-src/ext/tidy/tidy.c Fri Jan 25 20:29:48 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tidy.c,v 1.66.2.8.2.24.2.3 2007/12/31 07:17:16 sebastian Exp $ */ +/* $Id: tidy.c,v 1.66.2.8.2.24.2.4 2008/01/25 20:29:48 nlopess Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -351,7 +351,7 @@ static zend_object_handlers tidy_object_handlers_doc; static zend_object_handlers tidy_object_handlers_node; -zend_module_entry tidy_module_entry = { +const zend_module_entry tidy_module_entry = { STANDARD_MODULE_HEADER, tidy, tidy_functions, @@ -998,7 +998,7 @@ php_info_print_table_start(); php_info_print_table_header(2, Tidy support, enabled); php_info_print_table_row(2, libTidy Release, (char *)tidyReleaseDate()); - php_info_print_table_row(2, Extension Version, PHP_TIDY_MODULE_VERSION ($Id: tidy.c,v 1.66.2.8.2.24.2.3 2007/12/31 07:17:16 sebastian Exp $)); + php_info_print_table_row(2, Extension Version, PHP_TIDY_MODULE_VERSION ($Id: tidy.c,v 1.66.2.8.2.24.2.4 2008/01/25 20:29:48 nlopess Exp $)); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php