Move *_BASE determination to base.load.php.
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 9 Jun 2009 19:21:29 +0000 (13:21 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 9 Jun 2009 19:54:10 +0000 (13:54 -0600)
32 files changed:
chora/index.php
chora/lib/base.load.php [new file with mode: 0644]
chora/test.php
imp/ajax.php
imp/cache.php
imp/index.php
imp/lib/base.load.php [new file with mode: 0644]
imp/lib/base.php
imp/test.php
ingo/index.php
ingo/lib/base.load.php [new file with mode: 0644]
ingo/lib/base.php
ingo/test.php
kronolith/add.php
kronolith/ajax.php
kronolith/attend.php
kronolith/attendees.php
kronolith/contacts.php
kronolith/data.php
kronolith/delete.php
kronolith/edit.php
kronolith/event.php
kronolith/fb.php
kronolith/imple.php
kronolith/index.php
kronolith/lib/base.load.php [new file with mode: 0644]
kronolith/lib/base.php
kronolith/new.php
kronolith/perms.php
kronolith/pref_api.php
kronolith/search.php
kronolith/test.php

index 05362c2..5ccfb14 100644 (file)
@@ -9,15 +9,14 @@
  * @package Chora
  */
 
-define('CHORA_BASE', dirname(__FILE__));
+require_once dirname(__FILE__) . '/lib/base.load.php';
 $chora_configured = (is_readable(CHORA_BASE . '/config/conf.php') &&
                      is_readable(CHORA_BASE . '/config/sourceroots.php') &&
                      is_readable(CHORA_BASE . '/config/mime_drivers.php') &&
                      is_readable(CHORA_BASE . '/config/prefs.php'));
 
 if (!$chora_configured) {
-    /* Chora isn't configured. */
-    require CHORA_BASE . '/../lib/Test.php';
+    require HORDE_BASE . '/lib/Test.php';
     Horde_Test::configFilesMissing('Chora', CHORA_BASE,
         array('conf.php', 'prefs.php', 'mime_drivers.php'),
         array('sourceroots.php' => 'This file defines all of the source repositories that you wish Chora to display.'));
diff --git a/chora/lib/base.load.php b/chora/lib/base.load.php
new file mode 100644 (file)
index 0000000..a763fd5
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Script to determine the correct *_BASE values.
+ *
+ * Copyright 2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @package Chora
+ */
+
+$curr_dir = dirname(__FILE__);
+
+if (!defined('HORDE_BASE')) {
+    /* Temporary fix - if horde does not live directly under the app
+     * directory, the HORDE_BASE constant should be defined in
+     * lib/base.local.php. */
+    if (file_exists($curr_dir . '/base.local.php')) {
+        include $curr_dir . '/base.local.php';
+    } else {
+        define('HORDE_BASE', $curr_dir . '/../..');
+    }
+}
+
+if (!defined('CHORA_BASE')) {
+    define('CHORA_BASE', $curr_dir . '/..');
+}
index 4f6844f..fcac2cc 100644 (file)
@@ -9,12 +9,7 @@
  */
 
 /* Include Horde's core.php file. */
-$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 . '/..');
-}
+require_once dirname(__FILE__) . '/lib/base.load.php';
 include_once HORDE_BASE . '/lib/core.php';
 
 /* We should have loaded the String class, from the Horde_Util
@@ -35,7 +30,7 @@ $horde_test = new Horde_Test;
 
 /* Chora version. */
 $module = 'Chora';
-require_once $filedir . '/lib/version.php';
+require_once CHORA_BASE . '/lib/version.php';
 $module_version = CHORA_VERSION;
 
 /* Chora configuration files. */
index d24f164..15687bb 100644 (file)
@@ -140,17 +140,7 @@ function _getQuota()
 }
 
 // Need to load Util:: to give us access to Util::getPathInfo().
-$imp_dir = dirname(__FILE__);
-if (!defined('HORDE_BASE')) {
-    /* Temporary fix - if horde does not live directly under the imp
-     * directory, the HORDE_BASE constant should be defined in
-     * imp/lib/base.local.php. */
-    if (file_exists($imp_dir . '/lib/base.local.php')) {
-        include $imp_dir . '/lib/base.local.php';
-    } else {
-        define('HORDE_BASE', $imp_dir . '/..');
-    }
-}
+require_once dirname(__FILE__) . '/lib/base.load.php';
 require_once HORDE_BASE . '/lib/core.php';
 $action = basename(Util::getPathInfo());
 if (empty($action)) {
@@ -168,7 +158,7 @@ if (in_array($action, array('chunkContent', 'Html2Text', 'Text2Html', 'GetReplyD
 
 $dimp_logout = ($action == 'LogOut');
 $session_timeout = 'json';
-require_once $imp_dir . '/lib/base.php';
+require_once IMP_BASE . '/lib/base.php';
 
 // Process common request variables.
 $mbox = Util::getPost('view');
index e3700c2..4f662a6 100644 (file)
 $expire_time = 525600;
 
 /* Load IMP.php to access IMP::getPathInfo(). */
-$imp_dir = dirname(__FILE__);
-if (!defined('HORDE_BASE')) {
-    /* Temporary fix - if horde does not live directly under the imp
-     * directory, the HORDE_BASE constant should be defined in
-     * imp/lib/base.local.php. */
-    if (file_exists($imp_dir . '/lib/base.local.php')) {
-        include $imp_dir . '/lib/base.local.php';
-    } else {
-        define('HORDE_BASE', $imp_dir . '/..');
-    }
-}
+require_once dirname(__FILE__) . '/lib/base.load.php';
 require_once HORDE_BASE . '/lib/core.php';
 $path_info = trim(Util::getPathInfo(), '/');
 if (empty($path_info)) {
@@ -56,7 +46,7 @@ if ($type == 'fckeditor') {
 }
 $session_control = 'readonly';
 $session_timeout = 'none';
-require_once $imp_dir . '/lib/base.php';
+require_once IMP_BASE . '/lib/base.php';
 
 switch ($type) {
 case 'css':
index 068de14..c6ee326 100644 (file)
@@ -9,24 +9,13 @@
  * @package IMP
  */
 
-@define('IMP_BASE', dirname(__FILE__));
+require_once dirname(__FILE__) . '/lib/base.load.php';
 $imp_configured = (is_readable(IMP_BASE . '/config/conf.php') &&
                    is_readable(IMP_BASE . '/config/mime_drivers.php') &&
                    is_readable(IMP_BASE . '/config/prefs.php') &&
                    is_readable(IMP_BASE . '/config/servers.php'));
 
 if (!$imp_configured) {
-    if (!defined('HORDE_BASE')) {
-        /* Temporary fix - if horde does not live directly under the imp
-         * directory, the HORDE_BASE constant should be defined in
-         * imp/lib/base.local.php. */
-        if (file_exists(IMP_BASE . '/lib/base.local.php')) {
-            include IMP_BASE . '/lib/base.local.php';
-        } else {
-            define('HORDE_BASE', IMP_BASE . '/..');
-        }
-    }
-
     require HORDE_BASE . '/lib/Test.php';
     Horde_Test::configFilesMissing('IMP', IMP_BASE,
         array('conf.php', 'mime_drivers.php', 'prefs.php'),
diff --git a/imp/lib/base.load.php b/imp/lib/base.load.php
new file mode 100644 (file)
index 0000000..d7b1de9
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Script to determine the correct *_BASE values.
+ *
+ * Copyright 2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @package IMP
+ */
+
+$curr_dir = dirname(__FILE__);
+
+if (!defined('HORDE_BASE')) {
+    /* Temporary fix - if horde does not live directly under the app
+     * directory, the HORDE_BASE constant should be defined in
+     * lib/base.local.php. */
+    if (file_exists($curr_dir . '/base.local.php')) {
+        include $curr_dir . '/base.local.php';
+    } else {
+        define('HORDE_BASE', $curr_dir . '/../..');
+    }
+}
+
+if (!defined('IMP_BASE')) {
+    define('IMP_BASE', $curr_dir . '/..');
+}
index bdb09f4..3d12554 100644 (file)
  * @package IMP
  */
 
+// Determine BASE directories.
 $imp_dir = dirname(__FILE__);
-
-// Check for a prior definition of HORDE_BASE.
-if (!defined('HORDE_BASE')) {
-    /* Temporary fix - if horde does not live directly under the imp
-     * directory, the HORDE_BASE constant should be defined in
-     * imp/lib/base.local.php. */
-    if (file_exists($imp_dir . '/base.local.php')) {
-        include $imp_dir . '/base.local.php';
-    } else {
-        define('HORDE_BASE', $imp_dir . '/../..');
-    }
-}
-
-// Find the base file path of IMP.
-if (!defined('IMP_BASE')) {
-    define('IMP_BASE', $imp_dir . '/..');
-}
+require_once $imp_dir . '/base.load.php';
 
 // Load the Horde Framework core, and set up inclusion paths.
 require_once HORDE_BASE . '/lib/core.php';
index 0722901..8bdfff2 100644 (file)
@@ -92,12 +92,7 @@ function _errorMsg($e)
 
 
 /* Include Horde's core.php file. */
-$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 . '/..');
-}
+require_once dirname(__FILE__) . '/lib/base.load.php';
 include_once HORDE_BASE . '/lib/core.php';
 
 /* We should have loaded the String class, from the Horde_Util
@@ -119,7 +114,7 @@ $horde_test = new Horde_Test;
 
 /* IMP version. */
 $module = 'IMP';
-require_once $filedir .'/lib/version.php';
+require_once IMP_BASE .'/lib/version.php';
 $module_version = IMP_VERSION;
 
 require TEST_TEMPLATES . 'header.inc';
index 40f9ee3..02fcfca 100644 (file)
  * @author Mike Cochrane <mike@graftonhall.co.nz>
  */
 
-@define('INGO_BASE', dirname(__FILE__));
+require_once dirname(__FILE__) . '/base.load.php';
 $ingo_configured = (is_readable(INGO_BASE . '/config/conf.php') &&
                     is_readable(INGO_BASE . '/config/prefs.php') &&
                     is_readable(INGO_BASE . '/config/backends.php') &&
                     is_readable(INGO_BASE . '/config/fields.php'));
 
 if (!$ingo_configured) {
-    if (!defined('HORDE_BASE')) {
-        /* Temporary fix - if horde does not live directly under the imp
-         * directory, the HORDE_BASE constant should be defined in
-         * imp/lib/base.local.php. */
-        if (file_exists(INGO_BASE . '/lib/base.local.php')) {
-            include INGO_BASE . '/lib/base.local.php';
-        } else {
-            define('HORDE_BASE', INGO_BASE . '/..');
-        }
-    }
-
     require HORDE_BASE . '/lib/Test.php';
     Horde_Test::configFilesMissing('Ingo', INGO_BASE,
         array('conf.php', 'prefs.php', 'backends.php'),
diff --git a/ingo/lib/base.load.php b/ingo/lib/base.load.php
new file mode 100644 (file)
index 0000000..6c330a1
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Script to determine the correct *_BASE values.
+ *
+ * Copyright 2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @package Ingo
+ */
+
+$curr_dir = dirname(__FILE__);
+
+if (!defined('HORDE_BASE')) {
+    /* Temporary fix - if horde does not live directly under the app
+     * directory, the HORDE_BASE constant should be defined in
+     * lib/base.local.php. */
+    if (file_exists($curr_dir . '/base.local.php')) {
+        include $curr_dir . '/base.local.php';
+    } else {
+        define('HORDE_BASE', $curr_dir . '/../..');
+    }
+}
+
+if (!defined('INGO_BASE')) {
+    define('INGO_BASE', $curr_dir . '/..');
+}
index 7d1abd2..1325ce8 100644 (file)
  * did not receive this file, see http://www.horde.org/licenses/asl.php.
  */
 
+// Determine BASE directories.
 $ingo_dir = dirname(__FILE__);
-
-// Check for a prior definition of HORDE_BASE.
-if (!defined('HORDE_BASE')) {
-    /* Temporary fix - if horde does not live directly under the imp
-     * directory, the HORDE_BASE constant should be defined in
-     * imp/lib/base.local.php. */
-    if (file_exists($ingo_dir . '/base.local.php')) {
-        include $ingo_dir . '/base.local.php';
-    } else {
-        define('HORDE_BASE', $ingo_dir . '/../..');
-    }
-}
-
-// Find the base file path of Ingo.
-if (!defined('INGO_BASE')) {
-    define('INGO_BASE', $ingo_dir . '/..');
-}
+require_once $ingo_dir . '/base.load.php';
 
 // Load the Horde Framework core, and set up inclusion paths.
 require_once HORDE_BASE . '/lib/core.php';
index 25f7aa2..2103c64 100644 (file)
  */
 
 /* Include Horde's core.php file. */
-$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 . '/..');
-}
+require_once dirname(__FILE__) . '/lib/base.load.php';
 include_once HORDE_BASE . '/lib/core.php';
 
 /* We should have loaded the String class, from the Horde_Util
@@ -38,7 +33,7 @@ $horde_test = new Horde_Test;
 
 /* Ingo version. */
 $module = 'Ingo';
-require_once $filedir . '/lib/version.php';
+require_once INGO_BASE . '/lib/version.php';
 $module_version = INGO_VERSION;
 
 require TEST_TEMPLATES . 'header.inc';
index 0030a8a..8edc165 100644 (file)
@@ -6,8 +6,7 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-@define('KRONOLITH_BASE', dirname(__FILE__));
-require_once KRONOLITH_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
 
 if (!Util::getFormData('cancel')) {
     $targetcalendar = Util::getFormData('targetcalendar');
index 9f424cd..4feea97 100644 (file)
@@ -72,17 +72,7 @@ function saveEvent($event)
 }
 
 // Need to load Util:: to give us access to Util::getPathInfo().
-$kronolith_dir = dirname(__FILE__);
-if (!defined('HORDE_BASE')) {
-    /* Temporary fix - if horde does not live directly under the kronolith
-     * directory, the HORDE_BASE constant should be defined in
-     * kronolith/lib/base.local.php. */
-    if (file_exists($kronolith_dir . '/lib/base.local.php')) {
-        include $kronolith_dir . '/lib/base.local.php';
-    } else {
-        define('HORDE_BASE', $kronolith_dir . '/..');
-    }
-}
+require_once dirname(__FILE__) . '/base.load.php';
 require_once HORDE_BASE . '/lib/core.php';
 $action = basename(Util::getPathInfo());
 if (empty($action)) {
@@ -99,7 +89,7 @@ if (in_array($action, array())) {
 }
 
 $session_timeout = 'json';
-require_once $kronolith_dir . '/lib/base.php';
+require_once KRONOLITH_BASE . '/lib/base.php';
 
 // Process common request variables.
 $cacheid = Util::getPost('cacheid');
index 79b4bfb..4cc5d7d 100644 (file)
@@ -10,8 +10,7 @@
  */
 
 @define('AUTH_HANDLER', true);
-@define('KRONOLITH_BASE', dirname(__FILE__));
-require_once KRONOLITH_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
 
 $cal = Util::getFormData('c');
 $id = Util::getFormData('e');
index 9b8e36b..23fcb40 100644 (file)
@@ -7,8 +7,7 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-@define('KRONOLITH_BASE', dirname(__FILE__));
-require_once KRONOLITH_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
 require_once 'Horde/Identity.php';
 require_once 'Horde/Variables.php';
 
index 49dd140..78e5c6c 100644 (file)
@@ -6,8 +6,7 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-@define('KRONOLITH_BASE', dirname(__FILE__));
-require_once KRONOLITH_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
 
 if (!Auth::getAuth()) {
     Util::closeWindowJS();
index 187bdd4..46cd9d8 100644 (file)
@@ -16,8 +16,7 @@ function _cleanup()
     return Horde_Data::IMPORT_FILE;
 }
 
-@define('KRONOLITH_BASE', dirname(__FILE__));
-require_once KRONOLITH_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
 
 if (!$conf['menu']['import_export']) {
     require KRONOLITH_BASE . '/index.php';
index 1404751..753353f 100644 (file)
@@ -9,8 +9,7 @@
  * @package Kronolith
  */
 
-@define('KRONOLITH_BASE', dirname(__FILE__));
-require_once KRONOLITH_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
 
 $kronolith_driver = Kronolith::getDriver(null, Util::getFormData('calendar'));
 if ($eventID = Util::getFormData('eventID')) {
index 6868f03..2c15608 100644 (file)
@@ -35,8 +35,7 @@ function _check_max()
     return true;
 }
 
-@define('KRONOLITH_BASE', dirname(__FILE__));
-require_once KRONOLITH_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
 
 $url = Util::getFormData('url');
 $kronolith_driver = Kronolith::getDriver();
index 87601ea..5774984 100644 (file)
@@ -9,8 +9,7 @@
  * @package Kronolith
  */
 
-@define('KRONOLITH_BASE', dirname(__FILE__));
-require_once KRONOLITH_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
 
 $viewName = Util::getFormData('view', 'Event');
 $view = Kronolith::getView($viewName);
index c8ac772..9b602c1 100644 (file)
@@ -10,9 +10,8 @@
  */
 
 @define('AUTH_HANDLER', true);
-@define('KRONOLITH_BASE', dirname(__FILE__));
 $session_control = 'none';
-require_once KRONOLITH_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
 
 // We want to always generate UTF-8 iCalendar data.
 NLS::setCharset('UTF-8');
index c8bb186..b9e4ccb 100644 (file)
@@ -10,8 +10,7 @@
  * @author Michael Slusarz <slusarz@horde.org>
  */
 
-@define('KRONOLITH_BASE', dirname(__FILE__));
-require_once KRONOLITH_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
 
 $path = Util::getFormData('imple');
 if (!$path) {
index a2f0efa..e990d36 100644 (file)
@@ -6,12 +6,12 @@
  * not receive such a file, see also http://www.fsf.org/copyleft/gpl.html.
  */
 
-@define('KRONOLITH_BASE', dirname(__FILE__));
+require_once dirname(__FILE__) . '/lib/base.load.php';
 $kronolith_configured = (is_readable(KRONOLITH_BASE . '/config/conf.php') &&
                          is_readable(KRONOLITH_BASE . '/config/prefs.php'));
 
 if (!$kronolith_configured) {
-    require KRONOLITH_BASE . '/../lib/Test.php';
+    require HORDE_BASE . '/lib/Test.php';
     Horde_Test::configFilesMissing('Kronolith', KRONOLITH_BASE,
         array('conf.php', 'prefs.php'));
 }
diff --git a/kronolith/lib/base.load.php b/kronolith/lib/base.load.php
new file mode 100644 (file)
index 0000000..373081d
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Script to determine the correct *_BASE values.
+ *
+ * Copyright 2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @package Kronolith
+ */
+
+$curr_dir = dirname(__FILE__);
+
+if (!defined('HORDE_BASE')) {
+    /* Temporary fix - if horde does not live directly under the app
+     * directory, the HORDE_BASE constant should be defined in
+     * lib/base.local.php. */
+    if (file_exists($curr_dir . '/base.local.php')) {
+        include $curr_dir . '/base.local.php';
+    } else {
+        define('HORDE_BASE', $curr_dir . '/../..');
+    }
+}
+
+if (!defined('KRONOLITH_BASE')) {
+    define('KRONOLITH_BASE', $curr_dir . '/..');
+}
index 4050b6f..d12a128 100644 (file)
  * @package Kronolith
  */
 
+// Determine BASE directories.
 $kronolith_dir = dirname(__FILE__);
+require_once $kronolith_dir . '/base.load.php';
 
-// Check for a prior definition of HORDE_BASE.
-if (!defined('HORDE_BASE')) {
-    /* Temporary fix - if horde does not live directly under the imp
-     * directory, the HORDE_BASE constant should be defined in
-     * imp/lib/base.local.php. */
-    if (file_exists($kronolith_dir . '/base.local.php')) {
-        include $kronolith_dir . '/base.local.php';
-    } else {
-        define('HORDE_BASE', $kronolith_dir . '/../..');
-    }
-}
 /* Load the Horde Framework core, and set up inclusion paths. */
 require_once HORDE_BASE . '/lib/core.php';
 Horde_Autoloader::addClassPath($kronolith_dir);
@@ -51,11 +42,6 @@ if (is_a(($pushed = $registry->pushApp('kronolith', !defined('AUTH_HANDLER'))),
 $conf = &$GLOBALS['conf'];
 define('KRONOLITH_TEMPLATES', $registry->get('templates'));
 
-/* Find the base file path of Kronolith. */
-if (!defined('KRONOLITH_BASE')) {
-    define('KRONOLITH_BASE', $kronolith_dir . '/..');
-}
-
 /* Horde framework libraries. */
 require_once 'Horde/Help.php';
 
index 45b6b8d..935a6c8 100644 (file)
@@ -8,8 +8,7 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-@define('KRONOLITH_BASE', dirname(__FILE__));
-require KRONOLITH_BASE . '/lib/base.php';
+require dirname(__FILE__) . '/lib/base.php';
 
 /* Check permissions. */
 if (Kronolith::hasPermission('max_events') !== true &&
index 364d70f..2956ed9 100644 (file)
@@ -9,8 +9,7 @@
  * @author Jan Schneider <jan@horde.org>
  */
 
-@define('KRONOLITH_BASE', dirname(__FILE__));
-require_once KRONOLITH_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
 require_once 'Horde/Group.php';
 
 $shares = &Horde_Share::singleton('kronolith');
index a7a9254..3daae1c 100644 (file)
@@ -8,7 +8,7 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-@define('HORDE_BASE', dirname(dirname(__FILE__)));
+require_once dirname(__FILE__) . '/lib/base.load.php';
 require_once HORDE_BASE . '/lib/core.php';
 
 $registry = &Registry::singleton();
index 9d69873..9727a80 100644 (file)
@@ -8,8 +8,7 @@
  * @author Meilof Veeningen <meilof@gmail.com>
  */
 
-@define('KRONOLITH_BASE', dirname(__FILE__));
-require_once KRONOLITH_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/base.php';
 
 /* Get search parameters. */
 $search_mode = Util::getFormData('search_mode', 'basic');
index 62c79b8..de0ccf1 100644 (file)
@@ -1,11 +1,6 @@
 <?php
 /* Include Horde's core.php file. */
-$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 . '/..');
-}
+require_once dirname(__FILE__) . '/lib/base.load.php';
 include_once HORDE_BASE . '/lib/core.php';
 
 /* We should have loaded the String class, from the Horde_Util package, in
@@ -25,7 +20,7 @@ require_once HORDE_BASE . '/lib/Test.php';
 $horde_test = new Horde_Test;
 
 $module = 'Kronolith';
-require_once $filedir . '/lib/version.php';
+require_once KRONOLITH_DIR . '/lib/version.php';
 $module_version = KRONOLITH_VERSION;
 
 require TEST_TEMPLATES . 'header.inc';