1 telemetry.module | telemetry_get_data() |
Retrieve the Telemetry data values from modules.
File
- core/
modules/ telemetry/ telemetry.module, line 66 - Collects usage information to help improve Backdrop CMS.
Code
function telemetry_get_data() {
$telemetry_values = &backdrop_static(__FUNCTION__, array());
if (!empty($telemetry_values)) {
return $telemetry_values;
}
// Get any new values that have not yet been retrieved this request.
$telemetry_info = telemetry_get_info();
foreach ($telemetry_info as $project => $project_data) {
if ($project === 'backdrop') {
$telemetry_values[$project]['version'] = BACKDROP_VERSION;
}
else {
$first_data = reset($project_data);
$module_info = system_get_info('module', $first_data['module']);
if (isset($module_info['version'])) {
$telemetry_values[$project]['version'] = $module_info['version'];
}
else {
$telemetry_values[$project]['version'] = 'unknown';
}
}
foreach ($project_data as $item_key => $item) {
$value = module_invoke($item['module'], 'telemetry_data', $item_key);
$telemetry_values[$project][$item_key] = (string) $value;
}
}
backdrop_alter('telemetry_data', $telemetry_values);
return $telemetry_values;
}