Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
SkyAPM
SkyAPM-php-sdk
提交
460c4e52
S
SkyAPM-php-sdk
项目概览
SkyAPM
/
SkyAPM-php-sdk
通知
14
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyAPM-php-sdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
460c4e52
编写于
12月 05, 2019
作者:
何
何延龙
提交者:
GitHub
12月 05, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #165 from SkyAPM/develop
Support PHP 7.4.x
上级
dd8acf3c
b7ec9984
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
7 deletion
+17
-7
php_skywalking.h
php_skywalking.h
+5
-1
skywalking.c
skywalking.c
+12
-6
未找到文件。
php_skywalking.h
浏览文件 @
460c4e52
...
...
@@ -105,7 +105,11 @@ extern zend_module_entry skywalking_module_entry;
#define REDIS_KEY_HLL "|pfadd|watch|"
#define REDIS_KEY_GEO "|geoadd|geohash|geopos|geodist|georadius|georadiusbymember|"
#ifdef ZEND_ENABLE_ZVAL_LONG64
#define PRId3264 PRId64
#else
#define PRId3264 PRId32
#endif
#define RAND_RANGE(__n, __min, __max, __tmax) \
(__n) = ((__min) + (zend_long) ((double) ( (double) (__max) - (__min) + 1.0) * ((__n) / ((__tmax) + 1.0))))
...
...
skywalking.c
浏览文件 @
460c4e52
...
...
@@ -134,7 +134,13 @@ static char *pcre_match(char *pattern, int len, char *subject) {
zend_string
*
pattern_str
=
zend_string_init
(
pattern
,
len
,
0
);
if
((
cache
=
pcre_get_compiled_regex_cache
(
pattern_str
))
!=
NULL
)
{
#if PHP_VERSION_ID < 70400
php_pcre_match_impl
(
cache
,
subject
,
strlen
(
subject
),
result
,
subpats
,
0
,
0
,
0
,
0
);
#else
zend_string
*
subject_str
=
zend_string_init
(
subject
,
sizeof
(
subject
)
-
1
,
0
);
php_pcre_match_impl
(
cache
,
subject_str
,
result
,
subpats
,
0
,
0
,
0
,
0
);
zend_string_free
(
subject_str
);
#endif
zval
*
match
=
NULL
;
if
(
Z_LVAL_P
(
result
)
>
0
&&
Z_TYPE_P
(
subpats
)
==
IS_ARRAY
)
{
zval
*
value
=
zend_hash_index_find
(
Z_ARRVAL_P
(
subpats
),
1
);
...
...
@@ -271,7 +277,7 @@ ZEND_API void sky_execute_ex(zend_execute_data *execute_data) {
const
char
*
host
=
ZSTR_VAL
(
Z_STR_P
(
predis_host
));
peer
=
(
char
*
)
emalloc
(
strlen
(
host
)
+
10
);
bzero
(
peer
,
strlen
(
host
)
+
10
);
sprintf
(
peer
,
"%s:%
d"
,
host
,
Z_LVAL_P
(
predis_port
));
sprintf
(
peer
,
"%s:%
"
PRId3264
,
host
,
Z_LVAL_P
(
predis_port
));
}
}
}
...
...
@@ -1056,12 +1062,12 @@ static char *generate_sw3(zend_long span_id, char *peer_host, char *operation_na
zval
*
distributedTraceId
=
zend_hash_str_find
(
Z_ARRVAL
(
SKYWALKING_G
(
context
)),
"distributedTraceId"
,
sizeof
(
"distributedTraceId"
)
-
1
);
ssize_t
sw3_l
=
0
;
sw3_l
=
snprintf
(
NULL
,
0
,
"sw3: %s|%
d|%d|%d
|#%s|#%s|#%s|%s"
,
Z_STRVAL_P
(
traceId
),
span_id
,
sw3_l
=
snprintf
(
NULL
,
0
,
"sw3: %s|%
"
PRId3264
"|%d|%"
PRId3264
"
|#%s|#%s|#%s|%s"
,
Z_STRVAL_P
(
traceId
),
span_id
,
application_instance
,
Z_LVAL_P
(
entryApplicationInstance
),
peer_host
,
Z_STRVAL_P
(
entryOperationName
),
operation_name
,
Z_STRVAL_P
(
distributedTraceId
));
char
*
sw3
=
(
char
*
)
emalloc
(
sw3_l
+
1
);
bzero
(
sw3
,
sw3_l
+
1
);
snprintf
(
sw3
,
sw3_l
+
1
,
"sw3: %s|%
d|%d|%d
|#%s|#%s|#%s|%s"
,
Z_STRVAL_P
(
traceId
),
span_id
,
snprintf
(
sw3
,
sw3_l
+
1
,
"sw3: %s|%
"
PRId3264
"|%d|%"
PRId3264
"
|#%s|#%s|#%s|%s"
,
Z_STRVAL_P
(
traceId
),
span_id
,
application_instance
,
Z_LVAL_P
(
entryApplicationInstance
),
peer_host
,
Z_STRVAL_P
(
entryOperationName
),
operation_name
,
Z_STRVAL_P
(
distributedTraceId
));
return
sw3
;
...
...
@@ -1097,14 +1103,14 @@ static char *generate_sw6(zend_long span_id, char *peer_host, char *operation_na
zval_b64_encode
(
&
parentEndpointNameEncode
,
sharpParentEndpointName
);
ssize_t
sw6_l
=
0
;
sw6_l
=
snprintf
(
NULL
,
0
,
"sw6: 1-%s-%s-%
d-%d-%d
-%s-%s-%s"
,
Z_STRVAL
(
distributedTraceIdEncode
),
sw6_l
=
snprintf
(
NULL
,
0
,
"sw6: 1-%s-%s-%
"
PRId3264
"-%d-%"
PRId3264
"
-%s-%s-%s"
,
Z_STRVAL
(
distributedTraceIdEncode
),
Z_STRVAL
(
traceSegmentIdEncode
),
span_id
,
application_instance
,
Z_LVAL_P
(
entryApplicationInstance
),
Z_STRVAL
(
peerHostEncode
),
Z_STRVAL
(
entryEndpointNameEncode
),
Z_STRVAL
(
parentEndpointNameEncode
));
char
*
sw6
=
(
char
*
)
emalloc
(
sw6_l
+
1
);
bzero
(
sw6
,
sw6_l
+
1
);
snprintf
(
sw6
,
sw6_l
+
1
,
"sw6: 1-%s-%s-%
d-%d-%d
-%s-%s-%s"
,
Z_STRVAL
(
distributedTraceIdEncode
),
snprintf
(
sw6
,
sw6_l
+
1
,
"sw6: 1-%s-%s-%
"
PRId3264
"-%d-%"
PRId3264
"
-%s-%s-%s"
,
Z_STRVAL
(
distributedTraceIdEncode
),
Z_STRVAL
(
traceSegmentIdEncode
),
span_id
,
application_instance
,
Z_LVAL_P
(
entryApplicationInstance
),
Z_STRVAL
(
peerHostEncode
),
Z_STRVAL
(
entryEndpointNameEncode
),
Z_STRVAL
(
parentEndpointNameEncode
));
...
...
@@ -1370,7 +1376,7 @@ static char *get_page_request_peer() {
/**
* ip
*
*
* @since 2017年11月23日
* @copyright
* @return return_type
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录