Spatie\DbDumper\Databases\MySql::getDumpCommand PHP Method

getDumpCommand() public method

Get the command that should be performed to dump the database.
public getDumpCommand ( string $dumpFile, string $temporaryCredentialsFile ) : string
$dumpFile string
$temporaryCredentialsFile string
return string
    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);
    }