File tree Expand file tree Collapse file tree 6 files changed +38
-24
lines changed
Expand file tree Collapse file tree 6 files changed +38
-24
lines changed Original file line number Diff line number Diff line change 5353 "mezzio/mezzio-cors" : " ^1.11.1" ,
5454 "mezzio/mezzio-fastroute" : " ^3.11.0" ,
5555 "ramsey/uuid-doctrine" : " ^2.1.0" ,
56- "roave/psr-container-doctrine" : " ^5.1.0" ,
57- "doctrine/orm" : " ^3.2"
56+ "roave/psr-container-doctrine" : " ^5.2.2"
5857 },
5958 "require-dev" : {
6059 "filp/whoops" : " ^2.15.4" ,
Original file line number Diff line number Diff line change 22
33declare (strict_types=1 );
44
5- use Doctrine \ORM \Mapping \Driver \AttributeDriver ;
65use Doctrine \Persistence \Mapping \Driver \MappingDriverChain ;
76use Dot \Cache \Adapter \ArrayAdapter ;
87use Dot \Cache \Adapter \FilesystemAdapter ;
2019 'metadata_cache ' => 'filesystem ' ,
2120 'query_cache ' => 'filesystem ' ,
2221 'hydration_cache ' => 'array ' ,
22+ 'typed_field_mapper ' => null ,
2323 'second_level_cache ' => [
2424 'enabled ' => true ,
2525 'default_lifetime ' => 3600 ,
4242 // Override `orm_default` only if you know what you're doing
4343 'orm_default ' => [
4444 'class ' => MappingDriverChain::class,
45- 'drivers ' => [
46- 'Frontend \\App \\Entity ' => 'AppEntities ' ,
47- ],
48- ],
49- 'AppEntities ' => [
50- 'class ' => AttributeDriver::class,
51- 'cache ' => 'array ' ,
52- 'paths ' => __DIR__ . '/../../src/App/src/Entity ' ,
45+ 'drivers ' => [],
5346 ],
5447 ],
5548 'types ' => [
Original file line number Diff line number Diff line change 2222use Frontend \Admin \Service \AdminServiceInterface ;
2323use Laminas \Authentication \AuthenticationService ;
2424use Laminas \Form \ElementFactory ;
25+ use Mezzio \Application ;
2526
2627class ConfigProvider
2728{
@@ -38,6 +39,14 @@ public function __invoke(): array
3839 public function getDependencies (): array
3940 {
4041 return [
42+ 'delegators ' => [
43+ Application::class => [
44+ RoutesDelegator::class,
45+ ],
46+ AdminForm::class => [
47+ AdminRoleDelegator::class,
48+ ],
49+ ],
4150 'factories ' => [
4251 AdminController::class => AttributedServiceFactory::class,
4352 AdminService::class => AttributedServiceFactory::class,
@@ -51,11 +60,6 @@ public function getDependencies(): array
5160 AdminInterface::class => Admin::class,
5261 AdminServiceInterface::class => AdminService::class,
5362 ],
54- 'delegators ' => [
55- AdminForm::class => [
56- AdminRoleDelegator::class,
57- ],
58- ],
5963 ];
6064 }
6165
Original file line number Diff line number Diff line change 66
77use Doctrine \ORM \EntityManager ;
88use Doctrine \ORM \EntityManagerInterface ;
9+ use Doctrine \ORM \Mapping \Driver \AttributeDriver ;
910use Dot \Controller \Factory \PluginManagerFactory ;
1011use Dot \Controller \Plugin \PluginManager ;
1112use Dot \DependencyInjection \Factory \AttributedServiceFactory ;
@@ -34,8 +35,6 @@ public function getDependencies(): array
3435 'delegators ' => [
3536 Application::class => [
3637 RoutesDelegator::class,
37- \Frontend \Admin \RoutesDelegator::class,
38- \Frontend \Setting \RoutesDelegator::class,
3938 ],
4039 ],
4140 'factories ' => [
@@ -53,6 +52,24 @@ public function getDependencies(): array
5352 ];
5453 }
5554
55+ public function getDoctrineConfig (): array
56+ {
57+ return [
58+ 'driver ' => [
59+ 'orm_default ' => [
60+ 'drivers ' => [
61+ 'Frontend\App\Entity ' => 'AppEntities ' ,
62+ ],
63+ ],
64+ 'AppEntities ' => [
65+ 'class ' => AttributeDriver::class,
66+ 'cache ' => 'array ' ,
67+ 'paths ' => [__DIR__ . '/Entity ' ],
68+ ],
69+ ],
70+ ];
71+ }
72+
5673 public function getTemplates (): array
5774 {
5875 return [
Original file line number Diff line number Diff line change 1010use Frontend \Setting \Controller \SettingController ;
1111use Frontend \Setting \Repository \SettingRepository ;
1212use Frontend \Setting \Service \SettingService ;
13+ use Mezzio \Application ;
1314
1415class ConfigProvider
1516{
@@ -24,7 +25,12 @@ public function __invoke(): array
2425 public function getDependencies (): array
2526 {
2627 return [
27- 'factories ' => [
28+ 'delegators ' => [
29+ Application::class => [
30+ RoutesDelegator::class,
31+ ],
32+ ],
33+ 'factories ' => [
2834 SettingController::class => AttributedServiceFactory::class,
2935 SettingService::class => AttributedServiceFactory::class,
3036 SettingRepository::class => AttributedRepositoryFactory::class,
Original file line number Diff line number Diff line change 77use Doctrine \ORM \EntityManager ;
88use Doctrine \ORM \EntityManagerInterface ;
99use Dot \Controller \Plugin \PluginManager ;
10- use Frontend \Admin \RoutesDelegator as AdminDelegator ;
1110use Frontend \App \ConfigProvider ;
1211use Frontend \App \Controller \DashboardController ;
1312use Frontend \App \Plugin \FormsPlugin ;
@@ -43,10 +42,6 @@ public function testDependenciesHasDelegators(): void
4342 $ this ->assertIsArray ($ this ->config ['dependencies ' ]['delegators ' ]);
4443 $ this ->assertArrayHasKey (Application::class, $ this ->config ['dependencies ' ]['delegators ' ]);
4544 $ this ->assertIsArray ($ this ->config ['dependencies ' ]['delegators ' ][Application::class]);
46- $ this ->assertContainsEquals (
47- AdminDelegator::class,
48- $ this ->config ['dependencies ' ]['delegators ' ][Application::class]
49- );
5045 $ this ->assertContainsEquals (
5146 AppDelegator::class,
5247 $ this ->config ['dependencies ' ]['delegators ' ][Application::class]
You can’t perform that action at this time.
0 commit comments