Devise\Support\Installer\DatabaseCreator::findPdoConnection PHP Method

findPdoConnection() protected method

Creates a PDO connection for us
protected findPdoConnection ( string $driver, string $host, string $username, string $password ) : PDO
$driver string
$host string
$username string
$password string
return PDO
    protected function findPdoConnection($driver, $host, $username, $password)
    {
        if (!is_null($this->connection)) {
            return $this->connection;
        }
        switch ($driver) {
            case 'sqlite':
            case 'mysql':
            case 'psgql':
            case 'sqlsrv':
                return new \PDO("{$driver}:host={$host}", $username, $password);
        }
        throw new \Exception("Could not create connection for driver " . $driver);
    }