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

Converting from drush to bee #449

Open
jenlampton opened this issue Jan 16, 2025 · 1 comment
Open

Converting from drush to bee #449

jenlampton opened this issue Jan 16, 2025 · 1 comment

Comments

@jenlampton
Copy link
Member

@yorkshire-pudding I've taken the liberty of updating the Converting integrations from Drush wiki page to include some of the conversions I needed to research as part of elysia_cron's bee implementation.

But there are a few things I've not been able to find matches for, starting with drush_get_command() - is there an easy way to get the whole command that was given to bee?

Additionally, when I'm in a module's normal operations and do not have access to the callback function's arguments, how do I get the options and arguments that were passed along with the command? (In Drush this was done with drush_get_arguments() and drush_get_options())

For example, there is a elysia_cron_debug() function that will put it's debug information in watchdog OR print output to drush (and now bee) - but from within that function I can nolonger reach anything specific to the bee callback. Do you have a recommendation for how to best approach these situations?

@yorkshire-pudding
Copy link
Collaborator

@jenlampton

Wiki pages are normally populated from the docs folder (I need to make this clearer) and are normally locked down but I guess your superpowers give you access. I could copy your edits to the relevant file, but it will then have my name against the edits. Are you ok to make those edits in the docs file either as a PR, or if you want to just do a commit, I've fine with that from you?

Note - I am willing to consider adding the docs to docs.b.org but it needs backdrop-ops/docs.backdropcms.org#243 first

Bee has two globals - $_bee_arguments and $_bee_options that functions use to get arguments. There is also $_bee_command that will give you the command
Looking at that modules code, it uses a global variable to pass from drush to the module: $_elysia_cron_drush

If you were to declare:

global $_bee_arguments, $_bee_options, $_bee_command, $_elysia_cron_bee;

Then you should be able to add whatever you need from those to $_elysia_cron_bee and then use that in the module functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants