zend_accel_shared_globals *accel_shared_globals = NULL;
/* true globals, no need for thread safety */
+zend_bool accel_startup_ok = 0;
static char *zps_failure_reason = NULL;
char *zps_api_failure_reason = NULL;
if (ZCG(include_path) && *ZCG(include_path)) {
ZCG(include_path_len) = new_value_length;
- if (ZCG(startup_ok) &&
+ if (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) &&
- ZCG(startup_ok) &&
+ 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 ||
- !ZCG(startup_ok) ||
+ !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 (ZCG(startup_ok) &&
+ if (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 (ZCG(startup_ok) &&
+ if (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 (ZCG(startup_ok) &&
+ if (accel_startup_ok &&
(ZCG(counted) || ZCSG(accelerator_enabled)) &&
!CG(interactive) &&
!ZCSG(restart_in_progress)) {
{
TSRMLS_FETCH();
- if (!ZCG(startup_ok)) {
+ if (!accel_startup_ok) {
return;
}
*/
TSRMLS_FETCH();
- if (!ZCG(startup_ok)) {
+ if (!accel_startup_ok) {
return;
}
static void zps_startup_failure(char *reason, char *api_reason, int (*cb)(zend_extension *, zend_extension *) TSRMLS_DC)
{
- ZCG(startup_ok) = 0;
+ accel_startup_ok = 0;
zps_failure_reason = reason;
zps_api_failure_reason = api_reason?api_reason:reason;
zend_llist_del_element(&zend_extensions, NULL, (int (*)(void *, void *))cb);
#endif
if (start_accel_module(0) == FAILURE) {
- ZCG(startup_ok) = 0;
+ accel_startup_ok = 0;
zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME ": module registration failed!");
return FAILURE;
}
/* no supported SAPI found - disable acceleration and stop initalization */
if( accel_find_sapi(TSRMLS_C) == FAILURE ){
- ZCG(startup_ok) = 0;
+ accel_startup_ok = 0;
if (!ZCG(accel_directives).enable_cli &&
strcmp(sapi_module.name, "cli")==0) {
zps_startup_failure("Opcode Caching is disabled for CLI", NULL, accelerator_remove_cb TSRMLS_CC);
zend_accel_init_shm(TSRMLS_C);
break;
case ALLOC_FAILURE:
- ZCG(startup_ok) = 0;
+ accel_startup_ok = 0;
zend_accel_error(ACCEL_LOG_FATAL,"Failure to initialize shared memory structures - probably not enough shared memory.");
return SUCCESS;
case SUCCESSFULLY_REATTACHED:
break;
case FAILED_REATTACHED:
- ZCG(startup_ok) = 0;
+ accel_startup_ok = 0;
zend_accel_error(ACCEL_LOG_FATAL,"Failure to initialize shared memory structures - can not reattach to exiting shared memory.");
return SUCCESS;
break;
SHM_PROTECT();
- ZCG(startup_ok) = 1;
+ accel_startup_ok = 1;
/* Override file_exists(), is_file() and is_readable() */
zend_accel_override_file_functions(TSRMLS_C);
zend_accel_blacklist_shutdown(&accel_blacklist);
- if (!ZCG(startup_ok)) {
+ if (!accel_startup_ok) {
accel_free_ts_resources();
return;
}
{
TSRMLS_FETCH();
- if (ZCG(startup_ok) && ZCSG(accelerator_enabled)) {
+ if (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(ZCG(startup_ok) && ZCG(accel_directives).file_override_enabled) {
+ if(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 (ZCG(startup_ok) && ZCSG(accelerator_enabled)) {
+ if (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");
}
- if (ZCG(enabled) && ZCG(startup_ok) && ZCSG(accelerator_enabled) && ZCG(accel_directives).optimization_level) {
+ if (ZCG(enabled) && accel_startup_ok && ZCSG(accelerator_enabled) && ZCG(accel_directives).optimization_level) {
php_info_print_table_row(2, "Optimization", "Enabled");
} else {
php_info_print_table_row(2, "Optimization", "Disabled");
}
- if (!ZCG(startup_ok) || zps_api_failure_reason) {
+ 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");
struct timeval exec_time;
struct timeval fetch_time;
- if (!ZCG(startup_ok) || !ZCSG(accelerator_enabled) || accelerator_shm_read_lock(TSRMLS_C) != SUCCESS) {
+ if (!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 (!ZCG(startup_ok) || !ZCSG(accelerator_enabled)) {
+ if (!accel_startup_ok || !ZCSG(accelerator_enabled)) {
RETURN_FALSE;
}
array_init(return_value);
/* Trivia */
- add_assoc_bool(return_value, "accelerator_enabled", 1 /*ZCG(startup_ok) && ZCSG(accelerator_enabled)*/);
+ add_assoc_bool(return_value, "accelerator_enabled", 1 /*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 (!ZCG(startup_ok) || !ZCSG(accelerator_enabled)) {
+ if (!accel_startup_ok || !ZCSG(accelerator_enabled)) {
RETURN_FALSE;
}