-
Anonymous
Кэшированные ключи как «Массив» или «Объект» — кэш Laminas с Doctrine (PHP8.3)
Сообщение
Anonymous »
Вопрос также был опубликован здесь:
https://discourse.laminas.dev/t/laminas ... e-orm-6-1- laminas-cache-3-12-php-8-3/3780
Чистая установка на PHP8.3. Использование следующих пакетов:
Код: Выделить всё
"doctrine/doctrine-orm-module": "^6.1",
"doctrine/doctrine-module": "^6.1",
"laminas/laminas-cache":"^3.12",
"laminas/laminas-cache-storage-adapter-redis":"^2.9"
Конфигурация:
Код: Выделить всё
...
'service_manager' => [
'factories' => [
'Service\Redis' => Service\Factory\RedisFactory::class,
],
],
'doctrine' => [
'connection' => [
'orm_default' => [
'driverClass' => \Doctrine\DBAL\Driver\PDO\MySQL\Driver::class,
'params' => [
'host' => 'localhost',
'port' => '3306',
'user' => 'db_user',
'password' => 'my_password',
'dbname' => 'db_skeleton',
'charset' => 'utf8mb4',
],
],
],
'driver' => [
'annotation_driver' => [
'class' => AttributeDriver::class,
'cache' => 'array',
'paths' => [
__DIR__ . '/../src/Entity',
],
],
'orm_default' => [
'drivers' => [
'Application\Entity' => 'annotation_driver',
],
],
],
'cache' => [
'redis' => [
'namespace' => 'skeleton',
'instance' => 'Service\Redis',
],
],
'configuration' => [
'orm_default' => [
'result_cache' => 'redis',
'query_cache' => 'redis',
'metadata_cache' => 'redis',
'hydration_cache' => 'redis',
'generate_proxies' => false,
]
]
],
...
"Сервис/Redis" -> RedisFactory.php
Код: Выделить всё
Подробнее здесь: [url]https://stackoverflow.com/questions/79049936/cached-keys-as-array-or-object-laminas-cache-with-doctrine-php8-3[/url]
1733132361
Anonymous
Вопрос также был опубликован здесь:
https://discourse.laminas.dev/t/laminas-cache-with-doctrine-doctrine-orm-6-1- laminas-cache-3-12-php-8-3/3780
Чистая установка на PHP8.3. Использование следующих пакетов:
[code]"doctrine/doctrine-orm-module": "^6.1",
"doctrine/doctrine-module": "^6.1",
"laminas/laminas-cache":"^3.12",
"laminas/laminas-cache-storage-adapter-redis":"^2.9"
[/code]
Конфигурация:
[code] ...
'service_manager' => [
'factories' => [
'Service\Redis' => Service\Factory\RedisFactory::class,
],
],
'doctrine' => [
'connection' => [
'orm_default' => [
'driverClass' => \Doctrine\DBAL\Driver\PDO\MySQL\Driver::class,
'params' => [
'host' => 'localhost',
'port' => '3306',
'user' => 'db_user',
'password' => 'my_password',
'dbname' => 'db_skeleton',
'charset' => 'utf8mb4',
],
],
],
'driver' => [
'annotation_driver' => [
'class' => AttributeDriver::class,
'cache' => 'array',
'paths' => [
__DIR__ . '/../src/Entity',
],
],
'orm_default' => [
'drivers' => [
'Application\Entity' => 'annotation_driver',
],
],
],
'cache' => [
'redis' => [
'namespace' => 'skeleton',
'instance' => 'Service\Redis',
],
],
'configuration' => [
'orm_default' => [
'result_cache' => 'redis',
'query_cache' => 'redis',
'metadata_cache' => 'redis',
'hydration_cache' => 'redis',
'generate_proxies' => false,
]
]
],
...
[/code]
"Сервис/Redis" -> RedisFactory.php
[code]
Подробнее здесь: [url]https://stackoverflow.com/questions/79049936/cached-keys-as-array-or-object-laminas-cache-with-doctrine-php8-3[/url]