@@ -429,7 +429,7 @@ static zend_always_inline zend_string *accel_find_interned_string(zend_string *s
429429 }
430430
431431 if (!ZCG (counted )) {
432- if (accel_activate_add () == FAILURE ) {
432+ if (! ZCG ( accelerator_enabled ) || accel_activate_add () == FAILURE ) {
433433 return str ;
434434 }
435435 ZCG (counted ) = 1 ;
@@ -1145,7 +1145,7 @@ char *accel_make_persistent_key(const char *path, size_t path_length, int *key_l
11451145 cwd_len = ZSTR_LEN (cwd_str );
11461146 if (ZCG (cwd_check )) {
11471147 ZCG (cwd_check ) = 0 ;
1148- if (( ZCG (counted ) || ZCSG ( accelerator_enabled ) )) {
1148+ if (ZCG (accelerator_enabled )) {
11491149
11501150 zend_string * str = accel_find_interned_string (cwd_str );
11511151 if (!str ) {
@@ -1185,7 +1185,7 @@ char *accel_make_persistent_key(const char *path, size_t path_length, int *key_l
11851185
11861186 if (ZCG (include_path_check )) {
11871187 ZCG (include_path_check ) = 0 ;
1188- if (( ZCG (counted ) || ZCSG ( accelerator_enabled ) )) {
1188+ if (ZCG (accelerator_enabled )) {
11891189
11901190 zend_string * str = accel_find_interned_string (ZCG (include_path ));
11911191 if (!str ) {
@@ -1268,7 +1268,7 @@ int zend_accel_invalidate(const char *filename, size_t filename_len, zend_bool f
12681268 zend_string * realpath ;
12691269 zend_persistent_script * persistent_script ;
12701270
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 ) {
12721272 return FAILURE ;
12731273 }
12741274
@@ -1872,7 +1872,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
18721872 return accelerator_orig_compile_file (file_handle , type );
18731873 } else if (file_cache_only ) {
18741874 return file_cache_compile_file (file_handle , type );
1875- } else if (( !ZCG (counted ) && ! ZCSG ( accelerator_enabled ) ) ||
1875+ } else if (!ZCG (accelerator_enabled ) ||
18761876 (ZCSG (restart_in_progress ) && accel_restart_is_active ())) {
18771877 if (ZCG (accel_directives ).file_cache ) {
18781878 return file_cache_compile_file (file_handle , type );
@@ -2159,10 +2159,8 @@ static int persistent_stream_open_function(const char *filename, zend_file_handl
21592159/* zend_resolve_path() replacement for PHP 5.3 and above */
21602160static zend_string * persistent_zend_resolve_path (const char * filename , size_t filename_len )
21612161{
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 )) {
21662164
21672165 /* check if callback is called from include_once or it's a main request */
21682166 if ((!EG (current_execute_data ) &&
@@ -2304,6 +2302,7 @@ int accel_activate(INIT_FUNC_ARGS)
23042302 zend_alter_ini_entry_chars (key , "0" , 1 , ZEND_INI_SYSTEM , ZEND_INI_STAGE_RUNTIME );
23052303 zend_string_release_ex (key , 0 );
23062304 zend_accel_error (ACCEL_LOG_WARNING , "Can't cache files in chroot() directory with too big inode" );
2305+ ZCG (accelerator_enabled ) = 0 ;
23072306 return SUCCESS ;
23082307 }
23092308 }
@@ -2365,12 +2364,15 @@ int accel_activate(INIT_FUNC_ARGS)
23652364 }
23662365 accel_restart_leave ();
23672366 }
2368- } else {
2367+ }
2368+ if (!ZCG (pcre_reseted )) {
23692369 reset_pcre = 1 ;
23702370 }
23712371 zend_shared_alloc_unlock ();
23722372 }
23732373
2374+ ZCG (accelerator_enabled ) = ZCSG (accelerator_enabled );
2375+
23742376 SHM_PROTECT ();
23752377 HANDLE_UNBLOCK_INTERRUPTIONS ();
23762378
@@ -2382,8 +2384,10 @@ int accel_activate(INIT_FUNC_ARGS)
23822384 realpath_cache_clean ();
23832385
23842386 accel_reset_pcre_cache ();
2387+ ZCG (pcre_reseted ) = 0 ;
23852388 } else if (reset_pcre ) {
23862389 accel_reset_pcre_cache ();
2390+ ZCG (pcre_reseted ) = 1 ;
23872391 }
23882392
23892393
0 commit comments