$ rm -fr mod/forum $ php test.php || echo "Ouch, something went wrong!" ERROR: Plugin mod has forum as standard, missing in codebase. ERROR: Plugin block has search_books, search_glossaries in codebase, missing as standard. ERROR: Plugin filter has geshi, moodledocs, moodlelinks in codebase, missing as standard. ERROR: Plugin profilefield has social in codebase, missing as standard. ERROR: Plugin report has rawrecordscount in codebase, missing as standard. ERROR: Plugin local has ci, codechecker, moodlecheck in codebase, missing as standard. Ouch, something went wrong! ==== ==== ==== ==== ==== dirroot = $moodledirroot; $CFG->libdir = $CFG->dirroot . '/lib'; $CFG->admin = 'admin'; // Let's inject our fake cache. class cache { static function make() { return new self(); } function get() { } function set() { } } require('lib/classes/plugin_manager.php'); require('lib/classes/component.php'); $pm = core_plugin_manager::instance(); $pts = $pm->get_plugin_types(); $stds = []; $avas = []; $error = false; foreach ($pts as $type => $notused) { $stds[$type] = $pm::standard_plugins_list($type) ?: []; $avas[$type] = array_keys($pm->get_present_plugins($type) ?? []); if ($diff = array_diff($stds[$type], $avas[$type])) { $error = true; echo "ERROR: Plugin {$type} has " . implode(', ', $diff) . " as standard, missing in codebase.\n"; } if ($diff = array_diff($avas[$type], $stds[$type])) { $error = true; echo "ERROR: Plugin {$type} has " . implode(', ', $diff) . " in codebase, missing as standard.\n"; } } if (!$error) { echo "OK: Standard plugins and codebase plugins match.\n"; } exit((int)$error);