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

feat: Allow module writers to add commands to the bin/console command runner #7237

Closed
adunsulag opened this issue Feb 19, 2024 · 2 comments · Fixed by #7238
Closed

feat: Allow module writers to add commands to the bin/console command runner #7237

adunsulag opened this issue Feb 19, 2024 · 2 comments · Fixed by #7238
Labels
developers This issue targets an issue that is for developers/collaborators/module writers/technical users
Milestone

Comments

@adunsulag
Copy link
Sponsor Member

We should allow module writers to add commands to the bin/console command runner by dispatching an event when the command runner grabs the lists of commands to run.

As part of this work we should deprecate the old command runner since new commands are now leveraging the Symfony console project. Since we brought in that dependency we should deprecate the old commands since they were built under the assumption of having a primitive command runner framework so we didn't rely on dependencies.

@sjpadgett
Copy link
Sponsor Member

May I have an example of a use case please?

@adunsulag
Copy link
Sponsor Member Author

I have a module that needs to run a number of command line scripts. Instead of having to go into the module directory and run the scripts from inside the directory, it would be better to tie into the existing command line runner in openemr/bin/console. So you can run something like this:

php bin/console billing-cmd:process-import import-filename.txt

adunsulag added a commit to DiscoverAndChange/openemr that referenced this issue Feb 19, 2024
We change up the OpenEMR command runner to be deprecated and add a
warning notice for people to use the OpenEMR symfony command runner in
bin/console.

Changed up the symfony command runner to use a class that also fires an
event to grab module commands if there exist any in the system.
Deprecated the create client assertions command since that is used in
our FHIR api documentation.  I completely migrated the api documentation
creation command into the symfony command runner.
adunsulag added a commit that referenced this issue Mar 14, 2024
* Fixes #7237 allow modules to add CLI commands.

We change up the OpenEMR command runner to be deprecated and add a
warning notice for people to use the OpenEMR symfony command runner in
bin/console.

Changed up the symfony command runner to use a class that also fires an
event to grab module commands if there exist any in the system.
Deprecated the create client assertions command since that is used in
our FHIR api documentation.  I completely migrated the api documentation
creation command into the symfony command runner.

* Fix copyright notice for paid work.

* Fix command description
sjpadgett added a commit to sjpadgett/openemr that referenced this issue Mar 18, 2024
…_new

* 'master' of https://github.com/openemr/openemr:
  fix: Support google single sign on mode for esign of encounters and forms (openemr#7255)
  chore: ci add mariadb 11.3, change mysql 8.2 to mysql 8.3 (openemr#7273)
  chore: commit 2 that updates github actions for docker builds to prevent deprecations (openemr#7272)
  chore: update github actions for docker builds to prevent deprecations (openemr#7271)
  Fixes openemr#7237 allow modules to add CLI commands. (openemr#7238)
sjpadgett pushed a commit to sjpadgett/openemr that referenced this issue Mar 26, 2024
* Fixes openemr#7237 allow modules to add CLI commands.

We change up the OpenEMR command runner to be deprecated and add a
warning notice for people to use the OpenEMR symfony command runner in
bin/console.

Changed up the symfony command runner to use a class that also fires an
event to grab module commands if there exist any in the system.
Deprecated the create client assertions command since that is used in
our FHIR api documentation.  I completely migrated the api documentation
creation command into the symfony command runner.

* Fix copyright notice for paid work.

* Fix command description

(cherry picked from commit 075f300)
@adunsulag adunsulag added this to the 7.0.2.1 milestone Apr 23, 2024
@adunsulag adunsulag added the developers This issue targets an issue that is for developers/collaborators/module writers/technical users label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developers This issue targets an issue that is for developers/collaborators/module writers/technical users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants