public DbUpdateController::handle($op, Request $request)
Returns a database update page.
Parameters
string $op: The update operation to perform. Can be any of the below:
- info
- selection
- run
- results
\Symfony\Component\HttpFoundation\Request $request: The current request object.
Return value
\Symfony\Component\HttpFoundation\Response A response object object.
File
- core/modules/system/src/Controller/DbUpdateController.php, line 142
Class
- DbUpdateController
- Controller routines for database update routes.
Namespace
Drupal\system\Controller
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | public function handle( $op , Request $request ) { require_once $this ->root . '/core/includes/install.inc' ; require_once $this ->root . '/core/includes/update.inc' ; drupal_load_updates(); update_fix_compatibility(); if ( $request ->query->get( 'continue' )) { $_SESSION [ 'update_ignore_warnings' ] = TRUE; } $regions = array (); $requirements = update_check_requirements(); $severity = drupal_requirements_severity( $requirements ); if ( $severity == REQUIREMENT_ERROR || ( $severity == REQUIREMENT_WARNING && empty ( $_SESSION [ 'update_ignore_warnings' ]))) { $regions [ 'sidebar_first' ] = $this ->updateTasksList( 'requirements' ); $output = $this ->requirements( $severity , $requirements , $request ); } else { switch ( $op ) { case 'selection' : $regions [ 'sidebar_first' ] = $this ->updateTasksList( 'selection' ); $output = $this ->selection( $request ); break ; case 'run' : $regions [ 'sidebar_first' ] = $this ->updateTasksList( 'run' ); $output = $this ->triggerBatch( $request ); break ; case 'info' : $regions [ 'sidebar_first' ] = $this ->updateTasksList( 'info' ); $output = $this ->info( $request ); break ; case 'results' : $regions [ 'sidebar_first' ] = $this ->updateTasksList( 'results' ); $output = $this ->results( $request ); break ; // Regular batch ops : defer to batch processing API. default : require_once $this ->root . '/core/includes/batch.inc' ; $regions [ 'sidebar_first' ] = $this ->updateTasksList( 'run' ); $output = _batch_page( $request ); break ; } } if ( $output instanceof Response) { return $output ; } $title = isset( $output [ '#title' ]) ? $output [ '#title' ] : $this ->t( 'Drupal database update' ); return $this ->bareHtmlPageRenderer->renderBarePage( $output , $title , 'maintenance_page' , $regions ); } |
Please login to continue.