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

MongoDB uses get_debug_type that is not available for PHP 7.4

    XMLWordPrintable

Details

    Description

      This was detected as part of MDL-73587 (PHPCompatibility complete run against codebase).

      While installing the MongoDB PHP library with composer guarantees that the get_debug_type() function will be available via PHP 8.0 polyfill, we don't install the library via composer, but copy on PSR4-enabled dir.

      So, obviously, if that code is executed (out from PHPUnit, because PHPUnit also installs a polyfill) it will fail with PHP 7.4.

      The complete error message is:

      The function get_debug_type() is not present in PHP version 7.4 or earlier

      It has been reported upstream:

      And these are the current 2 cases in core:

      • cache/stores/mongodb/MongoDB/Exception/InvalidArgumentException.php : 60
      • cache/stores/mongodb/MongoDB/Exception/ResumeTokenException.php : 33

      We need to replace them with old code-compatible-solution (what the polyfill does, basically).

      And, maybe (apart) consider if, for 4.2 we ditch completely this store from core (MDLSITE-7106):

      • It was created only as a reference-implementation.
      • it's orders of magnitude slower than other caches (I don't think anybody in the world is using it in prod - though... I may be wrong).
      • The library is giving us problems on each version (see this, see MDL-77095 ... and many other in the tracker along the last years).
      • The php extension is a pain to build, it accounts ~ 30%-40% of the total time needed to build a PHP docker image.
      • ...

      Ciao

      Attachments

        Issue Links

          Activity

            People

              stronk7 Eloy Lafuente (stronk7)
              stronk7 Eloy Lafuente (stronk7)
              Paul Holden Paul Holden
              Andrew Lyons Andrew Lyons
              CiBoT CiBoT
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 25 minutes
                  1h 25m

                  Clockify

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