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