From d35d65aef43fd0f644ec9e80494263ade6659516 Mon Sep 17 00:00:00 2001 From: Valentin PRUGNAUD Date: Tue, 14 Apr 2015 23:50:50 -0700 Subject: [PATCH] Fix issue when no socket is defined --- src/BackupHandlers/Database/Databases/MySQLDatabase.php | 2 +- tests/database/MySQLDatabaseTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BackupHandlers/Database/Databases/MySQLDatabase.php b/src/BackupHandlers/Database/Databases/MySQLDatabase.php index 893ba119..9c08edfb 100644 --- a/src/BackupHandlers/Database/Databases/MySQLDatabase.php +++ b/src/BackupHandlers/Database/Databases/MySQLDatabase.php @@ -59,7 +59,7 @@ public function dump($destinationFile) escapeshellarg($temporaryCredentialsFile), escapeshellarg($this->database), escapeshellarg($destinationFile), - escapeshellarg($this->getSocketArgument()) + escapeshellcmd($this->getSocketArgument()) ); return $this->console->run($command); diff --git a/tests/database/MySQLDatabaseTest.php b/tests/database/MySQLDatabaseTest.php index 60b4bffb..7426205c 100644 --- a/tests/database/MySQLDatabaseTest.php +++ b/tests/database/MySQLDatabaseTest.php @@ -52,7 +52,7 @@ public function testCustomSocket() $this->console, 'testDatabase', 'testUser', 'password', 'localhost', '3306', 'customSocket.sock' ); $this->console->shouldReceive('run') - ->with("/mysqldump --defaults-extra-file='(.*)' --skip-comments --skip-extended-insert 'testDatabase' > 'testfile.sql' '--socket=customSocket.sock'/") + ->with("/mysqldump --defaults-extra-file='(.*)' --skip-comments --skip-extended-insert 'testDatabase' > 'testfile.sql' --socket=customSocket.sock/") ->once() ->andReturn(true);