Skip to content

Commit edff65f

Browse files
committed
Merge branch '6.2' into 6.3
* 6.2: fix Doctrine deprecations fix merge Fix Doctrine deprecations [Validator] Remove internal from methods on non-internal interfaces [PhpUnitBridge] Fix support for the NO_COLOR env var
2 parents a36b968 + b2d34ad commit edff65f

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

Session/Storage/Handler/PdoSessionHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ public function updateTimestamp(#[\SensitiveParameter] string $sessionId, string
380380
$updateStmt = $this->pdo->prepare(
381381
"UPDATE $this->table SET $this->lifetimeCol = :expiry, $this->timeCol = :time WHERE $this->idCol = :id"
382382
);
383-
$updateStmt->bindParam(':id', $sessionId, \PDO::PARAM_STR);
384-
$updateStmt->bindParam(':expiry', $expiry, \PDO::PARAM_INT);
383+
$updateStmt->bindValue(':id', $sessionId, \PDO::PARAM_STR);
384+
$updateStmt->bindValue(':expiry', $expiry, \PDO::PARAM_INT);
385385
$updateStmt->bindValue(':time', time(), \PDO::PARAM_INT);
386386
$updateStmt->execute();
387387
} catch (\PDOException $e) {

Session/Storage/Handler/SessionHandlerFactory.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@
1111

1212
namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
1313

14+
use Doctrine\DBAL\Configuration;
1415
use Doctrine\DBAL\DriverManager;
1516
use Relay\Relay;
17+
use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory;
18+
use Doctrine\DBAL\Tools\DsnParser;
19+
use Doctrine\ORM\ORMSetup;
1620
use Symfony\Component\Cache\Adapter\AbstractAdapter;
1721

1822
/**
@@ -67,7 +71,15 @@ public static function createHandler(object|string $connection, array $options =
6771
if (!class_exists(DriverManager::class)) {
6872
throw new \InvalidArgumentException('Unsupported PDO OCI DSN. Try running "composer require doctrine/dbal".');
6973
}
70-
$connection = DriverManager::getConnection(['url' => $connection])->getWrappedConnection();
74+
$connection[3] = '-';
75+
$params = class_exists(DsnParser::class) ? (new DsnParser())->parse($connection) : ['url' => $connection];
76+
$config = class_exists(ORMSetup::class) ? ORMSetup::createConfiguration(true) : new Configuration();
77+
if (class_exists(DefaultSchemaManagerFactory::class)) {
78+
$config->setSchemaManagerFactory(new DefaultSchemaManagerFactory());
79+
}
80+
81+
$connection = DriverManager::getConnection($params, $config);
82+
$connection = method_exists($connection, 'getNativeConnection') ? $connection->getNativeConnection() : $connection->getWrappedConnection();
7183
// no break;
7284

7385
case str_starts_with($connection, 'mssql://'):

0 commit comments

Comments
 (0)