Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 21fb4f1

Browse files
committed
Mysqli doesn't support the named parameters used by PdoAdapter
1 parent d695b43 commit 21fb4f1

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Cache\Exception;
13+
14+
class NotSupportedException extends LogicException
15+
{
16+
}

src/Symfony/Component/Cache/Traits/PdoTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Doctrine\DBAL\Exception\TableNotFoundException;
1818
use Doctrine\DBAL\Schema\Schema;
1919
use Symfony\Component\Cache\Exception\InvalidArgumentException;
20+
use Symfony\Component\Cache\Exception\NotSupportedException;
2021
use Symfony\Component\Cache\Marshaller\DefaultMarshaller;
2122
use Symfony\Component\Cache\Marshaller\MarshallerInterface;
2223

@@ -395,6 +396,7 @@ private function getConnection()
395396
} else {
396397
switch ($this->driver = $this->conn->getDriver()->getName()) {
397398
case 'mysqli':
399+
throw new NotSupportedException(sprintf('The adapter "%s" does not support the mysqli driver, use pdo_mysql instead.', \get_class($this)));
398400
case 'pdo_mysql':
399401
case 'drizzle_pdo_mysql':
400402
$this->driver = 'mysql';

0 commit comments

Comments
 (0)