8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Symfony Console component has a pretty nice API for creating a simple console application in a single file. However, it's not document anywhere. See http://www.hackdenver.com/blog/how-to-build-a-command-line-app-in-php for an example.
I think we should add an article to components/console about using this API.
components/console
The text was updated successfully, but these errors were encountered:
@wouterj console component, single command application
Sorry, something went wrong.
@luciantugui both don't tell the nice API as shown in the article I linked.
For the record, this syntax:
<?php require 'vendor/autoload.php'; use Symfony\Component\Console\Application; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; // Create the application $console = new Application('My App', '1.0'); // Register a new command $console ->register('greet') ->setDescription('Greet someone') ->setCode(function (InputInterface $input, OutputInterface $output) { $output->writeln('Hello'); }); // Run the application $console->run();
Closing this as "fixed" because the article https://symfony.com/doc/current/components/console/single_command_tool.html is enough to explain how to create a full Symfony console app in a single app. Thanks!
No branches or pull requests
The Symfony Console component has a pretty nice API for creating a simple console application in a single file. However, it's not document anywhere. See http://www.hackdenver.com/blog/how-to-build-a-command-line-app-in-php for an example.
I think we should add an article to
components/console
about using this API.The text was updated successfully, but these errors were encountered: