From f367b3dfc803a55f4ecf804f98996d3a37b35441 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Thu, 26 Oct 2000 21:16:12 +0000 Subject: [PATCH] Move some code to php_handle_special_queries(). --- main/main.c | 28 +++++++++++++++++----------- main/php_main.h | 1 + 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/main/main.c b/main/main.c index 888bb9ec1b..79ed8812c2 100644 --- a/main/main.c +++ b/main/main.c @@ -1133,33 +1133,39 @@ static void php_build_argv(char *s, zval *track_vars_array ELS_DC PLS_DC) #include "logos.h" -PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_DC) +PHPAPI int php_handle_special_queries(SLS_D PLS_DC) { - zend_file_handle *prepend_file_p, *append_file_p; - zend_file_handle prepend_file, append_file; - char *old_cwd; - SLS_FETCH(); - - if (SG(request_info).query_string && SG(request_info).query_string[0]=='=' && PG(expose_php)) { if (!strcmp(SG(request_info).query_string+1, PHP_LOGO_GUID)) { sapi_add_header(CONTEXT_TYPE_IMAGE_GIF, sizeof(CONTEXT_TYPE_IMAGE_GIF)-1, 1); PHPWRITE(php_logo, sizeof(php_logo)); - return; + return 1; } else if (!strcmp(SG(request_info).query_string+1, PHP_EGG_LOGO_GUID)) { sapi_add_header(CONTEXT_TYPE_IMAGE_GIF, sizeof(CONTEXT_TYPE_IMAGE_GIF)-1, 1); PHPWRITE(php_egg_logo, sizeof(php_egg_logo)); - return; + return 1; } else if (!strcmp(SG(request_info).query_string+1, ZEND_LOGO_GUID)) { sapi_add_header(CONTEXT_TYPE_IMAGE_GIF, sizeof(CONTEXT_TYPE_IMAGE_GIF)-1, 1); PHPWRITE(zend_logo, sizeof(zend_logo)); - return; + return 1; } else if (!strcmp(SG(request_info).query_string+1, "PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000")) { php_print_credits(PHP_CREDITS_ALL); - return; + return 1; } } + return 0; +} + +PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_DC) +{ + zend_file_handle *prepend_file_p, *append_file_p; + zend_file_handle prepend_file, append_file; + char *old_cwd; + SLS_FETCH(); + + if (php_handle_special_queries(SLS_C PLS_CC)) + return; #define OLD_CWD_SIZE 4096 old_cwd = do_alloca(OLD_CWD_SIZE); old_cwd[0] = '\0'; diff --git a/main/php_main.h b/main/php_main.h index 6f0f0f2ae2..e0ad78b915 100644 --- a/main/php_main.h +++ b/main/php_main.h @@ -41,6 +41,7 @@ PHPAPI int php_global_startup_extensions(zend_module_entry **ptr, int count); PHPAPI int php_global_shutdown_extensions(zend_module_entry **ptr, int count); PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_DC); +PHPAPI int php_handle_special_queries(SLS_D PLS_DC); PHPAPI int php_lint_script(zend_file_handle *file CLS_DC ELS_DC PLS_DC); -- 2.40.0