moving some laravel classes around, switching alias to reflect changes. added some factories. removed system ioc container config file.
This commit is contained in:
29
laravel/database/connectors/factory.php
Normal file
29
laravel/database/connectors/factory.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php namespace Laravel\Database\Connectors;
|
||||
|
||||
class Factory {
|
||||
|
||||
/**
|
||||
* Create a new database connector instance.
|
||||
*
|
||||
* @param string $driver
|
||||
* @return Connector
|
||||
*/
|
||||
public static function make($driver)
|
||||
{
|
||||
switch ($driver)
|
||||
{
|
||||
case 'sqlite':
|
||||
return new SQLite(DATABASE_PATH);
|
||||
|
||||
case 'mysql':
|
||||
return new MySQL;
|
||||
|
||||
case 'pgsql':
|
||||
return new Postgres;
|
||||
|
||||
default:
|
||||
throw new \Exception("Database driver [$driver] is not supported.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user