Skip to content

Commit 49c3996

Browse files
Merge pull request #35 from itiden/feature/configurable-repository
Get repository implementation from config
2 parents 6947440 + c8d19b4 commit 49c3996

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

config/backup.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,17 @@
4949
// 'time' => '03:00',
5050
],
5151

52+
/**
53+
* The backup repository
54+
*
55+
* the repository handles resolving and managing backups
56+
*/
57+
'repository' => \Itiden\Backup\Repositories\FileBackupRepository::class,
58+
5259
/**
5360
* The backup steps to use
5461
*
55-
* These are the steps/pipes that will be used to backup your site
62+
* these are the steps/pipes that will be used to backup your site
5663
* You can add your own here
5764
*
5865
* All pipes are expected to be instances of Itiden\Backup\Abtracts\BackupPipe

src/ServiceProvider.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Itiden\Backup\Console\Commands\BackupCommand;
99
use Itiden\Backup\Console\Commands\ClearFilesCommand;
1010
use Itiden\Backup\Console\Commands\RestoreCommand;
11+
use Itiden\Backup\Contracts\Repositories\BackupRepository;
1112
use Statamic\Facades\CP\Nav;
1213
use Statamic\Facades\Permission;
1314
use Statamic\Providers\AddonServiceProvider;
@@ -63,15 +64,15 @@ protected function schedule(Schedule $schedule)
6364

6465
public function register()
6566
{
66-
$this->app->bind(
67-
\Itiden\Backup\Contracts\Repositories\BackupRepository::class,
68-
\Itiden\Backup\Repositories\FileBackupRepository::class
69-
);
70-
7167
$this->mergeConfigFrom(
7268
__DIR__ . '/../config/backup.php',
7369
'backup'
7470
);
71+
72+
$this->app->bind(
73+
BackupRepository::class,
74+
config('backup.repository')
75+
);
7576
}
7677

7778
private function setUpPermissions()

0 commit comments

Comments
 (0)