From 6be6a39a1a807f5a954d664b0fd9c6b6fd52bed9 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Mon, 17 Feb 2020 18:20:44 +0100 Subject: [PATCH] =?UTF-8?q?[10.0.034.dev]=20canal=20de=20mise=20=C3=A0=20j?= =?UTF-8?q?our=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/class/helper.class.php | 8 ++++---- core/core.php | 9 +++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/core/class/helper.class.php b/core/class/helper.class.php index 392a2c28..a30174a0 100644 --- a/core/class/helper.class.php +++ b/core/class/helper.class.php @@ -130,8 +130,8 @@ class helper { * Renvoie le numéro de version de Zwii est en ligne * @return string */ - public static function getOnlineVersion() { - return (@file_get_contents('http://zwiicms.com/update/version')); + public static function getOnlineVersion($channel = '') { + return (@file_get_contents('http://zwiicms.com/update' . $channel . '/version')); } @@ -139,8 +139,8 @@ class helper { * Check si une nouvelle version de Zwii est disponible * @return bool */ - public static function checkNewVersion() { - if($version = helper::getOnlineVersion()) { + public static function checkNewVersion($channel = '') { + if($version = helper::getOnlineVersion($channel)) { //return (trim($version) !== common::ZWII_VERSION); return ((version_compare(common::ZWII_VERSION,$version)) === -1); } diff --git a/core/core.php b/core/core.php index ea0daab0..e139064b 100644 --- a/core/core.php +++ b/core/core.php @@ -33,7 +33,12 @@ class common { const TEMP_DIR = 'site/tmp/'; // Numéro de version - const ZWII_VERSION = '10.0.033.dev'; + const ZWII_VERSION = '10.0.034.dev'; + + // Laisser vide pour la version officiel + // v10 version 10 + // v11 verison 11 + const ZWII_UPDATE_CHANNEL = 'v10'; public static $actions = []; public static $coreModuleIds = [ @@ -2246,7 +2251,7 @@ class layout extends common { if( $this->getData(['config','autoUpdate']) && $lastAutoUpdate > $this->getData(['core','lastAutoUpdate']) + 86400 ) { $this->setData(['core','lastAutoUpdate',$lastAutoUpdate]); - if ( helper::checkNewVersion() ) { + if ( helper::checkNewVersion(common::ZWII_UPDATE_CHANNEL) ) { $rightItems .= '
  • ' . template::ico('update colorRed') . '
  • '; } }