fix PHP 7.4 preload error (#919)

This commit is contained in:
Piotr Antosik 2023-02-05 11:59:01 +01:00 committed by GitHub
parent c4161a0ebe
commit 24af6ac173
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 23 additions and 9 deletions

View File

@ -74,4 +74,6 @@ abstract class AbstractClock implements ClockInterface
* BC class alias
* @todo: remove in future release. Also in composer.json autoload/files.
*/
class_alias(AbstractClock::class, 'OpenTelemetry\SDK\AbstractClock');
if (!class_exists('OpenTelemetry\SDK\AbstractClock', false)) {
class_alias(AbstractClock::class, 'OpenTelemetry\SDK\AbstractClock');
}

View File

@ -13,7 +13,9 @@ interface ClockInterface extends Moved
/**
* @codeCoverageIgnoreStart
*/
class_alias(ClockInterface::class, 'OpenTelemetry\SDK\ClockInterface');
if (!interface_exists('OpenTelemetry\SDK\ClockInterface', false)) {
class_alias(ClockInterface::class, 'OpenTelemetry\SDK\ClockInterface');
}
/**
* @codeCoverageIgnoreEnd
*/

View File

@ -49,7 +49,9 @@ final class InstrumentationLibrary implements InstrumentationLibraryInterface
}
}
class_alias(InstrumentationLibrary::class, OpenTelemetry_SDK_InstrumentationLibrary);
if (!class_exists(OpenTelemetry_SDK_InstrumentationLibrary, false)) {
class_alias(InstrumentationLibrary::class, OpenTelemetry_SDK_InstrumentationLibrary);
}
/**
* @codeCoverageIgnoreEnd
*/

View File

@ -13,7 +13,9 @@ interface InstrumentationLibraryInterface extends Moved
/**
* @codeCoverageIgnoreStart
*/
class_alias(InstrumentationLibraryInterface::class, 'OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibraryInterface');
if (!interface_exists('OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibraryInterface', false)) {
class_alias(InstrumentationLibraryInterface::class, 'OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibraryInterface');
}
/**
* @codeCoverageIgnoreEnd
*/

View File

@ -25,7 +25,9 @@ final class LoggerHolder
}
}
class_alias(LoggerHolder::class, OpenTelemetry_SDK_Common_Log_LoggerHolder);
if (!class_exists(OpenTelemetry_SDK_Common_Log_LoggerHolder, false)) {
class_alias(LoggerHolder::class, OpenTelemetry_SDK_Common_Log_LoggerHolder);
}
/**
* @codeCoverageIgnoreEnd
*/

View File

@ -46,6 +46,8 @@ class OtlpExporter implements SpanExporterInterface
}
}
class_alias(OtlpExporter::class, 'OpenTelemetry\Contrib\OtlpGrpc\Exporter');
class_alias(OtlpExporter::class, 'OpenTelemetry\Contrib\OtlpHttp\Exporter');
class_alias(OtlpExporter::class, 'OpenTelemetry\Contrib\Otlp\Exporter');
if (!class_exists('OpenTelemetry\Contrib\Otlp\Exporter', false)) {
class_alias(OtlpExporter::class, 'OpenTelemetry\Contrib\OtlpGrpc\Exporter');
class_alias(OtlpExporter::class, 'OpenTelemetry\Contrib\OtlpHttp\Exporter');
class_alias(OtlpExporter::class, 'OpenTelemetry\Contrib\Otlp\Exporter');
}

View File

@ -41,7 +41,9 @@ class SystemClock implements ClockInterface
}
}
class_alias(SystemClock::class, OpenTelemetry_SDK_SystemClock);
if (!class_exists(OpenTelemetry_SDK_SystemClock, false)) {
class_alias(SystemClock::class, OpenTelemetry_SDK_SystemClock);
}
/**
* @codeCoverageIgnoreEnd
*/