Use Horde_Registry::getVersion()
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 30 Jul 2009 01:42:42 +0000 (19:42 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 30 Jul 2009 01:42:42 +0000 (19:42 -0600)
folks/lib/Folks.php
folks/lib/Notification/mail.php
folks/scripts/mail.php
imp/lib/Compose.php
imp/lib/Message.php
kronolith/feed/index.php
kronolith/lib/FreeBusy.php
kronolith/lib/Kronolith.php
nag/data.php
nag/lib/Nag.php
nag/lib/api.php

index a6c202a..d7d2d7b 100644 (file)
@@ -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']);
 
index fbfa572..20b9f7f 100644 (file)
@@ -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']);
 
index 9267ca7..ae4894d 100644 (file)
@@ -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');
index b144490..96411ca 100644 (file)
@@ -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']);
         }
index 1c54230..a1c0d4c 100644 (file)
@@ -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) {
index d76941f..f3ccd48 100644 (file)
@@ -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');
index 94bf3f5..925640e 100644 (file)
@@ -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. */
index ec64b42..052d9e1 100644 (file)
@@ -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 {
index fb81cd6..50dd743 100644 (file)
@@ -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));
             }
index 66fa2ce..6360f93 100644 (file)
@@ -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);
index 5d3035d..8bfb04c 100644 (file)
@@ -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.