]> granicus.if.org Git - php/commitdiff
Fixed bug #71024 Unable to use PHP 7.0 x64 side-by-side with PHP 5.6 x32 on the same...
authorAnatol Belski <ab@php.net>
Mon, 7 Dec 2015 21:52:51 +0000 (22:52 +0100)
committerAnatol Belski <ab@php.net>
Mon, 7 Dec 2015 21:53:35 +0000 (22:53 +0100)
ext/opcache/ZendAccelerator.c
ext/opcache/ZendAccelerator.h
ext/opcache/shared_alloc_win32.c

index 39d2b4c59095631b4a764facddd59c080358e116..cc4273c6bada10bcf34d428ea60359661ab84017 100644 (file)
@@ -2459,8 +2459,6 @@ static void accel_globals_dtor(zend_accel_globals *accel_globals)
        }
 }
 
-#ifdef HAVE_OPCACHE_FILE_CACHE
-
 #define ZEND_BIN_ID "BIN_" ZEND_TOSTR(SIZEOF_CHAR) ZEND_TOSTR(SIZEOF_INT) ZEND_TOSTR(SIZEOF_LONG) ZEND_TOSTR(SIZEOF_SIZE_T) ZEND_TOSTR(SIZEOF_ZEND_LONG) ZEND_TOSTR(ZEND_MM_ALIGNMENT)
 
 static void accel_gen_system_id(void)
@@ -2489,7 +2487,6 @@ static void accel_gen_system_id(void)
                md5str[(i * 2) + 1] = c;
        }
 }
-#endif
 
 #ifdef HAVE_HUGE_CODE_PAGES
 # ifndef _WIN32
@@ -2619,9 +2616,7 @@ static int accel_startup(zend_extension *extension)
                return FAILURE;
        }
 
-#ifdef HAVE_OPCACHE_FILE_CACHE
        accel_gen_system_id();
-#endif
 
 #ifdef HAVE_HUGE_CODE_PAGES
        if (ZCG(accel_directives).huge_code_pages &&
index 798b2d7365d06c4a2edd28a3681768409ecc2048..083c0d91e86779e3521276944af943c0087bda84 100644 (file)
@@ -251,9 +251,7 @@ typedef struct _zend_accel_globals {
        int                     auto_globals_mask;
        time_t                  request_time;
        time_t                  last_restart_time; /* used to synchronize SHM and in-process caches */
-#ifdef HAVE_OPCACHE_FILE_CACHE
        char                    system_id[32];
-#endif
        HashTable               xlat_table;
        /* preallocated shared-memory block to save current script */
        void                   *mem;
index ce4bacf348d60c4cbd978c5fe46d23f75311cf50..9465a6d3319134ff9063b34d47b0f3ded90d73f5 100644 (file)
@@ -76,18 +76,18 @@ static void zend_win_error_message(int type, char *msg, int err)
 
 static char *create_name_with_username(char *name)
 {
-       static char newname[MAXPATHLEN + UNLEN + 4];
+       static char newname[MAXPATHLEN + UNLEN + 4 + 1 + 32];
        char uname[UNLEN + 1];
        DWORD unsize = UNLEN;
 
        GetUserName(uname, &unsize);
-       snprintf(newname, sizeof(newname) - 1, "%s@%s", name, uname);
+       snprintf(newname, sizeof(newname) - 1, "%s@%s@%.32s", name, uname, ZCG(system_id));
        return newname;
 }
 
 static char *get_mmap_base_file(void)
 {
-       static char windir[MAXPATHLEN+UNLEN + 3 + sizeof("\\\\@")];
+       static char windir[MAXPATHLEN+UNLEN + 3 + sizeof("\\\\@") + 1 + 32];
        char uname[UNLEN + 1];
        DWORD unsize = UNLEN;
        int l;
@@ -95,7 +95,7 @@ static char *get_mmap_base_file(void)
        GetTempPath(MAXPATHLEN, windir);
        GetUserName(uname, &unsize);
        l = strlen(windir);
-       snprintf(windir + l, sizeof(windir) - l - 1, "\\%s@%s", ACCEL_FILEMAP_BASE, uname);
+       snprintf(windir + l, sizeof(windir) - l - 1, "\\%s@%s@%.32s", ACCEL_FILEMAP_BASE, uname, ZCG(system_id));
        return windir;
 }