Skip to content

Commit f794d1e

Browse files
committed
Merge branch '6.1' into 6.2
* 6.1: enable_annotations read also attributes Fix assets path in all directories no matter the deep. Add fix for js' assets. Add fix for fontawesome' assets.
2 parents 6a5ded0 + 76ba52e commit f794d1e

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

_build/build.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,18 @@
4747

4848
if ($result->isSuccessful()) {
4949
// fix assets URLs to make them absolute (otherwise, they don't work in subdirectories)
50-
foreach (glob($outputDir.'/**/*.html') as $htmlFilePath) {
50+
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($outputDir));
51+
52+
foreach (new RegexIterator($iterator, '/^.+\.html$/i', RegexIterator::GET_MATCH) as $match) {
53+
$htmlFilePath = array_shift($match);
54+
$htmlContents = file_get_contents($htmlFilePath);
55+
file_put_contents($htmlFilePath, str_replace('<head>', '<head><base href="/">', $htmlContents));
56+
}
57+
58+
foreach (new RegexIterator($iterator, '/^.+\.css/i', RegexIterator::GET_MATCH) as $match) {
59+
$htmlFilePath = array_shift($match);
5160
$htmlContents = file_get_contents($htmlFilePath);
52-
file_put_contents($htmlFilePath, str_replace('href="assets/', 'href="/assets/', $htmlContents));
61+
file_put_contents($htmlFilePath, str_replace('fonts/', '../fonts/', $htmlContents));
5362
}
5463

5564
$io->success(sprintf("The Symfony Docs were successfully built at %s", realpath($outputDir)));

reference/configuration/framework.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2514,7 +2514,7 @@ enable_annotations
25142514

25152515
**type**: ``boolean`` **default**: ``false``
25162516

2517-
If this option is enabled, validation constraints can be defined using annotations.
2517+
If this option is enabled, validation constraints can be defined using annotations or attributes.
25182518

25192519
translation_domain
25202520
..................
@@ -2722,7 +2722,7 @@ enable_annotations
27222722

27232723
**type**: ``boolean`` **default**: ``false``
27242724

2725-
If this option is enabled, serialization groups can be defined using annotations.
2725+
If this option is enabled, serialization groups can be defined using annotations or attributes.
27262726

27272727
.. seealso::
27282728

0 commit comments

Comments
 (0)