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

Add install/activate/unactivate plugin console commands #5862

Merged

Conversation

cedric-anne
Copy link
Member

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -

New commands to be able to install and activate plugins from CLI, in order to make insctallation scription easier.

image

@cedric-anne cedric-anne added this to the 9.5.0 milestone May 3, 2019
@cedric-anne cedric-anne self-assigned this May 3, 2019
@cedric-anne
Copy link
Member Author

For plugins using Migration class, it is not possible yet to have a clean output. Indeed, migration class flushes messages instantly and gives no ability to control this.
Example with fusioninventory plugin:
image

A solution could be to rework migration in 3 classes:

  • a AbstractMigration class, that handles logic part of migration,
  • a UiMigration class extending AbstractMigration, that handle displaying of messages on currentUI,
  • a CliMigration class extending AbstractMigration, that handle displaying of messages on currentUI.
    Then, to enfore usage of the UiMigration or the CliMigration class depending on context, GLPI init process could declare a class alias (class_alias(\UiMigration::class, 'Migration'); or class_alias(\CliMigration::class, 'Migration');)

This may looks as a hack, but, unless I miss something, it will prevent any breaking change for existing code.

@cedric-anne
Copy link
Member Author

I merged CliMigration into Migration and adapt output to context.
Now output is clean:
image

@cedric-anne cedric-anne marked this pull request as ready for review May 6, 2019 08:56
@cedric-anne
Copy link
Member Author

@flegastelois I just updated to last release of symfony/console. No the autocomplete feature should work for multiple choices, according to symfony/symfony#31377.

@trasher trasher force-pushed the 9.5/plugin-console-command branch from c8501fd to 18a32c1 Compare June 5, 2019 07:56
@trasher trasher merged commit ef3c709 into glpi-project:9.5/bugfixes Jun 5, 2019
@cedric-anne cedric-anne deleted the 9.5/plugin-console-command branch June 6, 2019 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants