1 telemetry.telemetry.inc telemetry_telemetry_data($key)

Implements hook_telemetry_data().

File

core/modules/telemetry/telemetry.telemetry.inc, line 67
Telemetry hook implementations.

Code

function telemetry_telemetry_data($key) {
  switch ($key) {
    case 'php_version':
      return PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION;
    case 'mysql_version':
      return Database::getConnection()->databaseType() === 'mysql' ? Database::getConnection()->version() : NULL;
    case 'server_os':
      return PHP_OS;
    case 'web_server':
      if (backdrop_is_apache()) {
        return 'Apache';
      }
      elseif (backdrop_is_nginx()) {
        return 'nginx';
      }
      elseif (backdrop_is_litespeed()) {
        return 'LiteSpeed';
      }
      else {
        return 'Other';
      }
    case 'install_profile':
      return backdrop_get_profile();
    case 'multisite':
      return conf_path() == '.' ? 'No' : 'Yes';
    case 'ckeditor_module_version':
      $ckeditor4 = module_exists('ckeditor');
      $ckeditor5 = module_exists('ckeditor5');
      if ($ckeditor4 && $ckeditor5) {
        return 'Both CKEditor 4 and 5';
      }
      elseif ($ckeditor4) {
        return 'CKEditor 4';
      }
      elseif ($ckeditor5) {
        return 'CKEditor 5';
      }
      else {
        return 'Neither';
      }
    case 'drupal_compatibility':
      return settings_get('backdrop_drupal_compatibility') ? 'Yes' : 'No';
    case 'jquery_version':
      $jquery = backdrop_get_library('system', 'jquery');
      return $jquery['version'];
    case 'update_module':
      return module_exists('update') ? 'Yes' : 'No';
  }
}