Skip to content

Commit f1aa5a1

Browse files
committed
minor #6796 Remove AcmeDemoBundle references (michaelcullum)
This PR was submitted for the 3.1 branch but it was merged into the 2.7 branch instead (closes #6796). Discussion ---------- Remove AcmeDemoBundle references After symfony/symfony-standard#819 and symfony/symfony-standard#818 last year the AcmeDemoBundle doesn't exist so having an article dedicated to it doesn't appear to make much sense. This adapts the article to be focused on removing 'a bundle'. Commits ------- 9476cfa Remove AcmeDemoBundle references
2 parents 999527a + 9476cfa commit f1aa5a1

File tree

1 file changed

+14
-31
lines changed

1 file changed

+14
-31
lines changed

bundles/remove.rst

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
11
.. index::
2-
single: Bundle; Removing AcmeDemoBundle
2+
single: Bundle; Removing a bundle
33

4-
How to Remove the AcmeDemoBundle
5-
================================
6-
7-
The Symfony Standard Edition comes with a complete demo that lives inside a
8-
bundle called AcmeDemoBundle. It is a great boilerplate to refer to while
9-
starting a project, but you'll probably want to eventually remove it.
10-
11-
.. tip::
12-
13-
This article uses the AcmeDemoBundle as an example, but you can use
14-
these steps to remove any bundle.
4+
How to Remove a Bundle
5+
======================
156

167
1. Unregister the Bundle in the ``AppKernel``
178
---------------------------------------------
189

1910
To disconnect the bundle from the framework, you should remove the bundle from
20-
the ``AppKernel::registerBundles()`` method. The bundle is normally found in
21-
the ``$bundles`` array but the AcmeDemoBundle is only registered in the
22-
development environment and you can find it inside the if statement below::
11+
the ``AppKernel::registerBundles()`` method. The bundle will likely be found in
12+
the ``$bundles`` array declaration or added to it in a later statement if the
13+
bundle is only registered in the development environment::
2314

2415
// app/AppKernel.php
2516

@@ -28,7 +19,9 @@ development environment and you can find it inside the if statement below::
2819
{
2920
public function registerBundles()
3021
{
31-
$bundles = array(...);
22+
$bundles = array(
23+
new Acme\DemoBundle\AcmeDemoBundle(),
24+
);
3225

3326
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
3427
// comment or remove this line:
@@ -48,8 +41,8 @@ that refers to the bundle.
4841
2.1 Remove Bundle Routing
4942
~~~~~~~~~~~~~~~~~~~~~~~~~
5043

51-
The routing for the AcmeDemoBundle can be found in ``app/config/routing_dev.yml``.
52-
Remove the ``_acme_demo`` entry at the bottom of this file.
44+
Remove routing references for the bundle, these can likely be found in either
45+
``app/config/routing.yml`` or ``app/config/routing_dev.yml``.
5346

5447
2.2 Remove Bundle Configuration
5548
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -60,18 +53,13 @@ quickly spot bundle configuration by looking for an ``acme_demo`` (or whatever
6053
the name of the bundle is, e.g. ``fos_user`` for the FOSUserBundle) string in
6154
the configuration files.
6255

63-
The AcmeDemoBundle doesn't have configuration. However, the bundle is
64-
used in the configuration for the ``app/config/security.yml`` file. You can
65-
use it as a boilerplate for your own security, but you **can** also remove
66-
everything: it doesn't matter to Symfony if you remove it or not.
67-
6856
3. Remove the Bundle from the Filesystem
6957
----------------------------------------
7058

7159
Now you have removed every reference to the bundle in your application, you
72-
should remove the bundle from the filesystem. The bundle is located in the
73-
``src/Acme/DemoBundle`` directory. You should remove this directory and you
74-
can remove the ``Acme`` directory as well.
60+
should remove the bundle from the filesystem. The bundle will be located in within
61+
src/ for example the ``src/Acme/DemoBundle`` directory. You should remove this
62+
directory, and any parent directories that are now empty (e.g. ``src/Acme/``).
7563

7664
.. tip::
7765

@@ -91,11 +79,6 @@ Remove the assets of the bundle in the web/ directory (e.g.
9179
4. Remove Integration in other Bundles
9280
--------------------------------------
9381

94-
.. note::
95-
96-
This doesn't apply to the AcmeDemoBundle - no other bundles depend
97-
on it, so you can skip this step.
98-
9982
Some bundles rely on other bundles, if you remove one of the two, the other
10083
will probably not work. Be sure that no other bundles, third party or self-made,
10184
rely on the bundle you are about to remove.

0 commit comments

Comments
 (0)