Skip to content

Commit 40f463b

Browse files
committed
Backport 91a6cdb
1 parent f1a8138 commit 40f463b

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
@@ -1761,11 +1761,15 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
17611761
int key_length;
17621762
int from_shared_memory; /* if the script we've got is stored in SHM */
17631763

1764-
if (!file_handle->filename || !ZCG(enabled) || !accel_startup_ok) {
1764+
if (!file_handle->filename || !ZCG(accelerator_enabled)) {
17651765
/* The Accelerator is disabled, act as if without the Accelerator */
1766+
ZCG(cache_opline) = NULL;
1767+
ZCG(cache_persistent_script) = NULL;
17661768
return accelerator_orig_compile_file(file_handle, type);
17671769
#ifdef HAVE_OPCACHE_FILE_CACHE
17681770
} else if (file_cache_only) {
1771+
ZCG(cache_opline) = NULL;
1772+
ZCG(cache_persistent_script) = NULL;
17691773
return file_cache_compile_file(file_handle, type);
17701774
#endif
17711775
} else if (!ZCG(accelerator_enabled) ||
@@ -1775,6 +1779,8 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
17751779
return file_cache_compile_file(file_handle, type);
17761780
}
17771781
#endif
1782+
ZCG(cache_opline) = NULL;
1783+
ZCG(cache_persistent_script) = NULL;
17781784
return accelerator_orig_compile_file(file_handle, type);
17791785
}
17801786

@@ -1801,10 +1807,14 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
18011807
/* try to find cached script by key */
18021808
key = accel_make_persistent_key(file_handle->filename, strlen(file_handle->filename), &key_length);
18031809
if (!key) {
1810+
ZCG(cache_opline) = NULL;
1811+
ZCG(cache_persistent_script) = NULL;
18041812
return accelerator_orig_compile_file(file_handle, type);
18051813
}
18061814
persistent_script = zend_accel_hash_str_find(&ZCSG(hash), key, key_length);
18071815
} else if (UNEXPECTED(is_stream_path(file_handle->filename) && !is_cacheable_stream_path(file_handle->filename))) {
1816+
ZCG(cache_opline) = NULL;
1817+
ZCG(cache_persistent_script) = NULL;
18081818
return accelerator_orig_compile_file(file_handle, type);
18091819
}
18101820

0 commit comments

Comments
 (0)