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
2ab88f78
Commit
2ab88f78
authored
May 25, 2018
by
tufengqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
格式化代码
parent
a7f959fd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
19 deletions
+14
-19
TCurlClient.php
classes/fpf/thrift/TCurlClient.php
+2
-2
TGuzzleClient.php
classes/fpf/thrift/TGuzzleClient.php
+3
-3
THttpClient.php
classes/fpf/thrift/THttpClient.php
+4
-4
ThriftAsyncDetailInstanse.php
classes/fpf/thrift/ThriftAsyncDetailInstanse.php
+2
-0
ThriftAsyncServiceFactoryProxy.php
classes/fpf/thrift/ThriftAsyncServiceFactoryProxy.php
+1
-6
ThriftServiceFactory.php
classes/fpf/thrift/ThriftServiceFactory.php
+1
-2
ThriftServiceFactoryProxy.php
classes/fpf/thrift/ThriftServiceFactoryProxy.php
+1
-2
No files found.
classes/fpf/thrift/TCurlClient.php
View file @
2ab88f78
...
...
@@ -101,8 +101,8 @@ class TCurlClient extends \Thrift\Transport\TTransport
*/
public
function
__construct
(
$host
,
$port
=
80
,
$uri_no_func
=
''
,
$scheme
=
'http'
)
{
if
((
TStringFuncFactory
::
create
()
->
strlen
(
$uri_no_func
)
>
0
)
&&
(
$uri_no_func
{
0
}
!=
'/'
))
{
if
((
TStringFuncFactory
::
create
()
->
strlen
(
$uri_no_func
)
>
0
)
&&
(
$uri_no_func
{
0
}
!=
'/'
))
{
$uri_no_func
=
'/'
.
$uri_no_func
;
}
$this
->
scheme_
=
$scheme
;
...
...
classes/fpf/thrift/TGuzzleClient.php
View file @
2ab88f78
...
...
@@ -103,8 +103,8 @@ class TGuzzleClient extends \Thrift\Transport\TTransport
*/
public
function
__construct
(
$host
,
$port
=
80
,
$uri_no_func
=
''
,
$scheme
=
'http'
)
{
if
((
TStringFuncFactory
::
create
()
->
strlen
(
$uri_no_func
)
>
0
)
&&
(
$uri_no_func
{
0
}
!=
'/'
))
{
if
((
TStringFuncFactory
::
create
()
->
strlen
(
$uri_no_func
)
>
0
)
&&
(
$uri_no_func
{
0
}
!=
'/'
))
{
$uri_no_func
=
'/'
.
$uri_no_func
;
}
$this
->
scheme_
=
$scheme
;
...
...
@@ -202,7 +202,7 @@ class TGuzzleClient extends \Thrift\Transport\TTransport
*/
public
function
flush
()
{
// God, PHP really has some esoteric ways of doing simple things.
// God, PHP really has some esoteric ways of doing simple things.
$host
=
$this
->
host_
.
(
$this
->
port_
!=
80
?
':'
.
$this
->
port_
:
''
);
$fullUrl
=
$this
->
scheme_
.
"://"
.
$host
.
$this
->
uri_
;
...
...
classes/fpf/thrift/THttpClient.php
View file @
2ab88f78
...
...
@@ -99,8 +99,8 @@ class THttpClient extends \Thrift\Transport\TTransport
*/
public
function
__construct
(
$host
,
$port
=
80
,
$uri_no_func
=
''
,
$scheme
=
'http'
)
{
if
((
TStringFuncFactory
::
create
()
->
strlen
(
$uri_no_func
)
>
0
)
&&
(
$uri_no_func
{
0
}
!=
'/'
))
{
if
((
TStringFuncFactory
::
create
()
->
strlen
(
$uri_no_func
)
>
0
)
&&
(
$uri_no_func
{
0
}
!=
'/'
))
{
$uri_no_func
=
'/'
.
$uri_no_func
;
}
$this
->
scheme_
=
$scheme
;
...
...
@@ -174,13 +174,13 @@ class THttpClient extends \Thrift\Transport\TTransport
if
(
$md
[
'timed_out'
])
{
throw
new
TTransportException
(
'THttpClient: timed out reading '
.
$len
.
' bytes from '
.
$this
->
host_
.
':'
.
$this
->
port_
.
$this
->
uri_
,
$this
->
host_
.
':'
.
$this
->
port_
.
$this
->
uri_
,
TTransportException
::
TIMED_OUT
);
}
else
{
throw
new
TTransportException
(
'THttpClient: Could not read '
.
$len
.
' bytes from '
.
$this
->
host_
.
':'
.
$this
->
port_
.
$this
->
uri_
,
$this
->
host_
.
':'
.
$this
->
port_
.
$this
->
uri_
,
TTransportException
::
UNKNOWN
);
}
...
...
classes/fpf/thrift/ThriftAsyncDetailInstanse.php
View file @
2ab88f78
<?php
namespace
fpf\thrift
;
use
Thrift\Type\TMessageType
;
...
...
@@ -9,6 +10,7 @@ class ThriftAsyncDetailInstanse
private
$promise
=
null
;
private
$class_name
=
''
;
private
$func_name
=
''
;
public
function
__construct
(
$promise
,
$protocol
,
$class_name
,
$func_name
)
{
$this
->
promise
=
$promise
;
...
...
classes/fpf/thrift/ThriftAsyncServiceFactoryProxy.php
View file @
2ab88f78
...
...
@@ -14,14 +14,9 @@ use Thrift\Factory\TStringFuncFactory;
class
ThriftAsyncServiceFactoryProxy
{
private
$instance
=
null
;
private
$transport
=
null
;
private
$socket
=
null
;
private
$promise
=
null
;
private
$protocol_list
=
null
;
private
$request_base_params
=
null
;
private
$tem_class_name
=
''
;
private
$class_name
=
''
;
private
$func_name
=
''
;
const
BINARY
=
0
;
const
JSON
=
1
;
...
...
@@ -92,7 +87,7 @@ class ThriftAsyncServiceFactoryProxy
goto
doEnd
;
}
doEnd
:
if
(
$error
)
{
if
(
$error
)
{
return
ResponseApi
::
arrFail
(
$error
);
}
return
ResponseApi
::
arrSuccess
([
$tem_arr
[
1
],
$matches
[
1
]]);
...
...
classes/fpf/thrift/ThriftServiceFactory.php
View file @
2ab88f78
...
...
@@ -2,8 +2,6 @@
namespace
fpf\thrift
;
use
fpf\thrift\ThriftAsyncServiceFactoryProxy
;
class
ThriftServiceFactory
{
...
...
@@ -18,6 +16,7 @@ class ThriftServiceFactory
self
::
$sync_services
[
$class_name
]
=
new
ThriftServiceFactoryProxy
(
$class_name
);
return
self
::
$sync_services
[
$class_name
];
}
public
static
function
getAsyncService
(
$class_name
)
{
if
(
!
empty
(
self
::
$async_services
[
$class_name
]))
{
...
...
classes/fpf/thrift/ThriftServiceFactoryProxy.php
View file @
2ab88f78
...
...
@@ -18,7 +18,6 @@ class ThriftServiceFactoryProxy
{
$service_default_protocol
=
Yii
::
$app
->
fpf
->
getConfig
(
'service_default_protocol'
,
'thrift_service'
);
$service_default_hosts
=
Yii
::
$app
->
fpf
->
getConfig
(
'service_default_hosts'
,
'thrift_service'
);
$service_default_failure_policy
=
Yii
::
$app
->
fpf
->
getConfig
(
'service_default_failure_policy'
,
'thrift_service'
);
$service_module_hosts
=
Yii
::
$app
->
fpf
->
getConfig
(
'service_module_hosts'
,
'thrift_service'
);
$check_ret
=
$this
->
checkService
(
$class_name
);
if
(
true
===
$check_ret
[
BaseConstant
::
ERROR
])
{
...
...
@@ -78,7 +77,7 @@ class ThriftServiceFactoryProxy
goto
doEnd
;
}
doEnd
:
if
(
$error
)
{
if
(
$error
)
{
return
ResponseApi
::
arrFail
(
$error
);
}
return
ResponseApi
::
arrSuccess
([
$tem_arr
[
1
],
$matches
[
1
]]);
...
...
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