Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wxh_internal_api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
杨培培
wxh_internal_api
Commits
dad94e48
Commit
dad94e48
authored
Jul 06, 2017
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化调试信息输出
parent
294541b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
15 deletions
+20
-15
Client.php
src/base/Client.php
+20
-15
No files found.
src/base/Client.php
View file @
dad94e48
...
@@ -230,29 +230,34 @@ class Client
...
@@ -230,29 +230,34 @@ class Client
curl_close
(
$ci
);
curl_close
(
$ci
);
if
(
$this
->
debug
)
{
if
(
$this
->
debug
)
{
echo
"<pre>
\r\n
=====INFO=====
\r\n
"
;
$info
=
"=====INFO=====
\r\n
"
echo
"Request URL:
$url
\r\n
"
,
.
"Request URL:
$url
\r\n
"
"Remote Address:
{
$httpInfo
[
'primary_ip'
]
}
:
{
$httpInfo
[
'primary_port'
]
}
\r\n
"
,
.
"Remote Address:
{
$httpInfo
[
'primary_ip'
]
}
:
{
$httpInfo
[
'primary_port'
]
}
\r\n
"
"Local Address:
{
$httpInfo
[
'local_ip'
]
}
:
{
$httpInfo
[
'local_port'
]
}
\r\n
"
,
.
"Local Address:
{
$httpInfo
[
'local_ip'
]
}
:
{
$httpInfo
[
'local_port'
]
}
\r\n
"
"Namelookup Time:
{
$httpInfo
[
'namelookup_time'
]
}
\r\n
"
,
.
"Namelookup Time:
{
$httpInfo
[
'namelookup_time'
]
}
\r\n
"
"Connect Time:
{
$httpInfo
[
'connect_time'
]
}
\r\n
"
,
.
"Connect Time:
{
$httpInfo
[
'connect_time'
]
}
\r\n
"
"Pre Transfer Time:
{
$httpInfo
[
'pretransfer_time'
]
}
\r\n
"
,
.
"Pre Transfer Time:
{
$httpInfo
[
'pretransfer_time'
]
}
\r\n
"
"Start Transfer Time:
{
$httpInfo
[
'starttransfer_time'
]
}
\r\n
"
,
.
"Start Transfer Time:
{
$httpInfo
[
'starttransfer_time'
]
}
\r\n
"
"File Time:
{
$httpInfo
[
'filetime'
]
}
\r\n
"
,
.
"File Time:
{
$httpInfo
[
'filetime'
]
}
\r\n
"
"Total Time:
{
$httpInfo
[
'total_time'
]
}
\r\n
"
;
.
"Total Time:
{
$httpInfo
[
'total_time'
]
}
\r\n
"
;
if
(
isset
(
$errno
))
{
if
(
isset
(
$errno
))
{
echo
"
\r\n
=====ERROR=====
\r\n
ErrorNo:
$errno
\r\n
ErrorMsg:
$errmsg
\r\n
"
;
$info
.=
"
\r\n
=====ERROR=====
\r\n
ErrorNo:
$errno
\r\n
ErrorMsg:
$errmsg
\r\n
"
;
}
}
echo
"
\r\n
=====REQUEST=====
\r\n
"
,
$httpInfo
[
'request_header'
]
;
$info
.=
"
\r\n
=====REQUEST=====
\r\n
{
$httpInfo
[
'request_header'
]
}
"
;
if
(
isset
(
$body
))
{
if
(
isset
(
$body
))
{
echo
$body
.
"
\r\n
"
;
$info
.=
$body
.
"
\r\n
"
;
}
}
echo
"
\r\n
=====RESPONSE=====
\r\n
"
,
$responseHeaders
,
$response
;
$info
.=
"
\r\n
=====RESPONSE=====
\r\n
{
$responseHeaders
}{
$response
}
"
;
echo
"
\r\n
</pre>"
;
if
(
PHP_SAPI
==
'cli'
||
(
isset
(
$_SERVER
[
'HTTP_X_REQUESTED_WITH'
])
&&
$_SERVER
[
'HTTP_X_REQUESTED_WITH'
]
==
'XMLHttpRequest'
)
||
empty
(
$_SERVER
[
'HTTP_USER_AGENT'
]))
{
echo
$info
.
"
\r\n
"
;
}
else
{
echo
'<pre>'
.
htmlspecialchars
(
$info
)
.
'</pre>'
;
}
}
}
return
[
$httpCode
,
$response
];
return
[
$httpCode
,
$response
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment