@@ -429,7 +429,7 @@ static zend_always_inline zend_string *accel_find_interned_string(zend_string *s
429
429
}
430
430
431
431
if (!ZCG (counted )) {
432
- if (accel_activate_add () == FAILURE ) {
432
+ if (! ZCG ( accelerator_enabled ) || accel_activate_add () == FAILURE ) {
433
433
return str ;
434
434
}
435
435
ZCG (counted ) = 1 ;
@@ -1145,7 +1145,7 @@ char *accel_make_persistent_key(const char *path, size_t path_length, int *key_l
1145
1145
cwd_len = ZSTR_LEN (cwd_str );
1146
1146
if (ZCG (cwd_check )) {
1147
1147
ZCG (cwd_check ) = 0 ;
1148
- if (( ZCG (counted ) || ZCSG ( accelerator_enabled ) )) {
1148
+ if (ZCG (accelerator_enabled )) {
1149
1149
1150
1150
zend_string * str = accel_find_interned_string (cwd_str );
1151
1151
if (!str ) {
@@ -1185,7 +1185,7 @@ char *accel_make_persistent_key(const char *path, size_t path_length, int *key_l
1185
1185
1186
1186
if (ZCG (include_path_check )) {
1187
1187
ZCG (include_path_check ) = 0 ;
1188
- if (( ZCG (counted ) || ZCSG ( accelerator_enabled ) )) {
1188
+ if (ZCG (accelerator_enabled )) {
1189
1189
1190
1190
zend_string * str = accel_find_interned_string (ZCG (include_path ));
1191
1191
if (!str ) {
@@ -1268,7 +1268,7 @@ int zend_accel_invalidate(const char *filename, size_t filename_len, zend_bool f
1268
1268
zend_string * realpath ;
1269
1269
zend_persistent_script * persistent_script ;
1270
1270
1271
- if (!ZCG (enabled ) || ! accel_startup_ok || ! ZCSG ( accelerator_enabled ) || accelerator_shm_read_lock () != SUCCESS ) {
1271
+ if (!ZCG (accelerator_enabled ) || accelerator_shm_read_lock () != SUCCESS ) {
1272
1272
return FAILURE ;
1273
1273
}
1274
1274
@@ -1872,7 +1872,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
1872
1872
return accelerator_orig_compile_file (file_handle , type );
1873
1873
} else if (file_cache_only ) {
1874
1874
return file_cache_compile_file (file_handle , type );
1875
- } else if (( !ZCG (counted ) && ! ZCSG ( accelerator_enabled ) ) ||
1875
+ } else if (!ZCG (accelerator_enabled ) ||
1876
1876
(ZCSG (restart_in_progress ) && accel_restart_is_active ())) {
1877
1877
if (ZCG (accel_directives ).file_cache ) {
1878
1878
return file_cache_compile_file (file_handle , type );
@@ -2159,10 +2159,8 @@ static int persistent_stream_open_function(const char *filename, zend_file_handl
2159
2159
/* zend_resolve_path() replacement for PHP 5.3 and above */
2160
2160
static zend_string * persistent_zend_resolve_path (const char * filename , size_t filename_len )
2161
2161
{
2162
- if (ZCG (enabled ) && accel_startup_ok &&
2163
- !file_cache_only &&
2164
- (ZCG (counted ) || ZCSG (accelerator_enabled )) &&
2165
- !ZCSG (restart_in_progress )) {
2162
+ if (!file_cache_only &&
2163
+ ZCG (accelerator_enabled )) {
2166
2164
2167
2165
/* check if callback is called from include_once or it's a main request */
2168
2166
if ((!EG (current_execute_data ) &&
@@ -2304,6 +2302,7 @@ int accel_activate(INIT_FUNC_ARGS)
2304
2302
zend_alter_ini_entry_chars (key , "0" , 1 , ZEND_INI_SYSTEM , ZEND_INI_STAGE_RUNTIME );
2305
2303
zend_string_release_ex (key , 0 );
2306
2304
zend_accel_error (ACCEL_LOG_WARNING , "Can't cache files in chroot() directory with too big inode" );
2305
+ ZCG (accelerator_enabled ) = 0 ;
2307
2306
return SUCCESS ;
2308
2307
}
2309
2308
}
@@ -2365,12 +2364,15 @@ int accel_activate(INIT_FUNC_ARGS)
2365
2364
}
2366
2365
accel_restart_leave ();
2367
2366
}
2368
- } else {
2367
+ }
2368
+ if (!ZCG (pcre_reseted )) {
2369
2369
reset_pcre = 1 ;
2370
2370
}
2371
2371
zend_shared_alloc_unlock ();
2372
2372
}
2373
2373
2374
+ ZCG (accelerator_enabled ) = ZCSG (accelerator_enabled );
2375
+
2374
2376
SHM_PROTECT ();
2375
2377
HANDLE_UNBLOCK_INTERRUPTIONS ();
2376
2378
@@ -2382,8 +2384,10 @@ int accel_activate(INIT_FUNC_ARGS)
2382
2384
realpath_cache_clean ();
2383
2385
2384
2386
accel_reset_pcre_cache ();
2387
+ ZCG (pcre_reseted ) = 0 ;
2385
2388
} else if (reset_pcre ) {
2386
2389
accel_reset_pcre_cache ();
2390
+ ZCG (pcre_reseted ) = 1 ;
2387
2391
}
2388
2392
2389
2393
0 commit comments