MDL-40402 libraries: Deprecate get_system_context()
This commit is contained in:
@@ -7225,19 +7225,6 @@ class context_block extends context {
|
||||
// before removing devs will be warned with a debugging message first,
|
||||
// then we will add error message and only after that we can remove the functions
|
||||
// completely.
|
||||
|
||||
|
||||
/**
|
||||
* Returns system context or null if can not be created yet.
|
||||
*
|
||||
* @deprecated since 2.2, use context_system::instance()
|
||||
* @param bool $cache use caching
|
||||
* @return context system context (null if context table not created yet)
|
||||
*/
|
||||
function get_system_context($cache = true) {
|
||||
return context_system::instance(0, IGNORE_MISSING, $cache);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursive function which, given a context, find all parent context ids,
|
||||
* and return the array in reverse order, i.e. parent first, then grand
|
||||
|
||||
@@ -4915,3 +4915,16 @@ function load_temp_role($context, $roleid, array $accessdata) {
|
||||
function remove_temp_roles($context, array $accessdata) {
|
||||
throw new coding_exception('remove_temp_roles() can not be used any more, please use remove_temp_course_roles()');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns system context or null if can not be created yet.
|
||||
*
|
||||
* @see context_system::instance()
|
||||
* @deprecated since 2.2, use context_system::instance()
|
||||
* @param bool $cache use caching
|
||||
* @return context system context (null if context table not created yet)
|
||||
*/
|
||||
function get_system_context($cache = true) {
|
||||
debugging('get_system_context() is deprecated, please use context_system::instance() instead.', DEBUG_DEVELOPER);
|
||||
return context_system::instance(0, IGNORE_MISSING, $cache);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ information provided here is intended especially for developers.
|
||||
* get_context_instance() is deprecated, please use use context_xxxx::instance().
|
||||
* get_context_instance_by_id() is deprecated, please use context::instance_by_id($id).
|
||||
* load_temp_role() and remove_temp_roles() can not be used any more.
|
||||
* get_system_context() is deprecated, please use context_system::instance().
|
||||
|
||||
=== 2.5.1 ===
|
||||
|
||||
|
||||
Reference in New Issue
Block a user