Skip to content

Commit

Permalink
Merge pull request #227 from dotkernel/issue-225
Browse files Browse the repository at this point in the history
Issue 225
  • Loading branch information
arhimede committed Mar 1, 2024
2 parents 988a78d + f5c8a37 commit f67576c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 9 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"ext-gd": "*",
"ext-json": "*",
"dotkernel/dot-annotated-services": "^4.1.7",
"dotkernel/dot-cache": "^4.0",
"dotkernel/dot-cli": "^3.5.0",
"dotkernel/dot-data-fixtures": "^1.1.3",
"dotkernel/dot-doctrine-metadata": "^3.2.2",
Expand Down
37 changes: 33 additions & 4 deletions config/autoload/doctrine.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@

declare(strict_types=1);

use Api\App\Entity\EntityListenerResolver;
use Doctrine\ORM\Mapping\Driver\AttributeDriver;
use Doctrine\Persistence\Mapping\Driver\MappingDriverChain;
use Dot\Cache\Adapter\ArrayAdapter;
use Dot\Cache\Adapter\FilesystemAdapter;
use Ramsey\Uuid\Doctrine\UuidBinaryOrderedTimeType;
use Ramsey\Uuid\Doctrine\UuidBinaryType;
use Ramsey\Uuid\Doctrine\UuidType;

return [
'doctrine' => [
'connection' => [
'connection' => [
'orm_default' => [
'doctrine_mapping_types' => [
UuidBinaryType::NAME => 'binary',
UuidBinaryOrderedTimeType::NAME => 'binary',
],
],
],
'driver' => [
'driver' => [
'orm_default' => [
'class' => MappingDriverChain::class,
'drivers' => [
Expand All @@ -43,12 +46,38 @@
'paths' => __DIR__ . '/../../src/App/src/Entity',
],
],
'types' => [
'types' => [
UuidType::NAME => UuidType::class,
UuidBinaryType::NAME => UuidBinaryType::class,
UuidBinaryOrderedTimeType::NAME => UuidBinaryOrderedTimeType::class,
],
'fixtures' => getcwd() . '/data/doctrine/fixtures',
'fixtures' => getcwd() . '/data/doctrine/fixtures',
'configuration' => [
'orm_default' => [
'entity_listener_resolver' => EntityListenerResolver::class,
'result_cache' => 'filesystem',
'metadata_cache' => 'filesystem',
'query_cache' => 'filesystem',
'hydration_cache' => 'array',
'second_level_cache' => [
'enabled' => true,
'default_lifetime' => 3600,
'default_lock_lifetime' => 60,
'file_lock_region_directory' => '',
'regions' => [],
],
],
],
'cache' => [
'array' => [
'class' => ArrayAdapter::class,
],
'filesystem' => [
'class' => FilesystemAdapter::class,
'directory' => getcwd() . '/data/cache',
'namespace' => 'doctrine',
],
],
],
'resultCacheLifetime' => 3600,
];
5 changes: 0 additions & 5 deletions config/autoload/local.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ return [
'params' => $databases['default'],
],
],
'configuration' => [
'orm_default' => [
'entity_listener_resolver' => EntityListenerResolver::class,
],
],
],
'uploads' => [
'user' => [
Expand Down
1 change: 1 addition & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class_exists(Mezzio\Tooling\ConfigProvider::class)
Dot\ResponseHeader\ConfigProvider::class,
Dot\Mail\ConfigProvider::class,
Dot\DataFixtures\ConfigProvider::class,
Dot\Cache\ConfigProvider::class,

// Default App module config
Api\Admin\ConfigProvider::class,
Expand Down

0 comments on commit f67576c

Please sign in to comment.