| @@ 27-38 (lines=12) @@ | ||
| 24 | * @throws \Spatie\DbDumper\Exceptions\CannotStartDump |
|
| 25 | * @throws \Spatie\DbDumper\Exceptions\DumpFailed |
|
| 26 | */ |
|
| 27 | public function dumpToFile(string $dumpFile) |
|
| 28 | { |
|
| 29 | $this->guardAgainstIncompleteCredentials(); |
|
| 30 | ||
| 31 | $command = $this->getDumpCommand($dumpFile); |
|
| 32 | ||
| 33 | $process = Process::fromShellCommandline($command, null, null, null, $this->timeout); |
|
| 34 | ||
| 35 | $process->run(); |
|
| 36 | ||
| 37 | $this->checkIfDumpWasSuccessFul($process, $dumpFile); |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * Verifies if the dbname and host options are set. |
|
| @@ 17-26 (lines=10) @@ | ||
| 14 | * |
|
| 15 | * @throws \Spatie\DbDumper\Exceptions\DumpFailed |
|
| 16 | */ |
|
| 17 | public function dumpToFile(string $dumpFile) |
|
| 18 | { |
|
| 19 | $command = $this->getDumpCommand($dumpFile); |
|
| 20 | ||
| 21 | $process = Process::fromShellCommandline($command, null, null, null, $this->timeout); |
|
| 22 | ||
| 23 | $process->run(); |
|
| 24 | ||
| 25 | $this->checkIfDumpWasSuccessFul($process, $dumpFile); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * Get the command that should be performed to dump the database. |
|