@@ -431,7 +431,7 @@ static zend_always_inline zend_string *accel_find_interned_string(zend_string *s
431
431
}
432
432
433
433
if (!ZCG (counted )) {
434
- if (accel_activate_add () == FAILURE ) {
434
+ if (! ZCG ( accelerator_enabled ) || accel_activate_add () == FAILURE ) {
435
435
return str ;
436
436
}
437
437
ZCG (counted ) = 1 ;
@@ -1164,7 +1164,7 @@ char *accel_make_persistent_key(const char *path, size_t path_length, int *key_l
1164
1164
cwd_len = ZSTR_LEN (cwd_str );
1165
1165
if (ZCG (cwd_check )) {
1166
1166
ZCG (cwd_check ) = 0 ;
1167
- if (( ZCG (counted ) || ZCSG ( accelerator_enabled ) )) {
1167
+ if (ZCG (accelerator_enabled )) {
1168
1168
1169
1169
zend_string * str = accel_find_interned_string (cwd_str );
1170
1170
if (!str ) {
@@ -1204,7 +1204,7 @@ char *accel_make_persistent_key(const char *path, size_t path_length, int *key_l
1204
1204
1205
1205
if (ZCG (include_path_check )) {
1206
1206
ZCG (include_path_check ) = 0 ;
1207
- if (( ZCG (counted ) || ZCSG ( accelerator_enabled ) )) {
1207
+ if (ZCG (accelerator_enabled )) {
1208
1208
1209
1209
zend_string * str = accel_find_interned_string (ZCG (include_path ));
1210
1210
if (!str ) {
@@ -1287,7 +1287,7 @@ int zend_accel_invalidate(const char *filename, size_t filename_len, zend_bool f
1287
1287
zend_string * realpath ;
1288
1288
zend_persistent_script * persistent_script ;
1289
1289
1290
- if (!ZCG (enabled ) || ! accel_startup_ok || ! ZCSG ( accelerator_enabled ) || accelerator_shm_read_lock () != SUCCESS ) {
1290
+ if (!ZCG (accelerator_enabled ) || accelerator_shm_read_lock () != SUCCESS ) {
1291
1291
return FAILURE ;
1292
1292
}
1293
1293
@@ -1910,7 +1910,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
1910
1910
} else if (file_cache_only ) {
1911
1911
return file_cache_compile_file (file_handle , type );
1912
1912
#endif
1913
- } else if (( !ZCG (counted ) && ! ZCSG ( accelerator_enabled ) ) ||
1913
+ } else if (!ZCG (accelerator_enabled ) ||
1914
1914
(ZCSG (restart_in_progress ) && accel_restart_is_active ())) {
1915
1915
#ifdef HAVE_OPCACHE_FILE_CACHE
1916
1916
if (ZCG (accel_directives ).file_cache ) {
@@ -2205,12 +2205,11 @@ static int persistent_stream_open_function(const char *filename, zend_file_handl
2205
2205
/* zend_resolve_path() replacement for PHP 5.3 and above */
2206
2206
static zend_string * persistent_zend_resolve_path (const char * filename , size_t filename_len )
2207
2207
{
2208
- if (ZCG ( enabled ) && accel_startup_ok &&
2208
+ if (
2209
2209
#ifdef HAVE_OPCACHE_FILE_CACHE
2210
2210
!file_cache_only &&
2211
2211
#endif
2212
- (ZCG (counted ) || ZCSG (accelerator_enabled )) &&
2213
- !ZCSG (restart_in_progress )) {
2212
+ ZCG (accelerator_enabled )) {
2214
2213
2215
2214
/* check if callback is called from include_once or it's a main request */
2216
2215
if ((!EG (current_execute_data ) &&
@@ -2359,6 +2358,7 @@ static void accel_activate(void)
2359
2358
zend_alter_ini_entry_chars (key , "0" , 1 , ZEND_INI_SYSTEM , ZEND_INI_STAGE_RUNTIME );
2360
2359
zend_string_release_ex (key , 0 );
2361
2360
zend_accel_error (ACCEL_LOG_WARNING , "Can't cache files in chroot() directory with too big inode" );
2361
+ ZCG (accelerator_enabled ) = 0 ;
2362
2362
return ;
2363
2363
}
2364
2364
}
@@ -2416,12 +2416,15 @@ static void accel_activate(void)
2416
2416
}
2417
2417
accel_restart_leave ();
2418
2418
}
2419
- } else {
2419
+ }
2420
+ if (!ZCG (pcre_reseted )) {
2420
2421
reset_pcre = 1 ;
2421
2422
}
2422
2423
zend_shared_alloc_unlock ();
2423
2424
}
2424
2425
2426
+ ZCG (accelerator_enabled ) = ZCSG (accelerator_enabled );
2427
+
2425
2428
SHM_PROTECT ();
2426
2429
HANDLE_UNBLOCK_INTERRUPTIONS ();
2427
2430
@@ -2433,8 +2436,10 @@ static void accel_activate(void)
2433
2436
realpath_cache_clean ();
2434
2437
2435
2438
accel_reset_pcre_cache ();
2439
+ ZCG (pcre_reseted ) = 0 ;
2436
2440
} else if (reset_pcre ) {
2437
2441
accel_reset_pcre_cache ();
2442
+ ZCG (pcre_reseted ) = 1 ;
2438
2443
}
2439
2444
}
2440
2445
@@ -2462,10 +2467,6 @@ static void accel_deactivate(void)
2462
2467
zend_string_release_ex (ZCG (cwd ), 0 );
2463
2468
ZCG (cwd ) = NULL ;
2464
2469
}
2465
-
2466
- if (!ZCG (enabled ) || !accel_startup_ok ) {
2467
- return ;
2468
- }
2469
2470
}
2470
2471
2471
2472
static int accelerator_remove_cb (zend_extension * element1 , zend_extension * element2 )
0 commit comments