@@ -438,7 +438,7 @@ static zend_always_inline zend_string *accel_find_interned_string(zend_string *s
438
438
}
439
439
440
440
if (!ZCG (counted )) {
441
- if (accel_activate_add () == FAILURE ) {
441
+ if (! ZCG ( accelerator_enabled ) || accel_activate_add () == FAILURE ) {
442
442
return str ;
443
443
}
444
444
ZCG (counted ) = 1 ;
@@ -1154,7 +1154,7 @@ char *accel_make_persistent_key(const char *path, size_t path_length, int *key_l
1154
1154
cwd_len = ZSTR_LEN (cwd_str );
1155
1155
if (ZCG (cwd_check )) {
1156
1156
ZCG (cwd_check ) = 0 ;
1157
- if (( ZCG (counted ) || ZCSG ( accelerator_enabled ) )) {
1157
+ if (ZCG (accelerator_enabled )) {
1158
1158
1159
1159
zend_string * str = accel_find_interned_string (cwd_str );
1160
1160
if (!str ) {
@@ -1194,7 +1194,7 @@ char *accel_make_persistent_key(const char *path, size_t path_length, int *key_l
1194
1194
1195
1195
if (ZCG (include_path_check )) {
1196
1196
ZCG (include_path_check ) = 0 ;
1197
- if (( ZCG (counted ) || ZCSG ( accelerator_enabled ) )) {
1197
+ if (ZCG (accelerator_enabled )) {
1198
1198
1199
1199
zend_string * str = accel_find_interned_string (ZCG (include_path ));
1200
1200
if (!str ) {
@@ -1277,7 +1277,7 @@ int zend_accel_invalidate(const char *filename, size_t filename_len, zend_bool f
1277
1277
zend_string * realpath ;
1278
1278
zend_persistent_script * persistent_script ;
1279
1279
1280
- if (!ZCG (enabled ) || ! accel_startup_ok || ! ZCSG ( accelerator_enabled ) || accelerator_shm_read_lock () != SUCCESS ) {
1280
+ if (!ZCG (accelerator_enabled ) || accelerator_shm_read_lock () != SUCCESS ) {
1281
1281
return FAILURE ;
1282
1282
}
1283
1283
@@ -1881,7 +1881,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
1881
1881
return accelerator_orig_compile_file (file_handle , type );
1882
1882
} else if (file_cache_only ) {
1883
1883
return file_cache_compile_file (file_handle , type );
1884
- } else if (( !ZCG (counted ) && ! ZCSG ( accelerator_enabled ) ) ||
1884
+ } else if (!ZCG (accelerator_enabled ) ||
1885
1885
(ZCSG (restart_in_progress ) && accel_restart_is_active ())) {
1886
1886
if (ZCG (accel_directives ).file_cache ) {
1887
1887
return file_cache_compile_file (file_handle , type );
@@ -2168,10 +2168,8 @@ static int persistent_stream_open_function(const char *filename, zend_file_handl
2168
2168
/* zend_resolve_path() replacement for PHP 5.3 and above */
2169
2169
static zend_string * persistent_zend_resolve_path (const char * filename , size_t filename_len )
2170
2170
{
2171
- if (ZCG (enabled ) && accel_startup_ok &&
2172
- !file_cache_only &&
2173
- (ZCG (counted ) || ZCSG (accelerator_enabled )) &&
2174
- !ZCSG (restart_in_progress )) {
2171
+ if (!file_cache_only &&
2172
+ ZCG (accelerator_enabled )) {
2175
2173
2176
2174
/* check if callback is called from include_once or it's a main request */
2177
2175
if ((!EG (current_execute_data ) &&
@@ -2313,6 +2311,7 @@ int accel_activate(INIT_FUNC_ARGS)
2313
2311
zend_alter_ini_entry_chars (key , "0" , 1 , ZEND_INI_SYSTEM , ZEND_INI_STAGE_RUNTIME );
2314
2312
zend_string_release_ex (key , 0 );
2315
2313
zend_accel_error (ACCEL_LOG_WARNING , "Can't cache files in chroot() directory with too big inode" );
2314
+ ZCG (accelerator_enabled ) = 0 ;
2316
2315
return SUCCESS ;
2317
2316
}
2318
2317
}
@@ -2374,12 +2373,15 @@ int accel_activate(INIT_FUNC_ARGS)
2374
2373
}
2375
2374
accel_restart_leave ();
2376
2375
}
2377
- } else {
2376
+ }
2377
+ if (!ZCG (pcre_reseted )) {
2378
2378
reset_pcre = 1 ;
2379
2379
}
2380
2380
zend_shared_alloc_unlock ();
2381
2381
}
2382
2382
2383
+ ZCG (accelerator_enabled ) = ZCSG (accelerator_enabled );
2384
+
2383
2385
SHM_PROTECT ();
2384
2386
HANDLE_UNBLOCK_INTERRUPTIONS ();
2385
2387
@@ -2391,8 +2393,10 @@ int accel_activate(INIT_FUNC_ARGS)
2391
2393
realpath_cache_clean ();
2392
2394
2393
2395
accel_reset_pcre_cache ();
2396
+ ZCG (pcre_reseted ) = 0 ;
2394
2397
} else if (reset_pcre ) {
2395
2398
accel_reset_pcre_cache ();
2399
+ ZCG (pcre_reseted ) = 1 ;
2396
2400
}
2397
2401
2398
2402
if (ZCSG (preload_script )) {
0 commit comments