Drupal 8  8.0.2
DbUpdateController Class Reference
Inheritance diagram for DbUpdateController:

Public Member Functions

 __construct ($root, KeyValueExpirableFactoryInterface $key_value_expirable_factory, CacheBackendInterface $cache, StateInterface $state, ModuleHandlerInterface $module_handler, AccountInterface $account, BareHtmlPageRendererInterface $bare_html_page_renderer, UpdateRegistry $post_update_registry)
 
 handle ($op, Request $request)
 
 requirements ($severity, array $requirements, Request $request)
 

Static Public Member Functions

static create (ContainerInterface $container)
 
static batchFinished ($success, $results, $operations)
 

Protected Member Functions

 info (Request $request)
 
 selection (Request $request)
 
 results (Request $request)
 
 updateTasksList ($active=NULL)
 
 triggerBatch (Request $request)
 
 helpfulLinks (Request $request)
 
 getModuleUpdates ()
 

Protected Attributes

 $keyValueExpirableFactory
 
 $cache
 
 $state
 
 $moduleHandler
 
 $account
 
 $bareHtmlPageRenderer
 
 $root
 
 $postUpdateRegistry
 

Detailed Description

Controller routines for database update routes.

Constructor & Destructor Documentation

__construct (   $root,
KeyValueExpirableFactoryInterface  $key_value_expirable_factory,
CacheBackendInterface  $cache,
StateInterface  $state,
ModuleHandlerInterface  $module_handler,
AccountInterface  $account,
BareHtmlPageRendererInterface  $bare_html_page_renderer,
UpdateRegistry  $post_update_registry 
)

Constructs a new UpdateController.

Parameters
string$rootThe app root.
\Drupal\Core\KeyValueStore\KeyValueExpirableFactoryInterface$key_value_expirable_factoryThe keyvalue expirable factory.
\Drupal\Core\Cache\CacheBackendInterface$cacheA cache backend interface.
\Drupal\Core\State\StateInterface$stateThe state service.
\Drupal\Core\Extension\ModuleHandlerInterface$module_handlerThe module handler.
\Drupal\Core\Session\AccountInterface$accountThe current user.
\Drupal\Core\Render\BareHtmlPageRendererInterface$bare_html_page_rendererThe bare HTML page renderer.
\Drupal\Core\Update\UpdateRegistry$post_update_registryThe post update registry.

References Drupal\cache(), Drupal\moduleHandler(), Drupal\root(), and Drupal\state().

Here is the call graph for this function:

Member Function Documentation

static batchFinished (   $success,
  $results,
  $operations 
)
static

Finishes the update process and stores the results for eventual display.

After the updates run, all caches are flushed. The update results are stored into the session (for example, to be displayed on the update results page in update.php). Additionally, if the site was off-line, now that the update process is completed, the site is set back online.

Parameters
$successIndicate that the batch API tasks were all completed successfully.
array$resultsAn array of all the results that were updated in update_do_one().
array$operationsA list of all the operations that had not been completed by the batch API.

References Drupal\state().

Here is the call graph for this function:

static create ( ContainerInterface  $container)
static

{}

getModuleUpdates ( )
protected

Retrieves module updates.

Returns
array The module updates that can be performed.

Referenced by DbUpdateController\triggerBatch().

Here is the caller graph for this function:

handle (   $op,
Request  $request 
)

Returns a database update page.

Parameters
string$opThe update operation to perform. Can be any of the below:
  • info
  • selection
  • run
  • results
\Symfony\Component\HttpFoundation\Request$requestThe current request object.
Returns
A response object object.

References DbUpdateController\info(), DbUpdateController\requirements(), DbUpdateController\results(), Drupal\root(), DbUpdateController\selection(), t(), DbUpdateController\triggerBatch(), and DbUpdateController\updateTasksList().

Here is the call graph for this function:

helpfulLinks ( Request  $request)
protected

Provides links to the homepage and administration pages.

Parameters
\Symfony\Component\HttpFoundation\Request$requestThe current request.
Returns
array An array of links.

References Url\fromRoute(), and t().

Referenced by DbUpdateController\results(), and DbUpdateController\selection().

Here is the call graph for this function:

Here is the caller graph for this function:

info ( Request  $request)
protected

Returns the info database update page.

Parameters
\Symfony\Component\HttpFoundation\Request$requestThe current request.
Returns
array A render array.

References Url\fromRoute(), Url\fromUri(), and t().

Referenced by DbUpdateController\handle().

Here is the call graph for this function:

Here is the caller graph for this function:

requirements (   $severity,
array  $requirements,
Request  $request 
)

Renders a list of requirement errors or warnings.

Parameters
\Symfony\Component\HttpFoundation\Request$requestThe current request.
Returns
array A render array.

References Url\fromUri(), and t().

Referenced by DbUpdateController\handle().

Here is the call graph for this function:

Here is the caller graph for this function:

results ( Request  $request)
protected

Displays results of the update script with any accompanying errors.

Parameters
\Symfony\Component\HttpFoundation\Request$requestThe current request.
Returns
array A render array.

References Url\fromRoute(), Settings\get(), DbUpdateController\helpfulLinks(), Drupal\moduleHandler(), and t().

Referenced by DbUpdateController\handle().

Here is the call graph for this function:

Here is the caller graph for this function:

selection ( Request  $request)
protected

Renders a list of available database updates.

Parameters
\Symfony\Component\HttpFoundation\Request$requestThe current request.
Returns
array A render array.

References Drupal\cache(), DbUpdateController\helpfulLinks(), and t().

Referenced by DbUpdateController\handle().

Here is the call graph for this function:

Here is the caller graph for this function:

triggerBatch ( Request  $request)
protected

Starts the database update batch process.

Parameters
\Symfony\Component\HttpFoundation\Request$requestThe current request object.

References batch_set(), drupal_set_installed_schema_version(), Url\fromUri(), DbUpdateController\getModuleUpdates(), Drupal\state(), and t().

Referenced by DbUpdateController\handle().

Here is the call graph for this function:

Here is the caller graph for this function:

updateTasksList (   $active = NULL)
protected

Provides the update task list render array.

Parameters
string$activeThe active task. Can be one of 'requirements', 'info', 'selection', 'run', 'results'.
Returns
array A render array.

References t().

Referenced by DbUpdateController\handle().

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: