Unfortunately, the read_timeout named parameter was not recognized on some machines.
To avoid such errors, this patch removed the named parameter on a single Redis connect() and the Redis cluster.
This has been generated running the following Sniff,
part of the Moodle's CodeSniffer standard:
- PSR2.Methods.MethodDeclaration
It just ensures all the function declarations have
the correct order for:
- abstract and final.
- visibility (public, protected, private).
- static.
So, all the lines modified by this commit are function declarations
and the only changes are in the positions of those keywords.
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing
All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.
Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
* Makes it possible to safely call acquire_lock so that it throws an
exception instead of returning false if it can't get a lock (which
most existing uses assumed it already does).
* Fix some omissions from the requirelockingbeforewrite option (it
now checks on delete).
* Modinfo uses a versioned cache, so it is not necessary to delete
items, only increase the version. (Provided we keep track of
cacherev carefully...)
* all constans usable in ABORT_AFTER_CONFIG should be always defined
* MDL_PERFDB and $PERF->logwrites not used after legacy log removal
* MDL_PERF_TEST should be documented in codebase
* deprecated warnings in shutdowb manager
If a statically accelerated cache returns an empty array then the value
was still fetched from the non-static cache store.
The check of the `$result` should be strictly checked against `false`,
which is the value used if no value was found.
If a plugin attempts to do something that would lock coursemodinfo cache
during install (such as creating a course module), this currently fails
as check_lock_state is not implemented in cache_disabled. Adding the
cache_loader_with_locking interface ensures that all lock methods are
implemented.
The feature added in 4.1 to lock the modinfo cache does not work when
using Redis, because:
* The API to acquire a cache lock is confusing, and the code did not
check that it successfully acquired a lock before going on to build
the cache anyway.
* Unlike the other types of cache lock, the Redis store did not retry
the lock for a timeout period before giving up and failing.
This change fixes both points.
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
When cache is disabled but temporary in-memory caches are allowed,
these were direct instances of cachestore_static with no loader, which
meant that the get_versioned and set_versioned functions did not work.
Cache locking fails if the cache store supports multiple identifiers
(in core, the only two which do are cachestore_static and
cachestore_mongodb, so this is unlikely to cause severe problems).
The new library version should work without problems with older
php-mongodb extension versions:
- v1.15.0 (paired version, tested).
- v1.14.1 (tested)
But, in order to keep them paired, the requirements have been
raised to the extension v1.15.0. See:
https://www.mongodb.com/docs/drivers/php/#compatibility
This updates the library from v1.13.1. Fixes some php81 warnings
leading to failed/risky tests.
The new library version should work without problems with older
php-mongodb extension versions:
- v1.15.0 (paired version, tested).
- v1.14.1 (tested)
During install/upgrade, caching is disabled. This change provides a
way to temporarily enable caching (using in-memory cache storage only)
within a specific function; caches are deleted afterwards.
Adding this to two locations improves install performance quite a lot.
Caching is not enabled during the parts of plugin installation that
can vary for individual plugins (install.php/upgrade.php) as these
might be relying on its absence, for example by making direct database
changes.