From 2d20c56bb72b21d5950d6b85c9f4496a9d968701 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 7 Jun 2011 17:33:34 +0000 Subject: [PATCH] Get rid of addNewExtension()/getNewExtensions() method of adding new extensions (added in r81266). Since r85021, this isn't necessary because we run old updates like we should. Fix the 3 extensions using it. Reverts most of r81266, all of r84868, tiny part of r86741. Also ping r89653 which is what caused me to look at this again. --- Math.hooks.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Math.hooks.php b/Math.hooks.php index 36d74522f..c4df909ad 100644 --- a/Math.hooks.php +++ b/Math.hooks.php @@ -104,7 +104,10 @@ class MathHooks { * @param $updater DatabaseUpdater * @return bool */ - static function onLoadExtensionSchemaUpdates( $updater ) { + static function onLoadExtensionSchemaUpdates( $updater = null ) { + if( is_null( $updater ) ) { + throw new MWException( "Math extension is only necessary in 1.18 or above" ); + } $map = array( 'mysql' => 'math.sql', 'sqlite' => 'math.sql', @@ -115,10 +118,8 @@ class MathHooks { ); $base = dirname( __FILE__ ); $type = $updater->getDB()->getType(); - if ( array_key_exists( $type, $map ) ) { - $file = $map[$type]; - $sql = "$base/db/$file"; - $updater->addNewExtension( 'CodeReview', $sql ); + if ( isset( $map[$type] ) ) { + $sql = dirname( __FILE__ ) . '/db/' . $map[$type]; $updater->addExtensionTable( 'math', $sql ); } else { throw new MWException( "Math extension does not currently support $type database." );