summaryrefslogtreecommitdiff
path: root/includes/SqlDataUpdate.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
committerPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
commit08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch)
tree577a29fb579188d16003a209ce2a2e9c5b0aa2bd /includes/SqlDataUpdate.php
parentcacc939b34e315b85e2d72997811eb6677996cc1 (diff)
Update to MediaWiki 1.21.1
Diffstat (limited to 'includes/SqlDataUpdate.php')
-rw-r--r--includes/SqlDataUpdate.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/includes/SqlDataUpdate.php b/includes/SqlDataUpdate.php
index 52c9be00..79dcdc59 100644
--- a/includes/SqlDataUpdate.php
+++ b/includes/SqlDataUpdate.php
@@ -48,7 +48,7 @@ abstract class SqlDataUpdate extends DataUpdate {
public function __construct( $withTransaction = true ) {
global $wgAntiLockFlags;
- parent::__construct( );
+ parent::__construct();
if ( $wgAntiLockFlags & ALF_NO_LINK_LOCK ) {
$this->mOptions = array();
@@ -76,7 +76,7 @@ abstract class SqlDataUpdate extends DataUpdate {
// NOTE: nested transactions are not supported, only start a transaction if none is open
if ( $this->mDb->trxLevel() === 0 ) {
- $this->mDb->begin( get_class( $this ) . '::beginTransaction' );
+ $this->mDb->begin( get_class( $this ) . '::beginTransaction' );
$this->mHasTransaction = true;
}
}
@@ -95,7 +95,7 @@ abstract class SqlDataUpdate extends DataUpdate {
* Abort the database transaction started via beginTransaction (if any).
*/
public function abortTransaction() {
- if ( $this->mHasTransaction ) {
+ if ( $this->mHasTransaction ) { //XXX: actually... maybe always?
$this->mDb->rollback( get_class( $this ) . '::abortTransaction' );
$this->mHasTransaction = false;
}
@@ -108,8 +108,8 @@ abstract class SqlDataUpdate extends DataUpdate {
* @param $namespace Integer
* @param $dbkeys Array
*/
- protected function invalidatePages( $namespace, Array $dbkeys ) {
- if ( !count( $dbkeys ) ) {
+ protected function invalidatePages( $namespace, array $dbkeys ) {
+ if ( $dbkeys === array() ) {
return;
}
@@ -127,10 +127,12 @@ abstract class SqlDataUpdate extends DataUpdate {
'page_touched < ' . $this->mDb->addQuotes( $now )
), __METHOD__
);
+
foreach ( $res as $row ) {
$ids[] = $row->page_id;
}
- if ( !count( $ids ) ) {
+
+ if ( $ids === array() ) {
return;
}