-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Updates to DI config for 3.3 #7807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
8433fc1
[WIP] Updates to DI config for 3.3
weaverryan 2d11347
more tweaks
weaverryan 105801c
adding note about autoconfigure
weaverryan 049df7d
Adding details and usages of fetching the service as a controller arg
weaverryan 9e84572
last tweaks from feedback
weaverryan c45daf4
fixing build problem
weaverryan 2636bea
bad link
weaverryan 9ab27f0
Add xml files
GuilhemN 0e48bd8
[WIP] Updates to DI config for 3.3
weaverryan 6e6ed94
more tweaks
weaverryan 70178d1
adding note about autoconfigure
weaverryan 45500b3
Adding details and usages of fetching the service as a controller arg
weaverryan 759e9b2
last tweaks from feedback
weaverryan 6de83e2
fixing build problem
weaverryan 89e12de
bad link
weaverryan 443aec2
Merge pull request #7857 from GuilhemN/patch-1
weaverryan bc7088d
Merge remote-tracking branch 'origin/di-3.3-changes' into di-3.3-changes
weaverryan ee27765
Adding versionadded
weaverryan 5452c61
Adding section about public: false
weaverryan 2229fd3
Merge remote-tracking branch 'origin/master' into di-3.3-changes
weaverryan cac3c6c
Merge remote-tracking branch 'origin/master' into di-3.3-changes
weaverryan 12c4944
Tweaks after amazing review from @GuilhemN and @xabbuh
weaverryan 22adfbd
removing duplicate target
weaverryan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add xml files
- Loading branch information
commit 9ab27f03a263c207031b14b235b34ef0785825da
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,7 +135,20 @@ the service container *how* to instantiate it: | |
.. code-block:: xml | ||
|
||
<!-- app/config/services.xml --> | ||
TODO | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services | ||
http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
|
||
<services> | ||
<!-- Default configuration for services in *this* file --> | ||
<defaults autowire="true" autoconfigure="true" /> | ||
|
||
<!-- Load services from whatever directories you want (you can update this!) --> | ||
<prototype namespace="AppBundle\" resource="../../src/AppBundle/{Service,EventDispatcher,Twig,Form}" /> | ||
</services> | ||
</container> | ||
|
||
.. code-block:: php | ||
|
||
|
@@ -284,7 +297,19 @@ the new ``Updates`` sub-directory: | |
.. code-block:: xml | ||
|
||
<!-- app/config/services.xml --> | ||
TODO | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services | ||
http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
|
||
<services> | ||
<!-- ... --> | ||
|
||
<!-- Registers all classes in Services & Updates directories --> | ||
<prototype namespace="AppBundle\" resource="../../src/AppBundle/{Service,Updates,EventDispatcher,Twig,Form}" /> | ||
</services> | ||
</container> | ||
|
||
.. code-block:: php | ||
|
||
|
@@ -375,7 +400,24 @@ pass here. No problem! In your configuration, you can explicitly set this argume | |
.. code-block:: xml | ||
|
||
<!-- app/config/services.xml --> | ||
TODO | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services | ||
http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
|
||
<services> | ||
<!-- ... --> | ||
|
||
<!-- Same as before --> | ||
<prototype namespace="AppBundle\" resource="../../src/AppBundle/{Service,Updates}" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
|
||
<!-- Explicitly configure the service --> | ||
<service id="AppBundle\Updates\SiteUpdateManager"> | ||
<argument key="$adminEmail">%admin_email%</argument> | ||
</service> | ||
</services> | ||
</container> | ||
|
||
.. code-block:: php | ||
|
||
|
@@ -412,7 +454,25 @@ and reference it with the ``%parameter_name%`` syntax: | |
|
||
.. code-block:: xml | ||
|
||
TODO | ||
<!-- app/config/services.xml --> | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services | ||
http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
|
||
<parameters> | ||
<parameter key="admin_email">manager@example.com</parameter> | ||
</parameters> | ||
|
||
<services> | ||
<!-- ... --> | ||
|
||
<service id="AppBundle\Updates\SiteUpdateManager"> | ||
<argument key="$adminEmail">%admin_email%</argument> | ||
</service> | ||
</services> | ||
</container> | ||
|
||
.. code-block:: php | ||
|
||
|
@@ -495,7 +555,21 @@ But, you can control this and pass in a different logger: | |
.. code-block:: xml | ||
|
||
<!-- app/config/services.xml --> | ||
TODO | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services | ||
http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
|
||
<services> | ||
<!-- ... same code as before --> | ||
|
||
<!-- Explicitly configure the service --> | ||
<service id="AppBundle\Service\MessageGenerator"> | ||
<argument key="$logger" type="service" id="monolog.logger.request" /> | ||
</service> | ||
</services> | ||
</container> | ||
|
||
.. code-block:: php | ||
|
||
|
@@ -538,7 +612,20 @@ as a service, and :doc:`tag </service_container/tags>` it with ``twig.extension` | |
.. code-block:: xml | ||
|
||
<!-- app/config/services.xml --> | ||
TODO | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services | ||
http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
|
||
<services> | ||
<!-- ... --> | ||
|
||
<service id="AppBundle\Twig\MyTwigExtension"> | ||
<tag name="twig.extension" /> | ||
</service> | ||
</services> | ||
</container> | ||
|
||
.. code-block:: php | ||
|
||
|
@@ -565,7 +652,19 @@ is this: | |
.. code-block:: xml | ||
|
||
<!-- app/config/services.xml --> | ||
TODO | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services | ||
http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
|
||
<services> | ||
<defaults autowire="true" autoconfigure="true" /> | ||
|
||
<!-- Load your services--> | ||
<prototype namespace="AppBundle\" resource="../../src/AppBundle/{Service,EventDispatcher,Twig,Form}" /> | ||
</services> | ||
</container> | ||
|
||
.. code-block:: php | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we add all directories supported in the standard edition (
{Command,Form,EventSubscriber,Twig,Security}
)?