php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #66471
Patch ZendOpcache-compatibility.patch revision 2014-01-12 13:53 UTC by Terry at ellisons dot org dot uk

Patch ZendOpcache-compatibility.patch for opcache Bug #66471

Patch version 2014-01-12 13:53 UTC

Return to Bug #66471 | Download this patch
Patch Revisions:

Developer: Terry@ellisons.org.uk

--- a/ZendAccelerator.c
+++ b/ZendAccelerator.c
@@ -36,7 +36,11 @@
 #include "main/php_open_temporary_file.h"
 #include "zend_API.h"
 #include "zend_ini.h"
+#if ZEND_EXTENSION_API_NO >= PHP_5_5_X_API_NO
 #include "zend_virtual_cwd.h"
+#else
+#include "TSRM/tsrm_virtual_cwd.h"
+#endif
 #include "zend_accelerator_util_funcs.h"
 #include "zend_accelerator_hash.h"
 
@@ -249,9 +253,9 @@ static ZEND_INI_MH(accel_include_path_on_modify)
 /* Interned strings support */
 static char *orig_interned_strings_start;
 static char *orig_interned_strings_end;
-#ifndef ZTS
+# if ZEND_EXTENSION_API_NO > PHP_5_5_X_API_NO && !defined(ZTS)
 static char *orig_interned_empty_string;
-#endif
+# endif
 static const char *(*orig_new_interned_string)(const char *str, int len, int free_src TSRMLS_DC);
 static void (*orig_interned_strings_snapshot)(TSRMLS_D);
 static void (*orig_interned_strings_restore)(TSRMLS_D);
@@ -391,8 +395,9 @@ static void accel_use_shm_interned_strings(TSRMLS_D)
        Bucket *p, *q;
 
        /* empty string */
+# if ZEND_EXTENSION_API_NO > PHP_5_5_X_API_NO
        CG(interned_empty_string) = accel_new_interned_string("", sizeof(""), 0 TSRMLS_CC);
-
+# endif
        /* function table hash keys */
        p = CG(function_table)->pListHead;
        while (p) {
@@ -2487,8 +2492,10 @@ static int zend_accel_init_shm(TSRMLS_D)
 # ifndef ZTS
        accel_use_shm_interned_strings(TSRMLS_C);
        accel_interned_strings_save_state(TSRMLS_C);
+#  if ZEND_EXTENSION_API_NO > PHP_5_5_X_API_NO
        orig_interned_empty_string = CG(interned_empty_string);
     CG(interned_empty_string) = accel_new_interned_string("", sizeof(""), 0 TSRMLS_CC);
+#  endif
 # endif
 
 #endif
@@ -2726,7 +2733,9 @@ void accel_shutdown(TSRMLS_D)
        zend_hash_clean(CG(function_table));
        zend_hash_clean(CG(class_table));
        zend_hash_clean(EG(zend_constants));
+#  if ZEND_EXTENSION_API_NO > PHP_5_5_X_API_NO
        CG(interned_empty_string) = orig_interned_empty_string;
+#  endif
 # endif
        CG(interned_strings_start) = orig_interned_strings_start;
        CG(interned_strings_end) = orig_interned_strings_end;

--- a/ZendAccelerator.h
+++ b/ZendAccelerator.h
@@ -302,7 +302,7 @@ typedef struct _zend_accel_shared_globals {
        char           *interned_strings_start;
        char           *interned_strings_top;
        char           *interned_strings_end;
-#ifndef ZTS
+#if ZEND_EXTENSION_API_NO > PHP_5_5_X_API_NO && !defined(ZTS)
        char           *interned_empty_string;
 #endif
        HashTable       interned_strings;

--- a/zend_accelerator_module.c
+++ b/zend_accelerator_module.c
@@ -28,7 +28,11 @@
 #include "zend_accelerator_blacklist.h"
 #include "php_ini.h"
 #include "SAPI.h"
+#if ZEND_EXTENSION_API_NO >= PHP_5_5_X_API_NO
 #include "zend_virtual_cwd.h"
+#else
+#include "TSRM/tsrm_virtual_cwd.h"
+#endif
 #include "ext/standard/info.h"
 #include "ext/standard/php_filestat.h"
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Nov 11 09:01:28 2024 UTC