diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-01 16:11:59 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-01 16:11:59 +0200 |
commit | e2fe71b6e7d09477298cfdba3dd6a07695c26118 (patch) | |
tree | a9bbcb7894d2902ed9965ddaf0e6ad7e893d7940 /lib/private/util.php | |
parent | 02d69762631edda67e56ff652c67dd12fef098fd (diff) | |
parent | b66e492d6e79fc1bef1fc416ab06f751e0ede6d4 (diff) | |
download | nextcloud-server-e2fe71b6e7d09477298cfdba3dd6a07695c26118.tar.gz nextcloud-server-e2fe71b6e7d09477298cfdba3dd6a07695c26118.zip |
Merge branch 'master' into lib-private-master-2
Diffstat (limited to 'lib/private/util.php')
-rwxr-xr-x | lib/private/util.php | 49 |
1 files changed, 44 insertions, 5 deletions
diff --git a/lib/private/util.php b/lib/private/util.php index 1fb867d3ac8..ea2eb98d23c 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -106,9 +106,8 @@ class OC_Util { * @return array */ public static function getVersion() { - // hint: We only can count up. Reset minor/patchlevel when - // updating major/minor version number. - return array(5, 80, 07); + OC_Util::loadVersion(); + return \OC::$server->getSession()->get('OC_Version'); } /** @@ -116,7 +115,8 @@ class OC_Util { * @return string */ public static function getVersionString() { - return '6.0 pre alpha'; + OC_Util::loadVersion(); + return \OC::$server->getSession()->get('OC_VersionString'); } /** @@ -126,7 +126,46 @@ class OC_Util { * @return string */ public static function getEditionString() { - return ''; + OC_Util::loadVersion(); + return \OC::$server->getSession()->get('OC_Edition'); + } + + /** + * @description get the update channel of the current installed of ownCloud. + * @return string + */ + public static function getChannel() { + OC_Util::loadVersion(); + return \OC::$server->getSession()->get('OC_Channel'); + } + + /** + * @description get the build number of the current installed of ownCloud. + * @return string + */ + public static function getBuild() { + OC_Util::loadVersion(); + return \OC::$server->getSession()->get('OC_Build'); + } + + /** + * @description load the version.php into the session as cache + */ + private static function loadVersion() { + if(!\OC::$server->getSession()->exists('OC_Version')) { + require 'version.php'; + $session = \OC::$server->getSession(); + /** @var $OC_Version string */ + $session->set('OC_Version', $OC_Version); + /** @var $OC_VersionString string */ + $session->set('OC_VersionString', $OC_VersionString); + /** @var $OC_Edition string */ + $session->set('OC_Edition', $OC_Edition); + /** @var $OC_Channel string */ + $session->set('OC_Channel', $OC_Channel); + /** @var $OC_Build string */ + $session->set('OC_Build', $OC_Build); + } } /** |