require_once __DIR__ . '/Maintenance.php';
-use Wikimedia\Rdbms\IDatabase;
-
/**
* Usage:
* populatePPSortKey.php
$lastPageValue = 0;
$editedRowCount = 0;
+ $this->output( "Populating page_props.pp_sortkey...\n" );
while ( true ) {
$conditions = [ 'pp_sortkey IS NULL' ];
if ( $lastPageValue !== 0 ) {
__METHOD__,
[
'ORDER BY' => 'pp_page, pp_propname',
- 'LIMIT' => $this->mBatchSize
+ 'LIMIT' => $this->getBatchSize()
]
);
$this->commitTransaction( $dbw, __METHOD__ );
// We need to get the last element's page ID
- $lastPageValue = $row->pp_value;
+ $lastPageValue = $row->pp_page;
// And the propname...
$lastProp = $row->pp_propname;
}
- $this->output( "Done!\n" );
+ $this->output( "Populating page_props.pp_sortkey complete.\n" );
}
protected function getUpdateKey() {
}
}
-$maintClass = 'PopulatePPSortKey';
+$maintClass = PopulatePPSortKey::class;
require_once RUN_MAINTENANCE_IF_MAIN;