private static function generateSafeModeOutput($lastError)
{
Common::sendResponseCode(500);
$controller = FrontController::getInstance();
try {
$controller->init();
$message = $controller->dispatch('CorePluginsAdmin', 'safemode', array($lastError));
} catch (Exception $e) {
// may fail in safe mode (eg. global.ini.php not found)
$message = sprintf("Piwik encoutered an error: %s (which lead to: %s)", $lastError['message'], $e->getMessage());
}
return $message;
}