| Conditions | 1 |
| Paths | 1 |
| Total Lines | 33 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function register(): void |
||
| 36 | { |
||
| 37 | $configPath = __DIR__ . '/../../config/config.php'; |
||
| 38 | $this->mergeConfigFrom($configPath, 'backup'); |
||
| 39 | |||
| 40 | $this->app->singleton( |
||
| 41 | 'backup', |
||
| 42 | function ($app) { |
||
| 43 | $config = array_merge($app['config']->get('database'), $app['config']->get('backup')); |
||
| 44 | |||
| 45 | return (new BackupFactory())->build($config); |
||
| 46 | } |
||
| 47 | ); |
||
| 48 | |||
| 49 | $this->app->singleton( |
||
| 50 | 'db.export', |
||
| 51 | function ($app) { |
||
| 52 | return new BackupCommandExport(new BackupFactory(), $app['config']); |
||
| 53 | } |
||
| 54 | ); |
||
| 55 | |||
| 56 | $this->app->singleton( |
||
| 57 | 'db.restore', |
||
| 58 | function ($app) { |
||
| 59 | return new BackupCommandRestore(new BackupFactory(), $app['config']); |
||
| 60 | } |
||
| 61 | ); |
||
| 62 | |||
| 63 | $this->commands( |
||
| 64 | 'db.export', |
||
| 65 | 'db.restore' |
||
| 66 | ); |
||
| 67 | } |
||
| 68 | |||
| 79 |