Skip to content

Commit 47b00ce

Browse files
committed
Setup de doctrine/orm
1 parent c5c353d commit 47b00ce

File tree

26 files changed

+1472
-321
lines changed

26 files changed

+1472
-321
lines changed

.env.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ DATABASE_NAME=web
99
DATABASE_USER=afup
1010
DATABASE_PASSWORD=afup
1111

12+
DATABASE_URL="mysql://afup:afup@db:3306/web?serverVersion=5.7.44&charset=utf8mb4"
13+
1214
SECRET=ThisTokenIsNotSoSecretChangeIt
1315

1416
GITHUB_CLIENT_ID=id

app/config/bundles.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@
1818
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
1919
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
2020
CuyZ\ValinorBundle\ValinorBundle::class => ['all' => true],
21+
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
2122
];

app/config/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ imports:
33
- { resource: security.yml }
44
- { resource: services.yml }
55
- { resource: packages/http_client.yaml }
6+
- { resource: packages/doctrine.yaml }
67

78
# Put parameters here that don't need to change on each machine where the app is deployed
89
# http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration

app/config/packages/doctrine.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
doctrine:
2+
dbal:
3+
url: '%env(resolve:DATABASE_URL)%'
4+
5+
profiling_collect_backtrace: '%kernel.debug%'
6+
use_savepoints: true
7+
orm:
8+
auto_generate_proxy_classes: true
9+
enable_lazy_ghost_objects: true
10+
report_fields_where_declared: true
11+
validate_xml_mapping: true
12+
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
13+
auto_mapping: true
14+
controller_resolver:
15+
auto_mapping: false
16+
mappings:
17+
Accounting:
18+
type: attribute
19+
is_bundle: false
20+
dir: '%kernel.project_dir%/../sources/AppBundle/Accounting/Entity'
21+
prefix: 'AppBundle\Accounting\Entity'
22+
alias: Accounting
23+
24+
when@test:
25+
doctrine:
26+
dbal:
27+
url: 'mysql://root:root@dbtest:3306/web?serverVersion=5.7.44&charset=utf8mb4'
28+
29+
when@prod:
30+
doctrine:
31+
orm:
32+
auto_generate_proxy_classes: false
33+
proxy_dir: '%kernel.build_dir%/doctrine/orm/Proxies'
34+
query_cache_driver:
35+
type: pool
36+
pool: doctrine.system_cache_pool
37+
result_cache_driver:
38+
type: pool
39+
pool: doctrine.result_cache_pool
40+
41+
framework:
42+
cache:
43+
pools:
44+
doctrine.result_cache_pool:
45+
adapter: cache.app
46+
doctrine.system_cache_pool:
47+
adapter: cache.system

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
"cuyz/valinor-bundle": "^2.0",
2020
"cweagans/composer-patches": "^1.7",
2121
"doctrine/dbal": "4.*",
22+
"doctrine/doctrine-bundle": "^2.18",
23+
"doctrine/orm": "^3.5",
2224
"drewm/mailchimp-api": "^2.5",
2325
"ekino/newrelic-bundle": "dev-patch-1#2cd9951c163bda2d18a1515b43ee574e51aac871",
2426
"erusev/parsedown": "^1.6",

0 commit comments

Comments
 (0)