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
1671. Unregister the Bundle in the ``AppKernel ``
178---------------------------------------------
189
1910To 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.
48412.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
54472.2 Remove Bundle Configuration
5548~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -60,18 +53,13 @@ quickly spot bundle configuration by looking for an ``acme_demo`` (or whatever
6053the name of the bundle is, e.g. ``fos_user `` for the FOSUserBundle) string in
6154the 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-
68563. Remove the Bundle from the Filesystem
6957----------------------------------------
7058
7159Now 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.
91794. 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-
9982Some bundles rely on other bundles, if you remove one of the two, the other
10083will probably not work. Be sure that no other bundles, third party or self-made,
10184rely on the bundle you are about to remove.
0 commit comments