8000 Green pipeline without renaming · symfony/symfony-docs@240ae8d · GitHub
[go: up one dir, main page]

Skip to content

Commit 240ae8d

Browse files
committed
Green pipeline without renaming
1 parent 9a39561 commit 240ae8d

File tree

2 files changed

+29
-15
lines changed

2 files changed

+29
-15
lines changed

.doctor-rst.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,17 @@ whitelist:
101101
- '// bin/console'
102102
- '.. _`a feature to test applications using Mercure`: https://github.com/symfony/panther#creating-isolated-browsers-to-test-apps-using-mercure-or-websocket'
103103
- '.. End to End Tests (E2E)'
104+
- 'First, create a new ``apps`` directory at the root of your project, which will' # configuration/multiple_kernels.rst
105+
- '├─ apps/' # configuration/multiple_kernels.rst
106+
- '``apps/`` directory. Therefore, you should carefully consider what is' # configuration/multiple_kernels.rst
107+
- 'Since the new ``apps/api/src/`` directory will host the PHP code related to the' # configuration/multiple_kernels.rst
108+
- '"Api\\": "apps/api/src/"' # configuration/multiple_kernels.rst
109+
- "return $this->getProjectDir().'/apps/'.$this->id.'/config';" # configuration/multiple_kernels.rst
110+
- '``apps/`` as it is used in the Kernel to load the specific application' # configuration/multiple_kernels.rst
111+
- '``apps/admin/templates/`` which you will need to manually configure under the' # configuration/multiple_kernels.rst
112+
- '# apps/admin/config/packages/twig.yaml' # configuration/multiple_kernels.rst
113+
- "'%kernel.project_dir%/apps/admin/templates': Admin" # configuration/multiple_kernels.rst
114+
- '// apps/api/tests/ApiTestCase.php' # configuration/multiple_kernels.rst
115+
- 'Now, create a ``tests/`` directory inside the ``apps/api/`` application. Then,' # configuration/multiple_kernels.rst
116+
- '"Api\\Tests\\": "apps/api/tests/"' # configuration/multiple_kernels.rst
117+
- '<directory>apps/api/tests</directory>' # configuration/multiple_kernels.rst

configuration/multiple_kernels.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ isolated context, but they can share common bundles, configuration, and code if
5151
desired. The optimal approach will depend on your specific needs and
5252
requirements, so it's up to you to decide which best suits your project.
5353

54-
First, create a new ``applications`` directory at the root of your project, which will
54+
First, create a new ``apps`` directory at the root of your project, which will
5555
hold all the necessary applications. Each application will follow a simplified
5656
directory structure like the one described in :ref:`Symfony Best Practice </best_practices>`:
5757

5858
.. code-block:: text
5959
6060
your-project/
61-
├─ applications/
61+
├─ apps/
6262
│ └─ api/
6363
│ ├─ config/
6464
│ │ ├─ bundles.php
@@ -77,7 +77,7 @@ directory structure like the one described in :ref:`Symfony Best Practice </best
7777

7878
Note that the ``config/`` and ``src/`` directories at the root of the
7979
project will represent the shared context among all applications within the
80-
``applications/`` directory. Therefore, you should carefully consider what is
80+
``apps/`` directory. Therefore, you should carefully consider what is
8181
common and what should be placed in the specific application.
8282

8383
.. tip::
@@ -86,7 +86,7 @@ directory structure like the one described in :ref:`Symfony Best Practice </best
8686
``App`` to ``Shared``, as it will make it easier to distinguish and provide
8787
clearer meaning to this context.
8888

89-
Since the new ``applications/api/src/`` directory will host the PHP code related to the
89+
Since the new ``apps/api/src/`` directory will host the PHP code related to the
9090
API, you have to update the ``composer.json`` file to include it in the autoload
9191
section:
9292

@@ -96,7 +96,7 @@ section:
9696
"autoload": {
9797
"psr-4": {
9898
"Shared\\": "src/",
99-
"Api\\": "applications/api/src/"
99+
"Api\\": "apps/api/src/"
100100
}
101101
}
102102
}
@@ -135,7 +135,7 @@ resources::
135135

136136
public function getAppConfig D7AE Dir(): string
137137
{
138-
return $this->getProjectDir().'/applications/'.$this->id.'/config';
138+
return $this->getProjectDir().'/apps/'.$this->id.'/config';
139139
}
140140

141141
public function registerBundles(): iterable
@@ -229,7 +229,7 @@ but it should typically be added to your web server configuration.
229229
.. caution::
230230

231231
The value of this variable must match the application directory within
232-
``applications/`` as it is used in the Kernel to load the specific application
232+
``apps/`` as it is used in the Kernel to load the specific application
233233
configuration.
234234

235235
Step 4) Update the Front Controllers
@@ -322,15 +322,15 @@ Let's consider that you need to create another app called ``admin``. If you
322322
follow the :ref:`Symfony Best Practices </best_practices>`, the shared Kernel
323323
templates will be located in the ``templates/`` directory at the project's root.
324324
For admin-specific templates, you can create a new directory
325-
``applications/admin/templates/`` which you will need to manually configure under the
325+
``apps/admin/templates/`` which you will need to manually configure under the
326326
Admin application:
327327

328328
.. code-block:: yaml
329329
330-
# applications/admin/config/packages/twig.yaml
330+
# apps/admin/config/packages/twig.yaml
331331
twig:
332332
paths:
333-
'%kernel.project_dir%/applications/admin/templates': Admin
333+
'%kernel.project_dir%/apps/admin/templates': Admin
334334
335335
Then, use this Twig namespace to reference any template within the Admin
336336
application only, for example ``@Admin/form/fields.html.twig``.
@@ -345,7 +345,7 @@ default. Within its parent class, ``KernelTestCase``, there is a method called
345345
the application during tests. However, the current logic of this method doesn't
346346
include the new application ID argument, so you need to update it::
347347

348-
// applications/api/tests/ApiTestCase.php
348+
// apps/api/tests/ApiTestCase.php
349349
namespace Api\Tests;
350350

351351
use Shared\Kernel;
@@ -368,7 +368,7 @@ include the new application ID argument, so you need to update it::
368368
This examples uses a hardcoded application ID value because the tests
369369
extending this ``ApiTestCase`` class will focus solely on the ``api`` tests.
370370

371-
Now, create a ``tests/`` directory inside the ``applications/api/`` application. Then,
371+
Now, create a ``tests/`` directory inside the ``apps/api/`` application. Then,
372372
update both the ``composer.json`` file and ``phpunit.xml`` configuration about
373373
its existence:
374374

@@ -378,7 +378,7 @@ its existence:
378378
"autoload-dev": {
379379
"psr-4": {
380380
"Shared\\Tests\\": "tests/",
381-
"Api\\Tests\\": "applications/api/tests/"
381+
"Api\\Tests\\": "apps/api/tests/"
382382
}
383383
}
384384
}
@@ -394,7 +394,7 @@ And, here is the update needed for the ``phpunit.xml`` file:
394394
<directory>tests</directory>
395395
</testsuite>
396396
<testsuite name="api">
397-
<directory>applications/api/tests</directory>
397+
<directory>apps/api/tests</directory>
398398
</testsuite>
399399
</testsuites>
400400
@@ -408,7 +408,7 @@ you will have to repeat the step 1 only:
408408
.. code-block:: text
409409
410410
your-project/
411-
├─ applications/
411+
├─ apps/
412412
│ ├─ admin/
413413
│ │ ├─ config/
414414
│ │ │ ├─ bundles.php

0 commit comments

Comments
 (0)
0