Remove "$that" from SessionManager
[lhc/web/wiklou.git] / maintenance / convertLinks.php
index 221ebe3..fa9c574 100644 (file)
@@ -36,9 +36,9 @@ class ConvertLinks extends Maintenance {
 
        public function __construct() {
                parent::__construct();
-               $this->mDescription =
-                       "Convert from the old links schema (string->ID) to the new schema (ID->ID)."
-                               . "The wiki should be put into read-only mode while this script executes";
+               $this->addDescription(
+                       'Convert from the old links schema (string->ID) to the new schema (ID->ID). '
+                               . 'The wiki should be put into read-only mode while this script executes' );
 
                $this->addArg( 'logperformance', "Log performance to perfLogFilename.", false );
                $this->addArg(
@@ -66,7 +66,7 @@ class ConvertLinks extends Maintenance {
        }
 
        public function execute() {
-               $dbw = wfGetDB( DB_MASTER );
+               $dbw = $this->getDB( DB_MASTER );
 
                $type = $dbw->getType();
                if ( $type != 'mysql' ) {
@@ -215,7 +215,7 @@ class ConvertLinks extends Maintenance {
                                }
                                $dbw->freeResult( $res );
                                # $this->output( "rowOffset: $rowOffset\ttuplesAdded: "
-                               #       . "$tuplesAdded\tnumBadLinks: $numBadLinks\n" );
+                               #       . "$tuplesAdded\tnumBadLinks: $numBadLinks\n" );
                                if ( $tuplesAdded != 0 ) {
                                        if ( $reportLinksConvProgress ) {
                                                $this->output( "Inserting $tuplesAdded tuples into $links_temp..." );
@@ -267,7 +267,7 @@ class ConvertLinks extends Maintenance {
        }
 
        private function createTempTable() {
-               $dbConn = wfGetDB( DB_MASTER );
+               $dbConn = $this->getDB( DB_MASTER );
 
                if ( !( $dbConn->isOpen() ) ) {
                        $this->output( "Opening connection to database failed.\n" );