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