From a4c371ece6b50286bcf212eadac7928e8421389e Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Wed, 27 Feb 2008 02:55:36 +0000 Subject: [PATCH] MDL-90 lib/setup: extend include_path to cover the PEAR libs we distribute 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. --- lib/setup.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/setup.php b/lib/setup.php index 88221547665..2a091f62df9 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -197,7 +197,10 @@ global $HTTPSPAGEREQUIRED; 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;