com php-src: [BUGFIX] fixes the issue that a value from .user.ini displays in phpinfo(), but not applies. [BUGFIX] when lsapi used the php_value has
higher priority then ini_set when called from the script by itself .: sapi/l itespeed/lsapi_main.c
| From: | George Wang | Date: | Wed, 28 Jun 2017 03:14:36 +0000 |
| Subject: | com php-src: [BUGFIX] fixes the issue that a value from .user.ini displays in phpinfo(), but not applies. [BUGFIX] when lsapi used the php_value has higher priority then ini_set when called from the script by itself .: sapi/l itespeed/lsapi_main.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-98235@lists.php.net to get a copy of this message | ||
Commit: 751d19f6982c36ca013f45c6bf2ad398304f6df5
Author: George Wang <gwang@php.net> Tue, 27 Jun 2017 23:14:36 -0400
Parents: 604827b694aaf1ffcbd986043ba27642534f2ccf
Branches: PHP-7.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=751d19f6982c36ca013f45c6bf2ad398304f6df5
Log:
[BUGFIX] fixes the issue that a value from .user.ini displays in phpinfo(), but not applies.
[BUGFIX] when lsapi used the php_value has higher priority then ini_set when called from the script
by itself .
Changed paths:
M sapi/litespeed/lsapi_main.c
Diff:
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index 06aa610..754ab15 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -404,17 +404,26 @@ static void log_message (const char *fmt, ...)
#define DEBUG_MESSAGE(fmt, ...)
#endif
+static int lsapi_activate_user_ini(TSRMLS_D);
+
+static int sapi_lsapi_activate(TSRMLS_D)
+{
+ if (parse_user_ini && lsapi_activate_user_ini(TSRMLS_C) == FAILURE) {
+ return FAILURE;
+ }
+ return SUCCESS;
+}
/* {{{ sapi_module_struct cgi_sapi_module
*/
static sapi_module_struct lsapi_sapi_module =
{
"litespeed",
- "LiteSpeed V6.10",
+ "LiteSpeed V6.11",
php_lsapi_startup, /* startup */
php_module_shutdown_wrapper, /* shutdown */
- NULL, /* activate */
+ sapi_lsapi_activate, /* activate */
sapi_lsapi_deactivate, /* deactivate */
sapi_lsapi_ub_write, /* unbuffered write */
@@ -547,8 +556,6 @@ static int lsapi_execute_script( zend_file_handle * file_handle)
}
-static int lsapi_activate_user_ini();
-
static int lsapi_module_main(int show_source)
{
zend_file_handle file_handle = {0};
@@ -557,10 +564,6 @@ static int lsapi_module_main(int show_source)
return -1;
}
- if (parse_user_ini && lsapi_activate_user_ini() == FAILURE) {
- return -1;
- }
-
if (show_source) {
zend_syntax_highlighter_ini syntax_highlighter_ini;
@@ -584,11 +587,16 @@ static int alter_ini( const char * pKey, int keyLen, const char * pValue, int
va
zend_string * psKey;
#endif
int type = ZEND_INI_PERDIR;
+ int stage = PHP_INI_STAGE_RUNTIME;
if ( '\001' == *pKey ) {
++pKey;
if ( *pKey == 4 ) {
type = ZEND_INI_SYSTEM;
}
+ else
+ {
+ stage = PHP_INI_STAGE_HTACCESS;
+ }
++pKey;
--keyLen;
if (( keyLen == 7 )&&( strncasecmp( pKey, "engine", 6 )== 0 ))
@@ -603,12 +611,12 @@ static int alter_ini( const char * pKey, int keyLen, const char * pValue, int
va
psKey = zend_string_init(pKey, keyLen, 1);
zend_alter_ini_entry_chars(psKey,
(char *)pValue, valLen,
- type, PHP_INI_STAGE_ACTIVATE);
+ type, stage);
zend_string_release(psKey);
#else
zend_alter_ini_entry((char *)pKey, keyLen,
(char *)pValue, valLen,
- type, PHP_INI_STAGE_ACTIVATE);
+ type, stage);
#endif
}
}