瀏覽代碼

[HttpKernel] Tweaked SQLite to speed up SqliteProfilerStorage

See: http://stackoverflow.com/questions/6108602/avoiding-locked-sqlite-database-timeouts-with-php-pdo
William DURAND 14 年之前
父節點
當前提交
f448029061
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php

+ 1 - 0
src/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php

@@ -41,6 +41,7 @@ class SqliteProfilerStorage extends PdoProfilerStorage
                 throw new \RuntimeException('You need to enable either the SQLite3 or PDO_SQLite extension for the profiler to run properly.');
             }
 
+            $db->exec('PRAGMA temp_store=MEMORY; PRAGMA journal_mode=MEMORY;');
             $db->exec('CREATE TABLE IF NOT EXISTS sf_profiler_data (token STRING, data STRING, ip STRING, url STRING, time INTEGER, parent STRING, created_at INTEGER)');
             $db->exec('CREATE INDEX IF NOT EXISTS data_created_at ON sf_profiler_data (created_at)');
             $db->exec('CREATE INDEX IF NOT EXISTS data_ip ON sf_profiler_data (ip)');