OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Author
    Replies
  • #36782

    Dima Soroka
    Keymaster

    Thanks for the heads up, we’ll work on this shortly.

    #36783

    What 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.

    #36784

    Ok 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.

    #36785

    Ivan Klymenko
    Spectator

    Hi 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

    #36786

    davidlin
    Participant

    hi markus,

    do you have finished the unit test and pull request to oro-crm github?

    #36787

    Julien VINAI
    Participant

    Hi Davidlin,

    Some informations in this issue : https://github.com/orocrm/platform/pull/347


    SYNOLIA – Lead Developer

    #36788

    Artem Liubeznyi
    Spectator

    Hi guys,

    We have just merged PHP7 support into master branch. Please enjoy.

Viewing 7 replies - 1 through 7 (of 7 total)

The forum ‘OroPlatform – Feature Requests’ is closed to new topics and replies.

Back to top