From ca4b6170b29ae94d54696ed8deafcb098d91df1e Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Fri, 17 May 2024 13:34:34 +0400 Subject: [PATCH] Spiral: Add cycle orm config --- frameworks/PHP/spiral/app/config/cycle.php | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 frameworks/PHP/spiral/app/config/cycle.php diff --git a/frameworks/PHP/spiral/app/config/cycle.php b/frameworks/PHP/spiral/app/config/cycle.php new file mode 100644 index 00000000000..a852b2f1082 --- /dev/null +++ b/frameworks/PHP/spiral/app/config/cycle.php @@ -0,0 +1,51 @@ + [ + /** + * true (Default) - Schema will be stored in a cache after compilation. + * It won't be changed after entity modification. Use `php app.php cycle` to update schema. + * + * false - Schema won't be stored in a cache after compilation. + * It will be automatically changed after entity modification. (Development mode) + */ + 'cache' => true, + + /** + * The CycleORM provides the ability to manage default settings for + * every schema with not defined segments + */ + 'defaults' => [ + SchemaInterface::MAPPER => \Cycle\ORM\Mapper\Mapper::class, + SchemaInterface::REPOSITORY => \Cycle\ORM\Select\Repository::class, + SchemaInterface::SCOPE => null, + SchemaInterface::TYPECAST_HANDLER => [ + \Cycle\ORM\Parser\Typecast::class + ], + ], + + 'collections' => [ + 'default' => 'array', + 'factories' => [ + 'array' => new \Cycle\ORM\Collection\ArrayCollectionFactory(), + // 'doctrine' => new \Cycle\ORM\Collection\DoctrineCollectionFactory(), + // 'illuminate' => new \Cycle\ORM\Collection\IlluminateCollectionFactory(), + ], + ], + + /** + * Schema generators (Optional) + * null (default) - Will be used schema generators defined in bootloaders + */ + 'generators' => null, + ], + + /** + * Prepare all internal ORM services (mappers, repositories, typecasters...) + */ + 'warmup' => true, +];