rules_test.module in Rules 6
Rules engine testing module
File
rules_test/rules_test.moduleView source
<?php
/**
* @file Rules engine testing module
*/
/**
* Returns the log and clears it afterwards
*/
function rules_test_show_log(&$error) {
global $_rules_log;
if (is_array($_rules_log) && count($_rules_log)) {
$i = 0;
$msg = _rules_show_log($i, $_rules_log, $error);
$_rules_log = NULL;
return $msg;
}
return FALSE;
}
/**
* Makes sure the rules engine doesn't clean up the log, so that we can access it
*/
function rules_test_keep_rules_log() {
global $_rules_exec_log;
if (!isset($_rules_exec_log)) {
$_rules_exec_log = array();
}
$_rules_exec_log['rules_test_keep_log'] = 'rules_test_keep_log';
}
/**
* Cleans up
*/
function rules_test_done() {
global $_rules_exec_log;
if (isset($_rules_exec_log)) {
unset($_rules_exec_log['rules_test_keep_log']);
}
}
Functions
Name | Description |
---|---|
rules_test_done | Cleans up |
rules_test_keep_rules_log | Makes sure the rules engine doesn't clean up the log, so that we can access it |
rules_test_show_log | Returns the log and clears it afterwards |