if (ZCG(include_path) && *ZCG(include_path)) {
ZCG(include_path_len) = new_value_length;
- if (accel_startup_ok &&
+ if (ZCG(enabled) && accel_startup_ok &&
(ZCG(counted) || ZCSG(accelerator_enabled)) &&
!zend_accel_hash_is_full(&ZCSG(include_paths))) {
include_path = ZCG(include_path);
include_path_len = ZCG(include_path_len);
if (ZCG(include_path_check) &&
- accel_startup_ok &&
+ ZCG(enabled) && accel_startup_ok &&
(ZCG(counted) || ZCSG(accelerator_enabled)) &&
!zend_accel_hash_is_full(&ZCSG(include_paths))) {
int from_shared_memory; /* if the script we've got is stored in SHM */
if (!file_handle->filename ||
- !accel_startup_ok ||
+ !ZCG(enabled) || !accel_startup_ok ||
(!ZCG(counted) && !ZCSG(accelerator_enabled)) ||
CG(interactive) ||
(ZCSG(restart_in_progress) && accel_restart_is_active(TSRMLS_C))) {
/* zend_stream_open_function() replacement for PHP 5.2 */
static int persistent_stream_open_function(const char *filename, zend_file_handle *handle TSRMLS_DC)
{
- if (accel_startup_ok &&
+ if (ZCG(enabled) && accel_startup_ok &&
(ZCG(counted) || ZCSG(accelerator_enabled)) &&
!CG(interactive) &&
!ZCSG(restart_in_progress)) {
/* zend_stream_open_function() replacement for PHP 5.3 and above */
static int persistent_stream_open_function(const char *filename, zend_file_handle *handle TSRMLS_DC)
{
- if (accel_startup_ok &&
+ if (ZCG(enabled) && accel_startup_ok &&
(ZCG(counted) || ZCSG(accelerator_enabled)) &&
!CG(interactive) &&
!ZCSG(restart_in_progress)) {
/* zend_resolve_path() replacement for PHP 5.3 and above */
static char* persistent_zend_resolve_path(const char *filename, int filename_len TSRMLS_DC)
{
- if (accel_startup_ok &&
+ if (ZCG(enabled) && accel_startup_ok &&
(ZCG(counted) || ZCSG(accelerator_enabled)) &&
!CG(interactive) &&
!ZCSG(restart_in_progress)) {
{
TSRMLS_FETCH();
- if (!accel_startup_ok) {
+ if (!ZCG(enabled) || !accel_startup_ok) {
return;
}
*/
TSRMLS_FETCH();
- if (!accel_startup_ok) {
+ if (!ZCG(enabled) || !accel_startup_ok) {
return;
}
zend_accel_blacklist_shutdown(&accel_blacklist);
- if (!accel_startup_ok) {
+ if (!ZCG(enabled) || !accel_startup_ok) {
accel_free_ts_resources();
return;
}
{
TSRMLS_FETCH();
- if (accel_startup_ok && ZCSG(accelerator_enabled)) {
+ if (ZCG(enabled) && accel_startup_ok && ZCSG(accelerator_enabled)) {
zend_optimizer(op_array TSRMLS_CC);
}
}
void zend_accel_override_file_functions(TSRMLS_D)
{
zend_function *old_function;
- if (accel_startup_ok && ZCG(accel_directives).file_override_enabled) {
+ if (ZCG(enabled) && accel_startup_ok && ZCG(accel_directives).file_override_enabled) {
/* override file_exists */
if (zend_hash_find(CG(function_table), "file_exists", sizeof("file_exists"), (void **)&old_function) == SUCCESS) {
old_function->internal_function.handler = accel_file_exists;
{
php_info_print_table_start();
- if (accel_startup_ok && ZCSG(accelerator_enabled)) {
+ if (ZCG(enabled) && accel_startup_ok && ZCSG(accelerator_enabled)) {
php_info_print_table_row(2, "Opcode Caching", "Up and Running");
} else {
php_info_print_table_row(2, "Opcode Caching", "Disabled");
} else {
php_info_print_table_row(2, "Optimization", "Disabled");
}
- if (!accel_startup_ok || zps_api_failure_reason) {
- php_info_print_table_row(2, "Startup Failed", zps_api_failure_reason);
- } else {
- php_info_print_table_row(2, "Startup", "OK");
- php_info_print_table_row(2, "Shared memory model", zend_accel_get_shared_model());
+ if (ZCG(enabled)) {
+ if (!accel_startup_ok || zps_api_failure_reason) {
+ php_info_print_table_row(2, "Startup Failed", zps_api_failure_reason);
+ } else {
+ php_info_print_table_row(2, "Startup", "OK");
+ php_info_print_table_row(2, "Shared memory model", zend_accel_get_shared_model());
+ }
}
php_info_print_table_end();
struct timeval exec_time;
struct timeval fetch_time;
- if (!accel_startup_ok || !ZCSG(accelerator_enabled) || accelerator_shm_read_lock(TSRMLS_C) != SUCCESS) {
+ if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled) || accelerator_shm_read_lock(TSRMLS_C) != SUCCESS) {
return 0;
}
/* keep the compiler happy */
(void)ht; (void)return_value_ptr; (void)this_ptr; (void)return_value_used;
- if (!accel_startup_ok || !ZCSG(accelerator_enabled)) {
+ if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled)) {
RETURN_FALSE;
}
array_init(return_value);
/* Trivia */
- add_assoc_bool(return_value, "accelerator_enabled", 1 /*accel_startup_ok && ZCSG(accelerator_enabled)*/);
+ add_assoc_bool(return_value, "accelerator_enabled", 1 /*ZCG(enabled) && accel_startup_ok && ZCSG(accelerator_enabled)*/);
add_assoc_bool(return_value, "cache_full", ZSMMG(memory_exhausted));
/* Memory usage statistics */
/* keep the compiler happy */
(void)ht; (void)return_value_ptr; (void)this_ptr; (void)return_value_used;
- if (!accel_startup_ok || !ZCSG(accelerator_enabled)) {
+ if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled)) {
RETURN_FALSE;
}