cvs: php4 /main main.c php_main.h

From: Date: Thu, 26 Oct 2000 21:16:13 +0000
Subject: cvs: php4 /main main.c php_main.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-2281@lists.php.net to get a copy of this message
sas Thu Oct 26 14:16:13 2000 EDT Modified files: /php4/main main.c php_main.h Log: Move some code to php_handle_special_queries(). Index: php4/main/main.c diff -u php4/main/main.c:1.327 php4/main/main.c:1.328 --- php4/main/main.c:1.327 Thu Oct 26 11:32:38 2000 +++ php4/main/main.c Thu Oct 26 14:16:12 2000 @@ -19,7 +19,7 @@ */ -/* $Id: main.c,v 1.327 2000/10/26 18:32:38 sas Exp $ */ +/* $Id: main.c,v 1.328 2000/10/26 21:16:12 sas Exp $ */ #include <stdio.h> @@ -1133,33 +1133,39 @@ #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'; Index: php4/main/php_main.h diff -u php4/main/php_main.h:1.3 php4/main/php_main.h:1.4 --- php4/main/php_main.h:1.3 Sat Jul 29 03:48:57 2000 +++ php4/main/php_main.h Thu Oct 26 14:16:12 2000 @@ -18,7 +18,7 @@ */ -/* $Id: php_main.h,v 1.3 2000/07/29 10:48:57 zeev Exp $ */ +/* $Id: php_main.h,v 1.4 2000/10/26 21:16:12 sas Exp $ */ #ifndef PHP_MAIN_H @@ -41,6 +41,7 @@ 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);

« previous php.cvs (#2281) next »