Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
one
提交
a521d94d
O
one
项目概览
OpenDocCN
/
one
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
one
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a521d94d
编写于
11月 17, 2018
作者:
lzc828
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
处理页面关闭后 后台还在执行输出的警告
上级
47aa884b
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
17 addition
and
12 deletion
+17
-12
src/Http/Controller.php
src/Http/Controller.php
+5
-6
src/Http/Request.php
src/Http/Request.php
+2
-0
src/Swoole/Event/HttpEvent.php
src/Swoole/Event/HttpEvent.php
+2
-1
src/Swoole/Listener/Port.php
src/Swoole/Listener/Port.php
+1
-1
src/Swoole/Request.php
src/Swoole/Request.php
+1
-0
src/Swoole/Response.php
src/Swoole/Response.php
+3
-1
src/Swoole/Server.php
src/Swoole/Server.php
+3
-3
未找到文件。
src/Http/Controller.php
浏览文件 @
a521d94d
...
...
@@ -2,7 +2,6 @@
namespace
One\Http
;
use
App\Protocol\AppHttpServer
;
use
One\Exceptions\HttpException
;
use
One\Facades\Log
;
...
...
@@ -20,7 +19,7 @@ class Controller
protected
$response
=
null
;
/**
* @var AppHttpServer
* @var
\App\Server\
AppHttpServer
*/
protected
$server
;
...
...
@@ -107,10 +106,10 @@ class Controller
final
protected
function
display
(
$tpl
,
$data
=
[])
{
$dir
=
substr
(
get_called_class
(),
4
);
$dir
=
str_replace
([
'Controllers'
,
'Controller'
],
''
,
$dir
);
$dir
=
str_replace
(
'\\'
,
'/'
,
$dir
);
$dir
=
str_replace
(
'//'
,
'/'
,
$dir
);
$dir
=
strtolower
(
trim
(
$dir
,
'/'
));
$dir
=
str_replace
([
'Controllers'
,
'Controller'
],
''
,
$dir
);
$dir
=
str_replace
(
'\\'
,
'/'
,
$dir
);
$dir
=
str_replace
(
'//'
,
'/'
,
$dir
);
$dir
=
strtolower
(
trim
(
$dir
,
'/'
));
return
$this
->
response
->
tpl
(
$dir
.
'/'
.
$tpl
,
$data
);
}
...
...
src/Http/Request.php
浏览文件 @
a521d94d
...
...
@@ -17,6 +17,8 @@ class Request
protected
$request
=
[];
public
$fd
=
0
;
public
$args
=
[];
public
$class
=
''
;
...
...
src/Swoole/Event/HttpEvent.php
浏览文件 @
a521d94d
...
...
@@ -42,7 +42,8 @@ trait HttpEvent
}
catch
(
\
Throwable
$e
)
{
$data
=
$e
->
getMessage
();
}
if
(
$data
)
{
$response
->
exist
=
$this
->
server
->
exist
(
$request
->
fd
);
if
(
$data
&&
$response
->
exist
)
{
$response
->
write
(
$data
);
}
...
...
src/Swoole/Listener/Port.php
浏览文件 @
a521d94d
...
...
@@ -35,7 +35,7 @@ class Port
public
function
__construct
(
$server
,
$conf
)
{
$this
->
server
=
$server
;
$this
->
conf
=
$conf
;
$this
->
conf
=
$conf
;
if
(
isset
(
$conf
[
'protocol'
]))
{
$this
->
protocol
=
$conf
[
'protocol'
];
}
...
...
src/Swoole/Request.php
浏览文件 @
a521d94d
...
...
@@ -21,6 +21,7 @@ class Request extends \One\Http\Request
foreach
(
$request
->
header
as
$k
=>
$v
){
$this
->
server
[
'HTTP_'
.
str_replace
(
'-'
,
'_'
,
strtoupper
(
$k
))]
=
$v
;
}
$this
->
fd
=
$request
->
fd
;
$this
->
cookie
=
&
$request
->
cookie
;
$this
->
get
=
&
$request
->
get
;
$this
->
post
=
&
$request
->
post
;
...
...
src/Swoole/Response.php
浏览文件 @
a521d94d
...
...
@@ -60,7 +60,9 @@ class Response extends \One\Http\Response
public
function
__destruct
()
{
$this
->
httpResponse
->
end
();
if
(
$this
->
httpResponse
->
exist
)
{
$this
->
httpResponse
->
end
();
}
}
}
\ No newline at end of file
src/Swoole/Server.php
浏览文件 @
a521d94d
...
...
@@ -40,7 +40,7 @@ class Server
public
function
__construct
(
\
swoole_server
$server
,
array
$conf
)
{
$this
->
server
=
$server
;
$this
->
conf
=
$conf
;
$this
->
conf
=
$conf
;
if
(
isset
(
$conf
[
'protocol'
]))
{
$this
->
protocol
=
$conf
[
'protocol'
];
}
...
...
@@ -68,8 +68,8 @@ class Server
public
function
onWorkerStart
(
\
swoole_server
$server
,
$worker_id
)
{
$this
->
worker_id
=
$worker_id
;
$this
->
is_task
=
$server
->
taskworker
?
true
:
false
;
$this
->
pid
=
$server
->
worker_pid
;
$this
->
is_task
=
$server
->
taskworker
?
true
:
false
;
$this
->
pid
=
$server
->
worker_pid
;
if
(
isset
(
$this
->
conf
[
'global_data'
]))
{
$this
->
globalData
=
$this
->
globalData
(
$this
->
conf
[
'global_data'
]);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录