class Advisor (View source)

A simple rules engine, that executes the rules in the advisory_rules files.

Constants

private GENERIC_RULES_FILE

private BEFORE_MYSQL80003_RULES_FILE

Methods

__construct(DatabaseInterface $dbi, ExpressionLanguage $expression)

No description

void
setVariable(string|int $variable, mixed $value)

No description

array
getRunResult()

No description

array
run()

No description

void
addRule(string $type, array $rule)

Adds a rule to the result list

static string
byTime(float $num, int $precision)

Formats interval like 10 per hour

Details

__construct(DatabaseInterface $dbi, ExpressionLanguage $expression)

No description

Parameters

DatabaseInterface $dbi

DatabaseInterface object

ExpressionLanguage $expression

ExpressionLanguage object

void setVariable(string|int $variable, mixed $value)

No description

Parameters

string|int $variable

Variable to set

mixed $value

Value to set

Return Value

void

array getRunResult()

No description

Return Value

array

array run()

No description

Return Value

array

void addRule(string $type, array $rule)

Adds a rule to the result list

Parameters

string $type

type of rule

array $rule

rule itself

Return Value

void

static string byTime(float $num, int $precision)

Formats interval like 10 per hour

Parameters

float $num

number to format

int $precision

required precision

Return Value

string

formatted string