diff options
author | VirtualTam <virtualtam@flibidi.net> | 2015-11-30 02:03:32 +0100 |
---|---|---|
committer | VirtualTam <virtualtam@flibidi.net> | 2015-11-30 02:03:32 +0100 |
commit | 05f21ea82130dca0bf49a16630105d1c5649e6c6 (patch) | |
tree | 0604f1af0688325fc8871161a650a7a4ee22fe34 /index.php | |
parent | 1b740e3de39172975d0e755d9a089d2e9a44279d (diff) | |
parent | 4407b45fd3b09257ea79edba8d4f50db350f8fa9 (diff) | |
download | Shaarli-05f21ea82130dca0bf49a16630105d1c5649e6c6.tar.gz Shaarli-05f21ea82130dca0bf49a16630105d1c5649e6c6.tar.zst Shaarli-05f21ea82130dca0bf49a16630105d1c5649e6c6.zip |
Merge pull request #394 from virtualtam/app-utils/check-update/stable-branch
application: default to the "stable" branch for update checks
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 32 |
1 files changed, 19 insertions, 13 deletions
@@ -92,7 +92,8 @@ $GLOBALS['config']['ENABLE_THUMBNAILS'] = true; | |||
92 | $GLOBALS['config']['ENABLE_LOCALCACHE'] = true; | 92 | $GLOBALS['config']['ENABLE_LOCALCACHE'] = true; |
93 | 93 | ||
94 | // Update check frequency for Shaarli. 86400 seconds=24 hours | 94 | // Update check frequency for Shaarli. 86400 seconds=24 hours |
95 | $GLOBALS['config']['UPDATECHECK_INTERVAL'] = 86400 ; | 95 | $GLOBALS['config']['UPDATECHECK_BRANCH'] = 'stable'; |
96 | $GLOBALS['config']['UPDATECHECK_INTERVAL'] = 86400; | ||
96 | 97 | ||
97 | 98 | ||
98 | /* | 99 | /* |
@@ -631,18 +632,23 @@ class pageBuilder | |||
631 | private function initialize() | 632 | private function initialize() |
632 | { | 633 | { |
633 | $this->tpl = new RainTPL; | 634 | $this->tpl = new RainTPL; |
634 | $this->tpl->assign( | 635 | |
635 | 'newversion', | 636 | try { |
636 | escape( | 637 | $version = ApplicationUtils::checkUpdate( |
637 | ApplicationUtils::checkUpdate( | 638 | shaarli_version, |
638 | shaarli_version, | 639 | $GLOBALS['config']['UPDATECHECK_FILENAME'], |
639 | $GLOBALS['config']['UPDATECHECK_FILENAME'], | 640 | $GLOBALS['config']['UPDATECHECK_INTERVAL'], |
640 | $GLOBALS['config']['UPDATECHECK_INTERVAL'], | 641 | $GLOBALS['config']['ENABLE_UPDATECHECK'], |
641 | $GLOBALS['config']['ENABLE_UPDATECHECK'], | 642 | isLoggedIn(), |
642 | isLoggedIn() | 643 | $GLOBALS['config']['UPDATECHECK_BRANCH'] |
643 | ) | 644 | ); |
644 | ) | 645 | $this->tpl->assign('newVersion', escape($version)); |
645 | ); | 646 | |
647 | } catch (Exception $exc) { | ||
648 | logm($exc->getMessage()); | ||
649 | $this->tpl->assign('versionError', escape($exc->getMessage())); | ||
650 | } | ||
651 | |||
646 | $this->tpl->assign('feedurl', escape(index_url($_SERVER))); | 652 | $this->tpl->assign('feedurl', escape(index_url($_SERVER))); |
647 | $searchcrits = ''; // Search criteria | 653 | $searchcrits = ''; // Search criteria |
648 | if (!empty($_GET['searchtags'])) { | 654 | if (!empty($_GET['searchtags'])) { |