Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/179118
Change subject: Inject settings into DirectSqlStore ...................................................................... Inject settings into DirectSqlStore Change-Id: I4f79e9ebc508b81fc8ac16b2714918145ae2abc8 --- M client/includes/WikibaseClient.php M client/includes/store/sql/DirectSqlStore.php M client/tests/phpunit/includes/store/sql/DirectSqlStoreTest.php 3 files changed, 12 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/18/179118/1 diff --git a/client/includes/WikibaseClient.php b/client/includes/WikibaseClient.php index f5ea885..21b14fb 100644 --- a/client/includes/WikibaseClient.php +++ b/client/includes/WikibaseClient.php @@ -288,6 +288,7 @@ $this->getEntityContentDataCodec(), $this->contentLanguage, $this->getEntityIdParser(), + $this->settings, $repoDatabase ); } diff --git a/client/includes/store/sql/DirectSqlStore.php b/client/includes/store/sql/DirectSqlStore.php index 217b4df..11e486c 100644 --- a/client/includes/store/sql/DirectSqlStore.php +++ b/client/includes/store/sql/DirectSqlStore.php @@ -135,14 +135,14 @@ EntityContentDataCodec $contentCodec, Language $wikiLanguage, EntityIdParser $entityIdParser, + SettingsArray $settings, $repoWiki ) { - $this->repoWiki = $repoWiki; $this->language = $wikiLanguage; $this->contentCodec = $contentCodec; + $this->settings = $settings; + $this->repoWiki = $repoWiki; - // @TODO: Inject - $settings = WikibaseClient::getDefaultInstance()->getSettings(); $cachePrefix = $settings->getSetting( 'sharedCacheKeyPrefix' ); $cacheDuration = $settings->getSetting( 'sharedCacheDuration' ); $cacheType = $settings->getSetting( 'sharedCacheType' ); diff --git a/client/tests/phpunit/includes/store/sql/DirectSqlStoreTest.php b/client/tests/phpunit/includes/store/sql/DirectSqlStoreTest.php index 495c9c4..0b6b428 100644 --- a/client/tests/phpunit/includes/store/sql/DirectSqlStoreTest.php +++ b/client/tests/phpunit/includes/store/sql/DirectSqlStoreTest.php @@ -21,14 +21,15 @@ class DirectSqlStoreTest extends \MediaWikiTestCase { protected function newStore() { - $lang = Language::factory( 'en' ); - $idParser = new BasicEntityIdParser(); + $wikibaseClient = WikibaseClient::getDefaultInstance(); - $contentCodec = WikibaseClient::getDefaultInstance()->getEntityContentDataCodec(); - - $store = new DirectSqlStore( $contentCodec, $lang, $idParser, 'DirectStoreSqlTestDummyRepoId' ); - - return $store; + return new DirectSqlStore( + $wikibaseClient->getEntityContentDataCodec(), + Language::factory( 'en' ), + new BasicEntityIdParser(), + $wikibaseClient->getSettings(), + 'DirectStoreSqlTestDummyRepoId' + ); } /** -- To view, visit https://gerrit.wikimedia.org/r/179118 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f79e9ebc508b81fc8ac16b2714918145ae2abc8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude <aude.w...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits