• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tito10047 / migration-backup / 22959989813

11 Mar 2026 03:19PM UTC coverage: 66.667%. First build
22959989813

Pull #1

github

web-flow
Merge 24800b128 into d2a2e5117
Pull Request #1: V2

108 of 165 new or added lines in 14 files covered. (65.45%)

120 of 180 relevant lines covered (66.67%)

2.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

12.5
/src/Driver/PostgresBackupDriver.php
1
<?php
2

3
namespace Tito10047\MigrationBackup\Driver;
4

5
use Symfony\Component\Filesystem\Filesystem;
6
use Symfony\Component\Process\Process;
7
use Tito10047\MigrationBackup\Dto\ConnectionParams;
8
use Tito10047\MigrationBackup\Exception\BackupFailedException;
9

10
class PostgresBackupDriver implements BackupDriverInterface {
11
        public function __construct(
12
                private readonly Filesystem $fs,
13
                private readonly string     $pgDumpPath = 'pg_dump',
14
        ) {}
2✔
15

16
        public function supports(string $driverName): bool {
17
                return in_array($driverName, ['pdo_pgsql', 'pgsql', 'postgres'], true);
2✔
18
        }
19

20
        public function dump(ConnectionParams $params, string $outputPath): void {
NEW
21
                $cmd = [
×
NEW
22
                        $this->pgDumpPath,
×
NEW
23
                        '-h', $params->host,
×
NEW
24
                        '-p', $params->port,
×
NEW
25
                        '-U', $params->user,
×
NEW
26
                        '-f', $outputPath,
×
NEW
27
                        $params->database,
×
NEW
28
                ];
×
29

NEW
30
                $process = new Process($cmd, null, [
×
NEW
31
                        'PGPASSWORD' => $params->password,
×
NEW
32
                ]);
×
33

NEW
34
                $process->run();
×
35

NEW
36
                if (!$process->isSuccessful()) {
×
NEW
37
                        throw new BackupFailedException('Could not dump PostgreSQL database: ' . $process->getErrorOutput());
×
38
                }
39
        }
40
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc