diff --git a/ext/standard/info.c b/ext/standard/info.c
index bfafc1d558c..0b0a2b36de8 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -48,7 +48,7 @@ ZEND_EXTERN_MODULE_GLOBALS(mbstring)
ZEND_EXTERN_MODULE_GLOBALS(iconv)
#endif
-#define SECTION(name) if (PG(html_errors)) { \
+#define SECTION(name) if (!sapi_module.phpinfo_as_text) { \
PUTS("
" name "
\n"); \
} else { \
php_info_print_table_start(); \
@@ -66,7 +66,7 @@ static int _display_module_info(zend_module_entry *module, void *arg TSRMLS_DC)
int show_info_func = *((int *) arg);
if (show_info_func && module->info_func) {
- if (PG(html_errors)) {
+ if (!sapi_module.phpinfo_as_text) {
php_printf("\n", module->name, module->name);
} else {
php_info_print_table_start();
@@ -75,7 +75,7 @@ static int _display_module_info(zend_module_entry *module, void *arg TSRMLS_DC)
}
module->info_func(module TSRMLS_CC);
} else if (!show_info_func && !module->info_func) {
- if (PG(html_errors)) {
+ if (!sapi_module.phpinfo_as_text) {
php_printf("");
php_printf("| ");
php_printf("%s", module->name);
@@ -105,7 +105,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
&& (Z_TYPE_PP(data)==IS_ARRAY)) {
zend_hash_internal_pointer_reset(Z_ARRVAL_PP(data));
while (zend_hash_get_current_data(Z_ARRVAL_PP(data), (void **) &tmp) == SUCCESS) {
- if (PG(html_errors)) {
+ if (!sapi_module.phpinfo_as_text) {
PUTS(" |
");
PUTS("| ");
@@ -116,7 +116,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
switch (zend_hash_get_current_key_ex(Z_ARRVAL_PP(data), &string_key, &string_len, &num_key, 0, NULL)) {
case HASH_KEY_IS_STRING:
- if (PG(html_errors)) {
+ if (!sapi_module.phpinfo_as_text) {
elem_esc = php_info_html_esc(string_key TSRMLS_CC);
PUTS(elem_esc);
efree(elem_esc);
@@ -129,24 +129,24 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
break;
}
PUTS("\"]");
- if (PG(html_errors)) {
+ if (!sapi_module.phpinfo_as_text) {
PUTS(" | ");
} else {
PUTS(" => ");
}
if (Z_TYPE_PP(tmp) == IS_ARRAY) {
- if (PG(html_errors)) {
+ if (!sapi_module.phpinfo_as_text) {
PUTS("");
}
zend_print_zval_r(*tmp, 0 TSRMLS_CC);
- if (PG(html_errors)) {
+ if (!sapi_module.phpinfo_as_text) {
PUTS("");
}
} else if (Z_TYPE_PP(tmp) != IS_STRING) {
tmp2 = **tmp;
zval_copy_ctor(&tmp2);
convert_to_string(&tmp2);
- if (PG(html_errors)) {
+ if (!sapi_module.phpinfo_as_text) {
if (Z_STRLEN(tmp2) == 0) {
PUTS("no value");
} else {
@@ -159,7 +159,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
}
zval_dtor(&tmp2);
} else {
- if (PG(html_errors)) {
+ if (!sapi_module.phpinfo_as_text) {
if (Z_STRLEN_PP(tmp) == 0) {
PUTS("no value");
} else {
@@ -171,7 +171,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
PUTS(Z_STRVAL_PP(tmp));
}
}
- if (PG(html_errors)) {
+ if (!sapi_module.phpinfo_as_text) {
PUTS(" |
\n");
} else {
PUTS("\n");
@@ -391,7 +391,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
the_time = time(NULL);
ta = php_localtime_r(&the_time, &tmbuf);
- if (PG(html_errors)) {
+ if (!sapi_module.phpinfo_as_text) {
php_print_info_htmlhead(TSRMLS_C);
} else {
PUTS("phpinfo()\n");
@@ -403,11 +403,11 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
php_uname = php_get_uname('a');
- if (PG(html_errors)) {
+ if (!sapi_module.phpinfo_as_text) {
php_info_print_box_start(1);
}
- if (expose_php && PG(html_errors)) {
+ if (expose_php && !sapi_module.phpinfo_as_text) {
PUTS("
PHP Version %s\n", PHP_VERSION);
} else {
php_info_print_table_row(2, "PHP Version", PHP_VERSION);
@@ -505,7 +505,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
/* Zend Engine */
php_info_print_box_start(0);
- if (expose_php && PG(html_errors)) {
+ if (expose_php && !sapi_module.phpinfo_as_text) {
PUTS("
\n");
}
PUTS("This program makes use of the Zend Scripting Language Engine:");
- PUTS(PG(html_errors)?"
":"\n");
+ PUTS(!sapi_module.phpinfo_as_text?"
":"\n");
zend_html_puts(zend_version, strlen(zend_version) TSRMLS_CC);
php_info_print_box_end();
efree(php_uname);
}
- if ((flag & PHP_INFO_CREDITS) && expose_php && PG(html_errors)) {
+ if ((flag & PHP_INFO_CREDITS) && expose_php && !sapi_module.phpinfo_as_text) {
php_info_print_hr();
PUTS("\n");
} else {
SECTION("Configuration");
@@ -613,7 +613,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
}
if (flag & PHP_INFO_LICENSE) {
- if (PG(html_errors)) {
+ if (!sapi_module.phpinfo_as_text) {
SECTION("PHP License");
php_info_print_box_start(0);
PUTS("\n");
@@ -645,7 +645,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
PUTS("questions about PHP licensing, please contact license@php.net.\n");
}
}
- if (PG(html_errors)) {
+ if (!sapi_module.phpinfo_as_text) {
PUTS("