UpdateDBCommand
final class UpdateDBCommand extends Command (View source)
Traits
A copy of \Drupal\Core\DependencyInjection\AutowireTrait with first params' type hint changed.
Constants
NAME |
|
Methods
Instantiates a new instance of the implementing class using autowiring.
Note - can't inject @database since a method below is static.
No description
No description
Log messages for any requirements warnings/errors.
Start the database update batch process.
Perform one update and store the results which will later be displayed on the finished page.
Batch command that executes a single post-update.
Batch finished callback.
No description
No description
Clears caches and rebuilds the container.
Details
static
create(ContainerInterface $container)
Instantiates a new instance of the implementing class using autowiring.
__construct(BootstrapManager $bootstrapManager, LoggerInterface $logger, ProcessManager $processManager, SiteAliasManagerInterface $siteAliasManager, DrushConfig $drushConfig)
Note - can't inject @database since a method below is static.
protected
configure()
No description
protected int
execute(InputInterface $input, OutputInterface $output)
No description
bool
updateCheckRequirements()
Log messages for any requirements warnings/errors.
bool
updateBatch()
Start the database update batch process.
static void
updateDoOne(string $module, int $number, array $dependency_map, array $context)
Perform one update and store the results which will later be displayed on the finished page.
An update function can force the current and all later updates for this module to abort by returning a $ret array with an element like: $ret['#abort'] = array('success' => FALSE, 'query' => 'What went wrong'); The schema version will not be updated in this case, and all the aborted updates will continue to appear on update.php as updates that have not yet been run.
This method is static since since it is called by _drush_batch_worker().
static void
updateDoOnePostUpdate(string $function, array $context)
Batch command that executes a single post-update.
static void
updateFinished(bool $success, array $results, array $operations)
Batch finished callback.
static void
restoreMaintMode($status)
No description
array
getUpdateList()
No description
static void
cacheRebuild()
Clears caches and rebuilds the container.
This is called in between regular updates and post updates. Do not use drush_drupal_cache_clear_all() as the cache clearing and container rebuild must happen in the same process that the updates are run in.
Drupal core's update.php uses drupal_flush_all_caches() directly without explicitly rebuilding the container as the container is rebuilt on the next HTTP request of the batch.