Using a test for template namespace initialisation that's more likely to return true
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 13 Nov 2004 03:53:02 +0000 (03:53 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 13 Nov 2004 03:53:02 +0000 (03:53 +0000)
maintenance/archives/moveCustomMessages.inc

index 2b28de1..2aa6dd2 100644 (file)
@@ -7,11 +7,12 @@
 
 /** */
 function isTemplateInitialised() {
+       global $wgAllMessagesEn;
        $fname = 'isTemplateInitialised';
 
        $dbw =& wfGetDB( DB_MASTER );
-       $res = $dbw->select( 'cur', 1, array( 'cur_namespace' => NS_TEMPLATE ), $fname, array( 'LIMIT' => 1 ) );
-       return $dbw->numRows( $res ) ? true : false;
+       $n = $dbw->selectField( 'cur', 'count(*)', array( 'cur_namespace' => NS_MEDIAWIKI ) );
+       return $n > count( $wgAllMessagesEn ) ? false : true;
 }
 
 function moveCustomMessages( $phase ) {