function rules_execute_php_eval

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

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));
}