Skip to content

Commit 3eb49e1

Browse files
committed
Automated deployment: Mon Nov 24 12:58:44 UTC 2025 0.1.1
1 parent bc65f5b commit 3eb49e1

14 files changed

Lines changed: 490 additions & 68 deletions

index.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,16 @@ <h5 class="subnavigation__title">Table of Contents</h5>
191191

192192

193193
<li class="subnavigation__list-item">
194-
<span class="subnavigation__headline">book</span>
194+
<span class="subnavigation__headline">Tutorial</span>
195195
<ul class="subnavigation__list">
196196

197197

198+
<li class="subnavigation__list-item ">
199+
<a href="v1/introduction/" class="subnavigation__link">Introduction</a>
200+
</li>
201+
202+
203+
198204
<li class="subnavigation__list-item ">
199205
<a href="v1/chapter-1/" class="subnavigation__link">Chapter 1</a>
200206
</li>
@@ -251,8 +257,8 @@ <h2>Support</h2>
251257

252258
<li class="col text-nowrap text-md-end pe-0">
253259

254-
<a rel="next" class="page-nav__link page-nav__link--next" href="v1/chapter-1/">
255-
Chapter 1
260+
<a rel="next" class="page-nav__link page-nav__link--next" href="v1/introduction/">
261+
Introduction
256262
<i class="bi bi-chevron-right"></i>
257263
</a>
258264

@@ -412,5 +418,5 @@ <h5 class="modal-title">Search</h5>
412418

413419
<!--
414420
MkDocs version : 1.6.1
415-
Build Date UTC : 2025-11-21 11:15:11.696025+00:00
421+
Build Date UTC : 2025-11-24 12:58:44.305784+00:00
416422
-->

pages/404.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,16 @@ <h5 class="subnavigation__title">Table of Contents</h5>
193193

194194

195195
<li class="subnavigation__list-item">
196-
<span class="subnavigation__headline">book</span>
196+
<span class="subnavigation__headline">Tutorial</span>
197197
<ul class="subnavigation__list">
198198

199199

200+
<li class="subnavigation__list-item ">
201+
<a href="../v1/introduction/" class="subnavigation__link">Introduction</a>
202+
</li>
203+
204+
205+
200206
<li class="subnavigation__list-item ">
201207
<a href="../v1/chapter-1/" class="subnavigation__link">Chapter 1</a>
202208
</li>

search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

sitemap.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
33
<url>
44
<loc>https://docs.dotkernel.org/tutorial-101/</loc>
5-
<lastmod>2025-11-21</lastmod>
5+
<lastmod>2025-11-24</lastmod>
66
</url>
77
<url>
88
<loc>https://docs.dotkernel.org/tutorial-101/v1/chapter-1/</loc>
9-
<lastmod>2025-11-21</lastmod>
9+
<lastmod>2025-11-24</lastmod>
10+
</url>
11+
<url>
12+
<loc>https://docs.dotkernel.org/tutorial-101/v1/introduction/</loc>
13+
<lastmod>2025-11-24</lastmod>
1014
</url>
1115
</urlset>

sitemap.xml.gz

15 Bytes
Binary file not shown.

v1/chapter-1/index.html

Lines changed: 26 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167

168168

169169

170-
<li class="breadcrumb-item">book</li>
170+
<li class="breadcrumb-item">Tutorial</li>
171171

172172

173173

@@ -202,10 +202,16 @@ <h5 class="subnavigation__title">Table of Contents</h5>
202202

203203

204204
<li class="subnavigation__list-item">
205-
<span class="subnavigation__headline">book</span>
205+
<span class="subnavigation__headline">Tutorial</span>
206206
<ul class="subnavigation__list">
207207

208208

209+
<li class="subnavigation__list-item ">
210+
<a href="../introduction/" class="subnavigation__link">Introduction</a>
211+
</li>
212+
213+
214+
209215
<li class="subnavigation__list-item subnavigation__list-item--active">
210216
<a href="./" class="subnavigation__link">Chapter 1</a>
211217
</li>
@@ -260,21 +266,21 @@ <h6 class="toc__headline">On this page</h6>
260266

261267

262268

263-
<!-- <h2 class="chapter__headline text-black-50">book</h2>-->
269+
<!-- <h2 class="chapter__headline text-black-50">Tutorial</h2>-->
264270

265271

266272
<h1 id="installing-doctrine">Installing Doctrine</h1>
267273
<h2 id="composer-requirements">Composer Requirements</h2>
268274
<p>The first step is to add alongside your current packages the required entries for our Doctrine installation.
269275
We would add the following to our <code>composer.json</code> file located in our root folder:</p>
270-
<p><img alt="composer" src="../images/composer.png" class="img-responsive"/></p>
276+
<p><img alt="composer.json" src="../images/composer.png" class="img-responsive"/></p>
271277
<pre class="highlight"><code class="language-text">"dotkernel/dot-cache": "^4.0",
272278
"ramsey/uuid": "^4.5.0",
273279
"ramsey/uuid-doctrine": "^2.1.0",
274280
"roave/psr-container-doctrine": "^5.2.2 || ^6.0.0",</code></pre>
275281
<p><code>dotkernel/dot-cache</code></p>
276-
<p>Provides caching support for DotKernel applications.
277-
It offers a PSR-6 and PSR-16 compatible caching system that integrates smoothly with DotKernel's service container.</p>
282+
<p>Provides caching support for Dotkernel applications.
283+
It offers a PSR-6 and PSR-16 compatible caching system that integrates smoothly with Dotkernel's service container.</p>
278284
<p><code>ramsey/uuid</code></p>
279285
<p>A widely used PHP library for generating and working with UUIDs (Universally Unique Identifiers).
280286
It supports multiple UUID versions.</p>
@@ -283,12 +289,12 @@ <h2 id="composer-requirements">Composer Requirements</h2>
283289
It allows Doctrine to store and retrieve UUIDs as proper value objects instead of plain strings, improving type safety.</p>
284290
<p><code>roave/psr-container-doctrine</code></p>
285291
<p>Provides a set of factory classes that integrate Doctrine ORM with any PSR-11 container.
286-
It simplifies wiring Doctrine EntityManager, DBAL, configuration, and related services in frameworks like DotKernel.</p>
292+
It simplifies wiring Doctrine EntityManager, DBAL, configuration, and related services in frameworks like Dotkernel.</p>
287293
<p><code>phpstan/phpstan-doctrine (dev requirement)</code></p>
288294
<p>An extension for PHPStan that improves static analysis for Doctrine.
289295
It understands entity metadata, repositories, and common Doctrine patterns, helping catch errors during development.</p>
290296
<h2 id="setting-up-doctrine">Setting Up Doctrine</h2>
291-
<p>After successfully installing our dependencies we now need to configure our Doctrine instance.</p>
297+
<p>After successfully installing our dependencies, we now need to configure our Doctrine instance.</p>
292298
<h3 id="declare-your-database">Declare your database</h3>
293299
<p>In the file <code>config/autoload/local.php</code> the structure would be updated like this:</p>
294300
<p><img alt="local.php" src="../images/local.png" class="img-responsive"/></p>
@@ -317,12 +323,12 @@ <h3 id="declare-your-database">Declare your database</h3>
317323
],
318324
// the rest of your configuration
319325
];</code></pre>
320-
<h3 id="declare-the-doctrine-drivers-and-migrations-location">Declare the Doctrine Drivers and Migrations Location</h3>
326+
<h3 id="declare-the-doctrine-drivers">Declare the Doctrine Drivers</h3>
321327
<p>With the very nice utility of the package <code>laminas/laminas-config-aggregator</code> we can declare our doctrine settings in the <code>src/App/src/ConfigProvider.php</code> file.
322328
This package takes all the provided configs from the <code>config/config.php</code> file and merges them into one.</p>
323329
<p>Our new <code>src/App/src/ConfigProvider.php</code> class would look like this now:</p>
324-
<p><img alt="Config provider factories update" src="../images/config-provider-1.png" />
325-
<img alt="Doctrine config function" src="../images/config-provider-2.png" /></p>
330+
<p><img alt="config-provider-1" src="../images/config-provider-1.png" class="img-responsive"/></p>
331+
<p><img alt="config-provider-2" src="../images/config-provider-2.png" class="img-responsive"/></p>
326332
<pre class="highlight"><code class="language-php">public function __invoke(): array
327333
{
328334
return [
@@ -366,12 +372,12 @@ <h3 id="declare-the-doctrine-drivers-and-migrations-location">Declare the Doctri
366372
],
367373
'configuration' =&gt; [
368374
'orm_default' =&gt; [
369-
'result_cache' =&gt; 'filesystem',
370-
'metadata_cache' =&gt; 'filesystem',
371-
'query_cache' =&gt; 'filesystem',
372-
'hydration_cache' =&gt; 'array',
373-
'typed_field_mapper' =&gt; null,
374-
'second_level_cache' =&gt; [
375+
'result_cache' =&gt; 'filesystem',
376+
'metadata_cache' =&gt; 'filesystem',
377+
'query_cache' =&gt; 'filesystem',
378+
'hydration_cache' =&gt; 'array',
379+
'typed_field_mapper' =&gt; null,
380+
'second_level_cache' =&gt; [
375381
'enabled' =&gt; true,
376382
'default_lifetime' =&gt; 3600,
377383
'default_lock_lifetime' =&gt; 60,
@@ -387,44 +393,15 @@ <h3 id="declare-the-doctrine-drivers-and-migrations-location">Declare the Doctri
387393
'class' =&gt; MappingDriverChain::class,
388394
],
389395
],
390-
'migrations' =&gt; [
391-
// Modify this line based on where you would like to have you migrations
392-
'migrations_paths' =&gt; [
393-
'Migrations' =&gt; 'src/Migrations',
394-
],
395-
'all_or_nothing' =&gt; true,
396-
'check_database_platform' =&gt; true,
397-
],
398396
'types' =&gt; [
399397
UuidType::NAME =&gt; UuidType::class,
400398
],
401399
];
402400
}</code></pre>
403-
<p>We also require a new file <code>config/cli-config.php</code>.
404-
It initializes and returns a <code>DependencyFactory</code> that Doctrine Migrations uses to run migrations.</p>
405-
<p><img alt="cli-config" src="../images/cli-config.png" class="img-responsive"/></p>
406-
<pre class="highlight"><code class="language-php">&lt;?php
407-
408-
declare(strict_types=1);
409-
410-
use Doctrine\Migrations\Configuration\EntityManager\ExistingEntityManager;
411-
use Doctrine\Migrations\Configuration\Migration\ConfigurationArray;
412-
use Doctrine\Migrations\DependencyFactory;
413-
use Doctrine\ORM\EntityManager;
414-
415-
$container = require 'config/container.php';
416-
417-
$entityManager = $container-&gt;get(EntityManager::class);
418-
$entityManager-&gt;getEventManager();
419-
420-
return DependencyFactory::fromEntityManager(
421-
new ConfigurationArray($container-&gt;get('config')['doctrine']['migrations']),
422-
new ExistingEntityManager($entityManager)
423-
);</code></pre>
424401
<h2 id="running-doctrine">Running doctrine</h2>
425402
<p>Now that everything has been configured we only need to do one last thing, to create an executable for the Doctrine CLI.
426403
In our case we will create a <code>doctrine</code> file inside the application's <code>bin</code> directory:</p>
427-
<p><img alt="bin/doctrine" src="../images/doctrine.png" class="img-responsive"/></p>
404+
<p><img alt="doctrine" src="../images/doctrine.png" class="img-responsive"/></p>
428405
<pre class="highlight"><code class="language-php">#!/usr/bin/env php
429406
&lt;?php
430407

@@ -442,17 +419,6 @@ <h2 id="running-doctrine">Running doctrine</h2>
442419
$entityManager-&gt;getEventManager();
443420

444421
ConsoleRunner::run(new SingleManagerProvider($entityManager));</code></pre>
445-
<p>(Optional) To keep things tidy, we recommend making an executable for the migrations of Doctrine as well.
446-
For this, we create <code>doctrine-migrations</code> file inside the application's <code>bin</code> directory:</p>
447-
<p><img alt="bin/doctrine-migrations" src="../images/doctrine-migrations.png" class="img-responsive"/></p>
448-
<pre class="highlight"><code class="language-php">#!/usr/bin/env php
449-
&lt;?php
450-
451-
declare(strict_types=1);
452-
453-
namespace Doctrine\Migrations;
454-
455-
require __DIR__ . '/../vendor/doctrine/migrations/bin/doctrine-migrations.php';</code></pre>
456422
<p>Now by running the command bellow we should see the Doctrine CLI version alongside its available commands:</p>
457423
<pre class="highlight"><code class="language-shell">php ./bin/doctrine</code></pre>
458424
<p>Example (truncated) output:</p>
@@ -475,9 +441,9 @@ <h2 id="running-doctrine">Running doctrine</h2>
475441

476442
<li class="col text-nowrap text-md-start">
477443

478-
<a rel="prev" class="page-nav__link page-nav__link--prev" href="../..">
444+
<a rel="prev" class="page-nav__link page-nav__link--prev" href="../introduction/">
479445
<i class="bi bi-chevron-left"></i>
480-
Home
446+
Introduction
481447
</a>
482448

483449
</li>

v1/images/cli-config.png

-5.64 KB
Loading

v1/images/composer.png

-2.56 KB
Loading

v1/images/config-provider-1.png

-6.41 KB
Loading

v1/images/config-provider-2.png

-15.1 KB
Loading

0 commit comments

Comments
 (0)