-
Bug
-
Resolution: Fixed
-
Minor
-
4.1.1
-
MOODLE_401_STABLE
-
MOODLE_311_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
-
MDL-77097_401 -
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:
- right now: https://jira.mongodb.org/plugins/servlet/mobile#issue/PHPLIB-1075 for more info.
- some months ago: https://github.com/mongodb/mongo-php-library/issues/897
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
- Discovered while testing
-
MDL-73587 Perform a complete PHPCompatibility 8.1 execution against codebase
- Closed
- has a non-specific relationship to
-
MDLSITE-7106 Consider the removal of the mongodb cache store from core
- Closed
-
MDL-77163 Remove cachestore_mongodb from core
- Closed