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