Skip to content

Commit

Permalink
Refs #6470 Make it clear Piwik will stop supporting PHP 5.3 in May
Browse files Browse the repository at this point in the history
  • Loading branch information
mattab committed Oct 20, 2014
1 parent d6a86e8 commit d6535f9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 19 deletions.
50 changes: 32 additions & 18 deletions core/Plugin/ControllerAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use Piwik\Config as PiwikConfig;
use Piwik\Config;
use Piwik\Date;
use Piwik\Menu\MenuAdmin;
use Piwik\Menu\MenuTop;
use Piwik\Menu\MenuUser;
Expand Down Expand Up @@ -124,17 +125,38 @@ public static function disableEacceleratorIfEnabled()

private static function notifyIfEAcceleratorIsUsed()
{
if (self::$isEacceleratorUsed) {
$message = sprintf("You are using the PHP accelerator & optimizer eAccelerator which is known to be not compatible with Piwik.
We have disabled eAccelerator, which might affect the performance of Piwik.
Read the %srelated ticket%s for more information and how to fix this problem.",
'<a target="_blank" href="https://github.com/piwik/piwik/issues/4439">', '</a>');
if (!self::$isEacceleratorUsed) {
return;
}
$message = sprintf("You are using the PHP accelerator & optimizer eAccelerator which is known to be not compatible with Piwik.
We have disabled eAccelerator, which might affect the performance of Piwik.
Read the %srelated ticket%s for more information and how to fix this problem.",
'<a target="_blank" href="https://github.com/piwik/piwik/issues/4439">', '</a>');

$notification = new Notification($message);
$notification->context = Notification::CONTEXT_WARNING;
$notification->raw = true;
Notification\Manager::notify('ControllerAdmin_EacceleratorIsUsed', $notification);
$notification = new Notification($message);
$notification->context = Notification::CONTEXT_WARNING;
$notification->raw = true;
Notification\Manager::notify('ControllerAdmin_EacceleratorIsUsed', $notification);
}

private static function notifyWhenPhpVersionIsEOL()
{
$notifyPhpIsEOL = Piwik::hasUserSuperUserAccess() && self::isPhpVersion53();
if (!$notifyPhpIsEOL) {
return;
}
$dateDropSupport = Date::factory('2015-05-01')->getLocalized('%longMonth% %longYear%');
$message = Piwik::translate('General_WarningPiwikWillStopSupportingPHPVersion', $dateDropSupport)
. "\n "
. Piwik::translate('General_WarningPhpVersionXIsTooOld', '5.3');

$notification = new Notification($message);
$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('PHP53VersionCheck', $notification);
}

/**
Expand Down Expand Up @@ -183,15 +205,7 @@ public static function setBasicVariablesAdminView(View $view)

self::checkPhpVersion($view);

if (Piwik::hasUserSuperUserAccess() && self::isPhpVersion53()) {
$notification = new Notification(Piwik::translate('General_WarningPhpVersionXIsTooOld', '5.3'));
$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('PHP53VersionCheck', $notification);
}
self::notifyWhenPhpVersionIsEOL();

$adminMenu = MenuAdmin::getInstance()->getMenu();
$view->adminMenu = $adminMenu;
Expand Down
1 change: 1 addition & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@
"VisitTypeExample": "For example, to select all visitors who have returned to the website, including those who have bought something in their previous visits, the API request would contain %s",
"Warning": "Warning",
"WarningPhpVersionXIsTooOld": "The PHP version %s you are using has reached its End of Life (EOL). You are strongly urged to upgrade to a current version, as using this version may expose you to security vulnerabilities and bugs that have been fixed in more recent versions of PHP.",
"WarningPiwikWillStopSupportingPHPVersion": "Piwik will stop supporting this PHP version in %s. Upgrade your PHP version before it's too late!",
"WarningFileIntegrityNoManifest": "File integrity check could not be performed due to missing manifest.inc.php.",
"WarningFileIntegrityNoManifestDeployingFromGit": "If you are deploying Piwik from Git, this message is normal.",
"WarningFileIntegrityNoMd5file": "File integrity check could not be completed due to missing md5_file() function.",
Expand Down
2 changes: 1 addition & 1 deletion tests/PHPUnit/UI
Submodule UI updated from ee7bcb to 97cb9e

0 comments on commit d6535f9

Please sign in to comment.