if ( !$status->isOK() ) {
return $status;
}
- $updater = DatabaseUpdater::newForDB( $this->db );
- $extensionUpdates = $updater->getNewExtensions();
-
- $ourExtensions = array_map( 'strtolower', $this->getVar( '_Extensions' ) );
-
- foreach( $ourExtensions as $ext ) {
- if( isset( $extensionUpdates[$ext] ) ) {
- $this->db->begin( __METHOD__ );
- $error = $this->db->sourceFile( $extensionUpdates[$ext] );
- if( $error !== true ) {
- $this->db->rollback( __METHOD__ );
- $status->warning( 'config-install-tables-failed', $error );
- } else {
- $this->db->commit( __METHOD__ );
- }
- }
- }
// Now run updates to create tables for old extensions
- $updater->doUpdates( array( 'extensions' ) );
+ DatabaseUpdater::newForDB( $this->db )->doUpdates( array( 'extensions' ) );
return $status;
}
*/
protected $extensionUpdates = array();
- /**
- * Used to hold schema files during installation process
- * @var array
- */
- protected $newExtensions = array();
-
/**
* Handle to the database subclass
*
$this->extensionUpdates[] = array( 'addTable', $tableName, $sqlPath, true );
}
- /**
- * Add a brand new extension to MediaWiki. Used during the initial install
- * @param $ext String Name of extension
- * @param $sqlPath String Full path to the schema file
- */
- public function addNewExtension( $ext, $sqlPath ) {
- $this->newExtensions[ strtolower( $ext ) ] = $sqlPath;
- }
-
- /**
- * Get the list of extensions that registered a schema with our DB type
- * @return array
- */
- public function getNewExtensions() {
- return $this->newExtensions;
- }
-
/**
* Get the list of extension-defined updates
*