PrestaShop Documentation, PrestaShop Tutorials

PrestaShop New version features

PrestaShop 9.0 has been upgraded to rely on Symfony 6.4. This is a significant leap from the previous version, 8.x, which was based on Symfony 4.4. As a result, version 9 includes all the breaking changes related to the Symfony Framework. For more details about these changes in the core, you can refer to the PrestaShop GitHub issue. Additionally, you can consult the Symfony migration guides (see links below).

Symfony 6.4 is the latest LTS version and will receive bug fixes until November 2026, as well as security fixes until November 2027.

Removed dependencies

We have followed Symfony’s recommendations and made changes to our dependencies. Instead of using the symfony/symfony dependency, we now manually include each sub-package. Additionally, due to the minimum PHP version requirement of 8.1, we had to upgrade or remove certain dependencies.

During this process, we took the opportunity to clean up dependencies that are no longer used in the core, regardless of whether they are from Symfony or not. If you rely on these dependencies in your modules, you will need to integrate them into your module’s dependencies.

Library nameReason for removal/Replacement
guzzlehttp/guzzleReplaced by Symfony HTTP client in the core
league/tactician-bundleReplaced by Symfony Messenger component
pear/archive_tarNo longer used
sensio/framework-extra-bundleWe now favor annotations in the core
soundasleep/html2textNo longer used
swiftmailer/swiftmailerReplaced by Symfony Mailer component in the core
symfony/inflectorNo longer used
symfony/notifierNo longer used
symfony/rate-limiterNo longer used
symfony/semaphoreNo longer used
symfony/uidNo longer used
symfony/workflowNo longer used

Mailer Migration

We have migrated from Swift Mailer to Symfony Mailer. This change includes several improvements and aligns with Symfony’s latest recommendations.

Mail SSL encryption was dropped

When we migrated from Swift Mailer to Symfony Mailer, we noticed that SSL support was not an option in ESMTP transport. SSL is an old and outdated encryption type, and for security reasons, it will no longer be allowed.

The remaining choices are “TLS encryption” or “No encryption”.

Upgraded dependencies

Some dependencies are still present but were upgraded which comes with their own breaking changes, please refer to each dependency changelog to understand them in details if you depend on these dependencies:

NameOld versionNew version
api-platform/core2.7.63.2.13
composer/installers1.12.02.2.0
friendsofsymfony/jsrouting-bundle2.8.03.2.1
lcobucci/jwt3.4.6 (special patch from https://github.com/PrestaShop/jwt.git)5.0.0 (no need for fork version anymore)
mobiledetect/mobiledetectlib2.8.413.74.0
pelago/emogrifier5.0.17.0.0
Symfony dependencies4.46.4
twig/twig3.4.33.8.0
doctrine/dbal2.13.83.6.5
doctrine/lexer1.2.32.1.1
doctrine/orm2.12.12.15.5
doctrine/deprecations0.5.31.1.3
egulias/email-validator3.2.64.0.1

Symfony controllers

In Symfony 6.4, the controllers must now be defined as services. The impact on the existing controllers is mainly around the concept of Dependency Injection and how services are injected or accessed in the controllers. The container passed to the controllers is no longer the “global container” that contains all the existing services in the application. Instead, it injects a dedicated container optimized for the controller based on the services that are injected into it.

The issue is that most of PrestaShop’s Symfony controllers do not rely on injection but instead use the $this->get('service_name') method to access any service. This is no longer possible in modern controllers because of the mentioned optimization related to container build (and the get method was even removed). To avoid a very big breaking change, we modified the PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController, so that it can fetch services from the controller’s container and from the global one, but this is a little hack that goes against Symfony recommendations, as such this base class is already deprecated and will be removed in PrestaShop 10.0.

This gives developers some time to refacto their controllers. They should now rely on the new PrestaShopBundle\Controller\Admin\PrestaShopAdminController, which doesn’t implement the mentioned hack in order to force a proper implementation of the controllers. You can read more details about Controllers as servicesService Subscribers & Locators or Service container in general.

 

About zohaibk

We develop useful addons for #E-Commerce and #CRM software to provide extra features.#PrestaShop,#Magento,#SugarCRM,#Vtiger & #Android #apps
View all posts by zohaibk →