X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fdeferred%2FSqlDataUpdate.php;h=9740cbe254cc6994966cfe51e295b328074fcd9d;hb=ec36a85b106699aabef435d825f5b3c1c6c4a2a1;hp=49164e3373cd540c9074456a00726188a34999f0;hpb=4fa02402289e9ba08369f2c3f9cb78eb0080027a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/deferred/SqlDataUpdate.php b/includes/deferred/SqlDataUpdate.php index 49164e3373..9740cbe254 100644 --- a/includes/deferred/SqlDataUpdate.php +++ b/includes/deferred/SqlDataUpdate.php @@ -35,7 +35,7 @@ abstract class SqlDataUpdate extends DataUpdate { protected $mDb; /** @var array SELECT options to be used (array) */ - protected $mOptions = array(); + protected $mOptions = []; /** @var bool Whether a transaction is open on this object (internal use only!) */ private $mHasTransaction; @@ -93,7 +93,7 @@ abstract class SqlDataUpdate extends DataUpdate { * Abort the database transaction started via beginTransaction (if any). */ public function abortTransaction() { - if ( $this->mHasTransaction ) { //XXX: actually... maybe always? + if ( $this->mHasTransaction ) { // XXX: actually... maybe always? $this->mDb->rollback( get_class( $this ) . '::abortTransaction' ); $this->mHasTransaction = false; } @@ -107,7 +107,7 @@ abstract class SqlDataUpdate extends DataUpdate { * @param array $dbkeys */ protected function invalidatePages( $namespace, array $dbkeys ) { - if ( $dbkeys === array() ) { + if ( $dbkeys === [] ) { return; } @@ -121,15 +121,15 @@ abstract class SqlDataUpdate extends DataUpdate { $now = $dbw->timestamp(); $ids = $dbw->selectFieldValues( 'page', 'page_id', - array( + [ 'page_namespace' => $namespace, 'page_title' => $dbkeys, 'page_touched < ' . $dbw->addQuotes( $now ) - ), + ], __METHOD__ ); - if ( $ids === array() ) { + if ( $ids === [] ) { return; } @@ -139,11 +139,11 @@ abstract class SqlDataUpdate extends DataUpdate { * the non-locking select above. */ $dbw->update( 'page', - array( 'page_touched' => $now ), - array( + [ 'page_touched' => $now ], + [ 'page_id' => $ids, 'page_touched < ' . $dbw->addQuotes( $now ) - ), __METHOD__ + ], __METHOD__ ); } ); }