Psecio\Versionscan\Command\MissingCommand::getCveDetail PHP Method

getCveDetail() private method

private getCveDetail ( $cveId, $output )
    private function getCveDetail($cveId, $output)
    {
        // save the contents locally
        $cacheFile = '/tmp/cache-' . $cveId . '.txt';
        if (!is_file($cacheFile)) {
            // Get the info for the CVE
            $message = 'Fetching for ' . $cveId;
            $cveUrl = 'http://www.cvedetails.com/cve-details.php?t=1&cve_id=' . $cveId;
            $cveDetail = file_get_contents($cveUrl);
            file_put_contents($cacheFile, $cveDetail);
        } else {
            $message = 'Cache found for ' . $cveId;
            $cveDetail = file_get_contents($cacheFile);
        }
        if (strstr($cveDetail, 'Unknown CVE ID') !== false) {
            $message .= ' (no data)';
            $cveDetail = false;
        }
        if ($this->verbose === true) {
            $output->writeLn($message);
        }
        return $cveDetail;
    }