PMA\libraries\Advisor::run PHP Method

run() public method

Parses and executes advisor rules
public run ( ) : array
return array with run and parse results
    public function run()
    {
        // HowTo: A simple Advisory system in 3 easy steps.
        // Step 1: Get some variables to evaluate on
        $this->setVariables(array_merge($GLOBALS['dbi']->fetchResult('SHOW GLOBAL STATUS', 0, 1), $GLOBALS['dbi']->fetchResult('SHOW GLOBAL VARIABLES', 0, 1)));
        // Add total memory to variables as well
        include_once 'libraries/sysinfo.lib.php';
        $sysinfo = PMA_getSysInfo();
        $memory = $sysinfo->memory();
        $this->variables['system_memory'] = isset($memory['MemTotal']) ? $memory['MemTotal'] : 0;
        // Step 2: Read and parse the list of rules
        $this->setParseResult(static::parseRulesFile());
        // Step 3: Feed the variables to the rules and let them fire. Sets
        // $runResult
        $this->runRules();
        return array('parse' => array('errors' => $this->parseResult['errors']), 'run' => $this->runResult);
    }