spaces -> tabs
This commit is contained in:
parent
fc91010111
commit
0f8197c031
2 changed files with 57 additions and 57 deletions
|
|
@ -25,9 +25,9 @@ class LinksUpdate extends SecondaryDBDataUpdate {
|
|||
* @private
|
||||
*/
|
||||
var $mId, //!< Page ID of the article linked from
|
||||
$mTitle, //!< Title object of the article linked from
|
||||
$mParserOutput, //!< Whether to queue jobs for recursive update
|
||||
$mLinks, //!< Map of title strings to IDs for the links in the document
|
||||
$mTitle, //!< Title object of the article linked from
|
||||
$mParserOutput, //!< Whether to queue jobs for recursive update
|
||||
$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
|
||||
|
|
@ -45,21 +45,21 @@ class LinksUpdate extends SecondaryDBDataUpdate {
|
|||
* @param $recursive Boolean: queue jobs for recursive updates?
|
||||
*/
|
||||
function __construct( $title, $parserOutput, $recursive = true ) {
|
||||
parent::__construct( );
|
||||
parent::__construct( );
|
||||
|
||||
if ( !is_object( $title ) ) {
|
||||
throw new MWException( "The calling convention to LinksUpdate::LinksUpdate() has changed. " .
|
||||
"Please see Article::editUpdates() for an invocation example.\n" );
|
||||
}
|
||||
if ( !is_object( $title ) ) {
|
||||
throw new MWException( "The calling convention to LinksUpdate::LinksUpdate() has changed. " .
|
||||
"Please see Article::editUpdates() for an invocation example.\n" );
|
||||
}
|
||||
|
||||
if ( !is_object( $title ) ) {
|
||||
throw new MWException( "The calling convention to LinksUpdate::__construct() has changed. " .
|
||||
if ( !is_object( $title ) ) {
|
||||
throw new MWException( "The calling convention to LinksUpdate::__construct() has changed. " .
|
||||
"Please see WikiPage::doEditUpdates() for an invocation example.\n" );
|
||||
}
|
||||
$this->mTitle = $title;
|
||||
$this->mId = $title->getArticleID();
|
||||
}
|
||||
$this->mTitle = $title;
|
||||
$this->mId = $title->getArticleID();
|
||||
|
||||
$this->mParserOutput = $parserOutput;
|
||||
$this->mParserOutput = $parserOutput;
|
||||
|
||||
$this->mLinks = $parserOutput->getLinks();
|
||||
$this->mImages = $parserOutput->getImages();
|
||||
|
|
@ -276,20 +276,20 @@ class LinksUpdate extends SecondaryDBDataUpdate {
|
|||
$this->invalidatePages( NS_FILE, array_keys( $images ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $table
|
||||
* @param $insertions
|
||||
* @param $fromField
|
||||
*/
|
||||
private function dumbTableUpdate( $table, $insertions, $fromField ) {
|
||||
$this->mDb->delete( $table, array( $fromField => $this->mId ), __METHOD__ );
|
||||
if ( count( $insertions ) ) {
|
||||
# The link array was constructed without FOR UPDATE, so there may
|
||||
# be collisions. This may cause minor link table inconsistencies,
|
||||
# which is better than crippling the site with lock contention.
|
||||
$this->mDb->insert( $table, $insertions, __METHOD__, array( 'IGNORE' ) );
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param $table
|
||||
* @param $insertions
|
||||
* @param $fromField
|
||||
*/
|
||||
private function dumbTableUpdate( $table, $insertions, $fromField ) {
|
||||
$this->mDb->delete( $table, array( $fromField => $this->mId ), __METHOD__ );
|
||||
if ( count( $insertions ) ) {
|
||||
# The link array was constructed without FOR UPDATE, so there may
|
||||
# be collisions. This may cause minor link table inconsistencies,
|
||||
# which is better than crippling the site with lock contention.
|
||||
$this->mDb->insert( $table, $insertions, __METHOD__, array( 'IGNORE' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a table by doing a delete query then an insert query
|
||||
|
|
@ -755,22 +755,22 @@ class LinksUpdate extends SecondaryDBDataUpdate {
|
|||
return $arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the title object of the page being updated
|
||||
* @return Title
|
||||
*/
|
||||
public function getTitle() {
|
||||
return $this->mTitle;
|
||||
}
|
||||
/**
|
||||
* Return the title object of the page being updated
|
||||
* @return Title
|
||||
*/
|
||||
public function getTitle() {
|
||||
return $this->mTitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns parser output
|
||||
* @since 1.19
|
||||
* @return ParserOutput
|
||||
*/
|
||||
public function getParserOutput() {
|
||||
return $this->mParserOutput;
|
||||
}
|
||||
/**
|
||||
* Returns parser output
|
||||
* @since 1.19
|
||||
* @return ParserOutput
|
||||
*/
|
||||
public function getParserOutput() {
|
||||
return $this->mParserOutput;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the list of images used as generated by the parser
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ abstract class SecondaryDataUpdate {
|
|||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct( ) {
|
||||
# noop
|
||||
public function __construct( ) {
|
||||
# noop
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -34,18 +34,18 @@ abstract class SecondaryDataUpdate {
|
|||
*/
|
||||
public abstract function doUpdate();
|
||||
|
||||
/**
|
||||
* Conveniance method, calls doUpdate() on every element in the array.
|
||||
*
|
||||
* @static
|
||||
* @param $updates array
|
||||
*/
|
||||
public static function runUpdates( $updates ) {
|
||||
if ( empty( $updates ) ) return; # nothing to do
|
||||
/**
|
||||
* Conveniance method, calls doUpdate() on every element in the array.
|
||||
*
|
||||
* @static
|
||||
* @param $updates array
|
||||
*/
|
||||
public static function runUpdates( $updates ) {
|
||||
if ( empty( $updates ) ) return; # nothing to do
|
||||
|
||||
foreach ( $updates as $update ) {
|
||||
$update->doUpdate();
|
||||
}
|
||||
}
|
||||
foreach ( $updates as $update ) {
|
||||
$update->doUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue