Skip to content

Commit 4684eb3

Browse files
Turn on "doctrine.orm.enable_lazy_ghost_objects" by default (#1140)
1 parent 296e45d commit 4684eb3

File tree

5 files changed

+101
-0
lines changed

5 files changed

+101
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
doctrine:
2+
dbal:
3+
url: '%env(resolve:DATABASE_URL)%'
4+
5+
# IMPORTANT: You MUST configure your server version,
6+
# either here or in the DATABASE_URL env var (see .env file)
7+
#server_version: '14'
8+
orm:
9+
auto_generate_proxy_classes: true
10+
enable_lazy_ghost_objects: true
11+
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
12+
auto_mapping: true
13+
mappings:
14+
App:
15+
is_bundle: false
16+
dir: '%kernel.project_dir%/src/Entity'
17+
prefix: 'App\Entity'
18+
alias: App
19+
20+
when@test:
21+
doctrine:
22+
dbal:
23+
# "TEST_TOKEN" is typically set by ParaTest
24+
dbname_suffix: '_test%env(default::TEST_TOKEN)%'
25+
26+
when@prod:
27+
doctrine:
28+
orm:
29+
auto_generate_proxy_classes: false
30+
proxy_dir: '%kernel.build_dir%/doctrine/orm/Proxies'
31+
query_cache_driver:
32+
type: pool
33+
pool: doctrine.system_cache_pool
34+
result_cache_driver:
35+
type: pool
36+
pool: doctrine.result_cache_pool
37+
38+
framework:
39+
cache:
40+
pools:
41+
doctrine.result_cache_pool:
42+
adapter: cache.app
43+
doctrine.system_cache_pool:
44+
adapter: cache.system
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"bundles": {
3+
"Doctrine\\Bundle\\DoctrineBundle\\DoctrineBundle": ["all"]
4+
},
5+
"copy-from-recipe": {
6+
"config/": "%CONFIG_DIR%/",
7+
"src/": "%SRC_DIR%/"
8+
},
9+
"env": {
10+
"#1": "Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url",
11+
"#2": "IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml",
12+
"#3": "",
13+
"#4": "DATABASE_URL=\"sqlite:///%kernel.project_dir%/var/data.db\"",
14+
"#5": "DATABASE_URL=\"mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8&charset=utf8mb4\"",
15+
"DATABASE_URL": "postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=14&charset=utf8"
16+
},
17+
"dockerfile": [
18+
"RUN apk add --no-cache --virtual .pgsql-deps postgresql-dev; \\",
19+
"\tdocker-php-ext-install -j$(nproc) pdo_pgsql; \\",
20+
"\tapk add --no-cache --virtual .pgsql-rundeps so:libpq.so.5; \\",
21+
"\tapk del .pgsql-deps"
22+
],
23+
"docker-compose": {
24+
"docker-compose.yml": {
25+
"services": [
26+
"database:",
27+
" image: postgres:${POSTGRES_VERSION:-14}-alpine",
28+
" environment:",
29+
" POSTGRES_DB: ${POSTGRES_DB:-app}",
30+
" # You should definitely change the password in production",
31+
" POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}",
32+
" POSTGRES_USER: ${POSTGRES_USER:-app}",
33+
" volumes:",
34+
" - db-data:/var/lib/postgresql/data:rw",
35+
" # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!",
36+
" # - ./docker/db/data:/var/lib/postgresql/data:rw"
37+
],
38+
"volumes": ["db-data:"]
39+
},
40+
"docker-compose.override.yml": {
41+
"services": [
42+
"database:",
43+
" ports:",
44+
" - \"5432\""
45+
]
46+
}
47+
},
48+
"conflict": {
49+
"doctrine/orm": "<2.14",
50+
"symfony/dependency-injection": "<6.2",
51+
"symfony/framework-bundle": "<5.3"
52+
}
53+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* Modify your DATABASE_URL config in <fg=green>.env</>
2+
3+
* Configure the <fg=green>driver</> (postgresql) and
4+
<fg=green>server_version</> (14) in <fg=green>config/packages/doctrine.yaml</>

doctrine/doctrine-bundle/2.8/src/Entity/.gitignore

Whitespace-only changes.

doctrine/doctrine-bundle/2.8/src/Repository/.gitignore

Whitespace-only changes.

0 commit comments

Comments
 (0)