提交 ccba0cc8 编写于 作者: H heyanlong

fix predis

......@@ -43,16 +43,16 @@ sudo make install
5.新建php的skywalking扩展配置文件,写入配置
```shell
# 扩展so
; 扩展so
extension=skywalking.so
# 是否启用:0 关闭;1 启用 (默认值为0)
; 是否启用:0 关闭;1 启用 (默认值为0)
skywalking.enable=1
# skywalking的版本:5或者6(默认值为6)
; skywalking的版本:5或者6(默认值为6)
skywalking.version=6
# app_code代码,不要含特殊字符,请使用数字、字母、下换线。(默认为:hello_skywalking)
; app_code代码,不要含特殊字符,请使用数字、字母、下换线。(默认为:hello_skywalking)
skywalking.app_code=hello_skywalking
# sock文件路径(默认值为/tmp/sky_agent.sock)
skywalking.sock_path=/tmp/sky_agent.sock
; sock文件路径(默认值为/tmp/sky-agent.sock)
skywalking.sock_path=/tmp/sky-agent.sock
```
......
......@@ -242,7 +242,7 @@ ZEND_API void sky_execute_ex(zend_execute_data *execute_data) {
if (Z_TYPE_P(arguments) == IS_ARRAY) {
zend_ulong num_key;
zval *entry;
zval *entry, str_entry;
smart_str command = {0};
smart_str_appends(&command, Z_STRVAL_P(id));
smart_str_appends(&command, " ");
......@@ -256,8 +256,9 @@ ZEND_API void sky_execute_ex(zend_execute_data *execute_data) {
case IS_ARRAY:
break;
default:
convert_to_string(entry);
smart_str_appends(&command, Z_STRVAL_P(entry));
ZVAL_COPY(&str_entry, entry);
convert_to_string(&str_entry);
smart_str_appends(&command, Z_STRVAL_P(&str_entry));
smart_str_appends(&command, " ");
break;
}
......@@ -558,18 +559,21 @@ ZEND_API void sky_execute_internal(zend_execute_data *execute_data, zval *return
int is_string_command = 1;
int i;
for (i = 1; i < arg_count + 1; ++i) {
zval str_p;
zval *p = ZEND_CALL_ARG(execute_data, i);
if (Z_TYPE_P(p) == IS_ARRAY) {
is_string_command = 0;
break;
}
if (Z_TYPE_P(p) != IS_STRING) {
convert_to_string(p);
ZVAL_COPY(&str_p, p);
if (Z_TYPE_P(&str_p) != IS_STRING) {
convert_to_string(&str_p);
}
if (i == 1) {
add_assoc_string(&tags, "redis.key", Z_STRVAL_P(p));
add_assoc_string(&tags, "redis.key", Z_STRVAL_P(&str_p));
}
smart_str_appends(&command, zend_str_tolower_dup(Z_STRVAL_P(p), Z_STRLEN_P(p)));
smart_str_appends(&command, zend_str_tolower_dup(Z_STRVAL_P(&str_p), Z_STRLEN_P(&str_p)));
smart_str_appends(&command, " ");
}
// store command to tags
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册