Moodle -- Local Folder -- hookutils

Hookutils is a moodle 1.9.x library (that lives in the Moodle local folder) that provides a consistent programming pattern for customizing core Moodle code:


if override_with_error(methods[], local_folder_files[]) {

    // as little setup as possible
    method1();
    method2();

} else {

    // overriden upstream code remains harmlessly here

}

Three methods are provided: override_with_exception, override_with_error, and override_without_error.

The idea was to minimize the amount of code that needs to be rewritten every time your Moodle instance is updated.