public function DefaultController::wardenStatus in Warden 8
Same name and namespace in other branches
- 8.2 src/Controller/DefaultController.php \Drupal\warden\Controller\DefaultController::wardenStatus()
- 3.x src/Controller/DefaultController.php \Drupal\warden\Controller\DefaultController::wardenStatus()
Routing callback to retrieve the data stored on the site.
Return value
1 string reference to 'DefaultController::wardenStatus'
File
- src/
Controller/ DefaultController.php, line 172
Class
- DefaultController
- Default controller for the warden module.
Namespace
Drupal\warden\ControllerCode
public function wardenStatus() {
\Drupal::service('page_cache_kill_switch')
->trigger();
$response = new JsonResponse();
try {
$this
->getWardenManager()
->updateWarden();
$response
->setData([
'data' => 'OK',
]);
} catch (\Exception $e) {
watchdog_exception('warden', $e);
$response
->setStatusCode(500);
$response
->setData([
'error' => 'Internal fault',
]);
}
return $response;
}