From b948c1a1b642e2cf99c3e59aff785d82ddec7645 Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Sat, 28 Sep 2013 17:43:14 +0200 Subject: [PATCH 1/6] prepare the updater for the new update channels --- lib/updater.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/updater.php b/lib/updater.php index df7332a96a..9827d8a8c1 100644 --- a/lib/updater.php +++ b/lib/updater.php @@ -56,7 +56,7 @@ class Updater extends BasicEmitter { $version = \OC_Util::getVersion(); $version['installed'] = \OC_Appconfig::getValue('core', 'installedat'); $version['updated'] = \OC_Appconfig::getValue('core', 'lastupdatedat'); - $version['updatechannel'] = 'stable'; + $version['updatechannel'] = \OC_Util::getChannel(); $version['edition'] = \OC_Util::getEditionString(); $versionString = implode('x', $version); From 69dd6af57489395527e94b033e3f0b8d5c73ca12 Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Sat, 28 Sep 2013 02:15:18 +0200 Subject: [PATCH 2/6] use === Shoudn't make a difference in this case but just in case Conflicts: lib/ocsclient.php --- lib/ocsclient.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/ocsclient.php b/lib/ocsclient.php index bd0302a2a8..67966fe7cd 100644 --- a/lib/ocsclient.php +++ b/lib/ocsclient.php @@ -36,7 +36,12 @@ class OC_OCSClient{ * to set it in the config file or it will fallback to the default */ private static function getAppStoreURL() { - $url = OC_Config::getValue('appstoreurl', 'http://api.apps.owncloud.com/v1'); + if(OC_Util::getEditionString()===''){ + $default='http://api.apps.owncloud.com/v1'; + }else{ + $default=''; + } + $url = OC_Config::getValue('appstoreurl', $default); return($url); } From 2cf26ee0b16bebe83a08e4be89681f73208ba9ae Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Fri, 27 Sep 2013 23:41:24 +0200 Subject: [PATCH 3/6] 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 --- lib/util.php | 43 ++++++++++++++++++++++++++++++++++++++----- version.php | 17 +++++++++++++++++ 2 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 version.php diff --git a/lib/util.php b/lib/util.php index e03667b079..5bfa7d7422 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; + } } /** diff --git a/version.php b/version.php new file mode 100644 index 0000000000..dcdc288959 --- /dev/null +++ b/version.php @@ -0,0 +1,17 @@ + Date: Mon, 30 Sep 2013 20:28:00 +0200 Subject: [PATCH 4/6] use public api for session access from server container --- lib/util.php | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/util.php b/lib/util.php index 36969f096f..ea2eb98d23 100755 --- a/lib/util.php +++ b/lib/util.php @@ -107,7 +107,7 @@ class OC_Util { */ public static function getVersion() { OC_Util::loadVersion(); - return $_SESSION['OC_Version']; + return \OC::$server->getSession()->get('OC_Version'); } /** @@ -116,7 +116,7 @@ class OC_Util { */ public static function getVersionString() { OC_Util::loadVersion(); - return $_SESSION['OC_VersionString']; + return \OC::$server->getSession()->get('OC_VersionString'); } /** @@ -127,7 +127,7 @@ class OC_Util { */ public static function getEditionString() { OC_Util::loadVersion(); - return $_SESSION['OC_Edition']; + return \OC::$server->getSession()->get('OC_Edition'); } /** @@ -136,7 +136,7 @@ class OC_Util { */ public static function getChannel() { OC_Util::loadVersion(); - return $_SESSION['OC_Channel']; + return \OC::$server->getSession()->get('OC_Channel'); } /** @@ -145,20 +145,26 @@ class OC_Util { */ public static function getBuild() { OC_Util::loadVersion(); - return $_SESSION['OC_Build']; + return \OC::$server->getSession()->get('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; + 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); } } From bf0f3bf0da64b8b81405846169b5ee27a4289362 Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Tue, 1 Oct 2013 12:37:19 +0200 Subject: [PATCH 5/6] use a 4 digit number --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index dcdc288959..3a9cac1d38 100644 --- a/version.php +++ b/version.php @@ -1,7 +1,7 @@ Date: Tue, 1 Oct 2013 14:28:59 +0200 Subject: [PATCH 6/6] add explanation --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index 3a9cac1d38..eb2e9a4a68 100644 --- a/version.php +++ b/version.php @@ -1,6 +1,6 @@