]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-90 lib/setup: extend include_path to cover the PEAR libs we distribute
authormartinlanghoff <martinlanghoff>
Wed, 27 Feb 2008 02:55:36 +0000 (02:55 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 27 Feb 2008 02:55:36 +0000 (02:55 +0000)
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

index 88221547665ef406a06d416a7d0af03bd86c3ccd..2a091f62df9ef1890b3427ef9969466343185793 100644 (file)
@@ -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;