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

tito10047 / migration-backup / 22962457449

11 Mar 2026 03:19PM UTC coverage: 66.667%. Remained the same
22962457449

push

github

web-flow
Merge pull request #1 from tito10047/v2

Create brand new version

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

3 existing lines in 2 files now uncovered.

120 of 180 relevant lines covered (66.67%)

28.58 hits per line

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

77.78
/src/Driver/SqliteBackupDriver.php
1
<?php
2

3
namespace Tito10047\MigrationBackup\Driver;
4

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

9
class SqliteBackupDriver implements BackupDriverInterface {
10
        public function __construct(
11
                private readonly Filesystem $fs
12
        ) {}
105✔
13

14
        public function supports(string $driverName): bool {
15
                return $driverName === 'pdo_sqlite' || $driverName === 'sqlite3';
42✔
16
        }
17

18
        public function dump(ConnectionParams $params, string $outputPath): void {
19
                if ($params->path === null) {
84✔
20
                        throw new BackupFailedException("SQLite path is not defined");
21✔
21
                }
22

23
                if (!$this->fs->exists($params->path)) {
63✔
24
                        // maybe database is not yet created, so we create an empty file if needed or throw exception
25
                        // but usually we want to backup existing database
26
                        throw new BackupFailedException("SQLite database file not found at " . $params->path);
21✔
27
                }
28

29
                try {
30
                        $this->fs->copy($params->path, $outputPath, true);
42✔
NEW
31
                } catch (\Exception $e) {
×
NEW
32
                        throw new BackupFailedException("Failed to copy SQLite database: " . $e->getMessage(), 0, $e);
×
33
                }
34
        }
35
}
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