cvs: php-src / unicode-progress.txt /ext/standard basic_functions.c
| From: | Andrei Zmievski | Date: | Wed, 22 Nov 2006 19:13:19 +0000 |
| Subject: | cvs: php-src / unicode-progress.txt /ext/standard basic_functions.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-41689@lists.php.net to get a copy of this message | ||
andrei Wed Nov 22 19:13:19 2006 UTC
Modified files:
/php-src unicode-progress.txt
/php-src/ext/standard basic_functions.c
Log:
- Unicode support for tick functions.
- Update unicode-progress.txt
http://cvs.php.net/viewvc.cgi/php-src/unicode-progress.txt?r1=1.62&r2=1.63&diff_format=u
Index: php-src/unicode-progress.txt
diff -u php-src/unicode-progress.txt:1.62 php-src/unicode-progress.txt:1.63
--- php-src/unicode-progress.txt:1.62 Mon Nov 20 20:58:56 2006
+++ php-src/unicode-progress.txt Wed Nov 22 19:13:19 2006
@@ -29,11 +29,10 @@
parse_ini_file()
Params API, unicode filename support, depends on INI mechaniem
- highlight_string()
- IS_UNICODE support (may be very easy, since scanner handles Unicode
-
getopt()
- Use ASCII for options?
+ Will use ASCII for options. $_SERVER['argv'] should not be converted
+ to Unicode and should stay binary, since we can't be sure of the
+ encoding on CLI. Console_Getopt may be changed to support encodings.
array.c
-------
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.825&r2=1.826&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.825 php-src/ext/standard/basic_functions.c:1.826
--- php-src/ext/standard/basic_functions.c:1.825 Tue Nov 21 22:21:38 2006
+++ php-src/ext/standard/basic_functions.c Wed Nov 22 19:13:19 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.825 2006/11/21 22:21:38 andrei Exp $ */
+/* $Id: basic_functions.c,v 1.826 2006/11/22 19:13:19 andrei Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -5259,13 +5259,13 @@
} else {
zval **obj, **method;
- if (Z_TYPE_P(function) == IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s() - function does not
exist", Z_STRVAL_P(function));
+ if (Z_TYPE_P(function) == IS_STRING || Z_TYPE_P(function) == IS_UNICODE) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %R() - function does not
exist", Z_TYPE_P(function), Z_UNIVAL_P(function));
} else if ( Z_TYPE_P(function) == IS_ARRAY
&& zend_hash_index_find(Z_ARRVAL_P(function), 0, (void **) &obj) == SUCCESS
&& zend_hash_index_find(Z_ARRVAL_P(function), 1, (void **) &method) == SUCCESS
&& Z_TYPE_PP(obj) == IS_OBJECT
- && Z_TYPE_PP(method) == IS_STRING ) {
+ && (Z_TYPE_PP(method) == IS_STRING || Z_TYPE_PP(method) == IS_UNICODE) ) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %v::%R() - function does not
exist", Z_OBJCE_PP(obj)->name, Z_TYPE_PP(method), Z_UNIVAL_PP(method));
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call tick function");
@@ -5291,6 +5291,8 @@
if (Z_TYPE_P(func1) == IS_STRING && Z_TYPE_P(func2) == IS_STRING) {
return (zend_binary_zval_strcmp(func1, func2) == 0);
+ } else if (Z_TYPE_P(func1) == IS_UNICODE && Z_TYPE_P(func2) == IS_UNICODE) {
+ return (zend_u_binary_zval_strcmp(func1, func2) == 0);
} else if (Z_TYPE_P(func1) == IS_ARRAY && Z_TYPE_P(func2) == IS_ARRAY) {
zval result;
zend_compare_arrays(&result, func1, func2 TSRMLS_CC);
@@ -5914,7 +5916,7 @@
/* }}} */
#endif
-/* {{{ proto bool register_tick_function(string function_name [, mixed arg [, mixed ... ]])
+/* {{{ proto bool register_tick_function(string function_name [, mixed arg [, mixed ... ]]) U
Registers a tick callback function */
PHP_FUNCTION(register_tick_function)
{
@@ -5935,8 +5937,9 @@
RETURN_FALSE;
}
- if (Z_TYPE_P(tick_fe.arguments[0]) != IS_ARRAY)
- convert_to_string_ex(&tick_fe.arguments[0]);
+ if (Z_TYPE_P(tick_fe.arguments[0]) != IS_ARRAY) {
+ convert_to_text_ex(&tick_fe.arguments[0]);
+ }
if (!BG(user_tick_functions)) {
BG(user_tick_functions) = (zend_llist *) emalloc(sizeof(zend_llist));
@@ -5956,27 +5959,27 @@
}
/* }}} */
-/* {{{ proto void unregister_tick_function(string function_name)
+/* {{{ proto void unregister_tick_function(string function_name) U
Unregisters a tick callback function */
PHP_FUNCTION(unregister_tick_function)
{
- zval **function;
+ zval *function;
user_tick_function_entry tick_fe;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &function)) {
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &function) == FAILURE) {
+ return;
}
if (!BG(user_tick_functions)) {
return;
}
- if (Z_TYPE_PP(function) != IS_ARRAY) {
- convert_to_string_ex(function);
+ if (Z_TYPE_P(function) != IS_ARRAY) {
+ convert_to_text(function);
}
tick_fe.arguments = (zval **) emalloc(sizeof(zval *));
- tick_fe.arguments[0] = *function;
+ tick_fe.arguments[0] = function;
tick_fe.arg_count = 1;
zend_llist_del_element(BG(user_tick_functions), &tick_fe, (int (*)(void *, void *))
user_tick_function_compare);
efree(tick_fe.arguments);