}
if (!ZCG(counted)) {
- if (accel_activate_add() == FAILURE) {
+ if (!ZCG(accelerator_enabled) || accel_activate_add() == FAILURE) {
return str;
}
ZCG(counted) = 1;
cwd_len = ZSTR_LEN(cwd_str);
if (ZCG(cwd_check)) {
ZCG(cwd_check) = 0;
- if ((ZCG(counted) || ZCSG(accelerator_enabled))) {
+ if (ZCG(accelerator_enabled)) {
zend_string *str = accel_find_interned_string(cwd_str);
if (!str) {
if (ZCG(include_path_check)) {
ZCG(include_path_check) = 0;
- if ((ZCG(counted) || ZCSG(accelerator_enabled))) {
+ if (ZCG(accelerator_enabled)) {
zend_string *str = accel_find_interned_string(ZCG(include_path));
if (!str) {
zend_string *realpath;
zend_persistent_script *persistent_script;
- if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) {
+ if (!ZCG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) {
return FAILURE;
}
} else if (file_cache_only) {
return file_cache_compile_file(file_handle, type);
#endif
- } else if ((!ZCG(counted) && !ZCSG(accelerator_enabled)) ||
+ } else if (!ZCG(accelerator_enabled) ||
(ZCSG(restart_in_progress) && accel_restart_is_active())) {
#ifdef HAVE_OPCACHE_FILE_CACHE
if (ZCG(accel_directives).file_cache) {
/* zend_resolve_path() replacement for PHP 5.3 and above */
static zend_string* persistent_zend_resolve_path(const char *filename, int filename_len)
{
- if (ZCG(enabled) && accel_startup_ok &&
+ if (
#ifdef HAVE_OPCACHE_FILE_CACHE
!file_cache_only &&
#endif
- (ZCG(counted) || ZCSG(accelerator_enabled)) &&
- !ZCSG(restart_in_progress)) {
+ ZCG(accelerator_enabled)) {
/* check if callback is called from include_once or it's a main request */
if ((!EG(current_execute_data) &&
zend_alter_ini_entry_chars(key, "0", 1, ZEND_INI_SYSTEM, ZEND_INI_STAGE_RUNTIME);
zend_string_release(key);
zend_accel_error(ACCEL_LOG_WARNING, "Can't cache files in chroot() directory with too big inode");
+ ZCG(accelerator_enabled) = 0;
return;
}
}
}
accel_restart_leave();
}
- } else {
+ }
+ if (!ZCG(pcre_reseted)) {
reset_pcre = 1;
}
zend_shared_alloc_unlock();
}
+ ZCG(accelerator_enabled) = ZCSG(accelerator_enabled);
+
SHM_PROTECT();
HANDLE_UNBLOCK_INTERRUPTIONS();
realpath_cache_clean();
accel_reset_pcre_cache();
+ ZCG(pcre_reseted) = 0;
} else if (reset_pcre) {
accel_reset_pcre_cache();
+ ZCG(pcre_reseted) = 1;
}
}
zend_string_release(ZCG(cwd));
ZCG(cwd) = NULL;
}
-
- if (!ZCG(enabled) || !accel_startup_ok) {
- return;
- }
}
static int accelerator_remove_cb(zend_extension *element1, zend_extension *element2)
{
php_info_print_table_start();
- if (ZCG(enabled) && accel_startup_ok &&
+ if (
#ifdef HAVE_OPCACHE_FILE_CACHE
- ((ZCG(counted) || ZCSG(accelerator_enabled)) || file_cache_only)
+ (ZCG(accelerator_enabled) || file_cache_only)
#else
- (ZCG(counted) || ZCSG(accelerator_enabled))
+ (ZCG(accelerator_enabled))
#endif
) {
php_info_print_table_row(2, "Opcode Caching", "Up and Running");
struct timeval exec_time;
struct timeval fetch_time;
- if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) {
+ if (!ZCG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) {
return 0;
}
array_init(return_value);
/* Trivia */
- add_assoc_bool(return_value, "opcache_enabled", ZCG(enabled) && (ZCG(counted) || ZCSG(accelerator_enabled)));
+ add_assoc_bool(return_value, "opcache_enabled", ZCG(accelerator_enabled));
#ifdef HAVE_OPCACHE_FILE_CACHE
if (ZCG(accel_directives).file_cache) {
return;
}
- if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled)) {
+ if (!ZCG(accelerator_enabled)) {
zend_error(E_NOTICE, ACCELERATOR_PRODUCT_NAME " seems to be disabled, can't compile file");
RETURN_FALSE;
}
RETURN_FALSE;
}
- if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled)) {
+ if (!ZCG(accelerator_enabled)) {
RETURN_FALSE;
}