From: Michael M Slusarz Date: Mon, 16 Mar 2009 14:31:37 +0000 (-0600) Subject: Fix locally modifiable file paths. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=4928211fda53c155015b8e398166a34e6ab5590e;p=horde.git Fix locally modifiable file paths. --- diff --git a/chora/test.php b/chora/test.php index 435efab47..4f6844f36 100644 --- a/chora/test.php +++ b/chora/test.php @@ -9,7 +9,13 @@ */ /* Include Horde's core.php file. */ -include_once '../lib/core.php'; +$filedir = dirname(__FILE__); +if (file_exists($filedir . '/lib/base.local.php')) { + include_once $filedir . '/lib/base.local.php'; +} elseif (!defined('HORDE_BASE')) { + define('HORDE_BASE', $filedir . '/..'); +} +include_once HORDE_BASE . '/lib/core.php'; /* We should have loaded the String class, from the Horde_Util package, in core.php. If String:: isn't defined, then we're not @@ -20,16 +26,16 @@ if (!class_exists('String')) { } /* Initialize the Horde_Test:: class. */ -if (!is_readable('../lib/Test.php')) { +if (!is_readable(HORDE_BASE . '/lib/Test.php')) { echo 'ERROR: You must install Horde before running this script.'; exit; } -require_once '../lib/Test.php'; +require_once HORDE_BASE . '/lib/Test.php'; $horde_test = new Horde_Test; /* Chora version. */ $module = 'Chora'; -require_once './lib/version.php'; +require_once $filedir . '/lib/version.php'; $module_version = CHORA_VERSION; /* Chora configuration files. */ diff --git a/imp/test.php b/imp/test.php index 14e7d3598..0722901ae 100644 --- a/imp/test.php +++ b/imp/test.php @@ -15,7 +15,6 @@ function _doConnectionTest() { - require_once 'Horde/Imap/Client.php'; $imap_config = array( 'username' => isset($_POST['user']) ? $_POST['user'] : '', 'password' => isset($_POST['passwd']) ? $_POST['passwd'] : '', @@ -93,7 +92,13 @@ function _errorMsg($e) /* Include Horde's core.php file. */ -include_once '../lib/core.php'; +$filedir = dirname(__FILE__); +if (file_exists($filedir . '/lib/base.local.php')) { + include_once $filedir . '/lib/base.local.php'; +} elseif (!defined('HORDE_BASE')) { + define('HORDE_BASE', $filedir . '/..'); +} +include_once HORDE_BASE . '/lib/core.php'; /* We should have loaded the String class, from the Horde_Util * package, in core.php. If String:: isn't defined, then we're not @@ -104,16 +109,17 @@ if (!class_exists('String')) { } /* Initialize the Horde_Test:: class. */ -if (!is_readable('../lib/Test.php')) { +if (!is_readable(HORDE_BASE . '/lib/Test.php')) { echo 'ERROR: You must install Horde before running this script.'; exit; } -require_once '../lib/Test.php'; + +require_once HORDE_BASE . '/lib/Test.php'; $horde_test = new Horde_Test; /* IMP version. */ $module = 'IMP'; -require_once './lib/version.php'; +require_once $filedir .'/lib/version.php'; $module_version = IMP_VERSION; require TEST_TEMPLATES . 'header.inc'; diff --git a/ingo/test.php b/ingo/test.php index ab9b63788..25f7aa2c4 100644 --- a/ingo/test.php +++ b/ingo/test.php @@ -12,7 +12,13 @@ */ /* Include Horde's core.php file. */ -include_once '../lib/core.php'; +$filedir = dirname(__FILE__); +if (file_exists($filedir . '/lib/base.local.php')) { + include_once $filedir . '/lib/base.local.php'; +} elseif (!defined('HORDE_BASE')) { + define('HORDE_BASE', $filedir . '/..'); +} +include_once HORDE_BASE . '/lib/core.php'; /* We should have loaded the String class, from the Horde_Util * package, in core.php. If String:: isn't defined, then we're not @@ -23,16 +29,16 @@ if (!class_exists('String')) { } /* Initialize the Horde_Test:: class. */ -if (!is_readable('../lib/Test.php')) { +if (!is_readable(HORDE_BASE . '/lib/Test.php')) { echo 'ERROR: You must install Horde before running this script.'; exit; } -require_once '../lib/Test.php'; +require_once HORDE_BASE . '/lib/Test.php'; $horde_test = new Horde_Test; /* Ingo version. */ $module = 'Ingo'; -require_once './lib/version.php'; +require_once $filedir . '/lib/version.php'; $module_version = INGO_VERSION; require TEST_TEMPLATES . 'header.inc'; diff --git a/kronolith/test.php b/kronolith/test.php index 91eabda3e..62c79b882 100644 --- a/kronolith/test.php +++ b/kronolith/test.php @@ -1,6 +1,12 @@