소스 검색

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