summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/bootstrap.php
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2013-08-16 10:11:20 +0200
committerThomas Bruederli <thomas@roundcube.net>2013-08-16 10:11:20 +0200
commitd25ad5cc877738a3c352f22fdbd7eb205703e1e3 (patch)
tree6f8970c6ec236cab27675eecdf125e043455d10b /program/lib/Roundcube/bootstrap.php
parent8d2963a4bf916d047cb0aebd825588a5e20b838f (diff)
Let the framework adjust the include_path if necessary
Diffstat (limited to 'program/lib/Roundcube/bootstrap.php')
-rw-r--r--program/lib/Roundcube/bootstrap.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/program/lib/Roundcube/bootstrap.php b/program/lib/Roundcube/bootstrap.php
index 182ea1232..3f4d2c387 100644
--- a/program/lib/Roundcube/bootstrap.php
+++ b/program/lib/Roundcube/bootstrap.php
@@ -58,7 +58,7 @@ define('RCUBE_VERSION', '1.0-git');
define('RCUBE_CHARSET', 'UTF-8');
if (!defined('RCUBE_LIB_DIR')) {
- define('RCUBE_LIB_DIR', dirname(__FILE__).'/');
+ define('RCUBE_LIB_DIR', dirname(__FILE__).DIRECTORY_SEPARATOR);
}
if (!defined('RCUBE_INSTALL_PATH')) {
@@ -83,6 +83,13 @@ if (extension_loaded('mbstring')) {
@mb_regex_encoding(RCUBE_CHARSET);
}
+// make sure the Roundcube lib directory is in the include_path
+$rcube_include_path = realpath(RCUBE_LIB_DIR . '..');
+$sep = PATH_SEPARATOR;
+if (!preg_match("!(^|$sep)$rcube_include_path($sep|\$)!", ini_get('include_path'))) {
+ set_include_path(ini_get('include_path') . PATH_SEPARATOR . $rcube_include_path);
+}
+
// Register autoloader
spl_autoload_register('rcube_autoload');