You are here

public function StatusController::json in Acquia Connector 8

Same name and namespace in other branches
  1. 8.2 src/Controller/StatusController.php \Drupal\acquia_connector\Controller\StatusController::json()
  2. 3.x src/Controller/StatusController.php \Drupal\acquia_connector\Controller\StatusController::json()

Return JSON site status.

Used by Acquia uptime monitoring.

1 string reference to 'StatusController::json'
acquia_connector.routing.yml in ./acquia_connector.routing.yml
acquia_connector.routing.yml

File

src/Controller/StatusController.php, line 36

Class

StatusController
Checks the current status of the Acquia Service.

Namespace

Drupal\acquia_connector\Controller

Code

public function json() {

  // We don't want this page cached.
  \Drupal::service('page_cache_kill_switch')
    ->trigger();
  $performance_config = $this
    ->config('system.performance');
  $data = [
    'version' => '1.0',
    'data' => [
      'maintenance_mode' => (bool) $this
        ->state()
        ->get('system.maintenance_mode'),
      'cache' => $performance_config
        ->get('cache.page.use_internal'),
      'block_cache' => FALSE,
    ],
  ];
  return new JsonResponse($data);
}