function getResultIDs($startDate, $endDate) { $idx = 0; $ids = array(); $dateArray = dateRangeArray($startDate, $endDate); foreach ($dateArray as $dte) { $dirpath = "/var/www/html/results/{$dte}/"; $dh = opendir($dirpath); while (false !== ($file = readdir($dh))) { if ($file == ".." || $file == ".") { continue; } try { $info = parse_ini_file("{$dirpath}/{$file}/testinfo.ini", true); } catch (Exception $e) { error_log("[WPTMonitor] Failed while reading testinfo ini: " . $e->getMessage()); print $e; } $val = array(); $id = $info["test"]["id"]; $startTime = $info["test"]["startTime"]; $endTime = $info["test"]["completeTime"]; $val["startTime"] = $startTime; $val["endTime"] = $endTime; $val["id"] = $id; $val["date"] = "20" . $dte; $ids[$idx] = $val; $idx++; } closedir($dh); } return $ids; }
function getResultIDs($startDate, $endDate) { $idx = 0; $ids = array(); $dateArray = dateRangeArray($startDate, $endDate); foreach ($dateArray as $dte) { $dirpath = "/var/www/html/results/{$dte}/"; $dh = opendir($dirpath); while (false !== ($file = readdir($dh))) { if ($file == ".." || $file == ".") { continue; } $info = parse_ini_file("{$dirpath}/{$file}/testinfo.ini", true); $val = array(); $id = $info["test"]["id"]; $startTime = $info["test"]["startTime"]; $endTime = $info["test"]["completeTime"]; $val["startTime"] = $startTime; $val["endTime"] = $endTime; $val["id"] = $id; $val["date"] = $dte; $ids[$idx] = $val; $idx++; } closedir($dh); } return $ids; }