[PHP-CVS-DAILY] cvs: php-src / ChangeLog

2009-01-03 Thread changelog
changelog   Sun Jan  4 01:32:24 2009 UTC

  Modified files:  
/php-srcChangeLog 
  Log:
  ChangeLog update
  
http://cvs.php.net/viewvc.cgi/php-src/ChangeLog?r1=1.3277r2=1.3278diff_format=u
Index: php-src/ChangeLog
diff -u php-src/ChangeLog:1.3277 php-src/ChangeLog:1.3278
--- php-src/ChangeLog:1.3277Sat Jan  3 01:38:37 2009
+++ php-src/ChangeLog   Sun Jan  4 01:32:22 2009
@@ -1,3 +1,127 @@
+2009-01-03  Felipe Pena  felipe...@gmail.com
+
+* (PHP_5_3)
+  ext/sqlite3/sqlite3.c:
+  MFH:
+  - Removed unnecessary repeated arginfos
+  - Changed sqlite3stmt and sqlite3result to ZEND_ACC_PRIVATE to avoid
+  reflection instantiation
+
+* ext/sqlite3/sqlite3.c:
+  - Removed unnecessary repeated arginfos
+  - Changed sqlite3stmt and sqlite3result to ZEND_ACC_PRIVATE to avoid
+  reflection instantiation
+
+2009-01-03  Marcus Boerger  p...@marcus-boerger.de
+
+* ext/reflection/php_reflection.c:
+  - MFB Missing namespace changes
+
+* ext/reflection/php_reflection.c
+  ext/reflection/tests/027.phpt
+  ext/reflection/tests/027.phpt
+  ext/reflection/tests/ReflectionMethod_getClosure_error.phpt:
+  - Minor corrections and a new test
+
+* ext/reflection/tests/ReflectionFunction_getNamespaceName.phpt
+  ext/reflection/tests/reflectionClass_getNamespaceName.phpt:
+  - MFB sync
+
+* (PHP_5_3)
+  ext/reflection/php_reflection.c:
+  - MFH Show closure's bound  as static parameter
+
+* ext/reflection/php_reflection.c:
+  - Show closure's bound  as static parameter
+
+* (PHP_5_3)
+  ZendEngine2/zend_closures.c:
+  - MFH Prevent instantiation from Reflection
+
+* ZendEngine2/zend_closures.c:
+  - Prevent instantiation from Reflection
+
+* (PHP_5_3)
+  ext/reflection/php_reflection.c:
+  MFH
+  - Add ReflectionFunctionAbstract::getClosureThis()
+  [DOC]
+
+* ext/reflection/php_reflection.c:
+  - Return this pointer and not closure itself
+
+* ext/reflection/php_reflection.c:
+  - Add ReflectionFunctionAbstract::getClosureThis()
+
+* ZendEngine2/tests/closure_035.phpt:
+  - Overlooked one instance number
+
+* ZendEngine2/zend_closures.c
+  ZendEngine2/tests/closure_035.phpt
+  ZendEngine2/tests/closure_035.phpt:
+  - Fix refcounting
+
+* (PHP_5_3)
+  ZendEngine2/zend_closures.c
+  ZendEngine2/zend_closures.h
+  ZendEngine2/zend_object_handlers.c
+  ZendEngine2/tests/closure_033.phpt
+  ZendEngine2/tests/closure_034.phpt:
+  - MFH Rebind closure when binding to property
+
+* ZendEngine2/tests/closure_033.phpt
+  ZendEngine2/tests/closure_033.phpt
+  ZendEngine2/tests/closure_034.phpt
+  ZendEngine2/tests/closure_034.phpt:
+  
+  - Rebind closure when binding to property
+
+* ZendEngine2/zend_closures.c
+  ZendEngine2/zend_closures.h
+  ZendEngine2/zend_object_handlers.c:
+  - Rebind closure when binding to property
+
+2009-01-03  Felipe Pena  felipe...@gmail.com
+
+* (PHP_5_2)
+  NEWS:
+  - BFN
+
+2009-01-03  Marcus Boerger  p...@marcus-boerger.de
+
+* ext/reflection/php_reflection.c:
+  - Improved closure support
+
+* ext/reflection/php_reflection.c:
+  - Small reordering
+
+* ZendEngine2/zend_closures.c:
+  - Fix vim blocks and add missing comment
+
+* ext/reflection/php_reflection.c:
+  - Add minimalistic closure support
+
+* ZendEngine2/zend_closures.c
+  ZendEngine2/zend_closures.h:
+  - Add reflection helpers
+
+* .gdbinit:
+  - There is no -v in keys
+
+2009-01-03  Kalle Sommer Nielsen  kalle@gmail.com
+
+* (PHP_5_2)
+  buildconf.bat
+  win32/build/buildconf.js:
+  MFH:
+  * Redirect the 1 file(s) copied message to nul
+  * Check if configure script was copied, and output an error if it wasn't
+
+2009-01-03  Felipe Pena  felipe...@gmail.com
+
+* main/network.c:
+  - Windows part
+
 2009-01-02  Felipe Pena  felipe...@gmail.com
 
 * main/network.c:
@@ -22329,7 +22453,7 @@
 
 * sapi/litespeed/lsapi_main.c
   sapi/litespeed/lsapilib.c:
-  - Added missing $Id: ChangeLog,v 1.3277 2009/01/03 01:38:37 changelog 
Exp $ tags and nuked c++ comments
+  - Added missing $Id: ChangeLog,v 1.3278 2009/01/04 01:32:22 changelog 
Exp $ tags and nuked c++ comments
 
 * (PHP_5_3)
   ext/intl/locale/locale.c




[PHP-CVS-DAILY] cvs: ZendEngine2 / ChangeLog

2009-01-03 Thread changelog
changelog   Sun Jan  4 01:32:28 2009 UTC

  Modified files:  
/ZendEngine2ChangeLog 
  Log:
  ChangeLog update
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/ChangeLog?r1=1.1420r2=1.1421diff_format=u
Index: ZendEngine2/ChangeLog
diff -u ZendEngine2/ChangeLog:1.1420 ZendEngine2/ChangeLog:1.1421
--- ZendEngine2/ChangeLog:1.1420Sat Jan  3 01:39:20 2009
+++ ZendEngine2/ChangeLog   Sun Jan  4 01:32:28 2009
@@ -1,3 +1,47 @@
+2009-01-03  Marcus Boerger  p...@marcus-boerger.de
+
+* (PHP_5_3)
+  zend_closures.c:
+  - MFH Prevent instantiation from Reflection
+
+* zend_closures.c:
+  - Prevent instantiation from Reflection
+
+* tests/closure_035.phpt:
+  - Overlooked one instance number
+
+* zend_closures.c
+  tests/closure_035.phpt
+  tests/closure_035.phpt:
+  - Fix refcounting
+
+* (PHP_5_3)
+  zend_closures.c
+  zend_closures.h
+  zend_object_handlers.c
+  tests/closure_033.phpt
+  tests/closure_034.phpt:
+  - MFH Rebind closure when binding to property
+
+* tests/closure_033.phpt
+  tests/closure_033.phpt
+  tests/closure_034.phpt
+  tests/closure_034.phpt:
+  
+  - Rebind closure when binding to property
+
+* zend_closures.c
+  zend_closures.h
+  zend_object_handlers.c:
+  - Rebind closure when binding to property
+
+* zend_closures.c:
+  - Fix vim blocks and add missing comment
+
+* zend_closures.c
+  zend_closures.h:
+  - Add reflection helpers
+
 2009-01-02  Felipe Pena  felipe...@gmail.com
 
 * header
@@ -27300,7 +27344,7 @@
 2003-06-10  Jani Taskinen  sni...@iki.fi
 
 * zend_multiply.h:
-  - Missing $Id: ChangeLog,v 1.1420 2009/01/03 01:39:20 changelog Exp $ tag
+  - Missing $Id: ChangeLog,v 1.1421 2009/01/04 01:32:28 changelog Exp $ tag
 
 2003-06-10  James Cox  ja...@imajes.info
 
@@ -29024,7 +29068,7 @@
   zend_types.h
   zend_variables.c
   zend_variables.h:
-  - Added some missing CVS $Id: ChangeLog,v 1.1420 2009/01/03 01:39:20 
changelog Exp $ tags, headers and footers.
+  - Added some missing CVS $Id: ChangeLog,v 1.1421 2009/01/04 01:32:28 
changelog Exp $ tags, headers and footers.
 
 2003-01-30  Ilia Alshanetsky  i...@prohost.org
 




[PHP-CVS] cvs: php-src / .gdbinit

2009-01-03 Thread Marcus Boerger
helly   Sat Jan  3 12:18:54 2009 UTC

  Modified files:  
/php-src.gdbinit 
  Log:
  - There is no -v in keys
  
http://cvs.php.net/viewvc.cgi/php-src/.gdbinit?r1=1.23r2=1.24diff_format=u
Index: php-src/.gdbinit
diff -u php-src/.gdbinit:1.23 php-src/.gdbinit:1.24
--- php-src/.gdbinit:1.23   Sun Aug 10 22:18:58 2008
+++ php-src/.gdbinitSat Jan  3 12:18:53 2009
@@ -316,7 +316,7 @@
end
else
printf \
-   printt $unicode $p-key.arKey.v $p-nKeyLength
+   printt $unicode $p-key.arKey.u $p-nKeyLength
printf \ = 
end
else



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



[PHP-CVS] cvs: php-src /ext/reflection php_reflection.c

2009-01-03 Thread Marcus Boerger
helly   Sat Jan  3 12:20:27 2009 UTC

  Modified files:  
/php-src/ext/reflection php_reflection.c 
  Log:
  - Add minimalistic closure support
  http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.330r2=1.331diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.330 
php-src/ext/reflection/php_reflection.c:1.331
--- php-src/ext/reflection/php_reflection.c:1.330   Wed Dec 31 14:37:17 2008
+++ php-src/ext/reflection/php_reflection.c Sat Jan  3 12:20:27 2009
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_reflection.c,v 1.330 2008/12/31 14:37:17 helly Exp $ */
+/* $Id: php_reflection.c,v 1.331 2009/01/03 12:20:27 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -323,7 +323,7 @@
 /* }}} */
 
 static void _const_string(string *str, zstr name, zval *value, char *indent 
TSRMLS_DC);
-static void _function_string(string *str, zend_function *fptr, 
zend_class_entry *scope, char *indent TSRMLS_DC);
+static void _function_string(string *str, zend_function *fptr, 
zend_class_entry *scope, zval* closure, char *indent TSRMLS_DC);
 static void _property_string(string *str, zend_property_info *prop, zstr 
prop_name, char* indent TSRMLS_DC);
 static void _class_string(string *str, zend_class_entry *ce, zval *obj, char 
*indent TSRMLS_DC);
 static void _extension_string(string *str, zend_module_entry *module, char 
*indent TSRMLS_DC);
@@ -489,7 +489,7 @@
 ((mptr-common.fn_flags  
ZEND_ACC_PRIVATE) == 0 || mptr-common.scope == ce))
{
string_printf(str, \n);
-   _function_string(str, mptr, ce, 
sub_indent.string TSRMLS_CC);
+   _function_string(str, mptr, ce, NULL, 
sub_indent.string TSRMLS_CC);
}
zend_hash_move_forward_ex(ce-function_table, 
pos);
}
@@ -595,7 +595,7 @@
}
 
string_printf(dyn, \n);
-   _function_string(dyn, mptr, 
ce, sub_indent.string TSRMLS_CC);
+   _function_string(dyn, mptr, 
ce, NULL, sub_indent.string TSRMLS_CC);
count++;
_free_function(closure 
TSRMLS_CC);
}
@@ -767,7 +767,7 @@
 /* }}} */
 
 /* {{{ _function_string */
-static void _function_string(string *str, zend_function *fptr, 
zend_class_entry *scope, char* indent TSRMLS_DC)
+static void _function_string(string *str, zend_function *fptr, 
zend_class_entry *scope, zval* closure, char* indent TSRMLS_DC)
 {
string param_indent;
zend_function *overwrites;
@@ -782,7 +782,8 @@
string_printf(str, %s%v\n, indent, 
fptr-op_array.doc_comment.v);
}
 
-   string_printf(str, fptr-common.scope ? %sMethod [  : %sFunction [ 
, indent);
+   string_write(str, indent, strlen(indent));
+   string_printf(str, closure ? Closure [  : (fptr-common.scope ? 
Method [  : Function [ ));
string_printf(str, (fptr-type == ZEND_USER_FUNCTION) ? user : 
internal);
if (fptr-common.fn_flags  ZEND_ACC_DEPRECATED) {
string_printf(str, , deprecated);
@@ -858,6 +859,28 @@
}
string_init(param_indent);
string_printf(param_indent, %s  , indent);
+   if (closure) {
+   const zend_function *closure_fptr = 
zend_get_closure_method_def(closure TSRMLS_CC);
+   if (closure_fptr-type == ZEND_USER_FUNCTION  
closure_fptr-op_array.static_variables) {
+   HashTable *static_variables = 
closure_fptr-op_array.static_variables;
+   HashPosition pos;
+   uint key_len;
+   zstr key;
+   ulong num_index, index = 0;
+   int count = zend_hash_num_elements(static_variables);
+   if (count) {
+   string_printf(str, \n);
+   string_printf(str, %s  - Static Parameters 
[%d] {\n, indent, count);
+   
zend_hash_internal_pointer_reset_ex(static_variables, pos);
+   while (index++  count) {
+   
zend_hash_get_current_key_ex(static_variables, key, key_len, num_index, 0, 
pos);
+   string_printf(str, %sParameter #%d 
[ $%v ]\n, indent, index++, key);
+   
zend_hash_move_forward_ex(static_variables, pos);
+   }   
+  

[PHP-CVS] cvs: php-src /ext/reflection php_reflection.c

2009-01-03 Thread Marcus Boerger
helly   Sat Jan  3 12:27:44 2009 UTC

  Modified files:  
/php-src/ext/reflection php_reflection.c 
  Log:
  - Small reordering
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.331r2=1.332diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.331 
php-src/ext/reflection/php_reflection.c:1.332
--- php-src/ext/reflection/php_reflection.c:1.331   Sat Jan  3 12:20:27 2009
+++ php-src/ext/reflection/php_reflection.c Sat Jan  3 12:27:43 2009
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_reflection.c,v 1.331 2009/01/03 12:20:27 helly Exp $ */
+/* $Id: php_reflection.c,v 1.332 2009/01/03 12:27:43 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -857,8 +857,6 @@
fptr-op_array.line_start,
fptr-op_array.line_end);
}
-   string_init(param_indent);
-   string_printf(param_indent, %s  , indent);
if (closure) {
const zend_function *closure_fptr = 
zend_get_closure_method_def(closure TSRMLS_CC);
if (closure_fptr-type == ZEND_USER_FUNCTION  
closure_fptr-op_array.static_variables) {
@@ -881,6 +879,8 @@
}
}
}
+   string_init(param_indent);
+   string_printf(param_indent, %s  , indent);
_function_parameter_string(str, fptr, param_indent.string TSRMLS_CC);
string_free(param_indent);
string_printf(str, %s}\n, indent);
@@ -5482,7 +5482,7 @@
php_info_print_table_start();
php_info_print_table_header(2, Reflection, enabled);
 
-   php_info_print_table_row(2, Version, $Revision: 1.331 $);
+   php_info_print_table_row(2, Version, $Revision: 1.332 $);
 
php_info_print_table_end();
 } /* }}} */
@@ -5496,7 +5496,7 @@
NULL,
NULL,
PHP_MINFO(reflection),
-   $Revision: 1.331 $,
+   $Revision: 1.332 $,
STANDARD_MODULE_PROPERTIES
 }; /* }}} */
 



-- 
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) / NEWS /ext/standard basic_functions.c /main SAPI.h main.c /sapi/cgi cgi_main.c /sapi/cli php_cli.c /sapi/embed php_embed.c

2009-01-03 Thread Antony Dovgal
On 02.01.2009 07:47, Andi Gutmans wrote:
 Hi Marcus,
 
 I think dl() should also be disabled for FastCGI.

Why?
I'm not aware of any dl()-related problems in FastCGI.

-- 
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/reflection php_reflection.c

2009-01-03 Thread Marcus Boerger
helly   Sat Jan  3 12:39:28 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/reflection php_reflection.c 
  Log:
  - MFH Add minimalistic closure support
  http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.45.2.45r2=1.164.2.33.2.45.2.46diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.45 
php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.46
--- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.45Wed Dec 
31 14:36:27 2008
+++ php-src/ext/reflection/php_reflection.c Sat Jan  3 12:39:27 2009
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.45 2008/12/31 14:36:27 helly Exp 
$ */
+/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.46 2009/01/03 12:39:27 helly Exp 
$ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -319,7 +319,7 @@
 }
 
 static void _const_string(string *str, char *name, zval *value, char *indent 
TSRMLS_DC);
-static void _function_string(string *str, zend_function *fptr, 
zend_class_entry *scope, char *indent TSRMLS_DC);
+static void _function_string(string *str, zend_function *fptr, 
zend_class_entry *scope, zval* closure, char *indent TSRMLS_DC);
 static void _property_string(string *str, zend_property_info *prop, char 
*prop_name, char* indent TSRMLS_DC);
 static void _class_string(string *str, zend_class_entry *ce, zval *obj, char 
*indent TSRMLS_DC);
 static void _extension_string(string *str, zend_module_entry *module, char 
*indent TSRMLS_DC);
@@ -485,7 +485,7 @@
 ((mptr-common.fn_flags  
ZEND_ACC_PRIVATE) == 0 || mptr-common.scope == ce))
{
string_printf(str, \n);
-   _function_string(str, mptr, ce, 
sub_indent.string TSRMLS_CC);
+   _function_string(str, mptr, ce, NULL, 
sub_indent.string TSRMLS_CC);
}
zend_hash_move_forward_ex(ce-function_table, 
pos);
}
@@ -587,7 +587,7 @@
closure = NULL;
}
string_printf(dyn, \n);
-   _function_string(dyn, mptr, 
ce, sub_indent.string TSRMLS_CC);
+   _function_string(dyn, mptr, 
ce, NULL, sub_indent.string TSRMLS_CC);
count++;
_free_function(closure 
TSRMLS_CC);
}
@@ -744,7 +744,7 @@
 /* }}} */
 
 /* {{{ _function_string */
-static void _function_string(string *str, zend_function *fptr, 
zend_class_entry *scope, char* indent TSRMLS_DC)
+static void _function_string(string *str, zend_function *fptr, 
zend_class_entry *scope, zval* closure, char* indent TSRMLS_DC)
 {
string param_indent;
zend_function *overwrites;
@@ -759,7 +759,8 @@
string_printf(str, %s%s\n, indent, 
fptr-op_array.doc_comment);
}
 
-   string_printf(str, fptr-common.scope ? %sMethod [  : %sFunction [ 
, indent);
+   string_write(str, indent, strlen(indent));
+   string_printf(str, closure ? Closure [  : (fptr-common.scope ? 
Method [  : Function [ ));
string_printf(str, (fptr-type == ZEND_USER_FUNCTION) ? user : 
internal);
if (fptr-common.fn_flags  ZEND_ACC_DEPRECATED) {
string_printf(str, , deprecated);
@@ -835,6 +836,28 @@
fptr-op_array.line_start,
fptr-op_array.line_end);
}
+   if (closure) {
+   const zend_function *closure_fptr = 
zend_get_closure_method_def(closure TSRMLS_CC);
+   if (closure_fptr-type == ZEND_USER_FUNCTION  
closure_fptr-op_array.static_variables) {
+   HashTable *static_variables = 
closure_fptr-op_array.static_variables;
+   HashPosition pos;
+   uint key_len;
+   char* key;
+   ulong num_index, index = 0;
+   int count = zend_hash_num_elements(static_variables);
+   if (count) {
+   string_printf(str, \n);
+   string_printf(str, %s  - Static Parameters 
[%d] {\n, indent, count);
+   
zend_hash_internal_pointer_reset_ex(static_variables, pos);
+   while (index++  count) {
+   
zend_hash_get_current_key_ex(static_variables, key, key_len, num_index, 0, 
pos);
+  

[PHP-CVS] cvs: php-src /ext/reflection php_reflection.c

2009-01-03 Thread Marcus Boerger
helly   Sat Jan  3 14:20:07 2009 UTC

  Modified files:  
/php-src/ext/reflection php_reflection.c 
  Log:
  - Improved closure support
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.332r2=1.333diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.332 
php-src/ext/reflection/php_reflection.c:1.333
--- php-src/ext/reflection/php_reflection.c:1.332   Sat Jan  3 12:27:43 2009
+++ php-src/ext/reflection/php_reflection.c Sat Jan  3 14:20:07 2009
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_reflection.c,v 1.332 2009/01/03 12:27:43 helly Exp $ */
+/* $Id: php_reflection.c,v 1.333 2009/01/03 14:20:07 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -219,6 +219,18 @@
 }
 /* }}} */
 
+static void _default_lookup_entry(zval *object, char *name, int name_len, zval 
**return_value TSRMLS_DC) /* {{{ */
+{
+   zval **value;
+
+   if (zend_ascii_hash_find(Z_OBJPROP_P(object), name, name_len, (void **) 
value) == FAILURE) {
+   *return_value = NULL;
+   } else {
+   *return_value = *value;
+   }
+}
+/* }}} */
+
 static void reflection_register_implement(zend_class_entry *class_entry, 
zend_class_entry *interface_entry TSRMLS_DC) /* {{{ */
 {
zend_uint num_interfaces = ++class_entry-num_interfaces;
@@ -323,7 +335,7 @@
 /* }}} */
 
 static void _const_string(string *str, zstr name, zval *value, char *indent 
TSRMLS_DC);
-static void _function_string(string *str, zend_function *fptr, 
zend_class_entry *scope, zval* closure, char *indent TSRMLS_DC);
+static void _function_string(string *str, zend_function *fptr, 
zend_class_entry *scope, zval* prop_name, zval* closure, char *indent 
TSRMLS_DC);
 static void _property_string(string *str, zend_property_info *prop, zstr 
prop_name, char* indent TSRMLS_DC);
 static void _class_string(string *str, zend_class_entry *ce, zval *obj, char 
*indent TSRMLS_DC);
 static void _extension_string(string *str, zend_module_entry *module, char 
*indent TSRMLS_DC);
@@ -489,7 +501,7 @@
 ((mptr-common.fn_flags  
ZEND_ACC_PRIVATE) == 0 || mptr-common.scope == ce))
{
string_printf(str, \n);
-   _function_string(str, mptr, ce, NULL, 
sub_indent.string TSRMLS_CC);
+   _function_string(str, mptr, ce, NULL, 
NULL, sub_indent.string TSRMLS_CC);
}
zend_hash_move_forward_ex(ce-function_table, 
pos);
}
@@ -595,7 +607,7 @@
}
 
string_printf(dyn, \n);
-   _function_string(dyn, mptr, 
ce, NULL, sub_indent.string TSRMLS_CC);
+   _function_string(dyn, mptr, 
ce, NULL, NULL, sub_indent.string TSRMLS_CC);
count++;
_free_function(closure 
TSRMLS_CC);
}
@@ -767,7 +779,7 @@
 /* }}} */
 
 /* {{{ _function_string */
-static void _function_string(string *str, zend_function *fptr, 
zend_class_entry *scope, zval* closure, char* indent TSRMLS_DC)
+static void _function_string(string *str, zend_function *fptr, 
zend_class_entry *scope, zval* prop_name, zval* closure, char* indent TSRMLS_DC)
 {
string param_indent;
zend_function *overwrites;
@@ -849,7 +861,11 @@
if (fptr-op_array.return_reference) {
string_printf(str, );
}
-   string_printf(str, %v ] {\n, fptr-common.function_name);
+   if (closure  prop_name) {
+   string_printf(str, %R ] {\n, Z_TYPE_P(prop_name), 
Z_UNIVAL_P(prop_name));
+   } else {
+   string_printf(str, %v ] {\n, fptr-common.function_name);
+   }
/* The information where a function is declared is only available for 
user classes */
if (fptr-type == ZEND_USER_FUNCTION) {
string_printf(str, %s  @@ %s %d - %d\n, indent, 
@@ -1085,7 +1101,7 @@
continue;
}

-   _function_string(str, fptr, NULL, NULL,  
TSRMLS_CC);
+   _function_string(str, fptr, NULL, NULL, NULL,  
TSRMLS_CC);
func++;
}
string_printf(str, %s  }\n, indent);
@@ -1504,7 +1520,7 @@
}
 
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() 
TSRMLS_CC, O, closure, zend_ce_closure) == SUCCESS) {
-   fptr = zend_get_closure_invoke_method(closure TSRMLS_CC);
+   fptr = 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/reflection php_reflection.c

2009-01-03 Thread Marcus Boerger
helly   Sat Jan  3 14:20:22 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/reflection php_reflection.c 
  Log:
  - MFH Improved closure support
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.45.2.46r2=1.164.2.33.2.45.2.47diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.46 
php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.47
--- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.46Sat Jan 
 3 12:39:27 2009
+++ php-src/ext/reflection/php_reflection.c Sat Jan  3 14:20:22 2009
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.46 2009/01/03 12:39:27 helly Exp 
$ */
+/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.47 2009/01/03 14:20:22 helly Exp 
$ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -223,6 +223,18 @@
INIT_PZVAL(return_value);
 }
 
+static void _default_lookup_entry(zval *object, char *name, int name_len, zval 
**return_value TSRMLS_DC) /* {{{ */
+{
+   zval **value;
+
+   if (zend_hash_find(Z_OBJPROP_P(object), name, name_len, (void **) 
value) == FAILURE) {
+   *return_value = NULL;
+   } else {
+   *return_value = *value;
+   }
+}
+/* }}} */
+
 static void reflection_register_implement(zend_class_entry *class_entry, 
zend_class_entry *interface_entry TSRMLS_DC)
 {
zend_uint num_interfaces = ++class_entry-num_interfaces;
@@ -319,7 +331,7 @@
 }
 
 static void _const_string(string *str, char *name, zval *value, char *indent 
TSRMLS_DC);
-static void _function_string(string *str, zend_function *fptr, 
zend_class_entry *scope, zval* closure, char *indent TSRMLS_DC);
+static void _function_string(string *str, zend_function *fptr, 
zend_class_entry *scope, zval* prop_name, zval* closure, char *indent 
TSRMLS_DC);
 static void _property_string(string *str, zend_property_info *prop, char 
*prop_name, char* indent TSRMLS_DC);
 static void _class_string(string *str, zend_class_entry *ce, zval *obj, char 
*indent TSRMLS_DC);
 static void _extension_string(string *str, zend_module_entry *module, char 
*indent TSRMLS_DC);
@@ -485,7 +497,7 @@
 ((mptr-common.fn_flags  
ZEND_ACC_PRIVATE) == 0 || mptr-common.scope == ce))
{
string_printf(str, \n);
-   _function_string(str, mptr, ce, NULL, 
sub_indent.string TSRMLS_CC);
+   _function_string(str, mptr, ce, NULL, 
NULL, sub_indent.string TSRMLS_CC);
}
zend_hash_move_forward_ex(ce-function_table, 
pos);
}
@@ -587,7 +599,7 @@
closure = NULL;
}
string_printf(dyn, \n);
-   _function_string(dyn, mptr, 
ce, NULL, sub_indent.string TSRMLS_CC);
+   _function_string(dyn, mptr, 
ce, NULL, NULL, sub_indent.string TSRMLS_CC);
count++;
_free_function(closure 
TSRMLS_CC);
}
@@ -744,7 +756,7 @@
 /* }}} */
 
 /* {{{ _function_string */
-static void _function_string(string *str, zend_function *fptr, 
zend_class_entry *scope, zval* closure, char* indent TSRMLS_DC)
+static void _function_string(string *str, zend_function *fptr, 
zend_class_entry *scope, zval* prop_name, zval* closure, char* indent TSRMLS_DC)
 {
string param_indent;
zend_function *overwrites;
@@ -828,7 +840,7 @@
if (fptr-op_array.return_reference) {
string_printf(str, );
}
-   string_printf(str, %s ] {\n, fptr-common.function_name);
+   string_printf(str, %s ] {\n, closure  prop_name ? 
Z_STRVAL_P(prop_name) : fptr-common.function_name);
/* The information where a function is declared is only available for 
user classes */
if (fptr-type == ZEND_USER_FUNCTION) {
string_printf(str, %s  @@ %s %d - %d\n, indent, 
@@ -1060,7 +1072,7 @@
continue;
}

-   _function_string(str, fptr, NULL, NULL,  
TSRMLS_CC);
+   _function_string(str, fptr, NULL, NULL, NULL,  
TSRMLS_CC);
func++;
}
string_printf(str, %s  }\n, indent);
@@ -1473,7 +1485,7 @@
}
 
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() 
TSRMLS_CC, O, closure, zend_ce_closure) == SUCCESS) {
-  

[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS

2009-01-03 Thread Felipe Pena
felipe  Sat Jan  3 17:02:56 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
  Log:
  - BFN
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1375r2=1.2027.2.547.2.1376diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1375 php-src/NEWS:1.2027.2.547.2.1376
--- php-src/NEWS:1.2027.2.547.2.1375Fri Jan  2 00:17:44 2009
+++ php-src/NEWSSat Jan  3 17:02:55 2009
@@ -18,6 +18,7 @@
 - Fixed bug #46959 (Unable to disable PCRE). (Scott)
 - Fixed bug #46918 (imap_rfc822_parse_adrlist host part not filled in 
correctly).
   (Felipe)
+- Fixed bug #46917 (Socket handling completely broken). (Jost boekemeier, 
Felipe).
 - Fixed bug #46889 (Memory leak in strtotime()). (Derick)
 - Fixed bug #46887 (Invalid calls to php_error_docref()).
   (oeriksson at mandriva dot com, Ilia)



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



[PHP-CVS] cvs: php-src /ext/reflection php_reflection.c

2009-01-03 Thread Marcus Boerger
helly   Sat Jan  3 19:02:07 2009 UTC

  Modified files:  
/php-src/ext/reflection php_reflection.c 
  Log:
  - Add ReflectionFunctionAbstract::getClosureThis()
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.333r2=1.334diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.333 
php-src/ext/reflection/php_reflection.c:1.334
--- php-src/ext/reflection/php_reflection.c:1.333   Sat Jan  3 14:20:07 2009
+++ php-src/ext/reflection/php_reflection.c Sat Jan  3 19:02:06 2009
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_reflection.c,v 1.333 2009/01/03 14:20:07 helly Exp $ */
+/* $Id: php_reflection.c,v 1.334 2009/01/03 19:02:06 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1585,6 +1585,19 @@
 }
 /* }}} */
 
+/* {{{ proto public bool ReflectionFunction::getClosureThis() U
+   Returns this pointer bound to closure */
+ZEND_METHOD(reflection_function, getClosureThis)
+{
+   reflection_object *intern;
+   zend_function *fptr;
+
+   METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0);
+   GET_REFLECTION_OBJECT_PTR(fptr);
+   RETURN_ZVAL(intern-obj, 1, 0);
+}
+/* }}} */
+
 /* {{{ proto public bool ReflectionFunction::isInternal() U
Returns whether this is an internal function */
 ZEND_METHOD(reflection_function, isInternal)
@@ -5106,25 +5119,26 @@
 static const zend_function_entry reflection_function_abstract_functions[] = {
ZEND_ME(reflection, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
PHP_ABSTRACT_ME(reflection_function, __toString, NULL)
+   ZEND_ME(reflection_function, inNamespace, NULL, 0)
ZEND_ME(reflection_function, isClosure, NULL, 0)
+   ZEND_ME(reflection_function, isDeprecated, NULL, 0)
ZEND_ME(reflection_function, isInternal, NULL, 0)
ZEND_ME(reflection_function, isUserDefined, NULL, 0)
-   ZEND_ME(reflection_function, getName, NULL, 0)
-   ZEND_ME(reflection_function, getFileName, NULL, 0)
-   ZEND_ME(reflection_function, getStartLine, NULL, 0)
-   ZEND_ME(reflection_function, getEndLine, NULL, 0)
+   ZEND_ME(reflection_function, getClosureThis, NULL, 0)
ZEND_ME(reflection_function, getDocComment, NULL, 0)
-   ZEND_ME(reflection_function, getStaticVariables, NULL, 0)
-   ZEND_ME(reflection_function, returnsReference, NULL, 0)
-   ZEND_ME(reflection_function, getParameters, NULL, 0)
-   ZEND_ME(reflection_function, getNumberOfParameters, NULL, 0)
-   ZEND_ME(reflection_function, getNumberOfRequiredParameters, NULL, 0)
+   ZEND_ME(reflection_function, getEndLine, NULL, 0)
ZEND_ME(reflection_function, getExtension, NULL, 0)
ZEND_ME(reflection_function, getExtensionName, NULL, 0)
-   ZEND_ME(reflection_function, isDeprecated, NULL, 0)
-   ZEND_ME(reflection_function, inNamespace, NULL, 0)
+   ZEND_ME(reflection_function, getFileName, NULL, 0)
+   ZEND_ME(reflection_function, getName, NULL, 0)
ZEND_ME(reflection_function, getNamespaceName, NULL, 0)
+   ZEND_ME(reflection_function, getNumberOfParameters, NULL, 0)
+   ZEND_ME(reflection_function, getNumberOfRequiredParameters, NULL, 0)
+   ZEND_ME(reflection_function, getParameters, NULL, 0)
ZEND_ME(reflection_function, getShortName, NULL, 0)
+   ZEND_ME(reflection_function, getStartLine, NULL, 0)
+   ZEND_ME(reflection_function, getStaticVariables, NULL, 0)
+   ZEND_ME(reflection_function, returnsReference, NULL, 0)
{NULL, NULL, NULL}
 };
 
@@ -5532,7 +5546,7 @@
php_info_print_table_start();
php_info_print_table_header(2, Reflection, enabled);
 
-   php_info_print_table_row(2, Version, $Revision: 1.333 $);
+   php_info_print_table_row(2, Version, $Revision: 1.334 $);
 
php_info_print_table_end();
 } /* }}} */
@@ -5546,7 +5560,7 @@
NULL,
NULL,
PHP_MINFO(reflection),
-   $Revision: 1.333 $,
+   $Revision: 1.334 $,
STANDARD_MODULE_PROPERTIES
 }; /* }}} */
 



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



[PHP-CVS] cvs: php-src /ext/reflection php_reflection.c

2009-01-03 Thread Marcus Boerger
helly   Sat Jan  3 19:08:27 2009 UTC

  Modified files:  
/php-src/ext/reflection php_reflection.c 
  Log:
  - Return this pointer and not closure itself
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.334r2=1.335diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.334 
php-src/ext/reflection/php_reflection.c:1.335
--- php-src/ext/reflection/php_reflection.c:1.334   Sat Jan  3 19:02:06 2009
+++ php-src/ext/reflection/php_reflection.c Sat Jan  3 19:08:27 2009
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_reflection.c,v 1.334 2009/01/03 19:02:06 helly Exp $ */
+/* $Id: php_reflection.c,v 1.335 2009/01/03 19:08:27 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1591,10 +1591,14 @@
 {
reflection_object *intern;
zend_function *fptr;
+   zval* closure_this;
 
METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0);
GET_REFLECTION_OBJECT_PTR(fptr);
-   RETURN_ZVAL(intern-obj, 1, 0);
+   if (intern-obj) {
+   closure_this = zend_get_closure_this_ptr(intern-obj TSRMLS_CC);
+   RETURN_ZVAL(closure_this, 1, 0);
+   }
 }
 /* }}} */
 
@@ -5546,7 +5550,7 @@
php_info_print_table_start();
php_info_print_table_header(2, Reflection, enabled);
 
-   php_info_print_table_row(2, Version, $Revision: 1.334 $);
+   php_info_print_table_row(2, Version, $Revision: 1.335 $);
 
php_info_print_table_end();
 } /* }}} */
@@ -5560,7 +5564,7 @@
NULL,
NULL,
PHP_MINFO(reflection),
-   $Revision: 1.334 $,
+   $Revision: 1.335 $,
STANDARD_MODULE_PROPERTIES
 }; /* }}} */
 



-- 
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/reflection php_reflection.c

2009-01-03 Thread Marcus Boerger
helly   Sat Jan  3 19:08:47 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/reflection php_reflection.c 
  Log:
  MFH
  - Add ReflectionFunctionAbstract::getClosureThis()
  [DOC]
  # Returns the this pointer bound to the closure is the relection object
  # points to closure. Since not all closures have a bound this, the method
  # cannot be used to differentiate between normal functions/methods and 
  # closures. Instead ReflectionFunctionAbstract::isClosure() has to be used.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.45.2.47r2=1.164.2.33.2.45.2.48diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.47 
php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.48
--- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.47Sat Jan 
 3 14:20:22 2009
+++ php-src/ext/reflection/php_reflection.c Sat Jan  3 19:08:47 2009
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.47 2009/01/03 14:20:22 helly Exp 
$ */
+/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.48 2009/01/03 19:08:47 helly Exp 
$ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1550,6 +1550,23 @@
 }
 /* }}} */
 
+/* {{{ proto public bool ReflectionFunction::getClosureThis()
+   Returns this pointer bound to closure */
+ZEND_METHOD(reflection_function, getClosureThis)
+{
+   reflection_object *intern;
+   zend_function *fptr;
+   zval* closure_this;
+
+   METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0);
+   GET_REFLECTION_OBJECT_PTR(fptr);
+   if (intern-obj) {
+   closure_this = zend_get_closure_this_ptr(intern-obj TSRMLS_CC);
+   RETURN_ZVAL(closure_this, 1, 0);
+   }
+}
+/* }}} */
+
 /* {{{ proto public bool ReflectionFunction::isInternal()
Returns whether this is an internal function */
 ZEND_METHOD(reflection_function, isInternal)
@@ -4927,25 +4944,26 @@
 static const zend_function_entry reflection_function_abstract_functions[] = {
ZEND_ME(reflection, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
PHP_ABSTRACT_ME(reflection_function, __toString, NULL)
+   ZEND_ME(reflection_function, inNamespace, NULL, 0)
ZEND_ME(reflection_function, isClosure, NULL, 0)
+   ZEND_ME(reflection_function, isDeprecated, NULL, 0)
ZEND_ME(reflection_function, isInternal, NULL, 0)
ZEND_ME(reflection_function, isUserDefined, NULL, 0)
-   ZEND_ME(reflection_function, getName, NULL, 0)
-   ZEND_ME(reflection_function, getFileName, NULL, 0)
-   ZEND_ME(reflection_function, getStartLine, NULL, 0)
-   ZEND_ME(reflection_function, getEndLine, NULL, 0)
+   ZEND_ME(reflection_function, getClosureThis, NULL, 0)
ZEND_ME(reflection_function, getDocComment, NULL, 0)
-   ZEND_ME(reflection_function, getStaticVariables, NULL, 0)
-   ZEND_ME(reflection_function, returnsReference, NULL, 0)
-   ZEND_ME(reflection_function, getParameters, NULL, 0)
-   ZEND_ME(reflection_function, getNumberOfParameters, NULL, 0)
-   ZEND_ME(reflection_function, getNumberOfRequiredParameters, NULL, 0)
+   ZEND_ME(reflection_function, getEndLine, NULL, 0)
ZEND_ME(reflection_function, getExtension, NULL, 0)
ZEND_ME(reflection_function, getExtensionName, NULL, 0)
-   ZEND_ME(reflection_function, isDeprecated, NULL, 0)
-   ZEND_ME(reflection_function, inNamespace, NULL, 0)
+   ZEND_ME(reflection_function, getFileName, NULL, 0)
+   ZEND_ME(reflection_function, getName, NULL, 0)
ZEND_ME(reflection_function, getNamespaceName, NULL, 0)
+   ZEND_ME(reflection_function, getNumberOfParameters, NULL, 0)
+   ZEND_ME(reflection_function, getNumberOfRequiredParameters, NULL, 0)
+   ZEND_ME(reflection_function, getParameters, NULL, 0)
ZEND_ME(reflection_function, getShortName, NULL, 0)
+   ZEND_ME(reflection_function, getStartLine, NULL, 0)
+   ZEND_ME(reflection_function, getStaticVariables, NULL, 0)
+   ZEND_ME(reflection_function, returnsReference, NULL, 0)
{NULL, NULL, NULL}
 };
 
@@ -5352,7 +5370,7 @@
php_info_print_table_start();
php_info_print_table_header(2, Reflection, enabled);
 
-   php_info_print_table_row(2, Version, $Revision: 1.164.2.33.2.45.2.47 
$);
+   php_info_print_table_row(2, Version, $Revision: 1.164.2.33.2.45.2.48 
$);
 
php_info_print_table_end();
 } /* }}} */
@@ -5366,7 +5384,7 @@
NULL,
NULL,
PHP_MINFO(reflection),
-   $Revision: 1.164.2.33.2.45.2.47 $,
+   $Revision: 1.164.2.33.2.45.2.48 $,
STANDARD_MODULE_PROPERTIES
 }; /* }}} */
 



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



[PHP-CVS] cvs: php-src /ext/reflection php_reflection.c

2009-01-03 Thread Marcus Boerger
helly   Sat Jan  3 20:03:45 2009 UTC

  Modified files:  
/php-src/ext/reflection php_reflection.c 
  Log:
  - Show closure's bound  as static parameter
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.335r2=1.336diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.335 
php-src/ext/reflection/php_reflection.c:1.336
--- php-src/ext/reflection/php_reflection.c:1.335   Sat Jan  3 19:08:27 2009
+++ php-src/ext/reflection/php_reflection.c Sat Jan  3 20:03:45 2009
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_reflection.c,v 1.335 2009/01/03 19:08:27 helly Exp $ */
+/* $Id: php_reflection.c,v 1.336 2009/01/03 20:03:45 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -875,24 +875,32 @@
}
if (closure) {
const zend_function *closure_fptr = 
zend_get_closure_method_def(closure TSRMLS_CC);
+   zval *closure_this = zend_get_closure_this_ptr(closure 
TSRMLS_CC);
+   HashTable *static_variables = NULL;
+   int index = 0, count = closure_this ? 1 : 0;
if (closure_fptr-type == ZEND_USER_FUNCTION  
closure_fptr-op_array.static_variables) {
-   HashTable *static_variables = 
closure_fptr-op_array.static_variables;
-   HashPosition pos;
-   uint key_len;
-   zstr key;
-   ulong num_index, index = 0;
-   int count = zend_hash_num_elements(static_variables);
-   if (count) {
-   string_printf(str, \n);
-   string_printf(str, %s  - Static Parameters 
[%d] {\n, indent, count);
+   static_variables = 
closure_fptr-op_array.static_variables;
+   count += zend_hash_num_elements(static_variables);
+   }
+   if (count) {
+   string_printf(str, \n);
+   string_printf(str, %s  - Static Parameters [%d] {\n, 
indent, count);
+   if (closure_this) {
+   string_printf(str, %sParameter #%d [ %v 
$this ]\n, indent, ++index, Z_OBJCE_P(closure_this)-name);
+   }
+   if (static_variables) {
+   HashPosition pos;
+   uint key_len;
+   zstr key;
+   ulong num_index;

zend_hash_internal_pointer_reset_ex(static_variables, pos);
while (index++  count) {

zend_hash_get_current_key_ex(static_variables, key, key_len, num_index, 0, 
pos);
string_printf(str, %sParameter #%d 
[ $%v ]\n, indent, index++, key);

zend_hash_move_forward_ex(static_variables, pos);
-   }   
-   string_printf(str, %s  }\n, indent);
+   }
}
+   string_printf(str, %s  }\n, indent);
}
}
string_init(param_indent);
@@ -5550,7 +5558,7 @@
php_info_print_table_start();
php_info_print_table_header(2, Reflection, enabled);
 
-   php_info_print_table_row(2, Version, $Revision: 1.335 $);
+   php_info_print_table_row(2, Version, $Revision: 1.336 $);
 
php_info_print_table_end();
 } /* }}} */
@@ -5564,7 +5572,7 @@
NULL,
NULL,
PHP_MINFO(reflection),
-   $Revision: 1.335 $,
+   $Revision: 1.336 $,
STANDARD_MODULE_PROPERTIES
 }; /* }}} */
 



-- 
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/reflection php_reflection.c

2009-01-03 Thread Marcus Boerger
helly   Sat Jan  3 20:04:23 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/reflection php_reflection.c 
  Log:
  - MFH Show closure's bound  as static parameter
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.45.2.48r2=1.164.2.33.2.45.2.49diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.48 
php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.49
--- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.48Sat Jan 
 3 19:08:47 2009
+++ php-src/ext/reflection/php_reflection.c Sat Jan  3 20:04:22 2009
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.48 2009/01/03 19:08:47 helly Exp 
$ */
+/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.49 2009/01/03 20:04:22 helly Exp 
$ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -850,24 +850,32 @@
}
if (closure) {
const zend_function *closure_fptr = 
zend_get_closure_method_def(closure TSRMLS_CC);
+   zval *closure_this = zend_get_closure_this_ptr(closure 
TSRMLS_CC);
+   HashTable *static_variables = NULL;
+   int index = 0, count = closure_this ? 1 : 0;
if (closure_fptr-type == ZEND_USER_FUNCTION  
closure_fptr-op_array.static_variables) {
-   HashTable *static_variables = 
closure_fptr-op_array.static_variables;
-   HashPosition pos;
-   uint key_len;
-   char* key;
-   ulong num_index, index = 0;
-   int count = zend_hash_num_elements(static_variables);
-   if (count) {
-   string_printf(str, \n);
-   string_printf(str, %s  - Static Parameters 
[%d] {\n, indent, count);
+   static_variables = 
closure_fptr-op_array.static_variables;
+   count += zend_hash_num_elements(static_variables);
+   }
+   if (count) {
+   string_printf(str, \n);
+   string_printf(str, %s  - Static Parameters [%d] {\n, 
indent, count);
+   if (closure_this) {
+   string_printf(str, %sParameter #%d [ %s 
$this ]\n, indent, ++index, Z_OBJCE_P(closure_this)-name);
+   }
+   if (static_variables) {
+   HashPosition pos;
+   uint key_len;
+   char* key;
+   ulong num_index;

zend_hash_internal_pointer_reset_ex(static_variables, pos);
while (index++  count) {

zend_hash_get_current_key_ex(static_variables, key, key_len, num_index, 0, 
pos);
string_printf(str, %sParameter #%d 
[ $%s ]\n, indent, index++, key);

zend_hash_move_forward_ex(static_variables, pos);
-   }   
-   string_printf(str, %s  }\n, indent);
+   }
}
+   string_printf(str, %s  }\n, indent);
}
}
string_init(param_indent);
@@ -5370,7 +5378,7 @@
php_info_print_table_start();
php_info_print_table_header(2, Reflection, enabled);
 
-   php_info_print_table_row(2, Version, $Revision: 1.164.2.33.2.45.2.48 
$);
+   php_info_print_table_row(2, Version, $Revision: 1.164.2.33.2.45.2.49 
$);
 
php_info_print_table_end();
 } /* }}} */
@@ -5384,7 +5392,7 @@
NULL,
NULL,
PHP_MINFO(reflection),
-   $Revision: 1.164.2.33.2.45.2.48 $,
+   $Revision: 1.164.2.33.2.45.2.49 $,
STANDARD_MODULE_PROPERTIES
 }; /* }}} */
 



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



[PHP-CVS] cvs: php-src /ext/reflection/tests ReflectionFunction_getNamespaceName.phpt reflectionClass_getNamespaceName.phpt

2009-01-03 Thread Marcus Boerger
helly   Sat Jan  3 20:39:26 2009 UTC

  Modified files:  
/php-src/ext/reflection/tests   

ReflectionFunction_getNamespaceName.phpt 
reflectionClass_getNamespaceName.phpt 
  Log:
  - MFB sync
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/ReflectionFunction_getNamespaceName.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/reflection/tests/ReflectionFunction_getNamespaceName.phpt
diff -u 
php-src/ext/reflection/tests/ReflectionFunction_getNamespaceName.phpt:1.2 
php-src/ext/reflection/tests/ReflectionFunction_getNamespaceName.phpt:1.3
--- php-src/ext/reflection/tests/ReflectionFunction_getNamespaceName.phpt:1.2   
Wed Jun 25 12:34:14 2008
+++ php-src/ext/reflection/tests/ReflectionFunction_getNamespaceName.phpt   
Sat Jan  3 20:39:26 2009
@@ -2,16 +2,16 @@
 ReflectionFunction::getNamespaceName()
 --FILE--
 ?php
-namespace A::B;
+namespace A\B;
 function foo() {}
 
-$function = new ReflectionFunction('sort');
+$function = new \ReflectionFunction('sort');
 var_dump($function-inNamespace());
 var_dump($function-getName());
 var_dump($function-getNamespaceName());
 var_dump($function-getShortName());
 
-$function = new ReflectionFunction('A::B::foo');
+$function = new \ReflectionFunction('A\\B\\foo');
 var_dump($function-inNamespace());
 var_dump($function-getName());
 var_dump($function-getNamespaceName());
@@ -23,7 +23,7 @@
 unicode(0) 
 unicode(4) sort
 bool(true)
-unicode(9) A::B::foo
-unicode(4) A::B
+unicode(7) A\B\foo
+unicode(3) A\B
 unicode(3) foo
 
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/reflectionClass_getNamespaceName.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/reflection/tests/reflectionClass_getNamespaceName.phpt
diff -u php-src/ext/reflection/tests/reflectionClass_getNamespaceName.phpt:1.2 
php-src/ext/reflection/tests/reflectionClass_getNamespaceName.phpt:1.3
--- php-src/ext/reflection/tests/reflectionClass_getNamespaceName.phpt:1.2  
Wed Jun 25 12:34:14 2008
+++ php-src/ext/reflection/tests/reflectionClass_getNamespaceName.phpt  Sat Jan 
 3 20:39:26 2009
@@ -2,17 +2,17 @@
 ReflectionClass::getNamespaceName()
 --FILE--
 ?php
-namespace A::B;
+namespace A\B;
 class Foo {
 }
 
-$function = new ReflectionClass('stdClass');
+$function = new \ReflectionClass('stdClass');
 var_dump($function-inNamespace());
 var_dump($function-getName());
 var_dump($function-getNamespaceName());
 var_dump($function-getShortName());
 
-$function = new ReflectionClass('A::B::Foo');
+$function = new \ReflectionClass('A\\B\\Foo');
 var_dump($function-inNamespace());
 var_dump($function-getName());
 var_dump($function-getNamespaceName());
@@ -24,7 +24,7 @@
 unicode(0) 
 unicode(8) stdClass
 bool(true)
-unicode(9) A::B::Foo
-unicode(4) A::B
+unicode(7) A\B\Foo
+unicode(3) A\B
 unicode(3) Foo
 



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



[PHP-CVS] cvs: php-src /ext/reflection php_reflection.c /ext/reflection/tests 027.phpt ReflectionMethod_getClosure_error.phpt

2009-01-03 Thread Marcus Boerger
helly   Sat Jan  3 20:40:22 2009 UTC

  Added files: 
/php-src/ext/reflection/tests   027.phpt 

  Modified files:  
/php-src/ext/reflection php_reflection.c 
/php-src/ext/reflection/tests   
ReflectionMethod_getClosure_error.phpt 
  Log:
  - Minor corrections and a new test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.336r2=1.337diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.336 
php-src/ext/reflection/php_reflection.c:1.337
--- php-src/ext/reflection/php_reflection.c:1.336   Sat Jan  3 20:03:45 2009
+++ php-src/ext/reflection/php_reflection.c Sat Jan  3 20:40:22 2009
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_reflection.c,v 1.336 2009/01/03 20:03:45 helly Exp $ */
+/* $Id: php_reflection.c,v 1.337 2009/01/03 20:40:22 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -886,7 +886,7 @@
string_printf(str, \n);
string_printf(str, %s  - Static Parameters [%d] {\n, 
indent, count);
if (closure_this) {
-   string_printf(str, %sParameter #%d [ %v 
$this ]\n, indent, ++index, Z_OBJCE_P(closure_this)-name);
+   string_printf(str, %sParameter #%d [ %v 
$this ]\n, indent, index++, Z_OBJCE_P(closure_this)-name);
}
if (static_variables) {
HashPosition pos;
@@ -894,7 +894,7 @@
zstr key;
ulong num_index;

zend_hash_internal_pointer_reset_ex(static_variables, pos);
-   while (index++  count) {
+   while (index  count) {

zend_hash_get_current_key_ex(static_variables, key, key_len, num_index, 0, 
pos);
string_printf(str, %sParameter #%d 
[ $%v ]\n, indent, index++, key);

zend_hash_move_forward_ex(static_variables, pos);
@@ -1605,7 +1605,9 @@
GET_REFLECTION_OBJECT_PTR(fptr);
if (intern-obj) {
closure_this = zend_get_closure_this_ptr(intern-obj TSRMLS_CC);
-   RETURN_ZVAL(closure_this, 1, 0);
+   if (closure_this) {
+   RETURN_ZVAL(closure_this, 1, 0);
+   }
}
 }
 /* }}} */
@@ -5558,7 +5560,7 @@
php_info_print_table_start();
php_info_print_table_header(2, Reflection, enabled);
 
-   php_info_print_table_row(2, Version, $Revision: 1.336 $);
+   php_info_print_table_row(2, Version, $Revision: 1.337 $);
 
php_info_print_table_end();
 } /* }}} */
@@ -5572,7 +5574,7 @@
NULL,
NULL,
PHP_MINFO(reflection),
-   $Revision: 1.336 $,
+   $Revision: 1.337 $,
STANDARD_MODULE_PROPERTIES
 }; /* }}} */
 
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt
diff -u php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt:1.2 
php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt:1.3
--- php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt:1.2 
Fri Aug  8 12:42:40 2008
+++ php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt Sat Jan 
 3 20:40:22 2009
@@ -56,9 +56,13 @@
 *** Testing ReflectionMethod::getClosure() : error conditions ***
 
 -- Testing ReflectionMethod::getClosure() function with more than expected no. 
of arguments --
-object(Closure)#%d (0) {
+object(Closure)#%d (1) {
+  [this]=
+  NULL
 }
-object(Closure)#%d (0) {
+object(Closure)#%d (1) {
+  [this]=
+  NULL
 }
 
 Warning: ReflectionMethod::getClosure() expects exactly 1 parameter, 2 given 
in %s on line %d

http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/027.phpt?view=markuprev=1.1
Index: php-src/ext/reflection/tests/027.phpt
+++ php-src/ext/reflection/tests/027.phpt
--TEST--
--FILE--
?php

$global = 42;

$func = function($x, stdClass $y=NULL) use($global) {
static $static;
};

ReflectionFunction::Export($func);

$r = new ReflectionFunction($func);

var_dump(@get_class($r-getClosureThis()));
var_dump($r-getName());
var_dump($r-isClosure());

Class Test {
public $func;
function __construct(){
global $global;
$this-func = function($x, stdClass $y = NULL) use($global) {
static $static;
};
}
}

ReflectionMethod::export(new Test, func);

$r = new ReflectionMethod(new Test, func);

var_dump(get_class($r-getClosureThis()));

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/reflection php_reflection.c /ext/reflection/tests 027.phpt ReflectionMethod_getClosure_error.phpt

2009-01-03 Thread Marcus Boerger
helly   Sat Jan  3 20:41:01 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/reflection/tests   027.phpt 

  Modified files:  
/php-src/ext/reflection php_reflection.c 
/php-src/ext/reflection/tests   
ReflectionMethod_getClosure_error.phpt 
  Log:
  - MFH Minor corrections and a new test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.45.2.49r2=1.164.2.33.2.45.2.50diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.49 
php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.50
--- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.49Sat Jan 
 3 20:04:22 2009
+++ php-src/ext/reflection/php_reflection.c Sat Jan  3 20:41:00 2009
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.49 2009/01/03 20:04:22 helly Exp 
$ */
+/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.50 2009/01/03 20:41:00 helly Exp 
$ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -861,7 +861,7 @@
string_printf(str, \n);
string_printf(str, %s  - Static Parameters [%d] {\n, 
indent, count);
if (closure_this) {
-   string_printf(str, %sParameter #%d [ %s 
$this ]\n, indent, ++index, Z_OBJCE_P(closure_this)-name);
+   string_printf(str, %sParameter #%d [ %s 
$this ]\n, indent, index++, Z_OBJCE_P(closure_this)-name);
}
if (static_variables) {
HashPosition pos;
@@ -869,7 +869,7 @@
char* key;
ulong num_index;

zend_hash_internal_pointer_reset_ex(static_variables, pos);
-   while (index++  count) {
+   while (index  count) {

zend_hash_get_current_key_ex(static_variables, key, key_len, num_index, 0, 
pos);
string_printf(str, %sParameter #%d 
[ $%s ]\n, indent, index++, key);

zend_hash_move_forward_ex(static_variables, pos);
@@ -1570,7 +1570,9 @@
GET_REFLECTION_OBJECT_PTR(fptr);
if (intern-obj) {
closure_this = zend_get_closure_this_ptr(intern-obj TSRMLS_CC);
-   RETURN_ZVAL(closure_this, 1, 0);
+   if (closure_this) {
+   RETURN_ZVAL(closure_this, 1, 0);
+   }
}
 }
 /* }}} */
@@ -5378,7 +5380,7 @@
php_info_print_table_start();
php_info_print_table_header(2, Reflection, enabled);
 
-   php_info_print_table_row(2, Version, $Revision: 1.164.2.33.2.45.2.49 
$);
+   php_info_print_table_row(2, Version, $Revision: 1.164.2.33.2.45.2.50 
$);
 
php_info_print_table_end();
 } /* }}} */
@@ -5392,7 +5394,7 @@
NULL,
NULL,
PHP_MINFO(reflection),
-   $Revision: 1.164.2.33.2.45.2.49 $,
+   $Revision: 1.164.2.33.2.45.2.50 $,
STANDARD_MODULE_PROPERTIES
 }; /* }}} */
 
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u
Index: php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt
diff -u 
php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt:1.1.2.1 
php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt:1.1.2.2
--- php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt:1.1.2.1 
Fri Aug  8 12:39:16 2008
+++ php-src/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt Sat Jan 
 3 20:41:01 2009
@@ -56,9 +56,13 @@
 *** Testing ReflectionMethod::getClosure() : error conditions ***
 
 -- Testing ReflectionMethod::getClosure() function with more than expected no. 
of arguments --
-object(Closure)#%d (0) {
+object(Closure)#%d (1) {
+  [this]=
+  NULL
 }
-object(Closure)#%d (0) {
+object(Closure)#%d (1) {
+  [this]=
+  NULL
 }
 
 Warning: ReflectionMethod::getClosure() expects exactly 1 parameter, 2 given 
in %s on line %d

http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/027.phpt?view=markuprev=1.1
Index: php-src/ext/reflection/tests/027.phpt
+++ php-src/ext/reflection/tests/027.phpt
--TEST--
--FILE--
?php

$global = 42;

$func = function($x, stdClass $y=NULL) use($global) {
static $static;
};

ReflectionFunction::Export($func);

$r = new ReflectionFunction($func);

var_dump(@get_class($r-getClosureThis()));
var_dump($r-getName());
var_dump($r-isClosure());

Class Test {
public $func;
function __construct(){
global $global;
$this-func = function($x, stdClass $y = NULL) use($global) {
   

[PHP-CVS] cvs: php-src /ext/reflection php_reflection.c

2009-01-03 Thread Marcus Boerger
helly   Sat Jan  3 21:06:39 2009 UTC

  Modified files:  
/php-src/ext/reflection php_reflection.c 
  Log:
  - MFB Missing namespace changes
  # Now all tests PASS again
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.337r2=1.338diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.337 
php-src/ext/reflection/php_reflection.c:1.338
--- php-src/ext/reflection/php_reflection.c:1.337   Sat Jan  3 20:40:22 2009
+++ php-src/ext/reflection/php_reflection.c Sat Jan  3 21:06:38 2009
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_reflection.c,v 1.337 2009/01/03 20:40:22 helly Exp $ */
+/* $Id: php_reflection.c,v 1.338 2009/01/03 21:06:38 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -2899,13 +2899,13 @@
RETURN_FALSE;
}
if (Z_TYPE_PP(name) == IS_STRING
-(colon.s = zend_memrchr(Z_STRVAL_PP(name), ':', 
Z_STRLEN_PP(name)))
-colon.s  Z_STRVAL_PP(name)  *(colon.s-1) == ':')
+(colon.s = zend_memrchr(Z_STRVAL_PP(name), '\\', 
Z_STRLEN_PP(name)))
+colon.s  Z_STRVAL_PP(name))
{
RETURN_TRUE;
} else if (Z_TYPE_PP(name) == IS_UNICODE
-(colon.u = u_memrchr(Z_USTRVAL_PP(name), ':', 
Z_USTRLEN_PP(name)))
-colon.u  Z_USTRVAL_PP(name)  *(colon.u-1) == ':')
+(colon.u = u_memrchr(Z_USTRVAL_PP(name), '\\', 
Z_USTRLEN_PP(name)))
+colon.u  Z_USTRVAL_PP(name))
{
RETURN_TRUE;
}
@@ -2913,53 +2913,53 @@
 }
 /* }}} */
 
-/* {{{ proto public string ReflectionFunction::getNamespaceName()
+/* {{{ proto public string ReflectionFunction::getNamespaceName() U
Returns the name of namespace where this function is defined */
 ZEND_METHOD(reflection_function, getNamespaceName)
 {
zval **name;
-   zstr colon;
+   zstr backslash;
 
METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0);
if (zend_hash_find(Z_OBJPROP_P(getThis()), name, sizeof(name), 
(void **) name) == FAILURE) {
RETURN_FALSE;
}
if (Z_TYPE_PP(name) == IS_STRING
-(colon.s = zend_memrchr(Z_STRVAL_PP(name), ':', 
Z_STRLEN_PP(name)))
-colon.s  Z_STRVAL_PP(name)  *(colon.s-1) == ':')
+(backslash.s = zend_memrchr(Z_STRVAL_PP(name), '\\', 
Z_STRLEN_PP(name)))
+backslash.s  Z_STRVAL_PP(name))
{
-   RETURN_STRINGL(Z_STRVAL_PP(name), colon.s - Z_STRVAL_PP(name) - 
1, 1);
+   RETURN_STRINGL(Z_STRVAL_PP(name), backslash.s - 
Z_STRVAL_PP(name), 1);
} else if (Z_TYPE_PP(name) == IS_UNICODE
-(colon.u = u_memrchr(Z_USTRVAL_PP(name), ':', 
Z_USTRLEN_PP(name)))
-colon.u  Z_USTRVAL_PP(name)  *(colon.u-1) == ':')
+(backslash.u = u_memrchr(Z_USTRVAL_PP(name), '\\', 
Z_USTRLEN_PP(name)))
+backslash.u  Z_USTRVAL_PP(name))
{
-   RETURN_UNICODEL(Z_USTRVAL_PP(name), colon.u - 
Z_USTRVAL_PP(name) - 1, 1);
+   RETURN_UNICODEL(Z_USTRVAL_PP(name), backslash.u - 
Z_USTRVAL_PP(name), 1);
}
RETURN_EMPTY_TEXT();
 }
 /* }}} */
 
-/* {{{ proto public string ReflectionFunction::getShortName()
+/* {{{ proto public string ReflectionFunction::getShortName() U
Returns the short name of the function (without namespace part) */
 ZEND_METHOD(reflection_function, getShortName)
 {
zval **name;
-   zstr colon;
+   zstr backslash;
 
METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0);
if (zend_hash_find(Z_OBJPROP_P(getThis()), name, sizeof(name), 
(void **) name) == FAILURE) {
RETURN_FALSE;
}
if (Z_TYPE_PP(name) == IS_STRING
-(colon.s = zend_memrchr(Z_STRVAL_PP(name), ':', 
Z_STRLEN_PP(name)))
-colon.s  Z_STRVAL_PP(name)  *(colon.s-1) == ':')
+(backslash.s = zend_memrchr(Z_STRVAL_PP(name), '\\', 
Z_STRLEN_PP(name)))
+backslash.s  Z_STRVAL_PP(name))
{
-   RETURN_STRINGL(colon.s + 1, Z_STRLEN_PP(name) - (colon.s - 
Z_STRVAL_PP(name) + 1), 1);
+   RETURN_STRINGL(backslash.s + 1, Z_STRLEN_PP(name) - 
(backslash.s - Z_STRVAL_PP(name) + 1), 1);
} else if (Z_TYPE_PP(name) == IS_UNICODE
-(colon.u = u_memrchr(Z_USTRVAL_PP(name), ':', 
Z_USTRLEN_PP(name)))
-colon.u  Z_USTRVAL_PP(name)  *(colon.u-1) == ':')
+(backslash.u = u_memrchr(Z_USTRVAL_PP(name), '\\', 
Z_USTRLEN_PP(name)))
+backslash.u  Z_USTRVAL_PP(name))
{
-   RETURN_UNICODEL(colon.u + 1, Z_USTRLEN_PP(name) - (colon.u - 
Z_USTRVAL_PP(name) + 1), 1);
+   RETURN_UNICODEL(backslash.u + 1, 

[PHP-CVS] cvs: php-src /ext/sqlite3 sqlite3.c

2009-01-03 Thread Felipe Pena
felipe  Sat Jan  3 22:07:22 2009 UTC

  Modified files:  
/php-src/ext/sqlite3sqlite3.c 
  Log:
  - Removed unnecessary repeated arginfos
  - Changed sqlite3stmt and sqlite3result to ZEND_ACC_PRIVATE to avoid 
reflection instantiation
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/sqlite3.c?r1=1.25r2=1.26diff_format=u
Index: php-src/ext/sqlite3/sqlite3.c
diff -u php-src/ext/sqlite3/sqlite3.c:1.25 php-src/ext/sqlite3/sqlite3.c:1.26
--- php-src/ext/sqlite3/sqlite3.c:1.25  Wed Dec 31 11:12:36 2008
+++ php-src/ext/sqlite3/sqlite3.c   Sat Jan  3 22:07:22 2009
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: sqlite3.c,v 1.25 2008/12/31 11:12:36 sebastian Exp $ */
+/* $Id: sqlite3.c,v 1.26 2009/01/03 22:07:22 felipe Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1439,40 +1439,14 @@
ZEND_ARG_INFO(0, encryption_key)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3_close, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3_exec, 0)
-   ZEND_ARG_INFO(0, query)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3_version, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3_lastinsertrowid, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3_lasterrorcode, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3_lasterrormsg, 0)
-ZEND_END_ARG_INFO()
-
 ZEND_BEGIN_ARG_INFO(arginfo_sqlite3_loadextension, 0)
ZEND_ARG_INFO(0, shared_library)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3_changes, 0)
-ZEND_END_ARG_INFO()
-
 ZEND_BEGIN_ARG_INFO_EX(arginfo_sqlite3_escapestring, 0, 0, 1)
ZEND_ARG_INFO(0, value)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(arginfo_sqlite3_prepare, 0, 0, 1)
-   ZEND_ARG_INFO(0, query)
-ZEND_END_ARG_INFO()
-
 ZEND_BEGIN_ARG_INFO_EX(arginfo_sqlite3_query, 0, 0, 1)
ZEND_ARG_INFO(0, query)
 ZEND_END_ARG_INFO()
@@ -1495,21 +1469,6 @@
ZEND_ARG_INFO(0, argument_count)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3stmt_paramcount, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3stmt_close, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3stmt_reset, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3stmt_clear, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3stmt_execute, 0)
-ZEND_END_ARG_INFO()
-
 ZEND_BEGIN_ARG_INFO_EX(arginfo_sqlite3stmt_bindparam, 0, 0, 2)
ZEND_ARG_INFO(0, param_number)
ZEND_ARG_INFO(1, param)
@@ -1526,9 +1485,6 @@
ZEND_ARG_INFO(0, sqlite3)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3result_numcolumns, 0)
-ZEND_END_ARG_INFO()
-
 ZEND_BEGIN_ARG_INFO_EX(arginfo_sqlite3result_columnname, 0, 0, 1)
ZEND_ARG_INFO(0, column_number)
 ZEND_END_ARG_INFO()
@@ -1541,29 +1497,23 @@
ZEND_ARG_INFO(0, mode)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3result_reset, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3result_finalize, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3result_construct, 0)
+ZEND_BEGIN_ARG_INFO(arginfo_sqlite3_void, 0)
 ZEND_END_ARG_INFO()
 /* }}} */
 
 /* {{{ php_sqlite3_class_methods */
 static zend_function_entry php_sqlite3_class_methods[] = {
PHP_ME(sqlite3, open,   
arginfo_sqlite3_open, ZEND_ACC_PUBLIC)
-   PHP_ME(sqlite3, close,  
arginfo_sqlite3_close, ZEND_ACC_PUBLIC)
-   PHP_ME(sqlite3, exec,   
arginfo_sqlite3_exec, ZEND_ACC_PUBLIC)
-   PHP_ME(sqlite3, version,
arginfo_sqlite3_version, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
-   PHP_ME(sqlite3, lastInsertRowID,
arginfo_sqlite3_lastinsertrowid, ZEND_ACC_PUBLIC)
-   PHP_ME(sqlite3, lastErrorCode,  
arginfo_sqlite3_lasterrorcode, ZEND_ACC_PUBLIC)
-   PHP_ME(sqlite3, lastErrorMsg,   
arginfo_sqlite3_lasterrormsg, ZEND_ACC_PUBLIC)
+   PHP_ME(sqlite3, close,  
arginfo_sqlite3_void, ZEND_ACC_PUBLIC)
+   PHP_ME(sqlite3, exec,   
arginfo_sqlite3_query, ZEND_ACC_PUBLIC)
+   PHP_ME(sqlite3, version,
arginfo_sqlite3_void, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+   PHP_ME(sqlite3, lastInsertRowID,arginfo_sqlite3_void, 
ZEND_ACC_PUBLIC)
+   PHP_ME(sqlite3, lastErrorCode,  arginfo_sqlite3_void, 
ZEND_ACC_PUBLIC)
+   PHP_ME(sqlite3, lastErrorMsg,   arginfo_sqlite3_void, 
ZEND_ACC_PUBLIC)
PHP_ME(sqlite3, loadExtension,  
arginfo_sqlite3_loadextension, ZEND_ACC_PUBLIC)
-   PHP_ME(sqlite3, changes,
arginfo_sqlite3_changes, ZEND_ACC_PUBLIC)
+   PHP_ME(sqlite3, changes,
arginfo_sqlite3_void, 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sqlite3 sqlite3.c

2009-01-03 Thread Felipe Pena
felipe  Sat Jan  3 22:08:39 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/sqlite3sqlite3.c 
  Log:
  MFH:
  - Removed unnecessary repeated arginfos
  - Changed sqlite3stmt and sqlite3result to ZEND_ACC_PRIVATE to avoid 
reflection instantiation
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/sqlite3.c?r1=1.1.2.23r2=1.1.2.24diff_format=u
Index: php-src/ext/sqlite3/sqlite3.c
diff -u php-src/ext/sqlite3/sqlite3.c:1.1.2.23 
php-src/ext/sqlite3/sqlite3.c:1.1.2.24
--- php-src/ext/sqlite3/sqlite3.c:1.1.2.23  Wed Dec 31 11:15:44 2008
+++ php-src/ext/sqlite3/sqlite3.c   Sat Jan  3 22:08:38 2009
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: sqlite3.c,v 1.1.2.23 2008/12/31 11:15:44 sebastian Exp $ */
+/* $Id: sqlite3.c,v 1.1.2.24 2009/01/03 22:08:38 felipe Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1411,40 +1411,14 @@
ZEND_ARG_INFO(0, encryption_key)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3_close, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3_exec, 0)
-   ZEND_ARG_INFO(0, query)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3_version, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3_lastinsertrowid, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3_lasterrorcode, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3_lasterrormsg, 0)
-ZEND_END_ARG_INFO()
-
 ZEND_BEGIN_ARG_INFO(arginfo_sqlite3_loadextension, 0)
ZEND_ARG_INFO(0, shared_library)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3_changes, 0)
-ZEND_END_ARG_INFO()
-
 ZEND_BEGIN_ARG_INFO_EX(arginfo_sqlite3_escapestring, 0, 0, 1)
ZEND_ARG_INFO(0, value)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(arginfo_sqlite3_prepare, 0, 0, 1)
-   ZEND_ARG_INFO(0, query)
-ZEND_END_ARG_INFO()
-
 ZEND_BEGIN_ARG_INFO_EX(arginfo_sqlite3_query, 0, 0, 1)
ZEND_ARG_INFO(0, query)
 ZEND_END_ARG_INFO()
@@ -1467,21 +1441,6 @@
ZEND_ARG_INFO(0, argument_count)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3stmt_paramcount, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3stmt_close, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3stmt_reset, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3stmt_clear, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3stmt_execute, 0)
-ZEND_END_ARG_INFO()
-
 ZEND_BEGIN_ARG_INFO_EX(arginfo_sqlite3stmt_bindparam, 0, 0, 2)
ZEND_ARG_INFO(0, param_number)
ZEND_ARG_INFO(1, param)
@@ -1498,9 +1457,6 @@
ZEND_ARG_INFO(0, sqlite3)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3result_numcolumns, 0)
-ZEND_END_ARG_INFO()
-
 ZEND_BEGIN_ARG_INFO_EX(arginfo_sqlite3result_columnname, 0, 0, 1)
ZEND_ARG_INFO(0, column_number)
 ZEND_END_ARG_INFO()
@@ -1513,29 +1469,23 @@
ZEND_ARG_INFO(0, mode)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3result_reset, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3result_finalize, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_sqlite3result_construct, 0)
+ZEND_BEGIN_ARG_INFO(arginfo_sqlite3_void, 0)
 ZEND_END_ARG_INFO()
 /* }}} */
 
 /* {{{ php_sqlite3_class_methods */
 static zend_function_entry php_sqlite3_class_methods[] = {
PHP_ME(sqlite3, open,   
arginfo_sqlite3_open, ZEND_ACC_PUBLIC)
-   PHP_ME(sqlite3, close,  
arginfo_sqlite3_close, ZEND_ACC_PUBLIC)
-   PHP_ME(sqlite3, exec,   
arginfo_sqlite3_exec, ZEND_ACC_PUBLIC)
-   PHP_ME(sqlite3, version,
arginfo_sqlite3_version, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
-   PHP_ME(sqlite3, lastInsertRowID,
arginfo_sqlite3_lastinsertrowid, ZEND_ACC_PUBLIC)
-   PHP_ME(sqlite3, lastErrorCode,  
arginfo_sqlite3_lasterrorcode, ZEND_ACC_PUBLIC)
-   PHP_ME(sqlite3, lastErrorMsg,   
arginfo_sqlite3_lasterrormsg, ZEND_ACC_PUBLIC)
+   PHP_ME(sqlite3, close,  
arginfo_sqlite3_void, ZEND_ACC_PUBLIC)
+   PHP_ME(sqlite3, exec,   
arginfo_sqlite3_query, ZEND_ACC_PUBLIC)
+   PHP_ME(sqlite3, version,
arginfo_sqlite3_void, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+   PHP_ME(sqlite3, lastInsertRowID,arginfo_sqlite3_void, 
ZEND_ACC_PUBLIC)
+   PHP_ME(sqlite3, lastErrorCode,  arginfo_sqlite3_void, 
ZEND_ACC_PUBLIC)
+   PHP_ME(sqlite3, lastErrorMsg,   arginfo_sqlite3_void, 
ZEND_ACC_PUBLIC)
PHP_ME(sqlite3, loadExtension,  
arginfo_sqlite3_loadextension, ZEND_ACC_PUBLIC)
-   PHP_ME(sqlite3, changes,
arginfo_sqlite3_changes, ZEND_ACC_PUBLIC)
+   PHP_ME(sqlite3,