1 | <?php |
||
22 | class SetupCommand extends AbstractCommand |
||
23 | { |
||
24 | /** |
||
25 | * The name and signature of the console command. |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $signature = 'aimeos:setup |
||
30 | {site=default : Site for updating database entries} |
||
31 | {tplsite=default : Site used as template for creating the new one} |
||
32 | {--task : Name of the setup task that should be executed} |
||
33 | {--action=migrate : Action name that should be executed, i.e. "migrate", "rollback", "clean"} |
||
34 | {--option= : Setup configuration, name and value are separated by ":" like "setup/default/demo:1"} |
||
35 | '; |
||
36 | |||
37 | /** |
||
38 | * The console command description. |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $description = 'Initialize or update the Aimeos database tables'; |
||
43 | |||
44 | |||
45 | /** |
||
46 | * Execute the console command. |
||
47 | * |
||
48 | * @return mixed |
||
49 | */ |
||
50 | public function handle() |
||
87 | |||
88 | |||
89 | /** |
||
90 | * Returns the database configuration from the config object. |
||
91 | * |
||
92 | * @param \Aimeos\MW\Config\Iface $conf Config object |
||
93 | * @return array Multi-dimensional associative list of database configuration parameters |
||
94 | */ |
||
95 | protected function getDbConfig( \Aimeos\MW\Config\Iface $conf ) |
||
108 | |||
109 | |||
110 | /** |
||
111 | * Extracts the configuration options from the input object and updates the configuration values in the config object. |
||
112 | * |
||
113 | * @param \Aimeos\MW\Config\Iface $conf Configuration object |
||
114 | * @param array Associative list of database configurations |
||
115 | * @throws \RuntimeException If the format of the options is invalid |
||
116 | */ |
||
117 | protected function setOptions( \Aimeos\MW\Config\Iface $conf ) |
||
125 | } |
||
126 |