Skip to content

Commit d89b0a7

Browse files
Fixed --tables feature and some other typos
1 parent d557135 commit d89b0a7

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/Backup/Source/Mysqldump.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,18 @@ public function setup(array $conf = array())
4343

4444
/**
4545
*
46-
* @param \phpbu\App\Target $target
47-
* @param \phpbu\App\Result $result
46+
* @param \phpbu\Backup\Target $target
47+
* @param \phpbu\App\Result $result
4848
* @return \phpbu\App\Result
49+
* @throws \phpbu\App\Exception
4950
*/
5051
public function backup(Target $target, Result $result)
5152
{
52-
$host = 'localhost';
53-
$user = $_SERVER['USER'];
54-
$password = null;
55-
$datbases = array();
56-
$exec = new Exec();
57-
58-
53+
$host = 'localhost';
54+
$user = $_SERVER['USER'];
55+
$password = null;
56+
$databases = array();
57+
$exec = new Exec();
5958
$path = isset($this->conf['pathToMysqldump']) ? $this->conf['pathToMysqldump'] : null;
6059
$mysqldump = Util\Cli::detectCmdLocation(
6160
'mysqldump',
@@ -93,9 +92,8 @@ public function backup(Target $target, Result $result)
9392
$cmd->addOption('-C');
9493
}
9594
if (!empty($this->conf['tables'])) {
96-
foreach ($tables as $table) {
97-
$cmd->addOption('--tables', $this->conf['tables']);
98-
}
95+
$tables = explode(',', $this->conf['tables']);
96+
$cmd->addOption('--tables', $tables);
9997
} else {
10098
if (!empty($this->conf['databases'])) {
10199
if (empty($this->conf['databases']) || $this->conf['databases'] == '__ALL__') {

0 commit comments

Comments
 (0)