Skip to content

Commit 675619b

Browse files
committed
Explain new Symfony kernel split
1 parent 3dde398 commit 675619b

1 file changed

Lines changed: 32 additions & 8 deletions

File tree

modules/core-updates/9.0.md

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,38 @@ Some dependencies are still present but were upgraded which comes with their own
8585
- [Services translator, security.csrf.token_manager, session, session.flash_bag no longer public](https://github.com/PrestaShop/PrestaShop/pull/35069)
8686
- [Replace AdminSecurity annotation with attributes](https://github.com/PrestaShop/PrestaShop/pull/35212)
8787

88+
### Kernel modifications
89+
90+
Until PrestaShop 8.0, we relied on one Kernel used for the back office. In Symfony 9.0, we expanded the usage of the Symfony framework, especially for two new features:
91+
- the new Admin API based on API Platform and OAuth authentication
92+
- an experimental feature that gives access to a Symfony container in the front office (in opposition to the custom-built container available today). This one is not very much used yet, but it's a first stone for the future front office migration
93+
94+
Those two new environments have mechanisms and configuration different from those in the back office. To separate these configurations cleanly, they each have their dedicated kernel class and their own configuration. This allows to cleanly define different routing, security configurations, dedicated services, listeners, ...
95+
Each kernel has a unique `applicationId` that allows to dynamize its configuration and cache folder (since the services are not the same, each kernel needs its own cache folder). The `appId` parameter has also been added globally to the `bin/console` tool. They all share the common `app/config/config.yml` configuration file, but each one extends it in its own config folder.
96+
97+
| Environment | Kernel class | Config folder | Cache folder | Endpoint | Application ID |
98+
|-----------------------------|------------------|------------------------|---------------------------------------|------------------------|----------------|
99+
| Back office | `AdminKernel` | `app/config/admin` | `var/cache/{dev,prod,test}/admin` | `/admin-dev/index.php` | `admin` |
100+
| Admin API | `AdminAPIKernel` | `app/config/admin-api` | `var/cache/{dev,prod,test}/admin-api` | `/admin-api/index.php` | `admin-api` |
101+
| Front office (experimental) | `FrontKernel` | `app/config/front` | `var/cache/{dev,prod,test}/front` | `/index.php` | `front` |
102+
103+
{{% notice note %}}
104+
**Console usage**
105+
106+
Clear the cache of the Admin API for its `prod` environment
107+
108+
`php bin/console cache:clear --env=prod --app-id=admin-api`
109+
110+
Display event listeners for the back office in `dev` environment (default value of `app-id` is `admin` for retro compatibility)
111+
112+
`php bin/console debug:event-dispatcher kernel.request --env=dev`
113+
{{% /notice %}}
114+
115+
**Related PRs**
116+
117+
- [Experimental front container](https://github.com/PrestaShop/PrestaShop/pull/32719)
118+
- [Admin API has dedicated kernel, we now have three distinct configurations](https://github.com/PrestaShop/PrestaShop/pull/35515)
119+
88120
### BO login and authorization migrated to Symfony
89121

90122
The back office login page has been migrated to Symfony. Along with this change, the authorization system in the back office is now also based on Symfony, which implies several things:
@@ -119,7 +151,6 @@ if ($session) {
119151
The Symfony session has other interesting features (like flash bags for unique usage data). You can read more about its usage in the <a href="https://symfony.com/doc/6.4/session.html" target="_blank">Session documentation</a>.
120152
{{% /notice %}}
121153

122-
123154
**Removed hooks:**
124155
- `actionAdminLoginControllerBefore`
125156
- `actionAdminLoginControllerLoginBefore`
@@ -204,13 +235,6 @@ This changes the data passed to the smarty templates:
204235

205236
- [Modified LanguageInterface and LocaleInterface](https://github.com/PrestaShop/PrestaShop/pull/34500)
206237

207-
### Kernel modifications
208-
209-
@todo Explain the three new kernels and their respective folders for configurations
210-
211-
- [Experimental front container](https://github.com/PrestaShop/PrestaShop/pull/32719)
212-
- [Admin API has dedicated kernel, we now have three distinct configurations](https://github.com/PrestaShop/PrestaShop/pull/35515)
213-
214238
### Change of behaviour/rules or removed code
215239

216240
- [Customization quantity feature has been removed](https://github.com/PrestaShop/PrestaShop/pull/12422), the customization quantity is now the one from the cart_product row

0 commit comments

Comments
 (0)