X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdeferred%2FSqlDataUpdate.php;h=121af0418ceb833f01fee27e3a4787ac7af6a9f7;hb=134f34e04f5ca339a57c0bf13f07488376333f37;hp=51188d85c9929fcbe83ba10ccdb840b42bd61803;hpb=8d7c0346307d94c679109a41e1a93fa93c921edf;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/deferred/SqlDataUpdate.php b/includes/deferred/SqlDataUpdate.php index 51188d85c9..121af0418c 100644 --- a/includes/deferred/SqlDataUpdate.php +++ b/includes/deferred/SqlDataUpdate.php @@ -31,20 +31,25 @@ * the beginTransaction() and commitTransaction() methods. */ abstract class SqlDataUpdate extends DataUpdate { + /** @var DatabaseBase Database connection reference */ + protected $mDb; - protected $mDb; //!< Database connection reference - protected $mOptions; //!< SELECT options to be used (array) + /** @var array SELECT options to be used (array) */ + protected $mOptions; - 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 + /** @var bool Whether a transaction is open on this object (internal use only!) */ + private $mHasTransaction; + + /** @var bool Whether this update should be wrapped in a transaction */ + protected $mUseTransaction; /** * Constructor * - * @param bool $withTransaction whether this update should be wrapped in a transaction (default: true). - * A transaction is only started if no transaction is already in progress, - * see beginTransaction() for details. - **/ + * @param bool $withTransaction whether this update should be wrapped in a + * transaction (default: true). A transaction is only started if no + * transaction is already in progress, see beginTransaction() for details. + */ public function __construct( $withTransaction = true ) { global $wgAntiLockFlags; @@ -56,7 +61,8 @@ abstract class SqlDataUpdate extends DataUpdate { $this->mOptions = array( 'FOR UPDATE' ); } - // @todo get connection only when it's needed? make sure that doesn't break anything, especially transactions! + // @todo Get connection only when it's needed? Make sure that doesn't + // break anything, especially transactions! $this->mDb = wfGetDB( DB_MASTER ); $this->mWithTransaction = $withTransaction; @@ -64,10 +70,12 @@ abstract class SqlDataUpdate extends DataUpdate { } /** - * Begin a database transaction, if $withTransaction was given as true in the constructor for this SqlDataUpdate. + * Begin a database transaction, if $withTransaction was given as true in + * the constructor for this SqlDataUpdate. * - * Because nested transactions are not supported by the Database class, this implementation - * checks Database::trxLevel() and only opens a transaction if none is already active. + * Because nested transactions are not supported by the Database class, + * this implementation checks Database::trxLevel() and only opens a + * transaction if none is already active. */ public function beginTransaction() { if ( !$this->mWithTransaction ) { @@ -105,8 +113,8 @@ abstract class SqlDataUpdate extends DataUpdate { * Invalidate the cache of a list of pages from a single namespace. * This is intended for use by subclasses. * - * @param $namespace Integer - * @param $dbkeys Array + * @param int $namespace Namespace number + * @param array $dbkeys */ protected function invalidatePages( $namespace, array $dbkeys ) { if ( $dbkeys === array() ) { @@ -148,5 +156,4 @@ abstract class SqlDataUpdate extends DataUpdate { ), __METHOD__ ); } - }