@@ -438,7 +438,7 @@ static zend_always_inline zend_string *accel_find_interned_string(zend_string *s
438438 }
439439
440440 if (!ZCG (counted )) {
441- if (accel_activate_add () == FAILURE ) {
441+ if (! ZCG ( accelerator_enabled ) || accel_activate_add () == FAILURE ) {
442442 return str ;
443443 }
444444 ZCG (counted ) = 1 ;
@@ -1154,7 +1154,7 @@ char *accel_make_persistent_key(const char *path, size_t path_length, int *key_l
11541154 cwd_len = ZSTR_LEN (cwd_str );
11551155 if (ZCG (cwd_check )) {
11561156 ZCG (cwd_check ) = 0 ;
1157- if (( ZCG (counted ) || ZCSG ( accelerator_enabled ) )) {
1157+ if (ZCG (accelerator_enabled )) {
11581158
11591159 zend_string * str = accel_find_interned_string (cwd_str );
11601160 if (!str ) {
@@ -1194,7 +1194,7 @@ char *accel_make_persistent_key(const char *path, size_t path_length, int *key_l
11941194
11951195 if (ZCG (include_path_check )) {
11961196 ZCG (include_path_check ) = 0 ;
1197- if (( ZCG (counted ) || ZCSG ( accelerator_enabled ) )) {
1197+ if (ZCG (accelerator_enabled )) {
11981198
11991199 zend_string * str = accel_find_interned_string (ZCG (include_path ));
12001200 if (!str ) {
@@ -1277,7 +1277,7 @@ int zend_accel_invalidate(const char *filename, size_t filename_len, zend_bool f
12771277 zend_string * realpath ;
12781278 zend_persistent_script * persistent_script ;
12791279
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 ) {
12811281 return FAILURE ;
12821282 }
12831283
@@ -1881,7 +1881,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
18811881 return accelerator_orig_compile_file (file_handle , type );
18821882 } else if (file_cache_only ) {
18831883 return file_cache_compile_file (file_handle , type );
1884- } else if (( !ZCG (counted ) && ! ZCSG ( accelerator_enabled ) ) ||
1884+ } else if (!ZCG (accelerator_enabled ) ||
18851885 (ZCSG (restart_in_progress ) && accel_restart_is_active ())) {
18861886 if (ZCG (accel_directives ).file_cache ) {
18871887 return file_cache_compile_file (file_handle , type );
@@ -2168,10 +2168,8 @@ static int persistent_stream_open_function(const char *filename, zend_file_handl
21682168/* zend_resolve_path() replacement for PHP 5.3 and above */
21692169static zend_string * persistent_zend_resolve_path (const char * filename , size_t filename_len )
21702170{
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 )) {
21752173
21762174 /* check if callback is called from include_once or it's a main request */
21772175 if ((!EG (current_execute_data ) &&
@@ -2313,6 +2311,7 @@ int accel_activate(INIT_FUNC_ARGS)
23132311 zend_alter_ini_entry_chars (key , "0" , 1 , ZEND_INI_SYSTEM , ZEND_INI_STAGE_RUNTIME );
23142312 zend_string_release_ex (key , 0 );
23152313 zend_accel_error (ACCEL_LOG_WARNING , "Can't cache files in chroot() directory with too big inode" );
2314+ ZCG (accelerator_enabled ) = 0 ;
23162315 return SUCCESS ;
23172316 }
23182317 }
@@ -2374,12 +2373,15 @@ int accel_activate(INIT_FUNC_ARGS)
23742373 }
23752374 accel_restart_leave ();
23762375 }
2377- } else {
2376+ }
2377+ if (!ZCG (pcre_reseted )) {
23782378 reset_pcre = 1 ;
23792379 }
23802380 zend_shared_alloc_unlock ();
23812381 }
23822382
2383+ ZCG (accelerator_enabled ) = ZCSG (accelerator_enabled );
2384+
23832385 SHM_PROTECT ();
23842386 HANDLE_UNBLOCK_INTERRUPTIONS ();
23852387
@@ -2391,8 +2393,10 @@ int accel_activate(INIT_FUNC_ARGS)
23912393 realpath_cache_clean ();
23922394
23932395 accel_reset_pcre_cache ();
2396+ ZCG (pcre_reseted ) = 0 ;
23942397 } else if (reset_pcre ) {
23952398 accel_reset_pcre_cache ();
2399+ ZCG (pcre_reseted ) = 1 ;
23962400 }
23972401
23982402 if (ZCSG (preload_script )) {
0 commit comments