install orm doctrine

This commit is contained in:
jannisp 2021-04-22 14:46:36 +02:00
parent ced8dbf963
commit 874f40d535
13 changed files with 2122 additions and 96 deletions

9
.env
View file

@ -17,3 +17,12 @@
APP_ENV=dev APP_ENV=dev
APP_SECRET=8a390490e448f181dd8d3e6bd38efe6a APP_SECRET=8a390490e448f181dd8d3e6bd38efe6a
###< symfony/framework-bundle ### ###< symfony/framework-bundle ###
###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7"
DATABASE_URL="postgresql://postgres:postgres@127.0.0.1:5432/plantex?serverVersion=13&charset=utf8"
###< doctrine/doctrine-bundle ###

View file

@ -7,10 +7,15 @@
"php": ">=7.2.5", "php": ">=7.2.5",
"ext-ctype": "*", "ext-ctype": "*",
"ext-iconv": "*", "ext-iconv": "*",
"composer/package-versions-deprecated": "1.11.99.1",
"doctrine/doctrine-bundle": "^2.3",
"doctrine/doctrine-migrations-bundle": "^3.1",
"doctrine/orm": "^2.8",
"symfony/console": "5.2.*", "symfony/console": "5.2.*",
"symfony/dotenv": "5.2.*", "symfony/dotenv": "5.2.*",
"symfony/flex": "^1.3.1", "symfony/flex": "^1.3.1",
"symfony/framework-bundle": "5.2.*", "symfony/framework-bundle": "5.2.*",
"symfony/proxy-manager-bridge": "5.2.*",
"symfony/security-bundle": "5.2.*", "symfony/security-bundle": "5.2.*",
"symfony/twig-bundle": "5.2.*", "symfony/twig-bundle": "5.2.*",
"symfony/yaml": "5.2.*", "symfony/yaml": "5.2.*",

2039
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -6,4 +6,6 @@ return [
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true], Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
]; ];

View file

@ -0,0 +1,19 @@
doctrine:
dbal:
override_url: true
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: '13'
orm:
auto_generate_proxy_classes: true
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
auto_mapping: true
mappings:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App

View file

@ -0,0 +1,6 @@
doctrine_migrations:
migrations_paths:
# namespace is arbitrary but should be different from App\Migrations
# as migrations classes should NOT be autoloaded
'DoctrineMigrations': '%kernel.project_dir%/migrations'
enable_profiler: '%kernel.debug%'

View file

@ -0,0 +1,20 @@
doctrine:
orm:
auto_generate_proxy_classes: false
metadata_cache_driver:
type: pool
pool: doctrine.system_cache_pool
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

View file

@ -0,0 +1,7 @@
#doctrine:
# dbal:
# # Overrides the database name in the test environment only
# # "host", "port", "user", & "password" can also be set to override their respective url parts
# #
# # If you're using ParaTest, "TEST_TOKEN" is set by ParaTest otherwise nothing is appended to the database name.
# dbname: main_test%env(default::TEST_TOKEN)%

View file

@ -0,0 +1,7 @@
controllers:
resource: ../../src/Controller/
type: annotation
kernel:
resource: ../../src/Kernel.php
type: annotation

0
migrations/.gitignore vendored Normal file
View file

0
src/Entity/.gitignore vendored Normal file
View file

0
src/Repository/.gitignore vendored Normal file
View file

View file

@ -1,7 +1,99 @@
{ {
"composer/package-versions-deprecated": {
"version": "1.11.99.1"
},
"doctrine/annotations": {
"version": "1.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.0",
"ref": "a2759dd6123694c8d901d0ec80006e044c2e6457"
},
"files": [
"config/routes/annotations.yaml"
]
},
"doctrine/cache": {
"version": "1.11.0"
},
"doctrine/collections": {
"version": "1.6.7"
},
"doctrine/common": {
"version": "3.1.2"
},
"doctrine/dbal": {
"version": "2.13.1"
},
"doctrine/deprecations": {
"version": "v0.5.3"
},
"doctrine/doctrine-bundle": {
"version": "2.3",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "2.3",
"ref": "6e0f582596a8f1c865aaa0d3cceb9bf0daf609b4"
},
"files": [
"config/packages/doctrine.yaml",
"config/packages/prod/doctrine.yaml",
"config/packages/test/doctrine.yaml",
"src/Entity/.gitignore",
"src/Repository/.gitignore"
]
},
"doctrine/doctrine-migrations-bundle": {
"version": "3.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.1",
"ref": "ee609429c9ee23e22d6fa5728211768f51ed2818"
},
"files": [
"config/packages/doctrine_migrations.yaml",
"migrations/.gitignore"
]
},
"doctrine/event-manager": {
"version": "1.1.1"
},
"doctrine/inflector": { "doctrine/inflector": {
"version": "2.0.3" "version": "2.0.3"
}, },
"doctrine/instantiator": {
"version": "1.4.0"
},
"doctrine/lexer": {
"version": "1.2.1"
},
"doctrine/migrations": {
"version": "3.1.1"
},
"doctrine/orm": {
"version": "2.8.4"
},
"doctrine/persistence": {
"version": "2.1.0"
},
"doctrine/sql-formatter": {
"version": "1.1.1"
},
"friendsofphp/proxy-manager-lts": {
"version": "v1.0.3"
},
"laminas/laminas-code": {
"version": "4.2.0"
},
"laminas/laminas-eventmanager": {
"version": "3.3.1"
},
"laminas/laminas-zendframework-bridge": {
"version": "1.2.0"
},
"nikic/php-parser": { "nikic/php-parser": {
"version": "v4.10.4" "version": "v4.10.4"
}, },
@ -44,6 +136,9 @@
"symfony/deprecation-contracts": { "symfony/deprecation-contracts": {
"version": "v2.4.0" "version": "v2.4.0"
}, },
"symfony/doctrine-bridge": {
"version": "v5.2.6"
},
"symfony/dotenv": { "symfony/dotenv": {
"version": "v5.2.4" "version": "v5.2.4"
}, },
@ -112,6 +207,9 @@
"ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f" "ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f"
} }
}, },
"symfony/orm-pack": {
"version": "v2.1.0"
},
"symfony/polyfill-intl-grapheme": { "symfony/polyfill-intl-grapheme": {
"version": "v1.22.1" "version": "v1.22.1"
}, },
@ -133,6 +231,9 @@
"symfony/property-info": { "symfony/property-info": {
"version": "v5.2.4" "version": "v5.2.4"
}, },
"symfony/proxy-manager-bridge": {
"version": "v5.2.4"
},
"symfony/routing": { "symfony/routing": {
"version": "5.1", "version": "5.1",
"recipe": { "recipe": {
@ -174,6 +275,9 @@
"symfony/service-contracts": { "symfony/service-contracts": {
"version": "v2.4.0" "version": "v2.4.0"
}, },
"symfony/stopwatch": {
"version": "v5.2.4"
},
"symfony/string": { "symfony/string": {
"version": "v5.2.6" "version": "v5.2.6"
}, },