mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
Unicode support: zstr union
This commit is contained in:
parent
9158218d3a
commit
6f7619cf6f
6 changed files with 21 additions and 21 deletions
|
@ -718,7 +718,7 @@ static zend_bool should_overwrite_per_dir_entry(HashTable *target_ht, php_per_di
|
|||
{
|
||||
php_per_dir_entry *orig_per_dir_entry;
|
||||
|
||||
if (zend_u_hash_find(target_ht, hash_key->type, hash_key->u.string, hash_key->nKeyLength, (void **) &orig_per_dir_entry)==FAILURE) {
|
||||
if (zend_u_hash_find(target_ht, hash_key->type, hash_key->arKey, hash_key->nKeyLength, (void **) &orig_per_dir_entry)==FAILURE) {
|
||||
return 1; /* does not exist in dest, copy from source */
|
||||
}
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf)
|
|||
php_conf_rec *d = base_conf, *e = new_conf;
|
||||
php_dir_entry *pe;
|
||||
php_dir_entry *data;
|
||||
char *str;
|
||||
zstr str;
|
||||
uint str_len;
|
||||
ulong num_index;
|
||||
|
||||
|
@ -142,10 +142,10 @@ void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf)
|
|||
zend_hash_move_forward(&d->config)) {
|
||||
pe = NULL;
|
||||
zend_hash_get_current_data(&d->config, (void **) &data);
|
||||
if (zend_hash_find(&e->config, str, str_len, (void **) &pe) == SUCCESS) {
|
||||
if (zend_hash_find(&e->config, str.s, str_len, (void **) &pe) == SUCCESS) {
|
||||
if (pe->status >= data->status) continue;
|
||||
}
|
||||
zend_hash_update(&e->config, str, str_len, data, sizeof(*data), NULL);
|
||||
zend_hash_update(&e->config, str.s, str_len, data, sizeof(*data), NULL);
|
||||
phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", str,
|
||||
data->status, pe?pe->status:-1));
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ char *get_php_config(void *conf, char *name, size_t name_len)
|
|||
void apply_config(void *dummy)
|
||||
{
|
||||
php_conf_rec *d = dummy;
|
||||
char *str;
|
||||
zstr str;
|
||||
uint str_len;
|
||||
php_dir_entry *data;
|
||||
|
||||
|
@ -176,8 +176,8 @@ void apply_config(void *dummy)
|
|||
NULL) == HASH_KEY_IS_STRING;
|
||||
zend_hash_move_forward(&d->config)) {
|
||||
zend_hash_get_current_data(&d->config, (void **) &data);
|
||||
phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value));
|
||||
if (zend_alter_ini_entry(str, str_len, data->value, data->value_len,
|
||||
phpapdebug((stderr, "APPLYING (%s)(%s)\n", str.s, data->value));
|
||||
if (zend_alter_ini_entry(str.s, str_len, data->value, data->value_len,
|
||||
data->status, PHP_INI_STAGE_ACTIVATE) == FAILURE) {
|
||||
phpapdebug((stderr, "..FAILED\n"));
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf)
|
|||
php_conf_rec *d = base_conf, *e = new_conf;
|
||||
php_dir_entry *pe;
|
||||
php_dir_entry *data;
|
||||
char *str;
|
||||
zstr str;
|
||||
uint str_len;
|
||||
ulong num_index;
|
||||
|
||||
|
@ -132,10 +132,10 @@ void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf)
|
|||
zend_hash_move_forward(&d->config)) {
|
||||
pe = NULL;
|
||||
zend_hash_get_current_data(&d->config, (void **) &data);
|
||||
if (zend_hash_find(&e->config, str, str_len, (void **) &pe) == SUCCESS) {
|
||||
if (zend_hash_find(&e->config, str.s, str_len, (void **) &pe) == SUCCESS) {
|
||||
if (pe->status >= data->status) continue;
|
||||
}
|
||||
zend_hash_update(&e->config, str, str_len, data, sizeof(*data), NULL);
|
||||
zend_hash_update(&e->config, str.s, str_len, data, sizeof(*data), NULL);
|
||||
phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", str, data->status, pe?pe->status:-1));
|
||||
}
|
||||
return new_conf;
|
||||
|
@ -156,7 +156,7 @@ char *get_php_config(void *conf, char *name, size_t name_len)
|
|||
void apply_config(void *dummy)
|
||||
{
|
||||
php_conf_rec *d = dummy;
|
||||
char *str;
|
||||
zstr str;
|
||||
uint str_len;
|
||||
php_dir_entry *data;
|
||||
|
||||
|
@ -165,8 +165,8 @@ void apply_config(void *dummy)
|
|||
NULL) == HASH_KEY_IS_STRING;
|
||||
zend_hash_move_forward(&d->config)) {
|
||||
zend_hash_get_current_data(&d->config, (void **) &data);
|
||||
phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value));
|
||||
if (zend_alter_ini_entry(str, str_len, data->value, data->value_len, data->status, PHP_INI_STAGE_ACTIVATE) == FAILURE) {
|
||||
phpapdebug((stderr, "APPLYING (%s)(%s)\n", str.s, data->value));
|
||||
if (zend_alter_ini_entry(str.s, str_len, data->value, data->value_len, data->status, PHP_INI_STAGE_ACTIVATE) == FAILURE) {
|
||||
phpapdebug((stderr, "..FAILED\n"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -781,7 +781,7 @@ static zend_bool should_overwrite_per_dir_entry(HashTable *target_ht, php_per_di
|
|||
{
|
||||
php_per_dir_entry *new_per_dir_entry;
|
||||
|
||||
if (zend_hash_find(target_ht, hash_key->arKey, hash_key->nKeyLength, (void **) &new_per_dir_entry)==FAILURE) {
|
||||
if (zend_u_hash_find(target_ht, hash_key->type, hash_key->arKey, hash_key->nKeyLength, (void **) &new_per_dir_entry)==FAILURE) {
|
||||
return 1; /* does not exist in dest, copy from source */
|
||||
}
|
||||
|
||||
|
|
|
@ -566,7 +566,7 @@ static void add_header_to_table(table *t, INTERNAL_FUNCTION_PARAMETERS)
|
|||
zval *first = NULL;
|
||||
zval *second = NULL;
|
||||
zval **entry, **value;
|
||||
char *string_key;
|
||||
zstr string_key;
|
||||
uint string_key_len;
|
||||
ulong num_key;
|
||||
|
||||
|
@ -584,7 +584,7 @@ static void add_header_to_table(table *t, INTERNAL_FUNCTION_PARAMETERS)
|
|||
while (zend_hash_get_current_data_ex(Z_ARRVAL_P(first), (void **)&entry, &pos) == SUCCESS) {
|
||||
switch(zend_hash_get_current_key_ex(Z_ARRVAL_P(first), &string_key, &string_key_len, &num_key, 0, &pos)) {
|
||||
case HASH_KEY_IS_STRING:
|
||||
if (zend_hash_find(Z_ARRVAL_P(first), string_key, string_key_len, (void **)&value) == FAILURE) {
|
||||
if (zend_hash_find(Z_ARRVAL_P(first), string_key.s, string_key_len, (void **)&value) == FAILURE) {
|
||||
zend_hash_move_forward_ex(Z_ARRVAL_P(first), &pos);
|
||||
continue;
|
||||
}
|
||||
|
@ -595,9 +595,9 @@ static void add_header_to_table(table *t, INTERNAL_FUNCTION_PARAMETERS)
|
|||
|
||||
convert_to_string_ex(value);
|
||||
if (replace)
|
||||
ap_table_set(t, string_key, Z_STRVAL_PP(value));
|
||||
ap_table_set(t, string_key.s, Z_STRVAL_PP(value));
|
||||
else
|
||||
ap_table_merge(t, string_key, Z_STRVAL_PP(value));
|
||||
ap_table_merge(t, string_key.s, Z_STRVAL_PP(value));
|
||||
|
||||
break;
|
||||
case HASH_KEY_IS_LONG:
|
||||
|
|
|
@ -277,7 +277,7 @@ int cli_is_valid_code(char *code, int len, char **prompt TSRMLS_DC)
|
|||
|
||||
static char *cli_completion_generator_ht(const char *text, int textlen, int *state, HashTable *ht, void **pData TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
char *name;
|
||||
zstr name;
|
||||
ulong number;
|
||||
|
||||
if (!(*state % 2)) {
|
||||
|
@ -286,12 +286,12 @@ static char *cli_completion_generator_ht(const char *text, int textlen, int *sta
|
|||
}
|
||||
while(zend_hash_has_more_elements(ht) == SUCCESS) {
|
||||
zend_hash_get_current_key(ht, &name, &number, 0);
|
||||
if (!textlen || (UG(unicode) ? !zend_cmp_unicode_and_string((UChar *)name, (char *)text, textlen) : !strncmp(name, text, textlen))) {
|
||||
if (!textlen || (UG(unicode) ? !zend_cmp_unicode_and_string(name.u, (char *)text, textlen) : !strncmp(name.s, text, textlen))) {
|
||||
if (pData) {
|
||||
zend_hash_get_current_data(ht, pData);
|
||||
}
|
||||
zend_hash_move_forward(ht);
|
||||
return name;
|
||||
return name.s;
|
||||
}
|
||||
if (zend_hash_move_forward(ht) == FAILURE) {
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue