jenkins-bot has submitted this change and it was merged.
Change subject: Update formatting on includes/deferred/
......................................................................
Update formatting on includes/deferred/
Change-Id: Id3f143eae3781b26dcbc3ba63a566b7a6006c0cc
---
M includes/deferred/CallableUpdate.php
M includes/deferred/DataUpdate.php
M includes/deferred/DeferredUpdates.php
M includes/deferred/HTMLCacheUpdate.php
M includes/deferred/LinksUpdate.php
M includes/deferred/SearchUpdate.php
M includes/deferred/SiteStatsUpdate.php
M includes/deferred/SqlDataUpdate.php
M includes/deferred/SquidUpdate.php
M includes/deferred/ViewCountUpdate.php
10 files changed, 55 insertions(+), 33 deletions(-)
Approvals:
Chad: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/deferred/CallableUpdate.php
b/includes/deferred/CallableUpdate.php
index 6eb5541..c52bb7d 100644
--- a/includes/deferred/CallableUpdate.php
+++ b/includes/deferred/CallableUpdate.php
@@ -4,7 +4,6 @@
* Deferrable Update for closure/callback
*/
class MWCallableUpdate implements DeferrableUpdate {
-
/**
* @var closure/callabck
*/
@@ -26,5 +25,4 @@
public function doUpdate() {
call_user_func( $this->callback );
}
-
}
diff --git a/includes/deferred/DataUpdate.php b/includes/deferred/DataUpdate.php
index 7b9ac28..986a1f7 100644
--- a/includes/deferred/DataUpdate.php
+++ b/includes/deferred/DataUpdate.php
@@ -30,7 +30,6 @@
* subclasses can override the beginTransaction() and
commitTransaction() methods.
*/
abstract class DataUpdate implements DeferrableUpdate {
-
/**
* Constructor
*/
@@ -122,5 +121,4 @@
throw $exception; // rethrow after cleanup
}
}
-
}
diff --git a/includes/deferred/DeferredUpdates.php
b/includes/deferred/DeferredUpdates.php
index c385f13..053b7f6 100644
--- a/includes/deferred/DeferredUpdates.php
+++ b/includes/deferred/DeferredUpdates.php
@@ -89,6 +89,7 @@
// No need to get master connections in case of empty updates
array
if ( !count( $updates ) ) {
wfProfileOut( __METHOD__ );
+
return;
}
diff --git a/includes/deferred/HTMLCacheUpdate.php
b/includes/deferred/HTMLCacheUpdate.php
index 4147424..8c91347 100644
--- a/includes/deferred/HTMLCacheUpdate.php
+++ b/includes/deferred/HTMLCacheUpdate.php
@@ -61,7 +61,7 @@
JobQueueGroup::singleton()->deduplicateRootJob( $job );
} else { // few backlinks ($count might be off even if 0)
$dbw = wfGetDB( DB_MASTER );
- $dbw->onTransactionIdle( function() use ( $job ) {
+ $dbw->onTransactionIdle( function () use ( $job ) {
$job->run(); // just do the purge query now
} );
}
diff --git a/includes/deferred/LinksUpdate.php
b/includes/deferred/LinksUpdate.php
index fdd0e3c..00d26ee 100644
--- a/includes/deferred/LinksUpdate.php
+++ b/includes/deferred/LinksUpdate.php
@@ -26,22 +26,21 @@
* @todo document (e.g. one-sentence top-level class description).
*/
class LinksUpdate extends SqlDataUpdate {
-
// @todo make members protected, but make sure extensions don't break
- public $mId, //!< Page ID of the article linked from
- $mTitle, //!< Title object of the article linked from
- $mParserOutput, //!< Parser output
- $mLinks, //!< Map of title strings to IDs for the links
in the document
- $mImages, //!< DB keys of the images used, in the array
key only
- $mTemplates, //!< Map of title strings to IDs for the
template references, including broken ones
- $mExternals, //!< URLs of external links, array key only
- $mCategories, //!< Map of category names to sort keys
- $mInterlangs, //!< Map of language codes to titles
- $mProperties, //!< Map of arbitrary name to value
- $mDb, //!< Database connection reference
- $mOptions, //!< SELECT options to be used (array)
- $mRecursive; //!< Whether to queue jobs for recursive
updates
+ public $mId, //!< Page ID of the article linked from
+ $mTitle, //!< Title object of the article linked from
+ $mParserOutput, //!< Parser output
+ $mLinks, //!< Map of title strings to IDs for the links in the
document
+ $mImages, //!< DB keys of the images used, in the array key only
+ $mTemplates, //!< Map of title strings to IDs for the template
references, including broken ones
+ $mExternals, //!< URLs of external links, array key only
+ $mCategories, //!< Map of category names to sort keys
+ $mInterlangs, //!< Map of language codes to titles
+ $mProperties, //!< Map of arbitrary name to value
+ $mDb, //!< Database connection reference
+ $mOptions, //!< SELECT options to be used (array)
+ $mRecursive; //!< Whether to queue jobs for recursive updates
/**
* @var null|array Added links if calculated.
@@ -330,6 +329,7 @@
);
}
}
+
return $arr;
}
@@ -350,6 +350,7 @@
);
}
}
+
return $arr;
}
@@ -368,6 +369,7 @@
'il_to' => $iname
);
}
+
return $arr;
}
@@ -388,6 +390,7 @@
);
}
}
+
return $arr;
}
@@ -432,6 +435,7 @@
'cl_type' => $type,
);
}
+
return $arr;
}
@@ -452,6 +456,7 @@
'll_title' => $title
);
}
+
return $arr;
}
@@ -470,6 +475,7 @@
'pp_value' => $value,
);
}
+
return $arr;
}
@@ -491,6 +497,7 @@
);
}
}
+
return $arr;
}
@@ -509,6 +516,7 @@
$del[$ns] = $existing[$ns];
}
}
+
return $del;
}
@@ -527,6 +535,7 @@
$del[$ns] = $existing[$ns];
}
}
+
return $del;
}
@@ -594,6 +603,7 @@
$del[$prefix] = $existing[$prefix];
}
}
+
return $del;
}
@@ -612,6 +622,7 @@
}
$arr[$row->pl_namespace][$row->pl_title] = 1;
}
+
return $arr;
}
@@ -630,6 +641,7 @@
}
$arr[$row->tl_namespace][$row->tl_title] = 1;
}
+
return $arr;
}
@@ -645,6 +657,7 @@
foreach ( $res as $row ) {
$arr[$row->il_to] = 1;
}
+
return $arr;
}
@@ -660,6 +673,7 @@
foreach ( $res as $row ) {
$arr[$row->el_to] = 1;
}
+
return $arr;
}
@@ -675,6 +689,7 @@
foreach ( $res as $row ) {
$arr[$row->cl_to] = $row->cl_sortkey_prefix;
}
+
return $arr;
}
@@ -691,6 +706,7 @@
foreach ( $res as $row ) {
$arr[$row->ll_lang] = $row->ll_title;
}
+
return $arr;
}
@@ -708,6 +724,7 @@
}
$arr[$row->iwl_prefix][$row->iwl_title] = 1;
}
+
return $arr;
}
@@ -723,6 +740,7 @@
foreach ( $res as $row ) {
$arr[$row->pp_propname] = $row->pp_value;
}
+
return $arr;
}
@@ -783,8 +801,9 @@
}
$result = array();
foreach ( $this->linkInsertions as $insertion ) {
- $result[] = Title::makeTitle( $insertion[
'pl_namespace' ], $insertion[ 'pl_title' ] );
+ $result[] = Title::makeTitle(
$insertion['pl_namespace'], $insertion['pl_title'] );
}
+
return $result;
}
@@ -803,6 +822,7 @@
$result[] = Title::makeTitle( $ns, $title );
}
}
+
return $result;
}
}
@@ -811,8 +831,7 @@
* Update object handling the cleanup of links tables after a page was deleted.
**/
class LinksDeletionUpdate extends SqlDataUpdate {
-
- protected $mPage; //!< WikiPage the wikipage that was deleted
+ protected $mPage; //!< WikiPage the wikipage that was deleted
/**
* Constructor
diff --git a/includes/deferred/SearchUpdate.php
b/includes/deferred/SearchUpdate.php
index 82a413e..85cc5e7 100644
--- a/includes/deferred/SearchUpdate.php
+++ b/includes/deferred/SearchUpdate.php
@@ -180,6 +180,7 @@
# Strip wiki '' and '''
$text = preg_replace( "/''[']*/", " ", $text );
wfProfileOut( __METHOD__ . '-regexps' );
+
return $text;
}
}
diff --git a/includes/deferred/SiteStatsUpdate.php
b/includes/deferred/SiteStatsUpdate.php
index 09ff87d..10511ee 100644
--- a/includes/deferred/SiteStatsUpdate.php
+++ b/includes/deferred/SiteStatsUpdate.php
@@ -85,6 +85,7 @@
|| !$dbw->lock( $lockKey, __METHOD__, 1 ) // 1
sec timeout
) {
$this->doUpdatePendingDeltas();
+
return;
}
$pd = $this->getPendingDeltas();
@@ -143,6 +144,7 @@
array( 'ss_row_id' => 1 ),
__METHOD__
);
+
return $activeUsers;
}
@@ -216,8 +218,8 @@
$pending = array();
foreach ( array( 'ss_total_views', 'ss_total_edits',
- 'ss_good_articles', 'ss_total_pages', 'ss_users',
'ss_images' ) as $type )
- {
+ 'ss_good_articles', 'ss_total_pages', 'ss_users',
'ss_images' ) as $type
+ ) {
// Get pending increments and pending decrements
$pending[$type]['+'] = (int)$wgMemc->get(
$this->getTypeCacheKey( $type, '+' ) );
$pending[$type]['-'] = (int)$wgMemc->get(
$this->getTypeCacheKey( $type, '-' ) );
@@ -242,4 +244,3 @@
}
}
}
-
diff --git a/includes/deferred/SqlDataUpdate.php
b/includes/deferred/SqlDataUpdate.php
index 51188d8..c98c1fd 100644
--- a/includes/deferred/SqlDataUpdate.php
+++ b/includes/deferred/SqlDataUpdate.php
@@ -31,11 +31,10 @@
* the beginTransaction() and commitTransaction() methods.
*/
abstract class SqlDataUpdate extends DataUpdate {
+ protected $mDb; //!< Database connection reference
+ protected $mOptions; //!< SELECT options to be used (array)
- protected $mDb; //!< Database connection reference
- protected $mOptions; //!< SELECT options to be used (array)
-
- private $mHasTransaction; //!< bool whether a transaction is open on
this object (internal use only!)
+ private $mHasTransaction; //!< bool whether a transaction is open on
this object (internal use only!)
protected $mUseTransaction; //!< bool whether this update should be
wrapped in a transaction
/**
@@ -148,5 +147,4 @@
), __METHOD__
);
}
-
}
diff --git a/includes/deferred/SquidUpdate.php
b/includes/deferred/SquidUpdate.php
index 71afeba..59347d6 100644
--- a/includes/deferred/SquidUpdate.php
+++ b/includes/deferred/SquidUpdate.php
@@ -26,7 +26,6 @@
* @ingroup Cache
*/
class SquidUpdate {
-
/**
* Collection of URLs to purge.
* @var array
@@ -83,6 +82,7 @@
}
wfProfileOut( __METHOD__ );
+
return new SquidUpdate( $blurlArr );
}
@@ -102,6 +102,7 @@
break;
}
}
+
return new SquidUpdate( $urlArr );
}
@@ -111,6 +112,7 @@
*/
public static function newSimplePurge( Title $title ) {
$urlArr = $title->getSquidURLs();
+
return new SquidUpdate( $urlArr );
}
@@ -194,11 +196,12 @@
// pfsockopen doesn't work because we need set_sock_opt
$conn = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP );
- if ( ! $conn ) {
+ if ( !$conn ) {
$errstr = socket_strerror( socket_last_error() );
wfDebugLog( 'squid', __METHOD__ .
": Error opening UDP socket: $errstr\n" );
wfProfileOut( __METHOD__ );
+
return;
}
@@ -295,6 +298,7 @@
return $routing;
}
}
+
return false;
}
}
diff --git a/includes/deferred/ViewCountUpdate.php
b/includes/deferred/ViewCountUpdate.php
index 22a4649..6863918 100644
--- a/includes/deferred/ViewCountUpdate.php
+++ b/includes/deferred/ViewCountUpdate.php
@@ -49,6 +49,7 @@
if ( $wgHitcounterUpdateFreq <= 1 || $dbw->getType() ==
'sqlite' ) {
$dbw->update( 'page', array( 'page_counter =
page_counter + 1' ), array( 'page_id' => $this->id ), __METHOD__ );
+
return;
}
@@ -59,7 +60,8 @@
if ( rand() % $checkfreq == 0 && $dbw->lastErrno() == 0
) {
$this->collect();
}
- } catch ( DBError $e ) {}
+ } catch ( DBError $e ) {
+ }
}
protected function collect() {
--
To view, visit https://gerrit.wikimedia.org/r/96523
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id3f143eae3781b26dcbc3ba63a566b7a6006c0cc
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits