@@ -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
0 commit comments