This means, we have have to drop support for older PHP versions such as 7.x or 8.0 in future OpenCart 3.0.x.x releases.
Any thoughts on this? What do you think? How should we proceed?
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
It sounds to me like dropping support for older PHP versions is the way to go.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
I was experimenting with this twig version, told composer.json to use "twig/twig": "^3.11", for some unknown reason, it picked up twig/twig 3.19.0. I ran the composer under PHP 8.4, may try it again under PHP 7.4, if we still want support for PHP 7.4. Other packages like scssphp/scssphp or cardinity/cardinity-sdk-php will likely require newer versions, too, to satisfy PHP 8.4 demands.ADD Creative wrote: ↑Sun Jun 22, 2025 11:55 pmCould upgrade Twig to 3.11.3. There is a 3.11.x on GitHub branch that suggests it supports PHP 7.4 to 8.4 and also the latest security patches.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Got an urgent question that’s keeping you up at night? There might just be a magical inbox ready to help: khnaz35@gmail.com
Enjoy nature
Not sure if others agree, but a major PHP requirement that is implemented on a minor point release seems confusing to me.
On Jonathan's point - I agree. Please could you consider 3.1.0.0 or 3.0.5.0 if you decide to drop php7.4 support
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
^3.11 would assume semantic versioning where only a change in the major number would indicate an incompatibility. So that would give any version < 4.0. ~3.11.3 or 3.11.* should work.JNeuhoff wrote: ↑Mon Jun 23, 2025 8:44 pmI was experimenting with this twig version, told composer.json to use "twig/twig": "^3.11", for some unknown reason, it picked up twig/twig 3.19.0. I ran the composer under PHP 8.4, may try it again under PHP 7.4, if we still want support for PHP 7.4. Other packages like scssphp/scssphp or cardinity/cardinity-sdk-php will likely require newer versions, too, to satisfy PHP 8.4 demands.ADD Creative wrote: ↑Sun Jun 22, 2025 11:55 pmCould upgrade Twig to 3.11.3. There is a 3.11.x on GitHub branch that suggests it supports PHP 7.4 to 8.4 and also the latest security patches.
scssphp/scssphp will be an issue The same version 2.0 added support for PHP 8.4 at the same time as dropping support for PHP 8.0 and lower. See https://github.com/scssphp/scssphp/issues/773.
Agree with you.Johnathan wrote: ↑Mon Jun 23, 2025 9:52 pmIf you do switch it to require later PHP 8 versions, I would suggest making it OpenCart 3.0.5.0 or 3.1.0.0 instead. That way you could say "use OpenCart 3.0.4.1 if you're using PHP 7 to 8.1, or OpenCart 3.0.5.0/3.1.0.0 for PHP 8.2 or later".
Not sure if others agree, but a major PHP requirement that is implemented on a minor point release seems confusing to me.
3.0.5.0 or 3.1.0.0 indicates a major update (which it is if we drop support for older versions php 8.x) and will make it clear to all users.
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
Yep also agreed. Dropping support for PHP 7 is a biggie and so it needs a big-ish version number jump.OSWorX wrote: ↑Tue Jun 24, 2025 4:41 pmAgree with you.Johnathan wrote: ↑Mon Jun 23, 2025 9:52 pmIf you do switch it to require later PHP 8 versions, I would suggest making it OpenCart 3.0.5.0 or 3.1.0.0 instead. That way you could say "use OpenCart 3.0.4.1 if you're using PHP 7 to 8.1, or OpenCart 3.0.5.0/3.1.0.0 for PHP 8.2 or later".
Not sure if others agree, but a major PHP requirement that is implemented on a minor point release seems confusing to me.
3.0.5.0 or 3.1.0.0 indicates a major update (which it is if we drop support for older versions php 8.x) and will make it clear to all users.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
I have tested some upgraded composer.json settings with later versions for the required packages, and so far this one seems to be the best one:
Code: Select all
{
"name": "opencart/opencart",
"type": "project",
"description": "OpenCart",
"keywords": ["opencart", "ecommerce", "framework", "opensource"],
"homepage": "http://www.opencart.com",
"license": "GPL-3.0+",
"config": {
"vendor-dir": "./upload/system/storage/vendor/"
},
"require": {
"braintree/braintree_php" : "3.40.0",
"cardinity/cardinity-sdk-php": "^v3.3.5",
"divido/divido-php": ">=1.15",
"php": ">=8.0",
"scssphp/scssphp": "^2.0",
"zoujingli/wechat-developer": "^1.2",
"twig/twig": "^3.0",
"zoujingli/wechat-php-sdk": "^1.3"
},
"autoload-dev": {
"psr-4": {
"Tools\\PHPStan\\": "tools/phpstan/"
}
}
}
Can someone else please do a quick test for the updated system/storage/vendor please?
Attachments
updated vendor folder
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Yes, you are right.ADD Creative wrote: ↑Wed Jun 25, 2025 12:11 amdivido/divido-php should be removed as the payment extension was removed in 3.0.4.0.
I also noticed when using the latest twig/twig package, one of packages used by it, namely the symfony/filesystem, requires PHP 8.2 or later, and won't work with PHP 8.1 or earlier, whereas twig/twig or any of the other packages would have been just fine with PHP 8.1 onwards. So it looks like support for PHP 8.1 or earlier will have to be dropped, and the minimum PHP version for next OC 3.0.5.0 will have to be 8.2, or later.
So we are looking at these supported PHP versions:
OpenCart 3.0.3.8 or 3.0.3.9: PHP 7.3 (possibly earlier ones which I haven't tested), 7.4
OpenCart 3.0.4.0 or 3.0.4.1: PHP 7.4, 8.0, 8.1, 8.2, 8.3
OpenCart 3.0.5.0: PHP 8.2, 8.3, 8.4
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
symfony/filesystem 6.4 still supports PHP 8.1 and is still maintained. It's a requirement of scssphp/scssphp which allows "^5.4 || ^6.0 || ^7.0", so should be no issue supporting PHP 8.1.JNeuhoff wrote: ↑Wed Jun 25, 2025 5:01 amI also noticed when using the latest twig/twig package, one of packages used by it, namely the symfony/filesystem, requires PHP 8.2 or later, and won't work with PHP 8.1 or earlier, whereas twig/twig or any of the other packages would have been just fine with PHP 8.1 onwards. So it looks like support for PHP 8.1 or earlier will have to be dropped, and the minimum PHP version for next OC 3.0.5.0 will have to be 8.2, or later.
So we are looking at these supported PHP versions:
OpenCart 3.0.3.8 or 3.0.3.9: PHP 7.3 (possibly earlier ones which I haven't tested), 7.4
OpenCart 3.0.4.0 or 3.0.4.1: PHP 7.4, 8.0, 8.1, 8.2, 8.3
OpenCart 3.0.5.0: PHP 8.2, 8.3, 8.4
The bigger issue is with symfony/validator it's a requirement of cardinity/cardinity-sdk-php (4.0||^5.4.43||^7.1.4), why it doesn't allow 6.x is strange and a bit of a pain. So it will need version 5.4.x, which is not maintained, but I do believe it will still get security patches as it's part of Symfony.
Also I don't think it's wise upgrading the cardinity/cardinity-sdk-php without testing the major version change doesn't break the Cardinity payment extension. If Cardinity aren't maintaining it, it may be best just to remove it as it seems to be the cause of most of the Composer issues. Or just leave the old SDK and dependencies the same as done with Braintree and Wechat.
Your would also want to use "twig/twig": "^3.11.3" instead of "twig/twig": "^3.0" to ensure it will have the latest security patches.
I just tested the "scssphp/scssphp": "^1.13" and it gets loads of deprecation messages when running under PHP 8.4. Hence we'll have to use "scssphp/scssphp":"^2.0.1", which is fine for PHP 8.4, but grabs a package ""symfony/filesystem" version "v7.3.0" which requires PHP 8.2 or later.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
What version of PHP are you running composer on? You need to use the lowest version of PHP when updating. Using PHP 8.1 pulls v6.4.13 of symfony/filesystem.JNeuhoff wrote: ↑Wed Jun 25, 2025 8:30 pmI just tested the "scssphp/scssphp": "^1.13" and it gets loads of deprecation messages when running under PHP 8.4. Hence we'll have to use "scssphp/scssphp":"^2.0.1", which is fine for PHP 8.4, but grabs a package ""symfony/filesystem" version "v7.3.0" which requires PHP 8.2 or later.
Or maybe able to use "platform" to set PHP 8.1 as the base.
https://getcomposer.org/doc/06-config.md#platform
I was running composer on PHP 8.4. I'll try again with PHP 8.1.ADD Creative wrote: ↑Thu Jun 26, 2025 12:09 amWhat version of PHP are you running composer on? You need to use the lowest version of PHP when updating. Using PHP 8.1 pulls v6.4.13 of symfony/filesystem.
Or maybe able to use "platform" to set PHP 8.1 as the base.
https://getcomposer.org/doc/06-config.md#platform
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Users browsing this forum: Baidu [Spider], lockiedownunder and 46 guests