]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Remove custom Postgres class
authorJeremy Benoist <jeremy.benoist@gmail.com>
Mon, 26 Nov 2018 19:02:15 +0000 (20:02 +0100)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Wed, 28 Nov 2018 21:04:54 +0000 (22:04 +0100)
Because PG > 10 is now supported by DBAL >= 2.6.0

app/config/config.yml
app/config/config_test.yml
app/config/parameters.yml.dist
app/config/parameters_test.yml
app/config/tests/parameters_test.mysql.yml
app/config/tests/parameters_test.pgsql.yml
app/config/tests/parameters_test.sqlite.yml
src/Wallabag/CoreBundle/Doctrine/DBAL/Driver/CustomPostgreSQLDriver.php [deleted file]
src/Wallabag/CoreBundle/Doctrine/DBAL/Schema/CustomPostgreSqlSchemaManager.php [deleted file]

index 092f3ec04860f342aecbfffb607252a45d168c80..ee0f0a38a8caf73f359ded5b914ce566818614ad 100644 (file)
@@ -46,7 +46,6 @@ twig:
 doctrine:
     dbal:
         driver: "%database_driver%"
-        driver_class: "%database_driver_class%"
         host: "%database_host%"
         port: "%database_port%"
         dbname: "%database_name%"
index 11e0feb778d92c48a71732150e110cb3e9376680..216f84316078b06734b5ff37543e787f183803e4 100644 (file)
@@ -24,7 +24,6 @@ swiftmailer:
 doctrine:
     dbal:
         driver: "%test_database_driver%"
-        driver_class: "%test_database_driver_class%"
         host: "%test_database_host%"
         port: "%test_database_port%"
         dbname: "%test_database_name%"
index d21f20e074710d7317a5728eac060da08ef166ae..13e2584f25b9a192a7816da2fe7bb34c1ee5de22 100644 (file)
@@ -11,8 +11,6 @@ parameters:
     # database_password: %env.database_password%
 
     database_driver: pdo_mysql
-    database_driver_class: ~
-    # database_driver_class: Wallabag\CoreBundle\Doctrine\DBAL\Driver\CustomPostgreSQLDriver
     database_host: 127.0.0.1
     database_port: ~
     database_name: wallabag
index 64e51976595d461ddac5ee77b1fe3cc269bf25da..257d2acecbc4ba637b4f316628993647c01c3d1b 100644 (file)
@@ -8,4 +8,3 @@ parameters:
     test_database_path: "%env(TEST_DATABASE_PATH)%"
     env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite"
     test_database_charset: utf8
-    test_database_driver_class: ~
index 0b7b82eb922cd7686bc970e766e099b9952116b8..36b227fbc800f11ce6dbebb0a9d8eade68d728be 100644 (file)
@@ -1,6 +1,5 @@
 parameters:
     test_database_driver: pdo_mysql
-    test_database_driver_class: ~
     test_database_host: localhost
     test_database_port: 3306
     test_database_name: wallabag_test
index ea249324e0eff08518a1ba52c27ae4e391b25b71..60f51df6d84e0c6631d15de618726bd294c4acfd 100644 (file)
@@ -1,6 +1,5 @@
 parameters:
     test_database_driver: pdo_pgsql
-    test_database_driver_class: Wallabag\CoreBundle\Doctrine\DBAL\Driver\CustomPostgreSQLDriver
     test_database_host: localhost
     test_database_port:
     test_database_name: wallabag_test
index 64cd984b9c01d74b911f7a32796c69bd12b0ba76..2b92d579f5d1db332c3aa68c523734c15e94043c 100644 (file)
@@ -1,6 +1,5 @@
 parameters:
     test_database_driver: pdo_sqlite
-    test_database_driver_class: ~
     test_database_host: localhost
     test_database_port:
     test_database_name: ~
diff --git a/src/Wallabag/CoreBundle/Doctrine/DBAL/Driver/CustomPostgreSQLDriver.php b/src/Wallabag/CoreBundle/Doctrine/DBAL/Driver/CustomPostgreSQLDriver.php
deleted file mode 100644 (file)
index eb5b203..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-namespace Wallabag\CoreBundle\Doctrine\DBAL\Driver;
-
-use Doctrine\DBAL\Connection;
-use Doctrine\DBAL\Driver\PDOPgSql\Driver;
-use Wallabag\CoreBundle\Doctrine\DBAL\Schema\CustomPostgreSqlSchemaManager;
-
-/**
- * This custom driver allow to use a different schema manager
- * So we can fix the PostgreSQL 10 problem.
- *
- * @see https://github.com/wallabag/wallabag/issues/3479
- * @see https://github.com/doctrine/dbal/issues/2868
- */
-class CustomPostgreSQLDriver extends Driver
-{
-    /**
-     * {@inheritdoc}
-     */
-    public function getSchemaManager(Connection $conn)
-    {
-        return new CustomPostgreSqlSchemaManager($conn);
-    }
-}
diff --git a/src/Wallabag/CoreBundle/Doctrine/DBAL/Schema/CustomPostgreSqlSchemaManager.php b/src/Wallabag/CoreBundle/Doctrine/DBAL/Schema/CustomPostgreSqlSchemaManager.php
deleted file mode 100644 (file)
index 439ae17..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-
-namespace Wallabag\CoreBundle\Doctrine\DBAL\Schema;
-
-use Doctrine\DBAL\Schema\PostgreSqlSchemaManager;
-use Doctrine\DBAL\Schema\Sequence;
-
-/**
- * This custom schema manager fix the PostgreSQL 10 problem.
- *
- * @see https://github.com/wallabag/wallabag/issues/3479
- * @see https://github.com/doctrine/dbal/issues/2868
- */
-class CustomPostgreSqlSchemaManager extends PostgreSqlSchemaManager
-{
-    /**
-     * {@inheritdoc}
-     */
-    protected function _getPortableSequenceDefinition($sequence)
-    {
-        $sequenceName = $sequence['relname'];
-        if ('public' !== $sequence['schemaname']) {
-            $sequenceName = $sequence['schemaname'] . '.' . $sequence['relname'];
-        }
-
-        $query = 'SELECT min_value, increment_by FROM ' . $this->_platform->quoteIdentifier($sequenceName);
-
-        // the `method_exists` is only to avoid test to fail:
-        // DAMA\DoctrineTestBundle\Doctrine\DBAL\StaticConnection doesn't support the `getServerVersion`
-        if (method_exists($this->_conn->getWrappedConnection(), 'getServerVersion') && (float) ($this->_conn->getWrappedConnection()->getServerVersion()) >= 10) {
-            $query = "SELECT min_value, increment_by FROM pg_sequences WHERE schemaname = 'public' AND sequencename = " . $this->_conn->quote($sequenceName);
-        }
-
-        $data = $this->_conn->fetchAll($query);
-
-        return new Sequence($sequenceName, $data[0]['increment_by'], $data[0]['min_value']);
-    }
-}