jenkins-bot has submitted this change and it was merged.
Change subject: Re-enable MediaWiki code sniffer rule for empty comments
......................................................................
Re-enable MediaWiki code sniffer rule for empty comments
Change-Id: Ib7107c49c081a8a7d67f08892b84cf17e9a08cbd
---
M client/config/WikibaseClient.default.php
M client/config/WikibaseClient.example.php
M client/includes/store/sql/BulkSubscriptionUpdater.php
M phpcs.xml
M repo/config/Wikibase.default.php
M repo/includes/OutputPageJsConfigBuilder.php
M repo/includes/store/sql/WikiPageEntityStore.php
7 files changed, 107 insertions(+), 87 deletions(-)
Approvals:
Umherirrender: Looks good to me, approved
JanZerebecki: Looks good to me, approved
jenkins-bot: Verified
diff --git a/client/config/WikibaseClient.default.php
b/client/config/WikibaseClient.default.php
index bc2069e..0e3cf71 100644
--- a/client/config/WikibaseClient.default.php
+++ b/client/config/WikibaseClient.default.php
@@ -56,29 +56,37 @@
// Enable in case wbc_entity_usage does not exist or is not yet
populated.
'useLegacyUsageIndex' => false,
- // Enable in case wb_changes_subscription does not exist (on
the repo) or is not yet populated.
- //
- // @note: if Wikibase Repo and Client are enabled on the same
wiki, then this only needs
- // to be set in the repo or can be set the same in both. (repo
settings override client settings)
+ /**
+ * Enable in case wb_changes_subscription does not exist (on
the repo) or is not yet
+ * populated.
+ *
+ * @note If Wikibase Repo and Client are enabled on the same
wiki, then this only needs to
+ * be set in the repo or can be set the same in both (repo
settings override client
+ * settings).
+ */
'useLegacyChangesSubscription' => false,
- // Prefix to use for cache keys that should be shared among a
Wikibase Repo instance
- // and all its clients. This is for things like caching entity
blobs in memcached.
- //
- // The default here assumes Wikibase Repo + Client installed
together on the same wiki.
- // For a multiwiki / wikifarm setup, to configure shared caches
between clients and repo,
- // this needs to be set to the same value in both client and
repo wiki settings.
- //
- // For Wikidata production, we set it to
'wikibase-shared/wikidata_1_25wmf24-wikidatawiki',
- // which is 'wikibase_shared/' + deployment branch name + '-' +
repo database name,
- // and have it set in both $wgWBClientSettings and
$wgWBRepoSettings.
+ /**
+ * Prefix to use for cache keys that should be shared among a
Wikibase Repo instance and all
+ * its clients. This is for things like caching entity blobs in
memcached.
+ *
+ * The default here assumes Wikibase Repo + Client installed
together on the same wiki. For
+ * a multiwiki / wikifarm setup, to configure shared caches
between clients and repo, this
+ * needs to be set to the same value in both client and repo
wiki settings.
+ *
+ * For Wikidata production, we set it to
'wikibase-shared/wikidata_1_25wmf24-wikidatawiki',
+ * which is 'wikibase_shared/' + deployment branch name + '-' +
repo database name, and have
+ * it set in both $wgWBClientSettings and $wgWBRepoSettings.
+ */
'sharedCacheKeyPrefix' => 'wikibase_shared/' . WBL_VERSION .
'-' . $GLOBALS['wgDBname'],
- // The duration of the object cache, in seconds.
- //
- // As with sharedCacheKeyPrefix, this is both client and repo
setting. On a multiwiki
- // setup, this should be set to the same value in both the repo
and clients.
- // Also note that the setting value in $wgWBClientSettings
overrides the one here.
+ /**
+ * The duration of the object cache, in seconds.
+ *
+ * As with sharedCacheKeyPrefix, this is both client and repo
setting. On a multiwiki setup,
+ * this should be set to the same value in both the repo and
clients. Also note that the
+ * setting value in $wgWBClientSettings overrides the one here.
+ */
'sharedCacheDuration' => 60 * 60,
// The type of object cache to use. Use CACHE_XXX constants.
diff --git a/client/config/WikibaseClient.example.php
b/client/config/WikibaseClient.example.php
index 2d072e8..92e5d33 100644
--- a/client/config/WikibaseClient.example.php
+++ b/client/config/WikibaseClient.example.php
@@ -32,12 +32,14 @@
// and if you do not have $wgArticlePath set anywhere, MediaWiki has a default
for it.
$wgWBClientSettings['repoArticlePath'] = "/wiki/$1";
-// Assuming your wiki is setup with such script path as
"http://repo.example.org/w/api.php"
-// This should be the same as the $wgScriptPath setting if you have it set in
your repo
-// If $wgScriptPath is not set, then MediaWiki assumes a default.
-//
-// If your client and repo are setup in the same way, then the below setting
is optional
-// and will default to what you have $wgScriptPath set in the client.
+/**
+ * Assuming your wiki is setup with such script path as
"http://repo.example.org/w/api.php". This
+ * should be the same as the $wgScriptPath setting if you have it set in your
repo. If $wgScriptPath
+ * is not set, then MediaWiki assumes a default.
+ *
+ * If your client and repo are setup in the same way, then the below setting
is optional and will
+ * default to what you have $wgScriptPath set in the client.
+ */
$wgWBClientSettings['repoScriptPath'] = "/w";
// The global site ID by which this wiki is known on the repo.
@@ -91,17 +93,19 @@
'repowiki' => 'repo',
),
- // Map host names to IP addresses to bypass DNS.
- //
- // NOTE: Even if all sections run on the same MySQL server
(typical for a test setup),
- // they must use different IP addresses, and MySQL must listen
on all of them.
- // The easiest way to do this is to set bind-address = 0.0.0.0
in the MySQL
- // configuration. Beware that this makes MySQL listen on you
ethernet port too.
- // Safer alternatives include setting up mysql-proxy or
mysqld_multi.
- //
- // For this setup to work a valid user must be set up for each
of the addresses you use,
- // that is grant access to the wikiuser for each of them.
Failure to do so will make the
- // MySQL server refuse access.
+ /**
+ * Map host names to IP addresses to bypass DNS.
+ *
+ * @note Even if all sections run on the same MySQL server
(typical for a test setup), they
+ * must use different IP addresses, and MySQL must listen on
all of them. The easiest way to
+ * do this is to set bind-address = 0.0.0.0 in the MySQL
configuration. Beware that this
+ * makes MySQL listen on you ethernet port too. Safer
alternatives include setting up
+ * mysql-proxy or mysqld_multi.
+ *
+ * For this setup to work a valid user must be set up for each
of the addresses you use,
+ * that is grant access to the wikiuser for each of them.
Failure to do so will make the
+ * MySQL server refuse access.
+ */
'hostsByName' => array(
'localhost' => '127.0.0.1:3306',
'local1' => '127.0.2.1',
diff --git a/client/includes/store/sql/BulkSubscriptionUpdater.php
b/client/includes/store/sql/BulkSubscriptionUpdater.php
index 22e1c6c..a809f53 100644
--- a/client/includes/store/sql/BulkSubscriptionUpdater.php
+++ b/client/includes/store/sql/BulkSubscriptionUpdater.php
@@ -332,15 +332,18 @@
$conditions[] = 'cs_entity_id > ' . $dbr->addQuotes(
$fromEntityId );
}
- // NOTE: below, we query and iterate all rows we want to delete
in the current batch.
- // That is rather ugly, but appears to be the best solution,
because:
- //
- // - Deletions must be paged to avoid lock retention.
- // - DELETE does not support LIMIT, so we need to know a range
(min/max) of IDs.
- // - GROUP BY does not support LIMIT, so we cannot use
aggregate functions to get the min/max IDs.
- //
- // Thus, using SELECT ... LIMIT seems to be the only reliable
way to get the min/max range
- // needed for batched deletion.
+ /**
+ * @note Below, we query and iterate all rows we want to delete
in the current batch. That
+ * is rather ugly, but appears to be the best solution, because:
+ *
+ * - Deletions must be paged to avoid lock retention.
+ * - DELETE does not support LIMIT, so we need to know a range
(min/max) of IDs.
+ * - GROUP BY does not support LIMIT, so we cannot use
aggregate functions to get the
+ * min/max IDs.
+ *
+ * Thus, using SELECT ... LIMIT seems to be the only reliable
way to get the min/max range
+ * needed for batched deletion.
+ */
$res = $dbr->select(
'wb_changes_subscription',
diff --git a/phpcs.xml b/phpcs.xml
index 2d97ece..0ea1e5f 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -27,9 +27,6 @@
<rule ref="Generic.PHP.CharacterBeforePHPOpeningTag" />
- <rule
ref="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.EmptyComment">
- <severity>0</severity>
- </rule>
<rule
ref="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.SingleSpaceBeforeSingleLineComment">
<severity>0</severity>
</rule>
diff --git a/repo/config/Wikibase.default.php b/repo/config/Wikibase.default.php
index 45f13cf..5863c8c 100644
--- a/repo/config/Wikibase.default.php
+++ b/repo/config/Wikibase.default.php
@@ -91,39 +91,45 @@
// Property used as formatter to link identifiers
'formatterUrlProperty' => null,
- // Determines how subscription lookup is handled. Possible
values:
- //
- // - 'sitelinks': Use only sitelinks to determine which wiki is
subscribed to which entity.
- // Use this mode if the wb_changes_subscription
table does not exist.
- // - 'subscriptions': use explicit subscriptions in the
wb_changes_subscription table.
- // - 'subscriptions+sitelinks': use a combination of both.
- //
- // @note: if Wikibase Repo and Client are enabled on the same
wiki, this setting
- // needs to match the useLegacyChangesSubscription value
in the client settings.
+ /**
+ * Determines how subscription lookup is handled. Possible
values:
+ *
+ * - 'sitelinks': Use only sitelinks to determine which wiki is
subscribed to which entity.
+ * Use this mode if the wb_changes_subscription table does
not exist.
+ * - 'subscriptions': use explicit subscriptions in the
wb_changes_subscription table.
+ * - 'subscriptions+sitelinks': use a combination of both.
+ *
+ * @note If Wikibase Repo and Client are enabled on the same
wiki, this setting needs to
+ * match the useLegacyChangesSubscription value in the client
settings.
+ */
'subscriptionLookupMode' => 'subscriptions',
'allowEntityImport' => false,
- // Prefix to use for cache keys that should be shared among a
Wikibase Repo instance
- // and all its clients. This is for things like caching entity
blobs in memcached.
- //
- // The default setting assumes Wikibase Repo + Client installed
together on the same wiki.
- // For a multiwiki / wikifarm setup, to configure shared caches
between clients and repo,
- // this needs to be set to the same value in both client and
repo wiki settings.
- //
- // For Wikidata production, we set it to
'wikibase-shared/wikidata_1_25wmf24-wikidatawiki',
- // which is 'wikibase_shared/' + deployment branch name + '-' +
repo database name,
- // and have it set in both $wgWBClientSettings and
$wgWBRepoSettings.
- //
- // Please note that $wgWBClientSettings overrides settings such
as this one in the repo,
- // if client is enabled on the same wiki.
+ /**
+ * Prefix to use for cache keys that should be shared among a
Wikibase Repo instance and all
+ * its clients. This is for things like caching entity blobs in
memcached.
+ *
+ * The default setting assumes Wikibase Repo + Client installed
together on the same wiki.
+ * For a multiwiki / wikifarm setup, to configure shared caches
between clients and repo,
+ * this needs to be set to the same value in both client and
repo wiki settings.
+ *
+ * For Wikidata production, we set it to
'wikibase-shared/wikidata_1_25wmf24-wikidatawiki',
+ * which is 'wikibase_shared/' + deployment branch name + '-' +
repo database name, and have
+ * it set in both $wgWBClientSettings and $wgWBRepoSettings.
+ *
+ * Please note that $wgWBClientSettings overrides settings such
as this one in the repo, if
+ * client is enabled on the same wiki.
+ */
'sharedCacheKeyPrefix' => 'wikibase_shared/' . WBL_VERSION .
'-' . $GLOBALS['wgDBname'],
- // The duration of the object cache, in seconds.
- //
- // As with sharedCacheKeyPrefix, this is both client and repo
setting. On a multiwiki
- // setup, this should be set to the same value in both the repo
and clients.
- // Also note that the setting value in $wgWBClientSettings
overrides the one here.
+ /**
+ * The duration of the object cache, in seconds.
+ *
+ * As with sharedCacheKeyPrefix, this is both client and repo
setting. On a multiwiki setup,
+ * this should be set to the same value in both the repo and
clients. Also note that the
+ * setting value in $wgWBClientSettings overrides the one here.
+ */
'sharedCacheDuration' => 60 * 60,
// The type of object cache to use. Use CACHE_XXX constants.
diff --git a/repo/includes/OutputPageJsConfigBuilder.php
b/repo/includes/OutputPageJsConfigBuilder.php
index 44999d8..1e0454b 100644
--- a/repo/includes/OutputPageJsConfigBuilder.php
+++ b/repo/includes/OutputPageJsConfigBuilder.php
@@ -62,11 +62,13 @@
private function getUserConfigVars( Title $title, User $user ) {
$configVars = array();
- // This is used in wikibase.ui.entityViewInit.js to double
check if a user
- // can edit, and if so, initializes relevant javascript.
- //
- // @todo: remove these variables if the javascript no longer
really
- // needs them. This check involves database lookup, which is
not nice.
+ /**
+ * This is used in wikibase.ui.entityViewInit.js to double
check if a user can edit, and if
+ * so, initializes relevant javascript.
+ *
+ * @todo Remove these variables if the javascript no longer
really needs them. This check
+ * involves database lookup, which is not nice.
+ */
$configVars['wbUserIsBlocked'] = $user->isBlockedFrom( $title,
true );
// tell JS whether the user can edit
diff --git a/repo/includes/store/sql/WikiPageEntityStore.php
b/repo/includes/store/sql/WikiPageEntityStore.php
index 9f0383f..746f024 100644
--- a/repo/includes/store/sql/WikiPageEntityStore.php
+++ b/repo/includes/store/sql/WikiPageEntityStore.php
@@ -202,13 +202,13 @@
}
}
- // NOTE: make sure we start saving from a clean slate. Calling
WikiPage::clearPreparedEdit
- // may cause the old content to be loaded from the
database again. This may be
- // necessary, because EntityContent is mutable, so the
cached object might have changed.
- //
- // The relevant test case is
ItemContentTest::testRepeatedSave
- //
- // TODO: might be able to further optimize handling of
prepared edit in WikiPage.
+ /**
+ * @note Make sure we start saving from a clean slate. Calling
WikiPage::clearPreparedEdit
+ * may cause the old content to be loaded from the database
again. This may be necessary,
+ * because EntityContent is mutable, so the cached object might
have changed.
+ *
+ * @todo Might be able to further optimize handling of prepared
edit in WikiPage.
+ */
$page->clear();
$page->clearPreparedEdit();
--
To view, visit https://gerrit.wikimedia.org/r/250027
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib7107c49c081a8a7d67f08892b84cf17e9a08cbd
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: JanZerebecki <[email protected]>
Gerrit-Reviewer: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits