Use __DIR__ instead of dirname( __FILE__ )
[lhc/web/wiklou.git] / maintenance / rebuildrecentchanges.php
index 8964d1a..0278f72 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
- * Rebuild link tracking tables from scratch.  This takes several
- * hours, depending on the database size and server configuration.
+ * Rebuild recent changes from scratch.  This takes several hours,
+ * depending on the database size and server configuration.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  *
+ * @file
  * @ingroup Maintenance
  * @todo Document
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
+/**
+ * Maintenance script that rebuilds recent changes from scratch.
+ *
+ * @ingroup Maintenance
+ */
 class RebuildRecentchanges extends Maintenance {
        public function __construct() {
                parent::__construct();
@@ -119,11 +125,11 @@ class RebuildRecentchanges extends Maintenance {
                                if ( $row ) {
                                        $lastOldId = intval( $row->rev_id );
                                        # Grab the last text size if available
-                                       $lastSize = !is_null( $row->rev_len ) ? intval( $row->rev_len ) : 'NULL';
+                                       $lastSize = !is_null( $row->rev_len ) ? intval( $row->rev_len ) : null;
                                } else {
                                        # No previous edit
                                        $lastOldId = 0;
-                                       $lastSize = 'NULL';
+                                       $lastSize = null;
                                        $new = 1; // probably true
                                }
                        }
@@ -132,7 +138,6 @@ class RebuildRecentchanges extends Maintenance {
                        } else {
                                # Grab the entry's text size
                                $size = $dbw->selectField( 'revision', 'rev_len', array( 'rev_id' => $obj->rc_this_oldid ) );
-                               $size = !is_null( $size ) ? intval( $size ) : 'NULL';
 
                                $dbw->update( 'recentchanges',
                                        array(