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);
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;
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;
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);
#include "zend_constants.h"
#include "zend_ini_scanner.h"
#include "zend_extensions.h"
-#include "SAPI.h"
#define YYSTYPE zval
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);
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