diff options
| author | Kalle Sommer Nielsen <kalle@php.net> | 2013-12-12 20:30:45 +0100 |
|---|---|---|
| committer | Kalle Sommer Nielsen <kalle@php.net> | 2013-12-12 20:30:45 +0100 |
| commit | 0fc8e6af0a0ff8eeb15746978ce1e6009ed76f11 (patch) | |
| tree | bd08220ec12315805e9d963667c8b91736099dd3 /ext | |
| parent | 4411641b1eba09fa8afe5b38af9be2ba49a51db4 (diff) | |
| download | php-git-0fc8e6af0a0ff8eeb15746978ce1e6009ed76f11.tar.gz | |
Eliminate another straight forward TSRMLS_FETCH() in zend_startup_module()
# For THTTPD:
# The code that uses a call to this function is for older versions of PHP anyway so its not covered
# For Zend OpCache:
# Added a new define for 5.6 and wrapped the code around that so its still compatible with older version
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/opcache/ZendAccelerator.c | 4 | ||||
| -rw-r--r-- | ext/opcache/ZendAccelerator.h | 1 | ||||
| -rw-r--r-- | ext/opcache/zend_accelerator_module.c | 7 | ||||
| -rw-r--r-- | ext/opcache/zend_accelerator_module.h | 5 |
4 files changed, 17 insertions, 0 deletions
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 9398b58ac6..69a5d386d2 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2528,7 +2528,11 @@ static int accel_startup(zend_extension *extension) _setmaxstdio(2048); /* The default configuration is limited to 512 stdio files */ #endif +#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO + if (start_accel_module(TSRMLS_C) == FAILURE) { +#else if (start_accel_module() == FAILURE) { +#endif accel_startup_ok = 0; zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME ": module registration failed!"); return FAILURE; diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index 487010ba27..7ffd0126b3 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -92,6 +92,7 @@ #define PHP_5_3_X_API_NO 220090626 #define PHP_5_4_X_API_NO 220100525 #define PHP_5_5_X_API_NO 220121212 +#define PHP_5_6_X_API_NO 220131106 /*** file locking ***/ #ifndef ZEND_WIN32 diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index cd840fd7dd..1034e3e05d 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -468,10 +468,17 @@ static zend_module_entry accel_module_entry = { STANDARD_MODULE_PROPERTIES }; +#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO +int start_accel_module(TSRMLS_D) +{ + return zend_startup_module(&accel_module_entry TSRMLS_CC); +} +#else int start_accel_module(void) { return zend_startup_module(&accel_module_entry); } +#endif /* {{{ proto array accelerator_get_scripts() Get the scripts which are accelerated by ZendAccelerator */ diff --git a/ext/opcache/zend_accelerator_module.h b/ext/opcache/zend_accelerator_module.h index 539b4e85af..74728f3f72 100644 --- a/ext/opcache/zend_accelerator_module.h +++ b/ext/opcache/zend_accelerator_module.h @@ -22,7 +22,12 @@ #ifndef ZEND_ACCELERATOR_MODULE_H #define ZEND_ACCELERATOR_MODULE_H +#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO +int start_accel_module(TSRMLS_D); +#else int start_accel_module(void); +#endif + void zend_accel_override_file_functions(TSRMLS_D); #endif /* _ZEND_ACCELERATOR_MODULE_H */ |
