Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Registry.php

function Registry::transportFactory

Get transport factory registered for protocol. If $protocol contains a content-type eg `http/xyz` then only the first part, `http`, is used.

3 calls to Registry::transportFactory()
LogsExporterFactory::buildTransport in vendor/open-telemetry/exporter-otlp/LogsExporterFactory.php
@psalm-suppress UndefinedClass
MetricExporterFactory::buildTransport in vendor/open-telemetry/exporter-otlp/MetricExporterFactory.php
@psalm-suppress UndefinedClass
SpanExporterFactory::buildTransport in vendor/open-telemetry/exporter-otlp/SpanExporterFactory.php
@psalm-suppress ArgumentTypeCoercion @psalm-suppress UndefinedClass

File

vendor/open-telemetry/sdk/Registry.php, line 155

Class

Registry
A registry to enable central registration of components that the SDK requires but which may be provided by non-SDK modules, such as contrib and extension. @todo [breaking] deprecate this mechanism of setting up components, in favor of using SPI.

Namespace

OpenTelemetry\SDK

Code

public static function transportFactory(string $protocol) : TransportFactoryInterface {
    $protocol = explode('/', $protocol)[0];
    if (!array_key_exists($protocol, self::$transportFactories)) {
        throw new RuntimeException('Transport factory not defined for protocol: ' . $protocol);
    }
    $class = self::$transportFactories[$protocol];
    $factory = is_callable($class) ? $class : new $class();
    assert($factory instanceof TransportFactoryInterface);
    return $factory;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal