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.66&r2=1.67&diff_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.832&r2=1.833&diff_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_parame