I saw already two issues that need to retrieve list of classes in autoloaded locations, so I thought it would be very useful to have such methods in core.
This issue introduces two new static functions:
core_component::find_classes_in_plugins($plugintype, $subnamespace, $parentclass = null, $nonabstractonly = false);
|
core_component::find_classes_in_components($componenttype, $subnamespace, $parentclass = null, $nonabstractonly = false);
|
Where $plugintype has a mixed syntax and can be one of the following: 'mod'; 'mod_assign'; array('mod', 'block'); array('mod_assign','block_navigation); '*'
$componenttype can be: 'core'; 'core_course'; array('core_course', 'core_availability'); '*'
Using them core API can find plugins that implement it (as a faster and more structured alternative to callbacks). Since the list of classes in autoloaded locations is already cached, such call will be very fast even across multiple or all plugin and component types.
Also as part of this issue the directory scanning in report_eventlist is replaced with those functions.
- blocks
-
MDL-45758 [Epic] Create an Event Monitor tool
- Closed
-
MDL-46109 Event monitor: Create a class to generate eventlist
- Closed
- has a non-specific relationship to
-
MDL-44637 Tool to list all events
- Closed
-
MDL-40457 Question Bank - Allow plugins to add columns to question bank view
- Closed
-
MDL-44078 Proposal: API standard in Moodle that uses autoloading (hooks)
- Closed
- has been marked as being related by
-
MDL-46214 Improve event classes deprecation
- Closed