Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-76406

Add environment check for versions not supporting PHP 8.2

XMLWordPrintable

    • MOODLE_402_STABLE
    • MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-76406-401
    • MDL-76406-master
    • Hide

      Note: Testing this issue requires, for some points, a running version of PHP 8.2.

      Note: It's better to try all the upgrades in the steps below using the CLI command:
      php admin/cli/upgrade.php

      Valid trick: If finding a working PHP 8.2 version is hard, or if using a real PHP 8.2 is still impossible because of other errors... the lib/environmentlib.php file can be edited, after every checkout, replacing the two existing calls to phpversion() by, simply: '8.2.0' (quotes included). That will cause the environment checks to think they are running that version.

      A) Using PHP 7.4.x - All upgrades work (all supported versions)

      1. Install a Moodle 3.8.x site (MOODLE_38_STABLE)
      2. Upgrade to 3.9.x (MOODLE_39_STABLE)
      3. Upgrade to 3.11.x (MOODLE_311_STABLE)
      4. Upgrade to 4.0.x (MOODLE_400_STABLE)
      5. Upgrade to 4.1.x (MOODLE_401_STABLE)
      6. Verify that all the upgrades above work without problem.

      B) Using PHP 8.2.x - Upgrades to 401 & 402 with PHP 8.2 don't work

      1. Switch to PHP 8.0 or lower (Not lower than 7.4)
      2. Install a Moodle 4.0.x site (MOODLE_400_STABLE)
        • E.g. If using MDK: "mdk create --integration --install --version 400"
      3. Switch to PHP 8.2 (or use the "Valid trick" commented above)
      4. Check out the 401 branch and try to upgrade to 4.1.x (MOODLE_401_STABLE)
      5. Verify that upgrade doesn't work and you get the "PHP version 8.2 and higher are not supported" message.
      6. Check out the 402 branch and try to upgrade to 4.2.x (MOODLE_402_STABLE)
      7. Verify that upgrade doesn't work and you get the "PHP version 8.2 and higher are not supported" message.
      8. Check out the 400 branch and try to upgrade to 4.0.x (MOODLE_400_STABLE)
      9. Verify that upgrade doesn't work and you get the "PHP version 8.1 and higher are not supported" message.
      10. Check out the master branch.
      11. Verify that the upgrade works without problem (might have errors related to dynamic properties).

      C) Confirm that environment.xml is 100% the same over all branches

      1. Verify that the following git commands return no differences (empty output)
         
        git diff MOODLE_39_STABLE master – admin/environment.xml
        git diff MOODLE_311_STABLE master – admin/environment.xml
        git diff MOODLE_400_STABLE master – admin/environment.xml
        git diff MOODLE_401_STABLE master – admin/environment.xml
        git diff MOODLE_402_STABLE master – admin/environment.xml
      Show
      Note : Testing this issue requires, for some points, a running version of PHP 8.2. Note : It's better to try all the upgrades in the steps below using the CLI command: php admin/cli/upgrade.php Valid trick : If finding a working PHP 8.2 version is hard, or if using a real PHP 8.2 is still impossible because of other errors... the lib/environmentlib.php file can be edited, after every checkout, replacing the two existing calls to phpversion() by, simply: '8.2.0' (quotes included). That will cause the environment checks to think they are running that version. A) Using PHP 7.4.x - All upgrades work (all supported versions) Install a Moodle 3.8.x site (MOODLE_38_STABLE) Upgrade to 3.9.x (MOODLE_39_STABLE) Upgrade to 3.11.x (MOODLE_311_STABLE) Upgrade to 4.0.x (MOODLE_400_STABLE) Upgrade to 4.1.x (MOODLE_401_STABLE) Verify that all the upgrades above work without problem. B) Using PHP 8.2.x - Upgrades to 401 & 402 with PHP 8.2 don't work Switch to PHP 8.0 or lower (Not lower than 7.4) Install a Moodle 4.0.x site (MOODLE_400_STABLE) E.g. If using MDK: " mdk create --integration --install --version 400 " Switch to PHP 8.2 (or use the "Valid trick" commented above) Check out the 401 branch and try to upgrade to 4.1.x (MOODLE_401_STABLE) Verify that upgrade doesn't work and you get the "PHP version 8.2 and higher are not supported" message. Check out the 402 branch and try to upgrade to 4.2.x (MOODLE_402_STABLE) Verify that upgrade doesn't work and you get the "PHP version 8.2 and higher are not supported" message. Check out the 400 branch and try to upgrade to 4.0.x (MOODLE_400_STABLE) Verify that upgrade doesn't work and you get the "PHP version 8.1 and higher are not supported" message. Check out the master branch. Verify that the upgrade works without problem (might have errors related to dynamic properties). C) Confirm that environment.xml is 100% the same over all branches Verify that the following git commands return no differences (empty output)   git diff MOODLE_39_STABLE master – admin/environment.xml git diff MOODLE_311_STABLE master – admin/environment.xml git diff MOODLE_400_STABLE master – admin/environment.xml git diff MOODLE_401_STABLE master – admin/environment.xml git diff MOODLE_402_STABLE master – admin/environment.xml
    • 6
    • Team Hedgehog 2023 Sprint 2.0, Team Hedgehog 2023 Sprint 2.1, Team Hedgehog 2023 Sprint 2.2
    • Small

      Requirement: We need the MOODLE_401_STABLE and the MOODLE_402_STABLE branch to exist to proceed with this (4.0.0 and 4.1.0 release).

      PHP 8.1 is supported from Moodle 4.1 (TBC) onwards.

      The next version of PHP is 8.2 and it's planned to be supported by Moodle 4.2 (TBC) and up.

      We should introduce a restricted PHP version check for PHP versions >= 8.0 into 3.11, for PHP versions >= 8.1 into 4.0 and for PHP versions >= 8.2 into 4.2.

      This change must be applied to ALL supported branches, including security-only ones.

      See previous MDL-73017 as a reference for this and the behaviour in previous branches.

      Usual changes to perform to Moodle Docs include (updated to the new PHP 8.2 information):

      • TODO: A note in the PHP Versions page about the WIP and the current status, like this.
      • TODO: (docs_required) Whenever the new version release notes is available, something like this.

        1. php74_311_to_400.png
          php74_311_to_400.png
          22 kB
        2. php74_38_to_39.png
          php74_38_to_39.png
          25 kB
        3. php74_39_to_311.png
          php74_39_to_311.png
          24 kB
        4. php74_400_to_401.png
          php74_400_to_401.png
          22 kB
        5. php82_400_to_401_error.png
          php82_400_to_401_error.png
          57 kB
        6. php82_400_to_402_error.png
          php82_400_to_402_error.png
          56 kB
        7. php82_400_to_master.png
          php82_400_to_master.png
          84 kB
        8. (A) Passed -- MDL-76406.png
          (A) Passed -- MDL-76406.png
          177 kB
        9. (B) Passed -- MDL-76406.png
          (B) Passed -- MDL-76406.png
          27 kB
        10. (C) Passed -- MDL-76406.png
          (C) Passed -- MDL-76406.png
          120 kB

            safat.shahin@moodle.com Safat Shahin
            dobedobedoh Andrew Lyons
            David Woloszyn David Woloszyn
            Andrew Lyons Andrew Lyons
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 6 hours, 39 minutes
                6h 39m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.