lib/setup moodelib: Introducing moodle_request_shutdown()

Now Moodle will have a 'shutdown_function' function. Right now
registered (and useful) only when running under apache + mod_php.

This initial function checks whether memory usage in this process exceeded
10MiB or $CFG->apachemaxmem (int, in bytes). This is really useful to prevent
using more RAM than we have.
This commit is contained in:
martinlanghoff
2007-04-05 05:00:23 +00:00
parent 93cc66aeae
commit bf01ed8211
2 changed files with 29 additions and 0 deletions
+4
View File
@@ -234,6 +234,10 @@ global $HTTPSPAGEREQUIRED;
$originaldatabasedebug = -1;
}
/// For now, only needed under apache (and probably unstable in other contexts)
if (function_exists('apache_child_terminate')) {
register_shutdown_function('moodle_request_shutdown');
}
//// Defining the site
if ($SITE = get_site()) {