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

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

Beau Simensen пре 14 година
родитељ
комит
7adedf9ce9
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      src/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php

+ 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 {