1
1
.. index ::
2
- single: Bundle; Removing AcmeDemoBundle
2
+ single: Bundle; Removing a bundle
3
3
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
+ ======================
15
6
16
7
1. Unregister the Bundle in the ``AppKernel ``
17
8
---------------------------------------------
18
9
19
10
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 ::
23
14
24
15
// app/AppKernel.php
25
16
@@ -28,7 +19,9 @@ development environment and you can find it inside the if statement below::
28
19
{
29
20
public function registerBundles()
30
21
{
31
- $bundles = array(...);
22
+ $bundles = array(
23
+ new Acme\DemoBundle\AcmeDemoBundle(),
24
+ );
32
25
33
26
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
34
27
// comment or remove this line:
@@ -48,8 +41,8 @@ that refers to the bundle.
48
41
2.1 Remove Bundle Routing
49
42
~~~~~~~~~~~~~~~~~~~~~~~~~
50
43
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 `` .
53
46
54
47
2.2 Remove Bundle Configuration
55
48
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -60,18 +53,13 @@ quickly spot bundle configuration by looking for an ``acme_demo`` (or whatever
60
53
the name of the bundle is, e.g. ``fos_user `` for the FOSUserBundle) string in
61
54
the configuration files.
62
55
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
-
68
56
3. Remove the Bundle from the Filesystem
69
57
----------------------------------------
70
58
71
59
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/ ``) .
75
63
76
64
.. tip ::
77
65
@@ -91,11 +79,6 @@ Remove the assets of the bundle in the web/ directory (e.g.
91
79
4. Remove Integration in other Bundles
92
80
--------------------------------------
93
81
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
-
99
82
Some bundles rely on other bundles, if you remove one of the two, the other
100
83
will probably not work. Be sure that no other bundles, third party or self-made,
101
84
rely on the bundle you are about to remove.
0 commit comments