From 48dc17e0678e9ac162d4598c9e0a7e9009344ed8 Mon Sep 17 00:00:00 2001 From: Ryan Price Date: Mon, 18 Mar 2024 10:29:25 -0700 Subject: [PATCH] Add --extra-dump option to archive:dump (#5915) * Add --extra-dump option to archive:dump * Update ArchiveDumpCommands.php * Update ArchiveDumpCommands.php to ue options similar to sql:sync --- src/Commands/core/ArchiveDumpCommands.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Commands/core/ArchiveDumpCommands.php b/src/Commands/core/ArchiveDumpCommands.php index 9a1928acc5..5887374474 100644 --- a/src/Commands/core/ArchiveDumpCommands.php +++ b/src/Commands/core/ArchiveDumpCommands.php @@ -68,6 +68,7 @@ final class ArchiveDumpCommands extends DrushCommands #[CLI\Option(name: 'overwrite', description: 'Overwrite destination file if exists.')] #[CLI\Option(name: 'code', description: 'Archive codebase.')] #[CLI\Option(name: 'exclude-code-paths', description: 'Comma-separated list of paths (or regular expressions matching paths) to exclude from the code archive.')] + #[CLI\Option(name: 'extra-dump', description: 'Add custom arguments/options to the dumping of the database (e.g. mysqldump command).')] #[CLI\Option(name: 'files', description: 'Archive Drupal files.')] #[CLI\Option(name: 'db', description: 'Archive database SQL dump.')] #[CLI\Option(name: 'description', description: 'Describe the archive contents.')] @@ -79,6 +80,7 @@ final class ArchiveDumpCommands extends DrushCommands #[CLI\Usage(name: 'drush archive:dump --destination=/path/to/archive.tar.gz --overwrite', description: 'Create (or overwrite if exists) /path/to/archive.tar.gz file containing code, database and Drupal files.')] #[CLI\Usage(name: 'drush archive:dump --code --destination=/path/to/archive.tar.gz', description: 'Create /path/to/archive.tar.gz file containing the code only.')] #[CLI\Usage(name: 'drush archive:dump --exclude-code-paths=foo_bar.txt,web/sites/.+/settings.php --destination=/path/to/archive.tar.gz', description: 'Create /path/to/archive.tar.gz file containing code, database and Drupal files but excluding foo_bar.txt file and settings.php files if found in web/sites/* subdirectories.')] + #[CLI\Usage(name: 'drush archive:dump --extra-dump=--no-data --destination=/path/to/archive.tar.gz', description: 'Create /path/to/archive.tar.gz file and pass extra option to mysqldump command.')] #[CLI\Usage(name: 'drush archive:dump --files --destination=/path/to/archive.tar.gz', description: 'Create /path/to/archive.tar.gz file containing the Drupal files only.')] #[CLI\Usage(name: 'drush archive:dump --database --destination=/path/to/archive.tar.gz', description: 'Create /path/to/archive.tar.gz archive file containing the database dump only.')] #[CLI\OptionsetTableSelection] @@ -95,6 +97,7 @@ public function dump(array $options = [ 'generator' => InputOption::VALUE_REQUIRED, 'generatorversion' => InputOption::VALUE_REQUIRED, 'exclude-code-paths' => InputOption::VALUE_REQUIRED, + 'extra-dump' => self::REQ, ]): string { $this->prepareArchiveDir();