Skip to main content
3 votes
Accepted

Is there a way to know which Drush command is executed from within a hook implementation?

You should be able to get all information from Drush::input() and Drush::getApplication(), but first check if you are running from command line and Drush is installed: if (PHP_SAPI === 'cli' &&...
4uk4's user avatar
  • 101k
2 votes

Is there a way to know which Drush command is executed from within a hook implementation?

This isn't exactly an answer to your question, but is there a reason you must do those specific things in those hooks as opposed to using the Migrate API Events and Hooks. It seems those could work ...
greggles's user avatar
  • 5,270
1 vote
Accepted

How do you set up Drush Aliases in DDEV?

Following the instructions at https://www.drush.org/12.x/site-aliases/ and placing the YAML file in $PROJECT/drush/sites/self.site.yml you can execute vendor/bin/drush sa outside the container and you ...
mona lisa's user avatar
  • 5,974
1 vote

drush updatedb fails to complete: Bootstrap fails at phase 5, can't find Drush config file

You did not load a copy of the site's database into DDEV with ddev import-db and are not prefixing Drush commands with ddev exec, as in ddev exec drush udpatedb.
mona lisa's user avatar
  • 5,974
1 vote
Accepted

Using drush PolicyCommands.php

This works just fine. drush sql:sync @self @prod will first ask a question if we want to destroy the live database and replace it with our local and our validation function is executed only if we ...
juliusfischer's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible