-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c1e0ce0
commit f3d9782
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace Dockworker\Robo\Plugin\Commands; | ||
|
||
use Dockworker\Docker\DockerContainerExecTrait; | ||
use Dockworker\Robo\Plugin\Commands\DrushCommands; | ||
use Dockworker\IO\DockworkerIO; | ||
use Dockworker\IO\DockworkerIOTrait; | ||
|
||
/** | ||
* Provides commands for running drush in the application's deployed resources. | ||
*/ | ||
class DrushSqlDumpCommands extends DrushCommands | ||
|
||
{ | ||
|
||
/** | ||
* Runs a drush sql-dump command within this application. | ||
* | ||
* @param string[] $options | ||
* An array of options to pass to the command. | ||
* | ||
* @option string $env | ||
* The environment to run the command in. | ||
* | ||
* @command drupal:drush:sql-dump | ||
* @aliases sql-dump | ||
* @usage --env=prod | ||
*/ | ||
public function runDrushSqlDumpCommand( | ||
array $options = [ | ||
'env' => 'local', | ||
] | ||
): void { | ||
$this->executeDrushCommand( | ||
$this->dockworkerIO, | ||
$options['env'], | ||
[ | ||
'sql-dump', | ||
'--extra-dump=--no-tablespaces', | ||
'--structure-tables-list="accesslog,batch,cache,cache_*,ctools_css_cache,ctools_object_cache,flood,search_*,history,queue,semaphore,sessions,watchdog"', | ||
] | ||
); | ||
} | ||
} |