Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
one
提交
1ed1767e
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 搜索 >>
提交
1ed1767e
编写于
6月 13, 2019
作者:
lzc828
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
错误号码
上级
bc9bae5a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
18 addition
and
14 deletion
+18
-14
src/Database/Mysql/Build.php
src/Database/Mysql/Build.php
+1
-1
src/Exceptions/Handler.php
src/Exceptions/Handler.php
+9
-5
src/Swoole/Client/Tcp.php
src/Swoole/Client/Tcp.php
+1
-1
src/Swoole/RpcClientTcp.php
src/Swoole/RpcClientTcp.php
+3
-3
src/Swoole/Server.php
src/Swoole/Server.php
+3
-3
src/run.php
src/run.php
+1
-1
未找到文件。
src/Database/Mysql/Build.php
浏览文件 @
1ed1767e
...
...
@@ -553,7 +553,7 @@ class Build
}
else
if
(
method_exists
(
$this
->
model
,
$name
))
{
return
$this
->
model
->
$name
(
...
$arguments
);
}
else
{
throw
new
DbException
(
'Undefined method '
.
$name
);
throw
new
DbException
(
'Undefined method '
.
$name
,
556
);
}
}
...
...
src/Exceptions/Handler.php
浏览文件 @
1ed1767e
...
...
@@ -6,16 +6,20 @@ class Handler
{
public
static
function
render
(
HttpException
$e
)
{
$e
->
response
->
code
(
$e
->
getCode
());
$code
=
$e
->
getCode
();
if
(
$code
===
0
)
{
$code
=
1
;
}
$e
->
response
->
code
(
$code
);
if
(
$e
->
response
->
getHttpRequest
()
->
isJson
())
{
return
$e
->
response
->
json
(
format_json
(
$e
->
getMessage
(),
$
e
->
getCode
()
,
$e
->
response
->
getHttpRequest
()
->
id
()));
return
$e
->
response
->
json
(
format_json
(
$e
->
getMessage
(),
$
code
,
$e
->
response
->
getHttpRequest
()
->
id
()));
}
else
{
$file
=
_APP_PATH_VIEW_
.
'/exceptions/'
.
$
e
->
getCode
()
.
'.php'
;
$file
=
_APP_PATH_VIEW_
.
'/exceptions/'
.
$
code
.
'.php'
;
if
(
file_exists
(
$file
))
{
return
$e
->
response
->
tpl
(
'exceptions/'
.
$
e
->
getCode
()
,
[
'e'
=>
$e
]);
return
$e
->
response
->
tpl
(
'exceptions/'
.
$
code
,
[
'e'
=>
$e
]);
}
else
{
return
$e
->
response
->
json
(
format_json
(
$e
->
getMessage
(),
$
e
->
getCode
()
,
$e
->
response
->
getHttpRequest
()
->
id
()));
return
$e
->
response
->
json
(
format_json
(
$e
->
getMessage
(),
$
code
,
$e
->
response
->
getHttpRequest
()
->
id
()));
}
}
}
...
...
src/Swoole/Client/Tcp.php
浏览文件 @
1ed1767e
...
...
@@ -62,7 +62,7 @@ class Tcp
if
(
$r
)
{
return
$client
;
}
else
{
throw
new
\
Exception
(
'连接失败 tcp://'
.
$this
->
config
[
'ip'
]
.
':'
.
$this
->
config
[
'port'
]);
throw
new
\
Exception
(
'连接失败 tcp://'
.
$this
->
config
[
'ip'
]
.
':'
.
$this
->
config
[
'port'
]
,
650
);
}
}
...
...
src/Swoole/RpcClientTcp.php
浏览文件 @
1ed1767e
...
...
@@ -74,7 +74,7 @@ namespace One\Swoole {
$buffer
=
pack
(
'N'
,
4
+
strlen
(
$buffer
))
.
$buffer
;
$len
=
fwrite
(
self
::
$_connection
,
$buffer
);
if
(
$len
!==
strlen
(
$buffer
))
{
throw
new
\
Exception
(
'writeToRemote fail'
);
throw
new
\
Exception
(
'writeToRemote fail'
,
11
);
}
$data
=
msgpack_unpack
(
$this
->
read
());
if
(
$data
===
self
::
RPC_REMOTE_OBJ
)
{
...
...
@@ -95,7 +95,7 @@ namespace One\Swoole {
while
(
1
)
{
$buffer
=
fread
(
self
::
$_connection
,
8192
);
if
(
$buffer
===
''
||
$buffer
===
false
)
{
throw
new
\
Exception
(
'read from remote fail'
);
throw
new
\
Exception
(
'read from remote fail'
,
2
);
}
$all_buffer
.
=
$buffer
;
$recv_len
=
strlen
(
$all_buffer
);
...
...
@@ -118,7 +118,7 @@ namespace One\Swoole {
{
$connection
=
stream_socket_client
(
$this
->
_rpc_server
,
$code
,
$msg
,
3
);
if
(
!
$connection
)
{
throw
new
\
Exception
(
$msg
);
throw
new
\
Exception
(
$msg
,
3
);
}
stream_set_timeout
(
$connection
,
$this
->
_time_out
);
return
$connection
;
...
...
src/Swoole/Server.php
浏览文件 @
1ed1767e
...
...
@@ -19,7 +19,7 @@ use Swoole\Process;
*/
class
Server
{
protected
$conf
=
[];
/**
...
...
@@ -94,7 +94,7 @@ class Server
public
function
onClose
(
\
swoole_server
$server
,
$fd
,
$reactor_id
)
{
}
public
function
onPipeMessage
(
\
swoole_server
$server
,
$src_worker_id
,
$message
)
...
...
@@ -117,7 +117,7 @@ class Server
if
(
method_exists
(
$this
->
server
,
$name
))
{
return
$this
->
server
->
$name
(
...
$arguments
);
}
else
{
throw
new
\
Exception
(
'方法不存在:'
.
$name
);
throw
new
\
Exception
(
'方法不存在:'
.
$name
,
10
);
}
}
...
...
src/run.php
浏览文件 @
1ed1767e
...
...
@@ -10,6 +10,6 @@ if (!defined('_DEBUG_')) {
define
(
'_DEBUG_'
,
false
);
}
define
(
'_ONE_V_'
,
'1.7.
3
'
);
define
(
'_ONE_V_'
,
'1.7.
4
'
);
require
__DIR__
.
'/helper.php'
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录