diff --git a/README.md b/README.md index abeefe0..d5721df 100644 --- a/README.md +++ b/README.md @@ -146,8 +146,7 @@ Some rule or Docs May help you when you rebuild this project: | Name | Used As | Repo | Docs | |:--|:--:|:--:|:--:| -| MixPHP | Framework | https://github.com/mix-php/mix-framework/tree/v1 | https://www.kancloud.cn/onanying/mixphp1/379324 ( Chinese Version ) | -| siriusphp/validation | Validator | https://github.com/siriusphp/validation | http://www.sirius.ro/php/sirius/validation/ | -| league/plates | Template system | https://github.com/thephpleague/plates | http://platesphp.com/ | - +| [MixPHP](https://github.com/mix-php/mix-framework/tree/v1) | Framework | https://www.kancloud.cn/onanying/mixphp1/379324 ( Chinese Version ) | +| [siriusphp/validation](https://github.com/siriusphp/validation) | Validator | http://www.sirius.ro/php/sirius/validation/ | +| [league/plates](https://github.com/thephpleague/plates) | Template system | http://platesphp.com/ | diff --git a/apps/controllers/AuthController.php b/apps/controllers/AuthController.php index dbdcbbf..c5a402d 100644 --- a/apps/controllers/AuthController.php +++ b/apps/controllers/AuthController.php @@ -104,7 +104,6 @@ public function actionLogout() { // TODO add CSRF protect app()->user->deleteUserThisSession(); - // TODO update this session status (set it expired) in database return app()->response->redirect('/auth/login'); } } diff --git a/apps/views/rss_feed.php b/apps/views/rss_feed.php index 46cdeba..b20880b 100644 --- a/apps/views/rss_feed.php +++ b/apps/views/rss_feed.php @@ -22,7 +22,7 @@ <?= addslashes($site_name . ' Torrents') ?> - + ]]> en diff --git a/framework/Console/Input.php b/framework/Console/Input.php index 1a2718b..38b3464 100644 --- a/framework/Console/Input.php +++ b/framework/Console/Input.php @@ -22,8 +22,7 @@ class Input extends Component // 初始化事件 public function onInitialize() { - parent::onInitialize(); // TODO: Change the autogenerated stub - // 初始化 + parent::onInitialize(); $this->initialize(); } diff --git a/framework/Database/BasePDOConnection.php b/framework/Database/BasePDOConnection.php index 937ad8e..3f61046 100644 --- a/framework/Database/BasePDOConnection.php +++ b/framework/Database/BasePDOConnection.php @@ -60,9 +60,8 @@ class BasePDOConnection extends Component // 初始化事件 public function onInitialize() { - parent::onInitialize(); // TODO: Change the autogenerated stub - // 设置驱动连接选项 - $this->_driverOptions = $this->driverOptions + $this->_defaultDriverOptions; + parent::onInitialize(); + $this->_driverOptions = $this->driverOptions + $this->_defaultDriverOptions; // 设置驱动连接选项 } public function onRequestAfter() diff --git a/framework/Http/HttpServer.php b/framework/Http/HttpServer.php index 913b42d..19c844a 100644 --- a/framework/Http/HttpServer.php +++ b/framework/Http/HttpServer.php @@ -86,12 +86,19 @@ protected function onManagerStart() protected function onWorkerStart() { $this->_server->on('WorkerStart', function (\swoole_server $server,int $workerId) { + // 刷新OpCode缓存,防止reload重载入时受到影响 + foreach (['apc_clear_cache', 'opcache_reset'] as $func) { + if (function_exists($func)) /** @noinspection PhpComposerExtensionStubsInspection */ + $func(); + } + // 进程命名 if ($workerId < $server->setting['worker_num']) { ProcessHelper::setTitle("rid-httpd: worker #{$workerId}"); } else { ProcessHelper::setTitle("rid-httpd: task #{$workerId}"); } + // 实例化App $config = require $this->virtualHost['configFile']; $app = new Application($config); diff --git a/framework/Log/Log.php b/framework/Log/Log.php index a3187d5..3236355 100644 --- a/framework/Log/Log.php +++ b/framework/Log/Log.php @@ -38,9 +38,8 @@ class Log extends Component implements LoggerInterface // 初始化事件 public function onInitialize() { - parent::onInitialize(); // TODO: Change the autogenerated stub - // 设置协程模式 - $this->setCoroutineMode(Component::COROUTINE_MODE_REFERENCE); + parent::onInitialize(); + $this->setCoroutineMode(Component::COROUTINE_MODE_REFERENCE); // 设置协程模式 } // 记录日志 diff --git a/framework/Redis/BaseRedisConnection.php b/framework/Redis/BaseRedisConnection.php index 4e406d5..814ef52 100644 --- a/framework/Redis/BaseRedisConnection.php +++ b/framework/Redis/BaseRedisConnection.php @@ -215,9 +215,8 @@ class BaseRedisConnection extends Component // 初始化事件 public function onInitialize() { - parent::onInitialize(); // TODO: Change the autogenerated stub - // 设置驱动连接选项 - $this->_driverOptions = $this->driverOptions + $this->_defaultDriverOptions; + parent::onInitialize(); + $this->_driverOptions = $this->driverOptions + $this->_defaultDriverOptions; // 设置驱动连接选项 } public function onRequestAfter() diff --git a/framework/Redis/Coroutine/RedisConnection.php b/framework/Redis/Coroutine/RedisConnection.php index 026ade0..06fdbe2 100644 --- a/framework/Redis/Coroutine/RedisConnection.php +++ b/framework/Redis/Coroutine/RedisConnection.php @@ -19,9 +19,8 @@ class RedisConnection extends \Rid\Redis\Persistent\RedisConnection // 初始化事件 public function onInitialize() { - parent::onInitialize(); // TODO: Change the autogenerated stub - // 开启协程 - CoroutineHelper::enableCoroutine(); + parent::onInitialize(); + CoroutineHelper::enableCoroutine(); // 开启协程 } // 析构事件