Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7d75ce3

Browse files
committed
Removing more AppBundle
1 parent 2faa719 commit 7d75ce3

File tree

16 files changed

+150
-221
lines changed

16 files changed

+150
-221
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/code/reproducer.rst

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,22 @@ Reproducing Complex Bugs
3333
------------------------
3434

3535
If the bug is related to the Symfony Framework or if it's too complex to create
36-
a PHP script, it's better to reproduce the bug by forking the Symfony Standard
37-
edition. To do so:
38-
39-
#. Go to https://github.com/symfony/symfony-standard and click on the **Fork**
40-
button to make a fork of that repository or go to your already forked copy.
41-
#. Clone the forked repository into your computer:
42-
``git clone git://github.com/YOUR-GITHUB-USERNAME/symfony-standard.git``
43-
#. Browse the project and create a new branch (e.g. ``issue_23567``,
44-
``reproduce_23657``, etc.)
45-
#. Now you must add the minimum amount of code to reproduce the bug. This is the
36+
a PHP script, it's better to reproduce the bug by creating a new project. To do so:
37+
38+
1. Create a new project:
39+
40+
.. code-block:: terminal
41+
42+
$ composer require symfony/skeleton bug_app
43+
44+
2. Now you must add the minimum amount of code to reproduce the bug. This is the
4645
trickiest part and it's explained a bit more later.
47-
#. Add, commit and push all your changes.
48-
#. Add a comment in your original issue report to share the URL of your forked
49-
project (e.g. ``https://github.com/YOUR-GITHUB-USERNAME/symfony-standard/tree/issue_23567``)
46+
3. Add and commit your changes.
47+
4. Create a `new repository`_ on GitHub (give it any name).
48+
5. Follow the instructions on GitHub to add the ``origin`` remote to your local project
49+
and push it.
50+
6. Add a comment in your original issue report to share the URL of your forked
51+
project (e.g. ``https://github.com/YOUR-GITHUB-USERNAME/symfony_issue_23567``)
5052
and, if necessary, explain the steps to reproduce (e.g. "browse this URL",
5153
"fill in this data in the form and submit it", etc.)
5254

@@ -55,23 +57,24 @@ Adding the Minimum Amount of Code Possible
5557

5658
The key to create a bug reproducer is to solely focus on the feature that you
5759
suspect is failing. For example, imagine that you suspect that the bug is related
58-
to a route definition. Then, after forking the Symfony Standard Edition:
60+
to a route definition. Then, after creating your project:
5961

6062
#. Don't edit any of the default Symfony configuration options.
6163
#. Don't copy your original application code and don't use the same structure
62-
of bundles, controllers, actions, etc. as in your original application.
63-
#. Open the default controller class of the AppBundle and add your routing
64-
definition using annotations.
64+
of controllers, actions, etc. as in your original application.
65+
#. Create a simple controller and add your routing definition that shows the bug.
6566
#. Don't create or modify any other file.
66-
#. Execute the ``server:run`` command and browse the previously defined route
67-
to see if the bug appears or not.
67+
#. Execute ``composer require server`` and use the ``server:run`` command to browse
68+
to the new route and see if the bug appears or not.
6869
#. If you can see the bug, you're done and you can already share the code with us.
6970
#. If you can't see the bug, you must keep making small changes. For example, if
7071
your original route was defined using XML, forget about the previous route
71-
annotation and define the route using XML instead. Or maybe your application
72-
uses bundle inheritance and that's where the real bug is. Then, forget about
73-
AppBundle and quickly generate a new AppParentBundle, make AppBundle inherit
74-
from it and test if the route is working.
72+
and define the route using XML instead. Or maybe your application
73+
registers some event listeners and that's where the real bug is. In that case,
74+
add an event listener that's similar to your real app to see if you can find
75+
the bug.
76+
77+
In short, the idea is to keep adding small and incremental changes to a new project
78+
until you can reproduce the bug.
7579

76-
In short, the idea is to keep adding small and incremental changes to the default
77-
Symfony Standard edition until you can reproduce the bug.
80+
.. _`new repository`: https://github.com/new

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.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The database connection information is stored as an environment variable called
3939
DATABASE_URL="mysql://db_user:[email protected]:3306/db_name"
4040
4141
# to use sqlite:
42-
# DATABASE_URL="sqlite://%kernel.project_dir%/var/app.db"
42+
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/app.db"
4343
4444
Now that your connection parameters are setup, Doctrine can create the ``db_name``
4545
database for you:

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::

0 commit comments

Comments
 (0)