refactoring the database layer.

This commit is contained in:
Taylor Otwell
2011-09-11 23:25:31 -05:00
parent 3ada2cbd3e
commit 2521ab3c1d
12 changed files with 19 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
<?php namespace Laravel\Database\Connector;
use Laravel\Database\Connector;
use PDO;
class SQLite extends Connector {
@@ -14,15 +14,15 @@ class SQLite extends Connector {
{
if ($config['database'] == ':memory:')
{
return new \PDO('sqlite::memory:', null, null, $this->options);
return new PDO('sqlite::memory:', null, null, $this->options);
}
elseif (file_exists($path = DATABASE_PATH.$config['database'].'.sqlite'))
{
return new \PDO('sqlite:'.$path, null, null, $this->options);
return new PDO('sqlite:'.$path, null, null, $this->options);
}
elseif (file_exists($config['database']))
{
return new \PDO('sqlite:'.$config['database'], null, null, $this->options);
return new PDO('sqlite:'.$config['database'], null, null, $this->options);
}
throw new \Exception("SQLite database [".$config['database']."] could not be found.");