Add Horde_Registry::getVersion()
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 29 Jul 2009 21:48:26 +0000 (15:48 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 30 Jul 2009 01:49:36 +0000 (19:49 -0600)
framework/Core/lib/Horde/Registry.php

index 6d3f3fa..00c3fbe 100644 (file)
@@ -1032,6 +1032,24 @@ class Horde_Registry
     }
 
     /**
+     * Return the version string for a given application.
+     *
+     * @param string $app  The application to get the value for.
+     *
+     * @return string  The version string for the application.
+     */
+    public function getVersion($app = null)
+    {
+        if (is_null($app)) {
+            $app = $this->getApp();
+        }
+
+        require_once $this->get('fileroot', $app) . '/lib/version.php';
+
+        return constant(strtoupper($app) . '_VERSION');
+    }
+
+    /**
      * Function to work out an application's graphics URI, optionally taking
      * into account any themes directories that may be set up.
      *