From 035be23f723e1c6853655d8ee725cc577511b0d3 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 6 Dec 2016 00:05:56 +0100 Subject: [PATCH] Show info in updater if running PHP < 5.6 Signed-off-by: Morris Jobke --- apps/updatenotification/lib/Controller/AdminController.php | 2 +- apps/updatenotification/templates/admin.php | 7 +++++++ .../tests/Controller/AdminControllerTest.php | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/updatenotification/lib/Controller/AdminController.php b/apps/updatenotification/lib/Controller/AdminController.php index 0a867f1267c..51986631e14 100644 --- a/apps/updatenotification/lib/Controller/AdminController.php +++ b/apps/updatenotification/lib/Controller/AdminController.php @@ -114,7 +114,7 @@ class AdminController extends Controller implements ISettings { 'newVersionString' => (empty($updateState['updateVersion'])) ? '' : $updateState['updateVersion'], 'downloadLink' => (empty($updateState['downloadLink'])) ? '' : $updateState['downloadLink'], 'updaterEnabled' => (empty($updateState['updaterEnabled'])) ? false : $updateState['updaterEnabled'], - + 'outdatedPHP' => version_compare(PHP_VERSION, '5.6') === -1, 'notify_groups' => implode('|', $notifyGroups), ]; diff --git a/apps/updatenotification/templates/admin.php b/apps/updatenotification/templates/admin.php index 78337eb313b..b14c72d83a5 100644 --- a/apps/updatenotification/templates/admin.php +++ b/apps/updatenotification/templates/admin.php @@ -14,6 +14,13 @@ $currentChannel = $_['currentChannel']; ?>
+ + +

+ t('You are running PHP %s. To allow you to upgrade to Nextcloud 11 and higher you need to run at least PHP 5.6. Once you upgraded your PHP version you will be able to receive update notifications for these newer versions.', [PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION])); ?> +

+ + t('A new version is available: %s', [$newVersionString])); ?> diff --git a/apps/updatenotification/tests/Controller/AdminControllerTest.php b/apps/updatenotification/tests/Controller/AdminControllerTest.php index e731b9fb428..e4814a8c639 100644 --- a/apps/updatenotification/tests/Controller/AdminControllerTest.php +++ b/apps/updatenotification/tests/Controller/AdminControllerTest.php @@ -125,6 +125,7 @@ class AdminControllerTest extends TestCase { 'newVersionString' => '8.1.2', 'downloadLink' => 'https://downloads.nextcloud.org/server', 'updaterEnabled' => true, + 'outdatedPHP' => version_compare(PHP_VERSION, '5.6') === -1, 'notify_groups' => 'admin', ]; @@ -171,6 +172,7 @@ class AdminControllerTest extends TestCase { 'newVersionString' => '', 'downloadLink' => '', 'updaterEnabled' => 0, + 'outdatedPHP' => version_compare(PHP_VERSION, '5.6') === -1, 'notify_groups' => 'admin', ]; -- 2.39.5