From e41657c4d1598728162fac9ccf16be49fc9bd344 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 21 Jan 2012 10:39:54 -0600 Subject: [PATCH] do not check for existence of sqlite database before connecting. --- laravel/database/connectors/sqlite.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/laravel/database/connectors/sqlite.php b/laravel/database/connectors/sqlite.php index 61f12b14..5b3390f1 100644 --- a/laravel/database/connectors/sqlite.php +++ b/laravel/database/connectors/sqlite.php @@ -21,12 +21,12 @@ class SQLite extends Connector { return new PDO('sqlite::memory:', null, null, $options); } - if (file_exists($path = DATABASE_PATH.$config['database'].'.sqlite')) - { - return new PDO('sqlite:'.$path, null, null, $options); - } + // SQLite databases will be created automatically if they do not exist, so we + // will not check for the existence of the database file before establishing + // the PDO connection to the database. + $path = DATABASE_PATH.$config['database'].'.sqlite'; - throw new \Exception("SQLite database [{$config['database']}] could not be found."); + return new PDO('sqlite:'.$path, null, null, $options); } }