function RulesSchedulerDefaultTaskHandler::runTask
Implements RulesSchedulerTaskHandlerInterface::runTask().
Overrides RulesSchedulerTaskHandlerInterface::runTask
1 method overrides RulesSchedulerDefaultTaskHandler::runTask()
- RulesTestTaskHandler::runTask in rules_scheduler/
tests/ rules_scheduler_test.inc - Overrides RulesSchedulerDefaultTaskHandler::runTask().
File
-
rules_scheduler/
includes/ rules_scheduler.handler.inc, line 30
Class
- RulesSchedulerDefaultTaskHandler
- Default scheduled task handler.
Code
public function runTask() {
if ($component = rules_get_cache('comp_' . $this->task['config'])) {
$replacements = array(
'%label' => $component->label(),
'%plugin' => $component->plugin(),
);
$replacements['%identifier'] = $this->task['identifier'] ? $this->task['identifier'] : t('without identifier');
rules_log('Scheduled evaluation of %plugin %label, task %identifier.', $replacements, RulesLog::INFO, $component, TRUE);
$state = unserialize($this->task['data']);
$state->restoreBlocks();
// Block the config to prevent any future recursion.
$state->block($component);
// Finally evaluate the component with the given state.
$component->evaluate($state);
$state->unblock($component);
rules_log('Finished evaluation of %plugin %label, task %identifier.', $replacements, RulesLog::INFO, $component, FALSE);
$state->cleanUp();
}
}