mike                                     Tue, 31 Jan 2012 10:47:21 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=322966

Log:
fix usage of php_output_(de)activate; I guess this code doesn't bother about 
one more hack;

Changed paths:
    U   php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
    U   php/php-src/trunk/sapi/cli/php_cli_server.c

Modified: php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
===================================================================
--- php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c      2012-01-31 
10:47:11 UTC (rev 322965)
+++ php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c      2012-01-31 
10:47:21 UTC (rev 322966)
@@ -1755,11 +1755,22 @@
                int err = 0;
                zval *style = NULL;
                zend_try {
+                       if (!SG(sapi_started)) {
+                               php_output_activate(TSRMLS_C);
+                       }
                        php_output_start_user(NULL, 0, 
PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC);
                        php_info_print_style(TSRMLS_C);
                        MAKE_STD_ZVAL(style);
                        php_output_get_contents(style TSRMLS_CC);
                        php_output_discard(TSRMLS_C);
+                       if (!SG(sapi_started)) {
+                               static int 
(*send_header_func)(sapi_headers_struct * TSRMLS_DC);
+                               send_header_func = sapi_module.send_headers;
+                               /* we don't want the header to be sent now */
+                               sapi_module.send_headers = 
sapi_cli_server_discard_headers;
+                               php_output_deactivate(TSRMLS_C);
+                               sapi_module.send_headers = send_header_func;
+                       }
                        if (style && Z_STRVAL_P(style)) {
                                char *block = pestrndup(Z_STRVAL_P(style), 
Z_STRLEN_P(style), 1);
                                php_cli_server_chunk *chunk = 
php_cli_server_chunk_heap_new(block, block, Z_STRLEN_P(style));

Modified: php/php-src/trunk/sapi/cli/php_cli_server.c
===================================================================
--- php/php-src/trunk/sapi/cli/php_cli_server.c 2012-01-31 10:47:11 UTC (rev 
322965)
+++ php/php-src/trunk/sapi/cli/php_cli_server.c 2012-01-31 10:47:21 UTC (rev 
322966)
@@ -1755,11 +1755,22 @@
                int err = 0;
                zval *style = NULL;
                zend_try {
+                       if (!SG(sapi_started)) {
+                               php_output_activate(TSRMLS_C);
+                       }
                        php_output_start_user(NULL, 0, 
PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC);
                        php_info_print_style(TSRMLS_C);
                        MAKE_STD_ZVAL(style);
                        php_output_get_contents(style TSRMLS_CC);
                        php_output_discard(TSRMLS_C);
+                       if (!SG(sapi_started)) {
+                               static int 
(*send_header_func)(sapi_headers_struct * TSRMLS_DC);
+                               send_header_func = sapi_module.send_headers;
+                               /* we don't want the header to be sent now */
+                               sapi_module.send_headers = 
sapi_cli_server_discard_headers;
+                               php_output_deactivate(TSRMLS_C);
+                               sapi_module.send_headers = send_header_func;
+                       }
                        if (style && Z_STRVAL_P(style)) {
                                char *block = pestrndup(Z_STRVAL_P(style), 
Z_STRLEN_P(style), 1);
                                php_cli_server_chunk *chunk = 
php_cli_server_chunk_heap_new(block, block, Z_STRLEN_P(style));

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to