Skip to content

Example of a console application using Symfony components

License

Notifications You must be signed in to change notification settings

weitzman/console-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Experiments for Drush 14

This blog post was an inspiration for the approach here.

A Console app which explores moving on from AnnotatedCommand in favor of more native use of Console. It currently implements a single command - bin/console.php user:information --help

  1. HookManager replaced by regular EventDispatcher and Listeners
  2. Argument and Option default values are provided by Attribute
  3. Gone are CommandFactory, Parsing into Commandinfo, etc.
  4. See command and listener discovery in bin/console.
  5. This app uses a Symfony container instead of a League container.

Todo

  • Consider the FormatTrait and handle FormatterOptions
  • This app currently uses the Symfony Command object directly. Consider extending it instead, as AnnotatedCommand does today.
    • Consider using configure() method instead of Arg and Option Attributes
    • Deal with extended features like Usages, Topics
    • Deal with DrushCommands methods like logger(), io(), etc.
  • This app uses $services->load() to discover commands and listeners. Listeners must be named with suffixes corresponding to their event. Is OK?
  • This app is using the Symfony container to store commands and listeners. Drush moved away from that recently.
  • Do we need more Events?

About

Example of a console application using Symfony components

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%