Skip to content

Commit

Permalink
fix: ファイルキャッシュ以外(Memcache等)でCache::clearしてもDataSource内の_sourcesがクリアされない
Browse files Browse the repository at this point in the history
  • Loading branch information
s-nakajima committed Jul 11, 2020
1 parent f2a4e7d commit 55a65bf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Utility/InstallUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
App::uses('Security', 'Utility');
App::uses('ClassRegistry', 'Utility');
App::uses('InstallValidatorUtil', 'Install.Utility');
App::uses('ConnectionManager', 'Model');

/**
* Install Utility
Expand Down Expand Up @@ -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') {
Expand Down

0 comments on commit 55a65bf

Please sign in to comment.