]> granicus.if.org Git - php/commitdiff
Fixed bug #65338 (Enabling both php_opcache and php_wincache AVs on shutdown).
authorDmitry Stogov <dmitry@zend.com>
Tue, 30 Jul 2013 13:35:19 +0000 (17:35 +0400)
committerDmitry Stogov <dmitry@zend.com>
Tue, 30 Jul 2013 13:35:19 +0000 (17:35 +0400)
NEWS
ext/opcache/ZendAccelerator.c
ext/opcache/ZendAccelerator.h
ext/opcache/zend_accelerator_module.c

diff --git a/NEWS b/NEWS
index 57b523eb3a14805ed7158f2345f2fac35f9cc1f3..d21126d45a14b65fb3440727255aa49e665dd449 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,10 @@ PHP                                                                        NEWS
   . Fixed bug #65291 (get_defined_constants() causes PHP to crash in a very
     limited case). (Arpad)
 
+- OPcahce:
+  . Fixed bug #65338 (Enabling both php_opcache and php_wincache AVs on
+    shutdown). (Dmitry)
+
 - PDO_mysql:
   . Fixed bug #65299 (pdo mysql parsing errors). (Johannes)
 
index 76a33206ec90a4f5834e8bc8982fe72364bec48c..b5474c050761d5ceef242ee6540badbd243eda12 100644 (file)
@@ -2656,12 +2656,9 @@ static void accel_free_ts_resources()
 #endif
 }
 
-static void accel_shutdown(zend_extension *extension)
+void accel_shutdown(TSRMLS_D)
 {
        zend_ini_entry *ini_entry;
-       TSRMLS_FETCH();
-
-       (void)extension; /* keep the compiler happy */
 
        zend_accel_blacklist_shutdown(&accel_blacklist);
 
@@ -2679,6 +2676,11 @@ static void accel_shutdown(zend_extension *extension)
        }
 
 #if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO
+# ifndef ZTS
+       zend_hash_clean(CG(function_table));
+       zend_hash_clean(CG(class_table));
+       zend_hash_clean(EG(zend_constants));
+# endif
        CG(interned_strings_start) = orig_interned_strings_start;
        CG(interned_strings_end) = orig_interned_strings_end;
        zend_new_interned_string = orig_new_interned_string;
@@ -2768,7 +2770,7 @@ ZEND_EXT_API zend_extension zend_extension_entry = {
        "http://www.zend.com/",                                 /* URL */
        "Copyright (c) 1999-2013",                              /* copyright */
        accel_startup,                                                  /* startup */
-       accel_shutdown,                                                 /* shutdown */
+       NULL,                                                                   /* shutdown */
        accel_activate,                                                 /* per-script activation */
        accel_deactivate,                                               /* per-script deactivation */
        NULL,                                                                   /* message handler */
index 5f414f2bda32e112a30a806d70b32748d500bcbe..57e2e7a0c5d73662030e939d54572e1eab799575 100644 (file)
@@ -316,6 +316,7 @@ extern zend_accel_globals accel_globals;
 
 extern char *zps_api_failure_reason;
 
+void accel_shutdown(TSRMLS_D);
 void zend_accel_schedule_restart(zend_accel_restart_reason reason TSRMLS_DC);
 void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason TSRMLS_DC);
 int  zend_accel_invalidate(const char *filename, int filename_len, zend_bool force TSRMLS_DC);
index fa4e3d85b78dbeca2a944c505fab8d7e8ac8e493..2287d1353ced0d8d42ab3926dd04c889f42949e5 100644 (file)
@@ -378,6 +378,7 @@ static ZEND_MSHUTDOWN_FUNCTION(zend_accelerator)
        (void)type; /* keep the compiler happy */
 
        UNREGISTER_INI_ENTRIES();
+       accel_shutdown(TSRMLS_C);
        return SUCCESS;
 }