protected function handleMaintenanceMode()
{
if (Config::getInstance()->General['maintenance_mode'] != 1 || Common::isPhpCliMode()) {
return;
}
Common::sendResponseCode(503);
$logoUrl = null;
$faviconUrl = null;
try {
$logo = new CustomLogo();
$logoUrl = $logo->getHeaderLogoUrl();
$faviconUrl = $logo->getPathUserFavicon();
} catch (Exception $ex) {
}
$logoUrl = $logoUrl ?: 'plugins/Morpheus/images/logo-header.png';
$faviconUrl = $faviconUrl ?: 'plugins/CoreHome/images/favicon.png';
$page = file_get_contents(PIWIK_INCLUDE_PATH . '/plugins/Morpheus/templates/maintenance.tpl');
$page = str_replace('%logoUrl%', $logoUrl, $page);
$page = str_replace('%faviconUrl%', $faviconUrl, $page);
$page = str_replace('%piwikTitle%', Piwik::getRandomTitle(), $page);
echo $page;
exit;
}