Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKate Butler <kate@innocraft.com>2019-03-30 02:19:49 +0300
committerdiosmosis <diosmosis@users.noreply.github.com>2019-03-30 02:19:49 +0300
commit458f0fa9c04fb9e167b682c89e12f8d3151a1875 (patch)
tree445b0a5fd24af9d32433df2290fe433c41eaa6c0 /core/Plugin/ControllerAdmin.php
parentf6908294d00093234b2a27342f8f32b13a2b2232 (diff)
Display a warning if using an EOL version of PHP (#14201)
Diffstat (limited to 'core/Plugin/ControllerAdmin.php')
-rw-r--r--core/Plugin/ControllerAdmin.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/core/Plugin/ControllerAdmin.php b/core/Plugin/ControllerAdmin.php
index da28425b70..60a366b83e 100644
--- a/core/Plugin/ControllerAdmin.php
+++ b/core/Plugin/ControllerAdmin.php
@@ -207,7 +207,7 @@ abstract class ControllerAdmin extends Controller
*/
private static function getNextRequiredMinimumPHP()
{
- return '5.5.9';
+ return '7.1';
}
private static function isUsingPhpVersionCompatibleWithNextPiwik()
@@ -240,23 +240,24 @@ abstract class ControllerAdmin extends Controller
private static function notifyWhenPhpVersionIsEOL()
{
- return; // no supported version (5.5+) has currently ended support
- $notifyPhpIsEOL = Piwik::hasUserSuperUserAccess() && self::isPhpVersionAtLeast55();
+ $notifyPhpIsEOL = Piwik::hasUserSuperUserAccess() && ! self::isPhpVersionAtLeast71();
if (!$notifyPhpIsEOL) {
return;
}
+ $deprecatedMajorPhpVersion = PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION;
$message = Piwik::translate('General_WarningPiwikWillStopSupportingPHPVersion', array($deprecatedMajorPhpVersion, self::getNextRequiredMinimumPHP()))
- . "\n "
+ . "<br/> "
. Piwik::translate('General_WarningPhpVersionXIsTooOld', $deprecatedMajorPhpVersion);
$notification = new Notification($message);
+ $notification->raw = true;
$notification->title = Piwik::translate('General_Warning');
$notification->priority = Notification::PRIORITY_LOW;
$notification->context = Notification::CONTEXT_WARNING;
$notification->type = Notification::TYPE_TRANSIENT;
$notification->flags = Notification::FLAG_NO_CLEAR;
- NotificationManager::notify('PHP54VersionCheck', $notification);
+ NotificationManager::notify('PHP71VersionCheck', $notification);
}
private static function notifyWhenDebugOnDemandIsEnabled($trackerSetting)
@@ -365,8 +366,8 @@ abstract class ControllerAdmin extends Controller
return "Matomo " . Version::VERSION;
}
- private static function isPhpVersionAtLeast55()
+ private static function isPhpVersionAtLeast71()
{
- return version_compare(PHP_VERSION, '5.5', '>=');
+ return version_compare(PHP_VERSION, '7.1', '>=');
}
}