Преглед изворни кода

[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)');