composer / satis

Simple static Composer repository generator - For a full private Composer repo use Private Packagist
MIT License
3.15k stars 519 forks source link

Progamatically running Satis commands pita #508

Open pretzlaw opened 6 years ago

pretzlaw commented 6 years ago

Symfony allows something like this:

$app = new Application();
$app->find('build')->run(...);

to run a command within another ( see https://symfony.com/doc/current/console/calling_commands.html ).

Unfortunately this is not possible with Satis because ::run() depends on the properties \Composer\Satis\Console\Application::$io and/or \Composer\Satis\Console\Application::$composer to be initialized already.

Those two are initialized in \Composer\Satis\Console\Application::doRun(). But doing $app->doRun(...) is a bad solution because it exits (like an exit() || die()) after executing. Except you set \Composer\Satis\Console\Application::$autoExit = false. And if you feel confused now, then you also feel what the problem is.

So please initialize the two properties a bit earlier so that Satis can be used extended that way.

alcohol commented 6 years ago

Satis is entirely maintained and developed by volunteers and open source contributors. It is not actively developed by the Composer core team. We encourage everyone to submit PRs and we will (often) gladly accept them. I can mark your issue as a feature request, but keep in mind that it is up to you or someone else to deliver said feature :-)