@@ -40,18 +40,13 @@ If you are not using Symfony Flex, you need to enable the bundle by adding it to
4040the list of registered bundles in the ` app/AppKernel.php ` file of your project.
4141
4242``` 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+
5550```
5651
5752Step 3: Configure your databases and filesystems
@@ -142,9 +137,21 @@ To backup from any configured database.
142137Backup 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.
143138
144139` ` ` 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+ }
146151` ` `
147152
153+ Or with a command :
154+
148155` ` ` bash
149156php bin/console backup-manager:backup development s3 -c gzip --filename test/backup.sql
150157` ` `
@@ -155,9 +162,21 @@ To restore from any configured filesystem.
155162Restore the database file `test/backup.sql.gz` from `Amazon S3` to the `development` database.
156163
157164` ` ` 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+ }
159176` ` `
160177
178+ Or with a command :
179+
161180` ` ` bash
162181php bin/console backup-manager:restore development s3 test/backup.sql.gz -c gzip
163182` ` `
0 commit comments