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
de0e105f
Commit
de0e105f
authored
Sep 12, 2018
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
8c44a276
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
13 deletions
+7
-13
TraitYiiHashTable.php
classes/fpf/cache/TraitYiiHashTable.php
+0
-7
CurlHttpClient.php
classes/fpf/http/CurlHttpClient.php
+5
-4
FpfHttpClient.php
classes/fpf/http/FpfHttpClient.php
+2
-2
No files found.
classes/fpf/cache/TraitYiiHashTable.php
View file @
de0e105f
...
...
@@ -59,13 +59,6 @@ trait TraitYiiHashTable
return
Yii
::
$app
->
redis
->
hset
(
$table
,
$key
,
$value
);
}
public
static
function
getHashDataByTable
(
$table
,
$cursor
=
0
,
$match
=
null
,
$pattern
=
null
,
$count
=
0
)
{
self
::
checkTable
(
self
::
DB_NAME
,
$table
);
$table
=
self
::
getHashTable
(
self
::
DB_NAME
,
$table
);
return
Yii
::
$app
->
redis
->
hscan
(
$table
,
$cursor
/*, $match, $pattern, $count*/
);
}
private
static
function
checkTable
(
$db_name
,
$table
)
{
DefaultBaseImpl
::
checkTable
(
$db_name
,
$table
);
...
...
classes/fpf/http/CurlHttpClient.php
View file @
de0e105f
...
...
@@ -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
)
;
}
/**
...
...
@@ -87,6 +87,7 @@ class CurlHttpClient
if
(
!
empty
(
$options
[
'cookies'
]))
{
$this
->
cookies
=
$options
[
'cookies'
];
}
echo
$this
->
timeout_ms
;
exit
;
$this
->
method
=
self
::
METHOD_GET
;
$this
->
flush
();
return
$this
->
response
;
...
...
classes/fpf/http/FpfHttpClient.php
View file @
de0e105f
...
...
@@ -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
();
}
else
{
$this
->
http_client
=
new
CurlHttpClient
();
$this
->
http_client
=
new
CurlHttpClient
(
$config
);
}
}
...
...
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