logo       

RE: cvs: ZendEngine2(PHP_5_2) / zend_builtin_functions.c /tests 017.phpt: msg#00012

Subject: RE: cvs: ZendEngine2(PHP_5_2) / zend_builtin_functions.c /tests 017.phpt
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@xxxxxxx] 
> Sent: Thursday, August 02, 2007 8:55 PM
> To: zend-engine-cvs@xxxxxxxxxxxxx
> 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

--
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe