[PHP-CVS] cvs: php-src / unicode-progress.txt /ext/standard basic_functions.c
andrei Mon Dec 18 20:47:57 2006 UTC Modified files: /php-srcunicode-progress.txt /php-src/ext/standard basic_functions.c Log: Unicode support in get_cfg_var(). http://cvs.php.net/viewvc.cgi/php-src/unicode-progress.txt?r1=1.67r2=1.68diff_format=u Index: php-src/unicode-progress.txt diff -u php-src/unicode-progress.txt:1.67 php-src/unicode-progress.txt:1.68 --- php-src/unicode-progress.txt:1.67 Fri Dec 15 23:28:09 2006 +++ php-src/unicode-progress.txtMon Dec 18 20:47:57 2006 @@ -14,12 +14,6 @@ set_include_path(), get_include_path(), restore_include_path() Params API, depends on INI mechanism -get_cfg_var() -IS_UNICODE support for varname - -parse_ini_file() -Params API, unicode filename support, depends on INI mechaniem - array.c --- natsort(), natcasesort() http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.836r2=1.837diff_format=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.836 php-src/ext/standard/basic_functions.c:1.837 --- php-src/ext/standard/basic_functions.c:1.836Mon Dec 18 20:40:51 2006 +++ php-src/ext/standard/basic_functions.c Mon Dec 18 20:47:57 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.836 2006/12/18 20:40:51 andrei Exp $ */ +/* $Id: basic_functions.c,v 1.837 2006/12/18 20:47:57 andrei Exp $ */ #include php.h #include php_streams.h @@ -4807,7 +4807,7 @@ } /* }}} */ -/* {{{ proto string get_cfg_var(string option_name) +/* {{{ proto string get_cfg_var(string option_name) U Get the value of a PHP configuration option */ PHP_FUNCTION(get_cfg_var) { @@ -4815,14 +4815,14 @@ int varname_len; char *value; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, varname, varname_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, varname, varname_len, UG(utf8_conv)) == FAILURE) { return; } if (cfg_get_string(varname, value) == FAILURE) { RETURN_FALSE; } - RETURN_STRING(value, 1); + RETURN_UTF8_STRING(value, ZSTR_DUPLICATE); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / unicode-progress.txt /ext/standard basic_functions.c
andrei Fri Dec 15 23:28:10 2006 UTC Modified files: /php-srcunicode-progress.txt /php-src/ext/standard basic_functions.c Log: Unicode support in ini_*() functions. http://cvs.php.net/viewvc.cgi/php-src/unicode-progress.txt?r1=1.66r2=1.67diff_format=u Index: php-src/unicode-progress.txt diff -u php-src/unicode-progress.txt:1.66 php-src/unicode-progress.txt:1.67 --- php-src/unicode-progress.txt:1.66 Tue Dec 12 19:25:47 2006 +++ php-src/unicode-progress.txtFri Dec 15 23:28:09 2006 @@ -14,9 +14,6 @@ set_include_path(), get_include_path(), restore_include_path() Params API, depends on INI mechanism -ini_get(), ini_get_all(), ini_set(), ini_restore() -Params API, Unicode support per discussion - get_cfg_var() IS_UNICODE support for varname http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.832r2=1.833diff_format=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.832 php-src/ext/standard/basic_functions.c:1.833 --- php-src/ext/standard/basic_functions.c:1.832Tue Dec 12 18:24:16 2006 +++ php-src/ext/standard/basic_functions.c Fri Dec 15 23:28:10 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.832 2006/12/12 18:24:16 andrei Exp $ */ +/* $Id: basic_functions.c,v 1.833 2006/12/15 23:28:10 andrei Exp $ */ #include php.h #include php_streams.h @@ -5546,26 +5546,24 @@ } /* }}} */ -/* {{{ proto string ini_get(string varname) +/* {{{ proto string ini_get(string varname) U Get a configuration option */ PHP_FUNCTION(ini_get) { - zval **varname; - char *str; + char *varname, *str; + int varname_len; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, varname) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, varname, varname_len, UG(utf8_conv)) == FAILURE) { + return; } - convert_to_string_ex(varname); - - str = zend_ini_string(Z_STRVAL_PP(varname), Z_STRLEN_PP(varname)+1, 0); + str = zend_ini_string(varname, varname_len+1, 0); if (!str) { RETURN_FALSE; } - RETURN_RT_STRING(str, 1); + RETURN_UTF8_STRING(str, ZSTR_DUPLICATE); } /* }}} */ @@ -5588,15 +5586,15 @@ array_init(option); if (ini_entry-orig_value) { - add_ascii_assoc_stringl(option, global_value, ini_entry-orig_value, ini_entry-orig_value_length, 1); + add_ascii_assoc_utf8_stringl(option, global_value, ini_entry-orig_value, ini_entry-orig_value_length, 1); } else if (ini_entry-value) { - add_ascii_assoc_stringl(option, global_value, ini_entry-value, ini_entry-value_length, 1); + add_ascii_assoc_utf8_stringl(option, global_value, ini_entry-value, ini_entry-value_length, 1); } else { add_ascii_assoc_null(option, global_value); } if (ini_entry-value) { - add_ascii_assoc_stringl(option, local_value, ini_entry-value, ini_entry-value_length, 1); + add_ascii_assoc_utf8_stringl(option, local_value, ini_entry-value, ini_entry-value_length, 1); } else { add_ascii_assoc_null(option, local_value); } @@ -5608,7 +5606,7 @@ return 0; } -/* {{{ proto array ini_get_all([string extension]) +/* {{{ proto array ini_get_all([string extension]) U Get all configuration options */ PHP_FUNCTION(ini_get_all) { @@ -5616,8 +5614,8 @@ int extname_len = 0, extnumber = 0; zend_module_entry *module; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s, extname, extname_len) == FAILURE) { - RETURN_FALSE; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s, extname, extname_len, UG(ascii_conv)) == FAILURE) { + return; } zend_ini_sort_entries(TSRMLS_C); @@ -5644,67 +5642,99 @@ return !strncmp(option_name, new_option_name, option_len); } -/* {{{ proto string ini_set(string varname, string newvalue) +/* {{{ proto string ini_set(string varname, string newvalue) U Set a configuration option, returns false on error and the old value of the configuration option on success */ PHP_FUNCTION(ini_set) { - zval **varname, **new_value; + char *varname; + zstr new_value; + int varname_len, new_value_len; + zend_uchar type; char *old_value; - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, varname, new_value) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, st, +
[PHP-CVS] cvs: php-src / unicode-progress.txt /ext/standard basic_functions.c
andrei Wed Nov 22 19:13:19 2006 UTC Modified files: /php-srcunicode-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.62r2=1.63diff_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.txtWed 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.825r2=1.826diff_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.825Tue 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)) { -