}
}
-# Get MWInit class
-require_once "$IP/includes/Init.php";
-
# Start the autoloader, so that extensions can derive classes from core files
require_once "$IP/includes/AutoLoader.php";
exit( 1 );
}
-# Read language names
-global $wgLanguageNames;
-require_once __DIR__ . '/Names.php';
-
if ( function_exists( 'mb_strtoupper' ) ) {
mb_internal_encoding( 'UTF-8' );
}
// Check if there is a language class for the code
$class = self::classFromCode( $code );
self::preloadLanguageClass( $class );
- if ( MWInit::classExists( $class ) ) {
+ if ( class_exists( $class ) ) {
$lang = new $class;
return $lang;
}
$class = self::classFromCode( $fallbackCode );
self::preloadLanguageClass( $class );
- if ( MWInit::classExists( $class ) ) {
+ if ( class_exists( $class ) ) {
$lang = Language::newFromCode( $fallbackCode );
$lang->setCode( $code );
return $lang;
}
if ( $coreLanguageNames === null ) {
- include MWInit::compiledPath( 'languages/Names.php' );
+ global $IP;
+ include "$IP/languages/Names.php";
}
if ( isset( $coreLanguageNames[$tag] )
static $coreLanguageNames;
if ( $coreLanguageNames === null ) {
- include MWInit::compiledPath( 'languages/Names.php' );
+ global $IP;
+ include "$IP/languages/Names.php";
}
$names = array();
*/
public function runChild( $maintClass, $classFile = null ) {
// Make sure the class is loaded first
- if ( !MWInit::classExists( $maintClass ) ) {
+ if ( !class_exists( $maintClass ) ) {
if ( $classFile ) {
require_once $classFile;
}
- if ( !MWInit::classExists( $maintClass ) ) {
+ if ( !class_exists( $maintClass ) ) {
$this->error( "Cannot spawn child: $maintClass" );
}
}
* @return bool
*/
public static function posix_isatty( $fd ) {
- if ( !MWInit::functionExists( 'posix_isatty' ) ) {
+ if ( !function_exists( 'posix_isatty' ) ) {
return !$fd;
} else {
return posix_isatty( $fd );
// to $maintenance->mSelf. Keep that here for b/c
$self = $maintenance->getName();
-# Get the MWInit class
-require_once "$IP/includes/Init.php";
# Start the autoloader, so that extensions can derive classes from core files
require_once "$IP/includes/AutoLoader.php";
# Stub the profiler
// Some other requires
require_once "$IP/includes/Defines.php";
-require_once MWInit::compiledPath( 'includes/DefaultSettings.php' );
+require_once "$IP/includes/DefaultSettings.php";
# Load composer's autoloader if present
if ( is_readable( "$IP/vendor/autoload.php" ) ) {
# Maybe a hook?
global $cluster;
$cluster = 'pmtpa';
- require MWInit::interpretedPath( '../wmf-config/wgConf.php' );
+ require "$IP/../wmf-config/wgConf.php";
}
// Require the configuration (probably LocalSettings.php)
require $maintenance->loadSettings();
if ( $maintenance->getDbType() === Maintenance::DB_ADMIN &&
is_readable( "$IP/AdminSettings.php" ) )
{
- require MWInit::interpretedPath( 'AdminSettings.php' );
+ require "$IP/AdminSettings.php";
}
if ( $maintenance->getDbType() === Maintenance::DB_NONE ) {
}
$maintenance->finalSetup();
// Some last includes
-require_once MWInit::compiledPath( 'includes/Setup.php' );
+require_once "$IP/includes/Setup.php";
// Much much faster startup than creating a title object
$wgTitle = null;
<?php
/**
- * Helper class for update.php and upgrade1_5.php.
+ * Helper class for update.php.
*
* Copyright © 2005 Brion Vibber <brion@pobox.com>
* http://www.mediawiki.org/
* @access private
*/
function lock() {
- if ( $this->newSchema() ) {
- $set = array( 'user', 'revision' );
- } else {
- $set = array( 'user', 'cur', 'old' );
- }
+ $set = array( 'user', 'revision' );
$names = array_map( array( $this, 'lockTable' ), $set );
$tables = implode( ',', $names );
return $this->db->tableName( $table ) . ' WRITE';
}
- /**
- * @return bool
- * @access private
- */
- function newSchema() {
- return MWInit::classExists( 'Revision' );
- }
-
/**
* @access private
*/
* @access private
*/
function editCount( $userid ) {
- if ( $this->newSchema() ) {
- return $this->editCountOn( 'revision', 'rev_user', $userid );
- } else {
- return $this->editCountOn( 'cur', 'cur_user', $userid ) +
- $this->editCountOn( 'old', 'old_user', $userid );
- }
- }
-
- /**
- * Count the number of hits on a given table for this account.
- * @param $table string
- * @param $field string
- * @param $userid int
- * @return int
- * @access private
- */
- function editCountOn( $table, $field, $userid ) {
return intval( $this->db->selectField(
- $table,
+ 'revision',
'COUNT(*)',
- array( $field => $userid ),
+ array( 'rev_user' => $userid ),
__METHOD__ ) );
}
* @access private
*/
function reassignEdits( $from, $to ) {
- $set = $this->newSchema()
- ? array( 'revision' => 'rev_user' )
- : array( 'cur' => 'cur_user', 'old' => 'old_user' );
- foreach ( $set as $table => $field ) {
- $this->reassignEditsOn( $table, $field, $from, $to );
- }
- }
-
- /**
- * @param $table string
- * @param $field string
- * @param $from int
- * @param $to int
- * @access private
- */
- function reassignEditsOn( $table, $field, $from, $to ) {
- $this->out( "reassigning on $table... " );
- $this->db->update( $table,
- array( $field => $to ),
- array( $field => $from ),
+ $this->out( 'reassigning... ' );
+ $this->db->update( 'revision',
+ array( 'rev_user' => $to ),
+ array( 'rev_user' => $from ),
__METHOD__ );
$this->out( "ok. " );
}