Skip to content

Commit e177b95

Browse files
committed
minor #8799 Removing more AppBundle (weaverryan)
This PR was squashed before being merged into the 4.0 branch (closes #8799). Discussion ---------- Removing more AppBundle This is still not all of them (and we have a few pending PR's which remove some additional ones). But this gets us *close* to all AppBundle gone. I've even renamed some instances that are not technically problematic. That's because I want to be able to do a `git grep AppBundle` on 4.0 and higher and see *nothing*. This will make it easier to spot merge issues later. This helps #7809. Commits ------- 7d75ce3 Removing more AppBundle
2 parents bd9a614 + 7d75ce3 commit e177b95

File tree

8 files changed

+57
-26
lines changed

8 files changed

+57
-26
lines changed

bundles/best_practices.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,15 +454,15 @@ Resources
454454

455455
If the bundle references any resources (config files, translation files, etc.),
456456
don't use physical paths (e.g. ``__DIR__/config/services.xml``) but logical
457-
paths (e.g. ``@AppBundle/Resources/config/services.xml``).
457+
paths (e.g. ``@FooBundle/Resources/config/services.xml``).
458458

459459
The logical paths are required because of the bundle overriding mechanism that
460460
lets you override any resource/file of any bundle. See :ref:`http-kernel-resource-locator`
461461
for more details about transforming physical paths into logical paths.
462462

463463
Beware that templates use a simplified version of the logical path shown above.
464464
For example, an ``index.html.twig`` template located in the ``Resources/views/Default/``
465-
directory of the AppBundle, is referenced as ``@App/Default/index.html.twig``.
465+
directory of the FooBundle, is referenced as ``@Foo/Default/index.html.twig``.
466466

467467
Learn more
468468
----------

bundles/override.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ features of a bundle.
1212

1313
The bundle overriding mechanism means that you cannot use physical paths to
1414
refer to bundle's resources (e.g. ``__DIR__/config/services.xml``). Always
15-
use logical paths in your bundles (e.g. ``@AppBundle/Resources/config/services.xml``)
15+
use logical paths in your bundles (e.g. ``@FooBundle/Resources/config/services.xml``)
1616
and call the :ref:`locateResource() method <http-kernel-resource-locator>`
1717
to turn them into physical paths when needed.
1818

components/console/helpers/questionhelper.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ method::
247247
// ...
248248
$helper = $this->getHelper('question');
249249

250-
$question = new Question('Please enter the name of the bundle', 'AppBundle');
250+
$question = new Question('Please enter the name of the bundle', 'AcmeDemoBundle');
251251
$question->setNormalizer(function ($value) {
252252
// $value can be null here
253253
return $value ? trim($value) : '';

components/http_kernel.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ on the request's information.
258258

259259
a) If the ``_controller`` key doesn't follow the recommended PHP namespace
260260
format (e.g. ``App\Controller\DefaultController::index``) its format is
261-
transformed into it. For example, the legacy ``AppBundle:Default:index``
262-
format would be changed to ``Acme\AppBundle\Controller\DefaultController::indexAction``.
261+
transformed into it. For example, the legacy ``FooBundle:Default:index``
262+
format would be changed to ``Acme\FooBundle\Controller\DefaultController::indexAction``.
263263
This transformation is specific to the :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver`
264264
sub-class used by the Symfony Framework.
265265

@@ -742,10 +742,10 @@ translation files, etc.)
742742

743743
This overriding mechanism works because resources are referenced not by their
744744
physical path but by their logical path. For example, the ``services.xml`` file
745-
stored in the ``Resources/config/`` directory of a bundle called AppBundle is
746-
referenced as ``@AppBundle/Resources/config/services.xml``. This logical path
745+
stored in the ``Resources/config/`` directory of a bundle called FooBundle is
746+
referenced as ``@FooBundle/Resources/config/services.xml``. This logical path
747747
will work when the application overrides that file and even if you change the
748-
directory of AppBundle.
748+
directory of FooBundle.
749749

750750
The HttpKernel component provides a method called :method:`Symfony\\Component\\HttpKernel\\Kernel::locateResource`
751751
which can be used to transform logical paths into physical paths::
@@ -754,7 +754,7 @@ which can be used to transform logical paths into physical paths::
754754

755755
// ...
756756
$kernel = new HttpKernel($dispatcher, $resolver);
757-
$path = $kernel->locateResource('@AppBundle/Resources/config/services.xml');
757+
$path = $kernel->locateResource('@FooBundle/Resources/config/services.xml');
758758

759759
Learn more
760760
----------

contributing/documentation/standards.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ Code Examples
5454
* The code examples should look real for a web application context. Avoid abstract
5555
or trivial examples (``foo``, ``bar``, ``demo``, etc.);
5656
* The code should follow the :doc:`Symfony Best Practices </best_practices/introduction>`.
57-
Unless the example requires a custom bundle, make sure to always use the
58-
``AppBundle`` bundle to store your code;
5957
* Use ``Acme`` when the code requires a vendor name;
6058
* Use ``example.com`` as the domain of sample URLs and ``example.org`` and
6159
``example.net`` when additional domains are required. All of these domains are

doctrine/multiple_entity_managers.rst

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,21 @@ The following configuration code shows how you can configure two entity managers
5050
default:
5151
connection: default
5252
mappings:
53-
AppBundle: ~
54-
AcmeStoreBundle: ~
53+
Main:
54+
is_bundle: false
55+
type: annotation
56+
dir: '%kernel.project_dir%/src/Entity/Main'
57+
prefix: 'App\Entity\Main'
58+
alias: Main
5559
customer:
5660
connection: customer
5761
mappings:
58-
AcmeCustomerBundle: ~
62+
Customer:
63+
is_bundle: false
64+
type: annotation
65+
dir: '%kernel.project_dir%/src/Entity/Customer'
66+
prefix: 'App\Entity\Customer'
67+
alias: Customer
5968
6069
.. code-block:: xml
6170
@@ -94,12 +103,25 @@ The following configuration code shows how you can configure two entity managers
94103
95104
<doctrine:orm default-entity-manager="default">
96105
<doctrine:entity-manager name="default" connection="default">
97-
<doctrine:mapping name="AppBundle" />
98-
<doctrine:mapping name="AcmeStoreBundle" />
106+
<doctrine:mapping
107+
name="Main"
108+
is_bundle="false"
109+
type="annotation"
110+
dir="%kernel.project_dir%/src/Entity/Main"
111+
prefix="App\Entity\Main"
112+
alias="Main"
113+
/>
99114
</doctrine:entity-manager>
100115
101116
<doctrine:entity-manager name="customer" connection="customer">
102-
<doctrine:mapping name="AcmeCustomerBundle" />
117+
<doctrine:mapping
118+
name="Customer"
119+
is_bundle="false"
120+
type="annotation"
121+
dir="%kernel.project_dir%/src/Entity/Customer"
122+
prefix="App\Entity\Customer"
123+
alias="Customer"
124+
/>
103125
</doctrine:entity-manager>
104126
</doctrine:orm>
105127
</doctrine:config>
@@ -139,14 +161,25 @@ The following configuration code shows how you can configure two entity managers
139161
'default' => array(
140162
'connection' => 'default',
141163
'mappings' => array(
142-
'AppBundle' => null,
143-
'AcmeStoreBundle' => null,
164+
'Main' => array(
165+
is_bundle => false,
166+
type => 'annotation',
167+
dir => '%kernel.project_dir%/src/Entity/Main',
168+
prefix => 'App\Entity\Main',
169+
alias => 'Main',
170+
)
144171
),
145172
),
146173
'customer' => array(
147174
'connection' => 'customer',
148175
'mappings' => array(
149-
'AcmeCustomerBundle' => null,
176+
'Customer' => array(
177+
is_bundle => false,
178+
type => 'annotation',
179+
dir => '%kernel.project_dir%/src/Entity/Customer',
180+
prefix => 'App\Entity\Customer',
181+
alias => 'Customer',
182+
)
150183
),
151184
),
152185
),
@@ -155,8 +188,8 @@ The following configuration code shows how you can configure two entity managers
155188
156189
In this case, you've defined two entity managers and called them ``default``
157190
and ``customer``. The ``default`` entity manager manages entities in the
158-
AppBundle and AcmeStoreBundle, while the ``customer`` entity manager manages
159-
entities in the AcmeCustomerBundle. You've also defined two connections, one
191+
``src/Entity/Main`` directory, while the ``customer`` entity manager manages
192+
entities in ``src/Entity/Customer``. You've also defined two connections, one
160193
for each entity manager.
161194

162195
.. note::

security/entity_provider.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ Before you begin, first make sure you install the Security component:
4242
4343
$ composer require security
4444
45-
For this entry, suppose that you already have a ``User`` entity inside an
46-
``AppBundle`` with the following fields: ``id``, ``username``, ``password``,
45+
For this entry, suppose that you already have a ``User`` entity
46+
with the following fields: ``id``, ``username``, ``password``,
4747
``email`` and ``isActive``::
4848

4949
// src/Entity/User.php

service_container/tags.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ application handlers.
479479
.. code-block:: php
480480
481481
// src/HandlerCollection.php
482-
namespace AppBundle;
482+
namespace App;
483483
484484
class HandlerCollection
485485
{

0 commit comments

Comments
 (0)