Commit 26d04f74 authored by tufengqi's avatar tufengqi

remove or

parent 107e252a
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment