if (!file_handle->filename || !ZCG(enabled) || !accel_startup_ok) {
/* The Accelerator is disabled, act as if without the Accelerator */
return accelerator_orig_compile_file(file_handle, type);
-#ifdef HAVE_OPCACHE_FILE_CACHE
} else if (file_cache_only) {
return file_cache_compile_file(file_handle, type);
- } else if ((!ZCG(counted) && !ZCSG(accelerator_enabled)) ||
-#endif
+ } else if (!ZCG(accelerator_enabled) ||
(ZCSG(restart_in_progress) && accel_restart_is_active())) {
-#ifdef HAVE_OPCACHE_FILE_CACHE
if (ZCG(accel_directives).file_cache) {
return file_cache_compile_file(file_handle, type);
}
/* zend_resolve_path() replacement for PHP 5.3 and above */
static zend_string* persistent_zend_resolve_path(const char *filename, size_t filename_len)
{
- if (ZCG(enabled) && accel_startup_ok &&
- if (
-#ifdef HAVE_OPCACHE_FILE_CACHE
-- !file_cache_only &&
- (ZCG(counted) || ZCSG(accelerator_enabled)) &&
- !ZCSG(restart_in_progress)) {
-#endif
++ if (!file_cache_only &&
+ 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_ex(key, 0);
zend_accel_error(ACCEL_LOG_WARNING, "Can't cache files in chroot() directory with too big inode");
- return;
+ ZCG(accelerator_enabled) = 0;
+ return SUCCESS;
}
}
}
realpath_cache_clean();
accel_reset_pcre_cache();
+ ZCG(pcre_reseted) = 0;
} else if (reset_pcre) {
accel_reset_pcre_cache();
+ ZCG(pcre_reseted) = 1;
}
+
+ if (ZCSG(preload_script)) {
+ preload_activate();
+ }
+
+ return SUCCESS;
}
int accel_post_deactivate(void)
{
php_info_print_table_start();
- if (ZCG(enabled) && accel_startup_ok &&
- ((ZCG(counted) || ZCSG(accelerator_enabled)) || file_cache_only)
- if (
-#ifdef HAVE_OPCACHE_FILE_CACHE
- (ZCG(accelerator_enabled) || file_cache_only)
-#else
- (ZCG(accelerator_enabled))
-#endif
-- ) {
++ if (ZCG(accelerator_enabled) || file_cache_only) {
php_info_print_table_row(2, "Opcode Caching", "Up and Running");
} else {
php_info_print_table_row(2, "Opcode Caching", "Disabled");
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) {
add_assoc_string(return_value, "file_cache", ZCG(accel_directives).file_cache);
}