Commit 350c73f1 authored by catch's avatar catch

Issue #1987884 by dawehner: Convert update_callback_service_unavailable() to a...

Issue #1987884 by dawehner: Convert update_callback_service_unavailable() to a new style controller.
parent 4406bee5
<?php
/**
* @file
* Contains \Drupal\update_test\Controller\UpdateTestController.
*/
namespace Drupal\update_test\Controller;
use Symfony\Component\HttpFoundation\Response;
/**
* Provides different routes of the update_test module.
*/
class UpdateTestController {
/**
* Displays an Error 503 (Service unavailable) page.
*
* @return \Symfony\Component\HttpFoundation\Response
* Returns the response with a special header.
*/
public function updateError() {
$response = new Response();
$response->setStatusCode(503);
$response->headers->set('Status', '503 Service unavailable');
return $response;
}
}
...@@ -29,12 +29,6 @@ function update_test_menu() { ...@@ -29,12 +29,6 @@ function update_test_menu() {
'access callback' => TRUE, 'access callback' => TRUE,
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
); );
$items['503-error'] = array(
'title' => t('503 Service unavailable'),
'page callback' => 'update_callback_service_unavailable',
'access callback' => TRUE,
'type' => MENU_CALLBACK,
);
return $items; return $items;
} }
...@@ -163,13 +157,3 @@ function update_test_filetransfer_info() { ...@@ -163,13 +157,3 @@ function update_test_filetransfer_info() {
), ),
); );
} }
/**
* Page callback: Displays an Error 503 (Service unavailable) page.
*
* @see update_test_menu()
*/
function update_callback_service_unavailable() {
drupal_add_http_header('Status', '503 Service unavailable');
print "503 Service Temporarily Unavailable";
}
update_test_503:
pattern: '/503-error'
defaults:
_controller: 'Drupal\update_test\Controller\UpdateTestController::updateError'
requirements:
_access: 'TRUE'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment