本文整理汇总了PHP中Software::get_models_by_cpe方法的典型用法代码示例。如果您正苦于以下问题:PHP Software::get_models_by_cpe方法的具体用法?PHP Software::get_models_by_cpe怎么用?PHP Software::get_models_by_cpe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Software
的用法示例。
在下文中一共展示了Software::get_models_by_cpe方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_model_list
function get_model_list($conn, $data)
{
$response = array();
$vendor = $data['vendor'];
ossim_valid($vendor, OSS_NULLABLE, OSS_ALPHA, OSS_PUNC_EXT, 'illegal:' . _("Vendor"));
check_ossim_error();
if (empty($vendor)) {
$items = array();
} else {
$vendor = escape_sql($vendor, $conn);
$items = Software::get_models_by_cpe($conn, $vendor, TRUE);
}
$response['error'] = FALSE;
$response['data']['items'] = $items;
return $response;
}
示例2: array
$vendors = array();
Av_exception::write_log(Av_exception::USER_ERROR, $e->getMessage());
}
$plugin_list = array();
try {
$related_sensors = Asset_host_sensors::get_sensors_by_id($conn, $asset_id);
$selected_sensor = $sensor_id != '' ? $sensor_id : key($related_sensors);
$active_plugins = Plugin::get_plugins_by_device(Util::uuid_format($selected_sensor));
$asset_plugins = is_array($active_plugins[$asset_id]) ? $active_plugins[$asset_id] : array();
foreach ($asset_plugins as $pdata) {
$model_list = array();
$version_list = array();
list($vendor, $model, $version) = Plugin::translate_cpe_to_software($pdata['cpe']);
if ($vendor != '') {
try {
$model_list = Software::get_models_by_cpe($conn, $vendor, TRUE);
} catch (Exception $e) {
Av_exception::write_log(Av_exception::USER_ERROR, $e->getMessage());
}
}
if ($model != '') {
try {
$version_list = Software::get_versions_by_cpe($conn, $model, TRUE);
} catch (Exception $e) {
Av_exception::write_log(Av_exception::USER_ERROR, $e->getMessage());
}
}
$plugin_list[] = array('vendor' => $vendor, 'model' => $model, 'version' => $version, 'model_list' => $model_list, 'version_list' => $version_list);
}
} catch (Exception $e) {
Av_exception::write_log(Av_exception::USER_ERROR, $e->getMessage());