From: Aaron Schulz Date: Fri, 1 Aug 2014 17:25:47 +0000 (-0700) Subject: Added --lastUpdatedId option to backlink namespace population script X-Git-Tag: 1.31.0-rc.0~14442^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=139a12e80cabd006521c136f8f1b6bb3eb6d89c2;p=lhc%2Fweb%2Fwiklou.git Added --lastUpdatedId option to backlink namespace population script Change-Id: I3314264616066e3c645b1496a11f68a11fc189d5 --- diff --git a/maintenance/populateBacklinkNamespace.php b/maintenance/populateBacklinkNamespace.php index 271a3f6fd0..054f7921fb 100644 --- a/maintenance/populateBacklinkNamespace.php +++ b/maintenance/populateBacklinkNamespace.php @@ -32,6 +32,7 @@ class PopulateBacklinkNamespace extends LoggedUpdateMaintenance { public function __construct() { parent::__construct(); $this->mDescription = "Populate the *_from_namespace fields"; + $this->addOption( 'lastUpdatedId', "Highest page_id with updated links", false, true ); } protected function getUpdateKey() { @@ -49,7 +50,10 @@ class PopulateBacklinkNamespace extends LoggedUpdateMaintenance { $this->output( "Updating *_from_namespace fields in links tables.\n" ); - $start = $db->selectField( 'page', 'MIN(page_id)', false, __METHOD__ ); + $start = $this->getOption( 'lastUpdatedId' ); + if ( !$start ) { + $start = $db->selectField( 'page', 'MIN(page_id)', false, __METHOD__ ); + } if ( !$start ) { $this->output( "Nothing to do." ); return false;