Here is my use case.
I'm importing nodes with the classic migration API and goes through some hooks (like hook_node_presave
, hook_node_delete
...).
I also have another drush command that synchronise content and does some other stuff and goes through those same hooks.
I want to do some specific things in those hooks wether it's called by a back-office action or drush migrate:import
or drush command1
. Is there a way to pass a context of some sort on the drush command that would be retrievable in my hooks ? Or at least to know the hook is executed by a back-office action ?
I looked there and there but it was not satisfying. Knowing it's executed by PHP_CLI is not precise enough for me in my use case.