UpdateDBCommands
final class UpdateDBCommands extends DrushCommands implements SiteAliasManagerAwareInterface (View source)
Traits
Constants
REQ |
|
OPT |
|
EXIT_SUCCESS |
|
EXIT_FAILURE |
|
EXIT_FAILURE_WITH_CLARITY |
|
UPDATEDB |
|
STATUS |
|
BATCH_PROCESS |
|
Properties
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.
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.
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.
__construct()
No description
protected SymfonyStyle
io()
Override Robo's IO function with our custom style.
protected 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.
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.
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.