A couple quick cur->page fixes. moveCustomMessages needs major overhaul
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 29 Jan 2005 07:40:23 +0000 (07:40 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 29 Jan 2005 07:40:23 +0000 (07:40 +0000)
maintenance/archives/moveCustomMessages.inc
maintenance/rebuildMessages.php

index 5fb0d7c..83664dc 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+#### FIXME THIS FILE IS BADLY BROKEN FOR NEW SCHEMA
 /**
  * @deprecated
  * @package MediaWiki
@@ -11,7 +12,7 @@ function isTemplateInitialised() {
        $fname = 'isTemplateInitialised';
 
        $dbw =& wfGetDB( DB_MASTER );
-       $n = $dbw->selectField( 'cur', 'count(*)', array( 'cur_namespace' => NS_MEDIAWIKI ) );
+       $n = $dbw->selectField( 'page', 'count(*)', array( 'page_namespace' => NS_MEDIAWIKI ) );
        return $n > count( $wgAllMessagesEn ) ? false : true;
 }
 
@@ -36,7 +37,7 @@ function moveCustomMessages( $phase ) {
                $dbkeys[$title->getDBkey()] = 1;
        }
 
-       $res = $dbw->select( 'cur', array( 'cur_id', 'cur_title' ), array( 'cur_namespace' => NS_MEDIAWIKI ) );
+       $res = $dbw->select( 'page', array( 'page_id', 'page_title' ), array( 'page_namespace' => NS_MEDIAWIKI ) );
 
        # Compile target array
        $targets = array();
index c2bbb1b..40c8f60 100755 (executable)
@@ -33,7 +33,7 @@ if( isset( $options['rebuild'] ) ) $response = 2;
 
 if ( $response == 0 ) {
        $dbr =& wfGetDB( DB_SLAVE );
-       $row = $dbr->selectRow( "cur", array("count(*) as c"), array("cur_namespace" => NS_MEDIAWIKI) );
+       $row = $dbr->selectRow( "page", array("count(*) as c"), array("page_namespace" => NS_MEDIAWIKI) );
        print "Current namespace size: {$row->c}\n";
 
        print <<<END