@@ -40,18 +40,13 @@ If you are not using Symfony Flex, you need to enable the bundle by adding it to
40
40
the list of registered bundles in the ` app/AppKernel.php ` file of your project.
41
41
42
42
``` php
43
- // app/AppKernel.php
44
-
45
- class AppKernel extends Kernel
46
- {
47
- public function registerBundles()
48
- {
49
- $bundles = array(
50
- // ...
51
- new BM\BackupManagerBundle\BMBackupManagerBundle(),
52
- );
53
- }
54
- }
43
+ // config/bundles.php
44
+
45
+ return [
46
+ BM\BackupManagerBundle\BMBackupManagerBundle::class => ['all' => true],
47
+ // ...
48
+ ];
49
+
55
50
```
56
51
57
52
Step 3: Configure your databases and filesystems
@@ -142,9 +137,21 @@ To backup from any configured database.
142
137
Backup the development database to ` Amazon S3`. The S3 backup path will be `test/backup.sql.gz` in the end, when `gzip` is done with it.
143
138
144
139
` ` ` php
145
- $this->container->get('backup_manager')->makeBackup()->run('development', [new Destination('s3', 'test/backup.sql')], 'gzip');
140
+ class Foo {
141
+ private $backupManager;
142
+
143
+ public function __construct(BackupManager $backupManager) {
144
+ $this->backupManager = $backupManager;
145
+ }
146
+
147
+ public function bar() {
148
+ $this->backupManager->makeBackup()->run('development', [new Destination('s3', 'test/backup.sql')], 'gzip');
149
+ }
150
+ }
146
151
` ` `
147
152
153
+ Or with a command :
154
+
148
155
` ` ` bash
149
156
php bin/console backup-manager:backup development s3 -c gzip --filename test/backup.sql
150
157
` ` `
@@ -155,9 +162,21 @@ To restore from any configured filesystem.
155
162
Restore the database file `test/backup.sql.gz` from `Amazon S3` to the `development` database.
156
163
157
164
` ` ` php
158
- $this->container->get('backup_manager')->makeRestore()->run('s3', 'test/backup.sql.gz', 'development', 'gzip');
165
+ class Foo {
166
+ private $backupManager;
167
+
168
+ public function __construct(BackupManager $backupManager) {
169
+ $this->backupManager = $backupManager;
170
+ }
171
+
172
+ public function bar() {
173
+ $this->backupManager->makeRestore()->run('s3', 'test/backup.sql.gz', 'development', 'gzip');
174
+ }
175
+ }
159
176
` ` `
160
177
178
+ Or with a command :
179
+
161
180
` ` ` bash
162
181
php bin/console backup-manager:restore development s3 test/backup.sql.gz -c gzip
163
182
` ` `
0 commit comments