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
728ecdcf
Commit
728ecdcf
authored
May 25, 2018
by
tufengqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
格式化文件 删除无效代码
parent
2ab88f78
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
16 deletions
+23
-16
BaseConstant.php
classes/fpf/response/BaseConstant.php
+1
-0
ResponseApi.php
classes/fpf/response/ResponseApi.php
+14
-9
ThriftAsyncServiceFactoryProxy.php
classes/fpf/thrift/ThriftAsyncServiceFactoryProxy.php
+1
-1
Application.php
classes/fpf/yii_component/Application.php
+7
-6
CookieEdit.php
classes/fpf/yii_component/views/CookieEdit.php
+0
-0
No files found.
classes/fpf/response/BaseConstant.php
View file @
728ecdcf
<?php
namespace
fpf\response
;
class
BaseConstant
...
...
classes/fpf/response/ResponseApi.php
View file @
728ecdcf
<?php
namespace
fpf\response
;
use
fpf\response\BaseConstant
;
use
yii\helpers\Html
;
use
yii\web\Response
;
...
...
@@ -24,6 +24,7 @@ class ResponseApi
* @param string $msg
* @param int $code
* @param string $flag
* @return string
*/
public
static
function
jsonError
(
$msg
=
''
,
$code
=
-
1
,
$flag
=
''
)
{
...
...
@@ -41,8 +42,9 @@ class ResponseApi
/**
* 成功返回接口
* @param string $msg
* @param string $flag
* @param int $code
* @param string $flag
* @return string
*/
public
static
function
jsonSuccess
(
$msg
=
''
,
$code
=
0
,
$flag
=
''
)
{
...
...
@@ -72,7 +74,7 @@ class ResponseApi
/**
* 根据是否为JSONP做特殊处理输出
* @param $json
* @
param string $fla
g
* @
return strin
g
*/
public
static
function
dumpJsonData
(
$json
)
{
...
...
@@ -94,7 +96,8 @@ class ResponseApi
/**
* @param $json_str
* @param $callback_key
* @param string $callback_key
* @return string
*/
public
static
function
printByJson
(
$json_str
,
$callback_key
=
''
)
{
...
...
@@ -111,9 +114,11 @@ class ResponseApi
return
$json_str
;
}
}
/**
* @param $json_str
* @param $callback_key
* @param $arr
* @param string $callback_key
* @return string
*/
public
static
function
printByArr
(
$arr
,
$callback_key
=
''
)
{
...
...
@@ -131,10 +136,10 @@ class ResponseApi
}
}
/**
* @param $json_str
* @param $callback_key
* @param $success_data
* @param string $callback_key
* @return string
*/
public
static
function
printOldSuccess
(
$success_data
,
$callback_key
=
''
)
{
...
...
classes/fpf/thrift/ThriftAsyncServiceFactoryProxy.php
View file @
728ecdcf
...
...
@@ -120,7 +120,7 @@ class ThriftAsyncServiceFactoryProxy
$protocol
=
$this
->
protocol_factory_instanse
->
getProtocol
(
$transport
);
$bin_accel
=
(
$protocol
instanceof
TBinaryProtocolAccelerated
)
&&
function_exists
(
'thrift_protocol_write_binary'
);
if
(
$bin_accel
)
{
thrift_protocol_write_binary
(
$protocol
,
$func_name
,
TMessageType
::
CALL
,
$args
O
bj
,
0
,
$protocol
->
isStrictWrite
());
thrift_protocol_write_binary
(
$protocol
,
$func_name
,
TMessageType
::
CALL
,
$args
_o
bj
,
0
,
$protocol
->
isStrictWrite
());
}
else
{
$protocol
->
writeMessageBegin
(
$func_name
,
TMessageType
::
CALL
,
0
);
$args_obj
->
write
(
$protocol
);
...
...
classes/fpf/yii_component/Application.php
View file @
728ecdcf
<?php
namespace
fpf\yii_component
;
use
Yii
;
...
...
@@ -12,19 +13,22 @@ class Application extends Component
public
$terry
;
private
$configures
=
[];
private
$debug_config
=
[];
const
APP_SELF_CONFIG_PREFIX
=
'appself_'
;
public
function
__construct
(
$config
=
[])
{
$this
->
trace_config
=
isset
(
$_GET
[
"__config"
]);
}
public
function
getDebugConfig
()
{
return
$this
->
debug_config
;
}
public
function
welcome
()
{
echo
$this
->
terry
.
"Hello Welcome to MyComponent"
;
}
/**
* 获取配置信息
* @param string $name 配置名
...
...
@@ -58,6 +62,7 @@ class Application extends Component
}
return
$config
;
}
/**
* 导入配置文件
* @param string $file 配置文件名
...
...
@@ -68,7 +73,6 @@ class Application extends Component
$config
=
[];
foreach
(
$G_CONF_PATH
as
$path
)
{
$fullpath
=
"
$path$file
.php"
;
$exists
=
false
;
if
(
!
file_exists
(
$fullpath
))
{
continue
;
}
...
...
@@ -92,17 +96,13 @@ class Application extends Component
{
$set_cookie_val
=
Yii
::
$app
->
request
->
get
(
'set_cookie_val'
,
''
);
if
(
$set_cookie_val
)
{
$cookies
=
Yii
::
$app
->
response
->
cookies
;
setcookie
(
VERSION_KEY
,
$set_cookie_val
,
time
()
+
3600
*
24
*
7
);
\Yii
::
$app
->
response
->
format
=
Response
::
FORMAT_RAW
;
\Yii
::
$app
->
response
->
headers
->
add
(
'Content-type'
,
'application/javascript;charset=utf-8'
);
\Yii
::
$app
->
response
->
send
();
return
;
}
$app_self_config
=
Yii
::
$app
->
fpf
->
getConfig
(
self
::
APP_SELF_CONFIG_PREFIX
.
APP_NAME
,
'common'
);
$user_ip
=
Yii
::
$app
->
request
->
userIP
;
$host_name
=
Yii
::
$app
->
request
->
getHostName
();
$is_online_host
=
$this
->
isOnlineHost
(
$host_name
);
if
(
$this
->
isAllowIp
(
$user_ip
))
{
\Yii
::
$app
->
response
->
headers
->
add
(
'Content-type'
,
'text/html'
);
\Yii
::
$app
->
response
->
send
();
...
...
@@ -124,6 +124,7 @@ class Application extends Component
}
return
$ret
;
}
private
function
isAllowIp
(
$user_ip
)
{
$company_ip_list
=
Yii
::
$app
->
fpf
->
getConfig
(
'company_ip_list'
,
'ip'
);
...
...
classes/fpf/yii_component/views/CookieEdit.php
View file @
728ecdcf
This diff is collapsed.
Click to expand it.
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