I have been trying to run a drush command from Rules Action PHP Execute.
Settings are:
Event: Cron tasks
Action: PHP Execute (php filter is enabled)
Value:
drush_invoke('my_custom_command'); //doesn't work - although this 'drush my_custom_command' runs fine through the command line, doesn't work here. It gives the WSOD and upon inspection i got undefined function in the log. So i tried,
drush_invoke('cache-clear','all'); //doesn't work either
How do I accomplish this?
Ideally what I am trying to do is to run a function in an include file of my custom module. My custom module.info has -->files[] = my_custom_module.drush.inc; and module is enabled.
How can i attach this function to run using rules action-php exec? I must be doing something wrong. Options, ideas? I'd really appreciate your help.
:)
Comments
Comment #1
mitchell commentedPlease update this issue from our irc conversation.
Assigning to me to remind me close if nothing gets updated.
Comment #2
jumoke commentedI had function in a module:
Needed to call it from Rules.
In Rules Actions, I have:
Execute PHP Code
Value:
mymodule_run_export_trigger($node)Works perfectly.
Thanks mitchell.
Comment #3
jumoke commentedFixed.
Comment #4
mitchell commentedGood job, Jumoke.
Comment #5
mitchell commented