Moved NVD CVE parse progress to update_db and changed download progress to update overall instead of each file progress (bug #6)

Added include for autoload in helper.inc (bug #7)
Removed a few unnecessary variables
This commit is contained in:
2018-09-06 13:43:23 -04:00
parent 082ccd5381
commit d41c1f9e21
4 changed files with 12 additions and 22 deletions

View File

@ -65,7 +65,6 @@ print "Currently " . count($existing_cves) . " in DB" . PHP_EOL . "Parsing: " .
$db_cpes = [];
$new_cves = [];
$new_cve_refs = [];
$new_cve_web = [];
$sw_rows = [];
$new = 0;
$existing = 0;
@ -82,9 +81,6 @@ $cve_fields = [
$ref_fields = [
'cve_seq', 'source', 'url', 'val'
];
$web_fields = [
'cve_id', 'xml'
];
foreach ($json->CVE_Items as $cve) {
if (!isset($existing_cves["{$cve->cve->CVE_data_meta->ID}"])) {
@ -168,18 +164,9 @@ foreach ($json->CVE_Items as $cve) {
$new_cves = [];
$new_cve_refs = [];
$new_cve_web = [];
$sw_rows = [];
print "\t" . ($existing + $new) . " completed" . PHP_EOL;
$db->help->update("settings", ['meta_value' => number_format((($existing + $new) / count($json->CVE_Items)) * 100, 2)], [
[
'field' => 'meta_key',
'value' => 'nvd-cve-progress'
]
]);
$db->help->execute();
}
}