public function setDriver($dsn, array $config = [], array $options = [])
    {
        $class = '\Micro\Db\Drivers\\'.ucfirst(substr($dsn, 0, strpos($dsn, ':'))).'Driver';

        if (!class_exists($class)) {
            throw new Exception('DB driver `'.$class.'` not supported');
        }

        unset($this->driver);

        $this->driver = new $class($dsn, $config, $options);
    }
public function setDriver($dsn, array $config = [], array $options = [])
    {
        $class = '\Micro\Db\Drivers\\'.ucfirst(substr($dsn, 0, strpos($dsn, ':'))).'Driver';

        if (!class_exists($class)) {
            throw new Exception('DB driver `'.$class.'` not supported');
        }

        unset($this->driver);

        $this->driver = new $class($dsn, $config, $options);
    }
public function setDriver ( $ dsn , array $ config = [ ] , array $ options = [ ] ) { $ class = '\Micro\Db\Drivers\\' . ucfirst ( substr ( $ dsn , 0 , strpos ( $ dsn , ':' ) ) ) . 'Driver' ; if ( ! class_exists ( $ class ) ) { throw new Exception ( 'DB driver `' . $ class . '` not supported' ) ; } unset ( $ this -> driver ) ; $ this -> driver = new $ class ( $ dsn , $ config , $ options ) ; }
Set active connection driver

@access public

@param string $dsn DSN connection string
@param array $config Configuration of connection
@param array $options Other options

@return void
@throws Exception
Set active connection driver