Skip to content

Commit

Permalink
minor #572 Use DSN-like strings to define credentials (javiereguiluz)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the master branch (closes #572).

Discussion
----------

Use DSN-like strings to define credentials

This is the new best practice for modern Symfony apps. See https://github.com/symfony/recipes/blob/master/symfony/swiftmailer-bundle/2.5/etc/packages/swiftmailer.yaml

Commits
-------

b4e2d16 Use DSN-like strings to define credentials
  • Loading branch information
javiereguiluz committed May 30, 2017
2 parents c8a7c6c + b4e2d16 commit a99f756
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 27 deletions.
17 changes: 2 additions & 15 deletions app/config/config.yml
Expand Up @@ -62,16 +62,6 @@ doctrine:
dbal:
# if you don't want to use SQLite, change the URL in parameters.yml or set the DATABASE_URL environment variable
url: '%env(DATABASE_URL)%'

# instead of using a URL, you may also uncomment the following lines to configure your database
# driver: pdo_mysql
# host: '%database_host%'
# port: '%database_port%'
# dbname: '%database_name%'
# user: '%database_user%'
# password: '%database_password%'
# charset: UTF8

orm:
auto_generate_proxy_classes: '%kernel.debug%'
auto_mapping: true
Expand All @@ -83,8 +73,5 @@ doctrine:
# stores options that change from one server to another
#
swiftmailer:
transport: '%mailer_transport%'
host: '%mailer_host%'
username: '%mailer_user%'
password: '%mailer_password%'
spool: { type: memory }
url : '%env(MAILER_URL)%'
spool: { type: memory }
8 changes: 0 additions & 8 deletions app/config/config_test.yml
Expand Up @@ -15,14 +15,6 @@ web_profiler:
# swiftmailer:
# disable_delivery: true

# It's recommended to use a separate database for tests. This allows to have a
# fixed and known set of data fixtures, it simplifies the code of tests and it
# makes them more robust.
# In this case we just need to define a different path for the application database.
doctrine:
dbal:
path: "%kernel.project_dir%/var/data/blog_test.sqlite"

# this configuration simplifies testing URLs protected by the security mechanism
# See https://symfony.com/doc/current/cookbook/testing/http_authentication.html
security:
Expand Down
5 changes: 1 addition & 4 deletions app/config/parameters.yml.dist
Expand Up @@ -33,7 +33,4 @@ parameters:

# If you don't use a real mail server, you can send emails via your Gmail account.
# see https://symfony.com/doc/current/cookbook/email/gmail.html
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~
env(MAILER_URL): 'smtp://localhost:25?encryption=&auth_mode='
1 change: 1 addition & 0 deletions phpunit.xml.dist
Expand Up @@ -10,6 +10,7 @@
<php>
<ini name="error_reporting" value="-1" />
<server name="KERNEL_DIR" value="app/" />
<env name="DATABASE_URL" value="sqlite:///var/data/blog_test.sqlite"/>
</php>

<testsuites>
Expand Down

0 comments on commit a99f756

Please sign in to comment.