Closed l0gicgate closed 4 years ago
@l0gicgate I highly recommend Symfony Console. This is a thing that have everything we want to create a solid CLI application, despite its dependencies. As for Robo, It has Symfony Console in dependency, i think better to use the Symfony Console directly.
As a core slim package going with the more stable option seems safer for preventing major breaking changes in the long term.
The console entry point will also be separate from the http entry point. Although potentially we may consider setting up something to allow http requests to trigger console commands, we could majorly partition the console dependencies from the http dependencies.
I think Symfony Console is the "golden standard" in the PHP ecosystem. In Slim 4 everything has been abstracted via interfaces. But in this case it would (maybe) make more sense to re-use the Symfony console package and provide a simple interface for Slim commands. There is no PSR / FIG interface for this use case. However, this package could provide its own interfaces, for example
File: Slim\Console\Interfaces\CommandInterface.php
<?php
namespace Slim\Console\Interfaces;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
interface CommandInterface
{
public function execute(InputInterface $input, OutputInterface $output): int
}
Whereas Symphony Console is the "gold standard" for CLI in PHP, Robo is the "gold standard" for task runners. Separate question: Are we planning on using DI in this project (I nominate http://php-di.org/ as the default) with the ability to add/replace with any DI that follows the PSR standards.
@RyanNerd see #3
As per the original thread we discussed a few different frameworks that we could use as the underlying console runners. Namely:
Console Runners
Task Runners
We seemed to have more positive feedback around
symfony/console
. I am very familiar with their system and they will be providing long term support for the repo but let's look at the dependency overhead:On the other hand we have
phpleague/climate
but my concern is that the package is soon going to go unmaintained. The repository has issues/PRs that go back all the way to 2014:I'm open to other suggestions for frameworks / task runners.