You are here

public function SystemTestController::shutdownFunctions in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php \Drupal\system_test\Controller\SystemTestController::shutdownFunctions()

A simple page callback which adds a register shutdown function.

1 string reference to 'SystemTestController::shutdownFunctions'
system_test.routing.yml in core/modules/system/tests/modules/system_test/system_test.routing.yml
core/modules/system/tests/modules/system_test/system_test.routing.yml

File

core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php, line 307

Class

SystemTestController
Controller routines for system_test routes.

Namespace

Drupal\system_test\Controller

Code

public function shutdownFunctions($arg1, $arg2) {
  drupal_register_shutdown_function('_system_test_first_shutdown_function', $arg1, $arg2);

  // If using PHP-FPM then fastcgi_finish_request() will have been fired
  // preventing further output to the browser which means that the escaping of
  // the exception message can not be tested.
  // @see _drupal_shutdown_function()
  // @see \Drupal\system\Tests\System\ShutdownFunctionsTest
  if (function_exists('fastcgi_finish_request')) {
    return [
      '#markup' => 'The function fastcgi_finish_request exists when serving the request.',
    ];
  }
  return [];
}