@@ -89,10 +89,43 @@ protected function execute(InputInterface $input, OutputInterface $output)
89
89
if ($ input ->getOption ('git ' )/* || $input->getOption('github') !== false*/ ) {
90
90
$ this ->createRepository ($ directory , $ input , $ output );
91
91
}
92
+ }
93
+
94
+ $ helper = $ this ->getHelper ('question ' );
95
+
96
+ $ confirmation = new ConfirmationQuestion ('Now do you want to add additional containers? [default: no] ' , false );
97
+
98
+ $ availableContainers = [
99
+ 'Social Authentication ' => 'apiato/social-auth-container ' ,
100
+ 'Localization ' => 'apiato/localization-container ' ,
101
+ 'Payments ' => 'apiato/payment-container ' ,
102
+ 'Settings ' => 'apiato/settings-container ' ,
103
+ ];
104
+
105
+ if ($ helper ->ask ($ input , $ output , $ confirmation )) {
106
+ $ question = new ChoiceQuestion (
107
+ 'Select all containers you want to install (example: 2,3,4). ' ,
108
+ array_keys ($ availableContainers )
109
+ );
92
110
93
- $ output ->writeln (PHP_EOL . '<comment>Apiato ready! Build something amazing.</comment> ' );
111
+ $ question ->setMultiselect (true );
112
+
113
+ $ selectedContainersArray = $ helper ->ask ($ input , $ output , $ question );
114
+ $ selectedContainersString = "" ;
115
+ $ commands = ['cd ' . $ directory ];
116
+
117
+ foreach (array_keys ($ availableContainers ) as $ availableContainer ) {
118
+ if (in_array ($ availableContainer , $ selectedContainersArray )) {
119
+ $ selectedContainersString .= ' ' . $ availableContainers [$ availableContainer ];
120
+ }
121
+ }
122
+
123
+ array_push ($ commands , $ composer . " require " . $ selectedContainersString );
124
+ $ this ->runCommands ($ commands , $ input , $ output );
94
125
}
95
126
127
+ $ output ->writeln (PHP_EOL . '<comment>Apiato ready! Build something amazing.</comment> ' );
128
+
96
129
return $ process ->getExitCode ();
97
130
}
98
131
0 commit comments