From: Michael M Slusarz Date: Thu, 30 Jul 2009 01:42:42 +0000 (-0600) Subject: Use Horde_Registry::getVersion() X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=1711e521d98b5548a899a161573cc2cee4433e32;p=horde.git Use Horde_Registry::getVersion() --- diff --git a/folks/lib/Folks.php b/folks/lib/Folks.php index a6c202a9b..d7d2d7bb9 100644 --- a/folks/lib/Folks.php +++ b/folks/lib/Folks.php @@ -237,8 +237,7 @@ class Folks { { $mail = new Horde_Mime_Mail($subject, $body, $to, $GLOBALS['conf']['support'], Horde_Nls::getCharset()); - require_once FOLKS_BASE . '/lib/version.php'; - $mail->addHeader('User-Agent', 'Folks ' . FOLKS_VERSION); + $mail->addHeader('User-Agent', 'Folks ' . $GLOBALS['registry']->getVersion()); $mail->addHeader('X-Originating-IP', $_SERVER['REMOTE_ADDR']); $mail->addHeader('X-Remote-Browser', $_SERVER['HTTP_USER_AGENT']); diff --git a/folks/lib/Notification/mail.php b/folks/lib/Notification/mail.php index fbfa5720d..20b9f7fe5 100644 --- a/folks/lib/Notification/mail.php +++ b/folks/lib/Notification/mail.php @@ -55,13 +55,12 @@ class Folks_Notification_mail extends Folks_Notification { } list($mail_driver, $mail_params) = Horde::getMailerConfig(); - require_once FOLKS_BASE . '/lib/version.php'; $mail = new Horde_Mime_Mail($subject, $body, null, $this->_params['from_addr'], Horde_Nls::getCharset()); - $mail->addHeader('User-Agent', 'Folks ' . FOLKS_VERSION); + $mail->addHeader('User-Agent', 'Folks ' . $GLOBALS['registry']->getVersion()); $mail->addHeader('X-Originating-IP', $_SERVER['REMOTE_ADDR']); $mail->addHeader('X-Remote-Browser', $_SERVER['HTTP_USER_AGENT']); diff --git a/folks/scripts/mail.php b/folks/scripts/mail.php index 9267ca70e..ae4894d60 100644 --- a/folks/scripts/mail.php +++ b/folks/scripts/mail.php @@ -29,7 +29,6 @@ $cli = Horde_Cli::singleton(); $folks_authentication = 'none'; $no_compress = true; require_once dirname(__FILE__) . '/../lib/base.php'; -require_once FOLKS_BASE . '/lib/version.php'; // We accept the user name on the command-line. $ret = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), 'h:u:p:dt:f:c:', @@ -125,7 +124,7 @@ while ($row =& $res->fetchRow()) { // Send mail $mail = new MIME_Mail($subject, $body2, $row[1], $conf['support'], Horde_Nls::getCharset()); - $mail->addHeader('User-Agent', 'Folks' . FOLKS_VERSION); + $mail->addHeader('User-Agent', 'Folks' . $registry->getVersion()); $sent = $mail->send($conf['mailer']['type'], $conf['mailer']['params']); if ($sent instanceof PEAR_Error) { $cli->message($sent, 'cli.warning'); diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index b144490a1..96411ca6b 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -485,8 +485,7 @@ class IMP_Compose /* Add the 'User-Agent' header. */ if (empty($opts['useragent'])) { - require_once IMP_BASE . '/lib/version.php'; - $headers->setUserAgent('Internet Messaging Program (IMP) ' . IMP_VERSION); + $headers->setUserAgent('Internet Messaging Program (IMP) ' . $GLOBALS['registry']->getVersion()); } else { $headers->setUserAgent($opts['useragent']); } diff --git a/imp/lib/Message.php b/imp/lib/Message.php index 1c5423041..a1c0d4caf 100644 --- a/imp/lib/Message.php +++ b/imp/lib/Message.php @@ -332,8 +332,6 @@ class IMP_Message return false; } - require_once IMP_BASE . '/lib/version.php'; - foreach ($msgList as $folder => $msgIndices) { foreach ($msgIndices as $index) { /* Fetch the message contents. */ @@ -365,7 +363,7 @@ class IMP_Message /* Create a new iCalendar. */ $vCal = new Horde_iCalendar(); - $vCal->setAttribute('PRODID', '-//The Horde Project//IMP ' . IMP_VERSION . '//EN'); + $vCal->setAttribute('PRODID', '-//The Horde Project//IMP ' . $GLOBALS['registry']->getVersion() . '//EN'); $vCal->setAttribute('METHOD', 'PUBLISH'); switch ($type) { diff --git a/kronolith/feed/index.php b/kronolith/feed/index.php index d76941f33..f3ccd488b 100644 --- a/kronolith/feed/index.php +++ b/kronolith/feed/index.php @@ -24,7 +24,6 @@ function _no_access($status, $reason, $body) $kronolith_authentication = 'none'; $kronolith_session_control = 'readonly'; require_once dirname(__FILE__) . '/../lib/base.php'; -require_once KRONOLITH_BASE . '/lib/version.php'; require_once 'Horde/Identity.php'; $calendar = Horde_Util::getFormData('c'); @@ -95,7 +94,7 @@ $template = new Horde_Template(); $template->set('charset', Horde_Nls::getCharset()); $template->set('updated', $now->format(DATE_ATOM)); $template->set('kronolith_name', 'Kronolith'); -$template->set('kronolith_version', KRONOLITH_VERSION); +$template->set('kronolith_version', $registry->getVersion()); $template->set('kronolith_uri', 'http://www.horde.org/kronolith/'); $template->set('kronolith_icon', Horde::url($registry->getImageDir() . '/kronolith.png', true, -1)); $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl'); diff --git a/kronolith/lib/FreeBusy.php b/kronolith/lib/FreeBusy.php index 94bf3f532..925640edb 100644 --- a/kronolith/lib/FreeBusy.php +++ b/kronolith/lib/FreeBusy.php @@ -26,7 +26,6 @@ class Kronolith_FreeBusy { global $kronolith_shares; require_once 'Horde/Identity.php'; - require_once KRONOLITH_BASE . '/lib/version.php'; if (!is_array($calendar)) { $calendar = array($calendar); @@ -66,8 +65,7 @@ class Kronolith_FreeBusy { /* Create the new iCalendar. */ $vCal = new Horde_iCalendar(); - $vCal->setAttribute('PRODID', '-//The Horde Project//Kronolith ' - . KRONOLITH_VERSION . '//EN'); + $vCal->setAttribute('PRODID', '-//The Horde Project//Kronolith ' . $GLOBALS['registry']->getVersion() . '//EN'); $vCal->setAttribute('METHOD', 'PUBLISH'); /* Create new vFreebusy. */ diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index ec64b4204..052d9e123 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -1309,10 +1309,7 @@ class Kronolith $recipient = empty($status['name']) ? $email : Horde_Mime_Address::trimAddress($status['name'] . ' <' . $email . '>'); $mail = new Horde_Mime_Mail($subject, $message, $recipient, $from, Horde_Nls::getCharset()); - require_once KRONOLITH_BASE . '/lib/version.php'; - try { - $mail->addHeader('User-Agent', 'Kronolith ' . KRONOLITH_VERSION); - } catch (Horde_Mime_Exception $e) {} + $mail->addHeader('User-Agent', 'Kronolith ' . $GLOBALS['registry']->getVersion()); $mail->addMimePart($ics); try { diff --git a/nag/data.php b/nag/data.php index fb81cd63c..50dd74367 100644 --- a/nag/data.php +++ b/nag/data.php @@ -116,11 +116,10 @@ case 'export': exit; case Horde_Data::EXPORT_ICALENDAR: - require_once NAG_BASE . '/lib/version.php'; $iCal = new Horde_iCalendar(); $iCal->setAttribute( 'PRODID', - '-//The Horde Project//Nag ' . NAG_VERSION . '//EN'); + '-//The Horde Project//Nag ' . $registry->getVersion() . '//EN'); while ($task = $tasks->each()) { $iCal->addComponent($task->toiCalendar($iCal)); } diff --git a/nag/lib/Nag.php b/nag/lib/Nag.php index 66fa2cebf..6360f934a 100644 --- a/nag/lib/Nag.php +++ b/nag/lib/Nag.php @@ -817,8 +817,7 @@ class Nag list($mail_driver, $mail_params) = Horde::getMailerConfig(); $mail = new Horde_Mime_Mail(); - require_once NAG_BASE . '/lib/version.php'; - $mail->addHeader('User-Agent', 'Nag ' . NAG_VERSION); + $mail->addHeader('User-Agent', 'Nag ' . $GLOBALS['registry']->getVersion()); $mail->addHeader('Precedence', 'bulk'); $mail->addHeader('Auto-Submitted', 'auto-generated'); $mail->addHeader('From', $from); diff --git a/nag/lib/api.php b/nag/lib/api.php index 5d3035dd6..8bfb04c42 100644 --- a/nag/lib/api.php +++ b/nag/lib/api.php @@ -1122,11 +1122,9 @@ function _nag_export($uid, $contentType) case 'text/x-vcalendar': $version = '1.0'; case 'text/calendar': - require_once dirname(__FILE__) . '/version.php'; - // Create the new iCalendar container. $iCal = new Horde_iCalendar($version); - $iCal->setAttribute('PRODID', '-//The Horde Project//Nag ' . NAG_VERSION . '//EN'); + $iCal->setAttribute('PRODID', '-//The Horde Project//Nag ' . $GLOBALS['registry']->getVersion() . '//EN'); $iCal->setAttribute('METHOD', 'PUBLISH'); // Create new vTodo object.