do not check for existence of sqlite database before connecting.

This commit is contained in:
Taylor Otwell 2012-01-21 10:39:54 -06:00
parent dd8ebe60f0
commit e41657c4d1
1 changed files with 5 additions and 5 deletions

View File

@ -21,12 +21,12 @@ public function connect($config)
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);
}
}