summaryrefslogtreecommitdiff
path: root/maintenance/populateRevisionLength.php
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/populateRevisionLength.php')
-rw-r--r--maintenance/populateRevisionLength.php24
1 files changed, 14 insertions, 10 deletions
diff --git a/maintenance/populateRevisionLength.php b/maintenance/populateRevisionLength.php
index 7c529d53..3c69125a 100644
--- a/maintenance/populateRevisionLength.php
+++ b/maintenance/populateRevisionLength.php
@@ -21,7 +21,7 @@
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that populates the rev_len field for old revisions
@@ -48,8 +48,8 @@ class PopulateRevisionLength extends LoggedUpdateMaintenance {
$db = $this->getDB( DB_MASTER );
if ( !$db->tableExists( 'revision' ) ) {
$this->error( "revision table does not exist", true );
- } else if ( !$db->fieldExists( 'revision', 'rev_sha1', __METHOD__ ) ) {
- $this->output( "rev_sha1 column does not exist\n\n", true );
+ } elseif ( !$db->fieldExists( 'revision', 'rev_len', __METHOD__ ) ) {
+ $this->output( "rev_len column does not exist\n\n", true );
return false;
}
@@ -70,12 +70,16 @@ class PopulateRevisionLength extends LoggedUpdateMaintenance {
$fields = Revision::selectFields();
while ( $blockStart <= $end ) {
$this->output( "...doing rev_id from $blockStart to $blockEnd\n" );
- $res = $db->select( 'revision',
- $fields,
- array( "rev_id >= $blockStart",
- "rev_id <= $blockEnd",
- "rev_len IS NULL" ),
- __METHOD__ );
+ $res = $db->select(
+ 'revision',
+ $fields,
+ array(
+ "rev_id >= $blockStart",
+ "rev_id <= $blockEnd",
+ "rev_len IS NULL"
+ ),
+ __METHOD__
+ );
# Go through and update rev_len from these rows.
foreach ( $res as $row ) {
$rev = new Revision( $row );
@@ -105,4 +109,4 @@ class PopulateRevisionLength extends LoggedUpdateMaintenance {
}
$maintClass = "PopulateRevisionLength";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;