Skip to main content
Version: master

Moodle 4.2 developer update

This page highlights the important changes that are coming in Moodle 4.2 for developers.

External API

The external_api class, and all related classes have been moved from lib/externallib.php to namespaced classes within the core_external subsystem.

Delayed deprecation

The old class locations have been aliased for backwards compatibility and will emit a deprecation notice in a future release.

If you are writing a Moodle plugin which has a single codebase shared with older versions of Moodle, you should continue to use the old API locations at this time.

The following parts of the external API have been moved to the core_external subsystem.

Renamed External API classes

Old class nameNew class name
external_apicore_external\external_api
external_descriptioncore_external\external_description
external_filescore_external\files
external_format_valuecore_external\external_format_value
external_function_parameterscore_external\external_function_parameters
external_multiple_structurecore_external\external_multiple_structure
external_settingscore_external\external_settings
external_single_structurecore_external\external_single_structure
external_utilcore_external\util
external_valuecore_external\external_value
external_warningscore_external\external_warnings
restricted_context_exceptioncore_external\restricted_context_exception

Renamed External API functions

Old function nameNew function name
external_format_string()core_external\util::format_string()
external_format_text()core_external\util::format_text()
external_create_service_token()core_external\util::generate_token()
external_generate_token()core_external\util::generate_token()
external_generate_token_for_current_user()core_external\util::generate_token_for_current_user()
external_log_token_request()core_external\util::log_token_request()