From: Zeev Suraski Date: Sun, 5 Sep 2004 22:40:35 +0000 (+0000) Subject: Fix reverse dependency X-Git-Tag: PRE_ZEND_VM_DISPATCH_PATCH~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=85a36e2bc3c5ab9d838a4ca6eb4631676a6ae00a;p=php Fix reverse dependency --- diff --git a/Zend/zend.c b/Zend/zend.c index 36c13586ef..80fa7f2367 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -55,6 +55,7 @@ ZEND_API void (*zend_unblock_interruptions)(void); ZEND_API void (*zend_ticks_function)(int ticks); ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args); int (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap); +ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC); void (*zend_on_timeout)(int seconds TSRMLS_DC); @@ -577,6 +578,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i zend_ticks_function = utility_functions->ticks_function; zend_on_timeout = utility_functions->on_timeout; zend_vspprintf = utility_functions->vspprintf_function; + zend_getenv = utility_functions->getenv_function; zend_compile_file = compile_file; zend_execute = execute; diff --git a/Zend/zend.h b/Zend/zend.h index bfdbb312b4..4039160a95 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -357,6 +357,7 @@ typedef struct _zend_utility_functions { void (*on_timeout)(int seconds TSRMLS_DC); int (*stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC); int (*vspprintf_function)(char **pbuf, size_t max_len, const char *format, va_list ap); + char *(*getenv_function)(char *name, size_t name_len TSRMLS_DC); } zend_utility_functions; @@ -492,6 +493,7 @@ extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, cons extern void (*zend_on_timeout)(int seconds TSRMLS_DC); extern ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC); extern int (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap); +extern ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC); ZEND_API void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y index d691664985..255fc333f0 100644 --- a/Zend/zend_ini_parser.y +++ b/Zend/zend_ini_parser.y @@ -26,7 +26,6 @@ #include "zend_constants.h" #include "zend_ini_scanner.h" #include "zend_extensions.h" -#include "SAPI.h" #define YYSTYPE zval @@ -140,7 +139,7 @@ void zend_ini_get_var(zval *result, zval *name) if (zend_get_configuration_directive(name->value.str.val, name->value.str.len+1, &curval) == SUCCESS) { result->value.str.val = zend_strndup(curval.value.str.val, curval.value.str.len); result->value.str.len = curval.value.str.len; - } else if ((envvar = sapi_getenv(name->value.str.val, name->value.str.len TSRMLS_CC)) != NULL || + } else if ((envvar = zend_getenv(name->value.str.val, name->value.str.len TSRMLS_CC)) != NULL || (envvar = getenv(name->value.str.val)) != NULL) { result->value.str.val = strdup(envvar); result->value.str.len = strlen(envvar); diff --git a/main/main.c b/main/main.c index 4bcc72794d..f1080f62cf 100644 --- a/main/main.c +++ b/main/main.c @@ -1339,6 +1339,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod zuf.on_timeout = php_on_timeout; zuf.stream_open_function = php_stream_open_for_zend; zuf.vspprintf_function = vspprintf; + zuf.getenv_function = sapi_getenv; zend_startup(&zuf, NULL, 1); #ifdef ZTS