Skip to content

Commit c40cc10

Browse files
committed
[#1730] Tweaks as I proofread the DIC workflow entry
1 parent d67d44a commit c40cc10

File tree

1 file changed

+40
-36
lines changed

1 file changed

+40
-36
lines changed

components/dependency_injection/workflow.rst

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,71 +4,75 @@
44
Container Building Workflow
55
===========================
66

7-
In the preceding pages of this section of the components there has been
8-
little to say where the various files and classes should be located. This
9-
is because this depends on the application, library or framework you want
10-
to use the container in. Looking at how the container is configured and built
11-
in the Symfony2 full stack framework will help you see how this all fits
12-
together whether you are using the full stack framework or looking to use
13-
the service container in another application.
7+
In the preceding pages of this section, there has been little to say about
8+
where the various files and classes should be located. This is because this
9+
depends on the application, library or framework in which you want to use
10+
the container. Looking at how the container is configured and built in the
11+
Symfony2 full stack framework will help you see how this all fits together,
12+
whether you are using the full stack framework or looking to use the service
13+
container in another application.
1414

1515
The full stack framework uses the ``HttpKernel`` component to manage the loading
16-
of service container configuration from the app level and from bundles as well
17-
as with the compilation and caching. Even if you are not using the ``HttpKernel``
18-
it should give you an idea of a way of organising configuration in a modular
16+
of the service container configuration from the application and bundles and
17+
also handles the compilation and caching. Even if you are not using ``HttpKernel``,
18+
it should give you an idea of one way of organizing configuration in a modular
1919
application.
2020

21-
Working with cached container
21+
Working with cached Container
2222
-----------------------------
2323

24-
Before building the container a cached version is checked for. The ``HttpKernel``
25-
has a debug setting, if this is false then the cached version is used if it
26-
exists. If debug is true then the :doc:`cached configuration is checked for freshness<components/config/caching>`
27-
and the cached version of the container used if it is. If not then the container
28-
is built from the app level configuration and the bundle's extension configuration.
24+
Before building it, the kernel checks to see if a cached version of the container
25+
exists. The ``HttpKernel`` has a debug setting and if this is false, the
26+
cached version is used if it exists. If debug is true then the kernel
27+
:doc:`checks to see if configuration is fresh<components/config/caching>`
28+
and if it is, the cached version of the container is. If not then the container
29+
is built from the application-level configuration and the bundles's extension
30+
configuration.
31+
2932
Read :ref:`Dumping the Configuration for Performance<components-dependency-injection-dumping>`
3033
for more details.
3134

32-
Application level configuration
35+
Application-level Configuration
3336
-------------------------------
3437

3538
Application level config is loaded from the ``app/config`` directory. Multiple
3639
files are loaded which are then merged when the extensions are processed. This
37-
allows for different config for different environments e.g. dev, prod.
40+
allows for different configuration for different environments e.g. dev, prod.
3841

39-
These files contain parameters and services to be loaded directly into
42+
These files contain parameters and services that are loaded directly into
4043
the container as per :ref:`Setting Up the Container with Configuration Files<components-dependency-injection-loading-config>`.
41-
They all contain config to be processed by extensions as per :ref:`Managing Configuration with Extensions<components-dependency-injection-extension>`.
44+
They also contain configuration that is processed by extensions as per
45+
:ref:`Managing Configuration with Extensions<components-dependency-injection-extension>`.
4246
These are considered to be bundle configuration since each bundle contains
4347
an Extension class.
4448

45-
Bundle level config with extensions
46-
-----------------------------------
49+
Bundle-level Configuration with Extensions
50+
------------------------------------------
4751

48-
By convention each bundle contains an Extension class which is in the bundle's
49-
Dependency Injection directory. These are registered with the ``ContainerBuilder``
50-
when the Kernel is booted. When the ContainerBuilder is :doc:`compiled<components/dependency-injection/compilation>`
51-
the app level config relevant to the bundle's extension is passed to the Extension
52-
which also usually loads its own config file(s), typically from the bundle's
53-
``Resources/config`` directory. The app level config is usually processed with
54-
a :doc:`Configuration object<components/config/definition>` also stored in the
55-
bundle's ``DependencyInjection`` directory.
52+
By convention, each bundle contains an Extension class which is in the bundle's
53+
``DependencyInjection`` directory. These are registered with the ``ContainerBuilder``
54+
when the kernel is booted. When the ``ContainerBuilder`` is :doc:`compiled<components/dependency-injection/compilation>`,
55+
the application-level configuration relevant to the bundle's extension is
56+
passed to the Extension which also usually loads its own config file(s), typically from the bundle's
57+
``Resources/config`` directory. The application-level config is usually processed
58+
with a :doc:`Configuration object<components/config/definition>` also stored
59+
in the bundle's ``DependencyInjection`` directory.
5660

57-
Compiler passes to allow interaction between bundles
61+
Compiler passes to allow Interaction between Bundles
5862
----------------------------------------------------
5963

6064
:ref:`Compiler passes<components-dependency-injection-compiler-passes>` are
6165
used to allow interaction between different bundles as they cannot affect
6266
each others configuration in the extension classes. One of the main uses is
6367
to process tagged services, allowing bundles to register services to picked
64-
up by other bundle, such as Monolog loggers, Twig extensions and Data Collectors
68+
up by other bundles, such as Monolog loggers, Twig extensions and Data Collectors
6569
for the Web Profiler. Compiler passes are usually placed in the bundle's
6670
``DependencyInjection/Compiler`` directory.
6771

68-
Compilation and caching
72+
Compilation and Caching
6973
-----------------------
7074

7175
After the compilation process has loaded the services from the configuration,
72-
extensions and the compiler passes it is dumped so that the cache can be used
73-
next time and the dumped version then used during the request as it is more
74-
efficient.
76+
extensions and the compiler passes, it is dumped so that the cache can be used
77+
next time. The dumped version is then used during subsequent request as it
78+
is more efficient.

0 commit comments

Comments
 (0)