public function getDumpCommand(string $dumpFile, string $temporaryCredentialsFile) : string
{
$command = ["'{$this->dumpBinaryPath}mysqldump'", "--defaults-extra-file=\"{$temporaryCredentialsFile}\"", '--skip-comments', $this->useExtendedInserts ? '--extended-insert' : '--skip-extended-insert'];
if ($this->useSingleTransaction) {
$command[] = '--single-transaction';
}
if ($this->socket !== '') {
$command[] = "--socket={$this->socket}";
}
if (!empty($this->excludeTables)) {
$command[] = '--ignore-table=' . implode(' --ignore-table=', $this->excludeTables);
}
foreach ($this->extraOptions as $extraOption) {
$command[] = $extraOption;
}
$command[] = "{$this->dbName}";
if (!empty($this->includeTables)) {
$command[] = implode(' ', $this->includeTables);
}
$command[] = "> \"{$dumpFile}\"";
return implode(' ', $command);
}