8000 Jules' review · symfony/symfony-docs@c93db0b · GitHub
[go: up one dir, main page]

Skip to content

Commit c93db0b

Browse files
committed
Jules' review
1 parent 426e289 commit c93db0b

File tree

4 files changed

+17
-46
lines changed

4 files changed

+17
-46
lines changed

bundles/configuration.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ which is already supported when your bundle extend from the :class:`Symfony\\Com
465465
}
466466

467467
This method is a shortcut of the previous "Extension", "Configuration" and "TreeBuilder" convention,
468-
where you also have the possibility to import configuration definition from an external file::
468+
now you also have the possibility to import configuration definition from an external file::
469469

470470
// Acme/FooBundle/config/definition.php
471471
use Symfony\Component\Config\Definition\Configurator\DefinitionConfigurator;
@@ -480,7 +480,7 @@ where you also have the possibility to import configuration definition from an e
480480

481481
.. note::
482482

483-
The "configure()" method is called only at compiler time.
483+
The "configure()" method is called only at compile time.
484484

485485
.. _`FrameworkBundle Configuration`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
486486
.. _`TwigBundle Configuration`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php

bundles/extension.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,4 @@ them in place using the fluent interfaces.
187187

188188
.. note::
189189

190-
The "loadExtension()" like "load()" method is called only at compiler time.
190+
The "loadExtension()", as the "load()" method, are called only at compile time.

bundles/prepend_extension.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,4 +197,4 @@ the supported formats (php, yaml, xml).
197197

198198
.. note::
199199

200-
The "prependExtension()" like "prepend()" method is called only at compiler time.
200+
The "prependExtension()" like "prepend()" method is called only at compile time.

configuration/micro_kernel_trait.rst

Lines changed: 13 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,21 @@ Now it looks like this::
163163
protected function configureContainer(ContainerConfigurator $c): void
164164
{
165165
$c->import(__DIR__.'/../config/framework.yaml');
166-
$c->import(__DIR__.'/../config/web_profiler.yaml');
167166

168167
// register all classes in /src/ as service
169168
$c->services()
170169
->load('App\\', __DIR__.'/*')
171170
->autowire()
172171
->autoconfigure()
173172
;
173+
174+
// configure WebProfilerBundle only if the bundle is enabled
175+
if (isset($this->bundles['WebProfilerBundle'])) {
176+
$c->extension('web_profiler', [
177+
'toolbar' => true,
178+
'intercept_redirects' => false,
179+
]);
180+
}
174181
}
175182

176183
protected function configureRoutes(RoutingConfigurator $routes): void
@@ -229,11 +236,15 @@ add a service conditionally based on the ``foo`` value::
229236
public function loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): void
230237
{
231238
if ($config['foo']) {
232-
$container->set('foo_service', new stdClass());
239+
$container->set('foo_service', new \stdClass());
233240
}
234241
}
235242
}
236243

244+
.. versionadded:: 6.1
245+
246+
The ``AbstractExtension`` class is introduced in Symfony 6.1.
247+
237248
Unlike the previous kernel, this loads an external ``config/framework.yaml`` file,
238249
because the configuration started to get bigger:
239250

@@ -274,46 +285,6 @@ because the configuration started to get bigger:
274285
;
275286
};
276287
277-
As well as the ``config/web_profiler.yaml`` file:
278-
279-
.. configuration-block::
280-
281-
.. code-block:: yaml
282-
283-
# config/web_profiler.yaml
284-
when@dev:
285-
web_profiler:
286-
toolbar: true
287-
intercept_redirects: false
288-
289-
.. code-block:: xml
290-
291-
<!-- config/web_profiler.xml -->
292-
<?xml version="1.0" encoding="UTF-8" ?>
293-
<container xmlns="http://symfony.com/schema/dic/services"
294-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
295-
xmlns:framework="http://symfony.com/schema/dic/symfony"
296-
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd
297-
http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
298-
299-
<!-- WebProfilerBundle is enabled only in the "dev" environment -->
300-
<when env="dev">
301-
<web-profiler:config toolbar="true" intercept-redirects="false"/>
302-
</when>
303-
</container>
304-
305-
.. code-block:: php
306-
307-
// config/web_profiler.php
308-
use Symfony\Config\WebProfilerConfig;
309-
310-
return static function (WebProfilerConfig $webProfiler) {
311-
$webProfiler
312-
23DA ->toolbar(true)
313-
->interceptRedirects(false)
314-
;
315-
};
316-
317288
This also loads annotation routes from an ``src/Controller/`` directory, which
318289
has one file in it::
319< 3A81 code>290

0 commit comments

Comments
 (0)
0