Unverified Commit d1bbcbe8 authored by Michael Moravec's avatar Michael Moravec Committed by Sergei Morozov

Drop PDO DB2 driver

parent fc6091c3
...@@ -8,6 +8,14 @@ All implementations of the `PingableConnection` and `ServerInfoAwareConnection` ...@@ -8,6 +8,14 @@ All implementations of the `PingableConnection` and `ServerInfoAwareConnection`
All implementations of the `VersionAwarePlatformDriver` interface have to implement the methods defined in the `Driver` interface as well. All implementations of the `VersionAwarePlatformDriver` interface have to implement the methods defined in the `Driver` interface as well.
## BC BREAK: Removed PDO DB2 driver
This PDO-based IBM DB2 driver (built on top of `pdo_ibm` extension) has already been unsupported as of 2.5, it has been now removed.
The following class has been removed:
* `Doctrine\DBAL\Driver\PDOIbm\Driver`
## BC BREAK: Removed support for SQL Anywhere 12 and older ## BC BREAK: Removed support for SQL Anywhere 12 and older
DBAL now requires SQL Anywhere 16 or newer, support for unmaintained versions has been dropped. DBAL now requires SQL Anywhere 16 or newer, support for unmaintained versions has been dropped.
......
<?php
namespace Doctrine\DBAL\Driver\PDOIbm;
use Doctrine\DBAL\Driver\AbstractDB2Driver;
use Doctrine\DBAL\Driver\PDOConnection;
/**
* Driver for the PDO IBM extension.
*
* @deprecated Use the driver based on the ibm_db2 extension instead.
*/
class Driver extends AbstractDB2Driver
{
/**
* {@inheritdoc}
*/
public function connect(array $params, $username = null, $password = null, array $driverOptions = [])
{
return new PDOConnection(
$this->_constructPdoDsn($params),
$username,
$password,
$driverOptions
);
}
/**
* Constructs the IBM PDO DSN.
*
* @param mixed[] $params
*
* @return string The DSN.
*/
private function _constructPdoDsn(array $params)
{
$dsn = 'ibm:';
if (isset($params['host'])) {
$dsn .= 'HOSTNAME=' . $params['host'] . ';';
}
if (isset($params['port'])) {
$dsn .= 'PORT=' . $params['port'] . ';';
}
$dsn .= 'PROTOCOL=TCPIP;';
if (isset($params['dbname'])) {
$dsn .= 'DATABASE=' . $params['dbname'] . ';';
}
return $dsn;
}
/**
* {@inheritdoc}
*
* @deprecated
*/
public function getName()
{
return 'pdo_ibm';
}
}
<?php
namespace Doctrine\Tests\DBAL\Driver\PDOIbm;
use Doctrine\DBAL\Driver as DriverInterface;
use Doctrine\DBAL\Driver\PDOIbm\Driver;
use Doctrine\Tests\DBAL\Driver\AbstractDB2DriverTest;
class DriverTest extends AbstractDB2DriverTest
{
public function testReturnsName() : void
{
self::assertSame('pdo_ibm', $this->driver->getName());
}
protected function createDriver() : DriverInterface
{
return new Driver();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment