cvs: php4 /main php_ini.c

From: Date: Thu, 09 May 2002 21:18:27 +0000
Subject: cvs: php4 /main php_ini.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-11784@lists.php.net to get a copy of this message
pbannister Thu May 9 17:18:27 2002 EDT Modified files: /php4/main php_ini.c Log: Detect when running under IIS and default force_redirect to zero. This This means an explicit php.ini setting is no longer required. (NO extraneous whitespace changes this time (sigh)). Index: php4/main/php_ini.c diff -u php4/main/php_ini.c:1.88 php4/main/php_ini.c:1.89 --- php4/main/php_ini.c:1.88 Thu May 9 16:34:53 2002 +++ php4/main/php_ini.c Thu May 9 17:18:26 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_ini.c,v 1.88 2002/05/09 20:34:53 pbannister Exp $ */ +/* $Id: php_ini.c,v 1.89 2002/05/09 21:18:26 pbannister Exp $ */ #include "php.h" #ifndef PHP_WIN32 @@ -108,7 +108,7 @@ if (module) { module_number = module->module_number; - } else { + } else { module_number = 0; } php_info_print_table_start(); @@ -122,25 +122,25 @@ #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 @@ } 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 @@ 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 @@ 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 @@ efree(php_ini_opened_path); php_ini_opened_path = zend_strndup(Z_STRVAL(tmp), Z_STRLEN(tmp)); } - + return SUCCESS; } /* }}} */ @@ -344,7 +344,7 @@ 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_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;

« previous php.cvs (#11784) next »