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
d4a960fa
Commit
d4a960fa
authored
Jun 28, 2017
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
php curl 优化
parent
51caac20
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
Client.php
src/base/Client.php
+3
-1
client_config_prod.php
src/xue/client_config_prod.php
+25
-0
No files found.
src/base/Client.php
View file @
d4a960fa
...
...
@@ -142,7 +142,7 @@ class Client
return
[
$sign
,
$timestamp
,
$nonce
];
}
protected
function
request
(
$url
,
$post
=
''
,
$headers
=
array
()
)
{
protected
function
request
(
$url
,
$post
=
''
,
$headers
=
[]
)
{
$ci
=
curl_init
();
/* Curl settings */
curl_setopt
(
$ci
,
CURLOPT_USERAGENT
,
'PHP/'
.
PHP_VERSION
.
' Client/'
.
$this
->
clientId
);
...
...
@@ -158,6 +158,8 @@ class Client
$post
&&
curl_setopt
(
$ci
,
CURLOPT_POSTFIELDS
,
$post
);
}
$header
[]
=
'Expect:'
;
curl_setopt
(
$ci
,
CURLOPT_URL
,
$url
);
curl_setopt
(
$ci
,
CURLOPT_HTTPHEADER
,
$headers
);
//curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE);
...
...
src/xue/client_config_prod.php
0 → 100644
View file @
d4a960fa
<?php
/**
* Created by PhpStorm.
* User: pader
* Date: 2017/6/28
* Time: 17:13
*/
return
[
'ucenter'
=>
[
'apiUrl'
=>
'http://u.ibanshou.cn/api/server'
,
'clientId'
=>
'common'
,
'clientSecret'
=>
''
],
'xue'
=>
[
'apiUrl'
=>
'http://xue.ibanshou.cn/api'
,
'clientId'
=>
'common'
,
'clientSecret'
=>
''
],
'code'
=>
[
'apiUrl'
=>
'http://code.ibanshou.cn/site/api-server'
,
'clientId'
=>
'common'
,
'clientSecret'
=>
''
]
];
\ No newline at end of file
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