* (bug 11641) \dotsc \dotsm \dotsi \dotso can now be used in <math>
* (bug 21475) \mathtt and \textsf can now be used in <math>
* texvc is now run via ulimit4.sh, to limit execution time.
+* SQLite now supports $wgSharedDB.
=== Bug fixes in 1.17 ===
* (bug 17560) Half-broken deletion moved image files to deletion archive
* Parameters $server, $user and $password are not used.
*/
function __construct( $server = false, $user = false, $password = false, $dbName = false, $failFunction = false, $flags = 0 ) {
+ global $wgSharedDB;
$this->mFailFunction = $failFunction;
$this->mFlags = $flags;
$this->mName = $dbName;
- $this->open( $server, $user, $password, $dbName );
+
+ if ( $this->open( $server, $user, $password, $dbName ) && $wgSharedDB ) {
+ $this->attachDatabase( $wgSharedDB );
+ }
}
function getType() {
return false;
}
+ /**
+ * Attaches external database to our connection, see http://sqlite.org/lang_attach.html
+ * for details.
+ * @param $name: Database name to be used in queries like SELECT foo FROM dbname.table
+ * @param $file: Database file name. If omitted, will be generated using $name and $wgSQLiteDataDir
+ */
+ function attachDatabase( $name, $file = false, $fname = 'DatabaseSqlite::attachDatabase' ) {
+ global $wgSQLiteDataDir;
+ if ( !$file ) {
+ $file = self::generateFileName( $wgSQLiteDataDir, $name );
+ }
+ $file = $this->addQuotes( $file );
+ return $this->query( "ATTACH DATABASE $file AS $name", $fname );
+ }
+
/**
* SQLite doesn't allow buffered results or data seeking etc, so we'll use fetchAll as the result
*/