Almost no cost - most of our require/include calls are with
absolute paths, which will skip the include_path. The few
that are not absolute are usually to include PEAR libs -
so this is appropriate and avoids having to change the
PEAR libs themselves when they make references to other
PEAR libs.
Using the include path does mean that OS-installed PEAR libs
will override ours. There's a small compat risk here - if you
need to ensure a particular version, use an absolute path.
require_once($CFG->libdir .'/moodlelib.php'); // Other general-purpose functions
require_once($CFG->libdir .'/eventslib.php'); // Events functions
require_once($CFG->libdir .'/grouplib.php'); // Groups functions
-
+
+/// We use include some PEAR libs
+ ini_set("include_path", ini_get("include_path"). PATH_SEPARATOR . $CFG->libdir.'/pear');
+
/// Disable errors for now - needed for installation when debug enabled in config.php
if (isset($CFG->debug)) {
$originalconfigdebug = $CFG->debug;