From 55a65bf59f52d03e37775c7f5fa1eae417ed4c5e Mon Sep 17 00:00:00 2001 From: Shohei Nakajima Date: Sat, 11 Jul 2020 22:53:14 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7=E3=83=A5=E4=BB=A5=E5=A4=96?= =?UTF-8?q?=EF=BC=88Memcache=E7=AD=89=EF=BC=89=E3=81=A7Cache::clear?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=82=82DataSource=E5=86=85=E3=81=AE=5Fsourc?= =?UTF-8?q?es=E3=81=8C=E3=82=AF=E3=83=AA=E3=82=A2=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/NetCommons3/NetCommons3/issues/1585 --- Utility/InstallUtil.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Utility/InstallUtil.php b/Utility/InstallUtil.php index b2a3b9f..ebc7980 100644 --- a/Utility/InstallUtil.php +++ b/Utility/InstallUtil.php @@ -15,6 +15,7 @@ App::uses('Security', 'Utility'); App::uses('ClassRegistry', 'Utility'); App::uses('InstallValidatorUtil', 'Install.Utility'); +App::uses('ConnectionManager', 'Model'); /** * Install Utility @@ -523,6 +524,11 @@ public function createDB($configuration) { * @return void */ public function saveAdminUser($data) { + //DataSourceの中にあるlistSources()の$this->_sources変数を初期化することができないため、reconnect()する。 + $dataSource = ConnectionManager::getDataSource('master'); + $dataSource->cacheSources = false; + $dataSource->reconnect(); + //テストでMockに差し替えが必要なための処理であるので、カバレッジレポートから除外する。 //@codeCoverageIgnoreStart if (empty($this->User) || substr(get_class($this->User), 0, 4) !== 'Mock') {