Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
SkyAPM
SkyAPM-php-sdk
提交
d016eccf
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,发现更多精彩内容 >>
提交
d016eccf
编写于
12月 12, 2018
作者:
H
heyanlong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
default port
上级
d04e02cd
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
17 addition
and
19 deletion
+17
-19
sky-php7ext/skywalking.c
sky-php7ext/skywalking.c
+11
-13
sky-php7ext/src/report/report_client.cpp
sky-php7ext/src/report/report_client.cpp
+6
-6
未找到文件。
sky-php7ext/skywalking.c
浏览文件 @
d016eccf
...
@@ -180,7 +180,6 @@ void sky_curl_exec_handler(INTERNAL_FUNCTION_PARAMETERS)
...
@@ -180,7 +180,6 @@ void sky_curl_exec_handler(INTERNAL_FUNCTION_PARAMETERS)
char
*
sw3
=
generate_sw3
(
Z_LVAL_P
(
span_id
)
+
1
,
_peer_host
,
_op_name
);
char
*
sw3
=
generate_sw3
(
Z_LVAL_P
(
span_id
)
+
1
,
_peer_host
,
_op_name
);
zend_string_release
(
_peer_host
);
zend_string_release
(
_peer_host
);
zend_string_release
(
_op_name
);
zend_string_release
(
_op_name
);
if
(
sw3
!=
NULL
)
{
if
(
sw3
!=
NULL
)
{
zval
z_sw3
;
zval
z_sw3
;
array_init
(
&
z_sw3
);
array_init
(
&
z_sw3
);
...
@@ -207,18 +206,21 @@ void sky_curl_exec_handler(INTERNAL_FUNCTION_PARAMETERS)
...
@@ -207,18 +206,21 @@ void sky_curl_exec_handler(INTERNAL_FUNCTION_PARAMETERS)
orig_curl_exec
(
INTERNAL_FUNCTION_PARAM_PASSTHRU
);
orig_curl_exec
(
INTERNAL_FUNCTION_PARAM_PASSTHRU
);
zval
function_name_1
,
curlInfo_1
;
call_user_function
(
CG
(
function_table
),
NULL
,
&
function_name
,
&
curlInfo
,
1
,
params
);
zval
params_1
[
1
];
zval_dtor
(
&
params
[
0
]);
ZVAL_COPY
(
&
params_1
[
0
],
zid
);
zval_dtor
(
&
function_name
);
ZVAL_STRING
(
&
function_name_1
,
"curl_getinfo"
);
call_user_function
(
CG
(
function_table
),
NULL
,
&
function_name_1
,
&
curlInfo_1
,
1
,
params_1
);
zval_dtor
(
&
params_1
[
0
]);
zval_dtor
(
&
function_name_1
);
zval
*
z_http_code
;
zval
*
z_http_code
;
l_millisecond
=
get_millisecond
();
l_millisecond
=
get_millisecond
();
millisecond
=
zend_atol
(
l_millisecond
,
strlen
(
l_millisecond
));
millisecond
=
zend_atol
(
l_millisecond
,
strlen
(
l_millisecond
));
efree
(
l_millisecond
);
efree
(
l_millisecond
);
z_http_code
=
zend_hash_str_find
(
Z_ARRVAL
(
curlInfo
),
ZEND_STRL
(
"http_code"
));
z_http_code
=
zend_hash_str_find
(
Z_ARRVAL
(
curlInfo
_1
),
ZEND_STRL
(
"http_code"
));
zval_dtor
(
&
curlInfo
);
zval_dtor
(
&
curlInfo
_1
);
add_assoc_long
(
&
temp
,
"endTime"
,
millisecond
);
add_assoc_long
(
&
temp
,
"endTime"
,
millisecond
);
...
@@ -278,17 +280,13 @@ static void write_log(char *text) {
...
@@ -278,17 +280,13 @@ static void write_log(char *text) {
char
message
[
strlen
(
text
)
+
1
];
char
message
[
strlen
(
text
)
+
1
];
log_path
=
SKY_G
(
log_path
);
log_path
=
SKY_G
(
log_path
);
zend_string
*
date_fmt
,
*
_log_path
,
*
_log_path_lower
;
zend_string
*
_log_path
,
*
_log_path_lower
;
time_t
t
;
t
=
time
(
NULL
);
date_fmt
=
php_format_date
(
"YmdHi"
,
sizeof
(
"YmdHi"
)
-
1
,
t
,
1
);
_log_path
=
zend_string_init
(
log_path
,
strlen
(
log_path
),
0
);
_log_path
=
zend_string_init
(
log_path
,
strlen
(
log_path
),
0
);
_log_path_lower
=
php_string_tolower
(
_log_path
);
_log_path_lower
=
php_string_tolower
(
_log_path
);
bzero
(
logFilename
,
100
);
bzero
(
logFilename
,
100
);
sprintf
(
logFilename
,
"%s/skywalking.%
s.log"
,
ZSTR_VAL
(
_log_path_lower
),
ZSTR_VAL
(
date_fmt
));
sprintf
(
logFilename
,
"%s/skywalking.%
d.log"
,
ZSTR_VAL
(
_log_path_lower
),
get_second
(
));
zend_string_release
(
date_fmt
);
zend_string_release
(
_log_path
);
zend_string_release
(
_log_path
);
zend_string_release
(
_log_path_lower
);
zend_string_release
(
_log_path_lower
);
bzero
(
message
,
strlen
(
text
));
bzero
(
message
,
strlen
(
text
));
...
...
sky-php7ext/src/report/report_client.cpp
浏览文件 @
d016eccf
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#include <string>
#include <string>
#include <sys/types.h>
#include <sys/types.h>
#include <dirent.h>
#include <dirent.h>
#include <sys/time.h>
#include <regex>
#include <regex>
#include <chrono>
#include <chrono>
#include <cstdio>
#include <cstdio>
...
@@ -118,12 +119,11 @@ int main(int argc, char **argv) {
...
@@ -118,12 +119,11 @@ int main(int argc, char **argv) {
if
(
valid
)
{
if
(
valid
)
{
time_t
t
=
time
(
NULL
);
struct
timeval
tv
;
t
=
t
-
65
;
gettimeofday
(
&
tv
,
NULL
);
char
ch
[
64
]
=
{
0
};
strftime
(
ch
,
sizeof
(
ch
)
-
1
,
"%Y%m%d%H%M"
,
localtime
(
&
t
));
long
fileTime
=
std
::
stol
(
result
[
1
]);
unsigned
long
fileTime
=
std
::
stoul
(
result
[
1
]);
long
localTime
=
tv
.
tv_sec
-
3
;
unsigned
long
localTime
=
std
::
stoul
(
ch
);
if
(
fileTime
<
localTime
)
{
if
(
fileTime
<
localTime
)
{
std
::
ifstream
file
;
std
::
ifstream
file
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录