+ # 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 =
+<<<EOT
+ CREATE TABLE l10n_cache (
+ lc_lang BLOB NOT NULL,
+ lc_key TEXT NOT NULL,
+ lc_value BLOB NOT NULL,
+ PRIMARY KEY (lc_lang, lc_key)
+ );
+EOT;
+ $conn->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() );
+ }
+