Some upcoming changes to Silverstripe CMS!
We want to give a heads up to the Silverstripe CMS community about three substantial upcoming changes:
- adding support for PHPUnit 9 to enable official PHP 8 support
- dropping support for PHP releases that have reached end-of-life
- dropping support for Microsoft Internet Explorer in the CMS
Those changes will take effect with the Silverstripe CMS Recipe 4.10 release currently scheduled for January 2022. In the short term, developers do not need to take any specific steps. However, you may want to have discussions with your stakeholders to plan this transition.
Adding support for PHPUnit 9 to enable official PHP 8 support
Silverstripe CMS currently has “informal” support for PHP 8: you can install Silverstripe CMS in a PHP 8 environment and everything should work fine, however there’s no way to run tests on PHP 8.
A major roadblock preventing us from formally supporting PHP 8 is that the core Silverstripe CMS module tests do not support the PHP8-compatible PHPUnit 9. So from Silverstripe CMS Recipe 4.10.0 onwards, all our tests will switch to using the mainline release of PHPUnit 9.
As part of upgrading your project to PHP 8, you will also need to upgrade your project to use PHPUnit 9. Unfortunately, we will have to break semantic versioning to upgrade to PHPUnit 9 because several APIs we inherit from PHPUnit have been deprecated. The API breakage should be relatively minor and we’ll be providing upgrade guidance closer to the 4.10.0 release. We’ll also include a way for Silverstripe CMS projects to keep using the PHPUnit 5.7 fork for their own unit tests while they remain on PHP 7.
We’re currently in the process of implementing these changes and we are still working through some issues. However, we want to give all developers a heads up in advance of the next CMS release, so that you can start having a discussion with your stakeholders and plan your transition.
How will the PHPUnit support work in practice?
When writing unit tests for a Silverstripe CMS project, the primary class you are interacting with is SilverStripe\Dev\SapphireTest. SapphireTest extends PHPUnit_Framework_TestCase which has gone through several breaking changes since PHPUnit 5.7. This means it’s impossible to upgrade to PHPUnit 9 without carrying over those breaking changes.
While the breaking changes are relatively minor, we recognise that this could potentially be painful for some Silverstripe CMS projects with extensive test coverage. So we will include some bifurcated logic that will conditionally switch between the PHPUnit 5.7 and PHPUnit 9 implementation based on which version of PHPUnit is currently installed in your project.
This will allow Silverstripe CMS projects who are not ready to convert their tests to PHPUnit 9 to keep using PHPUnit 5.7 which will prevent you from running your unit tests on PHP 8 however.
Beware that this bifurcated logic is intended as a short-term solution to give you more lead time to plan your transition to PHPUnit 9. It will be completely removed from the Silverstripe CMS codebase in December 2022.
The test suites for all the supported Silverstripe CMS modules will be rewritten to be run against PHPUnit 9.
My project does not have any test coverage. How will this affect me?
The PHPUnit 9 upgrade won’t affect you at all. You can probably run PHP 8 right now if you want, or wait until we announce official support in the 4.10 CMS release.
Why not do a major CMS release?
In a perfect world, this kind of ‘breaking’ change would only be introduced in major releases.
Unfortunately, we’re not in a position right now where we could commit to doing a major release of Silverstripe CMS in January 2022.
We’re also aware that PHP 8 has been stable for almost a year now. The lack of official PHP 8 support in Silverstripe CMS is an impediment to many development teams.
In this context, we’ve concluded that it’s better to introduce some breaking API changes in a minor release and get PHP 8 support in the Silverstripe CMS 4.x release line.
Dropping support for PHP releases that have reached end-of-life
Silverstripe CMS Recipe 4.9.0 still allows installation on PHP 7.1 even though this PHP release has been end-of-life for several years. So far, Silverstripe CMS never had a formal policy on when it drops support for specific PHP releases.
Our discussions around adding PHPUnit 9 and PHP 8 support have led us to rethink this approach. We’ve concluded that our continued support for EOL PHP releases has ultimately made it more difficult for us to quickly support newer PHP releases or upgrade to the latest versions of third party dependencies.
From now on, new Silverstripe CMS Recipe minor releases will drop support for end-of-life PHP versions.
In practice, this new policy means that:
- Silverstripe CMS Recipe 4.10 will drop support for PHP 7.1 and PHP 7.2 when it's released in January 2022.
- Silverstripe CMS Recipe 4.11 will drop support for PHP 7.3 somewhere in the second or third quarter of 2022.
- The first release of Silverstripe CMS Recipe in 2023 will drop support for PHP 7 altogether.
Our hope is that this new policy will provide long term certainty to developers and allow them to plan their upgrade accordingly.
Review the PHP Supported Versions(opens in new tab) documentation to get a timeline of when specific PHP releases are scheduled to reach end-of-life.
Dropping support for Internet Explorer in the CMS
Silverstripe CMS 4.10.0 will not support any version of Microsoft Internet Explorer.
While the Silverstripe CMS UI might not allow content authors to manage content in Internet Explorer, this does not preclude Silverstripe CMS project from outputting a frontend site that is compatible with Internet Explorer.
Microsoft has announced the end-of-life for Internet Explorer 11(opens in new tab) on June 15, 2022. It has already dropped Internet Explorer support in many other products including Microsoft Teams and Microsoft 365. In this context, any development time dedicated to maintaining Internet Explorer support could be better used to improve other areas of Silverstripe CMS.
Read Phasing out CMS support for IE11(opens in new tab) on the Silverstripe CMS forum for a detailed outline of why this change is being implemented.
Latest from the blog
Did anything spark your interest?
Have you got an awesome new idea or project that you want to talk about? We're here to talk you through it.