X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FSqliteInstaller.php;h=aa954389b1dd6c40cbbc91ee472fe77d506aeb89;hb=81cbe34e4d519c62ac441197fe070709e4324304;hp=6f168720c7ca47f6516ad195067a59f952888b7b;hpb=0c2687f44eb0e8c7f480b7303f89056682ba0bfb;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/SqliteInstaller.php b/includes/installer/SqliteInstaller.php index 6f168720c7..aa954389b1 100644 --- a/includes/installer/SqliteInstaller.php +++ b/includes/installer/SqliteInstaller.php @@ -230,6 +230,7 @@ class SqliteInstaller extends DatabaseInstaller { $status = Status::newGood(); $status->merge( $this->makeStubDBFile( $dir, $db ) ); $status->merge( $this->makeStubDBFile( $dir, "wikicache" ) ); + $status->merge( $this->makeStubDBFile( $dir, "{$db}_l10n_cache" ) ); if ( !$status->isOK() ) { return $status; } @@ -242,7 +243,8 @@ class SqliteInstaller extends DatabaseInstaller { # Create the global cache DB try { - $conn = Database::factory( 'sqlite', [ 'dbname' => 'wikicache', 'dbDirectory' => $dir ] ); + $conn = Database::factory( + 'sqlite', [ 'dbname' => 'wikicache', 'dbDirectory' => $dir ] ); # @todo: don't duplicate objectcache definition, though it's very simple $sql = <<getMessage() ); } + # Create the l10n cache DB + try { + $conn = Database::factory( + 'sqlite', [ 'dbname' => "{$db}_l10n_cache", 'dbDirectory' => $dir ] ); + # @todo: don't duplicate l10n_cache definition, though it's very simple + $sql = +<<query( $sql ); + $conn->query( "PRAGMA journal_mode=WAL" ); // this is permanent + $conn->close(); + } catch ( DBConnectionError $e ) { + return Status::newFatal( 'config-sqlite-connection-error', $e->getMessage() ); + } + # Open the main DB return $this->getConnection(); } @@ -330,6 +353,13 @@ EOT; 'dbDirectory' => \$wgSQLiteDataDir, 'flags' => 0 ] +]; +\$wgLocalisationCacheConf['storeServer'] = [ + 'type' => 'sqlite', + 'dbname' => \"{\$wgDBname}_l10n_cache\", + 'tablePrefix' => '', + 'dbDirectory' => \$wgSQLiteDataDir, + 'flags' => 0 ];"; } }