mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-53978 core: Improve cache usage when no callbacks are defined
This commit is contained in:
parent
0f59b6dd75
commit
5d86494808
1 changed files with 2 additions and 1 deletions
|
@ -7484,8 +7484,9 @@ function get_plugins_with_function($function, $file = 'lib.php', $include = true
|
||||||
// Including both although I doubt that we will find two functions definitions with the same name.
|
// Including both although I doubt that we will find two functions definitions with the same name.
|
||||||
// Clearning the filename as cache_helper::hash_key only allows a-zA-Z0-9_.
|
// Clearning the filename as cache_helper::hash_key only allows a-zA-Z0-9_.
|
||||||
$key = $function . '_' . clean_param($file, PARAM_ALPHA);
|
$key = $function . '_' . clean_param($file, PARAM_ALPHA);
|
||||||
|
$pluginfunctions = $cache->get($key);
|
||||||
|
|
||||||
if ($pluginfunctions = $cache->get($key)) {
|
if ($pluginfunctions !== false) {
|
||||||
|
|
||||||
// Checking that the files are still available.
|
// Checking that the files are still available.
|
||||||
foreach ($pluginfunctions as $plugintype => $plugins) {
|
foreach ($pluginfunctions as $plugintype => $plugins) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue