Skip to content

Commit

Permalink
Slow Query Log: DB-Abfragen vermeiden (#5255)
Browse files Browse the repository at this point in the history
  • Loading branch information
gharlan committed Jul 21, 2022
1 parent e2376d9 commit be5c12e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion redaxo/src/core/backend.php
Expand Up @@ -177,8 +177,8 @@

// ----- Prepare Core Pages
if (rex::getUser()) {
rex_be_controller::appendLoggedInPages();
rex_be_controller::setCurrentPage(trim(rex_request('page', 'string')));
rex_be_controller::appendLoggedInPages();

if ('profile' !== rex_be_controller::getCurrentPage() && rex::getProperty('login')->requiresPasswordChange()) {
rex_response::sendRedirect(rex_url::backendPage('profile'));
Expand Down
8 changes: 5 additions & 3 deletions redaxo/src/core/lib/be/controller.php
Expand Up @@ -171,9 +171,11 @@ public static function appendLoggedInPages()
$logsPage->addSubpage((new rex_be_page('php', rex_i18n::msg('syslog_phperrors')))->setSubPath(rex_path::core('pages/system.log.external.php')));
}

$slowQueryLogPath = rex_sql_util::slowQueryLogPath();
if (null !== $slowQueryLogPath && @is_readable($slowQueryLogPath)) {
$logsPage->addSubpage((new rex_be_page('slow-queries', rex_i18n::msg('syslog_slowqueries')))->setSubPath(rex_path::core('pages/system.log.slow-queries.php')));
if ('system' === self::getCurrentPagePart(1) && 'log' === self::getCurrentPagePart(2)) {
$slowQueryLogPath = rex_sql_util::slowQueryLogPath();
if (null !== $slowQueryLogPath && @is_readable($slowQueryLogPath)) {
$logsPage->addSubpage((new rex_be_page('slow-queries', rex_i18n::msg('syslog_slowqueries')))->setSubPath(rex_path::core('pages/system.log.slow-queries.php')));
}
}

self::$pages['system'] = (new rex_be_page_main('system', 'system', rex_i18n::msg('system')))
Expand Down

0 comments on commit be5c12e

Please sign in to comment.