Skip to content

Commit a5b39ab

Browse files
committed
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2: Backport 91a6cdb
2 parents 98457b6 + 40f463b commit a5b39ab

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1907,11 +1907,15 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
19071907
int key_length;
19081908
int from_shared_memory; /* if the script we've got is stored in SHM */
19091909

1910-
if (!file_handle->filename || !ZCG(enabled) || !accel_startup_ok) {
1910+
if (!file_handle->filename || !ZCG(accelerator_enabled)) {
19111911
/* The Accelerator is disabled, act as if without the Accelerator */
1912+
ZCG(cache_opline) = NULL;
1913+
ZCG(cache_persistent_script) = NULL;
19121914
return accelerator_orig_compile_file(file_handle, type);
19131915
#ifdef HAVE_OPCACHE_FILE_CACHE
19141916
} else if (file_cache_only) {
1917+
ZCG(cache_opline) = NULL;
1918+
ZCG(cache_persistent_script) = NULL;
19151919
return file_cache_compile_file(file_handle, type);
19161920
#endif
19171921
} else if (!ZCG(accelerator_enabled) ||
@@ -1921,6 +1925,8 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
19211925
return file_cache_compile_file(file_handle, type);
19221926
}
19231927
#endif
1928+
ZCG(cache_opline) = NULL;
1929+
ZCG(cache_persistent_script) = NULL;
19241930
return accelerator_orig_compile_file(file_handle, type);
19251931
}
19261932

@@ -1947,10 +1953,14 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
19471953
/* try to find cached script by key */
19481954
key = accel_make_persistent_key(file_handle->filename, strlen(file_handle->filename), &key_length);
19491955
if (!key) {
1956+
ZCG(cache_opline) = NULL;
1957+
ZCG(cache_persistent_script) = NULL;
19501958
return accelerator_orig_compile_file(file_handle, type);
19511959
}
19521960
persistent_script = zend_accel_hash_str_find(&ZCSG(hash), key, key_length);
19531961
} else if (UNEXPECTED(is_stream_path(file_handle->filename) && !is_cacheable_stream_path(file_handle->filename))) {
1962+
ZCG(cache_opline) = NULL;
1963+
ZCG(cache_persistent_script) = NULL;
19541964
return accelerator_orig_compile_file(file_handle, type);
19551965
}
19561966

0 commit comments

Comments
 (0)