I decided to dispatch some shells from the Installer::postInstall function,
$bakeDatabaseConfig = $io->askAndValidate(
'<info>Bake Database Config ? (Default to Y)</info> [<comment>Y,n</comment>]? ',
$validator,
10,
'Y'
);
$shell = new ShellDispatcher();
if (in_array($bakeDatabaseConfig, ['Y', 'y'])) {
// cake bake database
$shell->dispatch([
'command' => 'bake database',
'extra' => []
]);
however, I am getting a fatal error…
Fatal error: Call to undefined function Cake\Console\namespaceSplit() ... Console/Shell.php on line 174
It seems that the autoloader isn’t loading the files specified in composer.json when using
composer run-script post-install-cmd
Anyone know if I can use ShellDispatcher from the Installer.php in the App\src\Console?