Skip to content

Commit

Permalink
added dotkernel/dot-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
bidi47 committed Feb 29, 2024
1 parent 988a78d commit ea6aa6a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 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
29 changes: 29 additions & 0 deletions config/autoload/doctrine.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

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;
Expand Down Expand Up @@ -49,6 +52,32 @@
UuidBinaryOrderedTimeType::NAME => UuidBinaryOrderedTimeType::class,
],
'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 ea6aa6a

Please sign in to comment.