Skip to content

Commit

Permalink
[HttpKernel] Fix to disable busyTimeout if it does not exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
simensen committed May 12, 2011
1 parent 0bad012 commit 7adedf9
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -31,7 +31,10 @@ protected function initDb()
}
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 {
Expand Down

0 comments on commit 7adedf9

Please sign in to comment.