Forums › Forums › OroPlatform › OroPlatform – Feature Requests › PHP 7.0 compatibility
This topic contains 7 replies, has 6 voices, and was last updated by Artem Liubeznyi 7 years, 10 months ago.
Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.
- CreatorTopic
- August 13, 2015 at 5:40 am #36781
All Symfony maintained branches are now 100% compatible with PHP7
When will Oro be PHP7 ready?
- CreatorTopic
- AuthorReplies
- August 13, 2015 at 2:54 pm #36782
Thanks for the heads up, we’ll work on this shortly.
October 7, 2015 at 2:47 am #36783What is the status here. Do you have a release plan about the PHP 7 compatibility?
The PHP 7 performance is just awesome. I need this performance developing in OroCrm for my customers.October 7, 2015 at 6:46 am #36784Ok I have to admit, that I badly want Oro to work with PHP7.
I did not get the UnitTests to run, even under PHP5. So I tried to fix the one Error I get under PHP7:
Fatal error: Cannot use 'True' as class name as it is reserved in /var/www/vendor/oro/platform/src/Oro/Component/ConfigExpression/Condition/True.php on line 10
So I wrote a few bash commands, which basically rename the Class True to TrueCompatible and False to FalseCompatible with all their occurrences in the code:
cd /var/www/vendor/oro
find . -type f -exec sed -i 's/Condition\\False()/Condition\\FalseCompatible()/g' {} +
find . -type f -exec sed -i 's/Condition\\True()/Condition\\TrueCompatible()/g' {} +
find . -type f -exec sed -i 's/Condition\\False$/Condition\\FalseCompatible/g' {} +
find . -type f -exec sed -i 's/Condition\\True$/Condition\\TrueCompatible/g' {} +
mv platform/src/Oro/Component/ConfigExpression/Condition/True.php platform/src/Oro/Component/ConfigExpression/Condition/TrueCompatible.php
mv platform/src/Oro/Component/ConfigExpression/Condition/False.php platform/src/Oro/Component/ConfigExpression/Condition/FalseCompatible.php
sed -i 's/class True/class TrueCompatible/g' platform/src/Oro/Component/ConfigExpression/Condition/TrueCompatible.php
sed -i 's/class False/class FalseCompatible/g' platform/src/Oro/Component/ConfigExpression/Condition/FalseCompatible.php
After executing this and deleting the cache files, Oro works fine for me in PHP7. 25-40% faster and nearly half the memory consumption.
If you have a small Tutorial how to get the UnitTests up and running, I could make a branch with my fix and could test for complete PHP7 compatibility in Oro Platform.
October 15, 2015 at 9:37 am #36785Hi markus,
thank you very much for sharing with us your investigation results! We planned to provide compatibility with PHP7 for OroCRM till the end of the year – after PHP7 release. We also spent some time checking this compatibility on the RC1 and faced with unexpected Segmentation Fault during application run.We will be very thankful if you could provide the PR with complete PHP7 compatibility and try to process it shortly.
To run Unit Tests for the OroPlatform or the OroCRM you should do the following:
1. Clone repository platform or/and crm
2. Open root folder of the cloned project
3. run “composer require symfony/symfony:2.7.* –prefer-dist –update-no-dev”
4. run “phpunit”If you want also to run functional tests, you can check this article in or documentation: http://oroinc.com/orocrm/doc/current/book/functional-tests
March 14, 2016 at 9:06 pm #36786hi markus,
do you have finished the unit test and pull request to oro-crm github?
March 15, 2016 at 1:12 am #36787Hi Davidlin,
Some informations in this issue : https://github.com/orocrm/platform/pull/347
SYNOLIA – Lead Developer
May 17, 2016 at 6:22 am #36788Hi guys,
We have just merged PHP7 support into master branch. Please enjoy.
- AuthorReplies
The forum ‘OroPlatform – Feature Requests’ is closed to new topics and replies.