Skip to content

Commit c2ea5db

Browse files
committed
#152: Run all site:create:* commands after site:create so that it can be used as an event mechanism
1 parent 28bffe7 commit c2ea5db

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/Joomlatools/Console/Command/Site/Create.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,26 @@ protected function execute(InputInterface $input, OutputInterface $output)
206206
$command->run(new ArrayInput($arguments), $output);
207207
}
208208

209+
/*
210+
* Run all site:create:* commands after site creation
211+
*/
212+
try {
213+
$commands = $this->getApplication()->all('site:create');
214+
215+
foreach ($commands as $command) {
216+
$arguments = array(
217+
$command->getName(),
218+
'site' => $this->site,
219+
'--www' => $this->www
220+
);
221+
$command->setApplication($this->getApplication());
222+
$command->run(new ArrayInput($arguments), $output);
223+
}
224+
}
225+
catch (\Symfony\Component\Console\Exception\NamespaceNotFoundException $e) {}
226+
catch (\Symfony\Component\Console\Exception\CommandNotFoundException $e) {}
227+
228+
209229
return 0;
210230
}
211231

0 commit comments

Comments
 (0)