// 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.
-/**
- * Precreates all contexts including all parents
- *
- * @deprecated since 2.2
- * @param int $contextlevel empty means all
- * @param bool $buildpaths update paths and depths
- * @return void
- */
-function create_contexts($contextlevel = null, $buildpaths = true) {
- context_helper::create_instances($contextlevel, $buildpaths);
-}
-
/**
* Remove stale context records
*
debugging('get_child_contexts() is deprecated, please use $context->get_child_contexts() instead.', DEBUG_DEVELOPER);
return $context->get_child_contexts();
}
+
+/**
+ * Precreates all contexts including all parents.
+ *
+ * @see context_helper::create_instances()
+ * @deprecated since 2.2
+ * @param int $contextlevel empty means all
+ * @param bool $buildpaths update paths and depths
+ * @return void
+ */
+function create_contexts($contextlevel = null, $buildpaths = true) {
+ debugging('create_contexts() is deprecated, please use context_helper::create_instances() instead.', DEBUG_DEVELOPER);
+ context_helper::create_instances($contextlevel, $buildpaths);
+}
$this->assertEquals($DB->count_records('context', array('depth'=>0)), 0);
$this->assertEquals($DB->count_records('context', array('path'=>NULL)), 0);
-
// ======= context_helper::cleanup_instances() ==========================
$lastcourse = $DB->get_field_sql("SELECT MAX(id) FROM {course}");
$DB->delete_records('context', array('contextlevel'=>CONTEXT_BLOCK));
create_contexts();
+ $this->assertDebuggingCalled('create_contexts() is deprecated, please use context_helper::create_instances() instead.', DEBUG_DEVELOPER);
$this->assertFalse($DB->record_exists('context', array('contextlevel'=>CONTEXT_BLOCK)));
$DB->set_field('context', 'depth', 0, array('contextlevel'=>CONTEXT_BLOCK));
* get_parent_contexts() is deprecated, please use $context->get_parent_context_ids().
* get_parent_contextid() is deprecated, please use $context->get_parent_context().
* get_child_contexts() is deprecated, please use $context->get_child_contexts().
+* create_contexts() is deprecated, please use context_helper::create_instances().
=== 2.5.1 ===