cvs: php4 /ext/standard info.c /main main.c
| From: | Zeev Suraski | Date: | Mon, 13 May 2002 08:46:28 +0000 |
| Subject: | cvs: php4 /ext/standard info.c /main main.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-11894@lists.php.net to get a copy of this message | ||
zeev Mon May 13 04:46:28 2002 EDT
Modified files:
/php4/ext/standard info.c
/php4/main main.c
Log:
- Centralize html_puts() again
- Revolutionize phpinfo()'s speed
Index: php4/ext/standard/info.c
diff -u php4/ext/standard/info.c:1.178 php4/ext/standard/info.c:1.179
--- php4/ext/standard/info.c:1.178 Sun May 12 10:50:54 2002
+++ php4/ext/standard/info.c Mon May 13 04:46:21 2002
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: info.c,v 1.178 2002/05/12 14:50:54 sas Exp $ */
+/* $Id: info.c,v 1.179 2002/05/13 08:46:21 zeev Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -532,7 +532,10 @@
flag = PHP_INFO_ALL;
}
+ /* Andale! Andale! Yee-Hah! */
+ php_start_ob_buffer(NULL, 4096, 0 TSRMLS_CC);
php_print_info(flag TSRMLS_CC);
+ php_end_ob_buffer(1, 0 TSRMLS_CC);
RETURN_TRUE;
}
Index: php4/main/main.c
diff -u php4/main/main.c:1.455 php4/main/main.c:1.456
--- php4/main/main.c:1.455 Sun May 12 11:30:44 2002
+++ php4/main/main.c Mon May 13 04:46:24 2002
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: main.c,v 1.455 2002/05/12 15:30:44 sas Exp $ */
+/* $Id: main.c,v 1.456 2002/05/13 08:46:24 zeev Exp $ */
/* {{{ includes
*/
@@ -378,46 +378,9 @@
/* }}} */
/* {{{ php_html_puts */
-#include "ext/standard/php_smart_str.h"
-
PHPAPI void php_html_puts(const char *str, uint size TSRMLS_DC)
{
- const char *end = str+size;
- const char *p = str;
- smart_str s = {0};
-
- while (p < end) {
- switch (*p) {
- case '\n':
- smart_str_appendl(&s, "<br />", sizeof("<br />")-1);
- break;
- case '<':
- smart_str_appendl(&s, "<", sizeof("<")-1);
- break;
- case '>':
- smart_str_appendl(&s, ">", sizeof(">")-1);
- break;
- case '&':
- smart_str_appendl(&s, "&", sizeof("&")-1);
- break;
- case ' ':
- while (++p < end && *p == ' ');
-
- smart_str_appends(&s, " ");
- continue;
- case '\t':
- smart_str_appendl(&s, " ",
sizeof(" ")-1);
- break;
- default:
- smart_str_appendc(&s, *p);
- }
- p++;
- }
-
- if (s.c) {
- PHPWRITE(s.c, s.len);
- smart_str_free(&s);
- }
+ zend_html_puts(str, size);
}
/* }}} */