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:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user