monitor = $monitor; $this->dbi = $dbi; } public function __invoke(ServerRequest $request): void { $GLOBALS['errorUrl'] ??= null; $GLOBALS['errorUrl'] = Url::getFromRoute('/'); if ($this->dbi->isSuperUser()) { $this->dbi->selectDb('mysql'); } if (! $this->response->isAjax()) { return; } $data = $this->monitor->getJsonForLogDataTypeSlow( (int) $request->getParsedBodyParam('time_start'), (int) $request->getParsedBodyParam('time_end') ); if ($data === null) { $this->response->setRequestStatus(false); return; } $this->response->addJSON(['message' => $data]); } }