Browse Source

[HttpKernel] Fix to disable busyTimeout if it does not exist.

Beau Simensen 14 years ago
parent
commit
7adedf9ce9

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

@@ -31,7 +31,10 @@ class SqliteProfilerStorage extends PdoProfilerStorage
             }
             if (class_exists('SQLite3')) {
                 $db = new \SQLite3(substr($this->dsn, 7, strlen($this->dsn)), \SQLITE3_OPEN_READWRITE | \SQLITE3_OPEN_CREATE);
-                $db->busyTimeout(1000);
+                if (method_exists($db, 'busyTimeout')) {
+                    // busyTimeout only exists for PHP >= 5.3.3
+                    $db->busyTimeout(1000);
+                }
             } elseif (class_exists('PDO') && in_array('sqlite', \PDO::getAvailableDrivers(), true)) {
                 $db = new \PDO($this->dsn);
             } else {