DbUpdateController
class DbUpdateController extends ControllerBase (View source)
Controller routines for database update routes.
Traits
Wrapper methods for the logger factory service.
Provides a trait for the messenger service.
Wrapper methods for the Redirect Destination.
Wrapper methods for \Drupal\Core\StringTranslation\TranslationInterface.
Properties
| protected LoggerChannelFactoryInterface | $loggerFactory | The logger channel factory service. |
from LoggerChannelTrait |
| protected MessengerInterface | $messenger | The messenger. |
from MessengerTrait |
| protected RedirectDestinationInterface | $redirectDestination | The redirect destination service. |
from RedirectDestinationTrait |
| protected TranslationInterface | $stringTranslation | The string translation service. |
from StringTranslationTrait |
| protected EntityTypeManagerInterface | $entityTypeManager | The entity type manager. |
from ControllerBase |
| protected EntityFormBuilderInterface | $entityFormBuilder | The entity form builder. |
from ControllerBase |
| protected LanguageManagerInterface | $languageManager | The language manager. |
from ControllerBase |
| protected ConfigFactoryInterface | $configFactory | The configuration factory. |
from ControllerBase |
| protected KeyValueStoreInterface | $keyValue | The key-value storage. |
from ControllerBase |
| protected AccountInterface | $currentUser | The current user service. |
from ControllerBase |
| protected StateInterface | $stateService | The state service. |
from ControllerBase |
| protected ModuleHandlerInterface | $moduleHandler | The module handler. |
|
| protected FormBuilderInterface | $formBuilder | The form builder. |
from ControllerBase |
| protected KeyValueExpirableFactoryInterface | $keyValueExpirableFactory | The keyvalue expirable factory. |
|
| protected CacheBackendInterface | $cache | A cache backend interface. |
|
| protected StateInterface | $state | The state service. |
|
| protected AccountInterface | $account | The current user. |
|
| protected BareHtmlPageRendererInterface | $bareHtmlPageRenderer | The bare HTML page renderer. |
|
| protected string | $root | The app root. |
|
| protected UpdateRegistry | $postUpdateRegistry | The post update registry. |
Methods
Gets the logger for a specific channel.
Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url.
Returns the redirect destination service.
Sets the redirect destination service.
Translates a string to the current language or to a given language.
Formats a string containing a count of items.
Returns the number of plurals supported by a given language.
Gets the string translation service.
Instantiates a new instance of this class.
Retrieves the entity type manager.
Retrieves the entity form builder.
Returns the requested cache bin.
Returns a key/value storage collection.
Returns the language manager service.
Returns a redirect response object for the specified route.
Constructs a new UpdateController.
Returns a database update page.
Returns the info database update page.
Renders a list of available database updates.
Displays results of the update script with any accompanying errors.
Renders a list of requirement errors or warnings.
Provides the update task list render array.
Starts the database update batch process.
Finishes the update process and stores the results for eventual display.
Provides links to the homepage and administration pages.
Retrieves module updates.
Details
protected LoggerInterface
getLogger(string $channel)
Gets the logger for a specific channel.
$this
setLoggerFactory(LoggerChannelFactoryInterface $logger_factory)
Injects the logger channel factory.
setMessenger(MessengerInterface $messenger)
Sets the messenger.
MessengerInterface
messenger()
Gets the messenger.
protected array
getDestinationArray()
Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url.
protected RedirectDestinationInterface
getRedirectDestination()
Returns the redirect destination service.
$this
setRedirectDestination(RedirectDestinationInterface $redirect_destination)
Sets the redirect destination service.
protected TranslatableMarkup
t(string $string, array $args = [], array $options = [])
Translates a string to the current language or to a given language.
See \Drupal\Core\StringTranslation\TranslatableMarkup::__construct() for important security information and usage guidelines.
In order for strings to be localized, make them available in one of the ways supported by the
protected
formatPlural($count, $singular, $plural, array $args = [], array $options = [])
Formats a string containing a count of items.
protected
getNumberOfPlurals($langcode = NULL)
Returns the number of plurals supported by a given language.
protected TranslationInterface
getStringTranslation()
Gets the string translation service.
$this
setStringTranslation(TranslationInterface $translation)
Sets the string translation service to use.
static
create(ContainerInterface $container)
Instantiates a new instance of this class.
This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.
protected EntityTypeManagerInterface
entityTypeManager()
Retrieves the entity type manager.
protected EntityFormBuilderInterface
entityFormBuilder()
Retrieves the entity form builder.
protected CacheBackendInterface
cache(string $bin = 'default')
Returns the requested cache bin.
protected Config
config(string $name)
Retrieves a configuration object.
This is the main entry point to the configuration API. Calling
protected KeyValueStoreInterface
keyValue(string $collection)
Returns a key/value storage collection.
protected StateInterface
state()
Returns the state storage service.
Use this to store machine-generated data, local to a specific environment that does not need deploying and does not need human editing; for example, the last time cron was run. Data which needs to be edited by humans and needs to be the same across development, production, etc. environments (for example, the system maintenance message) should use config() instead.
protected ModuleHandlerInterface
moduleHandler()
Returns the module handler.
protected FormBuilderInterface
formBuilder()
Returns the form builder service.
protected AccountInterface
currentUser()
Returns the current user.
protected LanguageManagerInterface
languageManager()
Returns the language manager service.
protected RedirectResponse
redirect(string $route_name, array $route_parameters = [], array $options = [], int $status = 302)
Returns a redirect response object for the specified route.
__construct(string $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.
Response
handle(string $op, Request $request)
Returns a database update page.
protected array
info(Request $request)
Returns the info database update page.
protected array
selection(Request $request)
Renders a list of available database updates.
protected array
results(Request $request)
Displays results of the update script with any accompanying errors.
array
requirements($severity, array $requirements, Request $request)
Renders a list of requirement errors or warnings.
protected array
updateTasksList(string $active = NULL)
Provides the update task list render array.
protected
triggerBatch(Request $request)
Starts the database update batch process.
static
batchFinished($success, array $results, array $operations)
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.
protected array
helpfulLinks(Request $request)
Provides links to the homepage and administration pages.
protected array
getModuleUpdates()
Retrieves module updates.