From e23cd6a85630df5bdec49c0ccfa247dfcad4f398 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 10 Apr 2021 13:47:51 +0200 Subject: [PATCH] Removed old MySQL connection options --- config/autoload/entity-manager.local.php.dist | 9 --------- config/test/test_config.global.php | 4 ---- docker/config/shlink_in_docker.local.php | 7 ------- 3 files changed, 20 deletions(-) diff --git a/config/autoload/entity-manager.local.php.dist b/config/autoload/entity-manager.local.php.dist index 1faed328..f3cca338 100644 --- a/config/autoload/entity-manager.local.php.dist +++ b/config/autoload/entity-manager.local.php.dist @@ -2,14 +2,6 @@ declare(strict_types=1); -use function Shlinkio\Shlink\Common\env; - -// When running tests, any mysql-specific option can interfere with other drivers -$driverOptions = env('APP_ENV') === 'test' ? [] : [ - PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', - PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, -]; - return [ 'entity_manager' => [ @@ -18,7 +10,6 @@ return [ 'password' => 'root', 'driver' => 'pdo_mysql', 'host' => 'shlink_db', - 'driverOptions' => $driverOptions, ], ], diff --git a/config/test/test_config.global.php b/config/test/test_config.global.php index c6d90e39..c8e9510b 100644 --- a/config/test/test_config.global.php +++ b/config/test/test_config.global.php @@ -55,10 +55,6 @@ $buildDbConnection = function (): array { 'password' => 'root', 'dbname' => 'shlink_test', 'charset' => 'utf8', - 'driverOptions' => [ - PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', - PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, - ], ], 'postgres' => [ 'driver' => 'pdo_pgsql', diff --git a/docker/config/shlink_in_docker.local.php b/docker/config/shlink_in_docker.local.php index d022f79d..acecda14 100644 --- a/docker/config/shlink_in_docker.local.php +++ b/docker/config/shlink_in_docker.local.php @@ -42,12 +42,6 @@ $helper = new class { ]; } - $driverOptions = ! $isMysql ? [] : [ - // 1002 -> PDO::MYSQL_ATTR_INIT_COMMAND - 1002 => 'SET NAMES utf8', - // 1000 -> PDO::MYSQL_ATTR_USE_BUFFERED_QUERY - 1000 => true, - ]; return [ 'driver' => self::DB_DRIVERS_MAP[$driver], 'dbname' => env('DB_NAME', 'shlink'), @@ -55,7 +49,6 @@ $helper = new class { 'password' => env('DB_PASSWORD'), 'host' => env('DB_HOST', $driver === 'postgres' ? env('DB_UNIX_SOCKET') : null), 'port' => env('DB_PORT', self::DB_PORTS_MAP[$driver]), - 'driverOptions' => $driverOptions, 'unix_socket' => $isMysql ? env('DB_UNIX_SOCKET') : null, ]; }