Skip to content

Commit

Permalink
Merge pull request #30 from dmstr/feature/cmd-refactoring
Browse files Browse the repository at this point in the history
improved command generation
  • Loading branch information
schmunk42 authored Dec 8, 2020
2 parents 9591845 + 2058b3a commit d9223fa
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions console/controllers/MysqlController.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,14 @@ public function actionDump()
// dump tables with data
$command = CliHelper::getMysqlCommand('mysqldump', $db);
$command->addArg('--no-tablespaces');
$command->addArg('--opt');

$noDataTables = explode(',', $this->noDataTables);
foreach ($noDataTables as $table) {
$command->addArg('--ignore-table', $opts['db'] . '.' . $table);
if ($this->noDataTables) {
$noDataTables = explode(',', $this->noDataTables);

foreach ($noDataTables as $table) {
$command->addArg('--ignore-table', $opts['db'] . '.' . $table);
}
}
$command->addArg($opts['db']);
$command->addArg(' > ', '', false);
Expand All @@ -365,11 +369,12 @@ public function actionDump()
}


if ($noDataTables) {
if ($this->noDataTables) {
// dump tables without data
$commandNoData = CliHelper::getMysqlCommand('mysqldump', $db);
$commandNoData->addArg('--no-tablespaces');
$commandNoData->addArg('--no-data');
$commandNoData->addArg('--opt');
$commandNoData->addArg($opts['db']);

foreach ($noDataTables as $table) {
Expand Down

0 comments on commit d9223fa

Please sign in to comment.