Show tags on deleted edits through the API
[lhc/web/wiklou.git] / maintenance / updateRestrictions.php
index 2bf68dd..175447e 100644 (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();
@@ -44,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;
@@ -64,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] );
                                        }
                                }
@@ -96,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
@@ -108,4 +114,4 @@ class UpdateRestrictions extends Maintenance {
 }
 
 $maintClass = "UpdateRestrictions";
-require_once( DO_MAINTENANCE );
+require_once RUN_MAINTENANCE_IF_MAIN;