PluginProbe
Disk Usage Insights / 1.4
Disk Usage Insights v1.4
trunk 1.0 1.10 1.11 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9
← All changes | src/Domain/DatabaseRepository.php +3 -5 trunk1.4 View file →
@@ -5,13 +5,11 @@
5 5 use Mgleis\PhpSqliteJobQueue\Queue;
6 6
7 7 class DatabaseRepository {
8 8
9 - private const OUTPUT_DIR = __DIR__ . '/../../output';
10 -
11 9 public function listDatabases(): array {
12 10
13 - $dir = realpath(self::OUTPUT_DIR);
11 + $dir = realpath(__DIR__ . '/../../output');
14 12 $pattern = $dir . '/*.db';
15 13 $files = glob($pattern);
16 14 rsort($files);
17 15 $results = [];
@@ -25,9 +23,9 @@
25 23 }
26 24
27 25 public function loadDatabase(string $databaseName): Database {
28 26 // TODO verify $databaseName
29 - $dir = realpath(self::OUTPUT_DIR);
27 + $dir = realpath(__DIR__ . '/../../output');
30 28 $file = $dir . '/' . $databaseName . '.db';
31 29
32 30 $db = new Database();
33 31 $db->q = new Queue($file);
@@ -38,9 +36,9 @@
38 36 }
39 37
40 38 public function deleteDatabase(string $databaseName) {
41 39 // TODO verify $databaseName
42 - $dir = realpath(self::OUTPUT_DIR);
40 + $dir = realpath(__DIR__ . '/../../output');
43 41 $file = $dir . '/' . $databaseName . '.db';
44 42 $success = wp_delete_file($file);
45 43 }
46 44