summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2013-09-27 23:41:24 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-09-30 20:19:26 +0200
commit2cf26ee0b16bebe83a08e4be89681f73208ba9ae (patch)
treeb917762373122c588e53ff80ee8ece5bda261b3f /lib
parent69dd6af57489395527e94b033e3f0b8d5c73ca12 (diff)
downloadnextcloud-server-2cf26ee0b16bebe83a08e4be89681f73208ba9ae.tar.gz
nextcloud-server-2cf26ee0b16bebe83a08e4be89681f73208ba9ae.zip
put the current version and edition into a seperate file to simplify packaging. introduce update channels and build version for automated channel updates. More about that later
Conflicts: lib/ocsclient.php lib/util.php
Diffstat (limited to 'lib')
-rwxr-xr-xlib/util.php43
1 files changed, 38 insertions, 5 deletions
diff --git a/lib/util.php b/lib/util.php
index e03667b0794..5bfa7d74228 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -96,9 +96,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, 05);
+ OC_Util::loadVersion();
+ return $_SESSION['OC_Version'];
}
/**
@@ -106,7 +105,8 @@ class OC_Util {
* @return string
*/
public static function getVersionString() {
- return '6.0 pre alpha';
+ OC_Util::loadVersion();
+ return $_SESSION['OC_VersionString'];
}
/**
@@ -116,7 +116,40 @@ class OC_Util {
* @return string
*/
public static function getEditionString() {
- return '';
+ OC_Util::loadVersion();
+ return $_SESSION['OC_Edition'];
+ }
+
+ /**
+ * @description get the update channel of the current installed of ownCloud.
+ * @return string
+ */
+ public static function getChannel() {
+ OC_Util::loadVersion();
+ return $_SESSION['OC_Channel'];
+ }
+
+ /**
+ * @description get the build number of the current installed of ownCloud.
+ * @return string
+ */
+ public static function getBuild() {
+ OC_Util::loadVersion();
+ return $_SESSION['OC_Build'];
+ }
+
+ /**
+ * @description load the version.php into the session as cache
+ */
+ private static function loadVersion() {
+ if(!isset($_SESSION['OC_Version'])){
+ require('version.php');
+ $_SESSION['OC_Version']=$OC_Version;
+ $_SESSION['OC_VersionString']=$OC_VersionString;
+ $_SESSION['OC_Edition']=$OC_Edition;
+ $_SESSION['OC_Channel']=$OC_Channel;
+ $_SESSION['OC_Build']=$OC_Build;
+ }
}
/**