Skip to content

Commit bee12f9

Browse files
committed
Merge branch 'develop'
Merge details: commit 7cf826c Author: Jelle Sebreghts <sebreghts.jelle@gmail.com> Date: Thu Apr 13 11:02:27 2023 Remove stackspace adapter commit f4bad67 Author: Jelle Sebreghts <sebreghts.jelle@gmail.com> Date: Thu Apr 13 10:20:22 2023 Update to our own fork of backup-manager The backup-manager/backup-manager package seems abandoned. commit 33166b8 Author: Jelle Sebreghts <sebreghts.jelle@gmail.com> Date: Tue Nov 8 15:18:40 2022 Add documentation for the db config event
2 parents 3385baf + 7cf826c commit bee12f9

16 files changed

+86
-31
lines changed

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,35 @@ class RoboFile extends \Robo\Tasks
274274

275275
`vendor/bin/robo digipolis:database-backup [DATABASE] [OPTIONS]`
276276

277+
#### Use events for default configuration
278+
279+
Implement an [on-event hook](https://github.com/consolidation/annotated-command#on-event-hook)
280+
for the digipolis-db-config event to return the datbase config
281+
[as specified above](#database-configuration-options) used by this command. For
282+
example:
283+
284+
```php
285+
/**
286+
* @hook on-event digipolis-db-config
287+
*/
288+
public function defaultDbConfig()
289+
{
290+
$dbConfig = [];
291+
$dbConfig['default'] = [
292+
'type' => 'mysql',
293+
'host' => 'localhost',
294+
'port' => '3306',
295+
'user' => 'root',
296+
'pass' => '$up3r$3cr3tP@$$w0rD',
297+
'database' => 'my_database',
298+
'structureTables' => [],
299+
'extra' => '--skip-add-locks --no-tablespaces',
300+
];
301+
302+
return $dbConfig;
303+
}
304+
```
305+
277306
#### Arguments
278307

279308
##### DATABASE
@@ -313,6 +342,35 @@ The destination type (e.g. `local`, `dropbox`, `ftp`). Defaults to `local`.
313342

314343
`vendor/bin/robo digipolis:database-restore [DATABASE] [OPTIONS]`
315344

345+
#### Use events for default configuration
346+
347+
Implement an [on-event hook](https://github.com/consolidation/annotated-command#on-event-hook)
348+
for the digipolis-db-config event to return the datbase config
349+
[as specified above](#database-configuration-options) used by this command. For
350+
example:
351+
352+
```php
353+
/**
354+
* @hook on-event digipolis-db-config
355+
*/
356+
public function defaultDbConfig()
357+
{
358+
$dbConfig = [];
359+
$dbConfig['default'] = [
360+
'type' => 'mysql',
361+
'host' => 'localhost',
362+
'port' => '3306',
363+
'user' => 'root',
364+
'pass' => '$up3r$3cr3tP@$$w0rD',
365+
'database' => 'my_database',
366+
'structureTables' => [],
367+
'extra' => '--skip-add-locks --no-tablespaces',
368+
];
369+
370+
return $dbConfig;
371+
}
372+
```
373+
316374
#### Arguments
317375

318376
##### DATABASE

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"require": {
88
"consolidation/robo": "^3.0",
99
"phpseclib/phpseclib": "^3.0",
10-
"backup-manager/backup-manager": "^3",
11-
"league/flysystem": "^1",
10+
"district09/backup-manager": "^4.0",
1211
"gordalina/cachetool": "^8",
1312
"digipolisgent/command-builder": "^1.2",
1413
"digipolisgent/robo-digipolis-general": "^2.0.0"

src/BackupManager/Adapter/BackupManagerAdapter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
namespace DigipolisGent\Robo\Task\Deploy\BackupManager\Adapter;
44

5-
use BackupManager\Manager;
5+
use District09\BackupManager\Manager;
66

77
class BackupManagerAdapter implements BackupManagerAdapterInterface
88
{
99
/**
1010
* The backup manager.
1111
*
12-
* @var \BackupManager\Manager
12+
* @var \District09\BackupManager\Manager
1313
*/
1414
protected $manager;
1515

src/BackupManager/Adapter/BackupProcedureAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace DigipolisGent\Robo\Task\Deploy\BackupManager\Adapter;
44

5-
use BackupManager\Procedures\BackupProcedure;
5+
use District09\BackupManager\Procedures\BackupProcedure;
66

77
class BackupProcedureAdapter implements BackupProcedureAdapterInterface
88
{

src/BackupManager/Adapter/BackupProcedureAdapterInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface BackupProcedureAdapterInterface
1010
*
1111
* @param string $database
1212
* The database name to backup.
13-
* @param \BackupManager\Filesystems\Destination[] $destinations
13+
* @param \District09\BackupManager\Filesystems\Destination[] $destinations
1414
* The destinations to backup to.
1515
* @param string $compression
1616
* The compression to use for the backup.

src/BackupManager/Adapter/RestoreProcedureAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace DigipolisGent\Robo\Task\Deploy\BackupManager\Adapter;
44

5-
use BackupManager\Procedures\RestoreProcedure;
5+
use District09\BackupManager\Procedures\RestoreProcedure;
66

77
class RestoreProcedureAdapter implements RestoreProcedureAdapterInterface
88
{

src/BackupManager/Compressors/TarCompressor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace DigipolisGent\Robo\Task\Deploy\BackupManager\Compressors;
44

5-
use BackupManager\Compressors\Compressor;
5+
use District09\BackupManager\Compressors\Compressor;
66

77
class TarCompressor implements Compressor
88
{

src/BackupManager/Databases/MysqlDatabase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace DigipolisGent\Robo\Task\Deploy\BackupManager\Databases;
44

5-
use BackupManager\Databases\MysqlDatabase as Mysql;
5+
use District09\BackupManager\Databases\MysqlDatabase as Mysql;
66

77
class MysqlDatabase extends Mysql
88
{

src/BackupManager/Factory/BackupManagerFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace DigipolisGent\Robo\Task\Deploy\BackupManager\Factory;
44

5-
use BackupManager\Manager;
5+
use District09\BackupManager\Manager;
66
use DigipolisGent\Robo\Task\Deploy\BackupManager\Adapter\BackupManagerAdapter;
77

88
class BackupManagerFactory implements BackupManagerFactoryInterface

src/BackupManager/Factory/CompressorProviderFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace DigipolisGent\Robo\Task\Deploy\BackupManager\Factory;
44

5-
use BackupManager\Compressors\CompressorProvider;
6-
use BackupManager\Compressors\GzipCompressor;
7-
use BackupManager\Compressors\NullCompressor;
5+
use District09\BackupManager\Compressors\CompressorProvider;
6+
use District09\BackupManager\Compressors\GzipCompressor;
7+
use District09\BackupManager\Compressors\NullCompressor;
88
use DigipolisGent\Robo\Task\Deploy\BackupManager\Compressors\TarCompressor;
99

1010
class CompressorProviderFactory implements CompressorProviderFactoryInterface

0 commit comments

Comments
 (0)