Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DSNs for DBAL 3.5 #1139

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions doctrine/doctrine-bundle/2.7/config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
doctrine:
dbal:
url: '%env(resolve:DATABASE_URL)%'

# IMPORTANT: You MUST configure your server version,
# either here or in the DATABASE_URL env var (see .env file)
#server_version: '15'
orm:
auto_generate_proxy_classes: true
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
auto_mapping: true
mappings:
App:
is_bundle: false
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App

when@test:
doctrine:
dbal:
# "TEST_TOKEN" is typically set by ParaTest
dbname_suffix: '_test%env(default::TEST_TOKEN)%'

when@prod:
doctrine:
orm:
auto_generate_proxy_classes: false
query_cache_driver:
type: pool
pool: doctrine.system_cache_pool
result_cache_driver:
type: pool
pool: doctrine.result_cache_pool

framework:
cache:
pools:
doctrine.result_cache_pool:
adapter: cache.app
doctrine.system_cache_pool:
adapter: cache.system
53 changes: 53 additions & 0 deletions doctrine/doctrine-bundle/2.7/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"bundles": {
"Doctrine\\Bundle\\DoctrineBundle\\DoctrineBundle": ["all"]
},
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/",
"src/": "%SRC_DIR%/"
},
"env": {
"#1": "Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url",
"#2": "IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml",
"#3": "",
"#4": "DATABASE_URL=\"pdo-sqlite:///%kernel.project_dir%/var/data.db\"",
"#5": "DATABASE_URL=\"pdo-mysql://app:[email protected]:3306/app?serverVersion=8.0.31&charset=utf8mb4\"",
"#6": "DATABASE_URL=\"mysqli://app:[email protected]:3306/app?serverVersion=10.9.3-MariaDB&charset=utf8mb4\"",
"DATABASE_URL": "pdo-pgsql://app:[email protected]:5432/app?serverVersion=15.0&charset=utf8"
},
"dockerfile": [
"RUN apk add --no-cache --virtual .pgsql-deps postgresql-dev; \\",
"\tdocker-php-ext-install -j$(nproc) pdo_pgsql; \\",
"\tapk add --no-cache --virtual .pgsql-rundeps so:libpq.so.5; \\",
"\tapk del .pgsql-deps"
],
"docker-compose": {
"docker-compose.yml": {
"services": [
"database:",
" image: postgres:${POSTGRES_VERSION:-15}-alpine",
" environment:",
" POSTGRES_DB: ${POSTGRES_DB:-app}",
" # You should definitely change the password in production",
" POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}",
" POSTGRES_USER: ${POSTGRES_USER:-app}",
" volumes:",
" - db-data:/var/lib/postgresql/data:rw",
" # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!",
" # - ./docker/db/data:/var/lib/postgresql/data:rw"
],
"volumes": ["db-data:"]
},
"docker-compose.override.yml": {
"services": [
"database:",
" ports:",
" - \"5432\""
]
}
},
"conflict": {
"doctrine/dbal": "<3.5",
"symfony/framework-bundle": "<5.3"
}
}
4 changes: 4 additions & 0 deletions doctrine/doctrine-bundle/2.7/post-install.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* Modify your DATABASE_URL config in <fg=green>.env</>

* Configure the <fg=green>driver</> (postgresql) and
<fg=green>server_version</> (15) in <fg=green>config/packages/doctrine.yaml</>
Empty file.
Empty file.