Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2_swoft_connector_33cn
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
yii2_swoft_connector_33cn
Commits
26d04f74
Commit
26d04f74
authored
Jul 16, 2018
by
tufengqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove or
parent
107e252a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
YiiWeb.php
src/YiiWeb.php
+9
-9
No files found.
src/YiiWeb.php
View file @
26d04f74
...
...
@@ -34,30 +34,30 @@ class YiiWeb
public
function
onWorkerStart
(
Server
$server
,
int
$workerId
,
bool
$isWorker
)
{
if
(
!
$isWorker
)
{
if
(
!
$isWorker
)
{
$this
->
enable
=
false
;
return
false
;
}
if
(
!
$server
instanceof
HttpServer
)
{
if
(
!
$server
instanceof
HttpServer
)
{
$this
->
enable
=
false
;
return
false
;
}
$config
=
App
::
getProperties
();
if
(
!
empty
(
$config
[
'yiiConfig'
]))
{
if
(
!
empty
(
$config
[
'yiiConfig'
]))
{
$yiiConfig
=
$config
[
'yiiConfig'
];
$this
->
config
=
$yiiConfig
[
'config'
];
$this
->
debug
=
$yiiConfig
[
'debug'
];
$this
->
env
=
$yiiConfig
[
'env'
];
}
else
{
}
else
{
$this
->
enable
=
false
;
return
false
;
}
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
$this
->
debug
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
$this
->
env
);
defined
(
'YII_ENABLE_ERROR_HANDLER'
)
or
define
(
'YII_ENABLE_ERROR_HANDLER'
,
$this
->
env
);
//必须关闭 Yii 的错误处理器
defined
(
'YII_DEBUG'
)
||
define
(
'YII_DEBUG'
,
$this
->
debug
);
defined
(
'YII_ENV'
)
||
define
(
'YII_ENV'
,
$this
->
env
);
defined
(
'YII_ENABLE_ERROR_HANDLER'
)
||
define
(
'YII_ENABLE_ERROR_HANDLER'
,
$this
->
env
);
//必须关闭 Yii 的错误处理器
$path
=
App
::
getAlias
(
'@vendor/foge/swoole-yii2/Yii.php'
);
require_once
(
$path
);
\Yii
::
$container
=
new
NullContainer
();
...
...
@@ -72,7 +72,7 @@ class YiiWeb
public
function
beforeRequest
()
{
if
(
!
$this
->
enable
)
{
if
(
!
$this
->
enable
)
{
return
false
;
}
...
...
@@ -93,7 +93,7 @@ class YiiWeb
public
function
afterRequest
()
{
if
(
!
$this
->
enable
)
{
if
(
!
$this
->
enable
)
{
return
false
;
}
...
...
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