Skip to content

Commit

Permalink
Add SQL dump command
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobSanford committed Apr 3, 2024
1 parent c1e0ce0 commit f3d9782
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/Robo/Plugin/Commands/DrushSqlDumpCommands.php
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"',
]
);
}
}

0 comments on commit f3d9782

Please sign in to comment.