RE: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_2) / zend_builtin_functions.c /tests 017.phpt

From: Date: Fri, 03 Aug 2007 07:45:28 +0000
Subject: RE: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_2) / zend_builtin_functions.c /tests 017.phpt
References: 1  Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-5949@lists.php.net to get a copy of this message
I think this patch breaks previous behavior, so it shouldn't be committed into 5.2.* Thanks. Dmitry. > -----Original Message----- > From: Johannes Schlьter [mailto:johannes@php.net] > Sent: Thursday, August 02, 2007 8:55 PM > To: zend-engine-cvs@lists.php.net > Subject: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_2) / > zend_builtin_functions.c /tests 017.phpt > > > johannes Thu Aug 2 16:54:44 2007 UTC > > Modified files: (Branch: PHP_5_2) > /ZendEngine2 zend_builtin_functions.c > /ZendEngine2/tests 017.phpt > Log: > - MFH: Respect value of the parameter for > get_loaded_extensions() and only > print zend extensions if set to true > > > http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_builtin_functio > ns.c?r1=1.277.2.12.2.20&r2=1.277.2.12.2.21&diff_format=u > Index: ZendEngine2/zend_builtin_functions.c > diff -u ZendEngine2/zend_builtin_functions.c:1.277.2.12.2.20 > ZendEngine2/zend_builtin_functions.c:1.277.2.12.2.21 > --- ZendEngine2/zend_builtin_functions.c:1.277.2.12.2.20 > Tue Jul 31 22:47:25 2007 > +++ ZendEngine2/zend_builtin_functions.c Thu Aug 2 16:54:44 2007 > @@ -17,7 +17,7 @@ > > +------------------------------------------------------------- > ---------+ > */ > > -/* $Id: zend_builtin_functions.c,v 1.277.2.12.2.20 > 2007/07/31 22:47:25 johannes Exp $ */ > +/* $Id: zend_builtin_functions.c,v 1.277.2.12.2.21 > 2007/08/02 16:54:44 > +johannes Exp $ */ > > #include "zend.h" > #include "zend_API.h" > @@ -1570,31 +1570,20 @@ > } > > > -/* {{{ proto array get_loaded_extensions([mixed categorize]) U > +/* {{{ proto array get_loaded_extensions([bool zend_extensions]) U > Return an array containing names of loaded extensions */ > ZEND_FUNCTION(get_loaded_extensions) > { > - int argc = ZEND_NUM_ARGS(); > + int zendext = 0; > > - if (argc != 0 && argc != 1) { > - ZEND_WRONG_PARAM_COUNT(); > + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, > "|b", &zendext) == FAILURE) { > + return; > } > > array_init(return_value); > > - if (argc) { > - zval *modules; > - zval *extensions; > - > - MAKE_STD_ZVAL(modules); > - array_init(modules); > - zend_hash_apply_with_argument(&module_registry, > (apply_func_arg_t) add_extension_info, modules TSRMLS_CC); > - add_assoc_zval_ex(return_value, "PHP Modules", > sizeof("PHP Modules"), modules); > - > - MAKE_STD_ZVAL(extensions); > - array_init(extensions); > - > zend_llist_apply_with_argument(&zend_extensions, > (llist_apply_with_arg_func_t) add_zendext_info, extensions TSRMLS_CC); > - add_assoc_zval_ex(return_value, "Zend > Extensions", sizeof("Zend Extensions"), extensions); > + if (zendext) { > + zend_llist_apply_with_argument(&zend_extensions, > +(llist_apply_with_arg_func_t) add_zendext_info, return_value > TSRMLS_CC); > } else { > zend_hash_apply_with_argument(&module_registry, > (apply_func_arg_t) add_extension_info, return_value TSRMLS_CC); > } > http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/017.phpt?r1=1. 1.2.3&r2=1.1.2.4&diff_format=u Index: ZendEngine2/tests/017.phpt diff -u ZendEngine2/tests/017.phpt:1.1.2.3 ZendEngine2/tests/017.phpt:1.1.2.4 --- ZendEngine2/tests/017.phpt:1.1.2.3 Tue Jul 31 22:47:25 2007 +++ ZendEngine2/tests/017.phpt Thu Aug 2 16:54:44 2007 @@ -12,7 +12,9 @@ var_dump(gettype(get_loaded_extensions())); var_dump(count(get_loaded_extensions())); +var_dump(gettype(get_loaded_extensions(true))); var_dump(count(get_loaded_extensions(true))); +var_dump(get_loaded_extensions(true, true)); define("USER_CONSTANT", "test"); @@ -52,7 +54,11 @@ string(7) "Unknown" string(5) "array" int(%d) -int(2) +string(5) "array" +int(0) + +Warning: get_loaded_extensions() expects at most 1 parameter, 2 given +in /home/johannes/src/php/PHP_5_2/Zend/tests/017.php on line 14 NULL Warning: Wrong parameter count for get_defined_constants() in %s on line %d NULL -- Zend Engine CVS Mailing List (http://cvs.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.zend-engine.cvs (#5949) next »