mirror of
https://github.com/librenms/librenms.git
synced 2024-09-29 06:16:43 +00:00
Merge pull request #871 from f0o/issue-870
Pre-Formatting rules to make parsing easier.
This commit is contained in:
commit
ce8193d541
@ -35,6 +35,9 @@ function GenSQL($rule) {
|
|||||||
if( empty($rule) ) {
|
if( empty($rule) ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
//Pretty-print rule to dissect easier
|
||||||
|
$pretty = array('*' => ' * ', '(' => ' ( ', ')' => ' ) ', '/' => ' / ', '&&' => ' && ', '||' => ' || ');
|
||||||
|
$rule = str_replace(array_keys($pretty),$pretty,$rule);
|
||||||
$tmp = explode(" ",$rule);
|
$tmp = explode(" ",$rule);
|
||||||
$tables = array();
|
$tables = array();
|
||||||
foreach( $tmp as $opt ) {
|
foreach( $tmp as $opt ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user