From 200926f0abf834d107ad62a10e2f4b9889d8a300 Mon Sep 17 00:00:00 2001 From: Rhilip Date: Thu, 15 Aug 2019 00:16:04 +0800 Subject: [PATCH] fix(Component): Fix parent::onRequest{Before,After} miss --- CHANGELOG.md | 4 ++++ apps/components/Auth.php | 2 +- framework/Component/I18n.php | 1 + framework/Database/BasePDOConnection.php | 10 +++------- framework/Redis/BaseRedisConnection.php | 10 +++------- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6eda059..ac05a82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ - **Config:** Remove params `$throw` in Config()->get() (706cc9a) - **RateLimit:** Change last param of isRateLimitHit and rate limit store Namespace (4dd571d) - **Site:** Simple Category Detail get function (ffa6855) +- **Site:** Move Cat, Quality, PinnedTag cache to Config.runtime (da1d9a7) - **Validator:** fix user input extract (81bdc8f) - **View:** Make View extends BaseObject (0865cf9) - **torrent/structure:** Use zui.tree instead javascript `$(this).next('ul').toggle()` (7b20b2c) @@ -42,6 +43,9 @@ ### Revert - **Redis:** Remove view in redis , use other software install (c5d3378) +### Style +- **Redis:** rewrite namespace of cache keys (0c4e1a2) + ## [v0.1.5-alpha] - 2019-08-09 diff --git a/apps/components/Auth.php b/apps/components/Auth.php index bf8f333..94b2cc6 100644 --- a/apps/components/Auth.php +++ b/apps/components/Auth.php @@ -30,8 +30,8 @@ public function onRequestBefore() public function onRequestAfter() { - $this->logSessionInfo(); parent::onRequestAfter(); + $this->logSessionInfo(); } /** diff --git a/framework/Component/I18n.php b/framework/Component/I18n.php index 74cf0f9..61767cb 100644 --- a/framework/Component/I18n.php +++ b/framework/Component/I18n.php @@ -53,6 +53,7 @@ class I18n extends Component public function onRequestBefore() { + parent::onRequestBefore(); $lastLang = null; } diff --git a/framework/Database/BasePDOConnection.php b/framework/Database/BasePDOConnection.php index 29aba16..cf74306 100644 --- a/framework/Database/BasePDOConnection.php +++ b/framework/Database/BasePDOConnection.php @@ -65,9 +65,10 @@ public function onInitialize() $this->_driverOptions = $this->driverOptions + $this->_defaultDriverOptions; // 设置驱动连接选项 } - public function onRequestAfter() + public function onRequestBefore() { - $this->_recordData && $this->cleanSqlExecuteData(); + parent::onRequestBefore(); + $this->_sqlExecuteData = []; } // 创建连接 @@ -426,11 +427,6 @@ public function getRawSql() return array_shift($sqlPrepareData); } - public function cleanSqlExecuteData() - { - $this->_sqlExecuteData = []; - } - public function getExecuteData() { return $this->_sqlExecuteData; } diff --git a/framework/Redis/BaseRedisConnection.php b/framework/Redis/BaseRedisConnection.php index dc1b2e3..2781709 100644 --- a/framework/Redis/BaseRedisConnection.php +++ b/framework/Redis/BaseRedisConnection.php @@ -221,9 +221,10 @@ public function onInitialize() $this->_driverOptions = $this->driverOptions + $this->_defaultDriverOptions; // 设置驱动连接选项 } - public function onRequestAfter() + public function onRequestBefore() { - $this->cleanCalledData(); + parent::onRequestBefore(); + $this->_calledData = []; } // 创建连接 @@ -317,11 +318,6 @@ public function getCalledData() return $this->_calledData; } - public function cleanCalledData() - { - $this->_recordData && $this->_calledData = []; - } - /** * @param bool $recordData */