mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-11 16:58:38 +00:00
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.
This commit is contained in:
parent
b75a2171f1
commit
2d20c56bb7
|
@ -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." );
|
||||
|
|
Loading…
Reference in a new issue