Hoo man has uploaded a new change for review.
https://gerrit.wikimedia.org/r/214518
Change subject: Remove the usePropertyInfoTable setting
......................................................................
Remove the usePropertyInfoTable setting
As it's no longer of much use.
Has been introduced in 0dd28e1997125bb4bab9ba72b6e90604c8a647cf
Change-Id: Idff339c0b62daddc7d4410638b6aefcc6125792a
---
M client/includes/store/sql/DirectSqlStore.php
M docs/options.wiki
M lib/config/WikibaseLib.default.php
M lib/tests/phpunit/store/Sql/PropertyInfoTableTest.php
M repo/includes/store/sql/SqlStore.php
5 files changed, 16 insertions(+), 37 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/18/214518/1
diff --git a/client/includes/store/sql/DirectSqlStore.php
b/client/includes/store/sql/DirectSqlStore.php
index 71f72cd..010b1a7 100644
--- a/client/includes/store/sql/DirectSqlStore.php
+++ b/client/includes/store/sql/DirectSqlStore.php
@@ -433,21 +433,16 @@
public function getPropertyInfoStore() {
if ( $this->propertyInfoTable === null ) {
$wikibaseClient = WikibaseClient::getDefaultInstance();
- $usePropertyInfoTable =
$wikibaseClient->getSettings()->getSetting( 'usePropertyInfoTable' );
- if ( $usePropertyInfoTable ) {
- $propertyInfoStore = new PropertyInfoTable(
true, $this->repoWiki );
- $cacheKey = $this->cacheKeyPrefix .
':CachingPropertyInfoStore';
+ $propertyInfoStore = new PropertyInfoTable( true,
$this->repoWiki );
+ $cacheKey = $this->cacheKeyPrefix .
':CachingPropertyInfoStore';
- $this->propertyInfoTable = new
CachingPropertyInfoStore(
- $propertyInfoStore,
- ObjectCache::getInstance(
$this->cacheType ),
- $this->cacheDuration,
- $cacheKey
- );
- } else {
- $this->propertyInfoTable = new
DummyPropertyInfoStore();
- }
+ $this->propertyInfoTable = new CachingPropertyInfoStore(
+ $propertyInfoStore,
+ ObjectCache::getInstance( $this->cacheType ),
+ $this->cacheDuration,
+ $cacheKey
+ );
}
return $this->propertyInfoTable;
diff --git a/docs/options.wiki b/docs/options.wiki
index 7c55234..c26cf50 100644
--- a/docs/options.wiki
+++ b/docs/options.wiki
@@ -30,7 +30,6 @@
);
</poem>
:'''Warning:''' do not change this if you already have Wikibase entities in
your database, since they may become unreadable!
-;usePropertyInfoTable: Whether to use the wb_property_info table for quick
lookup of meta-information about properties. True per default, can be set to
false in an environment where the necessary database update can't be deployed
right away. To set up the table manually, run repo/sql/wb_property_info.sql to
create it, then use repo/maintenance/rebuildPropertyInfo.php to populate the
table.
;useChangesTable: Whether to record changes in the database, so they can be
pushed to clients. Boolean, defaults to <code>true</code>. May be set to false
in situations where there are no clients to notify, to preserve space.
'''Note''' that if this is true, the <code>pruneChanges.php</code> script
should be run periodically to remove old changes from the database table.
;dispatchBatchChunkFactor: Chunk factor used internally by the
<code>dispatchChanges.php</code> script. The default is 3. If most clients are
not interested in most changes, this factor can be raised to lower the number
of database queries needed to fetch a batch of changes.
;changeHandlers: Array mapping change type IDs to handler classes. May be used
by extensions to register additional change classes.
diff --git a/lib/config/WikibaseLib.default.php
b/lib/config/WikibaseLib.default.php
index 177eaad..90d973d 100644
--- a/lib/config/WikibaseLib.default.php
+++ b/lib/config/WikibaseLib.default.php
@@ -20,9 +20,6 @@
// whether changes get recorded to wb_changes
'useChangesTable' => true,
- // whether property meta data is available in wb_property_info
- 'usePropertyInfoTable' => true,
-
'entityPrefixes' => array(
'q' => 'item',
'p' => 'property',
diff --git a/lib/tests/phpunit/store/Sql/PropertyInfoTableTest.php
b/lib/tests/phpunit/store/Sql/PropertyInfoTableTest.php
index 7694ea5..452d19a 100644
--- a/lib/tests/phpunit/store/Sql/PropertyInfoTableTest.php
+++ b/lib/tests/phpunit/store/Sql/PropertyInfoTableTest.php
@@ -39,11 +39,6 @@
$this->markTestSkipped( "Skipping because
WikibaseClient doesn't have a local wb_property_info table." );
}
- $settings = Settings::singleton();
- if ( !$settings->getSetting( 'usePropertyInfoTable' ) ) {
- $this->markTestSkipped( "Skipping because
wb_property_info isn't configured." );
- }
-
$this->tablesUsed[] = 'wb_property_info';
}
diff --git a/repo/includes/store/sql/SqlStore.php
b/repo/includes/store/sql/SqlStore.php
index d9f173c..6162f66 100644
--- a/repo/includes/store/sql/SqlStore.php
+++ b/repo/includes/store/sql/SqlStore.php
@@ -681,22 +681,15 @@
*/
private function newPropertyInfoStore() {
$wikibaseRepo = WikibaseRepo::getDefaultInstance();
- $usePropertyInfoTable =
$wikibaseRepo->getSettings()->getSetting( 'usePropertyInfoTable' );
+ $table = new PropertyInfoTable( false );
+ $cacheKey = $this->cacheKeyPrefix . ':CachingPropertyInfoStore';
- if ( $usePropertyInfoTable ) {
- $table = new PropertyInfoTable( false );
- $cacheKey = $this->cacheKeyPrefix .
':CachingPropertyInfoStore';
-
- return new CachingPropertyInfoStore(
- $table,
- ObjectCache::getInstance( $this->cacheType ),
- $this->cacheDuration,
- $cacheKey
- );
- } else {
- // dummy info store
- return new DummyPropertyInfoStore();
- }
+ return new CachingPropertyInfoStore(
+ $table,
+ ObjectCache::getInstance( $this->cacheType ),
+ $this->cacheDuration,
+ $cacheKey
+ );
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/214518
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idff339c0b62daddc7d4410638b6aefcc6125792a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits