DatabaseDumperInterface
Contract for dumping the host's database to a single file. This package stays domain-blind and ships no implementation — the host provides the concrete dumper (e.g. shelling out to `mysqldump`, copying a SQLite file, etc). {@see BackupManager} (Task 7) orchestrates a dumper alongside {@see StorageArchiver} to build a backup.
DatabaseDumperInterface::dump()
abstract public function dump(string $destinationFile): voidDump the database to `$destinationFile`. Implementations own how the dump is produced (shelling out, native driver, file copy) — this contract only fixes where the result lands.
Parameters
| Name | Type | Description |
|---|---|---|
| $destinationFile | string |
DatabaseDumperInterface::extension()
abstract public function extension(): stringThe file extension (without the leading dot) this dumper produces, e.g. `sql` for a `mysqldump` text dump or `sqlite` for a raw SQLite file copy. Callers use this to name the destination file before calling {@see self::dump()}.
DatabaseDumperInterface::restore()
abstract public function restore(string $sourceFile): voidRestore the database from `$sourceFile` (a file previously produced by {@see self::dump()}). Implementations own how the restore is performed (shelling out, native driver, file copy) — this contract only fixes where the source data comes from. {@see BackupManager::restore()} (Task 7) calls this after confirming the backup's manifest and files exist.
Parameters
| Name | Type | Description |
|---|---|---|
| $sourceFile | string |