From f446c92fbfeab1cadc0b60ffb6023388e18e4f75 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Thu, 16 Nov 2017 15:27:16 +0200 Subject: [PATCH 1/7] Moving server_version to committed config --- doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml | 1 + doctrine/doctrine-bundle/1.6/manifest.json | 2 +- doctrine/doctrine-bundle/1.6/post-install.txt | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 doctrine/doctrine-bundle/1.6/post-install.txt diff --git a/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml b/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml index f5d651117..64f43cd5b 100644 --- a/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml +++ b/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml @@ -2,6 +2,7 @@ doctrine: dbal: # With Symfony 3.3, remove the `resolve:` prefix url: '%env(resolve:DATABASE_URL)%' + server_version: 5.7 orm: auto_generate_proxy_classes: '%kernel.debug%' naming_strategy: doctrine.orm.naming_strategy.underscore diff --git a/doctrine/doctrine-bundle/1.6/manifest.json b/doctrine/doctrine-bundle/1.6/manifest.json index 1427a93bc..bc8451ee7 100644 --- a/doctrine/doctrine-bundle/1.6/manifest.json +++ b/doctrine/doctrine-bundle/1.6/manifest.json @@ -10,6 +10,6 @@ "#1": "Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url", "#2": "For an SQLite database, use: \"sqlite:///%kernel.project_dir%/var/data.db\"", "#3": "Set \"serverVersion\" to your server version to avoid edge-case exceptions and extra database calls", - "DATABASE_URL": "mysql://db_user:db_password@127.0.0.1:3306/db_name?charset=utf8mb4&serverVersion=5.7" + "DATABASE_URL": "mysql://db_user:db_password@127.0.0.1:3306/db_name?charset=utf8mb4" } } diff --git a/doctrine/doctrine-bundle/1.6/post-install.txt b/doctrine/doctrine-bundle/1.6/post-install.txt new file mode 100644 index 000000000..5b5c44abf --- /dev/null +++ b/doctrine/doctrine-bundle/1.6/post-install.txt @@ -0,0 +1,6 @@ + + Configure your database + + + * Modify your DATABASE_URL config in .env + * Check your server_version in config/packages/doctrine.yaml From 61ca864c15b66ceb0e6ec91cb41a6dd25510a801 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Thu, 16 Nov 2017 15:36:37 +0200 Subject: [PATCH 2/7] adding fallback DATABASE_URL to avoid connecting to the db during cache:warmup --- .../1.6/config/packages/doctrine.yaml | 13 ++++++++++++- doctrine/doctrine-bundle/1.6/post-install.txt | 4 +++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml b/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml index 64f43cd5b..1509b5b40 100644 --- a/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml +++ b/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml @@ -1,8 +1,19 @@ +parameters: + # update these for your app + doctrine.database_server: mysql + doctrine.server_version: 5.7 + + # adds a fallback URL if the env var is not set + # this is useful to allow you to run cache:warmup + # even when your environment variables don't yet exist + # you should not need to change this value + DATABASE_URL: '%doctrine.database_server%://' + doctrine: dbal: # With Symfony 3.3, remove the `resolve:` prefix url: '%env(resolve:DATABASE_URL)%' - server_version: 5.7 + server_version: '%doctrine.server_version%' orm: auto_generate_proxy_classes: '%kernel.debug%' naming_strategy: doctrine.orm.naming_strategy.underscore diff --git a/doctrine/doctrine-bundle/1.6/post-install.txt b/doctrine/doctrine-bundle/1.6/post-install.txt index 5b5c44abf..e97f842f0 100644 --- a/doctrine/doctrine-bundle/1.6/post-install.txt +++ b/doctrine/doctrine-bundle/1.6/post-install.txt @@ -3,4 +3,6 @@ * Modify your DATABASE_URL config in .env - * Check your server_version in config/packages/doctrine.yaml + + * Configure the database_server (mysql) and + server_version (5.7) in config/packages/doctrine.yaml From 25e96782f50ee0880811a8d08c56f263e28c7e14 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Thu, 16 Nov 2017 15:45:18 +0200 Subject: [PATCH 3/7] Moving some params --- doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml | 6 +----- doctrine/doctrine-bundle/1.6/manifest.json | 4 ++++ doctrine/doctrine-bundle/1.6/post-install.txt | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml b/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml index 1509b5b40..ee7be0e32 100644 --- a/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml +++ b/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml @@ -1,13 +1,9 @@ parameters: - # update these for your app - doctrine.database_server: mysql - doctrine.server_version: 5.7 - # adds a fallback URL if the env var is not set # this is useful to allow you to run cache:warmup # even when your environment variables don't yet exist # you should not need to change this value - DATABASE_URL: '%doctrine.database_server%://' + env(DATABASE_URL): '%doctrine.database_server%://' doctrine: dbal: diff --git a/doctrine/doctrine-bundle/1.6/manifest.json b/doctrine/doctrine-bundle/1.6/manifest.json index bc8451ee7..18cdf4ee0 100644 --- a/doctrine/doctrine-bundle/1.6/manifest.json +++ b/doctrine/doctrine-bundle/1.6/manifest.json @@ -11,5 +11,9 @@ "#2": "For an SQLite database, use: \"sqlite:///%kernel.project_dir%/var/data.db\"", "#3": "Set \"serverVersion\" to your server version to avoid edge-case exceptions and extra database calls", "DATABASE_URL": "mysql://db_user:db_password@127.0.0.1:3306/db_name?charset=utf8mb4" + }, + "container": { + "doctrine.database_server": "mysql", + "doctrine.server_version": "5.7" } } diff --git a/doctrine/doctrine-bundle/1.6/post-install.txt b/doctrine/doctrine-bundle/1.6/post-install.txt index e97f842f0..684cd1866 100644 --- a/doctrine/doctrine-bundle/1.6/post-install.txt +++ b/doctrine/doctrine-bundle/1.6/post-install.txt @@ -5,4 +5,4 @@ * Modify your DATABASE_URL config in .env * Configure the database_server (mysql) and - server_version (5.7) in config/packages/doctrine.yaml + server_version (5.7) in config/services.yaml From cb9f0ede5fe708d37b1c4c0f74fa8d6842a5fc6f Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sun, 19 Nov 2017 20:31:10 +0200 Subject: [PATCH 4/7] Simplifying setup: don't use any parameters We can do this by using the driver and server_version config. Then, we can just set DATABASE_URL to blank, to supress the error that it does not exist. If it *is* set, it overrides the driver option, but they should match anyways. --- .../1.6/config/packages/doctrine.yaml | 15 +++++++++------ doctrine/doctrine-bundle/1.6/manifest.json | 4 ---- doctrine/doctrine-bundle/1.6/post-install.txt | 10 +++++----- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml b/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml index ee7be0e32..f53a37dda 100644 --- a/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml +++ b/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml @@ -1,15 +1,18 @@ parameters: - # adds a fallback URL if the env var is not set - # this is useful to allow you to run cache:warmup - # even when your environment variables don't yet exist - # you should not need to change this value - env(DATABASE_URL): '%doctrine.database_server%://' + # Adds a fallback DATABASE_URL if the env var is not set. + # This allows you to run cache:warmup even if your + # environment variables are not available yet. + # You should not need to change this value. + env(DATABASE_URL): '' doctrine: dbal: + # configure these for your database server + driver: 'pdo_mysql' + server_version: '5.7' + # With Symfony 3.3, remove the `resolve:` prefix url: '%env(resolve:DATABASE_URL)%' - server_version: '%doctrine.server_version%' orm: auto_generate_proxy_classes: '%kernel.debug%' naming_strategy: doctrine.orm.naming_strategy.underscore diff --git a/doctrine/doctrine-bundle/1.6/manifest.json b/doctrine/doctrine-bundle/1.6/manifest.json index 18cdf4ee0..bc8451ee7 100644 --- a/doctrine/doctrine-bundle/1.6/manifest.json +++ b/doctrine/doctrine-bundle/1.6/manifest.json @@ -11,9 +11,5 @@ "#2": "For an SQLite database, use: \"sqlite:///%kernel.project_dir%/var/data.db\"", "#3": "Set \"serverVersion\" to your server version to avoid edge-case exceptions and extra database calls", "DATABASE_URL": "mysql://db_user:db_password@127.0.0.1:3306/db_name?charset=utf8mb4" - }, - "container": { - "doctrine.database_server": "mysql", - "doctrine.server_version": "5.7" } } diff --git a/doctrine/doctrine-bundle/1.6/post-install.txt b/doctrine/doctrine-bundle/1.6/post-install.txt index 684cd1866..fee1762fe 100644 --- a/doctrine/doctrine-bundle/1.6/post-install.txt +++ b/doctrine/doctrine-bundle/1.6/post-install.txt @@ -1,8 +1,8 @@ - - Configure your database - + + Next: Configuration + * Modify your DATABASE_URL config in .env - * Configure the database_server (mysql) and - server_version (5.7) in config/services.yaml + * Configure the driver (mysql) and + server_version (5.7) in config/packages/doctrine.yaml From 72bf213901b446412aae65291d41fc97c73e8de0 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sun, 19 Nov 2017 20:34:20 +0200 Subject: [PATCH 5/7] Also putting charset option in a place where it is committed --- doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml | 1 + doctrine/doctrine-bundle/1.6/manifest.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml b/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml index f53a37dda..ab772e9af 100644 --- a/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml +++ b/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml @@ -10,6 +10,7 @@ doctrine: # configure these for your database server driver: 'pdo_mysql' server_version: '5.7' + charset: utf8mb4 # With Symfony 3.3, remove the `resolve:` prefix url: '%env(resolve:DATABASE_URL)%' diff --git a/doctrine/doctrine-bundle/1.6/manifest.json b/doctrine/doctrine-bundle/1.6/manifest.json index bc8451ee7..df79bcac4 100644 --- a/doctrine/doctrine-bundle/1.6/manifest.json +++ b/doctrine/doctrine-bundle/1.6/manifest.json @@ -10,6 +10,6 @@ "#1": "Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url", "#2": "For an SQLite database, use: \"sqlite:///%kernel.project_dir%/var/data.db\"", "#3": "Set \"serverVersion\" to your server version to avoid edge-case exceptions and extra database calls", - "DATABASE_URL": "mysql://db_user:db_password@127.0.0.1:3306/db_name?charset=utf8mb4" + "DATABASE_URL": "mysql://db_user:db_password@127.0.0.1:3306/db_name" } } From 2d19e7c593a30eb0547b122fa73c161bf3fc9f5a Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sun, 19 Nov 2017 20:34:59 +0200 Subject: [PATCH 6/7] Tweak --- doctrine/doctrine-bundle/1.6/post-install.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doctrine/doctrine-bundle/1.6/post-install.txt b/doctrine/doctrine-bundle/1.6/post-install.txt index fee1762fe..681815f79 100644 --- a/doctrine/doctrine-bundle/1.6/post-install.txt +++ b/doctrine/doctrine-bundle/1.6/post-install.txt @@ -1,6 +1,6 @@ - - Next: Configuration - + + Next: Configuration + * Modify your DATABASE_URL config in .env From 2efa651860a9914c61ca4446db9a7674af7182b9 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Mon, 20 Nov 2017 15:57:25 -0500 Subject: [PATCH 7/7] add note to configure doctrine.yaml --- doctrine/doctrine-bundle/1.6/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doctrine/doctrine-bundle/1.6/manifest.json b/doctrine/doctrine-bundle/1.6/manifest.json index df79bcac4..3ab621af0 100644 --- a/doctrine/doctrine-bundle/1.6/manifest.json +++ b/doctrine/doctrine-bundle/1.6/manifest.json @@ -9,7 +9,7 @@ "env": { "#1": "Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url", "#2": "For an SQLite database, use: \"sqlite:///%kernel.project_dir%/var/data.db\"", - "#3": "Set \"serverVersion\" to your server version to avoid edge-case exceptions and extra database calls", + "#3": "Configure your db driver and server_version in config/packages/doctrine.yaml", "DATABASE_URL": "mysql://db_user:db_password@127.0.0.1:3306/db_name" } }