diff options
-rw-r--r-- | Zend/zend_API.c | 4 | ||||
-rw-r--r-- | Zend/zend_API.h | 2 | ||||
-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 | ||||
-rw-r--r-- | sapi/thttpd/thttpd.c | 3 |
7 files changed, 21 insertions, 5 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 18f151e0ef..b3f59a71f1 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2313,10 +2313,8 @@ ZEND_API void zend_unregister_functions(const zend_function_entry *functions, in } /* }}} */ -ZEND_API int zend_startup_module(zend_module_entry *module) /* {{{ */ +ZEND_API int zend_startup_module(zend_module_entry *module TSRMLS_DC) /* {{{ */ { - TSRMLS_FETCH(); - if ((module = zend_register_internal_module(module TSRMLS_CC)) != NULL && zend_startup_module_ex(module TSRMLS_CC) == SUCCESS) { return SUCCESS; } diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 007d989609..c426acf497 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -266,7 +266,7 @@ ZEND_API int zend_parse_parameter(int flags, int arg_num TSRMLS_DC, zval **arg, ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC); ZEND_API void zend_unregister_functions(const zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC); -ZEND_API int zend_startup_module(zend_module_entry *module_entry); +ZEND_API int zend_startup_module(zend_module_entry *module_entry TSRMLS_DC); ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module_entry TSRMLS_DC); ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TSRMLS_DC); ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC); 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 */ diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c index 548bcda170..b136b71d7b 100644 --- a/sapi/thttpd/thttpd.c +++ b/sapi/thttpd/thttpd.c @@ -349,11 +349,12 @@ static zend_module_entry php_thttpd_module = { STANDARD_MODULE_PROPERTIES }; -static int php_thttpd_startup(sapi_module_struct *sapi_module) +static int php_thttpd_startup(sapi_module_struct *sapi_module TSRMLS_DC) { #if PHP_API_VERSION >= 20020918 if (php_module_startup(sapi_module, &php_thttpd_module, 1) == FAILURE) { #else + /* No TSRMLS_CC here to zend_startup_module() as 5.6 and older does not have that parameter */ if (php_module_startup(sapi_module) == FAILURE || zend_startup_module(&php_thttpd_module) == FAILURE) { #endif |