zend_try {
/* even if on_modify bails out, we have to continue on with restoring,
since there can be allocated variables that would be freed on MM shutdown
- and would lead to memory corruption later ini entry is modified again */
+ and would lead to memory corruption later ini entry is modified again */
ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC);
} zend_end_try();
}
EG(ini_directives) = registered_zend_ini_directives;
EG(modified_ini_directives) = NULL;
- if (zend_hash_init_ex(registered_zend_ini_directives, 100, NULL, NULL, 1, 0)==FAILURE) {
+ if (zend_hash_init_ex(registered_zend_ini_directives, 100, NULL, NULL, 1, 0) == FAILURE) {
return FAILURE;
}
return SUCCESS;
EG(modified_ini_directives) = NULL;
EG(ini_directives) = (HashTable *) malloc(sizeof(HashTable));
- if (zend_hash_init_ex(EG(ini_directives), registered_zend_ini_directives->nNumOfElements, NULL, NULL, 1, 0)==FAILURE) {
+ if (zend_hash_init_ex(EG(ini_directives), registered_zend_ini_directives->nNumOfElements, NULL, NULL, 1, 0) == FAILURE) {
return FAILURE;
}
zend_hash_copy(EG(ini_directives), registered_zend_ini_directives, NULL, &ini_entry, sizeof(zend_ini_entry));
f = *((Bucket **) a);
s = *((Bucket **) b);
- if (f->nKeyLength==0 && s->nKeyLength==0) { /* both numeric */
+ if (f->nKeyLength == 0 && s->nKeyLength == 0) { /* both numeric */
return ZEND_NORMALIZE_BOOL(f->nKeyLength - s->nKeyLength);
- } else if (f->nKeyLength==0) { /* f is numeric, s is not */
+ } else if (f->nKeyLength == 0) { /* f is numeric, s is not */
return -1;
- } else if (s->nKeyLength==0) { /* s is numeric, f is not */
+ } else if (s->nKeyLength == 0) { /* s is numeric, f is not */
return 1;
} else { /* both strings */
- /*FIXME: unicode hash*/
+ /* FIXME: unicode hash */
return zend_binary_strcasecmp(f->key.arKey.s, f->nKeyLength, s->key.arKey.s, s->nKeyLength);
}
}
while (p->name) {
p->module_number = module_number;
config_directive_success = 0;
- if (zend_hash_add(directives, p->name, p->name_length, p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry)==FAILURE) {
+ if (zend_hash_add(directives, p->name, p->name_length, p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry) == FAILURE) {
zend_unregister_ini_entries(module_number TSRMLS_CC);
return FAILURE;
}
if ((zend_get_configuration_directive(p->name, p->name_length, &default_value))==SUCCESS) {
if (!hashed_ini_entry->on_modify
- || hashed_ini_entry->on_modify(hashed_ini_entry, Z_STRVAL(default_value), Z_STRLEN(default_value), hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC)==SUCCESS) {
+ || hashed_ini_entry->on_modify(hashed_ini_entry, Z_STRVAL(default_value), Z_STRLEN(default_value), hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC) == SUCCESS) {
hashed_ini_entry->value = Z_STRVAL(default_value);
hashed_ini_entry->value_length = Z_STRLEN(default_value);
config_directive_success = 1;
char *duplicate;
TSRMLS_FETCH();
- if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry)==FAILURE) {
+ if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == FAILURE) {
return FAILURE;
}
duplicate = estrndup(new_value, new_value_length);
if (!ini_entry->on_modify
- || ini_entry->on_modify(ini_entry, duplicate, new_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC)==SUCCESS) {
+ || ini_entry->on_modify(ini_entry, duplicate, new_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC) == SUCCESS) {
if (!ini_entry->modified) {
ini_entry->orig_value = ini_entry->value;
ini_entry->orig_value_length = ini_entry->value_length;
ALLOC_HASHTABLE(EG(modified_ini_directives));
zend_hash_init(EG(modified_ini_directives), 8, NULL, NULL, 0);
}
- zend_hash_add(EG(modified_ini_directives), name, name_length, &ini_entry, sizeof(zend_ini_entry*), NULL);
+ zend_hash_add(EG(modified_ini_directives), name, name_length, &ini_entry, sizeof(zend_ini_entry *), NULL);
} else { /* we already changed the value, free the changed value */
efree(ini_entry->value);
}
zend_ini_entry *ini_entry;
TSRMLS_FETCH();
- if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry)==FAILURE ||
- (stage == ZEND_INI_STAGE_RUNTIME && (ini_entry->modifiable & ZEND_INI_USER) == 0)) {
+ if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == FAILURE ||
+ (stage == ZEND_INI_STAGE_RUNTIME && (ini_entry->modifiable & ZEND_INI_USER) == 0)) {
return FAILURE;
}
zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC);
zend_hash_del(EG(modified_ini_directives), name, name_length);
}
-
+
return SUCCESS;
}
/* }}} */
{
zend_ini_entry *ini_entry;
- if (zend_hash_find(registered_zend_ini_directives, name, name_length, (void **) &ini_entry)==FAILURE) {
+ if (zend_hash_find(registered_zend_ini_directives, name, name_length, (void **) &ini_entry) == FAILURE) {
return FAILURE;
}
zend_ini_entry *ini_entry;
TSRMLS_FETCH();
- if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) {
+ if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) {
if (orig && ini_entry->modified) {
return (ini_entry->orig_value ? strtol(ini_entry->orig_value, NULL, 0) : 0);
} else if (ini_entry->value) {
zend_ini_entry *ini_entry;
TSRMLS_FETCH();
- if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) {
+ if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) {
if (orig && ini_entry->modified) {
return (double) (ini_entry->orig_value ? zend_strtod(ini_entry->orig_value, NULL) : 0.0);
} else if (ini_entry->value) {
zend_ini_entry *ini_entry;
TSRMLS_FETCH();
- if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) {
+ if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) {
if (orig && ini_entry->modified) {
return ini_entry->orig_value;
} else {
char *display_string;
uint display_string_length;
- if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
+ if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
if (ini_entry->orig_value) {
display_string = ini_entry->orig_value;
display_string_length = ini_entry->orig_value_length;
} else {
if (zend_uv.html_errors) {
display_string = NO_VALUE_HTML;
- display_string_length = sizeof(NO_VALUE_HTML)-1;
+ display_string_length = sizeof(NO_VALUE_HTML) - 1;
} else {
display_string = NO_VALUE_PLAINTEXT;
- display_string_length = sizeof(NO_VALUE_PLAINTEXT)-1;
+ display_string_length = sizeof(NO_VALUE_PLAINTEXT) - 1;
}
}
} else if (ini_entry->value && ini_entry->value[0]) {
} else {
if (zend_uv.html_errors) {
display_string = NO_VALUE_HTML;
- display_string_length = sizeof(NO_VALUE_HTML)-1;
+ display_string_length = sizeof(NO_VALUE_HTML) - 1;
} else {
display_string = NO_VALUE_PLAINTEXT;
- display_string_length = sizeof(NO_VALUE_PLAINTEXT)-1;
+ display_string_length = sizeof(NO_VALUE_PLAINTEXT) - 1;
}
}
ZEND_WRITE(display_string, display_string_length);
int value, tmp_value_len;
char *tmp_value;
- if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
+ if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
tmp_value = (ini_entry->orig_value ? ini_entry->orig_value : NULL );
tmp_value_len = ini_entry->orig_value_length;
} else if (ini_entry->value) {
{
char *value;
- if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
+ if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
value = ini_entry->orig_value;
} else if (ini_entry->value) {
value = ini_entry->value;
{
char *value;
- if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
+ if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
value = ini_entry->orig_value;
} else if (ini_entry->value) {
value = ini_entry->value;
}
if (value) {
- if (atoi(value)==-1) {
+ if (atoi(value) == -1) {
ZEND_PUTS("Unlimited");
} else {
zend_printf("%s", value);
p = (zend_bool *) (base+(size_t) mh_arg1);
- if (new_value_length==2 && strcasecmp("on", new_value)==0) {
+ if (new_value_length == 2 && strcasecmp("on", new_value) == 0) {
*p = (zend_bool) 1;
}
- else if (new_value_length==3 && strcasecmp("yes", new_value)==0) {
+ else if (new_value_length == 3 && strcasecmp("yes", new_value) == 0) {
*p = (zend_bool) 1;
}
- else if (new_value_length==4 && strcasecmp("true", new_value)==0) {
+ else if (new_value_length == 4 && strcasecmp("true", new_value) == 0) {
*p = (zend_bool) 1;
}
else {