- $this->mDBname = $p['dbname'];
- parent::__construct( $p );
- // parent doesn't open when $user is false, but we can work with $dbName
- if ( $p['dbname'] && !$this->isOpen() ) {
- if ( $this->open( $p['host'], $p['user'], $p['password'], $p['dbname'] ) ) {
- if ( $wgSharedDB ) {
- $this->attachDatabase( $wgSharedDB );
+ $this->dbDir = isset( $p['dbDirectory'] ) ? $p['dbDirectory'] : $wgSQLiteDataDir;
+
+ if ( isset( $p['dbFilePath'] ) ) {
+ parent::__construct( $p );
+ // Standalone .sqlite file mode.
+ // Super doesn't open when $user is false, but we can work with $dbName,
+ // which is derived from the file path in this case.
+ $this->openFile( $p['dbFilePath'] );
+ } else {
+ $this->mDBname = $p['dbname'];
+ // Stock wiki mode using standard file names per DB.
+ parent::__construct( $p );
+ // Super doesn't open when $user is false, but we can work with $dbName
+ if ( $p['dbname'] && !$this->isOpen() ) {
+ if ( $this->open( $p['host'], $p['user'], $p['password'], $p['dbname'] ) ) {
+ if ( $wgSharedDB ) {
+ $this->attachDatabase( $wgSharedDB );
+ }