You are here

function rules_execute_php_eval in Rules 7.2

Action and condition callback: Execute PHP code.

Related topics

2 string references to 'rules_execute_php_eval'
rules_php_action_info in modules/php.rules.inc
Implements hook_rules_action_info() on behalf of the php module.
rules_php_condition_info in modules/php.rules.inc
Implements hook_rules_condition_info() on behalf of the PHP module.

File

modules/php.eval.inc, line 131
Contains rules integration for the php module needed during evaluation.

Code

function rules_execute_php_eval($code, $settings, $state, $element) {
  $data = array();
  if (!empty($settings['used_vars'])) {
    foreach ($settings['used_vars'] as $key => $var_name) {
      $data[$var_name] = $state
        ->get($var_name);
    }
  }
  return rules_php_eval_return($code, rules_unwrap_data($data));
}