Skip to content

Commit 8d29cbb

Browse files
author
olaru
committed
replace dotkernel.org with dotkernel.com/api
1 parent a569da1 commit 8d29cbb

6 files changed

Lines changed: 5 additions & 31 deletions

File tree

‎bin/create-uploads-dir‎

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ $entityManager = $container->get(EntityManager::class);
3434
$postRepository = $entityManager->getRepository(Post::class);
3535

3636
/**
37-
* Index every file anywhere under public/ by basename, so we can locate the
38-
* source file for each image referenced from a template or markdown
39-
* article - including images already sitting in some other article's
40-
* uploads/article/{uuid}/ directory (e.g. left over from before a post's
41-
* UUID changed), not just loose files dropped outside uploads/article/.
42-
*
4337
* @return array<string, string>
4438
*/
4539
function indexUploadSources(string $publicDir): array
@@ -65,11 +59,6 @@ function indexUploadSources(string $publicDir): array
6559
}
6660

6761
/**
68-
* Extract every (uuid, filename) pair referenced via an
69-
* "uploads/article/{uuid}/{filename}" path in Markdown article content -
70-
* these are hardcoded literally in .md files, unlike the dynamic
71-
* `~ article.id ~` expression used in .html.twig templates.
72-
*
7362
* @return list<array{uuid: string, filename: string}>
7463
*/
7564
function extractArticleImageRefs(string $contents): array
@@ -99,7 +88,6 @@ function extractArticleImageRefs(string $contents): array
9988

10089
$sourceIndex = indexUploadSources($publicDir);
10190

102-
// Matches the filename in: asset('uploads/article/' ~ article.id ~ '/filename.ext')
10391
$pattern = '/~\s*article\.id\s*~\s*\'\/([^\']+)\'/';
10492

10593
$filesProcessed = 0;
@@ -171,16 +159,6 @@ foreach ($templateIterator as $file) {
171159
}
172160
}
173161

174-
/**
175-
* Markdown articles (public/md-articles/{category-slug}/{article-slug}.md)
176-
* embed uploads/article/{uuid}/{filename} paths as literal text, unlike
177-
* .html.twig templates whose `~ article.id ~` is resolved dynamically. Since
178-
* a Post's UUID (uuid7) is generated fresh the first time its slug is
179-
* fixture-inserted in a given environment, a UUID hardcoded in a .md file
180-
* drifts from the Post's real UUID as soon as that slug is (re)seeded
181-
* elsewhere. This pass detects that drift, rewrites the file to the real
182-
* UUID, and makes sure the image is available under the corrected path.
183-
*/
184162
$mdArticlesDir = 'public/md-articles';
185163

186164
$mdFilesProcessed = 0;
@@ -200,10 +178,6 @@ if (is_dir($mdArticlesDir)) {
200178
}
201179

202180
$path = $file->getPathname();
203-
204-
// Only handle files one level under a category directory, i.e.
205-
// public/md-articles/{category-slug}/{article-slug}.md - skips
206-
// stray top-level files such as md-articles/index.md.
207181
$relative = ltrim(substr($path, strlen($mdArticlesDir)), '/');
208182
if (substr_count($relative, '/') !== 1) {
209183
continue;

‎public/md-articles/best-practice/basic-security-in-dotkernel-headless-platform.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Let's take a practical view on software security in Dotkernel.
4848

4949
You should never trust that the user inputs correct data by passing it directly into your business logic. By defining the configuration for an input filter, you ensure that a field is both present, and of the correct type.
5050

51-
[Dotkernel API](https://www.dotkernel.org) makes use of [laminas/laminas-inputfilter](https://github.com/laminas/laminas-inputfilter) for this purpose.
51+
[Dotkernel API](https://www.dotkernel.com/api/) makes use of [laminas/laminas-inputfilter](https://github.com/laminas/laminas-inputfilter) for this purpose.
5252

5353
In addition to the above filtering, Dotkernel Admin also makes use of [laminas/laminas-form](https://github.com/laminas/laminas-form). laminas-form contains:
5454

‎public/md-articles/dotkernel-api/dotkernel-api-versus-laminas-api-tools.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ It's intended to highlight the differences between the two and also to showcase
2222
2323
| | **API Tools (formerly Apigility)** | **Dotkernel API** |
2424
| --- | --- | --- |
25-
| URL | [api-tools](https://api-tools.getlaminas.org/) | [Dotkernel API](https://www.dotkernel.org) |
25+
| URL | [api-tools](https://api-tools.getlaminas.org/) | [Dotkernel API](https://www.dotkernel.com/api/) |
2626
| First Release | 2012 | 2018 |
2727
| PHP Version | <= 8.2 | ![PHP Version](https://img.shields.io/packagist/php-v/dotkernel/api) |
2828
| Architecture | MVC, Event Driven | Middleware |

‎public/md-articles/dotkernel/dotkernel-light-the-best-choice-for-your-presentation-site.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,6 @@ A: Both live in src/App/templates/layout/default.html.twig: the top menu items a
153153

154154
## Resources
155155

156-
- [dotkernel.org](https://www.dotkernel.org) - a working example
156+
- [dotkernel.org](https://www.dotkernel.com/api/) - a working example
157157
- [Dotkernel Light](https://github.com/dotkernel/light)
158158
- [More from Dotkernel](https://github.com/dotkernel)

‎public/md-articles/headless-platform/dotkernel-headless-platform-the-whats-hows-and-whys.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Using both together, sharing a common Core module, gives consistent entities and
1919

2020
The Dotkernel Headless Platform contains two major components:
2121

22-
- [Dotkernel API](https://www.dotkernel.org) - a REST API based on the [Mezzio skeleton](https://github.com/mezzio/mezzio-skeleton).
22+
- [Dotkernel API](https://www.dotkernel.com/api/) - a REST API based on the [Mezzio skeleton](https://github.com/mezzio/mezzio-skeleton).
2323
- [Dotkernel Admin](https://github.com/dotkernel/admin) - a complementary component aimed at quickly setting up a backend for your platform.
2424

2525
The Admin is not bundled by default but is available as a first-party, installable application designed to work seamlessly alongside your API.

‎src/App/templates/partial/left-menu.html.twig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
</a>
6666
</li>
6767
<li>
68-
<a href="https://www.dotkernel.org" target="_blank" rel="noopener">
68+
<a href="https://www.dotkernel.com/api/" target="_blank" rel="noopener">
6969
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M8 4 3 12l5 8M16 4l5 8-5 8"/></svg>
7070
Dotkernel API
7171
</a>

0 commit comments

Comments
 (0)