} $b = explode("=", $arg); if (isset($options[$b[0]])) { $options[$b[0]] = $b[1]; } else { $buf .= "unknown key {$b['0']}"; echo $buf; exit; } } if (!file_exists($options['i']) && !file_exists($options['l'])) { echo $buf; exit; } $a = parser($options['i'], $options['l']); $table = htmlPrinter($a); $odir = $options['o'] . $options['r'] . "/"; @mkdir($odir); if (is_dir($odir)) { file_put_contents($odir . 'index.html', $table); } else { file_put_contents('index.html', $table); } /** * This function will first parse the instances.tab file and * get the data metrics for each endpoint. The returned array will then * be merged by prefix name with the LSR and one multidimensional array will * be returned */ function parser($instances, $lsr) {
$options[$b[0]] = $b[1]; } else { echo "unknown key {$b['0']}"; exit; } } if ($options['instances_file'] == '/path/to/instances.tab') { echo "** Specify a valid Virtuoso instances file. **" . PHP_EOL; exit; } if ($options['lsr_file'] == '/path/to/lsr.csv') { echo "** Specify a valid LSR CSV file. **" . PHP_EOL; exit; } $arr = parseBoth($options['instances_file'], $options['lsr_file']); $table = htmlPrinter($arr); echo $table; /** * This function will first parse the instances.tab file and * get the data metrics for each endpoint. The returned array will then * be merged by prefix name with the LSR and one multidimensional array will * be returned */ function parseBoth($instances_fn, $lsr_fn) { $returnMe = array(); $instances_arr = parseInstancesTabFile($instances_fn); $lsr_arr = parseLSR($lsr_fn); $returnMe = joinLSRAndInstancesTab($instances_arr, $lsr_arr); return $returnMe; }