]> granicus.if.org Git - php/commitdiff
Remove old apache_hooks occurrence
authorPeter Kokot <peterkokot@gmail.com>
Thu, 5 Oct 2017 17:07:28 +0000 (19:07 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Sun, 8 Oct 2017 15:49:24 +0000 (17:49 +0200)
The apache_hooks SAPI has been removed since PHP >= 7.0 and there is no
need to have two different php_request_startup definitions.

Also php_request_startup_for_hook() and php_request_shutdown_for_hook() functions
are not used in the PHP source code directly anymore. They are out of sync and
are not touched when making changes to the shutdown sequence.

The php_start_sapi() function was therefore not used anymore and is
removed.

main/main.c
main/php_main.h

index e4c97f686dfac8a5fad8704a9d461b88a444c5ec..dfa33789137e366c07ee999105718125d2313628 100644 (file)
@@ -1590,39 +1590,8 @@ static void sigchld_handler(int apar)
 /* }}} */
 #endif
 
-/* {{{ php_start_sapi()
- */
-static int php_start_sapi(void)
-{
-       int retval = SUCCESS;
-
-       if(!SG(sapi_started)) {
-               zend_try {
-                       PG(during_request_startup) = 1;
-
-                       /* initialize global variables */
-                       PG(modules_activated) = 0;
-                       PG(header_is_being_sent) = 0;
-                       PG(connection_status) = PHP_CONNECTION_NORMAL;
-
-                       zend_activate();
-                       zend_set_timeout(EG(timeout_seconds), 1);
-                       zend_activate_modules();
-                       PG(modules_activated)=1;
-               } zend_catch {
-                       retval = FAILURE;
-               } zend_end_try();
-
-               SG(sapi_started) = 1;
-       }
-       return retval;
-}
-
-/* }}} */
-
 /* {{{ php_request_startup
  */
-#ifndef APACHE_HOOKS
 int php_request_startup(void)
 {
        int retval = SUCCESS;
@@ -1702,61 +1671,6 @@ int php_request_startup(void)
 
        return retval;
 }
-# else
-int php_request_startup(void)
-{
-       int retval = SUCCESS;
-
-       zend_interned_strings_activate();
-
-#if PHP_SIGCHILD
-       signal(SIGCHLD, sigchld_handler);
-#endif
-
-       if (php_start_sapi() == FAILURE) {
-               return FAILURE;
-       }
-
-       php_output_activate();
-       sapi_activate();
-       php_hash_environment();
-
-       zend_try {
-               PG(during_request_startup) = 1;
-               if (PG(expose_php)) {
-                       sapi_add_header(SAPI_PHP_VERSION_HEADER, sizeof(SAPI_PHP_VERSION_HEADER)-1, 1);
-               }
-       } zend_catch {
-               retval = FAILURE;
-       } zend_end_try();
-
-       return retval;
-}
-# endif
-/* }}} */
-
-/* {{{ php_request_startup_for_hook
- */
-int php_request_startup_for_hook(void)
-{
-       int retval = SUCCESS;
-
-       zend_interned_strings_activate();
-
-#if PHP_SIGCHLD
-       signal(SIGCHLD, sigchld_handler);
-#endif
-
-       if (php_start_sapi() == FAILURE) {
-               return FAILURE;
-       }
-
-       php_output_activate();
-       sapi_activate_headers_only();
-       php_hash_environment();
-
-       return retval;
-}
 /* }}} */
 
 /* {{{ php_request_shutdown_for_exec
@@ -1771,60 +1685,6 @@ void php_request_shutdown_for_exec(void *dummy)
 }
 /* }}} */
 
-/* {{{ php_request_shutdown_for_hook
- */
-void php_request_shutdown_for_hook(void *dummy)
-{
-
-       if (PG(modules_activated)) zend_try {
-               php_call_shutdown_functions();
-       } zend_end_try();
-
-       if (PG(modules_activated)) {
-               zend_deactivate_modules();
-       }
-
-       if (PG(modules_activated)) {
-               php_free_shutdown_functions();
-       }
-
-       zend_try {
-               zend_unset_timeout();
-       } zend_end_try();
-
-       zend_try {
-               int i;
-
-               for (i = 0; i < NUM_TRACK_VARS; i++) {
-                       zval_ptr_dtor(&PG(http_globals)[i]);
-               }
-       } zend_end_try();
-
-       zend_deactivate();
-
-       zend_try {
-               sapi_deactivate();
-       } zend_end_try();
-
-       zend_try {
-               php_shutdown_stream_hashes();
-       } zend_end_try();
-
-       zend_interned_strings_deactivate();
-
-       zend_try {
-               shutdown_memory_manager(CG(unclean_shutdown), 0);
-       } zend_end_try();
-
-#ifdef ZEND_SIGNALS
-       zend_try {
-               zend_signal_deactivate();
-       } zend_end_try();
-#endif
-}
-
-/* }}} */
-
 /* {{{ php_request_shutdown
  */
 void php_request_shutdown(void *dummy)
index ff342a1f38c38c3d968e8a9df166989d8f406c67..539f9e745620d8afed6ac0405f4a53df4dab7702 100644 (file)
@@ -34,8 +34,6 @@ PHPAPI int php_module_startup(sapi_module_struct *sf, zend_module_entry *additio
 PHPAPI void php_module_shutdown(void);
 PHPAPI void php_module_shutdown_for_exec(void);
 PHPAPI int php_module_shutdown_wrapper(sapi_module_struct *sapi_globals);
-PHPAPI int php_request_startup_for_hook(void);
-PHPAPI void php_request_shutdown_for_hook(void *dummy);
 
 PHPAPI int php_register_extensions(zend_module_entry **ptr, int count);