From: Michael M Slusarz Date: Thu, 15 Jan 2009 06:37:02 +0000 (-0700) Subject: Autoload IMP::, MIMP::, and DIMP::. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=868e7171c01d9c1dd355a67e4e839dd453253268;p=horde.git Autoload IMP::, MIMP::, and DIMP::. --- diff --git a/imp/ajax.php b/imp/ajax.php index a5aac3583..1e5ea5c9d 100644 --- a/imp/ajax.php +++ b/imp/ajax.php @@ -710,10 +710,7 @@ case 'SMIMEPersonal': $result->error = _("Invalid passphrase entered."); } - /* TODO - This code will eventually be moved to the API. But this function - * may be called by IMP so explicitly include DIMP.php. */ if ($_SESSION['imp']['view'] != 'dimp') { - require_once IMP_BASE . '/lib/DIMP.php'; $notify = false; } @@ -728,10 +725,6 @@ case 'Fetchmail': $result->success = 1; } - /* TODO - This code will eventually be moved to the API. But this function - * may be called by IMP so explicitly include DIMP.php. */ - require_once IMP_BASE . '/lib/DIMP.php'; - /* Don't send dimp notifications via this response since the listener * on the browser (dialog.js) doesn't know what to do with them. Instead, * notifications will be picked up via the PollFolders() call that is @@ -742,12 +735,7 @@ case 'Fetchmail': case 'FetchmailDialog': $result = IMP_Fetchmail::fetchmailDialogForm(); - - /* TODO - This code will eventually be moved to the API. But this function - * may be called by IMP so explicitly include DIMP.php. */ - require_once IMP_BASE . '/lib/DIMP.php'; $notify = false; - break; } diff --git a/imp/config/prefs.php.dist b/imp/config/prefs.php.dist index d39a17729..27f20be1f 100644 --- a/imp/config/prefs.php.dist +++ b/imp/config/prefs.php.dist @@ -4,9 +4,6 @@ */ // Make sure that constants are defined. -require_once dirname(__FILE__) . '/../lib/IMP.php'; -require_once dirname(__FILE__) . '/../lib/IMAP.php'; -require_once 'Horde/Imap/Client.php'; $is_pop3 = isset($_SESSION['imp']['protocol']) && ($_SESSION['imp']['protocol'] == 'pop'); $prefGroups['identities'] = array( diff --git a/imp/lib/base.php b/imp/lib/base.php index 99b8f882f..1d354863e 100644 --- a/imp/lib/base.php +++ b/imp/lib/base.php @@ -52,6 +52,7 @@ if (!defined('IMP_BASE')) { // Load the Horde Framework core, and set up inclusion paths. require_once HORDE_BASE . '/lib/core.php'; +Horde_Autoloader::addClassPath($imp_dir); Horde_Autoloader::addClassPattern('/^IMP_/', $imp_dir); // Registry. @@ -73,9 +74,6 @@ case 'readonly': } $registry = &Registry::singleton($s_ctrl); -// Need to explicitly load IMP.php -require_once IMP_BASE . '/lib/IMP.php'; - // We explicitly do not check application permissions for the compose // and login pages, since those are handled below and need to fall through // to IMP-specific code. @@ -211,14 +209,8 @@ $GLOBALS['imp_search'] = (isset($_SESSION['imp']) && strpos($GLOBALS['imp_mbox'] : new IMP_Search(); if ($viewmode == 'mimp') { - // Need to explicitly load MIMP.php - require_once IMP_BASE . '/lib/MIMP.php'; - // Mobile markup renderer. $debug = Util::nonInputVar('mimp_debug'); $GLOBALS['mimp_render'] = new Horde_Mobile(null, $debug); $GLOBALS['mimp_render']->set('debug', !empty($debug)); -} elseif ($viewmode == 'dimp') { - // Need to explicitly load DIMP.php - require_once IMP_BASE . '/lib/DIMP.php'; }