Skip to content

Commit

Permalink
Make include-views a copy from include-tables
Browse files Browse the repository at this point in the history
  • Loading branch information
ifsnop committed Nov 12, 2015
1 parent a906a96 commit ab45f02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ Refer to the [wiki](https://github.com/ifsnop/mysqldump-php/wiki/full-example) f

$dumpSettingsDefault = array(
'include-tables' => array(),
'include-views' => array(),
'exclude-tables' => array(),
'compress' => 'None',
'no-data' => false,
Expand Down Expand Up @@ -153,8 +152,6 @@ Refer to the [wiki](https://github.com/ifsnop/mysqldump-php/wiki/full-example) f

- **include-tables**
- Only include these tables (array of table names), include all if empty
- **include-views**
- Only include these views (array of table names), include all if empty
- **exclude-tables**
- Exclude these tables (array of table names), include all if empty, supports regexps
- **compress**
Expand Down
7 changes: 4 additions & 3 deletions src/Ifsnop/Mysqldump/Mysqldump.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ public function __construct(
) {
$dumpSettingsDefault = array(
'include-tables' => array(),
'include-views' => array(),
'exclude-tables' => array(),
'compress' => Mysqldump::NONE,
'no-data' => false,
Expand Down Expand Up @@ -167,11 +166,13 @@ public function __construct(
}

if ( !is_array($this->dumpSettings['include-tables']) ||
!is_array($this->dumpSettings['exclude-tables']) ||
!is_array($this->dumpSettings['include-views']) ) {
!is_array($this->dumpSettings['exclude-tables']) ) {
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'];

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

0 comments on commit ab45f02

Please sign in to comment.