com php-src: Turn accel_activate into module callback .: ext/opcache/ZendAccelerator.c ext/opcache/ZendAcce lerator.h
ext/opcache/zend_accelerator_module.c
| From: | Dmitry Stogov | Date: | Mon, 01 Oct 2018 11:10:54 +0000 |
| Subject: | com php-src: Turn accel_activate into module callback .: ext/opcache/ZendAccelerator.c ext/opcache/ZendAcce lerator.h ext/opcache/zend_accelerator_module.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-103297@lists.php.net to get a copy of this message | ||
Commit: 34a491d1ed5b3e593572b45542fd394b308e91a9
Author: Dmitry Stogov <dmitry@zend.com> Mon, 1 Oct 2018 14:10:54 +0300
Parents: c25e7439ae3917be171ae1ba55f78013f92c2e14
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=34a491d1ed5b3e593572b45542fd394b308e91a9
Log:
Turn accel_activate into module callback..
Changed paths:
M ext/opcache/ZendAccelerator.c
M ext/opcache/ZendAccelerator.h
M ext/opcache/zend_accelerator_module.c
Diff:
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 6a0d991..fdaa9ae 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -2293,12 +2293,12 @@ static void accel_reset_pcre_cache(void)
} ZEND_HASH_FOREACH_END();
}
-static void accel_activate(void)
+int accel_activate(INIT_FUNC_ARGS)
{
zend_bool reset_pcre = 0;
if (!ZCG(enabled) || !accel_startup_ok) {
- return;
+ return SUCCESS;
}
/* PHP-5.4 and above return "double", but we use 1 sec precision */
@@ -2315,7 +2315,7 @@ static void accel_activate(void)
#ifdef HAVE_OPCACHE_FILE_CACHE
if (file_cache_only) {
- return;
+ return SUCCESS;
}
#endif
@@ -2333,7 +2333,7 @@ static void accel_activate(void)
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;
+ return SUCCESS;
}
}
}
@@ -2410,6 +2410,8 @@ static void accel_activate(void)
} else if (reset_pcre) {
accel_reset_pcre_cache();
}
+
+ return SUCCESS;
}
int accel_post_deactivate(void)
@@ -3026,7 +3028,7 @@ ZEND_EXT_API zend_extension zend_extension_entry = {
"Copyright (c) 1999-2018", /* copyright */
accel_startup, /* startup */
NULL, /* shutdown */
- accel_activate, /* per-script activation */
+ NULL, /* per-script activation */
NULL, /* per-script deactivation */
NULL, /* message handler */
NULL, /* op_array handler */
diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h
index 26dc0a6..f48c377 100644
--- a/ext/opcache/ZendAccelerator.h
+++ b/ext/opcache/ZendAccelerator.h
@@ -313,6 +313,7 @@ extern zend_accel_globals accel_globals;
extern char *zps_api_failure_reason;
void accel_shutdown(void);
+int accel_activate(INIT_FUNC_ARGS);
int accel_post_deactivate(void);
void zend_accel_schedule_restart(zend_accel_restart_reason reason);
void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason);
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index b4db8cb..79af9a3 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -521,7 +521,7 @@ static zend_module_entry accel_module_entry = {
accel_functions,
ZEND_MINIT(zend_accelerator),
ZEND_MSHUTDOWN(zend_accelerator),
- NULL,
+ accel_activate,
NULL,
zend_accel_info,
PHP_VERSION,