joomla/cve

Joomla CVE 包

3.0.0 2023-10-05 20:26 UTC

This package is auto-updated.

Last update: 2024-09-05 22:34:37 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

需要 PHP 7 >= 7.3 或 PHP 8 < 8.2

使用 CVE 包

tbd

实例化 CVE

实例化 CVE 服务很简单

use Joomla\Cve\CveService;

$cve = new CveService;

这会创建一个基本的 Github 对象,可用于访问mitre.org上的公共资源。

在大多数情况下,需要指定额外的选项。这可以通过注入包含您首选选项的 Registry 对象来完成。支持可选地提供自定义 CVE 账户用户名和密码,以及 CVE API 服务器的自定义 URL(例如用于测试目的)。

use Joomla\Cve\CveService;
use Joomla\Registry\Registry;

$options = new Registry;
$options->set('api.org', 'cve_org');
$options->set('api.username', 'cve_username');
$options->set('api.key', 'cve_key');
$options->set('api.url', 'http://localhost:3000');

$cve = new CveService($options);

可用选项

通过 Composer 安装

"joomla/cve": "~2.0@dev" 添加到 composer.json 中的 require 块,然后运行 composer install

{
	"require": {
		"joomla/cve": "~2.0@dev"
	}
}

或者,您可以直接在命令行运行以下命令

composer require joomla/cve "~2.0@dev"

如果您想包含测试源,请使用

composer require --prefer-source joomla/cve "~2.0"