X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=maintenance%2FupdateRestrictions.php;h=175447e780d713d7a31d2b475bfaf68caf1f091d;hb=71c0d39d12f140eb49757c991e063daec34b000f;hp=b823de11ad84404894886c1bebd65c0c6bddccbc;hpb=659778619cc12d156d3547834c0f90f407584104;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/updateRestrictions.php b/maintenance/updateRestrictions.php index b823de11ad..175447e780 100644 --- a/maintenance/updateRestrictions.php +++ b/maintenance/updateRestrictions.php @@ -20,11 +20,18 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * http://www.gnu.org/copyleft/gpl.html * + * @file * @ingroup Maintenance */ -require_once( dirname( __FILE__ ) . '/Maintenance.php' ); +require_once __DIR__ . '/Maintenance.php'; +/** + * Maintenance script that updates page_restrictions table from + * old page_restriction column. + * + * @ingroup Maintenance + */ class UpdateRestrictions extends Maintenance { public function __construct() { parent::__construct(); @@ -43,7 +50,7 @@ class UpdateRestrictions extends Maintenance { $this->error( "Nothing to do.", true ); } $end = $db->selectField( 'page', 'MAX(page_id)', false, __METHOD__ ); - + # Do remaining chunk $end += $this->mBatchSize - 1; $blockStart = $start; @@ -63,7 +70,7 @@ class UpdateRestrictions extends Maintenance { // old old format should be treated as edit/move restriction $oldRestrictions["edit"] = trim( $temp[0] ); $oldRestrictions["move"] = trim( $temp[0] ); - } else if ( $temp[1] ) { + } elseif ( $temp[1] ) { $oldRestrictions[$temp[0]] = trim( $temp[1] ); } } @@ -95,7 +102,7 @@ class UpdateRestrictions extends Maintenance { } $blockStart += $this->mBatchSize - 1; $blockEnd += $this->mBatchSize - 1; - wfWaitForSlaves( 5 ); + wfWaitForSlaves(); } $this->output( "...removing dead rows from page_restrictions\n" ); // Kill any broken rows from previous imports @@ -107,4 +114,4 @@ class UpdateRestrictions extends Maintenance { } $maintClass = "UpdateRestrictions"; -require_once( DO_MAINTENANCE ); +require_once RUN_MAINTENANCE_IF_MAIN;