UpdateDBCommands
final class UpdateDBCommands extends DrushCommands (View source)
Traits
A copy of \Drupal\Core\DependencyInjection\AutowireTrait with first params' type hint changed.
Constants
REQ |
|
OPT |
|
EXIT_SUCCESS |
|
EXIT_FAILURE |
|
EXIT_FAILURE_WITH_CLARITY |
|
UPDATEDB |
|
STATUS |
|
BATCH_PROCESS |
|
Properties
protected | $uri | from ExecTrait | |
protected CommandData|null | $commandData | from DrushCommands |
Methods
Starts a background browser/tab for the current site or a specified URL.
Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.
Prompt the user until the given validation callback passes.
No description
Persist commandData for use in primary command callback. Used by 'topic' commands.
Persist commandData for use in primary command callback. Used by 'topic' commands.
Print the contents of a file. The path comes from the @topic annotation.
This method overrides the trait in order to provide a more specific return type.
Instantiates a new instance of the implementing class using autowiring.
Apply any database updates required (as with running update.php).
List any pending database updates.
Process operations in the specified batch set.
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.
Start the database update batch process.
No description
No description
Clears caches and rebuilds the container.
Returns information about available module updates.
Log messages for any requirements warnings/errors.
Details
bool
startBrowser(string|null $uri = null, int $sleep = 0, int|null $port = null, string|bool $browser = false)
Starts a background browser/tab for the current site or a specified URL.
Uses a non-blocking Process call, so Drush execution will continue.
static bool
programExists($program)
No description
static string
getEditor(string|null $editor = null)
No description
DrushConfig
getConfig()
Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.
protected void
configurePrompts(InputInterface $input)
Configure the prompt fallbacks.
protected mixed
promptUntilValid(Closure $prompt, bool|string $required, Closure|null $validate)
Prompt the user until the given validation callback passes.
protected void
restorePrompts()
Restore the prompts output.
protected bool
runningUnitTests()
No description
__construct(SiteAliasManagerInterface $siteAliasManager)
No description
protected DrushStyle
io()
Override Robo's IO function with our custom style.
DrushLoggerManager|null
logger()
Returns a logger object.
protected void
printFile(string $file)
Print the contents of a file.
preHook(CommandData $commandData)
Persist commandData for use in primary command callback. Used by 'topic' commands.
initHook($input, AnnotationData $annotationData)
Persist commandData for use in primary command callback. Used by 'topic' commands.
protected
printFileTopic(CommandData $commandData)
Print the contents of a file. The path comes from the @topic annotation.
protected HandlerStack
getStack()
Get a Guzzle handler stack that uses the Drush logger.
ProcessManager
processManager()
This method overrides the trait in order to provide a more specific return type.
static AutowireTrait
create(ContainerInterface $container)
Instantiates a new instance of the implementing class using autowiring.
int
updatedb($options = ['cache-clear' => true])
Apply any database updates required (as with running update.php).
RowsOfFields|null
updatedbStatus($options = ['format' => 'table'])
List any pending database updates.
UnstructuredListData
process(string $batch_id, $options = ['format' => 'json'])
Process operations in the specified batch set.
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.
void
updateFinished(bool $success, array $results, array $operations)
Batch finished callback.
bool
updateBatch()
Start the database update batch process.
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.
array
getUpdatedbStatus(array $options)
Returns information about available module updates.
bool
updateCheckRequirements()
Log messages for any requirements warnings/errors.