Skip to content
New issue

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

[console] Use annotations in Commands #478

dmouse opened this issue Mar 2, 2015 · 4 comments

[console] Use annotations in Commands #478

dmouse opened this issue Mar 2, 2015 · 4 comments


Copy link

@dmouse dmouse commented Mar 2, 2015

The Drupal commands interact with more stuffs that the commands in Symfony, in Drupal, one command can be have many dependencies with other modules or themes or any other scope in your installation.

This approach is to use Annotations to provide metadata on each command to specify dependencies or check another variables in Drupal or any other stuff that interacts with the console.

For example:

 * @DrupalCommand (
 *      dependencies = {
 *          "simpletest"
 *      },
 * )
class TestDebugCommand extends ContainerAwareCommand { ... }
@dmouse dmouse self-assigned this Mar 2, 2015
@jmolivas jmolivas changed the title [Improve] Use annotations in Commands [console] Use annotations in Commands Mar 2, 2015

This comment has been minimized.

Copy link

@enzolutions enzolutions commented Mar 2, 2015


@jmolivas jmolivas added this to the Nice-to-have milestone Jun 12, 2015

This comment has been minimized.

Copy link

@jmolivas jmolivas commented Dec 16, 2015

Are we still trying to add this @dmouse ? any advantage vs the current command discovery method ?


This comment has been minimized.

Copy link

@itsdarrylnorris itsdarrylnorris commented Jan 16, 2016

@dmouse , Can you explain why you added the tag "core-issue"? I'm just curios.

@jmolivas jmolivas removed the core-issue label Feb 10, 2016
jmolivas added a commit that referenced this issue May 5, 2016
* set doctrine annotations and cache file

* changed way to discover commands

* create annotation command

* changed order to register commands

* update params to construct a register helper

* sample to define a command with dependencies

* set commands with not use the drupal installation

* update commands and dependencies

* revert changes in annotations

* added doctrine/annotatios dependecy

* define the annotation reader service

* define the DrupalCommand annotation

* register and read annotations

* added doctrine/commons to use ApcCache

* define annotation service

* move site_helper and kernel_helper to service

* register service helpers in defaultHelperSet

* check if command has the required dependencies

* annotation example

* return service container

* return false if not is a valid command

* doc blocks and type hint

* remove doctrine/commons

* replace Apc with cache files

* added extension field

* resolve dependencies on listener

* rename CommandDependencyResolver to CommandDependencies

* fix class name

* move site helper like service in test

* rollback services to helpers

* remove helpers in service and test

* remove kernel helper dependency within container

This comment has been minimized.

Copy link

@itsdarrylnorris itsdarrylnorris commented May 30, 2016

@dmouse , @jmolivas Shall we close this issue ? This is done.

@jmolivas jmolivas closed this Aug 31, 2016
@jmolivas jmolivas modified the milestone: nice-to-have Dec 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
4 participants
You can’t perform that action at this time.