mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
cron MDL-25370 Update to use simpler api to get component directory
This commit is contained in:
parent
e4a626b983
commit
cd092eceee
1 changed files with 2 additions and 8 deletions
|
@ -481,9 +481,6 @@ function cron_run() {
|
||||||
function cron_execute_plugin_type($plugintype, $description = null) {
|
function cron_execute_plugin_type($plugintype, $description = null) {
|
||||||
global $DB;
|
global $DB;
|
||||||
|
|
||||||
// Get list of all plugin directories of this type
|
|
||||||
$allplugins = get_plugin_list($plugintype);
|
|
||||||
|
|
||||||
// Get list from plugin => function for all plugins
|
// Get list from plugin => function for all plugins
|
||||||
$plugins = get_plugin_list_with_function($plugintype, 'cron');
|
$plugins = get_plugin_list_with_function($plugintype, 'cron');
|
||||||
|
|
||||||
|
@ -500,10 +497,7 @@ function cron_execute_plugin_type($plugintype, $description = null) {
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($plugins as $component=>$cronfunction) {
|
foreach ($plugins as $component=>$cronfunction) {
|
||||||
// Get short name of plugin without frankenstyle prefix, use this to find out plugin
|
$dir = get_component_directory($component);
|
||||||
// directory from the array
|
|
||||||
$nameonly = preg_replace('~^.*?_~', '', $component);
|
|
||||||
$dir = $allplugins[$nameonly];
|
|
||||||
|
|
||||||
// Get cron period if specified in version.php, otherwise assume every cron
|
// Get cron period if specified in version.php, otherwise assume every cron
|
||||||
$cronperiod = 0;
|
$cronperiod = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue