+
+ /**
+ * Override this to provide DBMS-specific schema variables, to be
+ * substituted into tables.sql and other schema files.
+ */
+ public function getSchemaVars() {
+ return array();
+ }
+
+ /**
+ * Set appropriate schema variables in the current database connection.
+ *
+ * This should be called after any request data has been imported, but before
+ * any write operations to the database.
+ */
+ public function setupSchemaVars() {
+ $status = $this->getConnection();
+ if ( $status->isOK() ) {
+ $status->value->setSchemaVars( $this->getSchemaVars() );
+ } else {
+ throw new MWException( __METHOD__.': unexpected DB connection error' );
+ }
+ }
+
+ /**
+ * Set up LBFactory so that wfGetDB() etc. works.
+ * We set up a special LBFactory instance which returns the current
+ * installer connection.
+ */
+ public function enableLB() {
+ $status = $this->getConnection();
+ if ( !$status->isOK() ) {
+ throw new MWException( __METHOD__.': unexpected DB connection error' );
+ }
+ LBFactory::setInstance( new LBFactory_Single( array(
+ 'connection' => $status->value ) ) );
+ }
+