Skip to content

Commit

Permalink
Allow include-views to be passed in. Fixes #185
Browse files Browse the repository at this point in the history
  • Loading branch information
bwmarkle authored and ifsnop committed Feb 12, 2020
1 parent 06be63f commit 0931ad6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Ifsnop/Mysqldump/Mysqldump.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public function __construct(
$dumpSettingsDefault = array(
'include-tables' => array(),
'exclude-tables' => array(),
'include-views' => array(),
'compress' => Mysqldump::NONE,
'init_commands' => array(),
'no-data' => array(),
Expand Down Expand Up @@ -198,8 +199,10 @@ public function __construct(
throw new Exception("Include-tables and exclude-tables should be arrays");
}

// Dump the same views as tables, mimic mysqldump behaviour
$this->dumpSettings['include-views'] = $this->dumpSettings['include-tables'];
// If no include-views is passed in, dump the same views as tables, mimic mysqldump behaviour.
if ( ! isset( $dumpSettings['include-views'] ) ) {
$this->dumpSettings['include-views'] = $this->dumpSettings['include-tables'];
}

// Create a new compressManager to manage compressed output
$this->compressManager = CompressManagerFactory::create($this->dumpSettings['compress']);
Expand Down

0 comments on commit 0931ad6

Please sign in to comment.