@@ -412,7 +412,7 @@ static zend_string *accel_find_interned_string(zend_string *str)
412
412
}
413
413
414
414
if (!ZCG (counted )) {
415
- if (accel_activate_add () == FAILURE ) {
415
+ if (! ZCG ( accelerator_enabled ) || accel_activate_add () == FAILURE ) {
416
416
return str ;
417
417
}
418
418
ZCG (counted ) = 1 ;
@@ -1070,7 +1070,7 @@ char *accel_make_persistent_key(const char *path, int path_length, int *key_len)
1070
1070
cwd_len = ZSTR_LEN (cwd_str );
1071
1071
if (ZCG (cwd_check )) {
1072
1072
ZCG (cwd_check ) = 0 ;
1073
- if (( ZCG (counted ) || ZCSG ( accelerator_enabled ) )) {
1073
+ if (ZCG (accelerator_enabled )) {
1074
1074
1075
1075
zend_string * str = accel_find_interned_string (cwd_str );
1076
1076
if (!str ) {
@@ -1110,7 +1110,7 @@ char *accel_make_persistent_key(const char *path, int path_length, int *key_len)
1110
1110
1111
1111
if (ZCG (include_path_check )) {
1112
1112
ZCG (include_path_check ) = 0 ;
1113
- if (( ZCG (counted ) || ZCSG ( accelerator_enabled ) )) {
1113
+ if (ZCG (accelerator_enabled )) {
1114
1114
1115
1115
zend_string * str = accel_find_interned_string (ZCG (include_path ));
1116
1116
if (!str ) {
@@ -1193,7 +1193,7 @@ int zend_accel_invalidate(const char *filename, int filename_len, zend_bool forc
1193
1193
zend_string * realpath ;
1194
1194
zend_persistent_script * persistent_script ;
1195
1195
1196
- if (!ZCG (enabled ) || ! accel_startup_ok || ! ZCSG ( accelerator_enabled ) || accelerator_shm_read_lock () != SUCCESS ) {
1196
+ if (!ZCG (accelerator_enabled ) || accelerator_shm_read_lock () != SUCCESS ) {
1197
1197
return FAILURE ;
1198
1198
}
1199
1199
@@ -1764,7 +1764,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
1764
1764
} else if (file_cache_only ) {
1765
1765
return file_cache_compile_file (file_handle , type );
1766
1766
#endif
1767
- } else if (( !ZCG (counted ) && ! ZCSG ( accelerator_enabled ) ) ||
1767
+ } else if (!ZCG (accelerator_enabled ) ||
1768
1768
(ZCSG (restart_in_progress ) && accel_restart_is_active ())) {
1769
1769
#ifdef HAVE_OPCACHE_FILE_CACHE
1770
1770
if (ZCG (accel_directives ).file_cache ) {
@@ -2059,12 +2059,11 @@ static int persistent_stream_open_function(const char *filename, zend_file_handl
2059
2059
/* zend_resolve_path() replacement for PHP 5.3 and above */
2060
2060
static zend_string * persistent_zend_resolve_path (const char * filename , int filename_len )
2061
2061
{
2062
- if (ZCG ( enabled ) && accel_startup_ok &&
2062
+ if (
2063
2063
#ifdef HAVE_OPCACHE_FILE_CACHE
2064
2064
!file_cache_only &&
2065
2065
#endif
2066
- (ZCG (counted ) || ZCSG (accelerator_enabled )) &&
2067
- !ZCSG (restart_in_progress )) {
2066
+ ZCG (accelerator_enabled )) {
2068
2067
2069
2068
/* check if callback is called from include_once or it's a main request */
2070
2069
if ((!EG (current_execute_data ) &&
@@ -2213,6 +2212,7 @@ static void accel_activate(void)
2213
2212
zend_alter_ini_entry_chars (key , "0" , 1 , ZEND_INI_SYSTEM , ZEND_INI_STAGE_RUNTIME );
2214
2213
zend_string_release (key );
2215
2214
zend_accel_error (ACCEL_LOG_WARNING , "Can't cache files in chroot() directory with too big inode" );
2215
+ ZCG (accelerator_enabled ) = 0 ;
2216
2216
return ;
2217
2217
}
2218
2218
}
@@ -2270,12 +2270,15 @@ static void accel_activate(void)
2270
2270
}
2271
2271
accel_restart_leave ();
2272
2272
}
2273
- } else {
2273
+ }
2274
+ if (!ZCG (pcre_reseted )) {
2274
2275
reset_pcre = 1 ;
2275
2276
}
2276
2277
zend_shared_alloc_unlock ();
2277
2278
}
2278
2279
2280
+ ZCG (accelerator_enabled ) = ZCSG (accelerator_enabled );
2281
+
2279
2282
SHM_PROTECT ();
2280
2283
HANDLE_UNBLOCK_INTERRUPTIONS ();
2281
2284
@@ -2287,8 +2290,10 @@ static void accel_activate(void)
2287
2290
realpath_cache_clean ();
2288
2291
2289
2292
accel_reset_pcre_cache ();
2293
+ ZCG (pcre_reseted ) = 0 ;
2290
2294
} else if (reset_pcre ) {
2291
2295
accel_reset_pcre_cache ();
2296
+ ZCG (pcre_reseted ) = 1 ;
2292
2297
}
2293
2298
}
2294
2299
@@ -2316,10 +2321,6 @@ static void accel_deactivate(void)
2316
2321
zend_string_release (ZCG (cwd ));
2317
2322
ZCG (cwd ) = NULL ;
2318
2323
}
2319
-
2320
- if (!ZCG (enabled ) || !accel_startup_ok ) {
2321
- return ;
2322
- }
2323
2324
}
2324
2325
2325
2326
static int accelerator_remove_cb (zend_extension * element1 , zend_extension * element2 )
0 commit comments