Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
system
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
_site-res
system
Commits
370a0e05
Commit
370a0e05
authored
Sep 12, 2018
by
tufengqi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '
TRADE-539
' into 'master'
Resolve
TRADE-539
Closes
TRADE-539
See merge request
!12
parents
495f90f1
5e94e4b3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
CurlHttpClient.php
classes/fpf/http/CurlHttpClient.php
+4
-4
FpfHttpClient.php
classes/fpf/http/FpfHttpClient.php
+3
-3
SwooleHttpClient.php
classes/fpf/http/SwooleHttpClient.php
+4
-4
No files found.
classes/fpf/http/CurlHttpClient.php
View file @
370a0e05
...
...
@@ -43,11 +43,11 @@ class CurlHttpClient
const
METHOD_POST
=
'POST'
;
const
METHOD_GET
=
'GET'
;
public
function
__construct
()
public
function
__construct
(
$config
=
[]
)
{
$
config
=
\Yii
::
$app
->
fpf
->
loadConfig
(
'http_options'
);
$this
->
connect_timeout_ms
=
$config
[
'connect_timeout'
]
??
10
;
$this
->
timeout_ms
=
$config
[
'timeout_ms'
]
??
100
;
$
http_option
=
\Yii
::
$app
->
fpf
->
loadConfig
(
'http_options'
);
$this
->
connect_timeout_ms
=
isset
(
$config
[
'connect_timeout'
])
?
$config
[
'connect_timeout'
]
:
(
$http_option
[
'connect_timeout'
]
??
10
)
;
$this
->
timeout_ms
=
isset
(
$config
[
'timeout_ms'
])
?
$config
[
'timeout_ms'
]
:
(
$http_option
[
'timeout_ms'
]
??
100
)
;
}
/**
...
...
classes/fpf/http/FpfHttpClient.php
View file @
370a0e05
...
...
@@ -12,12 +12,12 @@ class FpfHttpClient
*/
private
$http_client
;
public
function
__construct
()
public
function
__construct
(
$config
=
[]
)
{
if
(
defined
(
'IS_SWOOLE_SERVICE'
)
&&
IS_SWOOLE_SERVICE
===
true
)
{
$this
->
http_client
=
new
SwooleHttpClient
();
$this
->
http_client
=
new
SwooleHttpClient
(
$config
);
}
else
{
$this
->
http_client
=
new
CurlHttpClient
();
$this
->
http_client
=
new
CurlHttpClient
(
$config
);
}
}
...
...
classes/fpf/http/SwooleHttpClient.php
View file @
370a0e05
...
...
@@ -49,11 +49,11 @@ class SwooleHttpClient
const
METHOD_POST
=
'POST'
;
const
METHOD_GET
=
'GET'
;
public
function
__construct
()
public
function
__construct
(
$config
=
[]
)
{
$
config
=
\Yii
::
$app
->
fpf
->
loadConfig
(
'http_options'
);
$this
->
connect_timeout_ms
=
$config
[
'connect_timeout'
]
??
10
;
$this
->
timeout_ms
=
$config
[
'timeout_ms'
]
??
100
;
$
http_option
=
\Yii
::
$app
->
fpf
->
loadConfig
(
'http_options'
);
$this
->
connect_timeout_ms
=
isset
(
$config
[
'connect_timeout'
])
?
$config
[
'connect_timeout'
]
:
(
$http_option
[
'connect_timeout'
]
??
10
)
;
$this
->
timeout_ms
=
isset
(
$config
[
'timeout_ms'
])
?
$config
[
'timeout_ms'
]
:
(
$http_option
[
'timeout_ms'
]
??
100
)
;
}
/**
...
...
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