2008-09-12 12:51:56 +04:00
|
|
|
<?php
|
|
|
|
|
2009-02-20 08:46:20 +03:00
|
|
|
namespace Doctrine\DBAL\Driver\PDOPgSql;
|
|
|
|
|
|
|
|
use Doctrine\DBAL\Platforms;
|
2008-09-12 12:51:56 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Driver that connects through pdo_pgsql.
|
|
|
|
*
|
|
|
|
* @since 2.0
|
|
|
|
*/
|
2009-02-20 08:46:20 +03:00
|
|
|
class Driver implements \Doctrine\DBAL\Driver
|
2008-09-12 12:51:56 +04:00
|
|
|
{
|
|
|
|
public function connect(array $params, $username = null, $password = null, array $driverOptions = array())
|
|
|
|
{
|
2009-02-20 08:46:20 +03:00
|
|
|
return new \Doctrine\DBAL\Driver\PDOConnection(
|
|
|
|
$this->_constructPdoDsn($params),
|
|
|
|
$username,
|
|
|
|
$password,
|
|
|
|
$driverOptions
|
|
|
|
);
|
2008-09-12 12:51:56 +04:00
|
|
|
}
|
2009-02-20 08:46:20 +03:00
|
|
|
|
2008-09-12 12:51:56 +04:00
|
|
|
/**
|
|
|
|
* Constructs the Postgres PDO DSN.
|
|
|
|
*
|
|
|
|
* @return string The DSN.
|
|
|
|
*/
|
|
|
|
private function _constructPdoDsn(array $params)
|
|
|
|
{
|
|
|
|
//TODO
|
|
|
|
}
|
2009-02-20 08:46:20 +03:00
|
|
|
|
2008-09-12 12:51:56 +04:00
|
|
|
public function getDatabasePlatform()
|
|
|
|
{
|
2009-02-20 08:46:20 +03:00
|
|
|
return new \Doctrine\DBAL\Platforms\PostgreSqlPlatform();
|
2008-09-12 12:51:56 +04:00
|
|
|
}
|
2009-02-20 08:46:20 +03:00
|
|
|
|
|
|
|
public function getSchemaManager(\Doctrine\DBAL\Connection $conn)
|
2008-09-12 12:51:56 +04:00
|
|
|
{
|
2009-02-20 08:46:20 +03:00
|
|
|
return new \Doctrine\DBAL\Schema\PostgreSqlSchemaManager($conn);
|
2008-09-12 12:51:56 +04:00
|
|
|
}
|
2009-02-20 08:46:20 +03:00
|
|
|
}
|