From 4407b45fd3b09257ea79edba8d4f50db350f8fa9 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Fri, 27 Nov 2015 00:10:43 +0100 Subject: application: default to the "stable" branch for update checks Relates to #372 Relates to #390 Signed-off-by: VirtualTam --- index.php | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 90045d60..a1005639 100644 --- a/index.php +++ b/index.php @@ -92,7 +92,8 @@ $GLOBALS['config']['ENABLE_THUMBNAILS'] = true; $GLOBALS['config']['ENABLE_LOCALCACHE'] = true; // Update check frequency for Shaarli. 86400 seconds=24 hours -$GLOBALS['config']['UPDATECHECK_INTERVAL'] = 86400 ; +$GLOBALS['config']['UPDATECHECK_BRANCH'] = 'stable'; +$GLOBALS['config']['UPDATECHECK_INTERVAL'] = 86400; /* @@ -631,18 +632,23 @@ class pageBuilder private function initialize() { $this->tpl = new RainTPL; - $this->tpl->assign( - 'newversion', - escape( - ApplicationUtils::checkUpdate( - shaarli_version, - $GLOBALS['config']['UPDATECHECK_FILENAME'], - $GLOBALS['config']['UPDATECHECK_INTERVAL'], - $GLOBALS['config']['ENABLE_UPDATECHECK'], - isLoggedIn() - ) - ) - ); + + try { + $version = ApplicationUtils::checkUpdate( + shaarli_version, + $GLOBALS['config']['UPDATECHECK_FILENAME'], + $GLOBALS['config']['UPDATECHECK_INTERVAL'], + $GLOBALS['config']['ENABLE_UPDATECHECK'], + isLoggedIn(), + $GLOBALS['config']['UPDATECHECK_BRANCH'] + ); + $this->tpl->assign('newVersion', escape($version)); + + } catch (Exception $exc) { + logm($exc->getMessage()); + $this->tpl->assign('versionError', escape($exc->getMessage())); + } + $this->tpl->assign('feedurl', escape(index_url($_SERVER))); $searchcrits = ''; // Search criteria if (!empty($_GET['searchtags'])) { -- cgit v1.2.3