Skip to content

Commit 66287f5

Browse files
committed
SQLiteJournal: checks whether pdo_sqlite is loaded
1 parent a89c504 commit 66287f5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Caching/Storages/SQLiteJournal.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ class SQLiteJournal extends Nette\Object implements IJournal
2525
*/
2626
public function __construct($path = ':memory:')
2727
{
28+
if (!extension_loaded('pdo_sqlite')) {
29+
throw new Nette\NotSupportedException("SQLiteJournal requires PHP extension pdo_sqlite which is not loaded.");
30+
}
31+
2832
$this->pdo = new \PDO('sqlite:' . $path, NULL, NULL, array(\PDO::ATTR_PERSISTENT => TRUE));
2933
$this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
3034
$this->pdo->exec('

0 commit comments

Comments
 (0)