com php-src: Fixed phpinfo() output when O+ is not enabled for CLI: ZendAccelerator.c zend_accelerator_module.c
| From: | Dmitry Stogov | Date: | Thu, 14 Feb 2013 09:19:06 +0000 |
| Subject: | com php-src: Fixed phpinfo() output when O+ is not enabled for CLI: ZendAccelerator.c zend_accelerator_module.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-71550@lists.php.net to get a copy of this message | ||
Commit: ded12158ccf112860864d390d96913426a9debe7
Author: Dmitry Stogov <dmitry@zend.com> Thu, 14 Feb 2013 13:19:06 +0400
Parents: 91e775df1b04a1da9292ef06a4fd0e56bc3a8cc6
Branches: PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ded12158ccf112860864d390d96913426a9debe7
Log:
Fixed phpinfo() output when O+ is not enabled for CLI
Changed paths:
M ZendAccelerator.c
M zend_accelerator_module.c
Diff:
diff --git a/ZendAccelerator.c b/ZendAccelerator.c
index 8b2a6ae..3e9ea12 100644
--- a/ZendAccelerator.c
+++ b/ZendAccelerator.c
@@ -2255,7 +2255,12 @@ static int accel_startup(zend_extension *extension)
/* no supported SAPI found - disable acceleration and stop initalization */
if( accel_find_sapi(TSRMLS_C) == FAILURE ){
ZCG(startup_ok) = 0;
- zps_startup_failure("Opcode Caching is only supported in Apache, ISAPI and FastCGI
SAPIs", NULL, accelerator_remove_cb TSRMLS_CC);
+ 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);
+ } else {
+ zps_startup_failure("Opcode Caching is only supported in Apache, ISAPI, FPM and FastCGI
SAPIs", NULL, accelerator_remove_cb TSRMLS_CC);
+ }
return SUCCESS;
}
diff --git a/zend_accelerator_module.c b/zend_accelerator_module.c
index e64ad19..d26a773 100644
--- a/zend_accelerator_module..c
+++ b/zend_accelerator_module.c
@@ -373,7 +373,7 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
} else {
php_info_print_table_row(2, "Opcode Caching", "Disabled");
}
- if (ZCG(enabled) && ZCG(accel_directives).optimization_level) {
+ if (ZCG(enabled) && ZCG(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");