Browse Source

ws fix

experimental/new_ui_api
foobar 24 years ago
parent
commit
c241dc5c8b
  1. 36
      main/php_ini.c

36
main/php_ini.c

@ -108,7 +108,7 @@ PHPAPI void display_ini_entries(zend_module_entry *module)
if (module) {
module_number = module->module_number;
} else {
} else {
module_number = 0;
}
php_info_print_table_start();
@ -122,25 +122,25 @@ PHPAPI void display_ini_entries(zend_module_entry *module)
#ifdef ZTS
# if (ZEND_DEBUG)
# define ZEND_EXTENSION_TOKEN "zend_extension_debug_ts"
# define ZEND_EXTENSION_TOKEN "zend_extension_debug_ts"
# else
# define ZEND_EXTENSION_TOKEN "zend_extension_ts"
# define ZEND_EXTENSION_TOKEN "zend_extension_ts"
# endif
#else
# if (ZEND_DEBUG)
# define ZEND_EXTENSION_TOKEN "zend_extension_debug"
# define ZEND_EXTENSION_TOKEN "zend_extension_debug"
# else
# define ZEND_EXTENSION_TOKEN "zend_extension"
# define ZEND_EXTENSION_TOKEN "zend_extension"
# endif
#endif
/* {{{ pvalue_config_destructor
*/
static void pvalue_config_destructor(zval *pvalue)
{
if (Z_TYPE_P(pvalue) == IS_STRING && Z_STRVAL_P(pvalue) != empty_string) {
free(Z_STRVAL_P(pvalue));
}
{
if (Z_TYPE_P(pvalue) == IS_STRING && Z_STRVAL_P(pvalue) != empty_string) {
free(Z_STRVAL_P(pvalue));
}
}
/* }}} */
@ -157,14 +157,14 @@ static void php_config_ini_parser_cb(zval *arg1, zval *arg2, int callback_type,
}
if (!strcasecmp(Z_STRVAL_P(arg1), "extension")) { /* load function module */
zval copy;
copy = *arg2;
zval_copy_ctor(&copy);
copy.refcount = 0;
zend_llist_add_element(&extension_lists.functions, &copy);
zend_llist_add_element(&extension_lists.functions, &copy);
} else if (!strcasecmp(Z_STRVAL_P(arg1), ZEND_EXTENSION_TOKEN)) { /* load Zend extension */
char *extension_name = estrndup(Z_STRVAL_P(arg2), Z_STRLEN_P(arg2));
zend_llist_add_element(&extension_lists.engine, &extension_name);
} else {
zend_hash_update(&configuration_hash, Z_STRVAL_P(arg1), Z_STRLEN_P(arg1)+1, arg2, sizeof(zval), (void **) &entry);
@ -212,7 +212,7 @@ int php_init_config(char *php_ini_path_override)
zend_llist_init(&extension_lists.engine, sizeof(char *), (llist_dtor_func_t) free_estring, 1);
zend_llist_init(&extension_lists.functions, sizeof(zval), (llist_dtor_func_t) ZVAL_DESTRUCTOR, 1);
safe_mode_state = PG(safe_mode);
open_basedir = PG(open_basedir);
PG(safe_mode) = 0;
@ -284,11 +284,11 @@ int php_init_config(char *php_ini_path_override)
fh.filename = php_ini_opened_path;
zend_parse_ini_file(&fh, 1, php_config_ini_parser_cb, &extension_lists);
/* If we succeeded in opening an INI file, preserve the name of the file opened. */
if (php_ini_opened_path) {
zval tmp;
Z_STRLEN(tmp) = strlen(php_ini_opened_path);
Z_STRVAL(tmp) = zend_strndup(php_ini_opened_path, Z_STRLEN(tmp));
Z_TYPE(tmp) = IS_STRING;
@ -296,7 +296,7 @@ int php_init_config(char *php_ini_path_override)
efree(php_ini_opened_path);
php_ini_opened_path = zend_strndup(Z_STRVAL(tmp), Z_STRLEN(tmp));
}
return SUCCESS;
}
/* }}} */
@ -344,7 +344,7 @@ zval *cfg_get_entry(char *name, uint name_length)
PHPAPI int cfg_get_long(char *varname, long *result)
{
zval *tmp, var;
if (zend_hash_find(&configuration_hash, varname, strlen(varname)+1, (void **) &tmp)==FAILURE) {
*result=(long)NULL;
return FAILURE;
@ -362,7 +362,7 @@ PHPAPI int cfg_get_long(char *varname, long *result)
PHPAPI int cfg_get_double(char *varname, double *result)
{
zval *tmp, var;
if (zend_hash_find(&configuration_hash, varname, strlen(varname)+1, (void **) &tmp)==FAILURE) {
*result=(double)0;
return FAILURE;

Loading…
Cancel
Save