Skip to content
Extraits de code Groupes Projets
Valider ab6070fc rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

refs #4439 disable eAccelerator if enabled (just disabling optimizing did not...

refs #4439 disable eAccelerator if enabled (just disabling optimizing did not work) and display a message in the admin UI. Also disabled eAccelerator during tracking. We might need to move the method to detect eAccelerator to another place, not sure if this is the best one
parent 277af287
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -27,6 +27,8 @@ use Piwik\View;
*/
abstract class ControllerAdmin extends Controller
{
private static $isEacceleratorUsed = false;
private static function notifyWhenTrackingStatisticsDisabled()
{
$statsEnabled = PiwikConfig::getInstance()->Tracker['record_statistics'];
......@@ -97,6 +99,37 @@ abstract class ControllerAdmin extends Controller
}
}
/**
* See http://dev.piwik.org/trac/ticket/4439#comment:8 and https://github.com/eaccelerator/eaccelerator/issues/12
*
* Eaccelerator does not support closures and is known to be not comptabile with Piwik. Therefore we are disabling
* it automatically. At this point it looks like Eaccelerator is no longer under development and the bug has not
* been fixed within a year.
*/
public static function disableEacceleratorIfEnabled()
{
$isEacceleratorUsed = ini_get('eaccelerator.enable');
if (!empty($isEacceleratorUsed)) {
self::$isEacceleratorUsed = true;
@ini_set('eaccelerator.enable', 0);
}
}
private static function notifyIfEAcceleratorIsUsed()
{
if (self::$isEacceleratorUsed) {
$params = array('<a href="http://dev.piwik.org/trac/ticket/4439">', '</a>');
$message = Piwik::translate('CoreAdminHome_EacceleratorNotCompatible', $params);
$notification = new Notification($message);
$notification->context = Notification::CONTEXT_WARNING;
$notification->raw = true;
Notification\Manager::notify('ControllerAdmin_EacceleratorIsUsed', $notification);
}
}
/**
* Assigns view properties that would be useful to views that render admin pages.
*
......@@ -123,6 +156,7 @@ abstract class ControllerAdmin extends Controller
static public function setBasicVariablesAdminView(View $view)
{
self::notifyWhenTrackingStatisticsDisabled();
self::notifyIfEAcceleratorIsUsed();
$view->topMenu = MenuTop::getInstance()->getMenu();
$view->currentAdminMenuName = MenuAdmin::getInstance()->getCurrentAdminMenuName();
......
......@@ -11,6 +11,9 @@
use Piwik\Error;
use Piwik\ExceptionHandler;
use Piwik\FrontController;
use \Piwik\Plugin\ControllerAdmin as PluginControllerAdmin;
PluginControllerAdmin::disableEacceleratorIfEnabled();
if (!defined('PIWIK_ENABLE_ERROR_HANDLER') || PIWIK_ENABLE_ERROR_HANDLER) {
require_once PIWIK_INCLUDE_PATH . '/core/Error.php';
......
......@@ -585,7 +585,8 @@
"PluginSettingsIntro": "Here you can change the settings for the following 3rd party plugins:",
"PluginSettingsValueNotAllowed": "The value for field \"%s\" in plugin \"%s\" is not allowed",
"PluginSettingChangeNotAllowed": "You are not allowed to change the value of the setting \"%s\" in plugin \"%s\"",
"PluginSettings": "Plugin settings"
"PluginSettings": "Plugin settings",
"EacceleratorNotCompatible": "You are using the PHP accelerator & optimizer eAccelerator which is known to be not compatible with Piwik. We have disabled eAccelerator therefore which might affect the performance of Piwik. Read the %srelated ticket%s for more information and how to fix this problem."
},
"CoreHome": {
"InjectedHostWarningIntro": "You are now accessing Piwik from %1$s, but Piwik has been configured to run at this address: %2$s.",
......
......@@ -35,6 +35,11 @@ if (!defined('PIWIK_INCLUDE_PATH')) {
@ignore_user_abort(true);
require_once PIWIK_INCLUDE_PATH . '/core/Plugin/Controller.php';
require_once PIWIK_INCLUDE_PATH . '/core/Plugin/ControllerAdmin.php';
\Piwik\Plugin\ControllerAdmin::disableEacceleratorIfEnabled();
require_once PIWIK_INCLUDE_PATH . '/libs/upgradephp/upgrade.php';
require_once PIWIK_INCLUDE_PATH . '/core/testMinimumPhpVersion.php';
require_once PIWIK_INCLUDE_PATH . '/core/Singleton.php';
......@@ -78,6 +83,7 @@ session_cache_limiter('nocache');
if (!defined('PIWIK_ENABLE_TRACKING') || PIWIK_ENABLE_TRACKING) {
ob_start();
}
if ($GLOBALS['PIWIK_TRACKER_DEBUG'] === true) {
require_once PIWIK_INCLUDE_PATH . '/core/Loader.php';
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter