Skip to content

Commit 3ef0921

Browse files
committed
docs update
Signed-off-by: Howriq <horea@rospace.com>
1 parent a15b718 commit 3ef0921

File tree

4 files changed

+83
-2
lines changed

4 files changed

+83
-2
lines changed

docs/book/v1/chapter-1.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,87 @@ Our new `src/App/src/ConfigProvider.php` class would look like this now:
8787
![Config provider factories update](images/config-provider-1.png)
8888
![Doctrine config function](images/config-provider-2.png)
8989

90+
```php
91+
public function __invoke(): array
92+
{
93+
return [
94+
'dependencies' => $this->getDependencies(),
95+
'doctrine' => $this->getDoctrineConfig(),
96+
'templates' => $this->getTemplates(),
97+
];
98+
}
99+
100+
public function getDependencies(): array
101+
{
102+
return [
103+
'delegators' => [
104+
Application::class => [
105+
RoutesDelegator::class,
106+
],
107+
],
108+
'factories' => [
109+
'doctrine.entity_manager.orm_default' => EntityManagerFactory::class,
110+
GetIndexViewHandler::class => GetIndexViewHandlerFactory::class,
111+
],
112+
'aliases' => [
113+
EntityManager::class => 'doctrine.entity_manager.orm_default',
114+
EntityManagerInterface::class => 'doctrine.entity_manager.orm_default',
115+
],
116+
];
117+
}
118+
119+
private function getDoctrineConfig(): array
120+
{
121+
return [
122+
'cache' => [
123+
'array' => [
124+
'class' => ArrayAdapter::class,
125+
],
126+
'filesystem' => [
127+
'class' => FilesystemAdapter::class,
128+
'directory' => getcwd() . '/data/cache',
129+
'namespace' => 'doctrine',
130+
],
131+
],
132+
'configuration' => [
133+
'orm_default' => [
134+
'entity_listener_resolver' => EntityListenerResolverInterface::class,
135+
'result_cache' => 'filesystem',
136+
'metadata_cache' => 'filesystem',
137+
'query_cache' => 'filesystem',
138+
'hydration_cache' => 'array',
139+
'typed_field_mapper' => null,
140+
'second_level_cache' => [
141+
'enabled' => true,
142+
'default_lifetime' => 3600,
143+
'default_lock_lifetime' => 60,
144+
'file_lock_region_directory' => '',
145+
'regions' => [],
146+
],
147+
],
148+
],
149+
'driver' => [
150+
// The default metadata driver aggregates all other drivers into a single one.
151+
// Override `orm_default` only if you know what you're doing.
152+
'orm_default' => [
153+
'class' => MappingDriverChain::class,
154+
],
155+
],
156+
'migrations' => [
157+
// Modify this line based on where you would like to have you migrations
158+
'migrations_paths' => [
159+
'Migrations' => 'src/Migrations',
160+
],
161+
'all_or_nothing' => true,
162+
'check_database_platform' => true,
163+
],
164+
'types' => [
165+
UuidType::NAME => UuidType::class,
166+
],
167+
];
168+
}
169+
```
170+
90171
We also require a new file `config/cli-config.php`.
91172
It initializes and returns a `DependencyFactory` that Doctrine Migrations uses to run migrations.
92173

-592 Bytes
Loading
2.38 KB
Loading

mkdocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
docs_dir: docs/book/v1
1+
docs_dir: docs/book
22
site_dir: docs/html
33
extra:
44
project: Tutorial-101
@@ -8,7 +8,7 @@ extra:
88
nav:
99
- Home: index.md
1010
- book:
11-
- Chapter 1: book/v1/chapter-1.md
11+
- Chapter 1: v1/chapter-1.md
1212
site_name: Dotkernel 101
1313
site_description: "Beginner tutorial for using Dotkernel"
1414
repo_url: "https://github.com/dotkernel/tutorial-101"

0 commit comments

Comments
 (0)