mirror of
https://github.com/symfony/recipes.git
synced 2026-09-17 01:56:26 +03:00
Merge pull request #258
This commit is contained in:
@@ -1,5 +1,17 @@
|
|||||||
|
parameters:
|
||||||
|
# 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:
|
doctrine:
|
||||||
dbal:
|
dbal:
|
||||||
|
# configure these for your database server
|
||||||
|
driver: 'pdo_mysql'
|
||||||
|
server_version: '5.7'
|
||||||
|
charset: utf8mb4
|
||||||
|
|
||||||
# With Symfony 3.3, remove the `resolve:` prefix
|
# With Symfony 3.3, remove the `resolve:` prefix
|
||||||
url: '%env(resolve:DATABASE_URL)%'
|
url: '%env(resolve:DATABASE_URL)%'
|
||||||
orm:
|
orm:
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"env": {
|
"env": {
|
||||||
"#1": "Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url",
|
"#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\"",
|
"#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?charset=utf8mb4&serverVersion=5.7"
|
"DATABASE_URL": "mysql://db_user:db_password@127.0.0.1:3306/db_name"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<bg=blue;fg=white> </>
|
||||||
|
<bg=blue;fg=white> Next: Configuration </>
|
||||||
|
<bg=blue;fg=white> </>
|
||||||
|
|
||||||
|
* Modify your DATABASE_URL config in <fg=green>.env</>
|
||||||
|
|
||||||
|
* Configure the <fg=green>driver</> (mysql) and
|
||||||
|
<fg=green>server_version</fg> (5.7) in <fg=green>config/packages/doctrine.yaml</>
|
||||||
Reference in New Issue
Block a user