]> git.mjollnir.org Git - moodle.git/commit
course/lib: Cache get_categories() using a static variable (MDL-11938)
authorfmarier <fmarier>
Mon, 17 Dec 2007 04:49:27 +0000 (04:49 +0000)
committerfmarier <fmarier>
Mon, 17 Dec 2007 04:49:27 +0000 (04:49 +0000)
commit9bb19e5827f1ff3bc7c80a2072e052b13fd62d88
tree398c0bcc0bef2488072442da1c31173277e6e957
parent2efa773446c963031f7346e2edd7e4e9871d00f4
course/lib: Cache get_categories() using a static variable (MDL-11938)
Some recursive functions call get_categories() repeatedly to get all of the
child categories of the current one.

This commit create a lazily-initialized cache of all of the categories so
that the database is only queried once to retrieve all of the categories.

It speeds up the both the homepage and the course edit page (where the
categories are displayed in combo boxes).
course/lib.php