Skip to content

Commit 752722e

Browse files
committed
[symfony#2067] Tweaks to new remove "AcmeDemoBundle" entry
Biggest change was to rearrange steps so that all of the required steps are first, and the optional step (which doesn't apply to AcmeDemoBundle) is last.
1 parent e7c136f commit 752722e

File tree

3 files changed

+41
-38
lines changed

3 files changed

+41
-38
lines changed

Diff for: cookbook/bundles/remove.rst

+39-36
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,22 @@
44
How to remove the AcmeDemoBundle
55
================================
66

7-
The Symfony2 Standard Edition comes with a complete demo, that lives inside a
7+
The Symfony2 Standard Edition comes with a complete demo that lives inside a
88
bundle called ``AcmeDemoBundle``. It is a great boilerplate to refer to while
9-
starting with your project, but later on the project, it will become usefull
10-
to remove this bundle.
9+
starting a project, but you'll probably want to eventually remove it.
1110

1211
.. tip::
1312

14-
This article uses the AcmeDemoBundle as an example, you can use this
15-
article on every bundle you want to remove.
13+
This article uses the ``AcmeDemoBundle`` as an example, but you can use
14+
these steps to remove any bundle.
1615

1716
1. Unregister the bundle in the ``AppKernel``
1817
---------------------------------------------
1918

2019
To disconnect the bundle from the framework, you should remove the bundle from
2120
the ``Appkernel::registerBundles()`` method. The bundle is normally found in
2221
the ``$bundles`` array but the ``AcmeDemoBundle`` is only registered in a
23-
development environment and you can find him in the if statement thereafter::
22+
development environment and you can find him in the if statement after::
2423

2524
// app/AppKernel.php
2625

@@ -42,7 +41,7 @@ development environment and you can find him in the if statement thereafter::
4241
2. Remove bundle configuration
4342
------------------------------
4443

45-
Now Symfony doesn't know about the bundle, you need to remove any
44+
Now that Symfony doesn't know about the bundle, you need to remove any
4645
configuration and routing configuration inside the ``app/config`` directory
4746
that refers to the bundle.
4847

@@ -51,53 +50,57 @@ that refers to the bundle.
5150

5251
The routing for the AcmeDemoBundle can be found in
5352
``app/config/routing_dev.yml``. The routes are ``_welcome``, ``_demo_secured``
54-
and ``_demo``.
53+
and ``_demo``. Remove all three of these entries.
5554

5655
2.2 Remove bundle configuration
5756
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5857

59-
Some bundles contains configuration in one of the ``app/config/config*.yml``
58+
Some bundles contain configuration in one of the ``app/config/config*.yml``
6059
files. Be sure to remove the related configuration from these files. You can
6160
quickly spot bundle configuration by looking at a ``acme_demo`` (or whatever
62-
the name of the bundle is, e.g. ``fos_user`` with the FOSUserBundle) string in
61+
the name of the bundle is, e.g. ``fos_user`` for the ``FOSUserBundle``) string in
6362
the configuration files.
6463

65-
The AcmeDemoBundle doesn't have configuration. However, the bundle has set up
66-
the ``app/config/security.yml`` file. You can use it as a boilerplate for your
67-
own security, but you **can** also remove everything: It doesn't make sense to
68-
Symfony if you remove it or not.
64+
The ``AcmeDemoBundle`` doesn't have configuration. However, the bundle is
65+
used in the configuration for the ``app/config/security.yml`` file. You can
66+
use it as a boilerplate for your own security, but you **can** also remove
67+
everything: it doesn't matter to Symfony if you remove it or not.
6968

70-
3. Remove integration in other bundles
71-
--------------------------------------
69+
3. Remove the bundle from the Filesystem
70+
----------------------------------------
7271

73-
Some bundles rely on other bundles, if you remove one of the two, the other
74-
will properbly not work. Be sure that no other bundles, third party or self
75-
made, relies on the bundle you are about to remove.
72+
Now you have removed every reference to the bundle in your application, you
73+
should remove the bundle from the filesystem. The bundle is located in the
74+
``src/Acme/DemoBundle`` directory. You should remove this directory and you
75+
can remove the ``Acme`` directory as well.
7676

7777
.. tip::
7878

79-
If a bundle relies on another bundle, it means in most of the cases that
80-
it uses some services from the other bundle. Searching for a ``acme_demo``
81-
string will help you spot them.
79+
If you don't know the location of a bundle, you can use the
80+
:method:`Symfony\\Bundle\\FrameworkBundle\\Bundle\\Bundle::getPath` method
81+
to get the path of the bundle::
8282

83-
.. tip::
83+
echo $this->container->get('kernel')->getBundle('AcmeDemoBundle')->getPath();
84+
85+
4. Remove integration in other bundles
86+
--------------------------------------
8487

85-
If a third party bundle relies on another bundle, you can find the bundle
86-
in the ``composer.json`` file included in the bundle directory.
88+
.. note::
8789

88-
4. Remove the bundle from the filesystem
89-
----------------------------------------
90+
This doesn't apply to the ``AcmeDemoBundle`` - no other bundles depend
91+
on it, so you can skip this step.
9092

91-
Now you have removed every reference to the bundle in the Symfony2
92-
application, the last thing you should do is removing the bundle from the file
93-
system. The bundle is located in the ``src/Acme/DemoBundle`` directory. You
94-
should remove this directory and you can remove the ``Acme`` directory as
95-
well, you likely won't get other bundles in that vendor.
93+
Some bundles rely on other bundles, if you remove one of the two, the other
94+
will probably not work. Be sure that no other bundles, third party or self-made,
95+
rely on the bundle you are about to remove.
9696

9797
.. tip::
9898

99-
If you don't know the location of a bundle, you can use the
100-
:method:`Symfony\\Bundle\\FrameworkBundle\\Bundle\\Bundle::getPath` method
101-
to get the path of the bundle::
99+
If one bundle relies on another, in most it means that it uses some services
100+
from the bundle. Searching for a ``acme_demo`` string may help you spot
101+
them.
102102

103-
echo $this->container->get('kernel')->getBundle('AcmeDemoBundle')->getPath();
103+
.. tip::
104+
105+
If a third party bundle relies on another bundle, you can find that bundle
106+
mentioned in the ``composer.json`` file included in the bundle directory.

Diff for: cookbook/workflow/new_project_git.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ to learn more about how to configure and develop inside your application.
117117

118118
The Symfony2 Standard Edition comes with some example functionality. To
119119
remove the sample code, follow the instructions in the
120-
":doc:`/components/bundles/remove`" article.
120+
":doc:`/cookbook/bundles/remove`" article.
121121

122122
.. _cookbook-managing-vendor-libraries:
123123

Diff for: cookbook/workflow/new_project_svn.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ to learn more about how to configure and develop inside your application.
123123

124124
The Symfony2 Standard Edition comes with some example functionality. To
125125
remove the sample code, follow the instructions in the
126-
":doc:`/components/bundles/remove`" article.
126+
":doc:`/cookbook/bundles/remove`" article.
127127

128128
.. include:: _vendor_deps.rst.inc
129129

0 commit comments

Comments
 (0)