more 2.0 changes

This commit is contained in:
Taylor Otwell
2011-08-19 20:12:39 -05:00
parent 73b1cb78f4
commit 5b85edb23b
38 changed files with 951 additions and 614 deletions

View File

@@ -0,0 +1,30 @@
<?php namespace Laravel\DB\Connection;
use Laravel\DB\Connector;
use Laravel\DB\Connection;
class Factory {
/**
* Get a connnection instance.
*
* The connection instance created depends on the driver being used.
*
* @param string $connection
* @param object $config
* @param Connector $connector
* @return Connection
*/
public static function make($connection, $config, Connector $connector)
{
switch ($config['driver'])
{
case 'mysql':
return new MySQL($connection, $config, $connector);
default:
return new Connection($connection, $config, $connector);
}
}
}

View File

@@ -0,0 +1,16 @@
<?php namespace Laravel\DB\Connection;
use Laravel\DB\Connection;
class MySQL extends Connection {
/**
* Get the keyword identifier wrapper for the connection.
*
* MySQL uses a non-standard wrapper
*
* @return string
*/
public function wrapper() { return '`'; }
}