From cdd7ad020e165fe680703b6d3319b908b682fb7a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 20 Oct 2023 17:12:29 +0300 Subject: jaeger-client -> opentelemetry --- vendor/autoload.php | 18 + vendor/composer/ClassLoader.php | 174 +- vendor/composer/InstalledVersions.php | 577 ++---- vendor/composer/LICENSE | 2 + vendor/composer/autoload_classmap.php | 18 +- vendor/composer/autoload_files.php | 26 +- vendor/composer/autoload_namespaces.php | 2 +- vendor/composer/autoload_psr4.php | 28 +- vendor/composer/autoload_real.php | 49 +- vendor/composer/autoload_static.php | 162 +- vendor/composer/installed.json | 1948 ++++++++++++++++--- vendor/composer/installed.php | 1098 ++++++----- vendor/google/protobuf/LICENSE | 29 + vendor/google/protobuf/README.md | 2 + vendor/google/protobuf/composer.json | 23 + .../src/GPBMetadata/Google/Protobuf/Any.php | 30 + .../src/GPBMetadata/Google/Protobuf/Api.php | 48 + .../src/GPBMetadata/Google/Protobuf/Duration.php | 30 + .../src/GPBMetadata/Google/Protobuf/FieldMask.php | 29 + .../src/GPBMetadata/Google/Protobuf/GPBEmpty.php | 29 + .../Google/Protobuf/Internal/Descriptor.php | 282 +++ .../GPBMetadata/Google/Protobuf/SourceContext.php | 29 + .../src/GPBMetadata/Google/Protobuf/Struct.php | Bin 0 -> 1162 bytes .../src/GPBMetadata/Google/Protobuf/Timestamp.php | 30 + .../src/GPBMetadata/Google/Protobuf/Type.php | Bin 0 -> 2205 bytes .../src/GPBMetadata/Google/Protobuf/Wrappers.php | 49 + vendor/google/protobuf/src/Google/Protobuf/Any.php | 257 +++ vendor/google/protobuf/src/Google/Protobuf/Api.php | 360 ++++ .../protobuf/src/Google/Protobuf/BoolValue.php | 68 + .../protobuf/src/Google/Protobuf/BytesValue.php | 68 + .../protobuf/src/Google/Protobuf/Descriptor.php | 108 ++ .../src/Google/Protobuf/DescriptorPool.php | 76 + .../protobuf/src/Google/Protobuf/DoubleValue.php | 68 + .../protobuf/src/Google/Protobuf/Duration.php | 173 ++ .../google/protobuf/src/Google/Protobuf/Enum.php | 213 ++ .../src/Google/Protobuf/EnumDescriptor.php | 79 + .../protobuf/src/Google/Protobuf/EnumValue.php | 135 ++ .../src/Google/Protobuf/EnumValueDescriptor.php | 64 + .../google/protobuf/src/Google/Protobuf/Field.php | 381 ++++ .../src/Google/Protobuf/Field/Cardinality.php | 71 + .../protobuf/src/Google/Protobuf/Field/Kind.php | 176 ++ .../src/Google/Protobuf/FieldDescriptor.php | 144 ++ .../protobuf/src/Google/Protobuf/FieldMask.php | 217 +++ .../src/Google/Protobuf/Field_Cardinality.php | 16 + .../protobuf/src/Google/Protobuf/Field_Kind.php | 16 + .../protobuf/src/Google/Protobuf/FloatValue.php | 68 + .../protobuf/src/Google/Protobuf/GPBEmpty.php | 38 + .../protobuf/src/Google/Protobuf/Int32Value.php | 68 + .../protobuf/src/Google/Protobuf/Int64Value.php | 68 + .../src/Google/Protobuf/Internal/AnyBase.php | 86 + .../Google/Protobuf/Internal/CodedInputStream.php | 381 ++++ .../Google/Protobuf/Internal/CodedOutputStream.php | 159 ++ .../src/Google/Protobuf/Internal/Descriptor.php | 236 +++ .../Google/Protobuf/Internal/DescriptorPool.php | 194 ++ .../Google/Protobuf/Internal/DescriptorProto.php | 336 ++++ .../Internal/DescriptorProto/ExtensionRange.php | 161 ++ .../Internal/DescriptorProto/ReservedRange.php | 128 ++ .../Internal/DescriptorProto_ExtensionRange.php | 16 + .../Internal/DescriptorProto_ReservedRange.php | 16 + .../Protobuf/Internal/EnumBuilderContext.php | 63 + .../Google/Protobuf/Internal/EnumDescriptor.php | 116 ++ .../Protobuf/Internal/EnumDescriptorProto.php | 216 +++ .../EnumDescriptorProto/EnumReservedRange.php | 130 ++ .../EnumDescriptorProto_EnumReservedRange.php | 16 + .../src/Google/Protobuf/Internal/EnumOptions.php | 242 +++ .../Protobuf/Internal/EnumValueDescriptorProto.php | 146 ++ .../Google/Protobuf/Internal/EnumValueOptions.php | 123 ++ .../Protobuf/Internal/ExtensionRangeOptions.php | 67 + .../Google/Protobuf/Internal/FieldDescriptor.php | 326 ++++ .../Protobuf/Internal/FieldDescriptorProto.php | 611 ++++++ .../Internal/FieldDescriptorProto/Label.php | 58 + .../Internal/FieldDescriptorProto/Type.php | 153 ++ .../Internal/FieldDescriptorProto_Label.php | 16 + .../Internal/FieldDescriptorProto_Type.php | 16 + .../src/Google/Protobuf/Internal/FieldOptions.php | 559 ++++++ .../Protobuf/Internal/FieldOptions/CType.php | 58 + .../Protobuf/Internal/FieldOptions/JSType.php | 62 + .../Protobuf/Internal/FieldOptions_CType.php | 16 + .../Protobuf/Internal/FieldOptions_JSType.php | 16 + .../Google/Protobuf/Internal/FileDescriptor.php | 89 + .../Protobuf/Internal/FileDescriptorProto.php | 533 +++++ .../Google/Protobuf/Internal/FileDescriptorSet.php | 63 + .../src/Google/Protobuf/Internal/FileOptions.php | 1106 +++++++++++ .../Protobuf/Internal/FileOptions/OptimizeMode.php | 64 + .../Protobuf/Internal/FileOptions_OptimizeMode.php | 16 + .../Protobuf/Internal/GPBDecodeException.php | 47 + .../src/Google/Protobuf/Internal/GPBJsonWire.php | 304 +++ .../src/Google/Protobuf/Internal/GPBLabel.php | 40 + .../src/Google/Protobuf/Internal/GPBType.php | 55 + .../src/Google/Protobuf/Internal/GPBUtil.php | 663 +++++++ .../src/Google/Protobuf/Internal/GPBWire.php | 622 ++++++ .../src/Google/Protobuf/Internal/GPBWireType.php | 43 + .../Google/Protobuf/Internal/GeneratedCodeInfo.php | 75 + .../Internal/GeneratedCodeInfo/Annotation.php | 255 +++ .../Internal/GeneratedCodeInfo_Annotation.php | 16 + .../Protobuf/Internal/GetPublicDescriptorTrait.php | 41 + .../Protobuf/Internal/HasPublicDescriptorTrait.php | 43 + .../src/Google/Protobuf/Internal/MapEntry.php | 71 + .../src/Google/Protobuf/Internal/MapField.php | 298 +++ .../src/Google/Protobuf/Internal/MapFieldIter.php | 146 ++ .../src/Google/Protobuf/Internal/Message.php | 2040 +++++++++++++++++++ .../Protobuf/Internal/MessageBuilderContext.php | 120 ++ .../Google/Protobuf/Internal/MessageOptions.php | 466 +++++ .../Protobuf/Internal/MethodDescriptorProto.php | 282 +++ .../src/Google/Protobuf/Internal/MethodOptions.php | 160 ++ .../Internal/MethodOptions/IdempotencyLevel.php | 64 + .../Internal/MethodOptions_IdempotencyLevel.php | 16 + .../Google/Protobuf/Internal/OneofDescriptor.php | 87 + .../Protobuf/Internal/OneofDescriptorProto.php | 109 ++ .../src/Google/Protobuf/Internal/OneofField.php | 77 + .../src/Google/Protobuf/Internal/OneofOptions.php | 67 + .../Google/Protobuf/Internal/RawInputStream.php | 50 + .../src/Google/Protobuf/Internal/RepeatedField.php | 264 +++ .../Google/Protobuf/Internal/RepeatedFieldIter.php | 125 ++ .../Protobuf/Internal/ServiceDescriptorProto.php | 136 ++ .../Google/Protobuf/Internal/ServiceOptions.php | 123 ++ .../Google/Protobuf/Internal/SourceCodeInfo.php | 230 +++ .../Protobuf/Internal/SourceCodeInfo/Location.php | 448 +++++ .../Protobuf/Internal/SourceCodeInfo_Location.php | 16 + .../src/Google/Protobuf/Internal/TimestampBase.php | 32 + .../Protobuf/Internal/UninterpretedOption.php | 300 +++ .../Internal/UninterpretedOption/NamePart.php | 116 ++ .../Internal/UninterpretedOption_NamePart.php | 16 + .../protobuf/src/Google/Protobuf/ListValue.php | 68 + .../google/protobuf/src/Google/Protobuf/Method.php | 271 +++ .../google/protobuf/src/Google/Protobuf/Mixin.php | 166 ++ .../protobuf/src/Google/Protobuf/NullValue.php | 49 + .../src/Google/Protobuf/OneofDescriptor.php | 87 + .../google/protobuf/src/Google/Protobuf/Option.php | 136 ++ .../protobuf/src/Google/Protobuf/SourceContext.php | 72 + .../protobuf/src/Google/Protobuf/StringValue.php | 68 + .../google/protobuf/src/Google/Protobuf/Struct.php | 73 + .../google/protobuf/src/Google/Protobuf/Syntax.php | 54 + .../protobuf/src/Google/Protobuf/Timestamp.php | 186 ++ .../google/protobuf/src/Google/Protobuf/Type.php | 247 +++ .../protobuf/src/Google/Protobuf/UInt32Value.php | 68 + .../protobuf/src/Google/Protobuf/UInt64Value.php | 68 + .../google/protobuf/src/Google/Protobuf/Value.php | 244 +++ vendor/google/protobuf/src/phpdoc.dist.xml | 15 + vendor/guzzlehttp/guzzle/CHANGELOG.md | 1624 ++++++++++++++++ vendor/guzzlehttp/guzzle/LICENSE | 27 + vendor/guzzlehttp/guzzle/README.md | 94 + vendor/guzzlehttp/guzzle/UPGRADING.md | 1253 ++++++++++++ vendor/guzzlehttp/guzzle/composer.json | 103 + vendor/guzzlehttp/guzzle/src/BodySummarizer.php | 28 + .../guzzle/src/BodySummarizerInterface.php | 13 + vendor/guzzlehttp/guzzle/src/Client.php | 483 +++++ vendor/guzzlehttp/guzzle/src/ClientInterface.php | 84 + vendor/guzzlehttp/guzzle/src/ClientTrait.php | 241 +++ vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php | 307 +++ .../guzzle/src/Cookie/CookieJarInterface.php | 80 + .../guzzlehttp/guzzle/src/Cookie/FileCookieJar.php | 101 + .../guzzle/src/Cookie/SessionCookieJar.php | 77 + vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php | 488 +++++ .../guzzle/src/Exception/BadResponseException.php | 39 + .../guzzle/src/Exception/ClientException.php | 10 + .../guzzle/src/Exception/ConnectException.php | 56 + .../guzzle/src/Exception/GuzzleException.php | 9 + .../src/Exception/InvalidArgumentException.php | 7 + .../guzzle/src/Exception/RequestException.php | 166 ++ .../guzzle/src/Exception/ServerException.php | 10 + .../src/Exception/TooManyRedirectsException.php | 7 + .../guzzle/src/Exception/TransferException.php | 7 + .../guzzlehttp/guzzle/src/Handler/CurlFactory.php | 638 ++++++ .../guzzle/src/Handler/CurlFactoryInterface.php | 25 + .../guzzlehttp/guzzle/src/Handler/CurlHandler.php | 49 + .../guzzle/src/Handler/CurlMultiHandler.php | 267 +++ .../guzzlehttp/guzzle/src/Handler/EasyHandle.php | 112 ++ .../guzzle/src/Handler/HeaderProcessor.php | 42 + .../guzzlehttp/guzzle/src/Handler/MockHandler.php | 212 ++ vendor/guzzlehttp/guzzle/src/Handler/Proxy.php | 51 + .../guzzle/src/Handler/StreamHandler.php | 615 ++++++ vendor/guzzlehttp/guzzle/src/HandlerStack.php | 275 +++ vendor/guzzlehttp/guzzle/src/MessageFormatter.php | 199 ++ .../guzzle/src/MessageFormatterInterface.php | 18 + vendor/guzzlehttp/guzzle/src/Middleware.php | 268 +++ vendor/guzzlehttp/guzzle/src/Pool.php | 125 ++ .../guzzle/src/PrepareBodyMiddleware.php | 105 + .../guzzlehttp/guzzle/src/RedirectMiddleware.php | 228 +++ vendor/guzzlehttp/guzzle/src/RequestOptions.php | 276 +++ vendor/guzzlehttp/guzzle/src/RetryMiddleware.php | 119 ++ vendor/guzzlehttp/guzzle/src/TransferStats.php | 133 ++ vendor/guzzlehttp/guzzle/src/Utils.php | 385 ++++ vendor/guzzlehttp/guzzle/src/functions.php | 167 ++ vendor/guzzlehttp/guzzle/src/functions_include.php | 6 + vendor/guzzlehttp/promises/CHANGELOG.md | 145 ++ vendor/guzzlehttp/promises/LICENSE | 24 + vendor/guzzlehttp/promises/README.md | 559 ++++++ vendor/guzzlehttp/promises/composer.json | 58 + .../guzzlehttp/promises/src/AggregateException.php | 19 + .../promises/src/CancellationException.php | 12 + vendor/guzzlehttp/promises/src/Coroutine.php | 162 ++ vendor/guzzlehttp/promises/src/Create.php | 79 + vendor/guzzlehttp/promises/src/Each.php | 86 + vendor/guzzlehttp/promises/src/EachPromise.php | 250 +++ .../guzzlehttp/promises/src/FulfilledPromise.php | 89 + vendor/guzzlehttp/promises/src/Is.php | 40 + vendor/guzzlehttp/promises/src/Promise.php | 281 +++ .../guzzlehttp/promises/src/PromiseInterface.php | 91 + .../guzzlehttp/promises/src/PromisorInterface.php | 16 + vendor/guzzlehttp/promises/src/RejectedPromise.php | 95 + .../guzzlehttp/promises/src/RejectionException.php | 49 + vendor/guzzlehttp/promises/src/TaskQueue.php | 71 + .../guzzlehttp/promises/src/TaskQueueInterface.php | 24 + vendor/guzzlehttp/promises/src/Utils.php | 259 +++ vendor/guzzlehttp/psr7/CHANGELOG.md | 437 +++++ vendor/guzzlehttp/psr7/LICENSE | 26 + vendor/guzzlehttp/psr7/README.md | 880 +++++++++ vendor/guzzlehttp/psr7/composer.json | 93 + vendor/guzzlehttp/psr7/src/AppendStream.php | 248 +++ vendor/guzzlehttp/psr7/src/BufferStream.php | 147 ++ vendor/guzzlehttp/psr7/src/CachingStream.php | 153 ++ vendor/guzzlehttp/psr7/src/DroppingStream.php | 49 + .../psr7/src/Exception/MalformedUriException.php | 14 + vendor/guzzlehttp/psr7/src/FnStream.php | 179 ++ vendor/guzzlehttp/psr7/src/Header.php | 134 ++ vendor/guzzlehttp/psr7/src/HttpFactory.php | 94 + vendor/guzzlehttp/psr7/src/InflateStream.php | 37 + vendor/guzzlehttp/psr7/src/LazyOpenStream.php | 49 + vendor/guzzlehttp/psr7/src/LimitStream.php | 157 ++ vendor/guzzlehttp/psr7/src/Message.php | 246 +++ vendor/guzzlehttp/psr7/src/MessageTrait.php | 265 +++ vendor/guzzlehttp/psr7/src/MimeType.php | 1259 ++++++++++++ vendor/guzzlehttp/psr7/src/MultipartStream.php | 157 ++ vendor/guzzlehttp/psr7/src/NoSeekStream.php | 28 + vendor/guzzlehttp/psr7/src/PumpStream.php | 179 ++ vendor/guzzlehttp/psr7/src/Query.php | 113 ++ vendor/guzzlehttp/psr7/src/Request.php | 159 ++ vendor/guzzlehttp/psr7/src/Response.php | 161 ++ vendor/guzzlehttp/psr7/src/Rfc7230.php | 23 + vendor/guzzlehttp/psr7/src/ServerRequest.php | 340 ++++ vendor/guzzlehttp/psr7/src/Stream.php | 283 +++ .../guzzlehttp/psr7/src/StreamDecoratorTrait.php | 156 ++ vendor/guzzlehttp/psr7/src/StreamWrapper.php | 175 ++ vendor/guzzlehttp/psr7/src/UploadedFile.php | 211 ++ vendor/guzzlehttp/psr7/src/Uri.php | 741 +++++++ vendor/guzzlehttp/psr7/src/UriComparator.php | 52 + vendor/guzzlehttp/psr7/src/UriNormalizer.php | 220 +++ vendor/guzzlehttp/psr7/src/UriResolver.php | 211 ++ vendor/guzzlehttp/psr7/src/Utils.php | 463 +++++ vendor/jonahgeorge/jaeger-client-php/.editorconfig | 16 - .../jaeger-client-php/.github/workflows/main.yaml | 44 - vendor/jonahgeorge/jaeger-client-php/.gitignore | 17 - .../jonahgeorge/jaeger-client-php/CONTRIBUTING.md | 3 - vendor/jonahgeorge/jaeger-client-php/LICENSE | 21 - vendor/jonahgeorge/jaeger-client-php/README.md | 219 --- .../jonahgeorge/jaeger-client-php/build/.gitignore | 2 - vendor/jonahgeorge/jaeger-client-php/composer.json | 62 - .../jaeger-client-php/examples/config.php | 26 - .../jaeger-client-php/examples/jaeger.php | 51 - .../jonahgeorge/jaeger-client-php/phpcs.xml.dist | 37 - .../jonahgeorge/jaeger-client-php/phpunit.xml.dist | 47 - .../jaeger-client-php/scripts/thrift-gen.sh | 27 - .../src/Jaeger/AgentClient/HttpAgentClient.php | 27 - .../src/Jaeger/Codec/BinaryCodec.php | 39 - .../src/Jaeger/Codec/CodecInterface.php | 36 - .../src/Jaeger/Codec/CodecUtility.php | 41 - .../src/Jaeger/Codec/TextCodec.php | 184 -- .../src/Jaeger/Codec/ZipkinCodec.php | 85 - .../jaeger-client-php/src/Jaeger/Config.php | 390 ---- .../jaeger-client-php/src/Jaeger/Constants.php | 100 - .../src/Jaeger/Mapper/SpanToJaegerMapper.php | 171 -- .../src/Jaeger/Reporter/CompositeReporter.php | 51 - .../src/Jaeger/Reporter/InMemoryReporter.php | 47 - .../src/Jaeger/Reporter/JaegerReporter.php | 35 - .../src/Jaeger/Reporter/LoggingReporter.php | 51 - .../src/Jaeger/Reporter/NullReporter.php | 32 - .../src/Jaeger/Reporter/RemoteReporter.php | 46 - .../src/Jaeger/Reporter/ReporterInterface.php | 28 - .../ReporterFactory/AbstractReporterFactory.php | 23 - .../ReporterFactory/JaegerHttpReporterFactory.php | 35 - .../ReporterFactory/JaegerReporterFactory.php | 44 - .../ReporterFactory/ReporterFactoryInterface.php | 10 - .../ReporterFactory/ZipkinReporterFactory.php | 46 - .../src/Jaeger/Sampler/ConstSampler.php | 68 - .../src/Jaeger/Sampler/ProbabilisticSampler.php | 88 - .../src/Jaeger/Sampler/RateLimitingSampler.php | 62 - .../src/Jaeger/Sampler/SamplerInterface.php | 29 - .../jaeger-client-php/src/Jaeger/Scope.php | 71 - .../jaeger-client-php/src/Jaeger/ScopeManager.php | 45 - .../src/Jaeger/Sender/JaegerSender.php | 236 --- .../src/Jaeger/Sender/SenderInterface.php | 12 - .../src/Jaeger/Sender/UdpSender.php | 305 --- .../jaeger-client-php/src/Jaeger/Span.php | 476 ----- .../jaeger-client-php/src/Jaeger/SpanContext.php | 120 -- .../src/Jaeger/Thrift/Agent/AgentClient.php | 76 - .../src/Jaeger/Thrift/Agent/AgentIf.php | 30 - .../Jaeger/Thrift/Agent/Agent_emitBatch_args.php | 56 - .../Thrift/Agent/Agent_emitZipkinBatch_args.php | 60 - .../Thrift/Agent/AggregationValidatorClient.php | 83 - .../Jaeger/Thrift/Agent/AggregationValidatorIf.php | 27 - .../AggregationValidator_validateTrace_args.php | 55 - .../AggregationValidator_validateTrace_result.php | 56 - .../src/Jaeger/Thrift/Agent/BaggageRestriction.php | 65 - .../Agent/BaggageRestrictionManagerClient.php | 83 - .../Thrift/Agent/BaggageRestrictionManagerIf.php | 31 - ...trictionManager_getBaggageRestrictions_args.php | 55 - ...ictionManager_getBaggageRestrictions_result.php | 60 - .../src/Jaeger/Thrift/Agent/Dependencies.php | 61 - .../src/Jaeger/Thrift/Agent/DependencyClient.php | 105 - .../src/Jaeger/Thrift/Agent/DependencyIf.php | 31 - .../src/Jaeger/Thrift/Agent/DependencyLink.php | 74 - .../Dependency_getDependenciesForTrace_args.php | 55 - .../Dependency_getDependenciesForTrace_result.php | 56 - .../Agent/Dependency_saveDependencies_args.php | 56 - .../Thrift/Agent/OperationSamplingStrategy.php | 66 - .../Agent/PerOperationSamplingStrategies.php | 88 - .../Thrift/Agent/ProbabilisticSamplingStrategy.php | 56 - .../Thrift/Agent/RateLimitingSamplingStrategy.php | 56 - .../Jaeger/Thrift/Agent/SamplingManagerClient.php | 83 - .../src/Jaeger/Thrift/Agent/SamplingManagerIf.php | 27 - .../SamplingManager_getSamplingStrategy_args.php | 55 - .../SamplingManager_getSamplingStrategy_result.php | 56 - .../Thrift/Agent/SamplingStrategyResponse.php | 86 - .../Jaeger/Thrift/Agent/SamplingStrategyType.php | 28 - .../Jaeger/Thrift/Agent/ValidateTraceResponse.php | 65 - .../src/Jaeger/Thrift/Agent/Zipkin/Annotation.php | 87 - .../Jaeger/Thrift/Agent/Zipkin/AnnotationType.php | 38 - .../Thrift/Agent/Zipkin/BinaryAnnotation.php | 106 - .../src/Jaeger/Thrift/Agent/Zipkin/Constant.php | 246 --- .../src/Jaeger/Thrift/Agent/Zipkin/Endpoint.php | 108 -- .../src/Jaeger/Thrift/Agent/Zipkin/Response.php | 56 - .../src/Jaeger/Thrift/Agent/Zipkin/Span.php | 190 -- .../Thrift/Agent/Zipkin/ZipkinCollectorClient.php | 83 - .../Thrift/Agent/Zipkin/ZipkinCollectorIf.php | 27 - .../ZipkinCollector_submitZipkinBatch_args.php | 60 - .../ZipkinCollector_submitZipkinBatch_result.php | 60 - .../jaeger-client-php/src/Jaeger/Thrift/Batch.php | 71 - .../src/Jaeger/Thrift/BatchSubmitResponse.php | 56 - .../src/Jaeger/Thrift/CollectorClient.php | 83 - .../src/Jaeger/Thrift/CollectorIf.php | 27 - .../Jaeger/Thrift/Collector_submitBatches_args.php | 60 - .../Thrift/Collector_submitBatches_result.php | 60 - .../src/Jaeger/Thrift/Crossdock/Downstream.php | 102 - .../Jaeger/Thrift/Crossdock/JoinTraceRequest.php | 66 - .../src/Jaeger/Thrift/Crossdock/ObservedSpan.php | 74 - .../Jaeger/Thrift/Crossdock/StartTraceRequest.php | 84 - .../src/Jaeger/Thrift/Crossdock/TraceResponse.php | 82 - .../Thrift/Crossdock/TracedServiceClient.php | 134 -- .../Jaeger/Thrift/Crossdock/TracedServiceIf.php | 40 - .../Crossdock/TracedService_joinTrace_args.php | 56 - .../Crossdock/TracedService_joinTrace_result.php | 56 - .../Crossdock/TracedService_startTrace_args.php | 56 - .../Crossdock/TracedService_startTrace_result.php | 56 - .../src/Jaeger/Thrift/Crossdock/Transport.php | 30 - .../jaeger-client-php/src/Jaeger/Thrift/Log.php | 70 - .../src/Jaeger/Thrift/Process.php | 70 - .../jaeger-client-php/src/Jaeger/Thrift/Span.php | 161 -- .../src/Jaeger/Thrift/SpanRef.php | 83 - .../src/Jaeger/Thrift/SpanRefType.php | 28 - .../jaeger-client-php/src/Jaeger/Thrift/Tag.php | 110 -- .../src/Jaeger/Thrift/TagType.php | 34 - .../src/Jaeger/ThriftUdpTransport.php | 151 -- .../jaeger-client-php/src/Jaeger/Tracer.php | 420 ---- .../src/Jaeger/Util/RateLimiter.php | 128 -- .../tests/Jaeger/Codec/TextCodecTest.php | 170 -- .../tests/Jaeger/Codec/ZipkinCodecTest.php | 104 - .../jaeger-client-php/tests/Jaeger/ConfigTest.php | 257 --- .../tests/Jaeger/Logger/StackLogger.php | 30 - .../tests/Jaeger/Mapper/SpanToJaegerMapperTest.php | 169 -- .../Jaeger/Reporter/CompositeReporterTest.php | 52 - .../tests/Jaeger/Reporter/InMemoryReporterTest.php | 24 - .../tests/Jaeger/Reporter/LoggingReporterTest.php | 31 - .../tests/Jaeger/Reporter/NullReporterTest.php | 29 - .../tests/Jaeger/Reporter/RemoteReporterTest.php | 46 - .../tests/Jaeger/Sampler/ConstSamplerTest.php | 43 - .../Jaeger/Sampler/ProbablisticSamplerTest.php | 68 - .../tests/Jaeger/Sampler/RateLimitSamplerTest.php | 48 - .../tests/Jaeger/ScopeManagerTest.php | 49 - .../jaeger-client-php/tests/Jaeger/ScopeTest.php | 58 - .../tests/Jaeger/Sender/JaegerThriftSenderTest.php | 126 -- .../tests/Jaeger/Sender/UdpSenderTest.php | 116 -- .../tests/Jaeger/SpanContextTest.php | 37 - .../jaeger-client-php/tests/Jaeger/SpanTest.php | 293 --- .../tests/Jaeger/ThriftUdpTransportTest.php | 166 -- .../jaeger-client-php/tests/Jaeger/TracerTest.php | 262 --- .../jonahgeorge/jaeger-client-php/tests/README.md | 48 - .../jaeger-client-php/tests/php-test.sh | 64 - vendor/open-telemetry/api/Baggage/Baggage.php | 100 + .../open-telemetry/api/Baggage/BaggageBuilder.php | 40 + .../api/Baggage/BaggageBuilderInterface.php | 23 + .../api/Baggage/BaggageInterface.php | 62 + vendor/open-telemetry/api/Baggage/Entry.php | 38 + vendor/open-telemetry/api/Baggage/Metadata.php | 27 + .../api/Baggage/MetadataInterface.php | 13 + .../api/Baggage/Propagation/BaggagePropagator.php | 92 + .../api/Baggage/Propagation/Parser.php | 69 + .../Behavior/Internal/LogWriter/ErrorLogWriter.php | 13 + .../api/Behavior/Internal/LogWriter/Formatter.php | 37 + .../Internal/LogWriter/LogWriterInterface.php | 10 + .../Behavior/Internal/LogWriter/NoopLogWriter.php | 13 + .../Behavior/Internal/LogWriter/Psr3LogWriter.php | 22 + .../Internal/LogWriter/StreamLogWriter.php | 25 + .../api/Behavior/Internal/LogWriterFactory.php | 48 + .../api/Behavior/Internal/Logging.php | 90 + .../api/Behavior/LogsMessagesTrait.php | 50 + vendor/open-telemetry/api/Globals.php | 121 ++ .../api/Instrumentation/CachedInstrumentation.php | 97 + .../api/Instrumentation/ConfigurationResolver.php | 77 + .../ConfigurationResolverInterface.php | 14 + .../api/Instrumentation/Configurator.php | 113 ++ .../api/Instrumentation/ContextKeys.php | 58 + .../Instrumentation/InstrumentationInterface.php | 43 + .../api/Instrumentation/InstrumentationTrait.php | 193 ++ vendor/open-telemetry/api/LoggerHolder.php | 53 + vendor/open-telemetry/api/Logs/EventLogger.php | 26 + .../api/Logs/EventLoggerInterface.php | 13 + vendor/open-telemetry/api/Logs/LogRecord.php | 108 ++ vendor/open-telemetry/api/Logs/LoggerInterface.php | 10 + .../api/Logs/LoggerProviderInterface.php | 18 + vendor/open-telemetry/api/Logs/Map/Psr3.php | 40 + vendor/open-telemetry/api/Logs/NoopLogger.php | 33 + .../open-telemetry/api/Logs/NoopLoggerProvider.php | 20 + vendor/open-telemetry/api/Logs/README.md | 19 + .../api/Metrics/CounterInterface.php | 21 + .../api/Metrics/HistogramInterface.php | 21 + .../open-telemetry/api/Metrics/MeterInterface.php | 111 ++ .../api/Metrics/MeterProviderInterface.php | 28 + .../api/Metrics/Noop/NoopCounter.php | 18 + .../api/Metrics/Noop/NoopHistogram.php | 18 + .../open-telemetry/api/Metrics/Noop/NoopMeter.php | 46 + .../api/Metrics/Noop/NoopMeterProvider.php | 20 + .../api/Metrics/Noop/NoopObservableCallback.php | 18 + .../api/Metrics/Noop/NoopObservableCounter.php | 19 + .../api/Metrics/Noop/NoopObservableGauge.php | 19 + .../Metrics/Noop/NoopObservableUpDownCounter.php | 19 + .../api/Metrics/Noop/NoopUpDownCounter.php | 18 + .../api/Metrics/ObservableCallbackInterface.php | 56 + .../api/Metrics/ObservableCounterInterface.php | 16 + .../api/Metrics/ObservableGaugeInterface.php | 16 + .../Metrics/ObservableUpDownCounterInterface.php | 16 + .../api/Metrics/ObserverInterface.php | 18 + .../api/Metrics/UpDownCounterInterface.php | 19 + vendor/open-telemetry/api/README.md | 14 + vendor/open-telemetry/api/Signals.php | 21 + .../open-telemetry/api/Trace/NonRecordingSpan.php | 76 + .../open-telemetry/api/Trace/NoopSpanBuilder.php | 65 + vendor/open-telemetry/api/Trace/NoopTracer.php | 26 + .../api/Trace/NoopTracerProvider.php | 17 + .../Trace/Propagation/TraceContextPropagator.php | 157 ++ .../Trace/Propagation/TraceContextValidator.php | 31 + vendor/open-telemetry/api/Trace/Span.php | 59 + .../api/Trace/SpanBuilderInterface.php | 51 + vendor/open-telemetry/api/Trace/SpanContext.php | 127 ++ .../api/Trace/SpanContextInterface.php | 28 + .../api/Trace/SpanContextValidator.php | 35 + vendor/open-telemetry/api/Trace/SpanInterface.php | 96 + vendor/open-telemetry/api/Trace/SpanKind.php | 17 + vendor/open-telemetry/api/Trace/StatusCode.php | 15 + vendor/open-telemetry/api/Trace/TraceFlags.php | 11 + vendor/open-telemetry/api/Trace/TraceState.php | 190 ++ .../api/Trace/TraceStateInterface.php | 61 + .../open-telemetry/api/Trace/TracerInterface.php | 11 + .../api/Trace/TracerProviderInterface.php | 19 + vendor/open-telemetry/api/Trace/functions.php | 44 + vendor/open-telemetry/api/composer.json | 40 + vendor/open-telemetry/context/Context.php | 131 ++ vendor/open-telemetry/context/ContextInterface.php | 86 + vendor/open-telemetry/context/ContextKey.php | 23 + .../open-telemetry/context/ContextKeyInterface.php | 12 + vendor/open-telemetry/context/ContextKeys.php | 25 + vendor/open-telemetry/context/ContextStorage.php | 57 + .../open-telemetry/context/ContextStorageHead.php | 19 + .../context/ContextStorageInterface.php | 32 + .../open-telemetry/context/ContextStorageNode.php | 92 + .../context/ContextStorageScopeInterface.php | 22 + vendor/open-telemetry/context/DebugScope.php | 94 + .../context/ExecutionContextAwareInterface.php | 23 + .../context/FiberBoundContextStorage.php | 84 + .../context/FiberBoundContextStorageScope.php | 67 + .../context/ImplicitContextKeyedInterface.php | 32 + .../Propagation/ArrayAccessGetterSetter.php | 129 ++ .../context/Propagation/MultiTextMapPropagator.php | 83 + .../context/Propagation/NoopTextMapPropagator.php | 36 + .../Propagation/PropagationGetterInterface.php | 25 + .../Propagation/PropagationSetterInterface.php | 16 + .../SanitizeCombinedHeadersPropagationGetter.php | 46 + .../Propagation/TextMapPropagatorInterface.php | 40 + vendor/open-telemetry/context/README.md | 63 + vendor/open-telemetry/context/ScopeInterface.php | 32 + .../open-telemetry/context/ZendObserverFiber.php | 67 + vendor/open-telemetry/context/composer.json | 41 + .../context/fiber/initialize_fiber_handler.php | 20 + .../context/fiber/zend_observer_fiber.h | 9 + .../exporter-otlp/AttributesConverter.php | 62 + .../open-telemetry/exporter-otlp/ContentTypes.php | 12 + .../exporter-otlp/HttpEndpointResolver.php | 145 ++ .../HttpEndpointResolverInterface.php | 28 + .../open-telemetry/exporter-otlp/LogsConverter.php | 142 ++ .../open-telemetry/exporter-otlp/LogsExporter.php | 85 + .../exporter-otlp/LogsExporterFactory.php | 85 + .../exporter-otlp/MetricConverter.php | 265 +++ .../exporter-otlp/MetricExporter.php | 97 + .../exporter-otlp/MetricExporterFactory.php | 110 ++ .../exporter-otlp/OtlpHttpTransportFactory.php | 33 + vendor/open-telemetry/exporter-otlp/OtlpUtil.php | 45 + .../exporter-otlp/ProtobufSerializer.php | 115 ++ vendor/open-telemetry/exporter-otlp/Protocols.php | 36 + vendor/open-telemetry/exporter-otlp/README.md | 45 + .../open-telemetry/exporter-otlp/SpanConverter.php | 187 ++ .../open-telemetry/exporter-otlp/SpanExporter.php | 81 + .../exporter-otlp/SpanExporterFactory.php | 96 + vendor/open-telemetry/exporter-otlp/_register.php | 9 + vendor/open-telemetry/exporter-otlp/composer.json | 41 + vendor/open-telemetry/gen-otlp-protobuf/.gitignore | 1 + .../Proto/Collector/Logs/V1/LogsService.php | Bin 0 -> 1361 bytes .../Proto/Collector/Metrics/V1/MetricsService.php | Bin 0 -> 1438 bytes .../Proto/Collector/Trace/V1/TraceService.php | Bin 0 -> 1380 bytes .../Opentelemetry/Proto/Common/V1/Common.php | Bin 0 -> 1411 bytes .../Opentelemetry/Proto/Logs/V1/Logs.php | Bin 0 -> 2512 bytes .../Metrics/Experimental/MetricsConfigService.php | Bin 0 -> 1714 bytes .../Opentelemetry/Proto/Metrics/V1/Metrics.php | Bin 0 -> 4526 bytes .../Opentelemetry/Proto/Resource/V1/Resource.php | 32 + .../Opentelemetry/Proto/Trace/V1/Trace.php | Bin 0 -> 2533 bytes .../Opentelemetry/Proto/Trace/V1/TraceConfig.php | Bin 0 -> 1465 bytes .../Collector/Logs/V1/ExportLogsPartialSuccess.php | 127 ++ .../Collector/Logs/V1/ExportLogsServiceRequest.php | 81 + .../Logs/V1/ExportLogsServiceResponse.php | 119 ++ .../Proto/Collector/Logs/V1/LogsServiceClient.php | 53 + .../Metrics/V1/ExportMetricsPartialSuccess.php | 127 ++ .../Metrics/V1/ExportMetricsServiceRequest.php | 81 + .../Metrics/V1/ExportMetricsServiceResponse.php | 119 ++ .../Collector/Metrics/V1/MetricsServiceClient.php | 53 + .../Trace/V1/ExportTracePartialSuccess.php | 127 ++ .../Trace/V1/ExportTraceServiceRequest.php | 81 + .../Trace/V1/ExportTraceServiceResponse.php | 119 ++ .../Collector/Trace/V1/TraceServiceClient.php | 53 + .../Opentelemetry/Proto/Common/V1/AnyValue.php | 240 +++ .../Opentelemetry/Proto/Common/V1/ArrayValue.php | 68 + .../Proto/Common/V1/InstrumentationLibrary.php | 98 + .../Proto/Common/V1/InstrumentationScope.php | 164 ++ .../Opentelemetry/Proto/Common/V1/KeyValue.php | 98 + .../Opentelemetry/Proto/Common/V1/KeyValueList.php | 83 + .../Proto/Common/V1/StringKeyValue.php | 88 + .../Proto/Logs/V1/InstrumentationLibraryLogs.php | 156 ++ .../Opentelemetry/Proto/Logs/V1/LogRecord.php | 541 ++++++ .../Opentelemetry/Proto/Logs/V1/LogRecordFlags.php | 58 + .../Opentelemetry/Proto/Logs/V1/LogsData.php | 90 + .../Opentelemetry/Proto/Logs/V1/ResourceLogs.php | 153 ++ .../Opentelemetry/Proto/Logs/V1/ScopeLogs.php | 153 ++ .../Opentelemetry/Proto/Logs/V1/SeverityNumber.php | 167 ++ .../Metrics/Experimental/MetricConfigRequest.php | 113 ++ .../Metrics/Experimental/MetricConfigResponse.php | 201 ++ .../Experimental/MetricConfigResponse/Schedule.php | 149 ++ .../MetricConfigResponse/Schedule/Pattern.php | 113 ++ .../Experimental/MetricConfigResponse_Schedule.php | 16 + .../MetricConfigResponse_Schedule_Pattern.php | 16 + .../Proto/Metrics/V1/AggregationTemporality.php | 114 ++ .../Proto/Metrics/V1/DataPointFlags.php | 61 + .../Opentelemetry/Proto/Metrics/V1/Exemplar.php | 269 +++ .../Proto/Metrics/V1/ExponentialHistogram.php | 99 + .../Metrics/V1/ExponentialHistogramDataPoint.php | 718 +++++++ .../V1/ExponentialHistogramDataPoint/Buckets.php | 141 ++ .../V1/ExponentialHistogramDataPoint_Buckets.php | 16 + .../Opentelemetry/Proto/Metrics/V1/Gauge.php | 67 + .../Opentelemetry/Proto/Metrics/V1/Histogram.php | 99 + .../Proto/Metrics/V1/HistogramDataPoint.php | 565 ++++++ .../Metrics/V1/InstrumentationLibraryMetrics.php | 156 ++ .../Proto/Metrics/V1/IntDataPoint.php | 227 +++ .../Opentelemetry/Proto/Metrics/V1/IntExemplar.php | 235 +++ .../Opentelemetry/Proto/Metrics/V1/IntGauge.php | 60 + .../Proto/Metrics/V1/IntHistogram.php | 99 + .../Proto/Metrics/V1/IntHistogramDataPoint.php | 393 ++++ .../Opentelemetry/Proto/Metrics/V1/IntSum.php | 132 ++ .../Opentelemetry/Proto/Metrics/V1/Metric.php | 358 ++++ .../Opentelemetry/Proto/Metrics/V1/MetricsData.php | 90 + .../Proto/Metrics/V1/NumberDataPoint.php | 309 +++ .../Proto/Metrics/V1/ResourceMetrics.php | 153 ++ .../Proto/Metrics/V1/ScopeMetrics.php | 153 ++ .../Opentelemetry/Proto/Metrics/V1/Sum.php | 133 ++ .../Opentelemetry/Proto/Metrics/V1/Summary.php | 65 + .../Proto/Metrics/V1/SummaryDataPoint.php | 336 ++++ .../V1/SummaryDataPoint/ValueAtQuantile.php | 117 ++ .../V1/SummaryDataPoint_ValueAtQuantile.php | 16 + .../Opentelemetry/Proto/Resource/V1/Resource.php | 113 ++ .../Proto/Trace/V1/ConstantSampler.php | 60 + .../Trace/V1/ConstantSampler/ConstantDecision.php | 61 + .../Trace/V1/ConstantSampler_ConstantDecision.php | 16 + .../Proto/Trace/V1/InstrumentationLibrarySpans.php | 156 ++ .../Proto/Trace/V1/RateLimitingSampler.php | 67 + .../Opentelemetry/Proto/Trace/V1/ResourceSpans.php | 153 ++ .../Opentelemetry/Proto/Trace/V1/ScopeSpans.php | 153 ++ .../Opentelemetry/Proto/Trace/V1/Span.php | 726 +++++++ .../Opentelemetry/Proto/Trace/V1/Span/Event.php | 189 ++ .../Opentelemetry/Proto/Trace/V1/Span/Link.php | 225 +++ .../Opentelemetry/Proto/Trace/V1/Span/SpanKind.php | 94 + .../Opentelemetry/Proto/Trace/V1/Span_Event.php | 16 + .../Opentelemetry/Proto/Trace/V1/Span_Link.php | 16 + .../Opentelemetry/Proto/Trace/V1/Span_SpanKind.php | 16 + .../Opentelemetry/Proto/Trace/V1/Status.php | 102 + .../Proto/Trace/V1/Status/DeprecatedStatusCode.php | 126 ++ .../Proto/Trace/V1/Status/StatusCode.php | 66 + .../Proto/Trace/V1/Status_DeprecatedStatusCode.php | 16 + .../Proto/Trace/V1/Status_StatusCode.php | 16 + .../Opentelemetry/Proto/Trace/V1/TraceConfig.php | 297 +++ .../Proto/Trace/V1/TraceIdRatioBased.php | 68 + .../Opentelemetry/Proto/Trace/V1/TracesData.php | 90 + vendor/open-telemetry/gen-otlp-protobuf/README.md | 31 + vendor/open-telemetry/gen-otlp-protobuf/VERSION | 1 + .../open-telemetry/gen-otlp-protobuf/composer.json | 37 + .../Adapter/HttpDiscovery/DependencyResolver.php | 83 + .../HttpDiscovery/HttpPlugClientResolver.php | 29 + .../HttpDiscovery/MessageFactoryResolver.php | 88 + .../Adapter/HttpDiscovery/PsrClientResolver.php | 29 + .../sdk/Common/Attribute/AttributeValidator.php | 58 + .../Attribute/AttributeValidatorInterface.php | 11 + .../sdk/Common/Attribute/Attributes.php | 67 + .../sdk/Common/Attribute/AttributesBuilder.php | 120 ++ .../Attribute/AttributesBuilderInterface.php | 12 + .../sdk/Common/Attribute/AttributesFactory.php | 36 + .../Attribute/AttributesFactoryInterface.php | 10 + .../sdk/Common/Attribute/AttributesInterface.php | 19 + .../Common/Attribute/FilteredAttributesBuilder.php | 77 + .../Common/Attribute/FilteredAttributesFactory.php | 33 + .../Attribute/LogRecordAttributeValidator.php | 19 + .../sdk/Common/Configuration/Configuration.php | 182 ++ .../sdk/Common/Configuration/Defaults.php | 122 ++ .../sdk/Common/Configuration/KnownValues.php | 208 ++ .../Common/Configuration/Parser/BooleanParser.php | 34 + .../sdk/Common/Configuration/Parser/ListParser.php | 28 + .../sdk/Common/Configuration/Parser/MapParser.php | 45 + .../Common/Configuration/Parser/RatioParser.php | 38 + .../Configuration/Resolver/CompositeResolver.php | 68 + .../Configuration/Resolver/EnvironmentResolver.php | 40 + .../Configuration/Resolver/PhpIniAccessor.php | 18 + .../Configuration/Resolver/PhpIniResolver.php | 41 + .../Configuration/Resolver/ResolverInterface.php | 15 + .../sdk/Common/Configuration/ValueTypes.php | 133 ++ .../sdk/Common/Configuration/VariableTypes.php | 62 + .../sdk/Common/Configuration/Variables.php | 142 ++ .../sdk/Common/Dev/Compatibility/README.md | 14 + .../sdk/Common/Dev/Compatibility/Util.php | 93 + .../sdk/Common/Dev/Compatibility/_load.php | 7 + .../sdk/Common/Exception/StackTraceFormatter.php | 155 ++ .../sdk/Common/Export/Http/PsrTransport.php | 168 ++ .../sdk/Common/Export/Http/PsrTransportFactory.php | 74 + .../sdk/Common/Export/Http/PsrUtils.php | 175 ++ .../sdk/Common/Export/Stream/StreamTransport.php | 97 + .../Export/Stream/StreamTransportFactory.php | 118 ++ .../Common/Export/TransportFactoryInterface.php | 32 + .../sdk/Common/Export/TransportInterface.php | 22 + .../sdk/Common/Future/CancellationInterface.php | 18 + .../sdk/Common/Future/CompletedFuture.php | 48 + .../sdk/Common/Future/ErrorFuture.php | 40 + .../sdk/Common/Future/FutureInterface.php | 34 + .../sdk/Common/Future/NullCancellation.php | 20 + .../Common/Http/DependencyResolverInterface.php | 13 + .../Http/HttpPlug/Client/ResolverInterface.php | 12 + .../Common/Http/Psr/Client/ResolverInterface.php | 12 + .../Http/Psr/Message/FactoryResolverInterface.php | 22 + .../sdk/Common/Http/Psr/Message/MessageFactory.php | 52 + .../Http/Psr/Message/MessageFactoryInterface.php | 13 + .../Instrumentation/InstrumentationScope.php | 46 + .../InstrumentationScopeFactory.php | 31 + .../InstrumentationScopeFactoryInterface.php | 15 + .../InstrumentationScopeInterface.php | 18 + .../sdk/Common/Time/ClockFactory.php | 30 + .../sdk/Common/Time/ClockFactoryInterface.php | 16 + .../sdk/Common/Time/ClockInterface.php | 19 + .../open-telemetry/sdk/Common/Time/StopWatch.php | 119 ++ .../sdk/Common/Time/StopWatchFactory.php | 44 + .../sdk/Common/Time/StopWatchFactoryInterface.php | 18 + .../sdk/Common/Time/StopWatchInterface.php | 20 + .../open-telemetry/sdk/Common/Time/SystemClock.php | 49 + vendor/open-telemetry/sdk/Common/Time/Util.php | 32 + .../sdk/Common/Util/ClassConstantAccessor.php | 35 + .../sdk/Common/Util/ShutdownHandler.php | 82 + vendor/open-telemetry/sdk/Common/Util/WeakMap.php | 175 ++ .../open-telemetry/sdk/Common/Util/functions.php | 52 + .../sdk/Logs/Exporter/ConsoleExporter.php | 106 + .../sdk/Logs/Exporter/ConsoleExporterFactory.php | 19 + .../sdk/Logs/Exporter/InMemoryExporter.php | 48 + .../sdk/Logs/Exporter/InMemoryExporterFactory.php | 16 + .../sdk/Logs/Exporter/NoopExporter.php | 28 + .../open-telemetry/sdk/Logs/Exporter/_register.php | 6 + vendor/open-telemetry/sdk/Logs/ExporterFactory.php | 29 + .../sdk/Logs/LogRecordExporterFactoryInterface.php | 10 + .../sdk/Logs/LogRecordExporterInterface.php | 18 + vendor/open-telemetry/sdk/Logs/LogRecordLimits.php | 29 + .../sdk/Logs/LogRecordLimitsBuilder.php | 58 + .../sdk/Logs/LogRecordProcessorFactory.php | 62 + .../sdk/Logs/LogRecordProcessorInterface.php | 15 + vendor/open-telemetry/sdk/Logs/Logger.php | 37 + vendor/open-telemetry/sdk/Logs/LoggerProvider.php | 56 + .../sdk/Logs/LoggerProviderBuilder.php | 55 + .../sdk/Logs/LoggerProviderFactory.php | 24 + .../sdk/Logs/LoggerProviderInterface.php | 13 + .../open-telemetry/sdk/Logs/LoggerSharedState.php | 60 + .../open-telemetry/sdk/Logs/NoopLoggerProvider.php | 33 + .../sdk/Logs/Processor/BatchLogRecordProcessor.php | 273 +++ .../sdk/Logs/Processor/MultiLogRecordProcessor.php | 62 + .../sdk/Logs/Processor/NoopLogRecordProcessor.php | 37 + .../Logs/Processor/SimpleLogRecordProcessor.php | 38 + .../sdk/Logs/PsrSeverityMapperInterface.php | 50 + .../open-telemetry/sdk/Logs/ReadWriteLogRecord.php | 9 + .../open-telemetry/sdk/Logs/ReadableLogRecord.php | 103 + .../sdk/Logs/SimplePsrFileLogger.php | 83 + .../ExplicitBucketHistogramAggregation.php | 167 ++ .../Aggregation/ExplicitBucketHistogramSummary.php | 40 + .../Metrics/Aggregation/LastValueAggregation.php | 81 + .../sdk/Metrics/Aggregation/LastValueSummary.php | 22 + .../sdk/Metrics/Aggregation/SumAggregation.php | 91 + .../sdk/Metrics/Aggregation/SumSummary.php | 20 + .../sdk/Metrics/AggregationInterface.php | 57 + .../AggregationTemporalitySelectorInterface.php | 21 + .../FilteredAttributeProcessor.php | 33 + .../IdentityAttributeProcessor.php | 20 + .../sdk/Metrics/AttributeProcessorInterface.php | 16 + vendor/open-telemetry/sdk/Metrics/Counter.php | 37 + .../sdk/Metrics/Data/DataInterface.php | 9 + .../open-telemetry/sdk/Metrics/Data/Exemplar.php | 65 + vendor/open-telemetry/sdk/Metrics/Data/Gauge.php | 22 + .../open-telemetry/sdk/Metrics/Data/Histogram.php | 29 + .../sdk/Metrics/Data/HistogramDataPoint.php | 76 + vendor/open-telemetry/sdk/Metrics/Data/Metric.php | 46 + .../sdk/Metrics/Data/NumberDataPoint.php | 43 + vendor/open-telemetry/sdk/Metrics/Data/Sum.php | 34 + .../sdk/Metrics/Data/Temporality.php | 20 + .../DefaultAggregationProviderInterface.php | 13 + .../Metrics/DefaultAggregationProviderTrait.php | 28 + .../sdk/Metrics/Exemplar/BucketEntry.php | 26 + .../sdk/Metrics/Exemplar/BucketStorage.php | 92 + .../Exemplar/ExemplarFilter/AllExemplarFilter.php | 21 + .../Exemplar/ExemplarFilter/NoneExemplarFilter.php | 21 + .../WithSampledTraceExemplarFilter.php | 22 + .../Metrics/Exemplar/ExemplarFilterInterface.php | 20 + .../Exemplar/ExemplarReservoirInterface.php | 24 + .../sdk/Metrics/Exemplar/FilteredReservoir.php | 36 + .../sdk/Metrics/Exemplar/FixedSizeReservoir.php | 38 + .../Metrics/Exemplar/HistogramBucketReservoir.php | 40 + .../sdk/Metrics/Exemplar/NoopReservoir.php | 21 + vendor/open-telemetry/sdk/Metrics/Histogram.php | 37 + vendor/open-telemetry/sdk/Metrics/Instrument.php | 36 + .../open-telemetry/sdk/Metrics/InstrumentType.php | 25 + vendor/open-telemetry/sdk/Metrics/Meter.php | 314 +++ .../sdk/Metrics/MeterInstruments.php | 29 + .../open-telemetry/sdk/Metrics/MeterProvider.php | 130 ++ .../sdk/Metrics/MeterProviderBuilder.php | 62 + .../sdk/Metrics/MeterProviderFactory.php | 78 + .../sdk/Metrics/MeterProviderInterface.php | 12 + .../MetricExporter/ConsoleMetricExporter.php | 105 + .../ConsoleMetricExporterFactory.php | 16 + .../Metrics/MetricExporter/InMemoryExporter.php | 78 + .../MetricExporter/InMemoryExporterFactory.php | 16 + .../Metrics/MetricExporter/NoopMetricExporter.php | 23 + .../MetricExporter/NoopMetricExporterFactory.php | 16 + .../sdk/Metrics/MetricExporter/_register.php | 7 + .../sdk/Metrics/MetricExporterFactoryInterface.php | 10 + .../sdk/Metrics/MetricExporterInterface.php | 17 + .../sdk/Metrics/MetricFactory/StreamFactory.php | 187 ++ .../Metrics/MetricFactory/StreamMetricSource.php | 44 + .../MetricFactory/StreamMetricSourceProvider.php | 98 + .../sdk/Metrics/MetricFactoryInterface.php | 41 + .../sdk/Metrics/MetricMetadataInterface.php | 28 + .../sdk/Metrics/MetricReader/ExportingReader.php | 156 ++ .../sdk/Metrics/MetricReaderInterface.php | 14 + .../MultiRegistryRegistration.php | 36 + .../MetricRegistration/RegistryRegistration.php | 31 + .../sdk/Metrics/MetricRegistrationInterface.php | 13 + .../MetricRegistry/MetricCollectorInterface.php | 13 + .../sdk/Metrics/MetricRegistry/MetricRegistry.php | 184 ++ .../MetricRegistry/MetricRegistryInterface.php | 22 + .../MetricRegistry/MetricWriterInterface.php | 20 + .../sdk/Metrics/MetricRegistry/MultiObserver.php | 37 + .../sdk/Metrics/MetricRegistry/NoopObserver.php | 18 + .../sdk/Metrics/MetricSourceInterface.php | 24 + .../sdk/Metrics/MetricSourceProviderInterface.php | 15 + .../sdk/Metrics/MetricSourceRegistryInterface.php | 10 + .../sdk/Metrics/NoopMeterProvider.php | 26 + .../sdk/Metrics/ObservableCallback.php | 58 + .../sdk/Metrics/ObservableCallbackDestructor.php | 32 + .../sdk/Metrics/ObservableCounter.php | 15 + .../open-telemetry/sdk/Metrics/ObservableGauge.php | 15 + .../sdk/Metrics/ObservableInstrumentTrait.php | 61 + .../sdk/Metrics/ObservableUpDownCounter.php | 15 + .../sdk/Metrics/PushMetricExporterInterface.php | 12 + .../sdk/Metrics/ReferenceCounterInterface.php | 15 + .../StalenessHandler/DelayedStalenessHandler.php | 71 + .../DelayedStalenessHandlerFactory.php | 64 + .../StalenessHandler/ImmediateStalenessHandler.php | 50 + .../ImmediateStalenessHandlerFactory.php | 16 + .../StalenessHandler/NoopStalenessHandler.php | 30 + .../NoopStalenessHandlerFactory.php | 18 + .../Metrics/StalenessHandlerFactoryInterface.php | 13 + .../sdk/Metrics/StalenessHandlerInterface.php | 12 + .../Metrics/Stream/AsynchronousMetricStream.php | 111 ++ vendor/open-telemetry/sdk/Metrics/Stream/Delta.php | 33 + .../sdk/Metrics/Stream/DeltaStorage.php | 110 ++ .../open-telemetry/sdk/Metrics/Stream/Metric.php | 44 + .../sdk/Metrics/Stream/MetricAggregator.php | 73 + .../sdk/Metrics/Stream/MetricAggregatorFactory.php | 28 + .../Stream/MetricAggregatorFactoryInterface.php | 13 + .../Metrics/Stream/MetricAggregatorInterface.php | 12 + .../Metrics/Stream/MetricCollectorInterface.php | 13 + .../sdk/Metrics/Stream/MetricStreamInterface.php | 58 + .../sdk/Metrics/Stream/SynchronousMetricStream.php | 126 ++ .../Stream/WritableMetricStreamInterface.php | 19 + .../open-telemetry/sdk/Metrics/UpDownCounter.php | 37 + .../sdk/Metrics/View/CriteriaViewRegistry.php | 40 + .../Metrics/View/SelectionCriteria/AllCriteria.php | 33 + .../SelectionCriteria/InstrumentNameCriteria.php | 28 + .../SelectionCriteria/InstrumentTypeCriteria.php | 29 + .../InstrumentationScopeNameCriteria.php | 24 + .../InstrumentationScopeSchemaUrlCriteria.php | 24 + .../InstrumentationScopeVersionCriteria.php | 24 + .../Metrics/View/SelectionCriteriaInterface.php | 13 + .../sdk/Metrics/View/ViewTemplate.php | 77 + .../open-telemetry/sdk/Metrics/ViewProjection.php | 47 + .../sdk/Metrics/ViewRegistryInterface.php | 15 + .../sdk/Propagation/PropagatorFactory.php | 55 + .../open-telemetry/sdk/Propagation/_register.php | 16 + vendor/open-telemetry/sdk/README.md | 49 + vendor/open-telemetry/sdk/Registry.php | 208 ++ .../sdk/Resource/Detectors/Composer.php | 30 + .../sdk/Resource/Detectors/Composite.php | 32 + .../sdk/Resource/Detectors/Constant.php | 23 + .../sdk/Resource/Detectors/Environment.php | 40 + .../open-telemetry/sdk/Resource/Detectors/Host.php | 27 + .../sdk/Resource/Detectors/OperatingSystem.php | 32 + .../sdk/Resource/Detectors/Process.php | 43 + .../sdk/Resource/Detectors/ProcessRuntime.php | 28 + .../open-telemetry/sdk/Resource/Detectors/Sdk.php | 53 + .../sdk/Resource/Detectors/SdkProvided.php | 25 + .../sdk/Resource/ResourceDetectorInterface.php | 10 + .../open-telemetry/sdk/Resource/ResourceInfo.php | 125 ++ .../sdk/Resource/ResourceInfoFactory.php | 95 + vendor/open-telemetry/sdk/Sdk.php | 70 + vendor/open-telemetry/sdk/SdkAutoloader.php | 76 + vendor/open-telemetry/sdk/SdkBuilder.php | 98 + .../sdk/Trace/Behavior/LoggerAwareTrait.php | 48 + .../Trace/Behavior/SpanExporterDecoratorTrait.php | 47 + .../sdk/Trace/Behavior/SpanExporterTrait.php | 47 + .../sdk/Trace/Behavior/UsesSpanConverterTrait.php | 41 + vendor/open-telemetry/sdk/Trace/Event.php | 47 + vendor/open-telemetry/sdk/Trace/EventInterface.php | 15 + .../open-telemetry/sdk/Trace/ExporterFactory.php | 32 + .../sdk/Trace/IdGeneratorInterface.php | 12 + vendor/open-telemetry/sdk/Trace/ImmutableSpan.php | 153 ++ vendor/open-telemetry/sdk/Trace/Link.php | 30 + vendor/open-telemetry/sdk/Trace/LinkInterface.php | 14 + .../sdk/Trace/NoopTracerProvider.php | 21 + .../open-telemetry/sdk/Trace/RandomIdGenerator.php | 49 + .../sdk/Trace/ReadWriteSpanInterface.php | 11 + .../sdk/Trace/ReadableSpanInterface.php | 48 + .../sdk/Trace/Sampler/AlwaysOffSampler.php | 50 + .../sdk/Trace/Sampler/AlwaysOnSampler.php | 50 + .../sdk/Trace/Sampler/ParentBased.php | 100 + .../sdk/Trace/Sampler/TraceIdRatioBasedSampler.php | 70 + vendor/open-telemetry/sdk/Trace/SamplerFactory.php | 48 + .../open-telemetry/sdk/Trace/SamplerInterface.php | 46 + vendor/open-telemetry/sdk/Trace/SamplingResult.php | 71 + vendor/open-telemetry/sdk/Trace/Span.php | 359 ++++ vendor/open-telemetry/sdk/Trace/SpanBuilder.php | 191 ++ .../sdk/Trace/SpanConverterInterface.php | 10 + .../open-telemetry/sdk/Trace/SpanDataInterface.php | 46 + .../sdk/Trace/SpanExporter/AbstractDecorator.php | 12 + .../sdk/Trace/SpanExporter/ConsoleSpanExporter.php | 57 + .../SpanExporter/ConsoleSpanExporterFactory.php | 18 + .../Trace/SpanExporter/FriendlySpanConverter.php | 173 ++ .../sdk/Trace/SpanExporter/InMemoryExporter.php | 40 + .../SpanExporter/InMemorySpanExporterFactory.php | 15 + .../sdk/Trace/SpanExporter/LoggerDecorator.php | 58 + .../sdk/Trace/SpanExporter/LoggerExporter.php | 96 + .../sdk/Trace/SpanExporter/NullSpanConverter.php | 15 + .../SpanExporter/SpanExporterFactoryInterface.php | 12 + .../sdk/Trace/SpanExporter/_register.php | 7 + .../sdk/Trace/SpanExporterInterface.php | 29 + vendor/open-telemetry/sdk/Trace/SpanLimits.php | 67 + .../open-telemetry/sdk/Trace/SpanLimitsBuilder.php | 148 ++ .../sdk/Trace/SpanProcessor/BatchSpanProcessor.php | 290 +++ .../SpanProcessor/BatchSpanProcessorBuilder.php | 41 + .../sdk/Trace/SpanProcessor/MultiSpanProcessor.php | 79 + .../sdk/Trace/SpanProcessor/NoopSpanProcessor.php | 47 + .../Trace/SpanProcessor/SimpleSpanProcessor.php | 120 ++ .../sdk/Trace/SpanProcessorFactory.php | 48 + .../sdk/Trace/SpanProcessorInterface.php | 38 + vendor/open-telemetry/sdk/Trace/StatusData.php | 84 + .../sdk/Trace/StatusDataInterface.php | 18 + vendor/open-telemetry/sdk/Trace/Tracer.php | 52 + vendor/open-telemetry/sdk/Trace/TracerProvider.php | 99 + .../sdk/Trace/TracerProviderBuilder.php | 45 + .../sdk/Trace/TracerProviderFactory.php | 60 + .../sdk/Trace/TracerProviderInterface.php | 15 + .../open-telemetry/sdk/Trace/TracerSharedState.php | 100 + vendor/open-telemetry/sdk/_autoload.php | 5 + vendor/open-telemetry/sdk/composer.json | 59 + vendor/open-telemetry/sem-conv/README.md | 25 + .../open-telemetry/sem-conv/ResourceAttributes.php | 1007 ++++++++++ vendor/open-telemetry/sem-conv/TraceAttributes.php | 2052 ++++++++++++++++++++ vendor/open-telemetry/sem-conv/composer.json | 32 + .../opentracing/.github/ISSUE_TEMPLATE.md | 21 - .../opentracing/.github/PULL_REQUEST_TEMPLATE.md | 24 - .../opentracing/.github/workflows/ci.yml | 44 - vendor/opentracing/opentracing/.gitignore | 4 - vendor/opentracing/opentracing/CONTRIBUTING.md | 75 - vendor/opentracing/opentracing/LICENSE | 201 -- vendor/opentracing/opentracing/README.md | 306 --- vendor/opentracing/opentracing/composer.json | 44 - vendor/opentracing/opentracing/phpstan.neon | 5 - vendor/opentracing/opentracing/phpunit.xml | 27 - .../opentracing/src/OpenTracing/Formats.php | 49 - .../opentracing/src/OpenTracing/GlobalTracer.php | 60 - .../InvalidReferenceArgumentException.php | 33 - .../OpenTracing/InvalidReferencesSetException.php | 30 - .../src/OpenTracing/InvalidSpanOptionException.php | 131 -- .../opentracing/src/OpenTracing/Mock/MockScope.php | 62 - .../src/OpenTracing/Mock/MockScopeManager.php | 49 - .../opentracing/src/OpenTracing/Mock/MockSpan.php | 145 -- .../src/OpenTracing/Mock/MockSpanContext.php | 100 - .../src/OpenTracing/Mock/MockTracer.php | 152 -- .../opentracing/src/OpenTracing/NoopScope.php | 23 - .../src/OpenTracing/NoopScopeManager.php | 24 - .../opentracing/src/OpenTracing/NoopSpan.php | 67 - .../src/OpenTracing/NoopSpanContext.php | 35 - .../opentracing/src/OpenTracing/NoopTracer.php | 62 - .../opentracing/src/OpenTracing/Reference.php | 77 - .../opentracing/src/OpenTracing/Scope.php | 32 - .../opentracing/src/OpenTracing/ScopeManager.php | 40 - .../opentracing/src/OpenTracing/Span.php | 95 - .../opentracing/src/OpenTracing/SpanContext.php | 37 - .../src/OpenTracing/StartSpanOptions.php | 206 -- .../opentracing/src/OpenTracing/Tags.php | 124 -- .../opentracing/src/OpenTracing/Tracer.php | 119 -- .../src/OpenTracing/UnsupportedFormatException.php | 22 - .../OpenTracing/Mock/MockScopeManagerTest.php | 63 - .../tests/OpenTracing/Mock/MockSpanContextTest.php | 54 - .../tests/OpenTracing/Mock/MockSpanTest.php | 52 - .../tests/OpenTracing/Mock/MockTracerTest.php | 139 -- .../tests/OpenTracing/ReferenceTest.php | 45 - .../tests/OpenTracing/StartSpanOptionsTest.php | 129 -- vendor/packaged/thrift/.gitignore | 2 - vendor/packaged/thrift/README.md | 44 - vendor/packaged/thrift/composer.json | 16 - vendor/packaged/thrift/src/Base/TBase.php | 382 ---- .../thrift/src/ClassLoader/ThriftClassLoader.php | 206 -- .../thrift/src/Exception/TApplicationException.php | 76 - .../packaged/thrift/src/Exception/TException.php | 384 ---- .../thrift/src/Exception/TProtocolException.php | 50 - .../thrift/src/Exception/TTransportException.php | 40 - .../thrift/src/Factory/TBinaryProtocolFactory.php | 45 - .../thrift/src/Factory/TCompactProtocolFactory.php | 40 - .../thrift/src/Factory/TJSONProtocolFactory.php | 40 - .../thrift/src/Factory/TProtocolFactory.php | 36 - .../thrift/src/Factory/TStringFuncFactory.php | 66 - .../thrift/src/Factory/TTransportFactory.php | 18 - .../thrift/src/Protocol/JSON/BaseContext.php | 39 - .../thrift/src/Protocol/JSON/ListContext.php | 54 - .../thrift/src/Protocol/JSON/LookaheadReader.php | 57 - .../thrift/src/Protocol/JSON/PairContext.php | 64 - .../SimpleJSON/CollectionMapKeyException.php | 33 - .../thrift/src/Protocol/SimpleJSON/Context.php | 35 - .../thrift/src/Protocol/SimpleJSON/ListContext.php | 45 - .../thrift/src/Protocol/SimpleJSON/MapContext.php | 47 - .../src/Protocol/SimpleJSON/StructContext.php | 52 - .../thrift/src/Protocol/TBinaryProtocol.php | 453 ----- .../src/Protocol/TBinaryProtocolAccelerated.php | 67 - .../thrift/src/Protocol/TCompactProtocol.php | 739 ------- .../packaged/thrift/src/Protocol/TJSONProtocol.php | 815 -------- .../thrift/src/Protocol/TMultiplexedProtocol.php | 85 - vendor/packaged/thrift/src/Protocol/TProtocol.php | 352 ---- .../thrift/src/Protocol/TProtocolDecorator.php | 285 --- .../thrift/src/Protocol/TSimpleJSONProtocol.php | 374 ---- .../thrift/src/Serializer/TBinarySerializer.php | 87 - .../packaged/thrift/src/Server/TForkingServer.php | 125 -- .../thrift/src/Server/TSSLServerSocket.php | 97 - vendor/packaged/thrift/src/Server/TServer.php | 102 - .../packaged/thrift/src/Server/TServerSocket.php | 124 -- .../thrift/src/Server/TServerTransport.php | 56 - .../packaged/thrift/src/Server/TSimpleServer.php | 60 - .../packaged/thrift/src/StoredMessageProtocol.php | 53 - vendor/packaged/thrift/src/StringFunc/Core.php | 40 - vendor/packaged/thrift/src/StringFunc/Mbstring.php | 46 - .../packaged/thrift/src/StringFunc/TStringFunc.php | 28 - .../packaged/thrift/src/TMultiplexedProcessor.php | 118 -- .../thrift/src/Transport/TBufferedTransport.php | 206 -- .../packaged/thrift/src/Transport/TCurlClient.php | 281 --- .../thrift/src/Transport/TFramedTransport.php | 192 -- .../packaged/thrift/src/Transport/THttpClient.php | 258 --- .../thrift/src/Transport/TMemoryBuffer.php | 106 - .../thrift/src/Transport/TNullTransport.php | 56 - .../packaged/thrift/src/Transport/TPhpStream.php | 124 -- .../packaged/thrift/src/Transport/TSSLSocket.php | 117 -- vendor/packaged/thrift/src/Transport/TSocket.php | 366 ---- .../packaged/thrift/src/Transport/TSocketPool.php | 310 --- .../packaged/thrift/src/Transport/TTransport.php | 98 - vendor/packaged/thrift/src/Type/TConstant.php | 52 - vendor/packaged/thrift/src/Type/TMessageType.php | 34 - vendor/packaged/thrift/src/Type/TType.php | 47 - vendor/packaged/thrift/update.sh | 22 - vendor/php-http/discovery/.php-cs-fixer.php | 16 + vendor/php-http/discovery/CHANGELOG.md | 374 ++++ vendor/php-http/discovery/LICENSE | 19 + vendor/php-http/discovery/README.md | 122 ++ vendor/php-http/discovery/composer.json | 63 + vendor/php-http/discovery/src/ClassDiscovery.php | 255 +++ vendor/php-http/discovery/src/Composer/Plugin.php | 465 +++++ vendor/php-http/discovery/src/Exception.php | 12 + .../ClassInstantiationFailedException.php | 14 + .../src/Exception/DiscoveryFailedException.php | 51 + .../src/Exception/NoCandidateFoundException.php | 47 + .../discovery/src/Exception/NotFoundException.php | 16 + .../src/Exception/PuliUnavailableException.php | 12 + .../src/Exception/StrategyUnavailableException.php | 15 + .../discovery/src/HttpAsyncClientDiscovery.php | 32 + .../php-http/discovery/src/HttpClientDiscovery.php | 34 + .../discovery/src/MessageFactoryDiscovery.php | 34 + .../php-http/discovery/src/NotFoundException.php | 14 + vendor/php-http/discovery/src/Psr17Factory.php | 303 +++ .../discovery/src/Psr17FactoryDiscovery.php | 136 ++ vendor/php-http/discovery/src/Psr18Client.php | 45 + .../discovery/src/Psr18ClientDiscovery.php | 32 + .../src/Strategy/CommonClassesStrategy.php | 180 ++ .../src/Strategy/CommonPsr17ClassesStrategy.php | 104 + .../discovery/src/Strategy/DiscoveryStrategy.php | 23 + .../discovery/src/Strategy/MockClientStrategy.php | 24 + .../discovery/src/Strategy/PuliBetaStrategy.php | 90 + .../discovery/src/StreamFactoryDiscovery.php | 34 + .../php-http/discovery/src/UriFactoryDiscovery.php | 34 + vendor/php-http/guzzle7-adapter/CHANGELOG.md | 18 + vendor/php-http/guzzle7-adapter/LICENSE | 19 + vendor/php-http/guzzle7-adapter/README.md | 45 + vendor/php-http/guzzle7-adapter/composer.json | 43 + vendor/php-http/guzzle7-adapter/phpstan.neon.dist | 5 + vendor/php-http/guzzle7-adapter/psalm.baseline.xml | 8 + vendor/php-http/guzzle7-adapter/psalm.xml | 16 + vendor/php-http/guzzle7-adapter/src/Client.php | 75 + .../src/Exception/UnexpectedValueException.php | 9 + vendor/php-http/guzzle7-adapter/src/Promise.php | 132 ++ vendor/php-http/httplug/.php-cs-fixer.dist.php | 16 + vendor/php-http/httplug/CHANGELOG.md | 141 ++ vendor/php-http/httplug/LICENSE | 20 + vendor/php-http/httplug/README.md | 54 + vendor/php-http/httplug/composer.json | 40 + vendor/php-http/httplug/puli.json | 12 + vendor/php-http/httplug/src/Exception.php | 14 + .../httplug/src/Exception/HttpException.php | 65 + .../httplug/src/Exception/NetworkException.php | 28 + .../httplug/src/Exception/RequestAwareTrait.php | 26 + .../httplug/src/Exception/RequestException.php | 29 + .../httplug/src/Exception/TransferException.php | 14 + vendor/php-http/httplug/src/HttpAsyncClient.php | 25 + vendor/php-http/httplug/src/HttpClient.php | 17 + .../httplug/src/Promise/HttpFulfilledPromise.php | 54 + .../httplug/src/Promise/HttpRejectedPromise.php | 58 + vendor/php-http/promise/CHANGELOG.md | 48 + vendor/php-http/promise/LICENSE | 19 + vendor/php-http/promise/README.md | 48 + vendor/php-http/promise/composer.json | 38 + vendor/php-http/promise/src/FulfilledPromise.php | 58 + vendor/php-http/promise/src/Promise.php | 69 + vendor/php-http/promise/src/RejectedPromise.php | 58 + vendor/psr/cache/CHANGELOG.md | 16 - vendor/psr/cache/LICENSE.txt | 19 - vendor/psr/cache/README.md | 12 - vendor/psr/cache/composer.json | 25 - vendor/psr/cache/src/CacheException.php | 10 - vendor/psr/cache/src/CacheItemInterface.php | 105 - vendor/psr/cache/src/CacheItemPoolInterface.php | 138 -- vendor/psr/cache/src/InvalidArgumentException.php | 13 - vendor/psr/http-client/CHANGELOG.md | 31 + vendor/psr/http-client/LICENSE | 19 + vendor/psr/http-client/README.md | 12 + vendor/psr/http-client/composer.json | 30 + .../http-client/src/ClientExceptionInterface.php | 10 + vendor/psr/http-client/src/ClientInterface.php | 20 + .../http-client/src/NetworkExceptionInterface.php | 24 + .../http-client/src/RequestExceptionInterface.php | 24 + vendor/psr/http-factory/LICENSE | 21 + vendor/psr/http-factory/README.md | 12 + vendor/psr/http-factory/composer.json | 35 + .../http-factory/src/RequestFactoryInterface.php | 18 + .../http-factory/src/ResponseFactoryInterface.php | 18 + .../src/ServerRequestFactoryInterface.php | 24 + .../http-factory/src/StreamFactoryInterface.php | 45 + .../src/UploadedFileFactoryInterface.php | 34 + .../psr/http-factory/src/UriFactoryInterface.php | 17 + vendor/psr/http-message/CHANGELOG.md | 36 + vendor/psr/http-message/LICENSE | 19 + vendor/psr/http-message/README.md | 16 + vendor/psr/http-message/composer.json | 26 + vendor/psr/http-message/docs/PSR7-Interfaces.md | 130 ++ vendor/psr/http-message/docs/PSR7-Usage.md | 159 ++ vendor/psr/http-message/src/MessageInterface.php | 187 ++ vendor/psr/http-message/src/RequestInterface.php | 130 ++ vendor/psr/http-message/src/ResponseInterface.php | 68 + .../http-message/src/ServerRequestInterface.php | 261 +++ vendor/psr/http-message/src/StreamInterface.php | 158 ++ .../psr/http-message/src/UploadedFileInterface.php | 123 ++ vendor/psr/http-message/src/UriInterface.php | 324 ++++ vendor/ralouphie/getallheaders/LICENSE | 21 + vendor/ralouphie/getallheaders/README.md | 27 + vendor/ralouphie/getallheaders/composer.json | 26 + .../ralouphie/getallheaders/src/getallheaders.php | 46 + vendor/symfony/deprecation-contracts/.gitignore | 3 + vendor/symfony/deprecation-contracts/CHANGELOG.md | 5 + vendor/symfony/deprecation-contracts/LICENSE | 19 + vendor/symfony/deprecation-contracts/README.md | 26 + vendor/symfony/deprecation-contracts/composer.json | 35 + vendor/symfony/deprecation-contracts/function.php | 27 + vendor/symfony/polyfill-mbstring/LICENSE | 19 + vendor/symfony/polyfill-mbstring/Mbstring.php | 947 +++++++++ vendor/symfony/polyfill-mbstring/README.md | 13 + .../Resources/unidata/caseFolding.php | 119 ++ .../Resources/unidata/lowerCase.php | 1397 +++++++++++++ .../Resources/unidata/titleCaseRegexp.php | 5 + .../Resources/unidata/upperCase.php | 1489 ++++++++++++++ vendor/symfony/polyfill-mbstring/bootstrap.php | 151 ++ vendor/symfony/polyfill-mbstring/bootstrap80.php | 147 ++ vendor/symfony/polyfill-mbstring/composer.json | 41 + vendor/symfony/polyfill-php80/LICENSE | 19 + vendor/symfony/polyfill-php80/Php80.php | 115 ++ vendor/symfony/polyfill-php80/PhpToken.php | 103 + vendor/symfony/polyfill-php80/README.md | 25 + .../polyfill-php80/Resources/stubs/Attribute.php | 31 + .../polyfill-php80/Resources/stubs/PhpToken.php | 16 + .../polyfill-php80/Resources/stubs/Stringable.php | 20 + .../Resources/stubs/UnhandledMatchError.php | 16 + .../polyfill-php80/Resources/stubs/ValueError.php | 16 + vendor/symfony/polyfill-php80/bootstrap.php | 42 + vendor/symfony/polyfill-php80/composer.json | 40 + vendor/symfony/polyfill-php81/LICENSE | 19 + vendor/symfony/polyfill-php81/Php81.php | 37 + vendor/symfony/polyfill-php81/README.md | 18 + .../Resources/stubs/CURLStringFile.php | 51 + .../Resources/stubs/ReturnTypeWillChange.php | 20 + vendor/symfony/polyfill-php81/bootstrap.php | 28 + vendor/symfony/polyfill-php81/composer.json | 36 + vendor/symfony/polyfill-php82/LICENSE | 19 + .../symfony/polyfill-php82/NoDynamicProperties.php | 23 + vendor/symfony/polyfill-php82/Php82.php | 368 ++++ vendor/symfony/polyfill-php82/README.md | 23 + .../polyfill-php82/Random/Engine/Secure.php | 50 + .../Resources/stubs/AllowDynamicProperties.php | 20 + .../stubs/Random/BrokenRandomEngineError.php | 18 + .../Resources/stubs/Random/CryptoSafeEngine.php | 18 + .../Resources/stubs/Random/Engine.php | 19 + .../Resources/stubs/Random/Engine/Secure.php | 20 + .../Resources/stubs/Random/RandomError.php | 21 + .../Resources/stubs/Random/RandomException.php | 21 + .../Resources/stubs/SensitiveParameter.php | 20 + .../Resources/stubs/SensitiveParameterValue.php | 16 + .../polyfill-php82/SensitiveParameterValue.php | 47 + vendor/symfony/polyfill-php82/bootstrap.php | 36 + vendor/symfony/polyfill-php82/composer.json | 36 + 1144 files changed, 91791 insertions(+), 24093 deletions(-) create mode 100644 vendor/google/protobuf/LICENSE create mode 100644 vendor/google/protobuf/README.md create mode 100644 vendor/google/protobuf/composer.json create mode 100644 vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Any.php create mode 100644 vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Api.php create mode 100644 vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Duration.php create mode 100644 vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/FieldMask.php create mode 100644 vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/GPBEmpty.php create mode 100644 vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php create mode 100644 vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/SourceContext.php create mode 100644 vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Struct.php create mode 100644 vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Timestamp.php create mode 100644 vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Type.php create mode 100644 vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Wrappers.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Any.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Api.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/BoolValue.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/BytesValue.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Descriptor.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/DescriptorPool.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Duration.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Enum.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/EnumDescriptor.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/EnumValue.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/EnumValueDescriptor.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Field.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Field/Cardinality.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Field/Kind.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/FieldDescriptor.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/FieldMask.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Field_Cardinality.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Field_Kind.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/FloatValue.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/GPBEmpty.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Int32Value.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Int64Value.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/AnyBase.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/CodedInputStream.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/CodedOutputStream.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/Descriptor.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorPool.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto_ReservedRange.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/EnumBuilderContext.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptor.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto_EnumReservedRange.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/EnumOptions.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueOptions.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptor.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Label.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Type.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto_Type.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/CType.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/JSType.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions_CType.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions_JSType.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptor.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorProto.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorSet.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions/OptimizeMode.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions_OptimizeMode.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/GPBDecodeException.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/GPBJsonWire.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/GPBLabel.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/GPBType.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWire.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWireType.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/GetPublicDescriptorTrait.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/HasPublicDescriptorTrait.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/MapEntry.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/MapField.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/MapFieldIter.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/MessageBuilderContext.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/MessageOptions.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/MethodDescriptorProto.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions/IdempotencyLevel.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions_IdempotencyLevel.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptor.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptorProto.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/OneofField.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/OneofOptions.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/RawInputStream.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedField.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedFieldIter.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceDescriptorProto.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceOptions.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/TimestampBase.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/ListValue.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Method.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Mixin.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/NullValue.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/OneofDescriptor.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Option.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/SourceContext.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/StringValue.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Struct.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Syntax.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Timestamp.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Type.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/UInt32Value.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/UInt64Value.php create mode 100644 vendor/google/protobuf/src/Google/Protobuf/Value.php create mode 100644 vendor/google/protobuf/src/phpdoc.dist.xml create mode 100644 vendor/guzzlehttp/guzzle/CHANGELOG.md create mode 100644 vendor/guzzlehttp/guzzle/LICENSE create mode 100644 vendor/guzzlehttp/guzzle/README.md create mode 100644 vendor/guzzlehttp/guzzle/UPGRADING.md create mode 100644 vendor/guzzlehttp/guzzle/composer.json create mode 100644 vendor/guzzlehttp/guzzle/src/BodySummarizer.php create mode 100644 vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php create mode 100644 vendor/guzzlehttp/guzzle/src/Client.php create mode 100644 vendor/guzzlehttp/guzzle/src/ClientInterface.php create mode 100644 vendor/guzzlehttp/guzzle/src/ClientTrait.php create mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php create mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php create mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php create mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php create mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/ClientException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/RequestException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/ServerException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/TransferException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/Proxy.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php create mode 100644 vendor/guzzlehttp/guzzle/src/HandlerStack.php create mode 100644 vendor/guzzlehttp/guzzle/src/MessageFormatter.php create mode 100644 vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php create mode 100644 vendor/guzzlehttp/guzzle/src/Middleware.php create mode 100644 vendor/guzzlehttp/guzzle/src/Pool.php create mode 100644 vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php create mode 100644 vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php create mode 100644 vendor/guzzlehttp/guzzle/src/RequestOptions.php create mode 100644 vendor/guzzlehttp/guzzle/src/RetryMiddleware.php create mode 100644 vendor/guzzlehttp/guzzle/src/TransferStats.php create mode 100644 vendor/guzzlehttp/guzzle/src/Utils.php create mode 100644 vendor/guzzlehttp/guzzle/src/functions.php create mode 100644 vendor/guzzlehttp/guzzle/src/functions_include.php create mode 100644 vendor/guzzlehttp/promises/CHANGELOG.md create mode 100644 vendor/guzzlehttp/promises/LICENSE create mode 100644 vendor/guzzlehttp/promises/README.md create mode 100644 vendor/guzzlehttp/promises/composer.json create mode 100644 vendor/guzzlehttp/promises/src/AggregateException.php create mode 100644 vendor/guzzlehttp/promises/src/CancellationException.php create mode 100644 vendor/guzzlehttp/promises/src/Coroutine.php create mode 100644 vendor/guzzlehttp/promises/src/Create.php create mode 100644 vendor/guzzlehttp/promises/src/Each.php create mode 100644 vendor/guzzlehttp/promises/src/EachPromise.php create mode 100644 vendor/guzzlehttp/promises/src/FulfilledPromise.php create mode 100644 vendor/guzzlehttp/promises/src/Is.php create mode 100644 vendor/guzzlehttp/promises/src/Promise.php create mode 100644 vendor/guzzlehttp/promises/src/PromiseInterface.php create mode 100644 vendor/guzzlehttp/promises/src/PromisorInterface.php create mode 100644 vendor/guzzlehttp/promises/src/RejectedPromise.php create mode 100644 vendor/guzzlehttp/promises/src/RejectionException.php create mode 100644 vendor/guzzlehttp/promises/src/TaskQueue.php create mode 100644 vendor/guzzlehttp/promises/src/TaskQueueInterface.php create mode 100644 vendor/guzzlehttp/promises/src/Utils.php create mode 100644 vendor/guzzlehttp/psr7/CHANGELOG.md create mode 100644 vendor/guzzlehttp/psr7/LICENSE create mode 100644 vendor/guzzlehttp/psr7/README.md create mode 100644 vendor/guzzlehttp/psr7/composer.json create mode 100644 vendor/guzzlehttp/psr7/src/AppendStream.php create mode 100644 vendor/guzzlehttp/psr7/src/BufferStream.php create mode 100644 vendor/guzzlehttp/psr7/src/CachingStream.php create mode 100644 vendor/guzzlehttp/psr7/src/DroppingStream.php create mode 100644 vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php create mode 100644 vendor/guzzlehttp/psr7/src/FnStream.php create mode 100644 vendor/guzzlehttp/psr7/src/Header.php create mode 100644 vendor/guzzlehttp/psr7/src/HttpFactory.php create mode 100644 vendor/guzzlehttp/psr7/src/InflateStream.php create mode 100644 vendor/guzzlehttp/psr7/src/LazyOpenStream.php create mode 100644 vendor/guzzlehttp/psr7/src/LimitStream.php create mode 100644 vendor/guzzlehttp/psr7/src/Message.php create mode 100644 vendor/guzzlehttp/psr7/src/MessageTrait.php create mode 100644 vendor/guzzlehttp/psr7/src/MimeType.php create mode 100644 vendor/guzzlehttp/psr7/src/MultipartStream.php create mode 100644 vendor/guzzlehttp/psr7/src/NoSeekStream.php create mode 100644 vendor/guzzlehttp/psr7/src/PumpStream.php create mode 100644 vendor/guzzlehttp/psr7/src/Query.php create mode 100644 vendor/guzzlehttp/psr7/src/Request.php create mode 100644 vendor/guzzlehttp/psr7/src/Response.php create mode 100644 vendor/guzzlehttp/psr7/src/Rfc7230.php create mode 100644 vendor/guzzlehttp/psr7/src/ServerRequest.php create mode 100644 vendor/guzzlehttp/psr7/src/Stream.php create mode 100644 vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php create mode 100644 vendor/guzzlehttp/psr7/src/StreamWrapper.php create mode 100644 vendor/guzzlehttp/psr7/src/UploadedFile.php create mode 100644 vendor/guzzlehttp/psr7/src/Uri.php create mode 100644 vendor/guzzlehttp/psr7/src/UriComparator.php create mode 100644 vendor/guzzlehttp/psr7/src/UriNormalizer.php create mode 100644 vendor/guzzlehttp/psr7/src/UriResolver.php create mode 100644 vendor/guzzlehttp/psr7/src/Utils.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/.editorconfig delete mode 100644 vendor/jonahgeorge/jaeger-client-php/.github/workflows/main.yaml delete mode 100644 vendor/jonahgeorge/jaeger-client-php/.gitignore delete mode 100644 vendor/jonahgeorge/jaeger-client-php/CONTRIBUTING.md delete mode 100644 vendor/jonahgeorge/jaeger-client-php/LICENSE delete mode 100644 vendor/jonahgeorge/jaeger-client-php/README.md delete mode 100644 vendor/jonahgeorge/jaeger-client-php/build/.gitignore delete mode 100644 vendor/jonahgeorge/jaeger-client-php/composer.json delete mode 100644 vendor/jonahgeorge/jaeger-client-php/examples/config.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/examples/jaeger.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/phpcs.xml.dist delete mode 100644 vendor/jonahgeorge/jaeger-client-php/phpunit.xml.dist delete mode 100644 vendor/jonahgeorge/jaeger-client-php/scripts/thrift-gen.sh delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/AgentClient/HttpAgentClient.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/BinaryCodec.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/CodecInterface.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/CodecUtility.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/TextCodec.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/ZipkinCodec.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Config.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Constants.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Mapper/SpanToJaegerMapper.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/CompositeReporter.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/InMemoryReporter.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/JaegerReporter.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/LoggingReporter.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/NullReporter.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/RemoteReporter.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/ReporterInterface.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/AbstractReporterFactory.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/JaegerHttpReporterFactory.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/JaegerReporterFactory.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/ReporterFactoryInterface.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/ZipkinReporterFactory.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/ConstSampler.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/ProbabilisticSampler.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/RateLimitingSampler.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/SamplerInterface.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Scope.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ScopeManager.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sender/JaegerSender.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sender/SenderInterface.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sender/UdpSender.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Span.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/SpanContext.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AgentClient.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AgentIf.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Agent_emitBatch_args.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Agent_emitZipkinBatch_args.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidatorClient.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidatorIf.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidator_validateTrace_args.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidator_validateTrace_result.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestriction.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManagerClient.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManagerIf.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManager_getBaggageRestrictions_args.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManager_getBaggageRestrictions_result.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependencies.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/DependencyClient.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/DependencyIf.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/DependencyLink.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependency_getDependenciesForTrace_args.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependency_getDependenciesForTrace_result.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependency_saveDependencies_args.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/OperationSamplingStrategy.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/PerOperationSamplingStrategies.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/ProbabilisticSamplingStrategy.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/RateLimitingSamplingStrategy.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManagerClient.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManagerIf.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManager_getSamplingStrategy_args.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManager_getSamplingStrategy_result.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingStrategyResponse.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingStrategyType.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/ValidateTraceResponse.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Annotation.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/AnnotationType.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/BinaryAnnotation.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Constant.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Endpoint.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Response.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Span.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollectorClient.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollectorIf.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollector_submitZipkinBatch_args.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollector_submitZipkinBatch_result.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Batch.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/BatchSubmitResponse.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/CollectorClient.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/CollectorIf.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Collector_submitBatches_args.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Collector_submitBatches_result.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/Downstream.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/JoinTraceRequest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/ObservedSpan.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/StartTraceRequest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TraceResponse.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedServiceClient.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedServiceIf.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_joinTrace_args.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_joinTrace_result.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_startTrace_args.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_startTrace_result.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/Transport.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Log.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Process.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Span.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/SpanRef.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/SpanRefType.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Tag.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/TagType.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ThriftUdpTransport.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Tracer.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Util/RateLimiter.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Codec/TextCodecTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Codec/ZipkinCodecTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ConfigTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Logger/StackLogger.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Mapper/SpanToJaegerMapperTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/CompositeReporterTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/InMemoryReporterTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/LoggingReporterTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/NullReporterTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/RemoteReporterTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sampler/ConstSamplerTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sampler/ProbablisticSamplerTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sampler/RateLimitSamplerTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ScopeManagerTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ScopeTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sender/JaegerThriftSenderTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sender/UdpSenderTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/SpanContextTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/SpanTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ThriftUdpTransportTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/TracerTest.php delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/README.md delete mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/php-test.sh create mode 100644 vendor/open-telemetry/api/Baggage/Baggage.php create mode 100644 vendor/open-telemetry/api/Baggage/BaggageBuilder.php create mode 100644 vendor/open-telemetry/api/Baggage/BaggageBuilderInterface.php create mode 100644 vendor/open-telemetry/api/Baggage/BaggageInterface.php create mode 100644 vendor/open-telemetry/api/Baggage/Entry.php create mode 100644 vendor/open-telemetry/api/Baggage/Metadata.php create mode 100644 vendor/open-telemetry/api/Baggage/MetadataInterface.php create mode 100644 vendor/open-telemetry/api/Baggage/Propagation/BaggagePropagator.php create mode 100644 vendor/open-telemetry/api/Baggage/Propagation/Parser.php create mode 100644 vendor/open-telemetry/api/Behavior/Internal/LogWriter/ErrorLogWriter.php create mode 100644 vendor/open-telemetry/api/Behavior/Internal/LogWriter/Formatter.php create mode 100644 vendor/open-telemetry/api/Behavior/Internal/LogWriter/LogWriterInterface.php create mode 100644 vendor/open-telemetry/api/Behavior/Internal/LogWriter/NoopLogWriter.php create mode 100644 vendor/open-telemetry/api/Behavior/Internal/LogWriter/Psr3LogWriter.php create mode 100644 vendor/open-telemetry/api/Behavior/Internal/LogWriter/StreamLogWriter.php create mode 100644 vendor/open-telemetry/api/Behavior/Internal/LogWriterFactory.php create mode 100644 vendor/open-telemetry/api/Behavior/Internal/Logging.php create mode 100644 vendor/open-telemetry/api/Behavior/LogsMessagesTrait.php create mode 100644 vendor/open-telemetry/api/Globals.php create mode 100644 vendor/open-telemetry/api/Instrumentation/CachedInstrumentation.php create mode 100644 vendor/open-telemetry/api/Instrumentation/ConfigurationResolver.php create mode 100644 vendor/open-telemetry/api/Instrumentation/ConfigurationResolverInterface.php create mode 100644 vendor/open-telemetry/api/Instrumentation/Configurator.php create mode 100644 vendor/open-telemetry/api/Instrumentation/ContextKeys.php create mode 100644 vendor/open-telemetry/api/Instrumentation/InstrumentationInterface.php create mode 100644 vendor/open-telemetry/api/Instrumentation/InstrumentationTrait.php create mode 100644 vendor/open-telemetry/api/LoggerHolder.php create mode 100644 vendor/open-telemetry/api/Logs/EventLogger.php create mode 100644 vendor/open-telemetry/api/Logs/EventLoggerInterface.php create mode 100644 vendor/open-telemetry/api/Logs/LogRecord.php create mode 100644 vendor/open-telemetry/api/Logs/LoggerInterface.php create mode 100644 vendor/open-telemetry/api/Logs/LoggerProviderInterface.php create mode 100644 vendor/open-telemetry/api/Logs/Map/Psr3.php create mode 100644 vendor/open-telemetry/api/Logs/NoopLogger.php create mode 100644 vendor/open-telemetry/api/Logs/NoopLoggerProvider.php create mode 100644 vendor/open-telemetry/api/Logs/README.md create mode 100644 vendor/open-telemetry/api/Metrics/CounterInterface.php create mode 100644 vendor/open-telemetry/api/Metrics/HistogramInterface.php create mode 100644 vendor/open-telemetry/api/Metrics/MeterInterface.php create mode 100644 vendor/open-telemetry/api/Metrics/MeterProviderInterface.php create mode 100644 vendor/open-telemetry/api/Metrics/Noop/NoopCounter.php create mode 100644 vendor/open-telemetry/api/Metrics/Noop/NoopHistogram.php create mode 100644 vendor/open-telemetry/api/Metrics/Noop/NoopMeter.php create mode 100644 vendor/open-telemetry/api/Metrics/Noop/NoopMeterProvider.php create mode 100644 vendor/open-telemetry/api/Metrics/Noop/NoopObservableCallback.php create mode 100644 vendor/open-telemetry/api/Metrics/Noop/NoopObservableCounter.php create mode 100644 vendor/open-telemetry/api/Metrics/Noop/NoopObservableGauge.php create mode 100644 vendor/open-telemetry/api/Metrics/Noop/NoopObservableUpDownCounter.php create mode 100644 vendor/open-telemetry/api/Metrics/Noop/NoopUpDownCounter.php create mode 100644 vendor/open-telemetry/api/Metrics/ObservableCallbackInterface.php create mode 100644 vendor/open-telemetry/api/Metrics/ObservableCounterInterface.php create mode 100644 vendor/open-telemetry/api/Metrics/ObservableGaugeInterface.php create mode 100644 vendor/open-telemetry/api/Metrics/ObservableUpDownCounterInterface.php create mode 100644 vendor/open-telemetry/api/Metrics/ObserverInterface.php create mode 100644 vendor/open-telemetry/api/Metrics/UpDownCounterInterface.php create mode 100644 vendor/open-telemetry/api/README.md create mode 100644 vendor/open-telemetry/api/Signals.php create mode 100644 vendor/open-telemetry/api/Trace/NonRecordingSpan.php create mode 100644 vendor/open-telemetry/api/Trace/NoopSpanBuilder.php create mode 100644 vendor/open-telemetry/api/Trace/NoopTracer.php create mode 100644 vendor/open-telemetry/api/Trace/NoopTracerProvider.php create mode 100644 vendor/open-telemetry/api/Trace/Propagation/TraceContextPropagator.php create mode 100644 vendor/open-telemetry/api/Trace/Propagation/TraceContextValidator.php create mode 100644 vendor/open-telemetry/api/Trace/Span.php create mode 100644 vendor/open-telemetry/api/Trace/SpanBuilderInterface.php create mode 100644 vendor/open-telemetry/api/Trace/SpanContext.php create mode 100644 vendor/open-telemetry/api/Trace/SpanContextInterface.php create mode 100644 vendor/open-telemetry/api/Trace/SpanContextValidator.php create mode 100644 vendor/open-telemetry/api/Trace/SpanInterface.php create mode 100644 vendor/open-telemetry/api/Trace/SpanKind.php create mode 100644 vendor/open-telemetry/api/Trace/StatusCode.php create mode 100644 vendor/open-telemetry/api/Trace/TraceFlags.php create mode 100644 vendor/open-telemetry/api/Trace/TraceState.php create mode 100644 vendor/open-telemetry/api/Trace/TraceStateInterface.php create mode 100644 vendor/open-telemetry/api/Trace/TracerInterface.php create mode 100644 vendor/open-telemetry/api/Trace/TracerProviderInterface.php create mode 100644 vendor/open-telemetry/api/Trace/functions.php create mode 100644 vendor/open-telemetry/api/composer.json create mode 100644 vendor/open-telemetry/context/Context.php create mode 100644 vendor/open-telemetry/context/ContextInterface.php create mode 100644 vendor/open-telemetry/context/ContextKey.php create mode 100644 vendor/open-telemetry/context/ContextKeyInterface.php create mode 100644 vendor/open-telemetry/context/ContextKeys.php create mode 100644 vendor/open-telemetry/context/ContextStorage.php create mode 100644 vendor/open-telemetry/context/ContextStorageHead.php create mode 100644 vendor/open-telemetry/context/ContextStorageInterface.php create mode 100644 vendor/open-telemetry/context/ContextStorageNode.php create mode 100644 vendor/open-telemetry/context/ContextStorageScopeInterface.php create mode 100644 vendor/open-telemetry/context/DebugScope.php create mode 100644 vendor/open-telemetry/context/ExecutionContextAwareInterface.php create mode 100644 vendor/open-telemetry/context/FiberBoundContextStorage.php create mode 100644 vendor/open-telemetry/context/FiberBoundContextStorageScope.php create mode 100644 vendor/open-telemetry/context/ImplicitContextKeyedInterface.php create mode 100644 vendor/open-telemetry/context/Propagation/ArrayAccessGetterSetter.php create mode 100644 vendor/open-telemetry/context/Propagation/MultiTextMapPropagator.php create mode 100644 vendor/open-telemetry/context/Propagation/NoopTextMapPropagator.php create mode 100644 vendor/open-telemetry/context/Propagation/PropagationGetterInterface.php create mode 100644 vendor/open-telemetry/context/Propagation/PropagationSetterInterface.php create mode 100644 vendor/open-telemetry/context/Propagation/SanitizeCombinedHeadersPropagationGetter.php create mode 100644 vendor/open-telemetry/context/Propagation/TextMapPropagatorInterface.php create mode 100644 vendor/open-telemetry/context/README.md create mode 100644 vendor/open-telemetry/context/ScopeInterface.php create mode 100644 vendor/open-telemetry/context/ZendObserverFiber.php create mode 100644 vendor/open-telemetry/context/composer.json create mode 100644 vendor/open-telemetry/context/fiber/initialize_fiber_handler.php create mode 100644 vendor/open-telemetry/context/fiber/zend_observer_fiber.h create mode 100644 vendor/open-telemetry/exporter-otlp/AttributesConverter.php create mode 100644 vendor/open-telemetry/exporter-otlp/ContentTypes.php create mode 100644 vendor/open-telemetry/exporter-otlp/HttpEndpointResolver.php create mode 100644 vendor/open-telemetry/exporter-otlp/HttpEndpointResolverInterface.php create mode 100644 vendor/open-telemetry/exporter-otlp/LogsConverter.php create mode 100644 vendor/open-telemetry/exporter-otlp/LogsExporter.php create mode 100644 vendor/open-telemetry/exporter-otlp/LogsExporterFactory.php create mode 100644 vendor/open-telemetry/exporter-otlp/MetricConverter.php create mode 100644 vendor/open-telemetry/exporter-otlp/MetricExporter.php create mode 100644 vendor/open-telemetry/exporter-otlp/MetricExporterFactory.php create mode 100644 vendor/open-telemetry/exporter-otlp/OtlpHttpTransportFactory.php create mode 100644 vendor/open-telemetry/exporter-otlp/OtlpUtil.php create mode 100644 vendor/open-telemetry/exporter-otlp/ProtobufSerializer.php create mode 100644 vendor/open-telemetry/exporter-otlp/Protocols.php create mode 100644 vendor/open-telemetry/exporter-otlp/README.md create mode 100644 vendor/open-telemetry/exporter-otlp/SpanConverter.php create mode 100644 vendor/open-telemetry/exporter-otlp/SpanExporter.php create mode 100644 vendor/open-telemetry/exporter-otlp/SpanExporterFactory.php create mode 100644 vendor/open-telemetry/exporter-otlp/_register.php create mode 100644 vendor/open-telemetry/exporter-otlp/composer.json create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/.gitignore create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/GPBMetadata/Opentelemetry/Proto/Collector/Logs/V1/LogsService.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/GPBMetadata/Opentelemetry/Proto/Collector/Metrics/V1/MetricsService.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/GPBMetadata/Opentelemetry/Proto/Collector/Trace/V1/TraceService.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/GPBMetadata/Opentelemetry/Proto/Common/V1/Common.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/GPBMetadata/Opentelemetry/Proto/Logs/V1/Logs.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/GPBMetadata/Opentelemetry/Proto/Metrics/Experimental/MetricsConfigService.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/GPBMetadata/Opentelemetry/Proto/Metrics/V1/Metrics.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/GPBMetadata/Opentelemetry/Proto/Resource/V1/Resource.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/GPBMetadata/Opentelemetry/Proto/Trace/V1/Trace.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/GPBMetadata/Opentelemetry/Proto/Trace/V1/TraceConfig.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Logs/V1/ExportLogsPartialSuccess.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Logs/V1/ExportLogsServiceRequest.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Logs/V1/ExportLogsServiceResponse.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Logs/V1/LogsServiceClient.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Metrics/V1/ExportMetricsPartialSuccess.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Metrics/V1/ExportMetricsServiceRequest.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Metrics/V1/ExportMetricsServiceResponse.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Metrics/V1/MetricsServiceClient.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Trace/V1/ExportTracePartialSuccess.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Trace/V1/ExportTraceServiceRequest.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Trace/V1/ExportTraceServiceResponse.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Trace/V1/TraceServiceClient.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/AnyValue.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/ArrayValue.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/InstrumentationLibrary.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/InstrumentationScope.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/KeyValue.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/KeyValueList.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/StringKeyValue.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/InstrumentationLibraryLogs.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/LogRecord.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/LogRecordFlags.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/LogsData.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/ResourceLogs.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/ScopeLogs.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/SeverityNumber.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigRequest.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule/Pattern.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse_Schedule.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse_Schedule_Pattern.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/AggregationTemporality.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/DataPointFlags.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Exemplar.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ExponentialHistogram.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint/Buckets.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint_Buckets.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Gauge.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Histogram.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/HistogramDataPoint.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/InstrumentationLibraryMetrics.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntDataPoint.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntExemplar.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntGauge.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntHistogram.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntHistogramDataPoint.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntSum.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Metric.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/MetricsData.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/NumberDataPoint.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ResourceMetrics.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ScopeMetrics.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Sum.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Summary.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint/ValueAtQuantile.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint_ValueAtQuantile.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Resource/V1/Resource.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ConstantSampler.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ConstantSampler/ConstantDecision.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ConstantSampler_ConstantDecision.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/InstrumentationLibrarySpans.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/RateLimitingSampler.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ResourceSpans.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ScopeSpans.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span/Event.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span/Link.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span/SpanKind.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span_Event.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span_Link.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span_SpanKind.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Status.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Status/DeprecatedStatusCode.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Status/StatusCode.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Status_DeprecatedStatusCode.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Status_StatusCode.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/TraceConfig.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/TraceIdRatioBased.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/TracesData.php create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/README.md create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/VERSION create mode 100644 vendor/open-telemetry/gen-otlp-protobuf/composer.json create mode 100644 vendor/open-telemetry/sdk/Common/Adapter/HttpDiscovery/DependencyResolver.php create mode 100644 vendor/open-telemetry/sdk/Common/Adapter/HttpDiscovery/HttpPlugClientResolver.php create mode 100644 vendor/open-telemetry/sdk/Common/Adapter/HttpDiscovery/MessageFactoryResolver.php create mode 100644 vendor/open-telemetry/sdk/Common/Adapter/HttpDiscovery/PsrClientResolver.php create mode 100644 vendor/open-telemetry/sdk/Common/Attribute/AttributeValidator.php create mode 100644 vendor/open-telemetry/sdk/Common/Attribute/AttributeValidatorInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Attribute/Attributes.php create mode 100644 vendor/open-telemetry/sdk/Common/Attribute/AttributesBuilder.php create mode 100644 vendor/open-telemetry/sdk/Common/Attribute/AttributesBuilderInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Attribute/AttributesFactory.php create mode 100644 vendor/open-telemetry/sdk/Common/Attribute/AttributesFactoryInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Attribute/AttributesInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Attribute/FilteredAttributesBuilder.php create mode 100644 vendor/open-telemetry/sdk/Common/Attribute/FilteredAttributesFactory.php create mode 100644 vendor/open-telemetry/sdk/Common/Attribute/LogRecordAttributeValidator.php create mode 100644 vendor/open-telemetry/sdk/Common/Configuration/Configuration.php create mode 100644 vendor/open-telemetry/sdk/Common/Configuration/Defaults.php create mode 100644 vendor/open-telemetry/sdk/Common/Configuration/KnownValues.php create mode 100644 vendor/open-telemetry/sdk/Common/Configuration/Parser/BooleanParser.php create mode 100644 vendor/open-telemetry/sdk/Common/Configuration/Parser/ListParser.php create mode 100644 vendor/open-telemetry/sdk/Common/Configuration/Parser/MapParser.php create mode 100644 vendor/open-telemetry/sdk/Common/Configuration/Parser/RatioParser.php create mode 100644 vendor/open-telemetry/sdk/Common/Configuration/Resolver/CompositeResolver.php create mode 100644 vendor/open-telemetry/sdk/Common/Configuration/Resolver/EnvironmentResolver.php create mode 100644 vendor/open-telemetry/sdk/Common/Configuration/Resolver/PhpIniAccessor.php create mode 100644 vendor/open-telemetry/sdk/Common/Configuration/Resolver/PhpIniResolver.php create mode 100644 vendor/open-telemetry/sdk/Common/Configuration/Resolver/ResolverInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Configuration/ValueTypes.php create mode 100644 vendor/open-telemetry/sdk/Common/Configuration/VariableTypes.php create mode 100644 vendor/open-telemetry/sdk/Common/Configuration/Variables.php create mode 100644 vendor/open-telemetry/sdk/Common/Dev/Compatibility/README.md create mode 100644 vendor/open-telemetry/sdk/Common/Dev/Compatibility/Util.php create mode 100644 vendor/open-telemetry/sdk/Common/Dev/Compatibility/_load.php create mode 100644 vendor/open-telemetry/sdk/Common/Exception/StackTraceFormatter.php create mode 100644 vendor/open-telemetry/sdk/Common/Export/Http/PsrTransport.php create mode 100644 vendor/open-telemetry/sdk/Common/Export/Http/PsrTransportFactory.php create mode 100644 vendor/open-telemetry/sdk/Common/Export/Http/PsrUtils.php create mode 100644 vendor/open-telemetry/sdk/Common/Export/Stream/StreamTransport.php create mode 100644 vendor/open-telemetry/sdk/Common/Export/Stream/StreamTransportFactory.php create mode 100644 vendor/open-telemetry/sdk/Common/Export/TransportFactoryInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Export/TransportInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Future/CancellationInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Future/CompletedFuture.php create mode 100644 vendor/open-telemetry/sdk/Common/Future/ErrorFuture.php create mode 100644 vendor/open-telemetry/sdk/Common/Future/FutureInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Future/NullCancellation.php create mode 100644 vendor/open-telemetry/sdk/Common/Http/DependencyResolverInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Http/HttpPlug/Client/ResolverInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Http/Psr/Client/ResolverInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Http/Psr/Message/FactoryResolverInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Http/Psr/Message/MessageFactory.php create mode 100644 vendor/open-telemetry/sdk/Common/Http/Psr/Message/MessageFactoryInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Instrumentation/InstrumentationScope.php create mode 100644 vendor/open-telemetry/sdk/Common/Instrumentation/InstrumentationScopeFactory.php create mode 100644 vendor/open-telemetry/sdk/Common/Instrumentation/InstrumentationScopeFactoryInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Instrumentation/InstrumentationScopeInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Time/ClockFactory.php create mode 100644 vendor/open-telemetry/sdk/Common/Time/ClockFactoryInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Time/ClockInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Time/StopWatch.php create mode 100644 vendor/open-telemetry/sdk/Common/Time/StopWatchFactory.php create mode 100644 vendor/open-telemetry/sdk/Common/Time/StopWatchFactoryInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Time/StopWatchInterface.php create mode 100644 vendor/open-telemetry/sdk/Common/Time/SystemClock.php create mode 100644 vendor/open-telemetry/sdk/Common/Time/Util.php create mode 100644 vendor/open-telemetry/sdk/Common/Util/ClassConstantAccessor.php create mode 100644 vendor/open-telemetry/sdk/Common/Util/ShutdownHandler.php create mode 100644 vendor/open-telemetry/sdk/Common/Util/WeakMap.php create mode 100644 vendor/open-telemetry/sdk/Common/Util/functions.php create mode 100644 vendor/open-telemetry/sdk/Logs/Exporter/ConsoleExporter.php create mode 100644 vendor/open-telemetry/sdk/Logs/Exporter/ConsoleExporterFactory.php create mode 100644 vendor/open-telemetry/sdk/Logs/Exporter/InMemoryExporter.php create mode 100644 vendor/open-telemetry/sdk/Logs/Exporter/InMemoryExporterFactory.php create mode 100644 vendor/open-telemetry/sdk/Logs/Exporter/NoopExporter.php create mode 100644 vendor/open-telemetry/sdk/Logs/Exporter/_register.php create mode 100644 vendor/open-telemetry/sdk/Logs/ExporterFactory.php create mode 100644 vendor/open-telemetry/sdk/Logs/LogRecordExporterFactoryInterface.php create mode 100644 vendor/open-telemetry/sdk/Logs/LogRecordExporterInterface.php create mode 100644 vendor/open-telemetry/sdk/Logs/LogRecordLimits.php create mode 100644 vendor/open-telemetry/sdk/Logs/LogRecordLimitsBuilder.php create mode 100644 vendor/open-telemetry/sdk/Logs/LogRecordProcessorFactory.php create mode 100644 vendor/open-telemetry/sdk/Logs/LogRecordProcessorInterface.php create mode 100644 vendor/open-telemetry/sdk/Logs/Logger.php create mode 100644 vendor/open-telemetry/sdk/Logs/LoggerProvider.php create mode 100644 vendor/open-telemetry/sdk/Logs/LoggerProviderBuilder.php create mode 100644 vendor/open-telemetry/sdk/Logs/LoggerProviderFactory.php create mode 100644 vendor/open-telemetry/sdk/Logs/LoggerProviderInterface.php create mode 100644 vendor/open-telemetry/sdk/Logs/LoggerSharedState.php create mode 100644 vendor/open-telemetry/sdk/Logs/NoopLoggerProvider.php create mode 100644 vendor/open-telemetry/sdk/Logs/Processor/BatchLogRecordProcessor.php create mode 100644 vendor/open-telemetry/sdk/Logs/Processor/MultiLogRecordProcessor.php create mode 100644 vendor/open-telemetry/sdk/Logs/Processor/NoopLogRecordProcessor.php create mode 100644 vendor/open-telemetry/sdk/Logs/Processor/SimpleLogRecordProcessor.php create mode 100644 vendor/open-telemetry/sdk/Logs/PsrSeverityMapperInterface.php create mode 100644 vendor/open-telemetry/sdk/Logs/ReadWriteLogRecord.php create mode 100644 vendor/open-telemetry/sdk/Logs/ReadableLogRecord.php create mode 100644 vendor/open-telemetry/sdk/Logs/SimplePsrFileLogger.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Aggregation/ExplicitBucketHistogramAggregation.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Aggregation/ExplicitBucketHistogramSummary.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Aggregation/LastValueAggregation.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Aggregation/LastValueSummary.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Aggregation/SumAggregation.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Aggregation/SumSummary.php create mode 100644 vendor/open-telemetry/sdk/Metrics/AggregationInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/AggregationTemporalitySelectorInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/AttributeProcessor/FilteredAttributeProcessor.php create mode 100644 vendor/open-telemetry/sdk/Metrics/AttributeProcessor/IdentityAttributeProcessor.php create mode 100644 vendor/open-telemetry/sdk/Metrics/AttributeProcessorInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Counter.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Data/DataInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Data/Exemplar.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Data/Gauge.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Data/Histogram.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Data/HistogramDataPoint.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Data/Metric.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Data/NumberDataPoint.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Data/Sum.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Data/Temporality.php create mode 100644 vendor/open-telemetry/sdk/Metrics/DefaultAggregationProviderInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/DefaultAggregationProviderTrait.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/BucketEntry.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/BucketStorage.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilter/AllExemplarFilter.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilter/NoneExemplarFilter.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilter/WithSampledTraceExemplarFilter.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilterInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarReservoirInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/FilteredReservoir.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/FixedSizeReservoir.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/HistogramBucketReservoir.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Exemplar/NoopReservoir.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Histogram.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Instrument.php create mode 100644 vendor/open-telemetry/sdk/Metrics/InstrumentType.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Meter.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MeterInstruments.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MeterProvider.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MeterProviderBuilder.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MeterProviderFactory.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MeterProviderInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricExporter/ConsoleMetricExporter.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricExporter/ConsoleMetricExporterFactory.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricExporter/InMemoryExporter.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricExporter/InMemoryExporterFactory.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricExporter/NoopMetricExporter.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricExporter/NoopMetricExporterFactory.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricExporter/_register.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricExporterFactoryInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricExporterInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamFactory.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamMetricSource.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamMetricSourceProvider.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricFactoryInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricMetadataInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricReader/ExportingReader.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricReaderInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricRegistration/MultiRegistryRegistration.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricRegistration/RegistryRegistration.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricRegistrationInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricRegistry/MetricCollectorInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricRegistry/MetricRegistry.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricRegistry/MetricRegistryInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricRegistry/MetricWriterInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricRegistry/MultiObserver.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricRegistry/NoopObserver.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricSourceInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricSourceProviderInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/MetricSourceRegistryInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/NoopMeterProvider.php create mode 100644 vendor/open-telemetry/sdk/Metrics/ObservableCallback.php create mode 100644 vendor/open-telemetry/sdk/Metrics/ObservableCallbackDestructor.php create mode 100644 vendor/open-telemetry/sdk/Metrics/ObservableCounter.php create mode 100644 vendor/open-telemetry/sdk/Metrics/ObservableGauge.php create mode 100644 vendor/open-telemetry/sdk/Metrics/ObservableInstrumentTrait.php create mode 100644 vendor/open-telemetry/sdk/Metrics/ObservableUpDownCounter.php create mode 100644 vendor/open-telemetry/sdk/Metrics/PushMetricExporterInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/ReferenceCounterInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/StalenessHandler/DelayedStalenessHandler.php create mode 100644 vendor/open-telemetry/sdk/Metrics/StalenessHandler/DelayedStalenessHandlerFactory.php create mode 100644 vendor/open-telemetry/sdk/Metrics/StalenessHandler/ImmediateStalenessHandler.php create mode 100644 vendor/open-telemetry/sdk/Metrics/StalenessHandler/ImmediateStalenessHandlerFactory.php create mode 100644 vendor/open-telemetry/sdk/Metrics/StalenessHandler/NoopStalenessHandler.php create mode 100644 vendor/open-telemetry/sdk/Metrics/StalenessHandler/NoopStalenessHandlerFactory.php create mode 100644 vendor/open-telemetry/sdk/Metrics/StalenessHandlerFactoryInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/StalenessHandlerInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/AsynchronousMetricStream.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/Delta.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/DeltaStorage.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/Metric.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregator.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactory.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactoryInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/MetricCollectorInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/MetricStreamInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/SynchronousMetricStream.php create mode 100644 vendor/open-telemetry/sdk/Metrics/Stream/WritableMetricStreamInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/UpDownCounter.php create mode 100644 vendor/open-telemetry/sdk/Metrics/View/CriteriaViewRegistry.php create mode 100644 vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/AllCriteria.php create mode 100644 vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentNameCriteria.php create mode 100644 vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentTypeCriteria.php create mode 100644 vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeNameCriteria.php create mode 100644 vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeSchemaUrlCriteria.php create mode 100644 vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeVersionCriteria.php create mode 100644 vendor/open-telemetry/sdk/Metrics/View/SelectionCriteriaInterface.php create mode 100644 vendor/open-telemetry/sdk/Metrics/View/ViewTemplate.php create mode 100644 vendor/open-telemetry/sdk/Metrics/ViewProjection.php create mode 100644 vendor/open-telemetry/sdk/Metrics/ViewRegistryInterface.php create mode 100644 vendor/open-telemetry/sdk/Propagation/PropagatorFactory.php create mode 100644 vendor/open-telemetry/sdk/Propagation/_register.php create mode 100644 vendor/open-telemetry/sdk/README.md create mode 100644 vendor/open-telemetry/sdk/Registry.php create mode 100644 vendor/open-telemetry/sdk/Resource/Detectors/Composer.php create mode 100644 vendor/open-telemetry/sdk/Resource/Detectors/Composite.php create mode 100644 vendor/open-telemetry/sdk/Resource/Detectors/Constant.php create mode 100644 vendor/open-telemetry/sdk/Resource/Detectors/Environment.php create mode 100644 vendor/open-telemetry/sdk/Resource/Detectors/Host.php create mode 100644 vendor/open-telemetry/sdk/Resource/Detectors/OperatingSystem.php create mode 100644 vendor/open-telemetry/sdk/Resource/Detectors/Process.php create mode 100644 vendor/open-telemetry/sdk/Resource/Detectors/ProcessRuntime.php create mode 100644 vendor/open-telemetry/sdk/Resource/Detectors/Sdk.php create mode 100644 vendor/open-telemetry/sdk/Resource/Detectors/SdkProvided.php create mode 100644 vendor/open-telemetry/sdk/Resource/ResourceDetectorInterface.php create mode 100644 vendor/open-telemetry/sdk/Resource/ResourceInfo.php create mode 100644 vendor/open-telemetry/sdk/Resource/ResourceInfoFactory.php create mode 100644 vendor/open-telemetry/sdk/Sdk.php create mode 100644 vendor/open-telemetry/sdk/SdkAutoloader.php create mode 100644 vendor/open-telemetry/sdk/SdkBuilder.php create mode 100644 vendor/open-telemetry/sdk/Trace/Behavior/LoggerAwareTrait.php create mode 100644 vendor/open-telemetry/sdk/Trace/Behavior/SpanExporterDecoratorTrait.php create mode 100644 vendor/open-telemetry/sdk/Trace/Behavior/SpanExporterTrait.php create mode 100644 vendor/open-telemetry/sdk/Trace/Behavior/UsesSpanConverterTrait.php create mode 100644 vendor/open-telemetry/sdk/Trace/Event.php create mode 100644 vendor/open-telemetry/sdk/Trace/EventInterface.php create mode 100644 vendor/open-telemetry/sdk/Trace/ExporterFactory.php create mode 100644 vendor/open-telemetry/sdk/Trace/IdGeneratorInterface.php create mode 100644 vendor/open-telemetry/sdk/Trace/ImmutableSpan.php create mode 100644 vendor/open-telemetry/sdk/Trace/Link.php create mode 100644 vendor/open-telemetry/sdk/Trace/LinkInterface.php create mode 100644 vendor/open-telemetry/sdk/Trace/NoopTracerProvider.php create mode 100644 vendor/open-telemetry/sdk/Trace/RandomIdGenerator.php create mode 100644 vendor/open-telemetry/sdk/Trace/ReadWriteSpanInterface.php create mode 100644 vendor/open-telemetry/sdk/Trace/ReadableSpanInterface.php create mode 100644 vendor/open-telemetry/sdk/Trace/Sampler/AlwaysOffSampler.php create mode 100644 vendor/open-telemetry/sdk/Trace/Sampler/AlwaysOnSampler.php create mode 100644 vendor/open-telemetry/sdk/Trace/Sampler/ParentBased.php create mode 100644 vendor/open-telemetry/sdk/Trace/Sampler/TraceIdRatioBasedSampler.php create mode 100644 vendor/open-telemetry/sdk/Trace/SamplerFactory.php create mode 100644 vendor/open-telemetry/sdk/Trace/SamplerInterface.php create mode 100644 vendor/open-telemetry/sdk/Trace/SamplingResult.php create mode 100644 vendor/open-telemetry/sdk/Trace/Span.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanBuilder.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanConverterInterface.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanDataInterface.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanExporter/AbstractDecorator.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanExporter/ConsoleSpanExporter.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanExporter/ConsoleSpanExporterFactory.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanExporter/FriendlySpanConverter.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanExporter/InMemoryExporter.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanExporter/InMemorySpanExporterFactory.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanExporter/LoggerDecorator.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanExporter/LoggerExporter.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanExporter/NullSpanConverter.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanExporter/SpanExporterFactoryInterface.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanExporter/_register.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanExporterInterface.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanLimits.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanLimitsBuilder.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanProcessor/BatchSpanProcessor.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanProcessor/BatchSpanProcessorBuilder.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanProcessor/MultiSpanProcessor.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanProcessor/NoopSpanProcessor.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanProcessor/SimpleSpanProcessor.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanProcessorFactory.php create mode 100644 vendor/open-telemetry/sdk/Trace/SpanProcessorInterface.php create mode 100644 vendor/open-telemetry/sdk/Trace/StatusData.php create mode 100644 vendor/open-telemetry/sdk/Trace/StatusDataInterface.php create mode 100644 vendor/open-telemetry/sdk/Trace/Tracer.php create mode 100644 vendor/open-telemetry/sdk/Trace/TracerProvider.php create mode 100644 vendor/open-telemetry/sdk/Trace/TracerProviderBuilder.php create mode 100644 vendor/open-telemetry/sdk/Trace/TracerProviderFactory.php create mode 100644 vendor/open-telemetry/sdk/Trace/TracerProviderInterface.php create mode 100644 vendor/open-telemetry/sdk/Trace/TracerSharedState.php create mode 100644 vendor/open-telemetry/sdk/_autoload.php create mode 100644 vendor/open-telemetry/sdk/composer.json create mode 100644 vendor/open-telemetry/sem-conv/README.md create mode 100644 vendor/open-telemetry/sem-conv/ResourceAttributes.php create mode 100644 vendor/open-telemetry/sem-conv/TraceAttributes.php create mode 100644 vendor/open-telemetry/sem-conv/composer.json delete mode 100644 vendor/opentracing/opentracing/.github/ISSUE_TEMPLATE.md delete mode 100644 vendor/opentracing/opentracing/.github/PULL_REQUEST_TEMPLATE.md delete mode 100644 vendor/opentracing/opentracing/.github/workflows/ci.yml delete mode 100644 vendor/opentracing/opentracing/.gitignore delete mode 100644 vendor/opentracing/opentracing/CONTRIBUTING.md delete mode 100644 vendor/opentracing/opentracing/LICENSE delete mode 100644 vendor/opentracing/opentracing/README.md delete mode 100644 vendor/opentracing/opentracing/composer.json delete mode 100644 vendor/opentracing/opentracing/phpstan.neon delete mode 100644 vendor/opentracing/opentracing/phpunit.xml delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/Formats.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/GlobalTracer.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/InvalidReferenceArgumentException.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/InvalidReferencesSetException.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/InvalidSpanOptionException.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/Mock/MockScope.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/Mock/MockScopeManager.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/Mock/MockSpan.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/Mock/MockSpanContext.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/Mock/MockTracer.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/NoopScope.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/NoopScopeManager.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/NoopSpan.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/NoopSpanContext.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/NoopTracer.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/Reference.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/Scope.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/ScopeManager.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/Span.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/SpanContext.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/StartSpanOptions.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/Tags.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/Tracer.php delete mode 100644 vendor/opentracing/opentracing/src/OpenTracing/UnsupportedFormatException.php delete mode 100644 vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockScopeManagerTest.php delete mode 100644 vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockSpanContextTest.php delete mode 100644 vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockSpanTest.php delete mode 100644 vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockTracerTest.php delete mode 100644 vendor/opentracing/opentracing/tests/OpenTracing/ReferenceTest.php delete mode 100644 vendor/opentracing/opentracing/tests/OpenTracing/StartSpanOptionsTest.php delete mode 100644 vendor/packaged/thrift/.gitignore delete mode 100644 vendor/packaged/thrift/README.md delete mode 100644 vendor/packaged/thrift/composer.json delete mode 100644 vendor/packaged/thrift/src/Base/TBase.php delete mode 100644 vendor/packaged/thrift/src/ClassLoader/ThriftClassLoader.php delete mode 100644 vendor/packaged/thrift/src/Exception/TApplicationException.php delete mode 100644 vendor/packaged/thrift/src/Exception/TException.php delete mode 100644 vendor/packaged/thrift/src/Exception/TProtocolException.php delete mode 100644 vendor/packaged/thrift/src/Exception/TTransportException.php delete mode 100644 vendor/packaged/thrift/src/Factory/TBinaryProtocolFactory.php delete mode 100644 vendor/packaged/thrift/src/Factory/TCompactProtocolFactory.php delete mode 100644 vendor/packaged/thrift/src/Factory/TJSONProtocolFactory.php delete mode 100644 vendor/packaged/thrift/src/Factory/TProtocolFactory.php delete mode 100644 vendor/packaged/thrift/src/Factory/TStringFuncFactory.php delete mode 100644 vendor/packaged/thrift/src/Factory/TTransportFactory.php delete mode 100644 vendor/packaged/thrift/src/Protocol/JSON/BaseContext.php delete mode 100644 vendor/packaged/thrift/src/Protocol/JSON/ListContext.php delete mode 100644 vendor/packaged/thrift/src/Protocol/JSON/LookaheadReader.php delete mode 100644 vendor/packaged/thrift/src/Protocol/JSON/PairContext.php delete mode 100644 vendor/packaged/thrift/src/Protocol/SimpleJSON/CollectionMapKeyException.php delete mode 100644 vendor/packaged/thrift/src/Protocol/SimpleJSON/Context.php delete mode 100644 vendor/packaged/thrift/src/Protocol/SimpleJSON/ListContext.php delete mode 100644 vendor/packaged/thrift/src/Protocol/SimpleJSON/MapContext.php delete mode 100644 vendor/packaged/thrift/src/Protocol/SimpleJSON/StructContext.php delete mode 100644 vendor/packaged/thrift/src/Protocol/TBinaryProtocol.php delete mode 100644 vendor/packaged/thrift/src/Protocol/TBinaryProtocolAccelerated.php delete mode 100644 vendor/packaged/thrift/src/Protocol/TCompactProtocol.php delete mode 100644 vendor/packaged/thrift/src/Protocol/TJSONProtocol.php delete mode 100644 vendor/packaged/thrift/src/Protocol/TMultiplexedProtocol.php delete mode 100644 vendor/packaged/thrift/src/Protocol/TProtocol.php delete mode 100644 vendor/packaged/thrift/src/Protocol/TProtocolDecorator.php delete mode 100644 vendor/packaged/thrift/src/Protocol/TSimpleJSONProtocol.php delete mode 100644 vendor/packaged/thrift/src/Serializer/TBinarySerializer.php delete mode 100644 vendor/packaged/thrift/src/Server/TForkingServer.php delete mode 100644 vendor/packaged/thrift/src/Server/TSSLServerSocket.php delete mode 100644 vendor/packaged/thrift/src/Server/TServer.php delete mode 100644 vendor/packaged/thrift/src/Server/TServerSocket.php delete mode 100644 vendor/packaged/thrift/src/Server/TServerTransport.php delete mode 100644 vendor/packaged/thrift/src/Server/TSimpleServer.php delete mode 100644 vendor/packaged/thrift/src/StoredMessageProtocol.php delete mode 100644 vendor/packaged/thrift/src/StringFunc/Core.php delete mode 100644 vendor/packaged/thrift/src/StringFunc/Mbstring.php delete mode 100644 vendor/packaged/thrift/src/StringFunc/TStringFunc.php delete mode 100644 vendor/packaged/thrift/src/TMultiplexedProcessor.php delete mode 100644 vendor/packaged/thrift/src/Transport/TBufferedTransport.php delete mode 100644 vendor/packaged/thrift/src/Transport/TCurlClient.php delete mode 100644 vendor/packaged/thrift/src/Transport/TFramedTransport.php delete mode 100644 vendor/packaged/thrift/src/Transport/THttpClient.php delete mode 100644 vendor/packaged/thrift/src/Transport/TMemoryBuffer.php delete mode 100644 vendor/packaged/thrift/src/Transport/TNullTransport.php delete mode 100644 vendor/packaged/thrift/src/Transport/TPhpStream.php delete mode 100644 vendor/packaged/thrift/src/Transport/TSSLSocket.php delete mode 100644 vendor/packaged/thrift/src/Transport/TSocket.php delete mode 100644 vendor/packaged/thrift/src/Transport/TSocketPool.php delete mode 100644 vendor/packaged/thrift/src/Transport/TTransport.php delete mode 100644 vendor/packaged/thrift/src/Type/TConstant.php delete mode 100644 vendor/packaged/thrift/src/Type/TMessageType.php delete mode 100644 vendor/packaged/thrift/src/Type/TType.php delete mode 100644 vendor/packaged/thrift/update.sh create mode 100644 vendor/php-http/discovery/.php-cs-fixer.php create mode 100644 vendor/php-http/discovery/CHANGELOG.md create mode 100644 vendor/php-http/discovery/LICENSE create mode 100644 vendor/php-http/discovery/README.md create mode 100644 vendor/php-http/discovery/composer.json create mode 100644 vendor/php-http/discovery/src/ClassDiscovery.php create mode 100644 vendor/php-http/discovery/src/Composer/Plugin.php create mode 100644 vendor/php-http/discovery/src/Exception.php create mode 100644 vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php create mode 100644 vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php create mode 100644 vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php create mode 100644 vendor/php-http/discovery/src/Exception/NotFoundException.php create mode 100644 vendor/php-http/discovery/src/Exception/PuliUnavailableException.php create mode 100644 vendor/php-http/discovery/src/Exception/StrategyUnavailableException.php create mode 100644 vendor/php-http/discovery/src/HttpAsyncClientDiscovery.php create mode 100644 vendor/php-http/discovery/src/HttpClientDiscovery.php create mode 100644 vendor/php-http/discovery/src/MessageFactoryDiscovery.php create mode 100644 vendor/php-http/discovery/src/NotFoundException.php create mode 100644 vendor/php-http/discovery/src/Psr17Factory.php create mode 100644 vendor/php-http/discovery/src/Psr17FactoryDiscovery.php create mode 100644 vendor/php-http/discovery/src/Psr18Client.php create mode 100644 vendor/php-http/discovery/src/Psr18ClientDiscovery.php create mode 100644 vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php create mode 100644 vendor/php-http/discovery/src/Strategy/CommonPsr17ClassesStrategy.php create mode 100644 vendor/php-http/discovery/src/Strategy/DiscoveryStrategy.php create mode 100644 vendor/php-http/discovery/src/Strategy/MockClientStrategy.php create mode 100644 vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php create mode 100644 vendor/php-http/discovery/src/StreamFactoryDiscovery.php create mode 100644 vendor/php-http/discovery/src/UriFactoryDiscovery.php create mode 100644 vendor/php-http/guzzle7-adapter/CHANGELOG.md create mode 100644 vendor/php-http/guzzle7-adapter/LICENSE create mode 100644 vendor/php-http/guzzle7-adapter/README.md create mode 100644 vendor/php-http/guzzle7-adapter/composer.json create mode 100644 vendor/php-http/guzzle7-adapter/phpstan.neon.dist create mode 100644 vendor/php-http/guzzle7-adapter/psalm.baseline.xml create mode 100644 vendor/php-http/guzzle7-adapter/psalm.xml create mode 100644 vendor/php-http/guzzle7-adapter/src/Client.php create mode 100644 vendor/php-http/guzzle7-adapter/src/Exception/UnexpectedValueException.php create mode 100644 vendor/php-http/guzzle7-adapter/src/Promise.php create mode 100644 vendor/php-http/httplug/.php-cs-fixer.dist.php create mode 100644 vendor/php-http/httplug/CHANGELOG.md create mode 100644 vendor/php-http/httplug/LICENSE create mode 100644 vendor/php-http/httplug/README.md create mode 100644 vendor/php-http/httplug/composer.json create mode 100644 vendor/php-http/httplug/puli.json create mode 100644 vendor/php-http/httplug/src/Exception.php create mode 100644 vendor/php-http/httplug/src/Exception/HttpException.php create mode 100644 vendor/php-http/httplug/src/Exception/NetworkException.php create mode 100644 vendor/php-http/httplug/src/Exception/RequestAwareTrait.php create mode 100644 vendor/php-http/httplug/src/Exception/RequestException.php create mode 100644 vendor/php-http/httplug/src/Exception/TransferException.php create mode 100644 vendor/php-http/httplug/src/HttpAsyncClient.php create mode 100644 vendor/php-http/httplug/src/HttpClient.php create mode 100644 vendor/php-http/httplug/src/Promise/HttpFulfilledPromise.php create mode 100644 vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php create mode 100644 vendor/php-http/promise/CHANGELOG.md create mode 100644 vendor/php-http/promise/LICENSE create mode 100644 vendor/php-http/promise/README.md create mode 100644 vendor/php-http/promise/composer.json create mode 100644 vendor/php-http/promise/src/FulfilledPromise.php create mode 100644 vendor/php-http/promise/src/Promise.php create mode 100644 vendor/php-http/promise/src/RejectedPromise.php delete mode 100644 vendor/psr/cache/CHANGELOG.md delete mode 100644 vendor/psr/cache/LICENSE.txt delete mode 100644 vendor/psr/cache/README.md delete mode 100644 vendor/psr/cache/composer.json delete mode 100644 vendor/psr/cache/src/CacheException.php delete mode 100644 vendor/psr/cache/src/CacheItemInterface.php delete mode 100644 vendor/psr/cache/src/CacheItemPoolInterface.php delete mode 100644 vendor/psr/cache/src/InvalidArgumentException.php create mode 100644 vendor/psr/http-client/CHANGELOG.md create mode 100644 vendor/psr/http-client/LICENSE create mode 100644 vendor/psr/http-client/README.md create mode 100644 vendor/psr/http-client/composer.json create mode 100644 vendor/psr/http-client/src/ClientExceptionInterface.php create mode 100644 vendor/psr/http-client/src/ClientInterface.php create mode 100644 vendor/psr/http-client/src/NetworkExceptionInterface.php create mode 100644 vendor/psr/http-client/src/RequestExceptionInterface.php create mode 100644 vendor/psr/http-factory/LICENSE create mode 100644 vendor/psr/http-factory/README.md create mode 100644 vendor/psr/http-factory/composer.json create mode 100644 vendor/psr/http-factory/src/RequestFactoryInterface.php create mode 100644 vendor/psr/http-factory/src/ResponseFactoryInterface.php create mode 100644 vendor/psr/http-factory/src/ServerRequestFactoryInterface.php create mode 100644 vendor/psr/http-factory/src/StreamFactoryInterface.php create mode 100644 vendor/psr/http-factory/src/UploadedFileFactoryInterface.php create mode 100644 vendor/psr/http-factory/src/UriFactoryInterface.php create mode 100644 vendor/psr/http-message/CHANGELOG.md create mode 100644 vendor/psr/http-message/LICENSE create mode 100644 vendor/psr/http-message/README.md create mode 100644 vendor/psr/http-message/composer.json create mode 100644 vendor/psr/http-message/docs/PSR7-Interfaces.md create mode 100644 vendor/psr/http-message/docs/PSR7-Usage.md create mode 100644 vendor/psr/http-message/src/MessageInterface.php create mode 100644 vendor/psr/http-message/src/RequestInterface.php create mode 100644 vendor/psr/http-message/src/ResponseInterface.php create mode 100644 vendor/psr/http-message/src/ServerRequestInterface.php create mode 100644 vendor/psr/http-message/src/StreamInterface.php create mode 100644 vendor/psr/http-message/src/UploadedFileInterface.php create mode 100644 vendor/psr/http-message/src/UriInterface.php create mode 100644 vendor/ralouphie/getallheaders/LICENSE create mode 100644 vendor/ralouphie/getallheaders/README.md create mode 100644 vendor/ralouphie/getallheaders/composer.json create mode 100644 vendor/ralouphie/getallheaders/src/getallheaders.php create mode 100644 vendor/symfony/deprecation-contracts/.gitignore create mode 100644 vendor/symfony/deprecation-contracts/CHANGELOG.md create mode 100644 vendor/symfony/deprecation-contracts/LICENSE create mode 100644 vendor/symfony/deprecation-contracts/README.md create mode 100644 vendor/symfony/deprecation-contracts/composer.json create mode 100644 vendor/symfony/deprecation-contracts/function.php create mode 100644 vendor/symfony/polyfill-mbstring/LICENSE create mode 100644 vendor/symfony/polyfill-mbstring/Mbstring.php create mode 100644 vendor/symfony/polyfill-mbstring/README.md create mode 100644 vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php create mode 100644 vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php create mode 100644 vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php create mode 100644 vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php create mode 100644 vendor/symfony/polyfill-mbstring/bootstrap.php create mode 100644 vendor/symfony/polyfill-mbstring/bootstrap80.php create mode 100644 vendor/symfony/polyfill-mbstring/composer.json create mode 100644 vendor/symfony/polyfill-php80/LICENSE create mode 100644 vendor/symfony/polyfill-php80/Php80.php create mode 100644 vendor/symfony/polyfill-php80/PhpToken.php create mode 100644 vendor/symfony/polyfill-php80/README.md create mode 100644 vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php create mode 100644 vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php create mode 100644 vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php create mode 100644 vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php create mode 100644 vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php create mode 100644 vendor/symfony/polyfill-php80/bootstrap.php create mode 100644 vendor/symfony/polyfill-php80/composer.json create mode 100644 vendor/symfony/polyfill-php81/LICENSE create mode 100644 vendor/symfony/polyfill-php81/Php81.php create mode 100644 vendor/symfony/polyfill-php81/README.md create mode 100644 vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php create mode 100644 vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php create mode 100644 vendor/symfony/polyfill-php81/bootstrap.php create mode 100644 vendor/symfony/polyfill-php81/composer.json create mode 100644 vendor/symfony/polyfill-php82/LICENSE create mode 100644 vendor/symfony/polyfill-php82/NoDynamicProperties.php create mode 100644 vendor/symfony/polyfill-php82/Php82.php create mode 100644 vendor/symfony/polyfill-php82/README.md create mode 100644 vendor/symfony/polyfill-php82/Random/Engine/Secure.php create mode 100644 vendor/symfony/polyfill-php82/Resources/stubs/AllowDynamicProperties.php create mode 100644 vendor/symfony/polyfill-php82/Resources/stubs/Random/BrokenRandomEngineError.php create mode 100644 vendor/symfony/polyfill-php82/Resources/stubs/Random/CryptoSafeEngine.php create mode 100644 vendor/symfony/polyfill-php82/Resources/stubs/Random/Engine.php create mode 100644 vendor/symfony/polyfill-php82/Resources/stubs/Random/Engine/Secure.php create mode 100644 vendor/symfony/polyfill-php82/Resources/stubs/Random/RandomError.php create mode 100644 vendor/symfony/polyfill-php82/Resources/stubs/Random/RandomException.php create mode 100644 vendor/symfony/polyfill-php82/Resources/stubs/SensitiveParameter.php create mode 100644 vendor/symfony/polyfill-php82/Resources/stubs/SensitiveParameterValue.php create mode 100644 vendor/symfony/polyfill-php82/SensitiveParameterValue.php create mode 100644 vendor/symfony/polyfill-php82/bootstrap.php create mode 100644 vendor/symfony/polyfill-php82/composer.json (limited to 'vendor') diff --git a/vendor/autoload.php b/vendor/autoload.php index e6e3ad736..8235051f8 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -2,6 +2,24 @@ // autoload.php @generated by Composer +if (PHP_VERSION_ID < 50600) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, $err); + } elseif (!headers_sent()) { + echo $err; + } + } + trigger_error( + $err, + E_USER_ERROR + ); +} + require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit19fc2ff1c0f9a92279c7979386bb2056::getLoader(); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 4d989a212..7824d8f7e 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -42,30 +42,76 @@ namespace Composer\Autoload; */ class ClassLoader { + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ private $vendorDir; // PSR-4 + /** + * @var array> + */ private $prefixLengthsPsr4 = array(); + /** + * @var array> + */ private $prefixDirsPsr4 = array(); + /** + * @var list + */ private $fallbackDirsPsr4 = array(); // PSR-0 + /** + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> + */ private $prefixesPsr0 = array(); + /** + * @var list + */ private $fallbackDirsPsr0 = array(); + /** @var bool */ private $useIncludePath = false; + + /** + * @var array + */ private $classMap = array(); + + /** @var bool */ private $classMapAuthoritative = false; + + /** + * @var array + */ private $missingClasses = array(); + + /** @var string|null */ private $apcuPrefix; + /** + * @var array + */ private static $registeredLoaders = array(); + /** + * @param string|null $vendorDir + */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); } + /** + * @return array> + */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -75,28 +121,42 @@ class ClassLoader return array(); } + /** + * @return array> + */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } + /** + * @return list + */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } + /** + * @return list + */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } + /** + * @return array Array of classname => path + */ public function getClassMap() { return $this->classMap; } /** - * @param array $classMap Class to filename map + * @param array $classMap Class to filename map + * + * @return void */ public function addClassMap(array $classMap) { @@ -111,22 +171,25 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void */ public function add($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, - (array) $paths + $paths ); } @@ -135,19 +198,19 @@ class ClassLoader $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; + $this->prefixesPsr0[$first][$prefix] = $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], - (array) $paths + $paths ); } } @@ -156,25 +219,28 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException + * + * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, - (array) $paths + $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { @@ -184,18 +250,18 @@ class ClassLoader throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; + $this->prefixDirsPsr4[$prefix] = $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], - (array) $paths + $paths ); } } @@ -204,8 +270,10 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories + * + * @return void */ public function set($prefix, $paths) { @@ -220,10 +288,12 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException + * + * @return void */ public function setPsr4($prefix, $paths) { @@ -243,6 +313,8 @@ class ClassLoader * Turns on searching the include path for class files. * * @param bool $useIncludePath + * + * @return void */ public function setUseIncludePath($useIncludePath) { @@ -265,6 +337,8 @@ class ClassLoader * that have not been registered with the class map. * * @param bool $classMapAuthoritative + * + * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -285,6 +359,8 @@ class ClassLoader * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix + * + * @return void */ public function setApcuPrefix($apcuPrefix) { @@ -305,14 +381,18 @@ class ClassLoader * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); if (null === $this->vendorDir) { - //no-op - } elseif ($prepend) { + return; + } + + if ($prepend) { self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; } else { unset(self::$registeredLoaders[$this->vendorDir]); @@ -322,6 +402,8 @@ class ClassLoader /** * Unregisters this instance as an autoloader. + * + * @return void */ public function unregister() { @@ -336,15 +418,18 @@ class ClassLoader * Loads the given class or interface. * * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise + * @return true|null True if loaded, null otherwise */ public function loadClass($class) { if ($file = $this->findFile($class)) { - includeFile($file); + $includeFile = self::$includeFile; + $includeFile($file); return true; } + + return null; } /** @@ -390,15 +475,20 @@ class ClassLoader } /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. + * Returns the currently registered loaders keyed by their corresponding vendor directories. * - * @return self[] + * @return array */ public static function getRegisteredLoaders() { return self::$registeredLoaders; } + /** + * @param string $class + * @param string $ext + * @return string|false + */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -464,14 +554,26 @@ class ClassLoader return false; } -} -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } } diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index cf83ee179..51e734a77 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -18,459 +18,29 @@ use Composer\Semver\VersionParser; /** * This class is copied in every Composer installed project and available to all * - * To require it's presence, you can require `composer-runtime-api ^2.0` + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final */ class InstalledVersions { - private static $installed = array ( - 'root' => - array ( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'aliases' => - array ( - ), - 'reference' => 'a37eab2610a0a2bcb655258781c1c7e925dc94c0', - 'name' => '__root__', - ), - 'versions' => - array ( - '__root__' => - array ( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'aliases' => - array ( - ), - 'reference' => 'a37eab2610a0a2bcb655258781c1c7e925dc94c0', - ), - 'beberlei/assert' => - array ( - 'pretty_version' => 'v3.3.2', - 'version' => '3.3.2.0', - 'aliases' => - array ( - ), - 'reference' => 'cb70015c04be1baee6f5f5c953703347c0ac1655', - ), - 'chillerlan/php-qrcode' => - array ( - 'pretty_version' => '4.3.4', - 'version' => '4.3.4.0', - 'aliases' => - array ( - ), - 'reference' => '2ca4bf5ae048af1981d1023ee42a0a2a9d51e51d', - ), - 'chillerlan/php-settings-container' => - array ( - 'pretty_version' => '2.1.4', - 'version' => '2.1.4.0', - 'aliases' => - array ( - ), - 'reference' => '1beb7df3c14346d4344b0b2e12f6f9a74feabd4a', - ), - 'doctrine/instantiator' => - array ( - 'pretty_version' => '1.4.1', - 'version' => '1.4.1.0', - 'aliases' => - array ( - ), - 'reference' => '10dcfce151b967d20fde1b34ae6640712c3891bc', - ), - 'j4mie/idiorm' => - array ( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'aliases' => - array ( - 0 => '9999999-dev', - ), - 'reference' => 'efc8ea06698f53e2c479c7696f2b154c47c3a3cb', - ), - 'jonahgeorge/jaeger-client-php' => - array ( - 'pretty_version' => 'v1.4.4', - 'version' => '1.4.4.0', - 'aliases' => - array ( - ), - 'reference' => '3173d9c68ad8cea16058f25337982b00cc3d1c2b', - ), - 'mervick/material-design-icons' => - array ( - 'pretty_version' => '2.2.0', - 'version' => '2.2.0.0', - 'aliases' => - array ( - ), - 'reference' => '635435c8d3df3a6da3241648caf8a65d1c07cc1a', - ), - 'myclabs/deep-copy' => - array ( - 'pretty_version' => '1.11.0', - 'version' => '1.11.0.0', - 'aliases' => - array ( - ), - 'reference' => '14daed4296fae74d9e3201d2c4925d1acb7aa614', - ), - 'nikic/php-parser' => - array ( - 'pretty_version' => 'v4.14.0', - 'version' => '4.14.0.0', - 'aliases' => - array ( - ), - 'reference' => '34bea19b6e03d8153165d8f30bba4c3be86184c1', - ), - 'opentracing/opentracing' => - array ( - 'pretty_version' => '1.0.2', - 'version' => '1.0.2.0', - 'aliases' => - array ( - ), - 'reference' => 'cd60bd1fb2a25280600bc74c7f9e0c13881a9116', - ), - 'packaged/thrift' => - array ( - 'pretty_version' => '0.13.01', - 'version' => '0.13.01.0', - 'aliases' => - array ( - ), - 'reference' => 'e3dbcfb79e319971d64264ffe9c340590cc8a228', - ), - 'paragonie/constant_time_encoding' => - array ( - 'pretty_version' => 'v2.6.3', - 'version' => '2.6.3.0', - 'aliases' => - array ( - ), - 'reference' => '58c3f47f650c94ec05a151692652a868995d2938', - ), - 'phar-io/manifest' => - array ( - 'pretty_version' => '2.0.3', - 'version' => '2.0.3.0', - 'aliases' => - array ( - ), - 'reference' => '97803eca37d319dfa7826cc2437fc020857acb53', - ), - 'phar-io/version' => - array ( - 'pretty_version' => '3.2.1', - 'version' => '3.2.1.0', - 'aliases' => - array ( - ), - 'reference' => '4f7fd7836c6f332bb2933569e566a0d6c4cbed74', - ), - 'phpdocumentor/reflection-common' => - array ( - 'pretty_version' => '2.2.0', - 'version' => '2.2.0.0', - 'aliases' => - array ( - ), - 'reference' => '1d01c49d4ed62f25aa84a747ad35d5a16924662b', - ), - 'phpdocumentor/reflection-docblock' => - array ( - 'pretty_version' => '5.3.0', - 'version' => '5.3.0.0', - 'aliases' => - array ( - ), - 'reference' => '622548b623e81ca6d78b721c5e029f4ce664f170', - ), - 'phpdocumentor/type-resolver' => - array ( - 'pretty_version' => '1.6.1', - 'version' => '1.6.1.0', - 'aliases' => - array ( - ), - 'reference' => '77a32518733312af16a44300404e945338981de3', - ), - 'phpspec/prophecy' => - array ( - 'pretty_version' => 'v1.15.0', - 'version' => '1.15.0.0', - 'aliases' => - array ( - ), - 'reference' => 'bbcd7380b0ebf3961ee21409db7b38bc31d69a13', - ), - 'phpstan/phpstan' => - array ( - 'pretty_version' => '1.10.3', - 'version' => '1.10.3.0', - 'aliases' => - array ( - ), - 'reference' => '5419375b5891add97dc74be71e6c1c34baaddf64', - ), - 'phpunit/php-code-coverage' => - array ( - 'pretty_version' => '9.2.15', - 'version' => '9.2.15.0', - 'aliases' => - array ( - ), - 'reference' => '2e9da11878c4202f97915c1cb4bb1ca318a63f5f', - ), - 'phpunit/php-file-iterator' => - array ( - 'pretty_version' => '3.0.6', - 'version' => '3.0.6.0', - 'aliases' => - array ( - ), - 'reference' => 'cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf', - ), - 'phpunit/php-invoker' => - array ( - 'pretty_version' => '3.1.1', - 'version' => '3.1.1.0', - 'aliases' => - array ( - ), - 'reference' => '5a10147d0aaf65b58940a0b72f71c9ac0423cc67', - ), - 'phpunit/php-text-template' => - array ( - 'pretty_version' => '2.0.4', - 'version' => '2.0.4.0', - 'aliases' => - array ( - ), - 'reference' => '5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28', - ), - 'phpunit/php-timer' => - array ( - 'pretty_version' => '5.0.3', - 'version' => '5.0.3.0', - 'aliases' => - array ( - ), - 'reference' => '5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2', - ), - 'phpunit/phpunit' => - array ( - 'pretty_version' => '9.5.16', - 'version' => '9.5.16.0', - 'aliases' => - array ( - ), - 'reference' => '5ff8c545a50226c569310a35f4fa89d79f1ddfdc', - ), - 'psr/cache' => - array ( - 'pretty_version' => '3.0.0', - 'version' => '3.0.0.0', - 'aliases' => - array ( - ), - 'reference' => 'aa5030cfa5405eccfdcb1083ce040c2cb8d253bf', - ), - 'psr/log' => - array ( - 'pretty_version' => '3.0.0', - 'version' => '3.0.0.0', - 'aliases' => - array ( - ), - 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', - ), - 'sebastian/cli-parser' => - array ( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'aliases' => - array ( - ), - 'reference' => '442e7c7e687e42adc03470c7b668bc4b2402c0b2', - ), - 'sebastian/code-unit' => - array ( - 'pretty_version' => '1.0.8', - 'version' => '1.0.8.0', - 'aliases' => - array ( - ), - 'reference' => '1fc9f64c0927627ef78ba436c9b17d967e68e120', - ), - 'sebastian/code-unit-reverse-lookup' => - array ( - 'pretty_version' => '2.0.3', - 'version' => '2.0.3.0', - 'aliases' => - array ( - ), - 'reference' => 'ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5', - ), - 'sebastian/comparator' => - array ( - 'pretty_version' => '4.0.6', - 'version' => '4.0.6.0', - 'aliases' => - array ( - ), - 'reference' => '55f4261989e546dc112258c7a75935a81a7ce382', - ), - 'sebastian/complexity' => - array ( - 'pretty_version' => '2.0.2', - 'version' => '2.0.2.0', - 'aliases' => - array ( - ), - 'reference' => '739b35e53379900cc9ac327b2147867b8b6efd88', - ), - 'sebastian/diff' => - array ( - 'pretty_version' => '4.0.4', - 'version' => '4.0.4.0', - 'aliases' => - array ( - ), - 'reference' => '3461e3fccc7cfdfc2720be910d3bd73c69be590d', - ), - 'sebastian/environment' => - array ( - 'pretty_version' => '5.1.4', - 'version' => '5.1.4.0', - 'aliases' => - array ( - ), - 'reference' => '1b5dff7bb151a4db11d49d90e5408e4e938270f7', - ), - 'sebastian/exporter' => - array ( - 'pretty_version' => '4.0.4', - 'version' => '4.0.4.0', - 'aliases' => - array ( - ), - 'reference' => '65e8b7db476c5dd267e65eea9cab77584d3cfff9', - ), - 'sebastian/global-state' => - array ( - 'pretty_version' => '5.0.5', - 'version' => '5.0.5.0', - 'aliases' => - array ( - ), - 'reference' => '0ca8db5a5fc9c8646244e629625ac486fa286bf2', - ), - 'sebastian/lines-of-code' => - array ( - 'pretty_version' => '1.0.3', - 'version' => '1.0.3.0', - 'aliases' => - array ( - ), - 'reference' => 'c1c2e997aa3146983ed888ad08b15470a2e22ecc', - ), - 'sebastian/object-enumerator' => - array ( - 'pretty_version' => '4.0.4', - 'version' => '4.0.4.0', - 'aliases' => - array ( - ), - 'reference' => '5c9eeac41b290a3712d88851518825ad78f45c71', - ), - 'sebastian/object-reflector' => - array ( - 'pretty_version' => '2.0.4', - 'version' => '2.0.4.0', - 'aliases' => - array ( - ), - 'reference' => 'b4f479ebdbf63ac605d183ece17d8d7fe49c15c7', - ), - 'sebastian/recursion-context' => - array ( - 'pretty_version' => '4.0.4', - 'version' => '4.0.4.0', - 'aliases' => - array ( - ), - 'reference' => 'cd9d8cf3c5804de4341c283ed787f099f5506172', - ), - 'sebastian/resource-operations' => - array ( - 'pretty_version' => '3.0.3', - 'version' => '3.0.3.0', - 'aliases' => - array ( - ), - 'reference' => '0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8', - ), - 'sebastian/type' => - array ( - 'pretty_version' => '2.3.4', - 'version' => '2.3.4.0', - 'aliases' => - array ( - ), - 'reference' => 'b8cd8a1c753c90bc1a0f5372170e3e489136f914', - ), - 'sebastian/version' => - array ( - 'pretty_version' => '3.0.2', - 'version' => '3.0.2.0', - 'aliases' => - array ( - ), - 'reference' => 'c6c1022351a901512170118436c764e473f6de8c', - ), - 'spomky-labs/otphp' => - array ( - 'pretty_version' => 'v10.0.3', - 'version' => '10.0.3.0', - 'aliases' => - array ( - ), - 'reference' => '9784d9f7c790eed26e102d6c78f12c754036c366', - ), - 'thecodingmachine/safe' => - array ( - 'pretty_version' => 'v2.2.2', - 'version' => '2.2.2.0', - 'aliases' => - array ( - ), - 'reference' => '440284f9592c9df402832452a6871a8b3c48d97e', - ), - 'theseer/tokenizer' => - array ( - 'pretty_version' => '1.2.1', - 'version' => '1.2.1.0', - 'aliases' => - array ( - ), - 'reference' => '34a41e998c2183e22995f158c581e7b5e755ab9e', - ), - 'webmozart/assert' => - array ( - 'pretty_version' => '1.11.0', - 'version' => '1.11.0.0', - 'aliases' => - array ( - ), - 'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991', - ), - ), -); + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ private static $installedByVendor = array(); /** @@ -486,7 +56,6 @@ class InstalledVersions $packages[] = array_keys($installed['versions']); } - if (1 === \count($packages)) { return $packages[0]; } @@ -494,19 +63,42 @@ class InstalledVersions return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); } + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + /** * Checks whether the given package is installed * * This also returns true if the package name is provided or replaced by another package * * @param string $packageName + * @param bool $includeDevRequirements * @return bool */ - public static function isInstalled($packageName) + public static function isInstalled($packageName, $includeDevRequirements = true) { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { - return true; + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } @@ -520,15 +112,14 @@ class InstalledVersions * * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') * - * @param VersionParser $parser Install composer/semver to have access to this class and functionality - * @param string $packageName - * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package - * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package * @return bool */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { - $constraint = $parser->parseConstraints($constraint); + $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); @@ -633,9 +224,26 @@ class InstalledVersions throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + /** * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[]} + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} */ public static function getRootPackage() { @@ -647,14 +255,38 @@ class InstalledVersions /** * Returns the raw installed.php data for custom implementations * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[]}, versions: list} + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} */ public static function getRawData() { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + return self::$installed; } + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + /** * Lets you reload the static array from another file * @@ -671,7 +303,7 @@ class InstalledVersions * @param array[] $data A vendor/composer/installed.php data set * @return void * - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[]}, versions: list} $data + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data */ public static function reload($data) { @@ -681,6 +313,7 @@ class InstalledVersions /** * @return array[] + * @psalm-return list}> */ private static function getInstalled() { @@ -691,17 +324,35 @@ class InstalledVersions $installed = array(); if (self::$canGetVendors) { - // @phpstan-ignore-next-line foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } } } } - $installed[] = self::$installed; + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; + } else { + self::$installed = array(); + } + } + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } return $installed; } diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE index 62ecfd8d0..f27399a04 100644 --- a/vendor/composer/LICENSE +++ b/vendor/composer/LICENSE @@ -1,3 +1,4 @@ + Copyright (c) Nils Adermann, Jordi Boggiano Permission is hereby granted, free of charge, to any person obtaining a copy @@ -17,3 +18,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 9e751e17c..d51a256f0 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -2,10 +2,13 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( + 'AllowDynamicProperties' => $vendorDir . '/symfony/polyfill-php82/Resources/stubs/AllowDynamicProperties.php', + 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', + 'CURLStringFile' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php', 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 'IdiormMethodMissingException' => $vendorDir . '/j4mie/idiorm/idiorm.php', 'IdiormResultSet' => $vendorDir . '/j4mie/idiorm/idiorm.php', @@ -430,6 +433,14 @@ return array( 'PharIo\\Version\\VersionConstraintParser' => $vendorDir . '/phar-io/version/src/VersionConstraintParser.php', 'PharIo\\Version\\VersionConstraintValue' => $vendorDir . '/phar-io/version/src/VersionConstraintValue.php', 'PharIo\\Version\\VersionNumber' => $vendorDir . '/phar-io/version/src/VersionNumber.php', + 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', + 'Random\\BrokenRandomEngineError' => $vendorDir . '/symfony/polyfill-php82/Resources/stubs/Random/BrokenRandomEngineError.php', + 'Random\\CryptoSafeEngine' => $vendorDir . '/symfony/polyfill-php82/Resources/stubs/Random/CryptoSafeEngine.php', + 'Random\\Engine' => $vendorDir . '/symfony/polyfill-php82/Resources/stubs/Random/Engine.php', + 'Random\\Engine\\Secure' => $vendorDir . '/symfony/polyfill-php82/Resources/stubs/Random/Engine/Secure.php', + 'Random\\RandomError' => $vendorDir . '/symfony/polyfill-php82/Resources/stubs/Random/RandomError.php', + 'Random\\RandomException' => $vendorDir . '/symfony/polyfill-php82/Resources/stubs/Random/RandomException.php', + 'ReturnTypeWillChange' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php', 'Safe\\DateTime' => $vendorDir . '/thecodingmachine/safe/lib/DateTime.php', 'Safe\\DateTimeImmutable' => $vendorDir . '/thecodingmachine/safe/lib/DateTimeImmutable.php', 'Safe\\Exceptions\\ApacheException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/ApacheException.php', @@ -714,6 +725,9 @@ return array( 'SebastianBergmann\\Type\\UnknownType' => $vendorDir . '/sebastian/type/src/UnknownType.php', 'SebastianBergmann\\Type\\VoidType' => $vendorDir . '/sebastian/type/src/VoidType.php', 'SebastianBergmann\\Version' => $vendorDir . '/sebastian/version/src/Version.php', + 'SensitiveParameter' => $vendorDir . '/symfony/polyfill-php82/Resources/stubs/SensitiveParameter.php', + 'SensitiveParameterValue' => $vendorDir . '/symfony/polyfill-php82/Resources/stubs/SensitiveParameterValue.php', + 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'TheSeer\\Tokenizer\\Exception' => $vendorDir . '/theseer/tokenizer/src/Exception.php', 'TheSeer\\Tokenizer\\NamespaceUri' => $vendorDir . '/theseer/tokenizer/src/NamespaceUri.php', 'TheSeer\\Tokenizer\\NamespaceUriException' => $vendorDir . '/theseer/tokenizer/src/NamespaceUriException.php', @@ -722,4 +736,6 @@ return array( 'TheSeer\\Tokenizer\\TokenCollectionException' => $vendorDir . '/theseer/tokenizer/src/TokenCollectionException.php', 'TheSeer\\Tokenizer\\Tokenizer' => $vendorDir . '/theseer/tokenizer/src/Tokenizer.php', 'TheSeer\\Tokenizer\\XMLSerializer' => $vendorDir . '/theseer/tokenizer/src/XMLSerializer.php', + 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', + 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', ); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index f940286e8..3c4b2e7a3 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -2,14 +2,28 @@ // autoload_files.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( - '9b38cf48e83f5d8f60375221cd213eee' => $vendorDir . '/phpstan/phpstan/bootstrap.php', - 'ec07570ca5a812141189b1fa81503674' => $vendorDir . '/phpunit/phpunit/src/Framework/Assert/Functions.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', + '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', + '5897ea0ac4cccf14d323035e65887801' => $vendorDir . '/symfony/polyfill-php82/bootstrap.php', + '8e92226780215d0ec758aa7b73e0ede9' => $vendorDir . '/open-telemetry/context/fiber/initialize_fiber_handler.php', + 'c7b4a5d8b94d270f0f9a84f81e1dd63d' => $vendorDir . '/open-telemetry/api/Trace/functions.php', + '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', + '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', 'a4ecaeafb8cfb009ad0e052c90355e98' => $vendorDir . '/beberlei/assert/lib/Assert/functions.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', '6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', + 'c695cb998ba36e4bafc3d028efc7d113' => $vendorDir . '/open-telemetry/sdk/Common/Util/functions.php', + 'd991bdbfe253499825156f17c4a721db' => $vendorDir . '/open-telemetry/sdk/Logs/Exporter/_register.php', + '01d424d2624f29a2eef00b09eb00935e' => $vendorDir . '/open-telemetry/sdk/Metrics/MetricExporter/_register.php', + '063d0a0034c5e2149209c15208de47e4' => $vendorDir . '/open-telemetry/sdk/Propagation/_register.php', + '2cc49ecec7e065b3a5423e964c0275e6' => $vendorDir . '/open-telemetry/sdk/Trace/SpanExporter/_register.php', + '062120a429d7568eacd495a8c34fcf09' => $vendorDir . '/open-telemetry/sdk/Common/Dev/Compatibility/_load.php', + '88e3b63cfb48eb8ea316a8a85a5f5c5f' => $vendorDir . '/open-telemetry/sdk/_autoload.php', '51fcf4e06c07cc00c920b44bcd900e7a' => $vendorDir . '/thecodingmachine/safe/deprecated/apc.php', '288267919fedd3829a7732b5fb202197' => $vendorDir . '/thecodingmachine/safe/deprecated/array.php', 'a88cd08cfbf1600f7d5de6e587eee1fa' => $vendorDir . '/thecodingmachine/safe/deprecated/datetime.php', @@ -97,7 +111,7 @@ return array( '4af1dca6db8c527c6eed27bff85ff0e5' => $vendorDir . '/thecodingmachine/safe/generated/yaz.php', 'fe43ca06499ac37bc2dedd823af71eb5' => $vendorDir . '/thecodingmachine/safe/generated/zip.php', '356736db98a6834f0a886b8d509b0ecd' => $vendorDir . '/thecodingmachine/safe/generated/zlib.php', - 'ff1b7935a93a4a9517db3ebe0533892a' => $vendorDir . '/opentracing/opentracing/src/OpenTracing/Tags.php', - '0db36546c71c357f5ee70c39bb03966f' => $vendorDir . '/opentracing/opentracing/src/OpenTracing/Formats.php', - '822502b10d2c1dae82956ef999e8b4be' => $vendorDir . '/jonahgeorge/jaeger-client-php/src/Jaeger/Constants.php', + '157bbd0180425c7142fbaf1b1646bec3' => $vendorDir . '/open-telemetry/exporter-otlp/_register.php', + '9b38cf48e83f5d8f60375221cd213eee' => $vendorDir . '/phpstan/phpstan/bootstrap.php', + 'ec07570ca5a812141189b1fa81503674' => $vendorDir . '/phpunit/phpunit/src/Framework/Assert/Functions.php', ); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index b7fc0125d..15a2ff3ad 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -2,7 +2,7 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 98ef4f1fd..3354c5d1f 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -2,7 +2,7 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( @@ -10,15 +10,33 @@ return array( 'chillerlan\\Settings\\' => array($vendorDir . '/chillerlan/php-settings-container/src'), 'chillerlan\\QRCode\\' => array($vendorDir . '/chillerlan/php-qrcode/src'), 'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'), - 'Thrift\\' => array($vendorDir . '/packaged/thrift/src'), + 'Symfony\\Polyfill\\Php82\\' => array($vendorDir . '/symfony/polyfill-php82'), + 'Symfony\\Polyfill\\Php81\\' => array($vendorDir . '/symfony/polyfill-php81'), + 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), + 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/src'), - 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'), + 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'), + 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), 'Prophecy\\' => array($vendorDir . '/phpspec/prophecy/src/Prophecy'), 'PhpParser\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'), 'ParagonIE\\ConstantTime\\' => array($vendorDir . '/paragonie/constant_time_encoding/src'), - 'OpenTracing\\' => array($vendorDir . '/opentracing/opentracing/src/OpenTracing'), + 'Opentelemetry\\Proto\\' => array($vendorDir . '/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto'), + 'OpenTelemetry\\SemConv\\' => array($vendorDir . '/open-telemetry/sem-conv'), + 'OpenTelemetry\\SDK\\' => array($vendorDir . '/open-telemetry/sdk'), + 'OpenTelemetry\\Contrib\\Otlp\\' => array($vendorDir . '/open-telemetry/exporter-otlp'), + 'OpenTelemetry\\Context\\' => array($vendorDir . '/open-telemetry/context'), + 'OpenTelemetry\\API\\' => array($vendorDir . '/open-telemetry/api'), 'OTPHP\\' => array($vendorDir . '/spomky-labs/otphp/src'), - 'Jaeger\\' => array($vendorDir . '/jonahgeorge/jaeger-client-php/src/Jaeger'), + 'Http\\Promise\\' => array($vendorDir . '/php-http/promise/src'), + 'Http\\Discovery\\' => array($vendorDir . '/php-http/discovery/src'), + 'Http\\Client\\' => array($vendorDir . '/php-http/httplug/src'), + 'Http\\Adapter\\Guzzle7\\' => array($vendorDir . '/php-http/guzzle7-adapter/src'), + 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), + 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), + 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), + 'Google\\Protobuf\\' => array($vendorDir . '/google/protobuf/src/Google/Protobuf'), + 'GPBMetadata\\Opentelemetry\\' => array($vendorDir . '/open-telemetry/gen-otlp-protobuf/GPBMetadata/Opentelemetry'), + 'GPBMetadata\\Google\\Protobuf\\' => array($vendorDir . '/google/protobuf/src/GPBMetadata/Google/Protobuf'), 'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'), 'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'), 'Assert\\' => array($vendorDir . '/beberlei/assert/lib/Assert'), diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 51b54d2f0..ebee29895 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -23,51 +23,26 @@ class ComposerAutoloaderInit19fc2ff1c0f9a92279c7979386bb2056 } spl_autoload_register(array('ComposerAutoloaderInit19fc2ff1c0f9a92279c7979386bb2056', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInit19fc2ff1c0f9a92279c7979386bb2056', 'loadClassLoader')); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require __DIR__ . '/autoload_static.php'; + require __DIR__ . '/autoload_static.php'; + call_user_func(\Composer\Autoload\ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056::getInitializer($loader)); - call_user_func(\Composer\Autoload\ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } + $loader->register(true); - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } + $filesToLoad = \Composer\Autoload\ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056::$files; + $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); + require $file; } - } - - $loader->register(true); - - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire19fc2ff1c0f9a92279c7979386bb2056($fileIdentifier, $file); + }, null, null); + foreach ($filesToLoad as $fileIdentifier => $file) { + $requireFile($fileIdentifier, $file); } return $loader; } } - -function composerRequire19fc2ff1c0f9a92279c7979386bb2056($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - } -} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 67d12d734..5dcd0fd72 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -7,10 +7,24 @@ namespace Composer\Autoload; class ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056 { public static $files = array ( - '9b38cf48e83f5d8f60375221cd213eee' => __DIR__ . '/..' . '/phpstan/phpstan/bootstrap.php', - 'ec07570ca5a812141189b1fa81503674' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Assert/Functions.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', + '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', + '5897ea0ac4cccf14d323035e65887801' => __DIR__ . '/..' . '/symfony/polyfill-php82/bootstrap.php', + '8e92226780215d0ec758aa7b73e0ede9' => __DIR__ . '/..' . '/open-telemetry/context/fiber/initialize_fiber_handler.php', + 'c7b4a5d8b94d270f0f9a84f81e1dd63d' => __DIR__ . '/..' . '/open-telemetry/api/Trace/functions.php', + '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', + '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', 'a4ecaeafb8cfb009ad0e052c90355e98' => __DIR__ . '/..' . '/beberlei/assert/lib/Assert/functions.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', '6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', + 'c695cb998ba36e4bafc3d028efc7d113' => __DIR__ . '/..' . '/open-telemetry/sdk/Common/Util/functions.php', + 'd991bdbfe253499825156f17c4a721db' => __DIR__ . '/..' . '/open-telemetry/sdk/Logs/Exporter/_register.php', + '01d424d2624f29a2eef00b09eb00935e' => __DIR__ . '/..' . '/open-telemetry/sdk/Metrics/MetricExporter/_register.php', + '063d0a0034c5e2149209c15208de47e4' => __DIR__ . '/..' . '/open-telemetry/sdk/Propagation/_register.php', + '2cc49ecec7e065b3a5423e964c0275e6' => __DIR__ . '/..' . '/open-telemetry/sdk/Trace/SpanExporter/_register.php', + '062120a429d7568eacd495a8c34fcf09' => __DIR__ . '/..' . '/open-telemetry/sdk/Common/Dev/Compatibility/_load.php', + '88e3b63cfb48eb8ea316a8a85a5f5c5f' => __DIR__ . '/..' . '/open-telemetry/sdk/_autoload.php', '51fcf4e06c07cc00c920b44bcd900e7a' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/apc.php', '288267919fedd3829a7732b5fb202197' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/array.php', 'a88cd08cfbf1600f7d5de6e587eee1fa' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/datetime.php', @@ -98,9 +112,9 @@ class ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056 '4af1dca6db8c527c6eed27bff85ff0e5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/yaz.php', 'fe43ca06499ac37bc2dedd823af71eb5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/zip.php', '356736db98a6834f0a886b8d509b0ecd' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/zlib.php', - 'ff1b7935a93a4a9517db3ebe0533892a' => __DIR__ . '/..' . '/opentracing/opentracing/src/OpenTracing/Tags.php', - '0db36546c71c357f5ee70c39bb03966f' => __DIR__ . '/..' . '/opentracing/opentracing/src/OpenTracing/Formats.php', - '822502b10d2c1dae82956ef999e8b4be' => __DIR__ . '/..' . '/jonahgeorge/jaeger-client-php/src/Jaeger/Constants.php', + '157bbd0180425c7142fbaf1b1646bec3' => __DIR__ . '/..' . '/open-telemetry/exporter-otlp/_register.php', + '9b38cf48e83f5d8f60375221cd213eee' => __DIR__ . '/..' . '/phpstan/phpstan/bootstrap.php', + 'ec07570ca5a812141189b1fa81503674' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Assert/Functions.php', ); public static $prefixLengthsPsr4 = array ( @@ -117,26 +131,47 @@ class ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056 array ( 'Webmozart\\Assert\\' => 17, ), - 'T' => + 'S' => array ( - 'Thrift\\' => 7, + 'Symfony\\Polyfill\\Php82\\' => 23, + 'Symfony\\Polyfill\\Php81\\' => 23, + 'Symfony\\Polyfill\\Php80\\' => 23, + 'Symfony\\Polyfill\\Mbstring\\' => 26, ), 'P' => array ( 'Psr\\Log\\' => 8, - 'Psr\\Cache\\' => 10, + 'Psr\\Http\\Message\\' => 17, + 'Psr\\Http\\Client\\' => 16, 'Prophecy\\' => 9, 'PhpParser\\' => 10, 'ParagonIE\\ConstantTime\\' => 23, ), 'O' => array ( - 'OpenTracing\\' => 12, + 'Opentelemetry\\Proto\\' => 20, + 'OpenTelemetry\\SemConv\\' => 22, + 'OpenTelemetry\\SDK\\' => 18, + 'OpenTelemetry\\Contrib\\Otlp\\' => 27, + 'OpenTelemetry\\Context\\' => 22, + 'OpenTelemetry\\API\\' => 18, 'OTPHP\\' => 6, ), - 'J' => + 'H' => + array ( + 'Http\\Promise\\' => 13, + 'Http\\Discovery\\' => 15, + 'Http\\Client\\' => 12, + 'Http\\Adapter\\Guzzle7\\' => 21, + ), + 'G' => array ( - 'Jaeger\\' => 7, + 'GuzzleHttp\\Psr7\\' => 16, + 'GuzzleHttp\\Promise\\' => 19, + 'GuzzleHttp\\' => 11, + 'Google\\Protobuf\\' => 16, + 'GPBMetadata\\Opentelemetry\\' => 26, + 'GPBMetadata\\Google\\Protobuf\\' => 28, ), 'D' => array ( @@ -168,17 +203,34 @@ class ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056 array ( 0 => __DIR__ . '/..' . '/webmozart/assert/src', ), - 'Thrift\\' => + 'Symfony\\Polyfill\\Php82\\' => array ( - 0 => __DIR__ . '/..' . '/packaged/thrift/src', + 0 => __DIR__ . '/..' . '/symfony/polyfill-php82', + ), + 'Symfony\\Polyfill\\Php81\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php81', + ), + 'Symfony\\Polyfill\\Php80\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', + ), + 'Symfony\\Polyfill\\Mbstring\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', ), 'Psr\\Log\\' => array ( 0 => __DIR__ . '/..' . '/psr/log/src', ), - 'Psr\\Cache\\' => + 'Psr\\Http\\Message\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/http-message/src', + 1 => __DIR__ . '/..' . '/psr/http-factory/src', + ), + 'Psr\\Http\\Client\\' => array ( - 0 => __DIR__ . '/..' . '/psr/cache/src', + 0 => __DIR__ . '/..' . '/psr/http-client/src', ), 'Prophecy\\' => array ( @@ -192,17 +244,73 @@ class ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056 array ( 0 => __DIR__ . '/..' . '/paragonie/constant_time_encoding/src', ), - 'OpenTracing\\' => + 'Opentelemetry\\Proto\\' => + array ( + 0 => __DIR__ . '/..' . '/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto', + ), + 'OpenTelemetry\\SemConv\\' => + array ( + 0 => __DIR__ . '/..' . '/open-telemetry/sem-conv', + ), + 'OpenTelemetry\\SDK\\' => + array ( + 0 => __DIR__ . '/..' . '/open-telemetry/sdk', + ), + 'OpenTelemetry\\Contrib\\Otlp\\' => + array ( + 0 => __DIR__ . '/..' . '/open-telemetry/exporter-otlp', + ), + 'OpenTelemetry\\Context\\' => + array ( + 0 => __DIR__ . '/..' . '/open-telemetry/context', + ), + 'OpenTelemetry\\API\\' => array ( - 0 => __DIR__ . '/..' . '/opentracing/opentracing/src/OpenTracing', + 0 => __DIR__ . '/..' . '/open-telemetry/api', ), 'OTPHP\\' => array ( 0 => __DIR__ . '/..' . '/spomky-labs/otphp/src', ), - 'Jaeger\\' => + 'Http\\Promise\\' => + array ( + 0 => __DIR__ . '/..' . '/php-http/promise/src', + ), + 'Http\\Discovery\\' => + array ( + 0 => __DIR__ . '/..' . '/php-http/discovery/src', + ), + 'Http\\Client\\' => + array ( + 0 => __DIR__ . '/..' . '/php-http/httplug/src', + ), + 'Http\\Adapter\\Guzzle7\\' => + array ( + 0 => __DIR__ . '/..' . '/php-http/guzzle7-adapter/src', + ), + 'GuzzleHttp\\Psr7\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', + ), + 'GuzzleHttp\\Promise\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/promises/src', + ), + 'GuzzleHttp\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src', + ), + 'Google\\Protobuf\\' => + array ( + 0 => __DIR__ . '/..' . '/google/protobuf/src/Google/Protobuf', + ), + 'GPBMetadata\\Opentelemetry\\' => + array ( + 0 => __DIR__ . '/..' . '/open-telemetry/gen-otlp-protobuf/GPBMetadata/Opentelemetry', + ), + 'GPBMetadata\\Google\\Protobuf\\' => array ( - 0 => __DIR__ . '/..' . '/jonahgeorge/jaeger-client-php/src/Jaeger', + 0 => __DIR__ . '/..' . '/google/protobuf/src/GPBMetadata/Google/Protobuf', ), 'Doctrine\\Instantiator\\' => array ( @@ -219,6 +327,9 @@ class ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056 ); public static $classMap = array ( + 'AllowDynamicProperties' => __DIR__ . '/..' . '/symfony/polyfill-php82/Resources/stubs/AllowDynamicProperties.php', + 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', + 'CURLStringFile' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php', 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 'IdiormMethodMissingException' => __DIR__ . '/..' . '/j4mie/idiorm/idiorm.php', 'IdiormResultSet' => __DIR__ . '/..' . '/j4mie/idiorm/idiorm.php', @@ -643,6 +754,14 @@ class ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056 'PharIo\\Version\\VersionConstraintParser' => __DIR__ . '/..' . '/phar-io/version/src/VersionConstraintParser.php', 'PharIo\\Version\\VersionConstraintValue' => __DIR__ . '/..' . '/phar-io/version/src/VersionConstraintValue.php', 'PharIo\\Version\\VersionNumber' => __DIR__ . '/..' . '/phar-io/version/src/VersionNumber.php', + 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', + 'Random\\BrokenRandomEngineError' => __DIR__ . '/..' . '/symfony/polyfill-php82/Resources/stubs/Random/BrokenRandomEngineError.php', + 'Random\\CryptoSafeEngine' => __DIR__ . '/..' . '/symfony/polyfill-php82/Resources/stubs/Random/CryptoSafeEngine.php', + 'Random\\Engine' => __DIR__ . '/..' . '/symfony/polyfill-php82/Resources/stubs/Random/Engine.php', + 'Random\\Engine\\Secure' => __DIR__ . '/..' . '/symfony/polyfill-php82/Resources/stubs/Random/Engine/Secure.php', + 'Random\\RandomError' => __DIR__ . '/..' . '/symfony/polyfill-php82/Resources/stubs/Random/RandomError.php', + 'Random\\RandomException' => __DIR__ . '/..' . '/symfony/polyfill-php82/Resources/stubs/Random/RandomException.php', + 'ReturnTypeWillChange' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php', 'Safe\\DateTime' => __DIR__ . '/..' . '/thecodingmachine/safe/lib/DateTime.php', 'Safe\\DateTimeImmutable' => __DIR__ . '/..' . '/thecodingmachine/safe/lib/DateTimeImmutable.php', 'Safe\\Exceptions\\ApacheException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/ApacheException.php', @@ -927,6 +1046,9 @@ class ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056 'SebastianBergmann\\Type\\UnknownType' => __DIR__ . '/..' . '/sebastian/type/src/UnknownType.php', 'SebastianBergmann\\Type\\VoidType' => __DIR__ . '/..' . '/sebastian/type/src/VoidType.php', 'SebastianBergmann\\Version' => __DIR__ . '/..' . '/sebastian/version/src/Version.php', + 'SensitiveParameter' => __DIR__ . '/..' . '/symfony/polyfill-php82/Resources/stubs/SensitiveParameter.php', + 'SensitiveParameterValue' => __DIR__ . '/..' . '/symfony/polyfill-php82/Resources/stubs/SensitiveParameterValue.php', + 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'TheSeer\\Tokenizer\\Exception' => __DIR__ . '/..' . '/theseer/tokenizer/src/Exception.php', 'TheSeer\\Tokenizer\\NamespaceUri' => __DIR__ . '/..' . '/theseer/tokenizer/src/NamespaceUri.php', 'TheSeer\\Tokenizer\\NamespaceUriException' => __DIR__ . '/..' . '/theseer/tokenizer/src/NamespaceUriException.php', @@ -935,6 +1057,8 @@ class ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056 'TheSeer\\Tokenizer\\TokenCollectionException' => __DIR__ . '/..' . '/theseer/tokenizer/src/TokenCollectionException.php', 'TheSeer\\Tokenizer\\Tokenizer' => __DIR__ . '/..' . '/theseer/tokenizer/src/Tokenizer.php', 'TheSeer\\Tokenizer\\XMLSerializer' => __DIR__ . '/..' . '/theseer/tokenizer/src/XMLSerializer.php', + 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', + 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', ); public static function getInitializer(ClassLoader $loader) diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 0be499810..54f34fa7f 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -291,6 +291,387 @@ ], "install-path": "../doctrine/instantiator" }, + { + "name": "google/protobuf", + "version": "v3.24.4", + "version_normalized": "3.24.4.0", + "source": { + "type": "git", + "url": "https://github.com/protocolbuffers/protobuf-php.git", + "reference": "672d69e25f71b9364fdf1810eb8a8573defdc404" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/672d69e25f71b9364fdf1810eb8a8573defdc404", + "reference": "672d69e25f71b9364fdf1810eb8a8573defdc404", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": ">=5.0.0" + }, + "suggest": { + "ext-bcmath": "Need to support JSON deserialization" + }, + "time": "2023-10-04T17:22:47+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Google\\Protobuf\\": "src/Google/Protobuf", + "GPBMetadata\\Google\\Protobuf\\": "src/GPBMetadata/Google/Protobuf" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "proto library for PHP", + "homepage": "https://developers.google.com/protocol-buffers/", + "keywords": [ + "proto" + ], + "support": { + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v3.24.4" + }, + "install-path": "../google/protobuf" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.8.0", + "version_normalized": "7.8.0.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.1", + "ext-curl": "*", + "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "time": "2023-08-27T10:20:53+00:00", + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.8.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "install-path": "../guzzlehttp/guzzle" + }, + { + "name": "guzzlehttp/promises", + "version": "2.0.1", + "version_normalized": "2.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/111166291a0f8130081195ac4556a5587d7f1b5d", + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" + }, + "time": "2023-08-03T15:11:55+00:00", + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.0.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "install-path": "../guzzlehttp/promises" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.6.1", + "version_normalized": "2.6.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/be45764272e8873c72dbe3d2edcfdfcc3bc9f727", + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "time": "2023-08-27T10:13:57+00:00", + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.6.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "install-path": "../guzzlehttp/psr7" + }, { "name": "j4mie/idiorm", "version": "dev-master", @@ -359,77 +740,6 @@ }, "install-path": "../j4mie/idiorm" }, - { - "name": "jonahgeorge/jaeger-client-php", - "version": "v1.4.4", - "version_normalized": "1.4.4.0", - "source": { - "type": "git", - "url": "https://github.com/jonahgeorge/jaeger-client-php.git", - "reference": "3173d9c68ad8cea16058f25337982b00cc3d1c2b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/jonahgeorge/jaeger-client-php/zipball/3173d9c68ad8cea16058f25337982b00cc3d1c2b", - "reference": "3173d9c68ad8cea16058f25337982b00cc3d1c2b", - "shasum": "" - }, - "require": { - "ext-sockets": "*", - "opentracing/opentracing": "^1.0", - "packaged/thrift": "^0.13", - "php": "^7.1 || ^8.0 || ^8.1", - "psr/cache": "^1.0 || ^2.0 || ^3.0", - "psr/log": "^1.0 || ^2.0 || ^3.0" - }, - "require-dev": { - "cache/array-adapter": "^1.0", - "phpunit/phpunit": "^7 || ^8 || ^9", - "squizlabs/php_codesniffer": "3.*", - "symfony/polyfill-php73": "^1.10" - }, - "time": "2023-01-31T13:40:20+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "./src/Jaeger/Constants.php" - ], - "psr-4": { - "Jaeger\\": "src/Jaeger/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jonah George", - "homepage": "http://twitter.com/jonahgeorge" - }, - { - "name": "José Carlos Chávez", - "email": "jcchavezs@gmail.com" - }, - { - "name": "Contributors", - "homepage": "https://github.com/jonahgeorge/jaeger-client-php/graphs/contributors" - } - ], - "description": "Jaeger Bindings for PHP OpenTracing API", - "keywords": [ - "jaeger", - "opentracing", - "trace", - "tracing" - ], - "support": { - "issues": "https://github.com/jonahgeorge/jaeger-client-php/issues", - "source": "https://github.com/jonahgeorge/jaeger-client-php/tree/v1.4.4" - }, - "install-path": "../jonahgeorge/jaeger-client-php" - }, { "name": "mervick/material-design-icons", "version": "2.2.0", @@ -598,38 +908,42 @@ "install-path": "../nikic/php-parser" }, { - "name": "opentracing/opentracing", - "version": "1.0.2", - "version_normalized": "1.0.2.0", + "name": "open-telemetry/api", + "version": "1.0.0", + "version_normalized": "1.0.0.0", "source": { "type": "git", - "url": "https://github.com/opentracing/opentracing-php.git", - "reference": "cd60bd1fb2a25280600bc74c7f9e0c13881a9116" + "url": "https://github.com/opentelemetry-php/api.git", + "reference": "d577d732333d38a9a6c16936363ee25f1e3f1c3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentracing/opentracing-php/zipball/cd60bd1fb2a25280600bc74c7f9e0c13881a9116", - "reference": "cd60bd1fb2a25280600bc74c7f9e0c13881a9116", + "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/d577d732333d38a9a6c16936363ee25f1e3f1c3c", + "reference": "d577d732333d38a9a6c16936363ee25f1e3f1c3c", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "~0.12", - "phpunit/phpunit": "^7.0 || ^9.0", - "squizlabs/php_codesniffer": "3.*" - }, - "time": "2022-01-27T19:59:21+00:00", + "open-telemetry/context": "^1.0", + "php": "^7.4 || ^8.0", + "psr/log": "^1.1|^2.0|^3.0", + "symfony/polyfill-php80": "^1.26", + "symfony/polyfill-php81": "^1.26", + "symfony/polyfill-php82": "^1.26" + }, + "time": "2023-09-27T23:15:51+00:00", "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0.x-dev" + } + }, "installation-source": "dist", "autoload": { "files": [ - "src/OpenTracing/Tags.php", - "src/OpenTracing/Formats.php" + "Trace/functions.php" ], "psr-4": { - "OpenTracing\\": "src/OpenTracing/" + "OpenTelemetry\\API\\": "." } }, "notification-url": "https://packagist.org/downloads/", @@ -638,58 +952,370 @@ ], "authors": [ { - "name": "José Carlos Chávez", - "email": "jcchavezs@gmail.com" + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" } ], - "description": "OpenTracing API for PHP", + "description": "API for OpenTelemetry PHP.", + "keywords": [ + "Metrics", + "api", + "apm", + "logging", + "opentelemetry", + "otel", + "tracing" + ], "support": { - "issues": "https://github.com/opentracing/opentracing-php/issues", - "source": "https://github.com/opentracing/opentracing-php/tree/1.0.2" + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "install-path": "../opentracing/opentracing" + "install-path": "../open-telemetry/api" }, { - "name": "packaged/thrift", - "version": "0.13.01", - "version_normalized": "0.13.01.0", + "name": "open-telemetry/context", + "version": "1.0.0", + "version_normalized": "1.0.0.0", "source": { "type": "git", - "url": "https://github.com/packaged/thrift.git", - "reference": "e3dbcfb79e319971d64264ffe9c340590cc8a228" + "url": "https://github.com/opentelemetry-php/context.git", + "reference": "99f3d54fa9f9ff67421774feeef5e5b1f209ea21" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/packaged/thrift/zipball/e3dbcfb79e319971d64264ffe9c340590cc8a228", - "reference": "e3dbcfb79e319971d64264ffe9c340590cc8a228", + "url": "https://api.github.com/repos/opentelemetry-php/context/zipball/99f3d54fa9f9ff67421774feeef5e5b1f209ea21", + "reference": "99f3d54fa9f9ff67421774feeef5e5b1f209ea21", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0 || ^8.0" + "php": "^7.4 || ^8.0", + "symfony/polyfill-php80": "^1.26", + "symfony/polyfill-php81": "^1.26", + "symfony/polyfill-php82": "^1.26" + }, + "suggest": { + "ext-ffi": "To allow context switching in Fibers" + }, + "time": "2023-09-05T03:38:44+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "fiber/initialize_fiber_handler.php" + ], + "psr-4": { + "OpenTelemetry\\Context\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "Context implementation for OpenTelemetry PHP.", + "keywords": [ + "Context", + "opentelemetry", + "otel" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "install-path": "../open-telemetry/context" + }, + { + "name": "open-telemetry/exporter-otlp", + "version": "1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/exporter-otlp.git", + "reference": "756092bdff472ea49adb7843c74011606d065b36" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/756092bdff472ea49adb7843c74011606d065b36", + "reference": "756092bdff472ea49adb7843c74011606d065b36", + "shasum": "" + }, + "require": { + "open-telemetry/api": "^1.0", + "open-telemetry/gen-otlp-protobuf": "^1.0", + "open-telemetry/sdk": "^1.0", + "php": "^7.4 || ^8.0", + "php-http/discovery": "^1.14" + }, + "time": "2023-10-13T00:48:23+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "_register.php" + ], + "psr-4": { + "OpenTelemetry\\Contrib\\Otlp\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "OTLP exporter for OpenTelemetry.", + "keywords": [ + "Metrics", + "exporter", + "gRPC", + "http", + "opentelemetry", + "otel", + "otlp", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "install-path": "../open-telemetry/exporter-otlp" + }, + { + "name": "open-telemetry/gen-otlp-protobuf", + "version": "1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/gen-otlp-protobuf.git", + "reference": "30fe95f10c2ec1a577f78257c86fbbebe739ca5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/gen-otlp-protobuf/zipball/30fe95f10c2ec1a577f78257c86fbbebe739ca5e", + "reference": "30fe95f10c2ec1a577f78257c86fbbebe739ca5e", + "shasum": "" + }, + "require": { + "google/protobuf": "^3.3.0", + "php": "^7.4 || ^8.0" + }, + "suggest": { + "ext-protobuf": "For better performance, when dealing with the protobuf format" + }, + "time": "2023-09-05T03:38:44+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Opentelemetry\\Proto\\": "Opentelemetry/Proto/", + "GPBMetadata\\Opentelemetry\\": "GPBMetadata/Opentelemetry/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "PHP protobuf files for communication with OpenTelemetry OTLP collectors/servers.", + "keywords": [ + "Metrics", + "apm", + "gRPC", + "logging", + "opentelemetry", + "otel", + "otlp", + "protobuf", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "install-path": "../open-telemetry/gen-otlp-protobuf" + }, + { + "name": "open-telemetry/sdk", + "version": "1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/sdk.git", + "reference": "1c6020b4f1b85fdd647538ee46f6c83360d7c11e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/1c6020b4f1b85fdd647538ee46f6c83360d7c11e", + "reference": "1c6020b4f1b85fdd647538ee46f6c83360d7c11e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "open-telemetry/api": "^1.0", + "open-telemetry/context": "^1.0", + "open-telemetry/sem-conv": "^1.0", + "php": "^7.4 || ^8.0", + "php-http/discovery": "^1.14", + "psr/http-client": "^1.0", + "psr/http-client-implementation": "^1.0", + "psr/http-factory-implementation": "^1.0", + "psr/http-message": "^1.0.1|^2.0", + "psr/log": "^1.1|^2.0|^3.0", + "symfony/polyfill-mbstring": "^1.23", + "symfony/polyfill-php80": "^1.26", + "symfony/polyfill-php81": "^1.26", + "symfony/polyfill-php82": "^1.26" + }, + "suggest": { + "ext-gmp": "To support unlimited number of synchronous metric readers", + "ext-mbstring": "To increase performance of string operations" + }, + "time": "2023-10-18T20:53:08+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "Common/Util/functions.php", + "Logs/Exporter/_register.php", + "Metrics/MetricExporter/_register.php", + "Propagation/_register.php", + "Trace/SpanExporter/_register.php", + "Common/Dev/Compatibility/_load.php", + "_autoload.php" + ], + "psr-4": { + "OpenTelemetry\\SDK\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "SDK for OpenTelemetry PHP.", + "keywords": [ + "Metrics", + "apm", + "logging", + "opentelemetry", + "otel", + "sdk", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "install-path": "../open-telemetry/sdk" + }, + { + "name": "open-telemetry/sem-conv", + "version": "1.22.1", + "version_normalized": "1.22.1.0", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/sem-conv.git", + "reference": "e582b874ee89bec544f962db212b3966fe9310a7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/e582b874ee89bec544f962db212b3966fe9310a7", + "reference": "e582b874ee89bec544f962db212b3966fe9310a7", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "time": "2023-10-19T20:10:44+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } }, - "time": "2021-01-25T13:32:28+00:00", - "type": "library", "installation-source": "dist", "autoload": { "psr-4": { - "Thrift\\": "src/" + "OpenTelemetry\\SemConv\\": "." } }, "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], - "description": "Apache Thrift", - "homepage": "http://thrift.apache.org/", + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "Semantic conventions for OpenTelemetry PHP.", "keywords": [ - "apache", - "thrift" + "Metrics", + "apm", + "logging", + "opentelemetry", + "otel", + "semantic conventions", + "semconv", + "tracing" ], "support": { - "issues": "https://github.com/packaged/thrift/issues", - "source": "https://github.com/packaged/thrift/tree/0.13.01" + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "install-path": "../packaged/thrift" + "install-path": "../open-telemetry/sem-conv" }, { "name": "paragonie/constant_time_encoding", @@ -879,35 +1505,57 @@ "install-path": "../phar-io/version" }, { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "version_normalized": "2.2.0.0", + "name": "php-http/discovery", + "version": "1.19.1", + "version_normalized": "1.19.1.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + "url": "https://github.com/php-http/discovery.git", + "reference": "57f3de01d32085fea20865f9b16fb0e69347c39e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "url": "https://api.github.com/repos/php-http/discovery/zipball/57f3de01d32085fea20865f9b16fb0e69347c39e", + "reference": "57f3de01d32085fea20865f9b16fb0e69347c39e", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "composer-plugin-api": "^1.0|^2.0", + "php": "^7.1 || ^8.0" }, - "time": "2020-06-27T09:03:43+00:00", - "type": "library", + "conflict": { + "nyholm/psr7": "<1.0", + "zendframework/zend-diactoros": "*" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "*", + "psr/http-factory-implementation": "*", + "psr/http-message-implementation": "*" + }, + "require-dev": { + "composer/composer": "^1.0.2|^2.0", + "graham-campbell/phpspec-skip-example-extension": "^5.0", + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3", + "symfony/phpunit-bridge": "^6.2" + }, + "time": "2023-07-11T07:02:26+00:00", + "type": "composer-plugin", "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } + "class": "Http\\Discovery\\Composer\\Plugin", + "plugin-optional": true }, "installation-source": "dist", "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } + "Http\\Discovery\\": "src/" + }, + "exclude-from-classmap": [ + "src/Composer/Plugin.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -915,62 +1563,69 @@ ], "authors": [ { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" } ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", + "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations", + "homepage": "http://php-http.org", "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr17", + "psr7" ], "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + "issues": "https://github.com/php-http/discovery/issues", + "source": "https://github.com/php-http/discovery/tree/1.19.1" }, - "install-path": "../phpdocumentor/reflection-common" + "install-path": "../php-http/discovery" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "version_normalized": "5.3.0.0", + "name": "php-http/guzzle7-adapter", + "version": "1.0.0", + "version_normalized": "1.0.0.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + "url": "https://github.com/php-http/guzzle7-adapter.git", + "reference": "fb075a71dbfa4847cf0c2938c4e5a9c478ef8b01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "url": "https://api.github.com/repos/php-http/guzzle7-adapter/zipball/fb075a71dbfa4847cf0c2938c4e5a9c478ef8b01", + "reference": "fb075a71dbfa4847cf0c2938c4e5a9c478ef8b01", "shasum": "" }, "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" + "guzzlehttp/guzzle": "^7.0", + "php": "^7.2 | ^8.0", + "php-http/httplug": "^2.0", + "psr/http-client": "^1.0" + }, + "provide": { + "php-http/async-client-implementation": "1.0", + "php-http/client-implementation": "1.0", + "psr/http-client-implementation": "1.0" }, "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" + "php-http/client-integration-tests": "^3.0", + "phpunit/phpunit": "^8.0|^9.3" }, - "time": "2021-10-19T17:43:47+00:00", + "time": "2021-03-09T07:35:15+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "5.x-dev" + "dev-master": "0.2.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src" + "Http\\Adapter\\Guzzle7\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -979,55 +1634,53 @@ ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" } ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "description": "Guzzle 7 HTTP Adapter", + "homepage": "http://httplug.io", + "keywords": [ + "Guzzle", + "http" + ], "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + "issues": "https://github.com/php-http/guzzle7-adapter/issues", + "source": "https://github.com/php-http/guzzle7-adapter/tree/1.0.0" }, - "install-path": "../phpdocumentor/reflection-docblock" + "install-path": "../php-http/guzzle7-adapter" }, { - "name": "phpdocumentor/type-resolver", - "version": "1.6.1", - "version_normalized": "1.6.1.0", + "name": "php-http/httplug", + "version": "2.4.0", + "version_normalized": "2.4.0.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" + "url": "https://github.com/php-http/httplug.git", + "reference": "625ad742c360c8ac580fcc647a1541d29e257f67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", + "url": "https://api.github.com/repos/php-http/httplug/zipball/625ad742c360c8ac580fcc647a1541d29e257f67", + "reference": "625ad742c360c8ac580fcc647a1541d29e257f67", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" + "php": "^7.1 || ^8.0", + "php-http/promise": "^1.1", + "psr/http-client": "^1.0", + "psr/http-message": "^1.0 || ^2.0" }, "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" + "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0", + "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0" }, - "time": "2022-03-15T21:29:03+00:00", + "time": "2023-04-14T15:10:03+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, "installation-source": "dist", "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src" + "Http\\Client\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1036,24 +1689,263 @@ ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" } ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "description": "HTTPlug, the HTTP client abstraction for PHP", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http" + ], "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" + "issues": "https://github.com/php-http/httplug/issues", + "source": "https://github.com/php-http/httplug/tree/2.4.0" }, - "install-path": "../phpdocumentor/type-resolver" + "install-path": "../php-http/httplug" }, { - "name": "phpspec/prophecy", - "version": "v1.15.0", - "version_normalized": "1.15.0.0", + "name": "php-http/promise", + "version": "1.1.0", + "version_normalized": "1.1.0.0", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", + "url": "https://github.com/php-http/promise.git", + "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/promise/zipball/4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", + "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.3.2", + "phpspec/phpspec": "^5.1.2 || ^6.2" + }, + "time": "2020-07-07T09:29:14+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/php-http/promise/issues", + "source": "https://github.com/php-http/promise/tree/1.1.0" + }, + "install-path": "../php-http/promise" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "version_normalized": "2.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "time": "2020-06-27T09:03:43+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "install-path": "../phpdocumentor/reflection-common" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.3.0", + "version_normalized": "5.3.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" + }, + "time": "2021-10-19T17:43:47+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + }, + "install-path": "../phpdocumentor/reflection-docblock" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.6.1", + "version_normalized": "1.6.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "77a32518733312af16a44300404e945338981de3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", + "reference": "77a32518733312af16a44300404e945338981de3", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*", + "psalm/phar": "^4.8" + }, + "time": "2022-03-15T21:29:03+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" + }, + "install-path": "../phpdocumentor/type-resolver" + }, + { + "name": "phpspec/prophecy", + "version": "v1.15.0", + "version_normalized": "1.15.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" }, "dist": { @@ -1619,24 +2511,25 @@ "install-path": "../phpunit/phpunit" }, { - "name": "psr/cache", - "version": "3.0.0", - "version_normalized": "3.0.0.0", + "name": "psr/http-client", + "version": "1.0.3", + "version_normalized": "1.0.3.0", "source": { "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", "shasum": "" }, "require": { - "php": ">=8.0.0" + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" }, - "time": "2021-02-03T23:26:27+00:00", + "time": "2023-09-23T14:17:50+00:00", "type": "library", "extra": { "branch-alias": { @@ -1646,7 +2539,7 @@ "installation-source": "dist", "autoload": { "psr-4": { - "Psr\\Cache\\": "src/" + "Psr\\Http\\Client\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1659,46 +2552,49 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common interface for caching libraries", + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", "keywords": [ - "cache", + "http", + "http-client", "psr", - "psr-6" + "psr-18" ], "support": { - "source": "https://github.com/php-fig/cache/tree/3.0.0" + "source": "https://github.com/php-fig/http-client" }, - "install-path": "../psr/cache" + "install-path": "../psr/http-client" }, { - "name": "psr/log", - "version": "3.0.0", - "version_normalized": "3.0.0.0", + "name": "psr/http-factory", + "version": "1.0.2", + "version_normalized": "1.0.2.0", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + "url": "https://github.com/php-fig/http-factory.git", + "reference": "e616d01114759c4c489f93b099585439f795fe35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", + "reference": "e616d01114759c4c489f93b099585439f795fe35", "shasum": "" }, "require": { - "php": ">=8.0.0" + "php": ">=7.0.0", + "psr/http-message": "^1.0 || ^2.0" }, - "time": "2021-07-14T16:46:02+00:00", + "time": "2023-04-10T20:10:41+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "1.0.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Psr\\Log\\": "src" + "Psr\\Http\\Message\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1711,51 +2607,211 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "Common interfaces for PSR-7 HTTP message factories", "keywords": [ - "log", + "factory", + "http", + "message", "psr", - "psr-3" + "psr-17", + "psr-7", + "request", + "response" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" + "source": "https://github.com/php-fig/http-factory/tree/1.0.2" }, - "install-path": "../psr/log" + "install-path": "../psr/http-factory" }, { - "name": "sebastian/cli-parser", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "name": "psr/http-message", + "version": "2.0", + "version_normalized": "2.0.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", "shasum": "" }, "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" + "php": "^7.2 || ^8.0" }, - "time": "2020-09-28T06:08:49+00:00", + "time": "2023-04-04T09:54:51+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0.x-dev" } }, "installation-source": "dist", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "install-path": "../psr/http-message" + }, + { + "name": "psr/log", + "version": "3.0.0", + "version_normalized": "3.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "time": "2021-07-14T16:46:02+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.0" + }, + "install-path": "../psr/log" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "version_normalized": "3.0.3.0", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "time": "2019-03-08T08:55:37+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "install-path": "../ralouphie/getallheaders" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "time": "2020-09-28T06:08:49+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2813,6 +3869,412 @@ }, "install-path": "../spomky-labs/otphp" }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.0.2", + "version_normalized": "3.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "shasum": "" + }, + "require": { + "php": ">=8.0.2" + }, + "time": "2022-01-02T09:55:41+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/deprecation-contracts" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.28.0", + "version_normalized": "1.28.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "42292d99c55abe617799667f454222c54c60e229" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "time": "2023-07-28T09:04:16+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-mbstring" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.28.0", + "version_normalized": "1.28.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2023-01-26T09:26:14+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php80" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.28.0", + "version_normalized": "1.28.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2023-01-26T09:26:14+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php81" + }, + { + "name": "symfony/polyfill-php82", + "version": "v1.28.0", + "version_normalized": "1.28.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php82.git", + "reference": "7716bea9c86776fb3362d6b52fe1fc9471056a49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php82/zipball/7716bea9c86776fb3362d6b52fe1fc9471056a49", + "reference": "7716bea9c86776fb3362d6b52fe1fc9471056a49", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2023-08-25T17:27:25+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php82\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php82/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php82" + }, { "name": "thecodingmachine/safe", "version": "v2.2.2", diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index cec06e2b7..627ad010d 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,448 +1,654 @@ - - array ( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'aliases' => - array ( + array( + 'name' => '__root__', + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => '45a9ff0c88cbd33892ff16ab837e9059937d656e', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev' => true, + ), + 'versions' => array( + '__root__' => array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => '45a9ff0c88cbd33892ff16ab837e9059937d656e', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'beberlei/assert' => array( + 'pretty_version' => 'v3.3.2', + 'version' => '3.3.2.0', + 'reference' => 'cb70015c04be1baee6f5f5c953703347c0ac1655', + 'type' => 'library', + 'install_path' => __DIR__ . '/../beberlei/assert', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'chillerlan/php-qrcode' => array( + 'pretty_version' => '4.3.4', + 'version' => '4.3.4.0', + 'reference' => '2ca4bf5ae048af1981d1023ee42a0a2a9d51e51d', + 'type' => 'library', + 'install_path' => __DIR__ . '/../chillerlan/php-qrcode', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'chillerlan/php-settings-container' => array( + 'pretty_version' => '2.1.4', + 'version' => '2.1.4.0', + 'reference' => '1beb7df3c14346d4344b0b2e12f6f9a74feabd4a', + 'type' => 'library', + 'install_path' => __DIR__ . '/../chillerlan/php-settings-container', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'doctrine/instantiator' => array( + 'pretty_version' => '1.4.1', + 'version' => '1.4.1.0', + 'reference' => '10dcfce151b967d20fde1b34ae6640712c3891bc', + 'type' => 'library', + 'install_path' => __DIR__ . '/../doctrine/instantiator', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'google/protobuf' => array( + 'pretty_version' => 'v3.24.4', + 'version' => '3.24.4.0', + 'reference' => '672d69e25f71b9364fdf1810eb8a8573defdc404', + 'type' => 'library', + 'install_path' => __DIR__ . '/../google/protobuf', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'guzzlehttp/guzzle' => array( + 'pretty_version' => '7.8.0', + 'version' => '7.8.0.0', + 'reference' => '1110f66a6530a40fe7aea0378fe608ee2b2248f9', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'guzzlehttp/promises' => array( + 'pretty_version' => '2.0.1', + 'version' => '2.0.1.0', + 'reference' => '111166291a0f8130081195ac4556a5587d7f1b5d', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/promises', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'guzzlehttp/psr7' => array( + 'pretty_version' => '2.6.1', + 'version' => '2.6.1.0', + 'reference' => 'be45764272e8873c72dbe3d2edcfdfcc3bc9f727', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/psr7', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'j4mie/idiorm' => array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => 'efc8ea06698f53e2c479c7696f2b154c47c3a3cb', + 'type' => 'library', + 'install_path' => __DIR__ . '/../j4mie/idiorm', + 'aliases' => array( + 0 => '9999999-dev', + ), + 'dev_requirement' => false, + ), + 'mervick/material-design-icons' => array( + 'pretty_version' => '2.2.0', + 'version' => '2.2.0.0', + 'reference' => '635435c8d3df3a6da3241648caf8a65d1c07cc1a', + 'type' => 'library', + 'install_path' => __DIR__ . '/../mervick/material-design-icons', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'myclabs/deep-copy' => array( + 'pretty_version' => '1.11.0', + 'version' => '1.11.0.0', + 'reference' => '14daed4296fae74d9e3201d2c4925d1acb7aa614', + 'type' => 'library', + 'install_path' => __DIR__ . '/../myclabs/deep-copy', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'nikic/php-parser' => array( + 'pretty_version' => 'v4.14.0', + 'version' => '4.14.0.0', + 'reference' => '34bea19b6e03d8153165d8f30bba4c3be86184c1', + 'type' => 'library', + 'install_path' => __DIR__ . '/../nikic/php-parser', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'open-telemetry/api' => array( + 'pretty_version' => '1.0.0', + 'version' => '1.0.0.0', + 'reference' => 'd577d732333d38a9a6c16936363ee25f1e3f1c3c', + 'type' => 'library', + 'install_path' => __DIR__ . '/../open-telemetry/api', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'open-telemetry/context' => array( + 'pretty_version' => '1.0.0', + 'version' => '1.0.0.0', + 'reference' => '99f3d54fa9f9ff67421774feeef5e5b1f209ea21', + 'type' => 'library', + 'install_path' => __DIR__ . '/../open-telemetry/context', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'open-telemetry/exporter-otlp' => array( + 'pretty_version' => '1.0.0', + 'version' => '1.0.0.0', + 'reference' => '756092bdff472ea49adb7843c74011606d065b36', + 'type' => 'library', + 'install_path' => __DIR__ . '/../open-telemetry/exporter-otlp', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'open-telemetry/gen-otlp-protobuf' => array( + 'pretty_version' => '1.0.0', + 'version' => '1.0.0.0', + 'reference' => '30fe95f10c2ec1a577f78257c86fbbebe739ca5e', + 'type' => 'library', + 'install_path' => __DIR__ . '/../open-telemetry/gen-otlp-protobuf', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'open-telemetry/sdk' => array( + 'pretty_version' => '1.0.0', + 'version' => '1.0.0.0', + 'reference' => '1c6020b4f1b85fdd647538ee46f6c83360d7c11e', + 'type' => 'library', + 'install_path' => __DIR__ . '/../open-telemetry/sdk', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'open-telemetry/sem-conv' => array( + 'pretty_version' => '1.22.1', + 'version' => '1.22.1.0', + 'reference' => 'e582b874ee89bec544f962db212b3966fe9310a7', + 'type' => 'library', + 'install_path' => __DIR__ . '/../open-telemetry/sem-conv', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'paragonie/constant_time_encoding' => array( + 'pretty_version' => 'v2.6.3', + 'version' => '2.6.3.0', + 'reference' => '58c3f47f650c94ec05a151692652a868995d2938', + 'type' => 'library', + 'install_path' => __DIR__ . '/../paragonie/constant_time_encoding', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'phar-io/manifest' => array( + 'pretty_version' => '2.0.3', + 'version' => '2.0.3.0', + 'reference' => '97803eca37d319dfa7826cc2437fc020857acb53', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phar-io/manifest', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phar-io/version' => array( + 'pretty_version' => '3.2.1', + 'version' => '3.2.1.0', + 'reference' => '4f7fd7836c6f332bb2933569e566a0d6c4cbed74', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phar-io/version', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'php-http/async-client-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '*', + 1 => '1.0', + ), + ), + 'php-http/client-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '*', + 1 => '1.0', + ), + ), + 'php-http/discovery' => array( + 'pretty_version' => '1.19.1', + 'version' => '1.19.1.0', + 'reference' => '57f3de01d32085fea20865f9b16fb0e69347c39e', + 'type' => 'composer-plugin', + 'install_path' => __DIR__ . '/../php-http/discovery', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'php-http/guzzle7-adapter' => array( + 'pretty_version' => '1.0.0', + 'version' => '1.0.0.0', + 'reference' => 'fb075a71dbfa4847cf0c2938c4e5a9c478ef8b01', + 'type' => 'library', + 'install_path' => __DIR__ . '/../php-http/guzzle7-adapter', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'php-http/httplug' => array( + 'pretty_version' => '2.4.0', + 'version' => '2.4.0.0', + 'reference' => '625ad742c360c8ac580fcc647a1541d29e257f67', + 'type' => 'library', + 'install_path' => __DIR__ . '/../php-http/httplug', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'php-http/promise' => array( + 'pretty_version' => '1.1.0', + 'version' => '1.1.0.0', + 'reference' => '4c4c1f9b7289a2ec57cde7f1e9762a5789506f88', + 'type' => 'library', + 'install_path' => __DIR__ . '/../php-http/promise', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'phpdocumentor/reflection-common' => array( + 'pretty_version' => '2.2.0', + 'version' => '2.2.0.0', + 'reference' => '1d01c49d4ed62f25aa84a747ad35d5a16924662b', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpdocumentor/reflection-common', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phpdocumentor/reflection-docblock' => array( + 'pretty_version' => '5.3.0', + 'version' => '5.3.0.0', + 'reference' => '622548b623e81ca6d78b721c5e029f4ce664f170', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpdocumentor/reflection-docblock', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phpdocumentor/type-resolver' => array( + 'pretty_version' => '1.6.1', + 'version' => '1.6.1.0', + 'reference' => '77a32518733312af16a44300404e945338981de3', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpdocumentor/type-resolver', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phpspec/prophecy' => array( + 'pretty_version' => 'v1.15.0', + 'version' => '1.15.0.0', + 'reference' => 'bbcd7380b0ebf3961ee21409db7b38bc31d69a13', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpspec/prophecy', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phpstan/phpstan' => array( + 'pretty_version' => '1.10.3', + 'version' => '1.10.3.0', + 'reference' => '5419375b5891add97dc74be71e6c1c34baaddf64', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpstan/phpstan', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phpunit/php-code-coverage' => array( + 'pretty_version' => '9.2.15', + 'version' => '9.2.15.0', + 'reference' => '2e9da11878c4202f97915c1cb4bb1ca318a63f5f', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpunit/php-code-coverage', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phpunit/php-file-iterator' => array( + 'pretty_version' => '3.0.6', + 'version' => '3.0.6.0', + 'reference' => 'cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpunit/php-file-iterator', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phpunit/php-invoker' => array( + 'pretty_version' => '3.1.1', + 'version' => '3.1.1.0', + 'reference' => '5a10147d0aaf65b58940a0b72f71c9ac0423cc67', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpunit/php-invoker', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phpunit/php-text-template' => array( + 'pretty_version' => '2.0.4', + 'version' => '2.0.4.0', + 'reference' => '5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpunit/php-text-template', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phpunit/php-timer' => array( + 'pretty_version' => '5.0.3', + 'version' => '5.0.3.0', + 'reference' => '5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpunit/php-timer', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phpunit/phpunit' => array( + 'pretty_version' => '9.5.16', + 'version' => '9.5.16.0', + 'reference' => '5ff8c545a50226c569310a35f4fa89d79f1ddfdc', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpunit/phpunit', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'psr/http-client' => array( + 'pretty_version' => '1.0.3', + 'version' => '1.0.3.0', + 'reference' => 'bb5906edc1c324c9a05aa0873d40117941e5fa90', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-client', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/http-client-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '*', + 1 => '1.0', + ), + ), + 'psr/http-factory' => array( + 'pretty_version' => '1.0.2', + 'version' => '1.0.2.0', + 'reference' => 'e616d01114759c4c489f93b099585439f795fe35', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-factory', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/http-factory-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '*', + 1 => '1.0', + ), + ), + 'psr/http-message' => array( + 'pretty_version' => '2.0', + 'version' => '2.0.0.0', + 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-message', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/http-message-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '*', + 1 => '1.0', + ), + ), + 'psr/log' => array( + 'pretty_version' => '3.0.0', + 'version' => '3.0.0.0', + 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/log', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'ralouphie/getallheaders' => array( + 'pretty_version' => '3.0.3', + 'version' => '3.0.3.0', + 'reference' => '120b605dfeb996808c31b6477290a714d356e822', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ralouphie/getallheaders', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'sebastian/cli-parser' => array( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'reference' => '442e7c7e687e42adc03470c7b668bc4b2402c0b2', + 'type' => 'library', + 'install_path' => __DIR__ . '/../sebastian/cli-parser', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'sebastian/code-unit' => array( + 'pretty_version' => '1.0.8', + 'version' => '1.0.8.0', + 'reference' => '1fc9f64c0927627ef78ba436c9b17d967e68e120', + 'type' => 'library', + 'install_path' => __DIR__ . '/../sebastian/code-unit', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'sebastian/code-unit-reverse-lookup' => array( + 'pretty_version' => '2.0.3', + 'version' => '2.0.3.0', + 'reference' => 'ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5', + 'type' => 'library', + 'install_path' => __DIR__ . '/../sebastian/code-unit-reverse-lookup', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'sebastian/comparator' => array( + 'pretty_version' => '4.0.6', + 'version' => '4.0.6.0', + 'reference' => '55f4261989e546dc112258c7a75935a81a7ce382', + 'type' => 'library', + 'install_path' => __DIR__ . '/../sebastian/comparator', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'sebastian/complexity' => array( + 'pretty_version' => '2.0.2', + 'version' => '2.0.2.0', + 'reference' => '739b35e53379900cc9ac327b2147867b8b6efd88', + 'type' => 'library', + 'install_path' => __DIR__ . '/../sebastian/complexity', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'sebastian/diff' => array( + 'pretty_version' => '4.0.4', + 'version' => '4.0.4.0', + 'reference' => '3461e3fccc7cfdfc2720be910d3bd73c69be590d', + 'type' => 'library', + 'install_path' => __DIR__ . '/../sebastian/diff', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'sebastian/environment' => array( + 'pretty_version' => '5.1.4', + 'version' => '5.1.4.0', + 'reference' => '1b5dff7bb151a4db11d49d90e5408e4e938270f7', + 'type' => 'library', + 'install_path' => __DIR__ . '/../sebastian/environment', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'sebastian/exporter' => array( + 'pretty_version' => '4.0.4', + 'version' => '4.0.4.0', + 'reference' => '65e8b7db476c5dd267e65eea9cab77584d3cfff9', + 'type' => 'library', + 'install_path' => __DIR__ . '/../sebastian/exporter', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'sebastian/global-state' => array( + 'pretty_version' => '5.0.5', + 'version' => '5.0.5.0', + 'reference' => '0ca8db5a5fc9c8646244e629625ac486fa286bf2', + 'type' => 'library', + 'install_path' => __DIR__ . '/../sebastian/global-state', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'sebastian/lines-of-code' => array( + 'pretty_version' => '1.0.3', + 'version' => '1.0.3.0', + 'reference' => 'c1c2e997aa3146983ed888ad08b15470a2e22ecc', + 'type' => 'library', + 'install_path' => __DIR__ . '/../sebastian/lines-of-code', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'sebastian/object-enumerator' => array( + 'pretty_version' => '4.0.4', + 'version' => '4.0.4.0', + 'reference' => '5c9eeac41b290a3712d88851518825ad78f45c71', + 'type' => 'library', + 'install_path' => __DIR__ . '/../sebastian/object-enumerator', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'sebastian/object-reflector' => array( + 'pretty_version' => '2.0.4', + 'version' => '2.0.4.0', + 'reference' => 'b4f479ebdbf63ac605d183ece17d8d7fe49c15c7', + 'type' => 'library', + 'install_path' => __DIR__ . '/../sebastian/object-reflector', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'sebastian/recursion-context' => array( + 'pretty_version' => '4.0.4', + 'version' => '4.0.4.0', + 'reference' => 'cd9d8cf3c5804de4341c283ed787f099f5506172', + 'type' => 'library', + 'install_path' => __DIR__ . '/../sebastian/recursion-context', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'sebastian/resource-operations' => array( + 'pretty_version' => '3.0.3', + 'version' => '3.0.3.0', + 'reference' => '0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8', + 'type' => 'library', + 'install_path' => __DIR__ . '/../sebastian/resource-operations', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'sebastian/type' => array( + 'pretty_version' => '2.3.4', + 'version' => '2.3.4.0', + 'reference' => 'b8cd8a1c753c90bc1a0f5372170e3e489136f914', + 'type' => 'library', + 'install_path' => __DIR__ . '/../sebastian/type', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'sebastian/version' => array( + 'pretty_version' => '3.0.2', + 'version' => '3.0.2.0', + 'reference' => 'c6c1022351a901512170118436c764e473f6de8c', + 'type' => 'library', + 'install_path' => __DIR__ . '/../sebastian/version', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'spomky-labs/otphp' => array( + 'pretty_version' => 'v10.0.3', + 'version' => '10.0.3.0', + 'reference' => '9784d9f7c790eed26e102d6c78f12c754036c366', + 'type' => 'library', + 'install_path' => __DIR__ . '/../spomky-labs/otphp', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/deprecation-contracts' => array( + 'pretty_version' => 'v3.0.2', + 'version' => '3.0.2.0', + 'reference' => '26954b3d62a6c5fd0ea8a2a00c0353a14978d05c', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/polyfill-mbstring' => array( + 'pretty_version' => 'v1.28.0', + 'version' => '1.28.0.0', + 'reference' => '42292d99c55abe617799667f454222c54c60e229', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/polyfill-php80' => array( + 'pretty_version' => 'v1.28.0', + 'version' => '1.28.0.0', + 'reference' => '6caa57379c4aec19c0a12a38b59b26487dcfe4b5', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php80', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/polyfill-php81' => array( + 'pretty_version' => 'v1.28.0', + 'version' => '1.28.0.0', + 'reference' => '7581cd600fa9fd681b797d00b02f068e2f13263b', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php81', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/polyfill-php82' => array( + 'pretty_version' => 'v1.28.0', + 'version' => '1.28.0.0', + 'reference' => '7716bea9c86776fb3362d6b52fe1fc9471056a49', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php82', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'thecodingmachine/safe' => array( + 'pretty_version' => 'v2.2.2', + 'version' => '2.2.2.0', + 'reference' => '440284f9592c9df402832452a6871a8b3c48d97e', + 'type' => 'library', + 'install_path' => __DIR__ . '/../thecodingmachine/safe', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'theseer/tokenizer' => array( + 'pretty_version' => '1.2.1', + 'version' => '1.2.1.0', + 'reference' => '34a41e998c2183e22995f158c581e7b5e755ab9e', + 'type' => 'library', + 'install_path' => __DIR__ . '/../theseer/tokenizer', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'webmozart/assert' => array( + 'pretty_version' => '1.11.0', + 'version' => '1.11.0.0', + 'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991', + 'type' => 'library', + 'install_path' => __DIR__ . '/../webmozart/assert', + 'aliases' => array(), + 'dev_requirement' => true, + ), ), - 'reference' => 'a37eab2610a0a2bcb655258781c1c7e925dc94c0', - 'name' => '__root__', - ), - 'versions' => - array ( - '__root__' => - array ( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'aliases' => - array ( - ), - 'reference' => 'a37eab2610a0a2bcb655258781c1c7e925dc94c0', - ), - 'beberlei/assert' => - array ( - 'pretty_version' => 'v3.3.2', - 'version' => '3.3.2.0', - 'aliases' => - array ( - ), - 'reference' => 'cb70015c04be1baee6f5f5c953703347c0ac1655', - ), - 'chillerlan/php-qrcode' => - array ( - 'pretty_version' => '4.3.4', - 'version' => '4.3.4.0', - 'aliases' => - array ( - ), - 'reference' => '2ca4bf5ae048af1981d1023ee42a0a2a9d51e51d', - ), - 'chillerlan/php-settings-container' => - array ( - 'pretty_version' => '2.1.4', - 'version' => '2.1.4.0', - 'aliases' => - array ( - ), - 'reference' => '1beb7df3c14346d4344b0b2e12f6f9a74feabd4a', - ), - 'doctrine/instantiator' => - array ( - 'pretty_version' => '1.4.1', - 'version' => '1.4.1.0', - 'aliases' => - array ( - ), - 'reference' => '10dcfce151b967d20fde1b34ae6640712c3891bc', - ), - 'j4mie/idiorm' => - array ( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'aliases' => - array ( - 0 => '9999999-dev', - ), - 'reference' => 'efc8ea06698f53e2c479c7696f2b154c47c3a3cb', - ), - 'jonahgeorge/jaeger-client-php' => - array ( - 'pretty_version' => 'v1.4.4', - 'version' => '1.4.4.0', - 'aliases' => - array ( - ), - 'reference' => '3173d9c68ad8cea16058f25337982b00cc3d1c2b', - ), - 'mervick/material-design-icons' => - array ( - 'pretty_version' => '2.2.0', - 'version' => '2.2.0.0', - 'aliases' => - array ( - ), - 'reference' => '635435c8d3df3a6da3241648caf8a65d1c07cc1a', - ), - 'myclabs/deep-copy' => - array ( - 'pretty_version' => '1.11.0', - 'version' => '1.11.0.0', - 'aliases' => - array ( - ), - 'reference' => '14daed4296fae74d9e3201d2c4925d1acb7aa614', - ), - 'nikic/php-parser' => - array ( - 'pretty_version' => 'v4.14.0', - 'version' => '4.14.0.0', - 'aliases' => - array ( - ), - 'reference' => '34bea19b6e03d8153165d8f30bba4c3be86184c1', - ), - 'opentracing/opentracing' => - array ( - 'pretty_version' => '1.0.2', - 'version' => '1.0.2.0', - 'aliases' => - array ( - ), - 'reference' => 'cd60bd1fb2a25280600bc74c7f9e0c13881a9116', - ), - 'packaged/thrift' => - array ( - 'pretty_version' => '0.13.01', - 'version' => '0.13.01.0', - 'aliases' => - array ( - ), - 'reference' => 'e3dbcfb79e319971d64264ffe9c340590cc8a228', - ), - 'paragonie/constant_time_encoding' => - array ( - 'pretty_version' => 'v2.6.3', - 'version' => '2.6.3.0', - 'aliases' => - array ( - ), - 'reference' => '58c3f47f650c94ec05a151692652a868995d2938', - ), - 'phar-io/manifest' => - array ( - 'pretty_version' => '2.0.3', - 'version' => '2.0.3.0', - 'aliases' => - array ( - ), - 'reference' => '97803eca37d319dfa7826cc2437fc020857acb53', - ), - 'phar-io/version' => - array ( - 'pretty_version' => '3.2.1', - 'version' => '3.2.1.0', - 'aliases' => - array ( - ), - 'reference' => '4f7fd7836c6f332bb2933569e566a0d6c4cbed74', - ), - 'phpdocumentor/reflection-common' => - array ( - 'pretty_version' => '2.2.0', - 'version' => '2.2.0.0', - 'aliases' => - array ( - ), - 'reference' => '1d01c49d4ed62f25aa84a747ad35d5a16924662b', - ), - 'phpdocumentor/reflection-docblock' => - array ( - 'pretty_version' => '5.3.0', - 'version' => '5.3.0.0', - 'aliases' => - array ( - ), - 'reference' => '622548b623e81ca6d78b721c5e029f4ce664f170', - ), - 'phpdocumentor/type-resolver' => - array ( - 'pretty_version' => '1.6.1', - 'version' => '1.6.1.0', - 'aliases' => - array ( - ), - 'reference' => '77a32518733312af16a44300404e945338981de3', - ), - 'phpspec/prophecy' => - array ( - 'pretty_version' => 'v1.15.0', - 'version' => '1.15.0.0', - 'aliases' => - array ( - ), - 'reference' => 'bbcd7380b0ebf3961ee21409db7b38bc31d69a13', - ), - 'phpstan/phpstan' => - array ( - 'pretty_version' => '1.10.3', - 'version' => '1.10.3.0', - 'aliases' => - array ( - ), - 'reference' => '5419375b5891add97dc74be71e6c1c34baaddf64', - ), - 'phpunit/php-code-coverage' => - array ( - 'pretty_version' => '9.2.15', - 'version' => '9.2.15.0', - 'aliases' => - array ( - ), - 'reference' => '2e9da11878c4202f97915c1cb4bb1ca318a63f5f', - ), - 'phpunit/php-file-iterator' => - array ( - 'pretty_version' => '3.0.6', - 'version' => '3.0.6.0', - 'aliases' => - array ( - ), - 'reference' => 'cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf', - ), - 'phpunit/php-invoker' => - array ( - 'pretty_version' => '3.1.1', - 'version' => '3.1.1.0', - 'aliases' => - array ( - ), - 'reference' => '5a10147d0aaf65b58940a0b72f71c9ac0423cc67', - ), - 'phpunit/php-text-template' => - array ( - 'pretty_version' => '2.0.4', - 'version' => '2.0.4.0', - 'aliases' => - array ( - ), - 'reference' => '5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28', - ), - 'phpunit/php-timer' => - array ( - 'pretty_version' => '5.0.3', - 'version' => '5.0.3.0', - 'aliases' => - array ( - ), - 'reference' => '5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2', - ), - 'phpunit/phpunit' => - array ( - 'pretty_version' => '9.5.16', - 'version' => '9.5.16.0', - 'aliases' => - array ( - ), - 'reference' => '5ff8c545a50226c569310a35f4fa89d79f1ddfdc', - ), - 'psr/cache' => - array ( - 'pretty_version' => '3.0.0', - 'version' => '3.0.0.0', - 'aliases' => - array ( - ), - 'reference' => 'aa5030cfa5405eccfdcb1083ce040c2cb8d253bf', - ), - 'psr/log' => - array ( - 'pretty_version' => '3.0.0', - 'version' => '3.0.0.0', - 'aliases' => - array ( - ), - 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', - ), - 'sebastian/cli-parser' => - array ( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'aliases' => - array ( - ), - 'reference' => '442e7c7e687e42adc03470c7b668bc4b2402c0b2', - ), - 'sebastian/code-unit' => - array ( - 'pretty_version' => '1.0.8', - 'version' => '1.0.8.0', - 'aliases' => - array ( - ), - 'reference' => '1fc9f64c0927627ef78ba436c9b17d967e68e120', - ), - 'sebastian/code-unit-reverse-lookup' => - array ( - 'pretty_version' => '2.0.3', - 'version' => '2.0.3.0', - 'aliases' => - array ( - ), - 'reference' => 'ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5', - ), - 'sebastian/comparator' => - array ( - 'pretty_version' => '4.0.6', - 'version' => '4.0.6.0', - 'aliases' => - array ( - ), - 'reference' => '55f4261989e546dc112258c7a75935a81a7ce382', - ), - 'sebastian/complexity' => - array ( - 'pretty_version' => '2.0.2', - 'version' => '2.0.2.0', - 'aliases' => - array ( - ), - 'reference' => '739b35e53379900cc9ac327b2147867b8b6efd88', - ), - 'sebastian/diff' => - array ( - 'pretty_version' => '4.0.4', - 'version' => '4.0.4.0', - 'aliases' => - array ( - ), - 'reference' => '3461e3fccc7cfdfc2720be910d3bd73c69be590d', - ), - 'sebastian/environment' => - array ( - 'pretty_version' => '5.1.4', - 'version' => '5.1.4.0', - 'aliases' => - array ( - ), - 'reference' => '1b5dff7bb151a4db11d49d90e5408e4e938270f7', - ), - 'sebastian/exporter' => - array ( - 'pretty_version' => '4.0.4', - 'version' => '4.0.4.0', - 'aliases' => - array ( - ), - 'reference' => '65e8b7db476c5dd267e65eea9cab77584d3cfff9', - ), - 'sebastian/global-state' => - array ( - 'pretty_version' => '5.0.5', - 'version' => '5.0.5.0', - 'aliases' => - array ( - ), - 'reference' => '0ca8db5a5fc9c8646244e629625ac486fa286bf2', - ), - 'sebastian/lines-of-code' => - array ( - 'pretty_version' => '1.0.3', - 'version' => '1.0.3.0', - 'aliases' => - array ( - ), - 'reference' => 'c1c2e997aa3146983ed888ad08b15470a2e22ecc', - ), - 'sebastian/object-enumerator' => - array ( - 'pretty_version' => '4.0.4', - 'version' => '4.0.4.0', - 'aliases' => - array ( - ), - 'reference' => '5c9eeac41b290a3712d88851518825ad78f45c71', - ), - 'sebastian/object-reflector' => - array ( - 'pretty_version' => '2.0.4', - 'version' => '2.0.4.0', - 'aliases' => - array ( - ), - 'reference' => 'b4f479ebdbf63ac605d183ece17d8d7fe49c15c7', - ), - 'sebastian/recursion-context' => - array ( - 'pretty_version' => '4.0.4', - 'version' => '4.0.4.0', - 'aliases' => - array ( - ), - 'reference' => 'cd9d8cf3c5804de4341c283ed787f099f5506172', - ), - 'sebastian/resource-operations' => - array ( - 'pretty_version' => '3.0.3', - 'version' => '3.0.3.0', - 'aliases' => - array ( - ), - 'reference' => '0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8', - ), - 'sebastian/type' => - array ( - 'pretty_version' => '2.3.4', - 'version' => '2.3.4.0', - 'aliases' => - array ( - ), - 'reference' => 'b8cd8a1c753c90bc1a0f5372170e3e489136f914', - ), - 'sebastian/version' => - array ( - 'pretty_version' => '3.0.2', - 'version' => '3.0.2.0', - 'aliases' => - array ( - ), - 'reference' => 'c6c1022351a901512170118436c764e473f6de8c', - ), - 'spomky-labs/otphp' => - array ( - 'pretty_version' => 'v10.0.3', - 'version' => '10.0.3.0', - 'aliases' => - array ( - ), - 'reference' => '9784d9f7c790eed26e102d6c78f12c754036c366', - ), - 'thecodingmachine/safe' => - array ( - 'pretty_version' => 'v2.2.2', - 'version' => '2.2.2.0', - 'aliases' => - array ( - ), - 'reference' => '440284f9592c9df402832452a6871a8b3c48d97e', - ), - 'theseer/tokenizer' => - array ( - 'pretty_version' => '1.2.1', - 'version' => '1.2.1.0', - 'aliases' => - array ( - ), - 'reference' => '34a41e998c2183e22995f158c581e7b5e755ab9e', - ), - 'webmozart/assert' => - array ( - 'pretty_version' => '1.11.0', - 'version' => '1.11.0.0', - 'aliases' => - array ( - ), - 'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991', - ), - ), ); diff --git a/vendor/google/protobuf/LICENSE b/vendor/google/protobuf/LICENSE new file mode 100644 index 000000000..ba32af4c2 --- /dev/null +++ b/vendor/google/protobuf/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2019, Protocol Buffers +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/google/protobuf/README.md b/vendor/google/protobuf/README.md new file mode 100644 index 000000000..3663050d4 --- /dev/null +++ b/vendor/google/protobuf/README.md @@ -0,0 +1,2 @@ +# protobuf-php +This repository contains only PHP files to support Composer installation. This repository is a mirror of [protobuf](https://github.com/protocolbuffers/protobuf). Any support requests, bug reports, or development contributions should be directed to that project. To install protobuf for PHP, please see https://github.com/protocolbuffers/protobuf/tree/master/php diff --git a/vendor/google/protobuf/composer.json b/vendor/google/protobuf/composer.json new file mode 100644 index 000000000..70af0a033 --- /dev/null +++ b/vendor/google/protobuf/composer.json @@ -0,0 +1,23 @@ +{ + "name": "google/protobuf", + "type": "library", + "description": "proto library for PHP", + "keywords": ["proto"], + "homepage": "https://developers.google.com/protocol-buffers/", + "license": "BSD-3-Clause", + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": ">=5.0.0" + }, + "suggest": { + "ext-bcmath": "Need to support JSON deserialization" + }, + "autoload": { + "psr-4": { + "Google\\Protobuf\\": "src/Google/Protobuf", + "GPBMetadata\\Google\\Protobuf\\": "src/GPBMetadata/Google/Protobuf" + } + } +} diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Any.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Any.php new file mode 100644 index 000000000..fbce4bfdb --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Any.php @@ -0,0 +1,30 @@ +internalAddGeneratedFile( + ' +Ô +google/protobuf/any.protogoogle.protobuf"& +Any +type_url (  +value ( Bv +com.google.protobufBAnyProtoPZ,google.golang.org/protobuf/types/known/anypb¢GPBªGoogle.Protobuf.WellKnownTypesbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Api.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Api.php new file mode 100644 index 000000000..75e0ec631 --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Api.php @@ -0,0 +1,48 @@ +internalAddGeneratedFile( + ' +É +google/protobuf/api.protogoogle.protobufgoogle/protobuf/type.proto" +Api +name ( ( +methods ( 2.google.protobuf.Method( +options ( 2.google.protobuf.Option +version ( 6 +source_context ( 2.google.protobuf.SourceContext& +mixins ( 2.google.protobuf.Mixin\' +syntax (2.google.protobuf.Syntax"Õ +Method +name (  +request_type_url (  +request_streaming ( +response_type_url (  +response_streaming (( +options ( 2.google.protobuf.Option\' +syntax (2.google.protobuf.Syntax"# +Mixin +name (  +root ( Bv +com.google.protobufBApiProtoPZ,google.golang.org/protobuf/types/known/apipb¢GPBªGoogle.Protobuf.WellKnownTypesbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Duration.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Duration.php new file mode 100644 index 000000000..5d8023e4d --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Duration.php @@ -0,0 +1,30 @@ +internalAddGeneratedFile( + ' +ë +google/protobuf/duration.protogoogle.protobuf"* +Duration +seconds ( +nanos (Bƒ +com.google.protobufB DurationProtoPZ1google.golang.org/protobuf/types/known/durationpbø¢GPBªGoogle.Protobuf.WellKnownTypesbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/FieldMask.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/FieldMask.php new file mode 100644 index 000000000..f31bcc001 --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/FieldMask.php @@ -0,0 +1,29 @@ +internalAddGeneratedFile( + ' +ß + google/protobuf/field_mask.protogoogle.protobuf" + FieldMask +paths ( B… +com.google.protobufBFieldMaskProtoPZ2google.golang.org/protobuf/types/known/fieldmaskpbø¢GPBªGoogle.Protobuf.WellKnownTypesbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/GPBEmpty.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/GPBEmpty.php new file mode 100644 index 000000000..5e42536f2 --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/GPBEmpty.php @@ -0,0 +1,29 @@ +internalAddGeneratedFile( + ' +¾ +google/protobuf/empty.protogoogle.protobuf" +EmptyB} +com.google.protobufB +EmptyProtoPZ.google.golang.org/protobuf/types/known/emptypbø¢GPBªGoogle.Protobuf.WellKnownTypesbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php new file mode 100644 index 000000000..4247c0954 --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php @@ -0,0 +1,282 @@ +addMessage('google.protobuf.internal.FileDescriptorSet', \Google\Protobuf\Internal\FileDescriptorSet::class) + ->repeated('file', \Google\Protobuf\Internal\GPBType::MESSAGE, 1, 'google.protobuf.internal.FileDescriptorProto') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.FileDescriptorProto', \Google\Protobuf\Internal\FileDescriptorProto::class) + ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->optional('package', \Google\Protobuf\Internal\GPBType::STRING, 2) + ->repeated('dependency', \Google\Protobuf\Internal\GPBType::STRING, 3) + ->repeated('public_dependency', \Google\Protobuf\Internal\GPBType::INT32, 10) + ->repeated('weak_dependency', \Google\Protobuf\Internal\GPBType::INT32, 11) + ->repeated('message_type', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.DescriptorProto') + ->repeated('enum_type', \Google\Protobuf\Internal\GPBType::MESSAGE, 5, 'google.protobuf.internal.EnumDescriptorProto') + ->repeated('service', \Google\Protobuf\Internal\GPBType::MESSAGE, 6, 'google.protobuf.internal.ServiceDescriptorProto') + ->repeated('extension', \Google\Protobuf\Internal\GPBType::MESSAGE, 7, 'google.protobuf.internal.FieldDescriptorProto') + ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 8, 'google.protobuf.internal.FileOptions') + ->optional('source_code_info', \Google\Protobuf\Internal\GPBType::MESSAGE, 9, 'google.protobuf.internal.SourceCodeInfo') + ->optional('syntax', \Google\Protobuf\Internal\GPBType::STRING, 12) + ->optional('edition', \Google\Protobuf\Internal\GPBType::STRING, 13) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.DescriptorProto', \Google\Protobuf\Internal\DescriptorProto::class) + ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->repeated('field', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.FieldDescriptorProto') + ->repeated('extension', \Google\Protobuf\Internal\GPBType::MESSAGE, 6, 'google.protobuf.internal.FieldDescriptorProto') + ->repeated('nested_type', \Google\Protobuf\Internal\GPBType::MESSAGE, 3, 'google.protobuf.internal.DescriptorProto') + ->repeated('enum_type', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.EnumDescriptorProto') + ->repeated('extension_range', \Google\Protobuf\Internal\GPBType::MESSAGE, 5, 'google.protobuf.internal.DescriptorProto.ExtensionRange') + ->repeated('oneof_decl', \Google\Protobuf\Internal\GPBType::MESSAGE, 8, 'google.protobuf.internal.OneofDescriptorProto') + ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 7, 'google.protobuf.internal.MessageOptions') + ->repeated('reserved_range', \Google\Protobuf\Internal\GPBType::MESSAGE, 9, 'google.protobuf.internal.DescriptorProto.ReservedRange') + ->repeated('reserved_name', \Google\Protobuf\Internal\GPBType::STRING, 10) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.DescriptorProto.ExtensionRange', \Google\Protobuf\Internal\DescriptorProto\ExtensionRange::class) + ->optional('start', \Google\Protobuf\Internal\GPBType::INT32, 1) + ->optional('end', \Google\Protobuf\Internal\GPBType::INT32, 2) + ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 3, 'google.protobuf.internal.ExtensionRangeOptions') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.DescriptorProto.ReservedRange', \Google\Protobuf\Internal\DescriptorProto\ReservedRange::class) + ->optional('start', \Google\Protobuf\Internal\GPBType::INT32, 1) + ->optional('end', \Google\Protobuf\Internal\GPBType::INT32, 2) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.ExtensionRangeOptions', \Google\Protobuf\Internal\ExtensionRangeOptions::class) + ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.FieldDescriptorProto', \Google\Protobuf\Internal\FieldDescriptorProto::class) + ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->optional('number', \Google\Protobuf\Internal\GPBType::INT32, 3) + ->optional('label', \Google\Protobuf\Internal\GPBType::ENUM, 4, 'google.protobuf.internal.FieldDescriptorProto.Label') + ->optional('type', \Google\Protobuf\Internal\GPBType::ENUM, 5, 'google.protobuf.internal.FieldDescriptorProto.Type') + ->optional('type_name', \Google\Protobuf\Internal\GPBType::STRING, 6) + ->optional('extendee', \Google\Protobuf\Internal\GPBType::STRING, 2) + ->optional('default_value', \Google\Protobuf\Internal\GPBType::STRING, 7) + ->optional('oneof_index', \Google\Protobuf\Internal\GPBType::INT32, 9) + ->optional('json_name', \Google\Protobuf\Internal\GPBType::STRING, 10) + ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 8, 'google.protobuf.internal.FieldOptions') + ->optional('proto3_optional', \Google\Protobuf\Internal\GPBType::BOOL, 17) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FieldDescriptorProto.Type', \Google\Protobuf\Internal\Type::class) + ->value("TYPE_DOUBLE", 1) + ->value("TYPE_FLOAT", 2) + ->value("TYPE_INT64", 3) + ->value("TYPE_UINT64", 4) + ->value("TYPE_INT32", 5) + ->value("TYPE_FIXED64", 6) + ->value("TYPE_FIXED32", 7) + ->value("TYPE_BOOL", 8) + ->value("TYPE_STRING", 9) + ->value("TYPE_GROUP", 10) + ->value("TYPE_MESSAGE", 11) + ->value("TYPE_BYTES", 12) + ->value("TYPE_UINT32", 13) + ->value("TYPE_ENUM", 14) + ->value("TYPE_SFIXED32", 15) + ->value("TYPE_SFIXED64", 16) + ->value("TYPE_SINT32", 17) + ->value("TYPE_SINT64", 18) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FieldDescriptorProto.Label', \Google\Protobuf\Internal\Label::class) + ->value("LABEL_OPTIONAL", 1) + ->value("LABEL_REQUIRED", 2) + ->value("LABEL_REPEATED", 3) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.OneofDescriptorProto', \Google\Protobuf\Internal\OneofDescriptorProto::class) + ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.OneofOptions') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.EnumDescriptorProto', \Google\Protobuf\Internal\EnumDescriptorProto::class) + ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->repeated('value', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.EnumValueDescriptorProto') + ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 3, 'google.protobuf.internal.EnumOptions') + ->repeated('reserved_range', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.EnumDescriptorProto.EnumReservedRange') + ->repeated('reserved_name', \Google\Protobuf\Internal\GPBType::STRING, 5) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.EnumDescriptorProto.EnumReservedRange', \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange::class) + ->optional('start', \Google\Protobuf\Internal\GPBType::INT32, 1) + ->optional('end', \Google\Protobuf\Internal\GPBType::INT32, 2) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.EnumValueDescriptorProto', \Google\Protobuf\Internal\EnumValueDescriptorProto::class) + ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->optional('number', \Google\Protobuf\Internal\GPBType::INT32, 2) + ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 3, 'google.protobuf.internal.EnumValueOptions') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.ServiceDescriptorProto', \Google\Protobuf\Internal\ServiceDescriptorProto::class) + ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->repeated('method', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.MethodDescriptorProto') + ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 3, 'google.protobuf.internal.ServiceOptions') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.MethodDescriptorProto', \Google\Protobuf\Internal\MethodDescriptorProto::class) + ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->optional('input_type', \Google\Protobuf\Internal\GPBType::STRING, 2) + ->optional('output_type', \Google\Protobuf\Internal\GPBType::STRING, 3) + ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.MethodOptions') + ->optional('client_streaming', \Google\Protobuf\Internal\GPBType::BOOL, 5) + ->optional('server_streaming', \Google\Protobuf\Internal\GPBType::BOOL, 6) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.FileOptions', \Google\Protobuf\Internal\FileOptions::class) + ->optional('java_package', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->optional('java_outer_classname', \Google\Protobuf\Internal\GPBType::STRING, 8) + ->optional('java_multiple_files', \Google\Protobuf\Internal\GPBType::BOOL, 10) + ->optional('java_generate_equals_and_hash', \Google\Protobuf\Internal\GPBType::BOOL, 20) + ->optional('java_string_check_utf8', \Google\Protobuf\Internal\GPBType::BOOL, 27) + ->optional('optimize_for', \Google\Protobuf\Internal\GPBType::ENUM, 9, 'google.protobuf.internal.FileOptions.OptimizeMode') + ->optional('go_package', \Google\Protobuf\Internal\GPBType::STRING, 11) + ->optional('cc_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 16) + ->optional('java_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 17) + ->optional('py_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 18) + ->optional('php_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 42) + ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 23) + ->optional('cc_enable_arenas', \Google\Protobuf\Internal\GPBType::BOOL, 31) + ->optional('objc_class_prefix', \Google\Protobuf\Internal\GPBType::STRING, 36) + ->optional('csharp_namespace', \Google\Protobuf\Internal\GPBType::STRING, 37) + ->optional('swift_prefix', \Google\Protobuf\Internal\GPBType::STRING, 39) + ->optional('php_class_prefix', \Google\Protobuf\Internal\GPBType::STRING, 40) + ->optional('php_namespace', \Google\Protobuf\Internal\GPBType::STRING, 41) + ->optional('php_metadata_namespace', \Google\Protobuf\Internal\GPBType::STRING, 44) + ->optional('ruby_package', \Google\Protobuf\Internal\GPBType::STRING, 45) + ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FileOptions.OptimizeMode', \Google\Protobuf\Internal\OptimizeMode::class) + ->value("SPEED", 1) + ->value("CODE_SIZE", 2) + ->value("LITE_RUNTIME", 3) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.MessageOptions', \Google\Protobuf\Internal\MessageOptions::class) + ->optional('message_set_wire_format', \Google\Protobuf\Internal\GPBType::BOOL, 1) + ->optional('no_standard_descriptor_accessor', \Google\Protobuf\Internal\GPBType::BOOL, 2) + ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 3) + ->optional('map_entry', \Google\Protobuf\Internal\GPBType::BOOL, 7) + ->optional('deprecated_legacy_json_field_conflicts', \Google\Protobuf\Internal\GPBType::BOOL, 11) + ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.FieldOptions', \Google\Protobuf\Internal\FieldOptions::class) + ->optional('ctype', \Google\Protobuf\Internal\GPBType::ENUM, 1, 'google.protobuf.internal.FieldOptions.CType') + ->optional('packed', \Google\Protobuf\Internal\GPBType::BOOL, 2) + ->optional('jstype', \Google\Protobuf\Internal\GPBType::ENUM, 6, 'google.protobuf.internal.FieldOptions.JSType') + ->optional('lazy', \Google\Protobuf\Internal\GPBType::BOOL, 5) + ->optional('unverified_lazy', \Google\Protobuf\Internal\GPBType::BOOL, 15) + ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 3) + ->optional('weak', \Google\Protobuf\Internal\GPBType::BOOL, 10) + ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FieldOptions.CType', \Google\Protobuf\Internal\CType::class) + ->value("STRING", 0) + ->value("CORD", 1) + ->value("STRING_PIECE", 2) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FieldOptions.JSType', \Google\Protobuf\Internal\JSType::class) + ->value("JS_NORMAL", 0) + ->value("JS_STRING", 1) + ->value("JS_NUMBER", 2) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.OneofOptions', \Google\Protobuf\Internal\OneofOptions::class) + ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.EnumOptions', \Google\Protobuf\Internal\EnumOptions::class) + ->optional('allow_alias', \Google\Protobuf\Internal\GPBType::BOOL, 2) + ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 3) + ->optional('deprecated_legacy_json_field_conflicts', \Google\Protobuf\Internal\GPBType::BOOL, 6) + ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.EnumValueOptions', \Google\Protobuf\Internal\EnumValueOptions::class) + ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 1) + ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.ServiceOptions', \Google\Protobuf\Internal\ServiceOptions::class) + ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 33) + ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.MethodOptions', \Google\Protobuf\Internal\MethodOptions::class) + ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 33) + ->optional('idempotency_level', \Google\Protobuf\Internal\GPBType::ENUM, 34, 'google.protobuf.internal.MethodOptions.IdempotencyLevel') + ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.MethodOptions.IdempotencyLevel', \Google\Protobuf\Internal\IdempotencyLevel::class) + ->value("IDEMPOTENCY_UNKNOWN", 0) + ->value("NO_SIDE_EFFECTS", 1) + ->value("IDEMPOTENT", 2) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.UninterpretedOption', \Google\Protobuf\Internal\UninterpretedOption::class) + ->repeated('name', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.UninterpretedOption.NamePart') + ->optional('identifier_value', \Google\Protobuf\Internal\GPBType::STRING, 3) + ->optional('positive_int_value', \Google\Protobuf\Internal\GPBType::UINT64, 4) + ->optional('negative_int_value', \Google\Protobuf\Internal\GPBType::INT64, 5) + ->optional('double_value', \Google\Protobuf\Internal\GPBType::DOUBLE, 6) + ->optional('string_value', \Google\Protobuf\Internal\GPBType::BYTES, 7) + ->optional('aggregate_value', \Google\Protobuf\Internal\GPBType::STRING, 8) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.UninterpretedOption.NamePart', \Google\Protobuf\Internal\UninterpretedOption\NamePart::class) + ->required('name_part', \Google\Protobuf\Internal\GPBType::STRING, 1) + ->required('is_extension', \Google\Protobuf\Internal\GPBType::BOOL, 2) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.SourceCodeInfo', \Google\Protobuf\Internal\SourceCodeInfo::class) + ->repeated('location', \Google\Protobuf\Internal\GPBType::MESSAGE, 1, 'google.protobuf.internal.SourceCodeInfo.Location') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.SourceCodeInfo.Location', \Google\Protobuf\Internal\SourceCodeInfo\Location::class) + ->repeated('path', \Google\Protobuf\Internal\GPBType::INT32, 1) + ->repeated('span', \Google\Protobuf\Internal\GPBType::INT32, 2) + ->optional('leading_comments', \Google\Protobuf\Internal\GPBType::STRING, 3) + ->optional('trailing_comments', \Google\Protobuf\Internal\GPBType::STRING, 4) + ->repeated('leading_detached_comments', \Google\Protobuf\Internal\GPBType::STRING, 6) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.GeneratedCodeInfo', \Google\Protobuf\Internal\GeneratedCodeInfo::class) + ->repeated('annotation', \Google\Protobuf\Internal\GPBType::MESSAGE, 1, 'google.protobuf.internal.GeneratedCodeInfo.Annotation') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.GeneratedCodeInfo.Annotation', \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation::class) + ->repeated('path', \Google\Protobuf\Internal\GPBType::INT32, 1) + ->optional('source_file', \Google\Protobuf\Internal\GPBType::STRING, 2) + ->optional('begin', \Google\Protobuf\Internal\GPBType::INT32, 3) + ->optional('end', \Google\Protobuf\Internal\GPBType::INT32, 4) + ->finalizeToPool(); + + $pool->finish(); + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/SourceContext.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/SourceContext.php new file mode 100644 index 000000000..797732d9f --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/SourceContext.php @@ -0,0 +1,29 @@ +internalAddGeneratedFile( + ' +ð +$google/protobuf/source_context.protogoogle.protobuf"" + SourceContext + file_name ( BŠ +com.google.protobufBSourceContextProtoPZ6google.golang.org/protobuf/types/known/sourcecontextpb¢GPBªGoogle.Protobuf.WellKnownTypesbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Struct.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Struct.php new file mode 100644 index 000000000..888a81ade Binary files /dev/null and b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Struct.php differ diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Timestamp.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Timestamp.php new file mode 100644 index 000000000..09437271a --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Timestamp.php @@ -0,0 +1,30 @@ +internalAddGeneratedFile( + ' +ï +google/protobuf/timestamp.protogoogle.protobuf"+ + Timestamp +seconds ( +nanos (B… +com.google.protobufBTimestampProtoPZ2google.golang.org/protobuf/types/known/timestamppbø¢GPBªGoogle.Protobuf.WellKnownTypesbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Type.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Type.php new file mode 100644 index 000000000..7d0bfbb53 Binary files /dev/null and b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Type.php differ diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Wrappers.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Wrappers.php new file mode 100644 index 000000000..e7ea1a3b9 --- /dev/null +++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Wrappers.php @@ -0,0 +1,49 @@ +internalAddGeneratedFile( + ' +Ç +google/protobuf/wrappers.protogoogle.protobuf" + DoubleValue +value (" + +FloatValue +value (" + +Int64Value +value (" + UInt64Value +value (" + +Int32Value +value (" + UInt32Value +value ( " + BoolValue +value (" + StringValue +value ( " + +BytesValue +value ( Bƒ +com.google.protobufB WrappersProtoPZ1google.golang.org/protobuf/types/known/wrapperspbø¢GPBªGoogle.Protobuf.WellKnownTypesbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Any.php b/vendor/google/protobuf/src/Google/Protobuf/Any.php new file mode 100644 index 000000000..feea41aad --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Any.php @@ -0,0 +1,257 @@ +, + * "lastName": + * } + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + * + * Generated from protobuf message google.protobuf.Any + */ +class Any extends \Google\Protobuf\Internal\AnyBase +{ + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * + * Generated from protobuf field string type_url = 1; + */ + protected $type_url = ''; + /** + * Must be a valid serialized protocol buffer of the above specified type. + * + * Generated from protobuf field bytes value = 2; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type_url + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * @type string $value + * Must be a valid serialized protocol buffer of the above specified type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Any::initOnce(); + parent::__construct($data); + } + + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * + * Generated from protobuf field string type_url = 1; + * @return string + */ + public function getTypeUrl() + { + return $this->type_url; + } + + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * + * Generated from protobuf field string type_url = 1; + * @param string $var + * @return $this + */ + public function setTypeUrl($var) + { + GPBUtil::checkString($var, True); + $this->type_url = $var; + + return $this; + } + + /** + * Must be a valid serialized protocol buffer of the above specified type. + * + * Generated from protobuf field bytes value = 2; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Must be a valid serialized protocol buffer of the above specified type. + * + * Generated from protobuf field bytes value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, False); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Api.php b/vendor/google/protobuf/src/Google/Protobuf/Api.php new file mode 100644 index 000000000..3784263cb --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Api.php @@ -0,0 +1,360 @@ +google.protobuf.Api + */ +class Api extends \Google\Protobuf\Internal\Message +{ + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The methods of this interface, in unspecified order. + * + * Generated from protobuf field repeated .google.protobuf.Method methods = 2; + */ + private $methods; + /** + * Any metadata attached to the interface. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + */ + private $options; + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to be + * consistent with what is provided here. + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * The major version is also reflected in the package name of the + * interface, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, non-GA interfaces. + * + * Generated from protobuf field string version = 4; + */ + protected $version = ''; + /** + * Source context for the protocol buffer service represented by this + * message. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; + */ + protected $source_context = null; + /** + * Included interfaces. See [Mixin][]. + * + * Generated from protobuf field repeated .google.protobuf.Mixin mixins = 6; + */ + private $mixins; + /** + * The source syntax of the service. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 7; + */ + protected $syntax = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + * @type array<\Google\Protobuf\Method>|\Google\Protobuf\Internal\RepeatedField $methods + * The methods of this interface, in unspecified order. + * @type array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $options + * Any metadata attached to the interface. + * @type string $version + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to be + * consistent with what is provided here. + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * The major version is also reflected in the package name of the + * interface, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, non-GA interfaces. + * @type \Google\Protobuf\SourceContext $source_context + * Source context for the protocol buffer service represented by this + * message. + * @type array<\Google\Protobuf\Mixin>|\Google\Protobuf\Internal\RepeatedField $mixins + * Included interfaces. See [Mixin][]. + * @type int $syntax + * The source syntax of the service. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Api::initOnce(); + parent::__construct($data); + } + + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The methods of this interface, in unspecified order. + * + * Generated from protobuf field repeated .google.protobuf.Method methods = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMethods() + { + return $this->methods; + } + + /** + * The methods of this interface, in unspecified order. + * + * Generated from protobuf field repeated .google.protobuf.Method methods = 2; + * @param array<\Google\Protobuf\Method>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMethods($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Method::class); + $this->methods = $arr; + + return $this; + } + + /** + * Any metadata attached to the interface. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOptions() + { + return $this->options; + } + + /** + * Any metadata attached to the interface. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + * @param array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class); + $this->options = $arr; + + return $this; + } + + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to be + * consistent with what is provided here. + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * The major version is also reflected in the package name of the + * interface, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, non-GA interfaces. + * + * Generated from protobuf field string version = 4; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to be + * consistent with what is provided here. + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * The major version is also reflected in the package name of the + * interface, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, non-GA interfaces. + * + * Generated from protobuf field string version = 4; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * Source context for the protocol buffer service represented by this + * message. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; + * @return \Google\Protobuf\SourceContext|null + */ + public function getSourceContext() + { + return $this->source_context; + } + + public function hasSourceContext() + { + return isset($this->source_context); + } + + public function clearSourceContext() + { + unset($this->source_context); + } + + /** + * Source context for the protocol buffer service represented by this + * message. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; + * @param \Google\Protobuf\SourceContext $var + * @return $this + */ + public function setSourceContext($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\SourceContext::class); + $this->source_context = $var; + + return $this; + } + + /** + * Included interfaces. See [Mixin][]. + * + * Generated from protobuf field repeated .google.protobuf.Mixin mixins = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMixins() + { + return $this->mixins; + } + + /** + * Included interfaces. See [Mixin][]. + * + * Generated from protobuf field repeated .google.protobuf.Mixin mixins = 6; + * @param array<\Google\Protobuf\Mixin>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMixins($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Mixin::class); + $this->mixins = $arr; + + return $this; + } + + /** + * The source syntax of the service. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 7; + * @return int + */ + public function getSyntax() + { + return $this->syntax; + } + + /** + * The source syntax of the service. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 7; + * @param int $var + * @return $this + */ + public function setSyntax($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class); + $this->syntax = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/BoolValue.php b/vendor/google/protobuf/src/Google/Protobuf/BoolValue.php new file mode 100644 index 000000000..ecdbf4dcc --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/BoolValue.php @@ -0,0 +1,68 @@ +google.protobuf.BoolValue + */ +class BoolValue extends \Google\Protobuf\Internal\Message +{ + /** + * The bool value. + * + * Generated from protobuf field bool value = 1; + */ + protected $value = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $value + * The bool value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct($data); + } + + /** + * The bool value. + * + * Generated from protobuf field bool value = 1; + * @return bool + */ + public function getValue() + { + return $this->value; + } + + /** + * The bool value. + * + * Generated from protobuf field bool value = 1; + * @param bool $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkBool($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/BytesValue.php b/vendor/google/protobuf/src/Google/Protobuf/BytesValue.php new file mode 100644 index 000000000..1582e14ac --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/BytesValue.php @@ -0,0 +1,68 @@ +google.protobuf.BytesValue + */ +class BytesValue extends \Google\Protobuf\Internal\Message +{ + /** + * The bytes value. + * + * Generated from protobuf field bytes value = 1; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $value + * The bytes value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct($data); + } + + /** + * The bytes value. + * + * Generated from protobuf field bytes value = 1; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The bytes value. + * + * Generated from protobuf field bytes value = 1; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, False); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Descriptor.php b/vendor/google/protobuf/src/Google/Protobuf/Descriptor.php new file mode 100644 index 000000000..36436e2b7 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Descriptor.php @@ -0,0 +1,108 @@ +internal_desc = $internal_desc; + } + + /** + * @return string Full protobuf message name + */ + public function getFullName() + { + return trim($this->internal_desc->getFullName(), "."); + } + + /** + * @return string PHP class name + */ + public function getClass() + { + return $this->internal_desc->getClass(); + } + + /** + * @param int $index Must be >= 0 and < getFieldCount() + * @return FieldDescriptor + */ + public function getField($index) + { + return $this->getPublicDescriptor($this->internal_desc->getFieldByIndex($index)); + } + + /** + * @return int Number of fields in message + */ + public function getFieldCount() + { + return count($this->internal_desc->getField()); + } + + /** + * @param int $index Must be >= 0 and < getOneofDeclCount() + * @return OneofDescriptor + */ + public function getOneofDecl($index) + { + return $this->getPublicDescriptor($this->internal_desc->getOneofDecl()[$index]); + } + + /** + * @return int Number of oneofs in message + */ + public function getOneofDeclCount() + { + return count($this->internal_desc->getOneofDecl()); + } + + /** + * @return int Number of real oneofs in message + */ + public function getRealOneofDeclCount() + { + return $this->internal_desc->getRealOneofDeclCount(); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/DescriptorPool.php b/vendor/google/protobuf/src/Google/Protobuf/DescriptorPool.php new file mode 100644 index 000000000..119f0e2e6 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/DescriptorPool.php @@ -0,0 +1,76 @@ +internal_pool = $internal_pool; + } + + /** + * @param string $className A fully qualified protobuf class name + * @return Descriptor + */ + public function getDescriptorByClassName($className) + { + $desc = $this->internal_pool->getDescriptorByClassName($className); + return is_null($desc) ? null : $desc->getPublicDescriptor(); + } + + /** + * @param string $className A fully qualified protobuf class name + * @return EnumDescriptor + */ + public function getEnumDescriptorByClassName($className) + { + $desc = $this->internal_pool->getEnumDescriptorByClassName($className); + return is_null($desc) ? null : $desc->getPublicDescriptor(); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php b/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php new file mode 100644 index 000000000..b72399f46 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php @@ -0,0 +1,68 @@ +google.protobuf.DoubleValue + */ +class DoubleValue extends \Google\Protobuf\Internal\Message +{ + /** + * The double value. + * + * Generated from protobuf field double value = 1; + */ + protected $value = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $value + * The double value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct($data); + } + + /** + * The double value. + * + * Generated from protobuf field double value = 1; + * @return float + */ + public function getValue() + { + return $this->value; + } + + /** + * The double value. + * + * Generated from protobuf field double value = 1; + * @param float $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkDouble($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Duration.php b/vendor/google/protobuf/src/Google/Protobuf/Duration.php new file mode 100644 index 000000000..531cd50b5 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Duration.php @@ -0,0 +1,173 @@ + 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * Example 3: Compute Duration from datetime.timedelta in Python. + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * # JSON Mapping + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + * + * Generated from protobuf message google.protobuf.Duration + */ +class Duration extends \Google\Protobuf\Internal\Message +{ + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + * + * Generated from protobuf field int64 seconds = 1; + */ + protected $seconds = 0; + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + * + * Generated from protobuf field int32 nanos = 2; + */ + protected $nanos = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $seconds + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + * @type int $nanos + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Duration::initOnce(); + parent::__construct($data); + } + + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + * + * Generated from protobuf field int64 seconds = 1; + * @return int|string + */ + public function getSeconds() + { + return $this->seconds; + } + + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + * + * Generated from protobuf field int64 seconds = 1; + * @param int|string $var + * @return $this + */ + public function setSeconds($var) + { + GPBUtil::checkInt64($var); + $this->seconds = $var; + + return $this; + } + + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + * + * Generated from protobuf field int32 nanos = 2; + * @return int + */ + public function getNanos() + { + return $this->nanos; + } + + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + * + * Generated from protobuf field int32 nanos = 2; + * @param int $var + * @return $this + */ + public function setNanos($var) + { + GPBUtil::checkInt32($var); + $this->nanos = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Enum.php b/vendor/google/protobuf/src/Google/Protobuf/Enum.php new file mode 100644 index 000000000..185e54e03 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Enum.php @@ -0,0 +1,213 @@ +google.protobuf.Enum + */ +class Enum extends \Google\Protobuf\Internal\Message +{ + /** + * Enum type name. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Enum value definitions. + * + * Generated from protobuf field repeated .google.protobuf.EnumValue enumvalue = 2; + */ + private $enumvalue; + /** + * Protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + */ + private $options; + /** + * The source context. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 4; + */ + protected $source_context = null; + /** + * The source syntax. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 5; + */ + protected $syntax = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Enum type name. + * @type array<\Google\Protobuf\EnumValue>|\Google\Protobuf\Internal\RepeatedField $enumvalue + * Enum value definitions. + * @type array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $options + * Protocol buffer options. + * @type \Google\Protobuf\SourceContext $source_context + * The source context. + * @type int $syntax + * The source syntax. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Type::initOnce(); + parent::__construct($data); + } + + /** + * Enum type name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Enum type name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Enum value definitions. + * + * Generated from protobuf field repeated .google.protobuf.EnumValue enumvalue = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEnumvalue() + { + return $this->enumvalue; + } + + /** + * Enum value definitions. + * + * Generated from protobuf field repeated .google.protobuf.EnumValue enumvalue = 2; + * @param array<\Google\Protobuf\EnumValue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEnumvalue($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\EnumValue::class); + $this->enumvalue = $arr; + + return $this; + } + + /** + * Protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOptions() + { + return $this->options; + } + + /** + * Protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + * @param array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class); + $this->options = $arr; + + return $this; + } + + /** + * The source context. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 4; + * @return \Google\Protobuf\SourceContext|null + */ + public function getSourceContext() + { + return $this->source_context; + } + + public function hasSourceContext() + { + return isset($this->source_context); + } + + public function clearSourceContext() + { + unset($this->source_context); + } + + /** + * The source context. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 4; + * @param \Google\Protobuf\SourceContext $var + * @return $this + */ + public function setSourceContext($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\SourceContext::class); + $this->source_context = $var; + + return $this; + } + + /** + * The source syntax. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 5; + * @return int + */ + public function getSyntax() + { + return $this->syntax; + } + + /** + * The source syntax. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 5; + * @param int $var + * @return $this + */ + public function setSyntax($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class); + $this->syntax = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/EnumDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/EnumDescriptor.php new file mode 100644 index 000000000..a8b56c0d4 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/EnumDescriptor.php @@ -0,0 +1,79 @@ +internal_desc = $internal_desc; + } + + /** + * @return string Full protobuf message name + */ + public function getFullName() + { + return $this->internal_desc->getFullName(); + } + + /** + * @return string PHP class name + */ + public function getClass() + { + return $this->internal_desc->getClass(); + } + + /** + * @param int $index Must be >= 0 and < getValueCount() + * @return EnumValueDescriptor + */ + public function getValue($index) + { + return $this->internal_desc->getValueDescriptorByIndex($index); + } + + /** + * @return int Number of values in enum + */ + public function getValueCount() + { + return $this->internal_desc->getValueCount(); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/EnumValue.php b/vendor/google/protobuf/src/Google/Protobuf/EnumValue.php new file mode 100644 index 000000000..93c20f967 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/EnumValue.php @@ -0,0 +1,135 @@ +google.protobuf.EnumValue + */ +class EnumValue extends \Google\Protobuf\Internal\Message +{ + /** + * Enum value name. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Enum value number. + * + * Generated from protobuf field int32 number = 2; + */ + protected $number = 0; + /** + * Protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + */ + private $options; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Enum value name. + * @type int $number + * Enum value number. + * @type array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $options + * Protocol buffer options. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Type::initOnce(); + parent::__construct($data); + } + + /** + * Enum value name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Enum value name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Enum value number. + * + * Generated from protobuf field int32 number = 2; + * @return int + */ + public function getNumber() + { + return $this->number; + } + + /** + * Enum value number. + * + * Generated from protobuf field int32 number = 2; + * @param int $var + * @return $this + */ + public function setNumber($var) + { + GPBUtil::checkInt32($var); + $this->number = $var; + + return $this; + } + + /** + * Protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOptions() + { + return $this->options; + } + + /** + * Protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + * @param array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class); + $this->options = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/EnumValueDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/EnumValueDescriptor.php new file mode 100644 index 000000000..e76e19971 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/EnumValueDescriptor.php @@ -0,0 +1,64 @@ +name = $name; + $this->number = $number; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @return int + */ + public function getNumber() + { + return $this->number; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Field.php b/vendor/google/protobuf/src/Google/Protobuf/Field.php new file mode 100644 index 000000000..ddae570c2 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Field.php @@ -0,0 +1,381 @@ +google.protobuf.Field + */ +class Field extends \Google\Protobuf\Internal\Message +{ + /** + * The field type. + * + * Generated from protobuf field .google.protobuf.Field.Kind kind = 1; + */ + protected $kind = 0; + /** + * The field cardinality. + * + * Generated from protobuf field .google.protobuf.Field.Cardinality cardinality = 2; + */ + protected $cardinality = 0; + /** + * The field number. + * + * Generated from protobuf field int32 number = 3; + */ + protected $number = 0; + /** + * The field name. + * + * Generated from protobuf field string name = 4; + */ + protected $name = ''; + /** + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + * + * Generated from protobuf field string type_url = 6; + */ + protected $type_url = ''; + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + * + * Generated from protobuf field int32 oneof_index = 7; + */ + protected $oneof_index = 0; + /** + * Whether to use alternative packed wire representation. + * + * Generated from protobuf field bool packed = 8; + */ + protected $packed = false; + /** + * The protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 9; + */ + private $options; + /** + * The field JSON name. + * + * Generated from protobuf field string json_name = 10; + */ + protected $json_name = ''; + /** + * The string value of the default value of this field. Proto2 syntax only. + * + * Generated from protobuf field string default_value = 11; + */ + protected $default_value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $kind + * The field type. + * @type int $cardinality + * The field cardinality. + * @type int $number + * The field number. + * @type string $name + * The field name. + * @type string $type_url + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + * @type int $oneof_index + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + * @type bool $packed + * Whether to use alternative packed wire representation. + * @type array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $options + * The protocol buffer options. + * @type string $json_name + * The field JSON name. + * @type string $default_value + * The string value of the default value of this field. Proto2 syntax only. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Type::initOnce(); + parent::__construct($data); + } + + /** + * The field type. + * + * Generated from protobuf field .google.protobuf.Field.Kind kind = 1; + * @return int + */ + public function getKind() + { + return $this->kind; + } + + /** + * The field type. + * + * Generated from protobuf field .google.protobuf.Field.Kind kind = 1; + * @param int $var + * @return $this + */ + public function setKind($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Field\Kind::class); + $this->kind = $var; + + return $this; + } + + /** + * The field cardinality. + * + * Generated from protobuf field .google.protobuf.Field.Cardinality cardinality = 2; + * @return int + */ + public function getCardinality() + { + return $this->cardinality; + } + + /** + * The field cardinality. + * + * Generated from protobuf field .google.protobuf.Field.Cardinality cardinality = 2; + * @param int $var + * @return $this + */ + public function setCardinality($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Field\Cardinality::class); + $this->cardinality = $var; + + return $this; + } + + /** + * The field number. + * + * Generated from protobuf field int32 number = 3; + * @return int + */ + public function getNumber() + { + return $this->number; + } + + /** + * The field number. + * + * Generated from protobuf field int32 number = 3; + * @param int $var + * @return $this + */ + public function setNumber($var) + { + GPBUtil::checkInt32($var); + $this->number = $var; + + return $this; + } + + /** + * The field name. + * + * Generated from protobuf field string name = 4; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The field name. + * + * Generated from protobuf field string name = 4; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + * + * Generated from protobuf field string type_url = 6; + * @return string + */ + public function getTypeUrl() + { + return $this->type_url; + } + + /** + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + * + * Generated from protobuf field string type_url = 6; + * @param string $var + * @return $this + */ + public function setTypeUrl($var) + { + GPBUtil::checkString($var, True); + $this->type_url = $var; + + return $this; + } + + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + * + * Generated from protobuf field int32 oneof_index = 7; + * @return int + */ + public function getOneofIndex() + { + return $this->oneof_index; + } + + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + * + * Generated from protobuf field int32 oneof_index = 7; + * @param int $var + * @return $this + */ + public function setOneofIndex($var) + { + GPBUtil::checkInt32($var); + $this->oneof_index = $var; + + return $this; + } + + /** + * Whether to use alternative packed wire representation. + * + * Generated from protobuf field bool packed = 8; + * @return bool + */ + public function getPacked() + { + return $this->packed; + } + + /** + * Whether to use alternative packed wire representation. + * + * Generated from protobuf field bool packed = 8; + * @param bool $var + * @return $this + */ + public function setPacked($var) + { + GPBUtil::checkBool($var); + $this->packed = $var; + + return $this; + } + + /** + * The protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOptions() + { + return $this->options; + } + + /** + * The protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 9; + * @param array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class); + $this->options = $arr; + + return $this; + } + + /** + * The field JSON name. + * + * Generated from protobuf field string json_name = 10; + * @return string + */ + public function getJsonName() + { + return $this->json_name; + } + + /** + * The field JSON name. + * + * Generated from protobuf field string json_name = 10; + * @param string $var + * @return $this + */ + public function setJsonName($var) + { + GPBUtil::checkString($var, True); + $this->json_name = $var; + + return $this; + } + + /** + * The string value of the default value of this field. Proto2 syntax only. + * + * Generated from protobuf field string default_value = 11; + * @return string + */ + public function getDefaultValue() + { + return $this->default_value; + } + + /** + * The string value of the default value of this field. Proto2 syntax only. + * + * Generated from protobuf field string default_value = 11; + * @param string $var + * @return $this + */ + public function setDefaultValue($var) + { + GPBUtil::checkString($var, True); + $this->default_value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Field/Cardinality.php b/vendor/google/protobuf/src/Google/Protobuf/Field/Cardinality.php new file mode 100644 index 000000000..a42219957 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Field/Cardinality.php @@ -0,0 +1,71 @@ +google.protobuf.Field.Cardinality + */ +class Cardinality +{ + /** + * For fields with unknown cardinality. + * + * Generated from protobuf enum CARDINALITY_UNKNOWN = 0; + */ + const CARDINALITY_UNKNOWN = 0; + /** + * For optional fields. + * + * Generated from protobuf enum CARDINALITY_OPTIONAL = 1; + */ + const CARDINALITY_OPTIONAL = 1; + /** + * For required fields. Proto2 syntax only. + * + * Generated from protobuf enum CARDINALITY_REQUIRED = 2; + */ + const CARDINALITY_REQUIRED = 2; + /** + * For repeated fields. + * + * Generated from protobuf enum CARDINALITY_REPEATED = 3; + */ + const CARDINALITY_REPEATED = 3; + + private static $valueToName = [ + self::CARDINALITY_UNKNOWN => 'CARDINALITY_UNKNOWN', + self::CARDINALITY_OPTIONAL => 'CARDINALITY_OPTIONAL', + self::CARDINALITY_REQUIRED => 'CARDINALITY_REQUIRED', + self::CARDINALITY_REPEATED => 'CARDINALITY_REPEATED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Cardinality::class, \Google\Protobuf\Field_Cardinality::class); + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Field/Kind.php b/vendor/google/protobuf/src/Google/Protobuf/Field/Kind.php new file mode 100644 index 000000000..2d8dd77c1 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Field/Kind.php @@ -0,0 +1,176 @@ +google.protobuf.Field.Kind + */ +class Kind +{ + /** + * Field type unknown. + * + * Generated from protobuf enum TYPE_UNKNOWN = 0; + */ + const TYPE_UNKNOWN = 0; + /** + * Field type double. + * + * Generated from protobuf enum TYPE_DOUBLE = 1; + */ + const TYPE_DOUBLE = 1; + /** + * Field type float. + * + * Generated from protobuf enum TYPE_FLOAT = 2; + */ + const TYPE_FLOAT = 2; + /** + * Field type int64. + * + * Generated from protobuf enum TYPE_INT64 = 3; + */ + const TYPE_INT64 = 3; + /** + * Field type uint64. + * + * Generated from protobuf enum TYPE_UINT64 = 4; + */ + const TYPE_UINT64 = 4; + /** + * Field type int32. + * + * Generated from protobuf enum TYPE_INT32 = 5; + */ + const TYPE_INT32 = 5; + /** + * Field type fixed64. + * + * Generated from protobuf enum TYPE_FIXED64 = 6; + */ + const TYPE_FIXED64 = 6; + /** + * Field type fixed32. + * + * Generated from protobuf enum TYPE_FIXED32 = 7; + */ + const TYPE_FIXED32 = 7; + /** + * Field type bool. + * + * Generated from protobuf enum TYPE_BOOL = 8; + */ + const TYPE_BOOL = 8; + /** + * Field type string. + * + * Generated from protobuf enum TYPE_STRING = 9; + */ + const TYPE_STRING = 9; + /** + * Field type group. Proto2 syntax only, and deprecated. + * + * Generated from protobuf enum TYPE_GROUP = 10; + */ + const TYPE_GROUP = 10; + /** + * Field type message. + * + * Generated from protobuf enum TYPE_MESSAGE = 11; + */ + const TYPE_MESSAGE = 11; + /** + * Field type bytes. + * + * Generated from protobuf enum TYPE_BYTES = 12; + */ + const TYPE_BYTES = 12; + /** + * Field type uint32. + * + * Generated from protobuf enum TYPE_UINT32 = 13; + */ + const TYPE_UINT32 = 13; + /** + * Field type enum. + * + * Generated from protobuf enum TYPE_ENUM = 14; + */ + const TYPE_ENUM = 14; + /** + * Field type sfixed32. + * + * Generated from protobuf enum TYPE_SFIXED32 = 15; + */ + const TYPE_SFIXED32 = 15; + /** + * Field type sfixed64. + * + * Generated from protobuf enum TYPE_SFIXED64 = 16; + */ + const TYPE_SFIXED64 = 16; + /** + * Field type sint32. + * + * Generated from protobuf enum TYPE_SINT32 = 17; + */ + const TYPE_SINT32 = 17; + /** + * Field type sint64. + * + * Generated from protobuf enum TYPE_SINT64 = 18; + */ + const TYPE_SINT64 = 18; + + private static $valueToName = [ + self::TYPE_UNKNOWN => 'TYPE_UNKNOWN', + self::TYPE_DOUBLE => 'TYPE_DOUBLE', + self::TYPE_FLOAT => 'TYPE_FLOAT', + self::TYPE_INT64 => 'TYPE_INT64', + self::TYPE_UINT64 => 'TYPE_UINT64', + self::TYPE_INT32 => 'TYPE_INT32', + self::TYPE_FIXED64 => 'TYPE_FIXED64', + self::TYPE_FIXED32 => 'TYPE_FIXED32', + self::TYPE_BOOL => 'TYPE_BOOL', + self::TYPE_STRING => 'TYPE_STRING', + self::TYPE_GROUP => 'TYPE_GROUP', + self::TYPE_MESSAGE => 'TYPE_MESSAGE', + self::TYPE_BYTES => 'TYPE_BYTES', + self::TYPE_UINT32 => 'TYPE_UINT32', + self::TYPE_ENUM => 'TYPE_ENUM', + self::TYPE_SFIXED32 => 'TYPE_SFIXED32', + self::TYPE_SFIXED64 => 'TYPE_SFIXED64', + self::TYPE_SINT32 => 'TYPE_SINT32', + self::TYPE_SINT64 => 'TYPE_SINT64', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Kind::class, \Google\Protobuf\Field_Kind::class); + diff --git a/vendor/google/protobuf/src/Google/Protobuf/FieldDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/FieldDescriptor.php new file mode 100644 index 000000000..ac919a24a --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/FieldDescriptor.php @@ -0,0 +1,144 @@ +internal_desc = $internal_desc; + } + + /** + * @return string Field name + */ + public function getName() + { + return $this->internal_desc->getName(); + } + + /** + * @return int Protobuf field number + */ + public function getNumber() + { + return $this->internal_desc->getNumber(); + } + + /** + * @return int + */ + public function getLabel() + { + return $this->internal_desc->getLabel(); + } + + /** + * @return int + */ + public function getType() + { + return $this->internal_desc->getType(); + } + + /** + * @return OneofDescriptor + */ + public function getContainingOneof() + { + return $this->getPublicDescriptor($this->internal_desc->getContainingOneof()); + } + + /** + * Gets the field's containing oneof, only if non-synthetic. + * + * @return null|OneofDescriptor + */ + public function getRealContainingOneof() + { + return $this->getPublicDescriptor($this->internal_desc->getRealContainingOneof()); + } + + /** + * @return boolean + */ + public function hasOptionalKeyword() + { + return $this->internal_desc->hasOptionalKeyword(); + } + + /** + * @return Descriptor Returns a descriptor for the field type if the field type is a message, otherwise throws \Exception + * @throws \Exception + */ + public function getMessageType() + { + if ($this->getType() == GPBType::MESSAGE) { + return $this->getPublicDescriptor($this->internal_desc->getMessageType()); + } else { + throw new \Exception("Cannot get message type for non-message field '" . $this->getName() . "'"); + } + } + + /** + * @return EnumDescriptor Returns an enum descriptor if the field type is an enum, otherwise throws \Exception + * @throws \Exception + */ + public function getEnumType() + { + if ($this->getType() == GPBType::ENUM) { + return $this->getPublicDescriptor($this->internal_desc->getEnumType()); + } else { + throw new \Exception("Cannot get enum type for non-enum field '" . $this->getName() . "'"); + } + } + + /** + * @return boolean + */ + public function isMap() + { + return $this->internal_desc->isMap(); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/FieldMask.php b/vendor/google/protobuf/src/Google/Protobuf/FieldMask.php new file mode 100644 index 000000000..a8e5243f8 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/FieldMask.php @@ -0,0 +1,217 @@ +google.protobuf.FieldMask + */ +class FieldMask extends \Google\Protobuf\Internal\Message +{ + /** + * The set of field mask paths. + * + * Generated from protobuf field repeated string paths = 1; + */ + private $paths; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $paths + * The set of field mask paths. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); + parent::__construct($data); + } + + /** + * The set of field mask paths. + * + * Generated from protobuf field repeated string paths = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPaths() + { + return $this->paths; + } + + /** + * The set of field mask paths. + * + * Generated from protobuf field repeated string paths = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPaths($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->paths = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Field_Cardinality.php b/vendor/google/protobuf/src/Google/Protobuf/Field_Cardinality.php new file mode 100644 index 000000000..dff8f8931 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Field_Cardinality.php @@ -0,0 +1,16 @@ +google.protobuf.FloatValue + */ +class FloatValue extends \Google\Protobuf\Internal\Message +{ + /** + * The float value. + * + * Generated from protobuf field float value = 1; + */ + protected $value = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $value + * The float value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct($data); + } + + /** + * The float value. + * + * Generated from protobuf field float value = 1; + * @return float + */ + public function getValue() + { + return $this->value; + } + + /** + * The float value. + * + * Generated from protobuf field float value = 1; + * @param float $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkFloat($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/GPBEmpty.php b/vendor/google/protobuf/src/Google/Protobuf/GPBEmpty.php new file mode 100644 index 000000000..4db69238b --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/GPBEmpty.php @@ -0,0 +1,38 @@ +google.protobuf.Empty + */ +class GPBEmpty extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\GPBEmpty::initOnce(); + parent::__construct($data); + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Int32Value.php b/vendor/google/protobuf/src/Google/Protobuf/Int32Value.php new file mode 100644 index 000000000..cfd73cdc9 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Int32Value.php @@ -0,0 +1,68 @@ +google.protobuf.Int32Value + */ +class Int32Value extends \Google\Protobuf\Internal\Message +{ + /** + * The int32 value. + * + * Generated from protobuf field int32 value = 1; + */ + protected $value = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $value + * The int32 value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct($data); + } + + /** + * The int32 value. + * + * Generated from protobuf field int32 value = 1; + * @return int + */ + public function getValue() + { + return $this->value; + } + + /** + * The int32 value. + * + * Generated from protobuf field int32 value = 1; + * @param int $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkInt32($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Int64Value.php b/vendor/google/protobuf/src/Google/Protobuf/Int64Value.php new file mode 100644 index 000000000..143474fcd --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Int64Value.php @@ -0,0 +1,68 @@ +google.protobuf.Int64Value + */ +class Int64Value extends \Google\Protobuf\Internal\Message +{ + /** + * The int64 value. + * + * Generated from protobuf field int64 value = 1; + */ + protected $value = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $value + * The int64 value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct($data); + } + + /** + * The int64 value. + * + * Generated from protobuf field int64 value = 1; + * @return int|string + */ + public function getValue() + { + return $this->value; + } + + /** + * The int64 value. + * + * Generated from protobuf field int64 value = 1; + * @param int|string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkInt64($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/AnyBase.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/AnyBase.php new file mode 100644 index 000000000..5e9ab5705 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/AnyBase.php @@ -0,0 +1,86 @@ +type_url, 0, $url_prifix_len) != + GPBUtil::TYPE_URL_PREFIX) { + throw new \Exception( + "Type url needs to be type.googleapis.com/fully-qulified"); + } + $fully_qualifed_name = + substr($this->type_url, $url_prifix_len); + + // Create message according to fully qualified name. + $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); + $desc = $pool->getDescriptorByProtoName($fully_qualifed_name); + if (is_null($desc)) { + throw new \Exception("Class ".$fully_qualifed_name + ." hasn't been added to descriptor pool"); + } + $klass = $desc->getClass(); + $msg = new $klass(); + + // Merge data into message. + $msg->mergeFromString($this->value); + return $msg; + } + + /** + * The type_url will be created according to the given message’s type and + * the value is encoded data from the given message.. + * @param Message $msg A proto message. + */ + public function pack($msg) + { + if (!$msg instanceof Message) { + trigger_error("Given parameter is not a message instance.", + E_USER_ERROR); + return; + } + + // Set value using serialized message. + $this->value = $msg->serializeToString(); + + // Set type url. + $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); + $desc = $pool->getDescriptorByClassName(get_class($msg)); + $fully_qualifed_name = $desc->getFullName(); + $this->type_url = GPBUtil::TYPE_URL_PREFIX . $fully_qualifed_name; + } + + /** + * This method returns whether the type_url in any_message is corresponded + * to the given class. + * @param string $klass The fully qualified PHP class name of a proto message type. + */ + public function is($klass) + { + $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); + $desc = $pool->getDescriptorByClassName($klass); + $fully_qualifed_name = $desc->getFullName(); + $type_url = GPBUtil::TYPE_URL_PREFIX . $fully_qualifed_name; + return $this->type_url === $type_url; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedInputStream.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedInputStream.php new file mode 100644 index 000000000..a33fec2f6 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedInputStream.php @@ -0,0 +1,381 @@ +buffer = $buffer; + $this->buffer_size_after_limit = 0; + $this->buffer_end = $end; + $this->current = $start; + $this->current_limit = $end; + $this->legitimate_message_end = false; + $this->recursion_budget = self::DEFAULT_RECURSION_LIMIT; + $this->recursion_limit = self::DEFAULT_RECURSION_LIMIT; + $this->total_bytes_limit = self::DEFAULT_TOTAL_BYTES_LIMIT; + $this->total_bytes_read = $end - $start; + } + + private function advance($amount) + { + $this->current += $amount; + } + + public function bufferSize() + { + return $this->buffer_end - $this->current; + } + + public function current() + { + return $this->total_bytes_read - + ($this->buffer_end - $this->current + + $this->buffer_size_after_limit); + } + + public function substr($start, $end) + { + return substr($this->buffer, $start, $end - $start); + } + + private function recomputeBufferLimits() + { + $this->buffer_end += $this->buffer_size_after_limit; + $closest_limit = min($this->current_limit, $this->total_bytes_limit); + if ($closest_limit < $this->total_bytes_read) { + // The limit position is in the current buffer. We must adjust the + // buffer size accordingly. + $this->buffer_size_after_limit = $this->total_bytes_read - + $closest_limit; + $this->buffer_end -= $this->buffer_size_after_limit; + } else { + $this->buffer_size_after_limit = 0; + } + } + + private function consumedEntireMessage() + { + return $this->legitimate_message_end; + } + + /** + * Read uint32 into $var. Advance buffer with consumed bytes. If the + * contained varint is larger than 32 bits, discard the high order bits. + * @param $var + */ + public function readVarint32(&$var) + { + if (!$this->readVarint64($var)) { + return false; + } + + if (PHP_INT_SIZE == 4) { + $var = bcmod($var, 4294967296); + } else { + $var &= 0xFFFFFFFF; + } + + // Convert large uint32 to int32. + if ($var > 0x7FFFFFFF) { + if (PHP_INT_SIZE === 8) { + $var = $var | (0xFFFFFFFF << 32); + } else { + $var = bcsub($var, 4294967296); + } + } + + $var = intval($var); + return true; + } + + /** + * Read Uint64 into $var. Advance buffer with consumed bytes. + * @param $var + */ + public function readVarint64(&$var) + { + $count = 0; + + if (PHP_INT_SIZE == 4) { + $high = 0; + $low = 0; + $b = 0; + + do { + if ($this->current === $this->buffer_end) { + return false; + } + if ($count === self::MAX_VARINT_BYTES) { + return false; + } + $b = ord($this->buffer[$this->current]); + $bits = 7 * $count; + if ($bits >= 32) { + $high |= (($b & 0x7F) << ($bits - 32)); + } else if ($bits > 25){ + // $bits is 28 in this case. + $low |= (($b & 0x7F) << 28); + $high = ($b & 0x7F) >> 4; + } else { + $low |= (($b & 0x7F) << $bits); + } + + $this->advance(1); + $count += 1; + } while ($b & 0x80); + + $var = GPBUtil::combineInt32ToInt64($high, $low); + if (bccomp($var, 0) < 0) { + $var = bcadd($var, "18446744073709551616"); + } + } else { + $result = 0; + $shift = 0; + + do { + if ($this->current === $this->buffer_end) { + return false; + } + if ($count === self::MAX_VARINT_BYTES) { + return false; + } + + $byte = ord($this->buffer[$this->current]); + $result |= ($byte & 0x7f) << $shift; + $shift += 7; + $this->advance(1); + $count += 1; + } while ($byte > 0x7f); + + $var = $result; + } + + return true; + } + + /** + * Read int into $var. If the result is larger than the largest integer, $var + * will be -1. Advance buffer with consumed bytes. + * @param $var + */ + public function readVarintSizeAsInt(&$var) + { + if (!$this->readVarint64($var)) { + return false; + } + $var = (int)$var; + return true; + } + + /** + * Read 32-bit unsigned integer to $var. If the buffer has less than 4 bytes, + * return false. Advance buffer with consumed bytes. + * @param $var + */ + public function readLittleEndian32(&$var) + { + $data = null; + if (!$this->readRaw(4, $data)) { + return false; + } + $var = unpack('V', $data); + $var = $var[1]; + return true; + } + + /** + * Read 64-bit unsigned integer to $var. If the buffer has less than 8 bytes, + * return false. Advance buffer with consumed bytes. + * @param $var + */ + public function readLittleEndian64(&$var) + { + $data = null; + if (!$this->readRaw(4, $data)) { + return false; + } + $low = unpack('V', $data)[1]; + if (!$this->readRaw(4, $data)) { + return false; + } + $high = unpack('V', $data)[1]; + if (PHP_INT_SIZE == 4) { + $var = GPBUtil::combineInt32ToInt64($high, $low); + } else { + $var = ($high << 32) | $low; + } + return true; + } + + /** + * Read tag into $var. Advance buffer with consumed bytes. + */ + public function readTag() + { + if ($this->current === $this->buffer_end) { + // Make sure that it failed due to EOF, not because we hit + // total_bytes_limit, which, unlike normal limits, is not a valid + // place to end a message. + $current_position = $this->total_bytes_read - + $this->buffer_size_after_limit; + if ($current_position >= $this->total_bytes_limit) { + // Hit total_bytes_limit_. But if we also hit the normal limit, + // we're still OK. + $this->legitimate_message_end = + ($this->current_limit === $this->total_bytes_limit); + } else { + $this->legitimate_message_end = true; + } + return 0; + } + + $result = 0; + // The largest tag is 2^29 - 1, which can be represented by int32. + $success = $this->readVarint32($result); + if ($success) { + return $result; + } else { + return 0; + } + } + + public function readRaw($size, &$buffer) + { + $current_buffer_size = 0; + if ($this->bufferSize() < $size) { + return false; + } + + if ($size === 0) { + $buffer = ""; + } else { + $buffer = substr($this->buffer, $this->current, $size); + $this->advance($size); + } + + return true; + } + + /* Places a limit on the number of bytes that the stream may read, starting + * from the current position. Once the stream hits this limit, it will act + * like the end of the input has been reached until popLimit() is called. + * + * As the names imply, the stream conceptually has a stack of limits. The + * shortest limit on the stack is always enforced, even if it is not the top + * limit. + * + * The value returned by pushLimit() is opaque to the caller, and must be + * passed unchanged to the corresponding call to popLimit(). + * + * @param integer $byte_limit + * @throws \Exception Fail to push limit. + */ + public function pushLimit($byte_limit) + { + // Current position relative to the beginning of the stream. + $current_position = $this->current(); + $old_limit = $this->current_limit; + + // security: byte_limit is possibly evil, so check for negative values + // and overflow. + if ($byte_limit >= 0 && + $byte_limit <= PHP_INT_MAX - $current_position && + $byte_limit <= $this->current_limit - $current_position) { + $this->current_limit = $current_position + $byte_limit; + $this->recomputeBufferLimits(); + } else { + throw new GPBDecodeException("Fail to push limit."); + } + + return $old_limit; + } + + /* The limit passed in is actually the *old* limit, which we returned from + * PushLimit(). + * + * @param integer $byte_limit + */ + public function popLimit($byte_limit) + { + $this->current_limit = $byte_limit; + $this->recomputeBufferLimits(); + // We may no longer be at a legitimate message end. ReadTag() needs to + // be called again to find out. + $this->legitimate_message_end = false; + } + + public function incrementRecursionDepthAndPushLimit( + $byte_limit, &$old_limit, &$recursion_budget) + { + $old_limit = $this->pushLimit($byte_limit); + $recursion_limit = --$this->recursion_limit; + } + + public function decrementRecursionDepthAndPopLimit($byte_limit) + { + $result = $this->consumedEntireMessage(); + $this->popLimit($byte_limit); + ++$this->recursion_budget; + return $result; + } + + public function bytesUntilLimit() + { + if ($this->current_limit === PHP_INT_MAX) { + return -1; + } + return $this->current_limit - $this->current; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedOutputStream.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedOutputStream.php new file mode 100644 index 000000000..f75e9c662 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedOutputStream.php @@ -0,0 +1,159 @@ +current = 0; + $this->buffer_size = $size; + $this->buffer = str_repeat(chr(0), $this->buffer_size); + } + + public function getData() + { + return $this->buffer; + } + + public function writeVarint32($value, $trim) + { + $bytes = str_repeat(chr(0), self::MAX_VARINT64_BYTES); + $size = self::writeVarintToArray($value, $bytes, $trim); + return $this->writeRaw($bytes, $size); + } + + public function writeVarint64($value) + { + $bytes = str_repeat(chr(0), self::MAX_VARINT64_BYTES); + $size = self::writeVarintToArray($value, $bytes); + return $this->writeRaw($bytes, $size); + } + + public function writeLittleEndian32($value) + { + $bytes = str_repeat(chr(0), 4); + $size = self::writeLittleEndian32ToArray($value, $bytes); + return $this->writeRaw($bytes, $size); + } + + public function writeLittleEndian64($value) + { + $bytes = str_repeat(chr(0), 8); + $size = self::writeLittleEndian64ToArray($value, $bytes); + return $this->writeRaw($bytes, $size); + } + + public function writeTag($tag) + { + return $this->writeVarint32($tag, true); + } + + public function writeRaw($data, $size) + { + if ($this->buffer_size < $size) { + trigger_error("Output stream doesn't have enough buffer."); + return false; + } + + for ($i = 0; $i < $size; $i++) { + $this->buffer[$this->current] = $data[$i]; + $this->current++; + $this->buffer_size--; + } + return true; + } + + public static function writeVarintToArray($value, &$buffer, $trim = false) + { + $current = 0; + + $high = 0; + $low = 0; + if (PHP_INT_SIZE == 4) { + GPBUtil::divideInt64ToInt32($value, $high, $low, $trim); + } else { + $low = $value; + } + + while (($low >= 0x80 || $low < 0) || $high != 0) { + $buffer[$current] = chr($low | 0x80); + $value = ($value >> 7) & ~(0x7F << ((PHP_INT_SIZE << 3) - 7)); + $carry = ($high & 0x7F) << ((PHP_INT_SIZE << 3) - 7); + $high = ($high >> 7) & ~(0x7F << ((PHP_INT_SIZE << 3) - 7)); + $low = (($low >> 7) & ~(0x7F << ((PHP_INT_SIZE << 3) - 7)) | $carry); + $current++; + } + $buffer[$current] = chr($low); + return $current + 1; + } + + private static function writeLittleEndian32ToArray($value, &$buffer) + { + $buffer[0] = chr($value & 0x000000FF); + $buffer[1] = chr(($value >> 8) & 0x000000FF); + $buffer[2] = chr(($value >> 16) & 0x000000FF); + $buffer[3] = chr(($value >> 24) & 0x000000FF); + return 4; + } + + private static function writeLittleEndian64ToArray($value, &$buffer) + { + $high = 0; + $low = 0; + if (PHP_INT_SIZE == 4) { + GPBUtil::divideInt64ToInt32($value, $high, $low); + } else { + $low = $value & 0xFFFFFFFF; + $high = ($value >> 32) & 0xFFFFFFFF; + } + + $buffer[0] = chr($low & 0x000000FF); + $buffer[1] = chr(($low >> 8) & 0x000000FF); + $buffer[2] = chr(($low >> 16) & 0x000000FF); + $buffer[3] = chr(($low >> 24) & 0x000000FF); + $buffer[4] = chr($high & 0x000000FF); + $buffer[5] = chr(($high >> 8) & 0x000000FF); + $buffer[6] = chr(($high >> 16) & 0x000000FF); + $buffer[7] = chr(($high >> 24) & 0x000000FF); + return 8; + } + +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/Descriptor.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/Descriptor.php new file mode 100644 index 000000000..51a34d6bc --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/Descriptor.php @@ -0,0 +1,236 @@ +public_desc = new \Google\Protobuf\Descriptor($this); + } + + public function addOneofDecl($oneof) + { + $this->oneof_decl[] = $oneof; + } + + public function getOneofDecl() + { + return $this->oneof_decl; + } + + public function setFullName($full_name) + { + $this->full_name = $full_name; + } + + public function getFullName() + { + return $this->full_name; + } + + public function addField($field) + { + $this->field[$field->getNumber()] = $field; + $this->json_to_field[$field->getJsonName()] = $field; + $this->name_to_field[$field->getName()] = $field; + $this->index_to_field[] = $field; + } + + public function getField() + { + return $this->field; + } + + public function addNestedType($desc) + { + $this->nested_type[] = $desc; + } + + public function getNestedType() + { + return $this->nested_type; + } + + public function addEnumType($desc) + { + $this->enum_type[] = $desc; + } + + public function getEnumType() + { + return $this->enum_type; + } + + public function getFieldByNumber($number) + { + if (!isset($this->field[$number])) { + return NULL; + } else { + return $this->field[$number]; + } + } + + public function getFieldByJsonName($json_name) + { + if (!isset($this->json_to_field[$json_name])) { + return NULL; + } else { + return $this->json_to_field[$json_name]; + } + } + + public function getFieldByName($name) + { + if (!isset($this->name_to_field[$name])) { + return NULL; + } else { + return $this->name_to_field[$name]; + } + } + + public function getFieldByIndex($index) + { + if (count($this->index_to_field) <= $index) { + return NULL; + } else { + return $this->index_to_field[$index]; + } + } + + public function setClass($klass) + { + $this->klass = $klass; + } + + public function getClass() + { + return $this->klass; + } + + public function setLegacyClass($klass) + { + $this->legacy_klass = $klass; + } + + public function getLegacyClass() + { + return $this->legacy_klass; + } + + public function setPreviouslyUnreservedClass($klass) + { + $this->previous_klass = $klass; + } + + public function getPreviouslyUnreservedClass() + { + return $this->previous_klass; + } + + public function setOptions($options) + { + $this->options = $options; + } + + public function getOptions() + { + return $this->options; + } + + public static function buildFromProto($proto, $file_proto, $containing) + { + $desc = new Descriptor(); + + $message_name_without_package = ""; + $classname = ""; + $legacy_classname = ""; + $previous_classname = ""; + $fullname = ""; + GPBUtil::getFullClassName( + $proto, + $containing, + $file_proto, + $message_name_without_package, + $classname, + $legacy_classname, + $fullname, + $previous_classname); + $desc->setFullName($fullname); + $desc->setClass($classname); + $desc->setLegacyClass($legacy_classname); + $desc->setPreviouslyUnreservedClass($previous_classname); + $desc->setOptions($proto->getOptions()); + + foreach ($proto->getField() as $field_proto) { + $desc->addField(FieldDescriptor::buildFromProto($field_proto)); + } + + // Handle nested types. + foreach ($proto->getNestedType() as $nested_proto) { + $desc->addNestedType(Descriptor::buildFromProto( + $nested_proto, $file_proto, $message_name_without_package)); + } + + // Handle nested enum. + foreach ($proto->getEnumType() as $enum_proto) { + $desc->addEnumType(EnumDescriptor::buildFromProto( + $enum_proto, $file_proto, $message_name_without_package)); + } + + // Handle oneof fields. + $index = 0; + foreach ($proto->getOneofDecl() as $oneof_proto) { + $desc->addOneofDecl( + OneofDescriptor::buildFromProto($oneof_proto, $desc, $index)); + $index++; + } + + return $desc; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorPool.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorPool.php new file mode 100644 index 000000000..1be00e2ff --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorPool.php @@ -0,0 +1,194 @@ +mergeFromString($data); + + foreach($files->getFile() as $file_proto) { + $file = FileDescriptor::buildFromProto($file_proto); + + foreach ($file->getMessageType() as $desc) { + $this->addDescriptor($desc); + } + unset($desc); + + foreach ($file->getEnumType() as $desc) { + $this->addEnumDescriptor($desc); + } + unset($desc); + + foreach ($file->getMessageType() as $desc) { + $this->crossLink($desc); + } + unset($desc); + } + } + + public function addMessage($name, $klass) + { + return new MessageBuilderContext($name, $klass, $this); + } + + public function addEnum($name, $klass) + { + return new EnumBuilderContext($name, $klass, $this); + } + + public function addDescriptor($descriptor) + { + $this->proto_to_class[$descriptor->getFullName()] = + $descriptor->getClass(); + $this->class_to_desc[$descriptor->getClass()] = $descriptor; + $this->class_to_desc[$descriptor->getLegacyClass()] = $descriptor; + $this->class_to_desc[$descriptor->getPreviouslyUnreservedClass()] = $descriptor; + foreach ($descriptor->getNestedType() as $nested_type) { + $this->addDescriptor($nested_type); + } + foreach ($descriptor->getEnumType() as $enum_type) { + $this->addEnumDescriptor($enum_type); + } + } + + public function addEnumDescriptor($descriptor) + { + $this->proto_to_class[$descriptor->getFullName()] = + $descriptor->getClass(); + $this->class_to_enum_desc[$descriptor->getClass()] = $descriptor; + $this->class_to_enum_desc[$descriptor->getLegacyClass()] = $descriptor; + } + + public function getDescriptorByClassName($klass) + { + if (isset($this->class_to_desc[$klass])) { + return $this->class_to_desc[$klass]; + } else { + return null; + } + } + + public function getEnumDescriptorByClassName($klass) + { + if (isset($this->class_to_enum_desc[$klass])) { + return $this->class_to_enum_desc[$klass]; + } else { + return null; + } + } + + public function getDescriptorByProtoName($proto) + { + if (isset($this->proto_to_class[$proto])) { + $klass = $this->proto_to_class[$proto]; + return $this->class_to_desc[$klass]; + } else { + return null; + } + } + + public function getEnumDescriptorByProtoName($proto) + { + $klass = $this->proto_to_class[$proto]; + return $this->class_to_enum_desc[$klass]; + } + + private function crossLink(Descriptor $desc) + { + foreach ($desc->getField() as $field) { + switch ($field->getType()) { + case GPBType::MESSAGE: + $proto = $field->getMessageType(); + if ($proto[0] == '.') { + $proto = substr($proto, 1); + } + $subdesc = $this->getDescriptorByProtoName($proto); + if (is_null($subdesc)) { + trigger_error( + 'proto not added: ' . $proto + . " for " . $desc->getFullName(), E_USER_ERROR); + } + $field->setMessageType($subdesc); + break; + case GPBType::ENUM: + $proto = $field->getEnumType(); + if ($proto[0] == '.') { + $proto = substr($proto, 1); + } + $field->setEnumType( + $this->getEnumDescriptorByProtoName($proto)); + break; + default: + break; + } + } + unset($field); + + foreach ($desc->getNestedType() as $nested_type) { + $this->crossLink($nested_type); + } + unset($nested_type); + } + + public function finish() + { + foreach ($this->class_to_desc as $klass => $desc) { + $this->crossLink($desc); + } + unset($desc); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto.php new file mode 100644 index 000000000..2937c5a7c --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto.php @@ -0,0 +1,336 @@ +google.protobuf.DescriptorProto + */ +class DescriptorProto extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string name = 1; + */ + protected $name = null; + /** + * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto field = 2; + */ + private $field; + /** + * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto extension = 6; + */ + private $extension; + /** + * Generated from protobuf field repeated .google.protobuf.DescriptorProto nested_type = 3; + */ + private $nested_type; + /** + * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto enum_type = 4; + */ + private $enum_type; + /** + * Generated from protobuf field repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + */ + private $extension_range; + /** + * Generated from protobuf field repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; + */ + private $oneof_decl; + /** + * Generated from protobuf field optional .google.protobuf.MessageOptions options = 7; + */ + protected $options = null; + /** + * Generated from protobuf field repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + */ + private $reserved_range; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + * + * Generated from protobuf field repeated string reserved_name = 10; + */ + private $reserved_name; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type array<\Google\Protobuf\Internal\FieldDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $field + * @type array<\Google\Protobuf\Internal\FieldDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $extension + * @type array<\Google\Protobuf\Internal\DescriptorProto>|\Google\Protobuf\Internal\RepeatedField $nested_type + * @type array<\Google\Protobuf\Internal\EnumDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $enum_type + * @type array<\Google\Protobuf\Internal\DescriptorProto\ExtensionRange>|\Google\Protobuf\Internal\RepeatedField $extension_range + * @type array<\Google\Protobuf\Internal\OneofDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $oneof_decl + * @type \Google\Protobuf\Internal\MessageOptions $options + * @type array<\Google\Protobuf\Internal\DescriptorProto\ReservedRange>|\Google\Protobuf\Internal\RepeatedField $reserved_range + * @type array|\Google\Protobuf\Internal\RepeatedField $reserved_name + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string name = 1; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Generated from protobuf field optional string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto field = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getField() + { + return $this->field; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto field = 2; + * @param array<\Google\Protobuf\Internal\FieldDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setField($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class); + $this->field = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto extension = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExtension() + { + return $this->extension; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto extension = 6; + * @param array<\Google\Protobuf\Internal\FieldDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExtension($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class); + $this->extension = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.DescriptorProto nested_type = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNestedType() + { + return $this->nested_type; + } + + /** + * Generated from protobuf field repeated .google.protobuf.DescriptorProto nested_type = 3; + * @param array<\Google\Protobuf\Internal\DescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNestedType($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto::class); + $this->nested_type = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto enum_type = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEnumType() + { + return $this->enum_type; + } + + /** + * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto enum_type = 4; + * @param array<\Google\Protobuf\Internal\EnumDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEnumType($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumDescriptorProto::class); + $this->enum_type = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExtensionRange() + { + return $this->extension_range; + } + + /** + * Generated from protobuf field repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + * @param array<\Google\Protobuf\Internal\DescriptorProto\ExtensionRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExtensionRange($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto\ExtensionRange::class); + $this->extension_range = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOneofDecl() + { + return $this->oneof_decl; + } + + /** + * Generated from protobuf field repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; + * @param array<\Google\Protobuf\Internal\OneofDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOneofDecl($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\OneofDescriptorProto::class); + $this->oneof_decl = $arr; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.MessageOptions options = 7; + * @return \Google\Protobuf\Internal\MessageOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Generated from protobuf field optional .google.protobuf.MessageOptions options = 7; + * @param \Google\Protobuf\Internal\MessageOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\MessageOptions::class); + $this->options = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReservedRange() + { + return $this->reserved_range; + } + + /** + * Generated from protobuf field repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + * @param array<\Google\Protobuf\Internal\DescriptorProto\ReservedRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReservedRange($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto\ReservedRange::class); + $this->reserved_range = $arr; + + return $this; + } + + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + * + * Generated from protobuf field repeated string reserved_name = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReservedName() + { + return $this->reserved_name; + } + + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + * + * Generated from protobuf field repeated string reserved_name = 10; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReservedName($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->reserved_name = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php new file mode 100644 index 000000000..43c33c4a9 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php @@ -0,0 +1,161 @@ +google.protobuf.DescriptorProto.ExtensionRange + */ +class ExtensionRange extends \Google\Protobuf\Internal\Message +{ + /** + * Inclusive. + * + * Generated from protobuf field optional int32 start = 1; + */ + protected $start = null; + /** + * Exclusive. + * + * Generated from protobuf field optional int32 end = 2; + */ + protected $end = null; + /** + * Generated from protobuf field optional .google.protobuf.ExtensionRangeOptions options = 3; + */ + protected $options = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $start + * Inclusive. + * @type int $end + * Exclusive. + * @type \Google\Protobuf\Internal\ExtensionRangeOptions $options + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Inclusive. + * + * Generated from protobuf field optional int32 start = 1; + * @return int + */ + public function getStart() + { + return isset($this->start) ? $this->start : 0; + } + + public function hasStart() + { + return isset($this->start); + } + + public function clearStart() + { + unset($this->start); + } + + /** + * Inclusive. + * + * Generated from protobuf field optional int32 start = 1; + * @param int $var + * @return $this + */ + public function setStart($var) + { + GPBUtil::checkInt32($var); + $this->start = $var; + + return $this; + } + + /** + * Exclusive. + * + * Generated from protobuf field optional int32 end = 2; + * @return int + */ + public function getEnd() + { + return isset($this->end) ? $this->end : 0; + } + + public function hasEnd() + { + return isset($this->end); + } + + public function clearEnd() + { + unset($this->end); + } + + /** + * Exclusive. + * + * Generated from protobuf field optional int32 end = 2; + * @param int $var + * @return $this + */ + public function setEnd($var) + { + GPBUtil::checkInt32($var); + $this->end = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.ExtensionRangeOptions options = 3; + * @return \Google\Protobuf\Internal\ExtensionRangeOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Generated from protobuf field optional .google.protobuf.ExtensionRangeOptions options = 3; + * @param \Google\Protobuf\Internal\ExtensionRangeOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\ExtensionRangeOptions::class); + $this->options = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ExtensionRange::class, \Google\Protobuf\Internal\DescriptorProto_ExtensionRange::class); + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php new file mode 100644 index 000000000..f099cc345 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php @@ -0,0 +1,128 @@ +google.protobuf.DescriptorProto.ReservedRange + */ +class ReservedRange extends \Google\Protobuf\Internal\Message +{ + /** + * Inclusive. + * + * Generated from protobuf field optional int32 start = 1; + */ + protected $start = null; + /** + * Exclusive. + * + * Generated from protobuf field optional int32 end = 2; + */ + protected $end = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $start + * Inclusive. + * @type int $end + * Exclusive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Inclusive. + * + * Generated from protobuf field optional int32 start = 1; + * @return int + */ + public function getStart() + { + return isset($this->start) ? $this->start : 0; + } + + public function hasStart() + { + return isset($this->start); + } + + public function clearStart() + { + unset($this->start); + } + + /** + * Inclusive. + * + * Generated from protobuf field optional int32 start = 1; + * @param int $var + * @return $this + */ + public function setStart($var) + { + GPBUtil::checkInt32($var); + $this->start = $var; + + return $this; + } + + /** + * Exclusive. + * + * Generated from protobuf field optional int32 end = 2; + * @return int + */ + public function getEnd() + { + return isset($this->end) ? $this->end : 0; + } + + public function hasEnd() + { + return isset($this->end); + } + + public function clearEnd() + { + unset($this->end); + } + + /** + * Exclusive. + * + * Generated from protobuf field optional int32 end = 2; + * @param int $var + * @return $this + */ + public function setEnd($var) + { + GPBUtil::checkInt32($var); + $this->end = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ReservedRange::class, \Google\Protobuf\Internal\DescriptorProto_ReservedRange::class); + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php new file mode 100644 index 000000000..c928fbe5b --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php @@ -0,0 +1,16 @@ +descriptor = new EnumDescriptor(); + $this->descriptor->setFullName($full_name); + $this->descriptor->setClass($klass); + $this->pool = $pool; + } + + public function value($name, $number) + { + $value = new EnumValueDescriptor($name, $number); + $this->descriptor->addValue($number, $value); + return $this; + } + + public function finalizeToPool() + { + $this->pool->addEnumDescriptor($this->descriptor); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptor.php new file mode 100644 index 000000000..383f53b13 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptor.php @@ -0,0 +1,116 @@ +public_desc = new \Google\Protobuf\EnumDescriptor($this); + } + + public function setFullName($full_name) + { + $this->full_name = $full_name; + } + + public function getFullName() + { + return $this->full_name; + } + + public function addValue($number, $value) + { + $this->value[$number] = $value; + $this->name_to_value[$value->getName()] = $value; + $this->value_descriptor[] = new EnumValueDescriptor($value->getName(), $number); + } + + public function getValueByNumber($number) + { + if (isset($this->value[$number])) { + return $this->value[$number]; + } + return null; + } + + public function getValueByName($name) + { + if (isset($this->name_to_value[$name])) { + return $this->name_to_value[$name]; + } + return null; + } + + public function getValueDescriptorByIndex($index) + { + if (isset($this->value_descriptor[$index])) { + return $this->value_descriptor[$index]; + } + return null; + } + + public function getValueCount() + { + return count($this->value); + } + + public function setClass($klass) + { + $this->klass = $klass; + } + + public function getClass() + { + return $this->klass; + } + + public function setLegacyClass($klass) + { + $this->legacy_klass = $klass; + } + + public function getLegacyClass() + { + return $this->legacy_klass; + } + + public static function buildFromProto($proto, $file_proto, $containing) + { + $desc = new EnumDescriptor(); + + $enum_name_without_package = ""; + $classname = ""; + $legacy_classname = ""; + $fullname = ""; + GPBUtil::getFullClassName( + $proto, + $containing, + $file_proto, + $enum_name_without_package, + $classname, + $legacy_classname, + $fullname, + $unused_previous_classname); + $desc->setFullName($fullname); + $desc->setClass($classname); + $desc->setLegacyClass($legacy_classname); + $values = $proto->getValue(); + foreach ($values as $value) { + $desc->addValue($value->getNumber(), $value); + } + + return $desc; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto.php new file mode 100644 index 000000000..cb2a42ae3 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto.php @@ -0,0 +1,216 @@ +google.protobuf.EnumDescriptorProto + */ +class EnumDescriptorProto extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string name = 1; + */ + protected $name = null; + /** + * Generated from protobuf field repeated .google.protobuf.EnumValueDescriptorProto value = 2; + */ + private $value; + /** + * Generated from protobuf field optional .google.protobuf.EnumOptions options = 3; + */ + protected $options = null; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + * + * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + */ + private $reserved_range; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + * + * Generated from protobuf field repeated string reserved_name = 5; + */ + private $reserved_name; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type array<\Google\Protobuf\Internal\EnumValueDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $value + * @type \Google\Protobuf\Internal\EnumOptions $options + * @type array<\Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange>|\Google\Protobuf\Internal\RepeatedField $reserved_range + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + * @type array|\Google\Protobuf\Internal\RepeatedField $reserved_name + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string name = 1; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Generated from protobuf field optional string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.EnumValueDescriptorProto value = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValue() + { + return $this->value; + } + + /** + * Generated from protobuf field repeated .google.protobuf.EnumValueDescriptorProto value = 2; + * @param array<\Google\Protobuf\Internal\EnumValueDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValue($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumValueDescriptorProto::class); + $this->value = $arr; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.EnumOptions options = 3; + * @return \Google\Protobuf\Internal\EnumOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Generated from protobuf field optional .google.protobuf.EnumOptions options = 3; + * @param \Google\Protobuf\Internal\EnumOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\EnumOptions::class); + $this->options = $var; + + return $this; + } + + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + * + * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReservedRange() + { + return $this->reserved_range; + } + + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + * + * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + * @param array<\Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReservedRange($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange::class); + $this->reserved_range = $arr; + + return $this; + } + + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + * + * Generated from protobuf field repeated string reserved_name = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReservedName() + { + return $this->reserved_name; + } + + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + * + * Generated from protobuf field repeated string reserved_name = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReservedName($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->reserved_name = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php new file mode 100644 index 000000000..7282fccb0 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php @@ -0,0 +1,130 @@ +google.protobuf.EnumDescriptorProto.EnumReservedRange + */ +class EnumReservedRange extends \Google\Protobuf\Internal\Message +{ + /** + * Inclusive. + * + * Generated from protobuf field optional int32 start = 1; + */ + protected $start = null; + /** + * Inclusive. + * + * Generated from protobuf field optional int32 end = 2; + */ + protected $end = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $start + * Inclusive. + * @type int $end + * Inclusive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Inclusive. + * + * Generated from protobuf field optional int32 start = 1; + * @return int + */ + public function getStart() + { + return isset($this->start) ? $this->start : 0; + } + + public function hasStart() + { + return isset($this->start); + } + + public function clearStart() + { + unset($this->start); + } + + /** + * Inclusive. + * + * Generated from protobuf field optional int32 start = 1; + * @param int $var + * @return $this + */ + public function setStart($var) + { + GPBUtil::checkInt32($var); + $this->start = $var; + + return $this; + } + + /** + * Inclusive. + * + * Generated from protobuf field optional int32 end = 2; + * @return int + */ + public function getEnd() + { + return isset($this->end) ? $this->end : 0; + } + + public function hasEnd() + { + return isset($this->end); + } + + public function clearEnd() + { + unset($this->end); + } + + /** + * Inclusive. + * + * Generated from protobuf field optional int32 end = 2; + * @param int $var + * @return $this + */ + public function setEnd($var) + { + GPBUtil::checkInt32($var); + $this->end = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(EnumReservedRange::class, \Google\Protobuf\Internal\EnumDescriptorProto_EnumReservedRange::class); + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto_EnumReservedRange.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto_EnumReservedRange.php new file mode 100644 index 000000000..b1b59ed91 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto_EnumReservedRange.php @@ -0,0 +1,16 @@ +google.protobuf.EnumOptions + */ +class EnumOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Set this option to true to allow mapping different tag names to the same + * value. + * + * Generated from protobuf field optional bool allow_alias = 2; + */ + protected $allow_alias = null; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + * + * Generated from protobuf field optional bool deprecated = 3 [default = false]; + */ + protected $deprecated = null; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO(b/261750190) Remove this legacy behavior once downstream teams have + * had time to migrate. + * + * Generated from protobuf field optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + * @deprecated + */ + protected $deprecated_legacy_json_field_conflicts = null; + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + private $uninterpreted_option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $allow_alias + * Set this option to true to allow mapping different tag names to the same + * value. + * @type bool $deprecated + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + * @type bool $deprecated_legacy_json_field_conflicts + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO(b/261750190) Remove this legacy behavior once downstream teams have + * had time to migrate. + * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * The parser stores options it doesn't recognize here. See above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Set this option to true to allow mapping different tag names to the same + * value. + * + * Generated from protobuf field optional bool allow_alias = 2; + * @return bool + */ + public function getAllowAlias() + { + return isset($this->allow_alias) ? $this->allow_alias : false; + } + + public function hasAllowAlias() + { + return isset($this->allow_alias); + } + + public function clearAllowAlias() + { + unset($this->allow_alias); + } + + /** + * Set this option to true to allow mapping different tag names to the same + * value. + * + * Generated from protobuf field optional bool allow_alias = 2; + * @param bool $var + * @return $this + */ + public function setAllowAlias($var) + { + GPBUtil::checkBool($var); + $this->allow_alias = $var; + + return $this; + } + + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + * + * Generated from protobuf field optional bool deprecated = 3 [default = false]; + * @return bool + */ + public function getDeprecated() + { + return isset($this->deprecated) ? $this->deprecated : false; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + * + * Generated from protobuf field optional bool deprecated = 3 [default = false]; + * @param bool $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkBool($var); + $this->deprecated = $var; + + return $this; + } + + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO(b/261750190) Remove this legacy behavior once downstream teams have + * had time to migrate. + * + * Generated from protobuf field optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + * @return bool + * @deprecated + */ + public function getDeprecatedLegacyJsonFieldConflicts() + { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + return isset($this->deprecated_legacy_json_field_conflicts) ? $this->deprecated_legacy_json_field_conflicts : false; + } + + public function hasDeprecatedLegacyJsonFieldConflicts() + { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + return isset($this->deprecated_legacy_json_field_conflicts); + } + + public function clearDeprecatedLegacyJsonFieldConflicts() + { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + unset($this->deprecated_legacy_json_field_conflicts); + } + + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO(b/261750190) Remove this legacy behavior once downstream teams have + * had time to migrate. + * + * Generated from protobuf field optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setDeprecatedLegacyJsonFieldConflicts($var) + { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->deprecated_legacy_json_field_conflicts = $var; + + return $this; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUninterpretedOption() + { + return $this->uninterpreted_option; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUninterpretedOption($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class); + $this->uninterpreted_option = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php new file mode 100644 index 000000000..0feaea6f1 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php @@ -0,0 +1,146 @@ +google.protobuf.EnumValueDescriptorProto + */ +class EnumValueDescriptorProto extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string name = 1; + */ + protected $name = null; + /** + * Generated from protobuf field optional int32 number = 2; + */ + protected $number = null; + /** + * Generated from protobuf field optional .google.protobuf.EnumValueOptions options = 3; + */ + protected $options = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type int $number + * @type \Google\Protobuf\Internal\EnumValueOptions $options + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string name = 1; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Generated from protobuf field optional string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field optional int32 number = 2; + * @return int + */ + public function getNumber() + { + return isset($this->number) ? $this->number : 0; + } + + public function hasNumber() + { + return isset($this->number); + } + + public function clearNumber() + { + unset($this->number); + } + + /** + * Generated from protobuf field optional int32 number = 2; + * @param int $var + * @return $this + */ + public function setNumber($var) + { + GPBUtil::checkInt32($var); + $this->number = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.EnumValueOptions options = 3; + * @return \Google\Protobuf\Internal\EnumValueOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Generated from protobuf field optional .google.protobuf.EnumValueOptions options = 3; + * @param \Google\Protobuf\Internal\EnumValueOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\EnumValueOptions::class); + $this->options = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueOptions.php new file mode 100644 index 000000000..2db7fceea --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueOptions.php @@ -0,0 +1,123 @@ +google.protobuf.EnumValueOptions + */ +class EnumValueOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + * + * Generated from protobuf field optional bool deprecated = 1 [default = false]; + */ + protected $deprecated = null; + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + private $uninterpreted_option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $deprecated + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * The parser stores options it doesn't recognize here. See above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + * + * Generated from protobuf field optional bool deprecated = 1 [default = false]; + * @return bool + */ + public function getDeprecated() + { + return isset($this->deprecated) ? $this->deprecated : false; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + * + * Generated from protobuf field optional bool deprecated = 1 [default = false]; + * @param bool $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkBool($var); + $this->deprecated = $var; + + return $this; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUninterpretedOption() + { + return $this->uninterpreted_option; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUninterpretedOption($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class); + $this->uninterpreted_option = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions.php new file mode 100644 index 000000000..245173c3d --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions.php @@ -0,0 +1,67 @@ +google.protobuf.ExtensionRangeOptions + */ +class ExtensionRangeOptions extends \Google\Protobuf\Internal\Message +{ + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + private $uninterpreted_option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * The parser stores options it doesn't recognize here. See above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUninterpretedOption() + { + return $this->uninterpreted_option; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUninterpretedOption($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class); + $this->uninterpreted_option = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptor.php new file mode 100644 index 000000000..3a9a73b72 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptor.php @@ -0,0 +1,326 @@ +public_desc = new \Google\Protobuf\FieldDescriptor($this); + } + + public function setOneofIndex($index) + { + $this->oneof_index = $index; + } + + public function getOneofIndex() + { + return $this->oneof_index; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getName() + { + return $this->name; + } + + public function setJsonName($json_name) + { + $this->json_name = $json_name; + } + + public function getJsonName() + { + return $this->json_name; + } + + public function setSetter($setter) + { + $this->setter = $setter; + } + + public function getSetter() + { + return $this->setter; + } + + public function setGetter($getter) + { + $this->getter = $getter; + } + + public function getGetter() + { + return $this->getter; + } + + public function setNumber($number) + { + $this->number = $number; + } + + public function getNumber() + { + return $this->number; + } + + public function setLabel($label) + { + $this->label = $label; + } + + public function getLabel() + { + return $this->label; + } + + public function isRepeated() + { + return $this->label === GPBLabel::REPEATED; + } + + public function setType($type) + { + $this->type = $type; + } + + public function getType() + { + return $this->type; + } + + public function setMessageType($message_type) + { + $this->message_type = $message_type; + } + + public function getMessageType() + { + return $this->message_type; + } + + public function setEnumType($enum_type) + { + $this->enum_type = $enum_type; + } + + public function getEnumType() + { + return $this->enum_type; + } + + public function setPacked($packed) + { + $this->packed = $packed; + } + + public function getPacked() + { + return $this->packed; + } + + public function getProto3Optional() + { + return $this->proto3_optional; + } + + public function setProto3Optional($proto3_optional) + { + $this->proto3_optional = $proto3_optional; + } + + public function getContainingOneof() + { + return $this->containing_oneof; + } + + public function setContainingOneof($containing_oneof) + { + $this->containing_oneof = $containing_oneof; + } + + public function getRealContainingOneof() + { + return !is_null($this->containing_oneof) && !$this->containing_oneof->isSynthetic() + ? $this->containing_oneof : null; + } + + public function isPackable() + { + return $this->isRepeated() && self::isTypePackable($this->type); + } + + public function isMap() + { + return $this->getType() == GPBType::MESSAGE && + !is_null($this->getMessageType()->getOptions()) && + $this->getMessageType()->getOptions()->getMapEntry(); + } + + public function isTimestamp() + { + return $this->getType() == GPBType::MESSAGE && + $this->getMessageType()->getClass() === "Google\Protobuf\Timestamp"; + } + + public function isWrapperType() + { + if ($this->getType() == GPBType::MESSAGE) { + $class = $this->getMessageType()->getClass(); + return in_array($class, [ + "Google\Protobuf\DoubleValue", + "Google\Protobuf\FloatValue", + "Google\Protobuf\Int64Value", + "Google\Protobuf\UInt64Value", + "Google\Protobuf\Int32Value", + "Google\Protobuf\UInt32Value", + "Google\Protobuf\BoolValue", + "Google\Protobuf\StringValue", + "Google\Protobuf\BytesValue", + ]); + } + return false; + } + + private static function isTypePackable($field_type) + { + return ($field_type !== GPBType::STRING && + $field_type !== GPBType::GROUP && + $field_type !== GPBType::MESSAGE && + $field_type !== GPBType::BYTES); + } + + /** + * @param FieldDescriptorProto $proto + * @return FieldDescriptor + */ + public static function getFieldDescriptor($proto) + { + $type_name = null; + $type = $proto->getType(); + switch ($type) { + case GPBType::MESSAGE: + case GPBType::GROUP: + case GPBType::ENUM: + $type_name = $proto->getTypeName(); + break; + default: + break; + } + + $oneof_index = $proto->hasOneofIndex() ? $proto->getOneofIndex() : -1; + // TODO: once proto2 is supported, this default should be false + // for proto2. + if ($proto->getLabel() === GPBLabel::REPEATED && + $proto->getType() !== GPBType::MESSAGE && + $proto->getType() !== GPBType::GROUP && + $proto->getType() !== GPBType::STRING && + $proto->getType() !== GPBType::BYTES) { + $packed = true; + } else { + $packed = false; + } + $options = $proto->getOptions(); + if ($options !== null) { + $packed = $options->getPacked(); + } + + $field = new FieldDescriptor(); + $field->setName($proto->getName()); + + if ($proto->hasJsonName()) { + $json_name = $proto->getJsonName(); + } else { + $proto_name = $proto->getName(); + $json_name = implode('', array_map('ucwords', explode('_', $proto_name))); + if ($proto_name[0] !== "_" && !ctype_upper($proto_name[0])) { + $json_name = lcfirst($json_name); + } + } + $field->setJsonName($json_name); + + $camel_name = implode('', array_map('ucwords', explode('_', $proto->getName()))); + $field->setGetter('get' . $camel_name); + $field->setSetter('set' . $camel_name); + $field->setType($proto->getType()); + $field->setNumber($proto->getNumber()); + $field->setLabel($proto->getLabel()); + $field->setPacked($packed); + $field->setOneofIndex($oneof_index); + $field->setProto3Optional($proto->getProto3Optional()); + + // At this time, the message/enum type may have not been added to pool. + // So we use the type name as place holder and will replace it with the + // actual descriptor in cross building. + switch ($type) { + case GPBType::MESSAGE: + $field->setMessageType($type_name); + break; + case GPBType::ENUM: + $field->setEnumType($type_name); + break; + default: + break; + } + + return $field; + } + + public static function buildFromProto($proto) + { + return FieldDescriptor::getFieldDescriptor($proto); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto.php new file mode 100644 index 000000000..5e99bff17 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto.php @@ -0,0 +1,611 @@ +google.protobuf.FieldDescriptorProto + */ +class FieldDescriptorProto extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string name = 1; + */ + protected $name = null; + /** + * Generated from protobuf field optional int32 number = 3; + */ + protected $number = null; + /** + * Generated from protobuf field optional .google.protobuf.FieldDescriptorProto.Label label = 4; + */ + protected $label = null; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + * + * Generated from protobuf field optional .google.protobuf.FieldDescriptorProto.Type type = 5; + */ + protected $type = null; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + * + * Generated from protobuf field optional string type_name = 6; + */ + protected $type_name = null; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + * + * Generated from protobuf field optional string extendee = 2; + */ + protected $extendee = null; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * + * Generated from protobuf field optional string default_value = 7; + */ + protected $default_value = null; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + * + * Generated from protobuf field optional int32 oneof_index = 9; + */ + protected $oneof_index = null; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + * + * Generated from protobuf field optional string json_name = 10; + */ + protected $json_name = null; + /** + * Generated from protobuf field optional .google.protobuf.FieldOptions options = 8; + */ + protected $options = null; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * When proto3_optional is true, this field must be belong to a oneof to + * signal to old proto3 clients that presence is tracked for this field. This + * oneof is known as a "synthetic" oneof, and this field must be its sole + * member (each proto3 optional field gets its own synthetic oneof). Synthetic + * oneofs exist in the descriptor only, and do not generate any API. Synthetic + * oneofs must be ordered after all "real" oneofs. + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + * + * Generated from protobuf field optional bool proto3_optional = 17; + */ + protected $proto3_optional = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type int $number + * @type int $label + * @type int $type + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + * @type string $type_name + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + * @type string $extendee + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + * @type string $default_value + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * @type int $oneof_index + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + * @type string $json_name + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + * @type \Google\Protobuf\Internal\FieldOptions $options + * @type bool $proto3_optional + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * When proto3_optional is true, this field must be belong to a oneof to + * signal to old proto3 clients that presence is tracked for this field. This + * oneof is known as a "synthetic" oneof, and this field must be its sole + * member (each proto3 optional field gets its own synthetic oneof). Synthetic + * oneofs exist in the descriptor only, and do not generate any API. Synthetic + * oneofs must be ordered after all "real" oneofs. + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string name = 1; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Generated from protobuf field optional string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field optional int32 number = 3; + * @return int + */ + public function getNumber() + { + return isset($this->number) ? $this->number : 0; + } + + public function hasNumber() + { + return isset($this->number); + } + + public function clearNumber() + { + unset($this->number); + } + + /** + * Generated from protobuf field optional int32 number = 3; + * @param int $var + * @return $this + */ + public function setNumber($var) + { + GPBUtil::checkInt32($var); + $this->number = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FieldDescriptorProto.Label label = 4; + * @return int + */ + public function getLabel() + { + return isset($this->label) ? $this->label : 0; + } + + public function hasLabel() + { + return isset($this->label); + } + + public function clearLabel() + { + unset($this->label); + } + + /** + * Generated from protobuf field optional .google.protobuf.FieldDescriptorProto.Label label = 4; + * @param int $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldDescriptorProto\Label::class); + $this->label = $var; + + return $this; + } + + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + * + * Generated from protobuf field optional .google.protobuf.FieldDescriptorProto.Type type = 5; + * @return int + */ + public function getType() + { + return isset($this->type) ? $this->type : 0; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + * + * Generated from protobuf field optional .google.protobuf.FieldDescriptorProto.Type type = 5; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldDescriptorProto\Type::class); + $this->type = $var; + + return $this; + } + + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + * + * Generated from protobuf field optional string type_name = 6; + * @return string + */ + public function getTypeName() + { + return isset($this->type_name) ? $this->type_name : ''; + } + + public function hasTypeName() + { + return isset($this->type_name); + } + + public function clearTypeName() + { + unset($this->type_name); + } + + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + * + * Generated from protobuf field optional string type_name = 6; + * @param string $var + * @return $this + */ + public function setTypeName($var) + { + GPBUtil::checkString($var, True); + $this->type_name = $var; + + return $this; + } + + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + * + * Generated from protobuf field optional string extendee = 2; + * @return string + */ + public function getExtendee() + { + return isset($this->extendee) ? $this->extendee : ''; + } + + public function hasExtendee() + { + return isset($this->extendee); + } + + public function clearExtendee() + { + unset($this->extendee); + } + + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + * + * Generated from protobuf field optional string extendee = 2; + * @param string $var + * @return $this + */ + public function setExtendee($var) + { + GPBUtil::checkString($var, True); + $this->extendee = $var; + + return $this; + } + + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * + * Generated from protobuf field optional string default_value = 7; + * @return string + */ + public function getDefaultValue() + { + return isset($this->default_value) ? $this->default_value : ''; + } + + public function hasDefaultValue() + { + return isset($this->default_value); + } + + public function clearDefaultValue() + { + unset($this->default_value); + } + + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * + * Generated from protobuf field optional string default_value = 7; + * @param string $var + * @return $this + */ + public function setDefaultValue($var) + { + GPBUtil::checkString($var, True); + $this->default_value = $var; + + return $this; + } + + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + * + * Generated from protobuf field optional int32 oneof_index = 9; + * @return int + */ + public function getOneofIndex() + { + return isset($this->oneof_index) ? $this->oneof_index : 0; + } + + public function hasOneofIndex() + { + return isset($this->oneof_index); + } + + public function clearOneofIndex() + { + unset($this->oneof_index); + } + + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + * + * Generated from protobuf field optional int32 oneof_index = 9; + * @param int $var + * @return $this + */ + public function setOneofIndex($var) + { + GPBUtil::checkInt32($var); + $this->oneof_index = $var; + + return $this; + } + + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + * + * Generated from protobuf field optional string json_name = 10; + * @return string + */ + public function getJsonName() + { + return isset($this->json_name) ? $this->json_name : ''; + } + + public function hasJsonName() + { + return isset($this->json_name); + } + + public function clearJsonName() + { + unset($this->json_name); + } + + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + * + * Generated from protobuf field optional string json_name = 10; + * @param string $var + * @return $this + */ + public function setJsonName($var) + { + GPBUtil::checkString($var, True); + $this->json_name = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FieldOptions options = 8; + * @return \Google\Protobuf\Internal\FieldOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Generated from protobuf field optional .google.protobuf.FieldOptions options = 8; + * @param \Google\Protobuf\Internal\FieldOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FieldOptions::class); + $this->options = $var; + + return $this; + } + + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * When proto3_optional is true, this field must be belong to a oneof to + * signal to old proto3 clients that presence is tracked for this field. This + * oneof is known as a "synthetic" oneof, and this field must be its sole + * member (each proto3 optional field gets its own synthetic oneof). Synthetic + * oneofs exist in the descriptor only, and do not generate any API. Synthetic + * oneofs must be ordered after all "real" oneofs. + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + * + * Generated from protobuf field optional bool proto3_optional = 17; + * @return bool + */ + public function getProto3Optional() + { + return isset($this->proto3_optional) ? $this->proto3_optional : false; + } + + public function hasProto3Optional() + { + return isset($this->proto3_optional); + } + + public function clearProto3Optional() + { + unset($this->proto3_optional); + } + + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * When proto3_optional is true, this field must be belong to a oneof to + * signal to old proto3 clients that presence is tracked for this field. This + * oneof is known as a "synthetic" oneof, and this field must be its sole + * member (each proto3 optional field gets its own synthetic oneof). Synthetic + * oneofs exist in the descriptor only, and do not generate any API. Synthetic + * oneofs must be ordered after all "real" oneofs. + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + * + * Generated from protobuf field optional bool proto3_optional = 17; + * @param bool $var + * @return $this + */ + public function setProto3Optional($var) + { + GPBUtil::checkBool($var); + $this->proto3_optional = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Label.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Label.php new file mode 100644 index 000000000..a54b228f1 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Label.php @@ -0,0 +1,58 @@ +google.protobuf.FieldDescriptorProto.Label + */ +class Label +{ + /** + * 0 is reserved for errors + * + * Generated from protobuf enum LABEL_OPTIONAL = 1; + */ + const LABEL_OPTIONAL = 1; + /** + * Generated from protobuf enum LABEL_REQUIRED = 2; + */ + const LABEL_REQUIRED = 2; + /** + * Generated from protobuf enum LABEL_REPEATED = 3; + */ + const LABEL_REPEATED = 3; + + private static $valueToName = [ + self::LABEL_OPTIONAL => 'LABEL_OPTIONAL', + self::LABEL_REQUIRED => 'LABEL_REQUIRED', + self::LABEL_REPEATED => 'LABEL_REPEATED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Label::class, \Google\Protobuf\Internal\FieldDescriptorProto_Label::class); + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Type.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Type.php new file mode 100644 index 000000000..6072e9990 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Type.php @@ -0,0 +1,153 @@ +google.protobuf.FieldDescriptorProto.Type + */ +class Type +{ + /** + * 0 is reserved for errors. + * Order is weird for historical reasons. + * + * Generated from protobuf enum TYPE_DOUBLE = 1; + */ + const TYPE_DOUBLE = 1; + /** + * Generated from protobuf enum TYPE_FLOAT = 2; + */ + const TYPE_FLOAT = 2; + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + * + * Generated from protobuf enum TYPE_INT64 = 3; + */ + const TYPE_INT64 = 3; + /** + * Generated from protobuf enum TYPE_UINT64 = 4; + */ + const TYPE_UINT64 = 4; + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + * + * Generated from protobuf enum TYPE_INT32 = 5; + */ + const TYPE_INT32 = 5; + /** + * Generated from protobuf enum TYPE_FIXED64 = 6; + */ + const TYPE_FIXED64 = 6; + /** + * Generated from protobuf enum TYPE_FIXED32 = 7; + */ + const TYPE_FIXED32 = 7; + /** + * Generated from protobuf enum TYPE_BOOL = 8; + */ + const TYPE_BOOL = 8; + /** + * Generated from protobuf enum TYPE_STRING = 9; + */ + const TYPE_STRING = 9; + /** + * Tag-delimited aggregate. + * Group type is deprecated and not supported in proto3. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. + * + * Generated from protobuf enum TYPE_GROUP = 10; + */ + const TYPE_GROUP = 10; + /** + * Length-delimited aggregate. + * + * Generated from protobuf enum TYPE_MESSAGE = 11; + */ + const TYPE_MESSAGE = 11; + /** + * New in version 2. + * + * Generated from protobuf enum TYPE_BYTES = 12; + */ + const TYPE_BYTES = 12; + /** + * Generated from protobuf enum TYPE_UINT32 = 13; + */ + const TYPE_UINT32 = 13; + /** + * Generated from protobuf enum TYPE_ENUM = 14; + */ + const TYPE_ENUM = 14; + /** + * Generated from protobuf enum TYPE_SFIXED32 = 15; + */ + const TYPE_SFIXED32 = 15; + /** + * Generated from protobuf enum TYPE_SFIXED64 = 16; + */ + const TYPE_SFIXED64 = 16; + /** + * Uses ZigZag encoding. + * + * Generated from protobuf enum TYPE_SINT32 = 17; + */ + const TYPE_SINT32 = 17; + /** + * Uses ZigZag encoding. + * + * Generated from protobuf enum TYPE_SINT64 = 18; + */ + const TYPE_SINT64 = 18; + + private static $valueToName = [ + self::TYPE_DOUBLE => 'TYPE_DOUBLE', + self::TYPE_FLOAT => 'TYPE_FLOAT', + self::TYPE_INT64 => 'TYPE_INT64', + self::TYPE_UINT64 => 'TYPE_UINT64', + self::TYPE_INT32 => 'TYPE_INT32', + self::TYPE_FIXED64 => 'TYPE_FIXED64', + self::TYPE_FIXED32 => 'TYPE_FIXED32', + self::TYPE_BOOL => 'TYPE_BOOL', + self::TYPE_STRING => 'TYPE_STRING', + self::TYPE_GROUP => 'TYPE_GROUP', + self::TYPE_MESSAGE => 'TYPE_MESSAGE', + self::TYPE_BYTES => 'TYPE_BYTES', + self::TYPE_UINT32 => 'TYPE_UINT32', + self::TYPE_ENUM => 'TYPE_ENUM', + self::TYPE_SFIXED32 => 'TYPE_SFIXED32', + self::TYPE_SFIXED64 => 'TYPE_SFIXED64', + self::TYPE_SINT32 => 'TYPE_SINT32', + self::TYPE_SINT64 => 'TYPE_SINT64', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Protobuf\Internal\FieldDescriptorProto_Type::class); + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php new file mode 100644 index 000000000..218a846e1 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php @@ -0,0 +1,16 @@ +google.protobuf.FieldOptions + */ +class FieldOptions extends \Google\Protobuf\Internal\Message +{ + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + * + * Generated from protobuf field optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + */ + protected $ctype = null; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + * + * Generated from protobuf field optional bool packed = 2; + */ + protected $packed = null; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + * + * Generated from protobuf field optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; + */ + protected $jstype = null; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + * As of May 2022, lazy verifies the contents of the byte stream during + * parsing. An invalid byte stream will cause the overall parsing to fail. + * + * Generated from protobuf field optional bool lazy = 5 [default = false]; + */ + protected $lazy = null; + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + * + * Generated from protobuf field optional bool unverified_lazy = 15 [default = false]; + */ + protected $unverified_lazy = null; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + * + * Generated from protobuf field optional bool deprecated = 3 [default = false]; + */ + protected $deprecated = null; + /** + * For Google-internal migration only. Do not use. + * + * Generated from protobuf field optional bool weak = 10 [default = false]; + */ + protected $weak = null; + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + private $uninterpreted_option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $ctype + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + * @type bool $packed + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + * @type int $jstype + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + * @type bool $lazy + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + * As of May 2022, lazy verifies the contents of the byte stream during + * parsing. An invalid byte stream will cause the overall parsing to fail. + * @type bool $unverified_lazy + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + * @type bool $deprecated + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + * @type bool $weak + * For Google-internal migration only. Do not use. + * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * The parser stores options it doesn't recognize here. See above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + * + * Generated from protobuf field optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + * @return int + */ + public function getCtype() + { + return isset($this->ctype) ? $this->ctype : 0; + } + + public function hasCtype() + { + return isset($this->ctype); + } + + public function clearCtype() + { + unset($this->ctype); + } + + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + * + * Generated from protobuf field optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + * @param int $var + * @return $this + */ + public function setCtype($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldOptions\CType::class); + $this->ctype = $var; + + return $this; + } + + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + * + * Generated from protobuf field optional bool packed = 2; + * @return bool + */ + public function getPacked() + { + return isset($this->packed) ? $this->packed : false; + } + + public function hasPacked() + { + return isset($this->packed); + } + + public function clearPacked() + { + unset($this->packed); + } + + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + * + * Generated from protobuf field optional bool packed = 2; + * @param bool $var + * @return $this + */ + public function setPacked($var) + { + GPBUtil::checkBool($var); + $this->packed = $var; + + return $this; + } + + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + * + * Generated from protobuf field optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; + * @return int + */ + public function getJstype() + { + return isset($this->jstype) ? $this->jstype : 0; + } + + public function hasJstype() + { + return isset($this->jstype); + } + + public function clearJstype() + { + unset($this->jstype); + } + + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + * + * Generated from protobuf field optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; + * @param int $var + * @return $this + */ + public function setJstype($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldOptions\JSType::class); + $this->jstype = $var; + + return $this; + } + + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + * As of May 2022, lazy verifies the contents of the byte stream during + * parsing. An invalid byte stream will cause the overall parsing to fail. + * + * Generated from protobuf field optional bool lazy = 5 [default = false]; + * @return bool + */ + public function getLazy() + { + return isset($this->lazy) ? $this->lazy : false; + } + + public function hasLazy() + { + return isset($this->lazy); + } + + public function clearLazy() + { + unset($this->lazy); + } + + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + * As of May 2022, lazy verifies the contents of the byte stream during + * parsing. An invalid byte stream will cause the overall parsing to fail. + * + * Generated from protobuf field optional bool lazy = 5 [default = false]; + * @param bool $var + * @return $this + */ + public function setLazy($var) + { + GPBUtil::checkBool($var); + $this->lazy = $var; + + return $this; + } + + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + * + * Generated from protobuf field optional bool unverified_lazy = 15 [default = false]; + * @return bool + */ + public function getUnverifiedLazy() + { + return isset($this->unverified_lazy) ? $this->unverified_lazy : false; + } + + public function hasUnverifiedLazy() + { + return isset($this->unverified_lazy); + } + + public function clearUnverifiedLazy() + { + unset($this->unverified_lazy); + } + + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + * + * Generated from protobuf field optional bool unverified_lazy = 15 [default = false]; + * @param bool $var + * @return $this + */ + public function setUnverifiedLazy($var) + { + GPBUtil::checkBool($var); + $this->unverified_lazy = $var; + + return $this; + } + + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + * + * Generated from protobuf field optional bool deprecated = 3 [default = false]; + * @return bool + */ + public function getDeprecated() + { + return isset($this->deprecated) ? $this->deprecated : false; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + * + * Generated from protobuf field optional bool deprecated = 3 [default = false]; + * @param bool $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkBool($var); + $this->deprecated = $var; + + return $this; + } + + /** + * For Google-internal migration only. Do not use. + * + * Generated from protobuf field optional bool weak = 10 [default = false]; + * @return bool + */ + public function getWeak() + { + return isset($this->weak) ? $this->weak : false; + } + + public function hasWeak() + { + return isset($this->weak); + } + + public function clearWeak() + { + unset($this->weak); + } + + /** + * For Google-internal migration only. Do not use. + * + * Generated from protobuf field optional bool weak = 10 [default = false]; + * @param bool $var + * @return $this + */ + public function setWeak($var) + { + GPBUtil::checkBool($var); + $this->weak = $var; + + return $this; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUninterpretedOption() + { + return $this->uninterpreted_option; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUninterpretedOption($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class); + $this->uninterpreted_option = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/CType.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/CType.php new file mode 100644 index 000000000..ba9eb4adb --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/CType.php @@ -0,0 +1,58 @@ +google.protobuf.FieldOptions.CType + */ +class CType +{ + /** + * Default mode. + * + * Generated from protobuf enum STRING = 0; + */ + const STRING = 0; + /** + * Generated from protobuf enum CORD = 1; + */ + const CORD = 1; + /** + * Generated from protobuf enum STRING_PIECE = 2; + */ + const STRING_PIECE = 2; + + private static $valueToName = [ + self::STRING => 'STRING', + self::CORD => 'CORD', + self::STRING_PIECE => 'STRING_PIECE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CType::class, \Google\Protobuf\Internal\FieldOptions_CType::class); + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/JSType.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/JSType.php new file mode 100644 index 000000000..175a4330b --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/JSType.php @@ -0,0 +1,62 @@ +google.protobuf.FieldOptions.JSType + */ +class JSType +{ + /** + * Use the default type. + * + * Generated from protobuf enum JS_NORMAL = 0; + */ + const JS_NORMAL = 0; + /** + * Use JavaScript strings. + * + * Generated from protobuf enum JS_STRING = 1; + */ + const JS_STRING = 1; + /** + * Use JavaScript numbers. + * + * Generated from protobuf enum JS_NUMBER = 2; + */ + const JS_NUMBER = 2; + + private static $valueToName = [ + self::JS_NORMAL => 'JS_NORMAL', + self::JS_STRING => 'JS_STRING', + self::JS_NUMBER => 'JS_NUMBER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(JSType::class, \Google\Protobuf\Internal\FieldOptions_JSType::class); + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions_CType.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions_CType.php new file mode 100644 index 000000000..4d18783ee --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions_CType.php @@ -0,0 +1,16 @@ +package = $package; + } + + public function getPackage() + { + return $this->package; + } + + public function getMessageType() + { + return $this->message_type; + } + + public function addMessageType($desc) + { + $this->message_type[] = $desc; + } + + public function getEnumType() + { + return $this->enum_type; + } + + public function addEnumType($desc) + { + $this->enum_type[]= $desc; + } + + public static function buildFromProto($proto) + { + $file = new FileDescriptor(); + $file->setPackage($proto->getPackage()); + foreach ($proto->getMessageType() as $message_proto) { + $file->addMessageType(Descriptor::buildFromProto( + $message_proto, $proto, "")); + } + foreach ($proto->getEnumType() as $enum_proto) { + $file->addEnumType( + EnumDescriptor::buildFromProto( + $enum_proto, + $proto, + "")); + } + return $file; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorProto.php new file mode 100644 index 000000000..d4c7f6bb8 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorProto.php @@ -0,0 +1,533 @@ +google.protobuf.FileDescriptorProto + */ +class FileDescriptorProto extends \Google\Protobuf\Internal\Message +{ + /** + * file name, relative to root of source tree + * + * Generated from protobuf field optional string name = 1; + */ + protected $name = null; + /** + * e.g. "foo", "foo.bar", etc. + * + * Generated from protobuf field optional string package = 2; + */ + protected $package = null; + /** + * Names of files imported by this file. + * + * Generated from protobuf field repeated string dependency = 3; + */ + private $dependency; + /** + * Indexes of the public imported files in the dependency list above. + * + * Generated from protobuf field repeated int32 public_dependency = 10; + */ + private $public_dependency; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + * + * Generated from protobuf field repeated int32 weak_dependency = 11; + */ + private $weak_dependency; + /** + * All top-level definitions in this file. + * + * Generated from protobuf field repeated .google.protobuf.DescriptorProto message_type = 4; + */ + private $message_type; + /** + * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto enum_type = 5; + */ + private $enum_type; + /** + * Generated from protobuf field repeated .google.protobuf.ServiceDescriptorProto service = 6; + */ + private $service; + /** + * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto extension = 7; + */ + private $extension; + /** + * Generated from protobuf field optional .google.protobuf.FileOptions options = 8; + */ + protected $options = null; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + * + * Generated from protobuf field optional .google.protobuf.SourceCodeInfo source_code_info = 9; + */ + protected $source_code_info = null; + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * If `edition` is present, this value must be "editions". + * + * Generated from protobuf field optional string syntax = 12; + */ + protected $syntax = null; + /** + * The edition of the proto file, which is an opaque string. + * + * Generated from protobuf field optional string edition = 13; + */ + protected $edition = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * file name, relative to root of source tree + * @type string $package + * e.g. "foo", "foo.bar", etc. + * @type array|\Google\Protobuf\Internal\RepeatedField $dependency + * Names of files imported by this file. + * @type array|\Google\Protobuf\Internal\RepeatedField $public_dependency + * Indexes of the public imported files in the dependency list above. + * @type array|\Google\Protobuf\Internal\RepeatedField $weak_dependency + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + * @type array<\Google\Protobuf\Internal\DescriptorProto>|\Google\Protobuf\Internal\RepeatedField $message_type + * All top-level definitions in this file. + * @type array<\Google\Protobuf\Internal\EnumDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $enum_type + * @type array<\Google\Protobuf\Internal\ServiceDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $service + * @type array<\Google\Protobuf\Internal\FieldDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $extension + * @type \Google\Protobuf\Internal\FileOptions $options + * @type \Google\Protobuf\Internal\SourceCodeInfo $source_code_info + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + * @type string $syntax + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * If `edition` is present, this value must be "editions". + * @type string $edition + * The edition of the proto file, which is an opaque string. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * file name, relative to root of source tree + * + * Generated from protobuf field optional string name = 1; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * file name, relative to root of source tree + * + * Generated from protobuf field optional string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * e.g. "foo", "foo.bar", etc. + * + * Generated from protobuf field optional string package = 2; + * @return string + */ + public function getPackage() + { + return isset($this->package) ? $this->package : ''; + } + + public function hasPackage() + { + return isset($this->package); + } + + public function clearPackage() + { + unset($this->package); + } + + /** + * e.g. "foo", "foo.bar", etc. + * + * Generated from protobuf field optional string package = 2; + * @param string $var + * @return $this + */ + public function setPackage($var) + { + GPBUtil::checkString($var, True); + $this->package = $var; + + return $this; + } + + /** + * Names of files imported by this file. + * + * Generated from protobuf field repeated string dependency = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDependency() + { + return $this->dependency; + } + + /** + * Names of files imported by this file. + * + * Generated from protobuf field repeated string dependency = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDependency($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->dependency = $arr; + + return $this; + } + + /** + * Indexes of the public imported files in the dependency list above. + * + * Generated from protobuf field repeated int32 public_dependency = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPublicDependency() + { + return $this->public_dependency; + } + + /** + * Indexes of the public imported files in the dependency list above. + * + * Generated from protobuf field repeated int32 public_dependency = 10; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPublicDependency($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->public_dependency = $arr; + + return $this; + } + + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + * + * Generated from protobuf field repeated int32 weak_dependency = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWeakDependency() + { + return $this->weak_dependency; + } + + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + * + * Generated from protobuf field repeated int32 weak_dependency = 11; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWeakDependency($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->weak_dependency = $arr; + + return $this; + } + + /** + * All top-level definitions in this file. + * + * Generated from protobuf field repeated .google.protobuf.DescriptorProto message_type = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMessageType() + { + return $this->message_type; + } + + /** + * All top-level definitions in this file. + * + * Generated from protobuf field repeated .google.protobuf.DescriptorProto message_type = 4; + * @param array<\Google\Protobuf\Internal\DescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMessageType($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto::class); + $this->message_type = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto enum_type = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEnumType() + { + return $this->enum_type; + } + + /** + * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto enum_type = 5; + * @param array<\Google\Protobuf\Internal\EnumDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEnumType($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumDescriptorProto::class); + $this->enum_type = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.ServiceDescriptorProto service = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getService() + { + return $this->service; + } + + /** + * Generated from protobuf field repeated .google.protobuf.ServiceDescriptorProto service = 6; + * @param array<\Google\Protobuf\Internal\ServiceDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setService($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\ServiceDescriptorProto::class); + $this->service = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto extension = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExtension() + { + return $this->extension; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto extension = 7; + * @param array<\Google\Protobuf\Internal\FieldDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExtension($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class); + $this->extension = $arr; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FileOptions options = 8; + * @return \Google\Protobuf\Internal\FileOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Generated from protobuf field optional .google.protobuf.FileOptions options = 8; + * @param \Google\Protobuf\Internal\FileOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FileOptions::class); + $this->options = $var; + + return $this; + } + + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + * + * Generated from protobuf field optional .google.protobuf.SourceCodeInfo source_code_info = 9; + * @return \Google\Protobuf\Internal\SourceCodeInfo|null + */ + public function getSourceCodeInfo() + { + return $this->source_code_info; + } + + public function hasSourceCodeInfo() + { + return isset($this->source_code_info); + } + + public function clearSourceCodeInfo() + { + unset($this->source_code_info); + } + + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + * + * Generated from protobuf field optional .google.protobuf.SourceCodeInfo source_code_info = 9; + * @param \Google\Protobuf\Internal\SourceCodeInfo $var + * @return $this + */ + public function setSourceCodeInfo($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\SourceCodeInfo::class); + $this->source_code_info = $var; + + return $this; + } + + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * If `edition` is present, this value must be "editions". + * + * Generated from protobuf field optional string syntax = 12; + * @return string + */ + public function getSyntax() + { + return isset($this->syntax) ? $this->syntax : ''; + } + + public function hasSyntax() + { + return isset($this->syntax); + } + + public function clearSyntax() + { + unset($this->syntax); + } + + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * If `edition` is present, this value must be "editions". + * + * Generated from protobuf field optional string syntax = 12; + * @param string $var + * @return $this + */ + public function setSyntax($var) + { + GPBUtil::checkString($var, True); + $this->syntax = $var; + + return $this; + } + + /** + * The edition of the proto file, which is an opaque string. + * + * Generated from protobuf field optional string edition = 13; + * @return string + */ + public function getEdition() + { + return isset($this->edition) ? $this->edition : ''; + } + + public function hasEdition() + { + return isset($this->edition); + } + + public function clearEdition() + { + unset($this->edition); + } + + /** + * The edition of the proto file, which is an opaque string. + * + * Generated from protobuf field optional string edition = 13; + * @param string $var + * @return $this + */ + public function setEdition($var) + { + GPBUtil::checkString($var, True); + $this->edition = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorSet.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorSet.php new file mode 100644 index 000000000..1dae6fb3e --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorSet.php @@ -0,0 +1,63 @@ +google.protobuf.FileDescriptorSet + */ +class FileDescriptorSet extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .google.protobuf.FileDescriptorProto file = 1; + */ + private $file; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Protobuf\Internal\FileDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $file + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .google.protobuf.FileDescriptorProto file = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFile() + { + return $this->file; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FileDescriptorProto file = 1; + * @param array<\Google\Protobuf\Internal\FileDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFile($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FileDescriptorProto::class); + $this->file = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions.php new file mode 100644 index 000000000..43931be80 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions.php @@ -0,0 +1,1106 @@ +google.protobuf.FileOptions + */ +class FileOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + * + * Generated from protobuf field optional string java_package = 1; + */ + protected $java_package = null; + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + * + * Generated from protobuf field optional string java_outer_classname = 8; + */ + protected $java_outer_classname = null; + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + * + * Generated from protobuf field optional bool java_multiple_files = 10 [default = false]; + */ + protected $java_multiple_files = null; + /** + * This option does nothing. + * + * Generated from protobuf field optional bool java_generate_equals_and_hash = 20 [deprecated = true]; + * @deprecated + */ + protected $java_generate_equals_and_hash = null; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + * + * Generated from protobuf field optional bool java_string_check_utf8 = 27 [default = false]; + */ + protected $java_string_check_utf8 = null; + /** + * Generated from protobuf field optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + */ + protected $optimize_for = null; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + * + * Generated from protobuf field optional string go_package = 11; + */ + protected $go_package = null; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + * + * Generated from protobuf field optional bool cc_generic_services = 16 [default = false]; + */ + protected $cc_generic_services = null; + /** + * Generated from protobuf field optional bool java_generic_services = 17 [default = false]; + */ + protected $java_generic_services = null; + /** + * Generated from protobuf field optional bool py_generic_services = 18 [default = false]; + */ + protected $py_generic_services = null; + /** + * Generated from protobuf field optional bool php_generic_services = 42 [default = false]; + */ + protected $php_generic_services = null; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + * + * Generated from protobuf field optional bool deprecated = 23 [default = false]; + */ + protected $deprecated = null; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + * + * Generated from protobuf field optional bool cc_enable_arenas = 31 [default = true]; + */ + protected $cc_enable_arenas = null; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + * + * Generated from protobuf field optional string objc_class_prefix = 36; + */ + protected $objc_class_prefix = null; + /** + * Namespace for generated classes; defaults to the package. + * + * Generated from protobuf field optional string csharp_namespace = 37; + */ + protected $csharp_namespace = null; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + * + * Generated from protobuf field optional string swift_prefix = 39; + */ + protected $swift_prefix = null; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + * + * Generated from protobuf field optional string php_class_prefix = 40; + */ + protected $php_class_prefix = null; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + * + * Generated from protobuf field optional string php_namespace = 41; + */ + protected $php_namespace = null; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + * + * Generated from protobuf field optional string php_metadata_namespace = 44; + */ + protected $php_metadata_namespace = null; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + * + * Generated from protobuf field optional string ruby_package = 45; + */ + protected $ruby_package = null; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + private $uninterpreted_option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $java_package + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + * @type string $java_outer_classname + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + * @type bool $java_multiple_files + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + * @type bool $java_generate_equals_and_hash + * This option does nothing. + * @type bool $java_string_check_utf8 + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + * @type int $optimize_for + * @type string $go_package + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + * @type bool $cc_generic_services + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + * @type bool $java_generic_services + * @type bool $py_generic_services + * @type bool $php_generic_services + * @type bool $deprecated + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + * @type bool $cc_enable_arenas + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + * @type string $objc_class_prefix + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + * @type string $csharp_namespace + * Namespace for generated classes; defaults to the package. + * @type string $swift_prefix + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + * @type string $php_class_prefix + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + * @type string $php_namespace + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + * @type string $php_metadata_namespace + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + * @type string $ruby_package + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + * + * Generated from protobuf field optional string java_package = 1; + * @return string + */ + public function getJavaPackage() + { + return isset($this->java_package) ? $this->java_package : ''; + } + + public function hasJavaPackage() + { + return isset($this->java_package); + } + + public function clearJavaPackage() + { + unset($this->java_package); + } + + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + * + * Generated from protobuf field optional string java_package = 1; + * @param string $var + * @return $this + */ + public function setJavaPackage($var) + { + GPBUtil::checkString($var, True); + $this->java_package = $var; + + return $this; + } + + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + * + * Generated from protobuf field optional string java_outer_classname = 8; + * @return string + */ + public function getJavaOuterClassname() + { + return isset($this->java_outer_classname) ? $this->java_outer_classname : ''; + } + + public function hasJavaOuterClassname() + { + return isset($this->java_outer_classname); + } + + public function clearJavaOuterClassname() + { + unset($this->java_outer_classname); + } + + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + * + * Generated from protobuf field optional string java_outer_classname = 8; + * @param string $var + * @return $this + */ + public function setJavaOuterClassname($var) + { + GPBUtil::checkString($var, True); + $this->java_outer_classname = $var; + + return $this; + } + + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + * + * Generated from protobuf field optional bool java_multiple_files = 10 [default = false]; + * @return bool + */ + public function getJavaMultipleFiles() + { + return isset($this->java_multiple_files) ? $this->java_multiple_files : false; + } + + public function hasJavaMultipleFiles() + { + return isset($this->java_multiple_files); + } + + public function clearJavaMultipleFiles() + { + unset($this->java_multiple_files); + } + + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + * + * Generated from protobuf field optional bool java_multiple_files = 10 [default = false]; + * @param bool $var + * @return $this + */ + public function setJavaMultipleFiles($var) + { + GPBUtil::checkBool($var); + $this->java_multiple_files = $var; + + return $this; + } + + /** + * This option does nothing. + * + * Generated from protobuf field optional bool java_generate_equals_and_hash = 20 [deprecated = true]; + * @return bool + * @deprecated + */ + public function getJavaGenerateEqualsAndHash() + { + @trigger_error('java_generate_equals_and_hash is deprecated.', E_USER_DEPRECATED); + return isset($this->java_generate_equals_and_hash) ? $this->java_generate_equals_and_hash : false; + } + + public function hasJavaGenerateEqualsAndHash() + { + @trigger_error('java_generate_equals_and_hash is deprecated.', E_USER_DEPRECATED); + return isset($this->java_generate_equals_and_hash); + } + + public function clearJavaGenerateEqualsAndHash() + { + @trigger_error('java_generate_equals_and_hash is deprecated.', E_USER_DEPRECATED); + unset($this->java_generate_equals_and_hash); + } + + /** + * This option does nothing. + * + * Generated from protobuf field optional bool java_generate_equals_and_hash = 20 [deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setJavaGenerateEqualsAndHash($var) + { + @trigger_error('java_generate_equals_and_hash is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->java_generate_equals_and_hash = $var; + + return $this; + } + + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + * + * Generated from protobuf field optional bool java_string_check_utf8 = 27 [default = false]; + * @return bool + */ + public function getJavaStringCheckUtf8() + { + return isset($this->java_string_check_utf8) ? $this->java_string_check_utf8 : false; + } + + public function hasJavaStringCheckUtf8() + { + return isset($this->java_string_check_utf8); + } + + public function clearJavaStringCheckUtf8() + { + unset($this->java_string_check_utf8); + } + + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + * + * Generated from protobuf field optional bool java_string_check_utf8 = 27 [default = false]; + * @param bool $var + * @return $this + */ + public function setJavaStringCheckUtf8($var) + { + GPBUtil::checkBool($var); + $this->java_string_check_utf8 = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + * @return int + */ + public function getOptimizeFor() + { + return isset($this->optimize_for) ? $this->optimize_for : 0; + } + + public function hasOptimizeFor() + { + return isset($this->optimize_for); + } + + public function clearOptimizeFor() + { + unset($this->optimize_for); + } + + /** + * Generated from protobuf field optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + * @param int $var + * @return $this + */ + public function setOptimizeFor($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FileOptions\OptimizeMode::class); + $this->optimize_for = $var; + + return $this; + } + + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + * + * Generated from protobuf field optional string go_package = 11; + * @return string + */ + public function getGoPackage() + { + return isset($this->go_package) ? $this->go_package : ''; + } + + public function hasGoPackage() + { + return isset($this->go_package); + } + + public function clearGoPackage() + { + unset($this->go_package); + } + + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + * + * Generated from protobuf field optional string go_package = 11; + * @param string $var + * @return $this + */ + public function setGoPackage($var) + { + GPBUtil::checkString($var, True); + $this->go_package = $var; + + return $this; + } + + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + * + * Generated from protobuf field optional bool cc_generic_services = 16 [default = false]; + * @return bool + */ + public function getCcGenericServices() + { + return isset($this->cc_generic_services) ? $this->cc_generic_services : false; + } + + public function hasCcGenericServices() + { + return isset($this->cc_generic_services); + } + + public function clearCcGenericServices() + { + unset($this->cc_generic_services); + } + + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + * + * Generated from protobuf field optional bool cc_generic_services = 16 [default = false]; + * @param bool $var + * @return $this + */ + public function setCcGenericServices($var) + { + GPBUtil::checkBool($var); + $this->cc_generic_services = $var; + + return $this; + } + + /** + * Generated from protobuf field optional bool java_generic_services = 17 [default = false]; + * @return bool + */ + public function getJavaGenericServices() + { + return isset($this->java_generic_services) ? $this->java_generic_services : false; + } + + public function hasJavaGenericServices() + { + return isset($this->java_generic_services); + } + + public function clearJavaGenericServices() + { + unset($this->java_generic_services); + } + + /** + * Generated from protobuf field optional bool java_generic_services = 17 [default = false]; + * @param bool $var + * @return $this + */ + public function setJavaGenericServices($var) + { + GPBUtil::checkBool($var); + $this->java_generic_services = $var; + + return $this; + } + + /** + * Generated from protobuf field optional bool py_generic_services = 18 [default = false]; + * @return bool + */ + public function getPyGenericServices() + { + return isset($this->py_generic_services) ? $this->py_generic_services : false; + } + + public function hasPyGenericServices() + { + return isset($this->py_generic_services); + } + + public function clearPyGenericServices() + { + unset($this->py_generic_services); + } + + /** + * Generated from protobuf field optional bool py_generic_services = 18 [default = false]; + * @param bool $var + * @return $this + */ + public function setPyGenericServices($var) + { + GPBUtil::checkBool($var); + $this->py_generic_services = $var; + + return $this; + } + + /** + * Generated from protobuf field optional bool php_generic_services = 42 [default = false]; + * @return bool + */ + public function getPhpGenericServices() + { + return isset($this->php_generic_services) ? $this->php_generic_services : false; + } + + public function hasPhpGenericServices() + { + return isset($this->php_generic_services); + } + + public function clearPhpGenericServices() + { + unset($this->php_generic_services); + } + + /** + * Generated from protobuf field optional bool php_generic_services = 42 [default = false]; + * @param bool $var + * @return $this + */ + public function setPhpGenericServices($var) + { + GPBUtil::checkBool($var); + $this->php_generic_services = $var; + + return $this; + } + + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + * + * Generated from protobuf field optional bool deprecated = 23 [default = false]; + * @return bool + */ + public function getDeprecated() + { + return isset($this->deprecated) ? $this->deprecated : false; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + * + * Generated from protobuf field optional bool deprecated = 23 [default = false]; + * @param bool $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkBool($var); + $this->deprecated = $var; + + return $this; + } + + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + * + * Generated from protobuf field optional bool cc_enable_arenas = 31 [default = true]; + * @return bool + */ + public function getCcEnableArenas() + { + return isset($this->cc_enable_arenas) ? $this->cc_enable_arenas : false; + } + + public function hasCcEnableArenas() + { + return isset($this->cc_enable_arenas); + } + + public function clearCcEnableArenas() + { + unset($this->cc_enable_arenas); + } + + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + * + * Generated from protobuf field optional bool cc_enable_arenas = 31 [default = true]; + * @param bool $var + * @return $this + */ + public function setCcEnableArenas($var) + { + GPBUtil::checkBool($var); + $this->cc_enable_arenas = $var; + + return $this; + } + + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + * + * Generated from protobuf field optional string objc_class_prefix = 36; + * @return string + */ + public function getObjcClassPrefix() + { + return isset($this->objc_class_prefix) ? $this->objc_class_prefix : ''; + } + + public function hasObjcClassPrefix() + { + return isset($this->objc_class_prefix); + } + + public function clearObjcClassPrefix() + { + unset($this->objc_class_prefix); + } + + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + * + * Generated from protobuf field optional string objc_class_prefix = 36; + * @param string $var + * @return $this + */ + public function setObjcClassPrefix($var) + { + GPBUtil::checkString($var, True); + $this->objc_class_prefix = $var; + + return $this; + } + + /** + * Namespace for generated classes; defaults to the package. + * + * Generated from protobuf field optional string csharp_namespace = 37; + * @return string + */ + public function getCsharpNamespace() + { + return isset($this->csharp_namespace) ? $this->csharp_namespace : ''; + } + + public function hasCsharpNamespace() + { + return isset($this->csharp_namespace); + } + + public function clearCsharpNamespace() + { + unset($this->csharp_namespace); + } + + /** + * Namespace for generated classes; defaults to the package. + * + * Generated from protobuf field optional string csharp_namespace = 37; + * @param string $var + * @return $this + */ + public function setCsharpNamespace($var) + { + GPBUtil::checkString($var, True); + $this->csharp_namespace = $var; + + return $this; + } + + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + * + * Generated from protobuf field optional string swift_prefix = 39; + * @return string + */ + public function getSwiftPrefix() + { + return isset($this->swift_prefix) ? $this->swift_prefix : ''; + } + + public function hasSwiftPrefix() + { + return isset($this->swift_prefix); + } + + public function clearSwiftPrefix() + { + unset($this->swift_prefix); + } + + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + * + * Generated from protobuf field optional string swift_prefix = 39; + * @param string $var + * @return $this + */ + public function setSwiftPrefix($var) + { + GPBUtil::checkString($var, True); + $this->swift_prefix = $var; + + return $this; + } + + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + * + * Generated from protobuf field optional string php_class_prefix = 40; + * @return string + */ + public function getPhpClassPrefix() + { + return isset($this->php_class_prefix) ? $this->php_class_prefix : ''; + } + + public function hasPhpClassPrefix() + { + return isset($this->php_class_prefix); + } + + public function clearPhpClassPrefix() + { + unset($this->php_class_prefix); + } + + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + * + * Generated from protobuf field optional string php_class_prefix = 40; + * @param string $var + * @return $this + */ + public function setPhpClassPrefix($var) + { + GPBUtil::checkString($var, True); + $this->php_class_prefix = $var; + + return $this; + } + + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + * + * Generated from protobuf field optional string php_namespace = 41; + * @return string + */ + public function getPhpNamespace() + { + return isset($this->php_namespace) ? $this->php_namespace : ''; + } + + public function hasPhpNamespace() + { + return isset($this->php_namespace); + } + + public function clearPhpNamespace() + { + unset($this->php_namespace); + } + + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + * + * Generated from protobuf field optional string php_namespace = 41; + * @param string $var + * @return $this + */ + public function setPhpNamespace($var) + { + GPBUtil::checkString($var, True); + $this->php_namespace = $var; + + return $this; + } + + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + * + * Generated from protobuf field optional string php_metadata_namespace = 44; + * @return string + */ + public function getPhpMetadataNamespace() + { + return isset($this->php_metadata_namespace) ? $this->php_metadata_namespace : ''; + } + + public function hasPhpMetadataNamespace() + { + return isset($this->php_metadata_namespace); + } + + public function clearPhpMetadataNamespace() + { + unset($this->php_metadata_namespace); + } + + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + * + * Generated from protobuf field optional string php_metadata_namespace = 44; + * @param string $var + * @return $this + */ + public function setPhpMetadataNamespace($var) + { + GPBUtil::checkString($var, True); + $this->php_metadata_namespace = $var; + + return $this; + } + + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + * + * Generated from protobuf field optional string ruby_package = 45; + * @return string + */ + public function getRubyPackage() + { + return isset($this->ruby_package) ? $this->ruby_package : ''; + } + + public function hasRubyPackage() + { + return isset($this->ruby_package); + } + + public function clearRubyPackage() + { + unset($this->ruby_package); + } + + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + * + * Generated from protobuf field optional string ruby_package = 45; + * @param string $var + * @return $this + */ + public function setRubyPackage($var) + { + GPBUtil::checkString($var, True); + $this->ruby_package = $var; + + return $this; + } + + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUninterpretedOption() + { + return $this->uninterpreted_option; + } + + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUninterpretedOption($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class); + $this->uninterpreted_option = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions/OptimizeMode.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions/OptimizeMode.php new file mode 100644 index 000000000..0df27b533 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions/OptimizeMode.php @@ -0,0 +1,64 @@ +google.protobuf.FileOptions.OptimizeMode + */ +class OptimizeMode +{ + /** + * Generate complete code for parsing, serialization, + * + * Generated from protobuf enum SPEED = 1; + */ + const SPEED = 1; + /** + * etc. + * + * Generated from protobuf enum CODE_SIZE = 2; + */ + const CODE_SIZE = 2; + /** + * Generate code using MessageLite and the lite runtime. + * + * Generated from protobuf enum LITE_RUNTIME = 3; + */ + const LITE_RUNTIME = 3; + + private static $valueToName = [ + self::SPEED => 'SPEED', + self::CODE_SIZE => 'CODE_SIZE', + self::LITE_RUNTIME => 'LITE_RUNTIME', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OptimizeMode::class, \Google\Protobuf\Internal\FileOptions_OptimizeMode::class); + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions_OptimizeMode.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions_OptimizeMode.php new file mode 100644 index 000000000..8926e63ba --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions_OptimizeMode.php @@ -0,0 +1,16 @@ +writeRaw("\"", 1); + $field_name = GPBJsonWire::formatFieldName($field); + $output->writeRaw($field_name, strlen($field_name)); + $output->writeRaw("\":", 2); + } + return static::serializeFieldValueToStream( + $value, + $field, + $output, + !$has_field_name); + } + + public static function serializeFieldValueToStream( + $values, + $field, + &$output, + $is_well_known = false) + { + if ($field->isMap()) { + $output->writeRaw("{", 1); + $first = true; + $map_entry = $field->getMessageType(); + $key_field = $map_entry->getFieldByNumber(1); + $value_field = $map_entry->getFieldByNumber(2); + + switch ($key_field->getType()) { + case GPBType::STRING: + case GPBType::SFIXED64: + case GPBType::INT64: + case GPBType::SINT64: + case GPBType::FIXED64: + case GPBType::UINT64: + $additional_quote = false; + break; + default: + $additional_quote = true; + } + + foreach ($values as $key => $value) { + if ($first) { + $first = false; + } else { + $output->writeRaw(",", 1); + } + if ($additional_quote) { + $output->writeRaw("\"", 1); + } + if (!static::serializeSingularFieldValueToStream( + $key, + $key_field, + $output, + $is_well_known)) { + return false; + } + if ($additional_quote) { + $output->writeRaw("\"", 1); + } + $output->writeRaw(":", 1); + if (!static::serializeSingularFieldValueToStream( + $value, + $value_field, + $output, + $is_well_known)) { + return false; + } + } + $output->writeRaw("}", 1); + return true; + } elseif ($field->isRepeated()) { + $output->writeRaw("[", 1); + $first = true; + foreach ($values as $value) { + if ($first) { + $first = false; + } else { + $output->writeRaw(",", 1); + } + if (!static::serializeSingularFieldValueToStream( + $value, + $field, + $output, + $is_well_known)) { + return false; + } + } + $output->writeRaw("]", 1); + return true; + } else { + return static::serializeSingularFieldValueToStream( + $values, + $field, + $output, + $is_well_known); + } + } + + private static function serializeSingularFieldValueToStream( + $value, + $field, + &$output, $is_well_known = false) + { + switch ($field->getType()) { + case GPBType::SFIXED32: + case GPBType::SINT32: + case GPBType::INT32: + $str_value = strval($value); + $output->writeRaw($str_value, strlen($str_value)); + break; + case GPBType::FIXED32: + case GPBType::UINT32: + if ($value < 0) { + $value = bcadd($value, "4294967296"); + } + $str_value = strval($value); + $output->writeRaw($str_value, strlen($str_value)); + break; + case GPBType::FIXED64: + case GPBType::UINT64: + if ($value < 0) { + $value = bcadd($value, "18446744073709551616"); + } + // Intentional fall through. + case GPBType::SFIXED64: + case GPBType::INT64: + case GPBType::SINT64: + $output->writeRaw("\"", 1); + $str_value = strval($value); + $output->writeRaw($str_value, strlen($str_value)); + $output->writeRaw("\"", 1); + break; + case GPBType::FLOAT: + if (is_nan($value)) { + $str_value = "\"NaN\""; + } elseif ($value === INF) { + $str_value = "\"Infinity\""; + } elseif ($value === -INF) { + $str_value = "\"-Infinity\""; + } else { + $str_value = sprintf("%.8g", $value); + } + $output->writeRaw($str_value, strlen($str_value)); + break; + case GPBType::DOUBLE: + if (is_nan($value)) { + $str_value = "\"NaN\""; + } elseif ($value === INF) { + $str_value = "\"Infinity\""; + } elseif ($value === -INF) { + $str_value = "\"-Infinity\""; + } else { + $str_value = sprintf("%.17g", $value); + } + $output->writeRaw($str_value, strlen($str_value)); + break; + case GPBType::ENUM: + $enum_desc = $field->getEnumType(); + if ($enum_desc->getClass() === "Google\Protobuf\NullValue") { + $output->writeRaw("null", 4); + break; + } + $enum_value_desc = $enum_desc->getValueByNumber($value); + if (!is_null($enum_value_desc)) { + $str_value = $enum_value_desc->getName(); + $output->writeRaw("\"", 1); + $output->writeRaw($str_value, strlen($str_value)); + $output->writeRaw("\"", 1); + } else { + $str_value = strval($value); + $output->writeRaw($str_value, strlen($str_value)); + } + break; + case GPBType::BOOL: + if ($value) { + $output->writeRaw("true", 4); + } else { + $output->writeRaw("false", 5); + } + break; + case GPBType::BYTES: + $bytes_value = base64_encode($value); + $output->writeRaw("\"", 1); + $output->writeRaw($bytes_value, strlen($bytes_value)); + $output->writeRaw("\"", 1); + break; + case GPBType::STRING: + $value = json_encode($value, JSON_UNESCAPED_UNICODE); + $output->writeRaw($value, strlen($value)); + break; + // case GPBType::GROUP: + // echo "GROUP\xA"; + // trigger_error("Not implemented.", E_ERROR); + // break; + case GPBType::MESSAGE: + $value->serializeToJsonStream($output); + break; + default: + user_error("Unsupported type."); + return false; + } + return true; + } + + private static function formatFieldName($field) + { + return $field->getJsonName(); + } + + // Used for escaping control chars in strings. + private static $k_control_char_limit = 0x20; + + private static function jsonNiceEscape($c) + { + switch ($c) { + case '"': return "\\\""; + case '\\': return "\\\\"; + case '/': return "\\/"; + case '\b': return "\\b"; + case '\f': return "\\f"; + case '\n': return "\\n"; + case '\r': return "\\r"; + case '\t': return "\\t"; + default: return NULL; + } + } + + private static function isJsonEscaped($c) + { + // See RFC 4627. + return $c < chr($k_control_char_limit) || $c === "\"" || $c === "\\"; + } + + public static function escapedJson($value) + { + $escaped_value = ""; + $unescaped_run = ""; + for ($i = 0; $i < strlen($value); $i++) { + $c = $value[$i]; + // Handle escaping. + if (static::isJsonEscaped($c)) { + // Use a "nice" escape, like \n, if one exists for this + // character. + $escape = static::jsonNiceEscape($c); + if (is_null($escape)) { + $escape = "\\u00" . bin2hex($c); + } + if ($unescaped_run !== "") { + $escaped_value .= $unescaped_run; + $unescaped_run = ""; + } + $escaped_value .= $escape; + } else { + if ($unescaped_run === "") { + $unescaped_run .= $c; + } + } + } + $escaped_value .= $unescaped_run; + return $escaped_value; + } + +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBLabel.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBLabel.php new file mode 100644 index 000000000..0fb238415 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBLabel.php @@ -0,0 +1,40 @@ + 0) { + $high = (int) bcsub($high, 4294967296); + } else { + $high = (int) $high; + } + if (bccomp($low, 2147483647) > 0) { + $low = (int) bcsub($low, 4294967296); + } else { + $low = (int) $low; + } + + if ($isNeg) { + $high = ~$high; + $low = ~$low; + $low++; + if (!$low) { + $high = (int)($high + 1); + } + } + + if ($trim) { + $high = 0; + } + } + + public static function checkString(&$var, $check_utf8) + { + if (is_array($var) || is_object($var)) { + throw new \InvalidArgumentException("Expect string."); + } + if (!is_string($var)) { + $var = strval($var); + } + if ($check_utf8 && !preg_match('//u', $var)) { + throw new \Exception("Expect utf-8 encoding."); + } + } + + public static function checkEnum(&$var) + { + static::checkInt32($var); + } + + public static function checkInt32(&$var) + { + if (is_numeric($var)) { + $var = intval($var); + } else { + throw new \Exception("Expect integer."); + } + } + + public static function checkUint32(&$var) + { + if (is_numeric($var)) { + if (PHP_INT_SIZE === 8) { + $var = intval($var); + $var |= ((-(($var >> 31) & 0x1)) & ~0xFFFFFFFF); + } else { + if (bccomp($var, 0x7FFFFFFF) > 0) { + $var = bcsub($var, "4294967296"); + } + $var = (int) $var; + } + } else { + throw new \Exception("Expect integer."); + } + } + + public static function checkInt64(&$var) + { + if (is_numeric($var)) { + if (PHP_INT_SIZE == 8) { + $var = intval($var); + } else { + if (is_float($var) || + is_integer($var) || + (is_string($var) && + bccomp($var, "9223372036854774784") < 0)) { + $var = number_format($var, 0, ".", ""); + } + } + } else { + throw new \Exception("Expect integer."); + } + } + + public static function checkUint64(&$var) + { + if (is_numeric($var)) { + if (PHP_INT_SIZE == 8) { + $var = intval($var); + } else { + $var = number_format($var, 0, ".", ""); + } + } else { + throw new \Exception("Expect integer."); + } + } + + public static function checkFloat(&$var) + { + if (is_float($var) || is_numeric($var)) { + $var = unpack("f", pack("f", $var))[1]; + } else { + throw new \Exception("Expect float."); + } + } + + public static function checkDouble(&$var) + { + if (is_float($var) || is_numeric($var)) { + $var = floatval($var); + } else { + throw new \Exception("Expect float."); + } + } + + public static function checkBool(&$var) + { + if (is_array($var) || is_object($var)) { + throw new \Exception("Expect boolean."); + } + $var = boolval($var); + } + + public static function checkMessage(&$var, $klass, $newClass = null) + { + if (!$var instanceof $klass && !is_null($var)) { + throw new \Exception("Expect $klass."); + } + } + + public static function checkRepeatedField(&$var, $type, $klass = null) + { + if (!$var instanceof RepeatedField && !is_array($var)) { + throw new \Exception("Expect array."); + } + if (is_array($var)) { + $tmp = new RepeatedField($type, $klass); + foreach ($var as $value) { + $tmp[] = $value; + } + return $tmp; + } else { + if ($var->getType() != $type) { + throw new \Exception( + "Expect repeated field of different type."); + } + if ($var->getType() === GPBType::MESSAGE && + $var->getClass() !== $klass && + $var->getLegacyClass() !== $klass) { + throw new \Exception( + "Expect repeated field of " . $klass . "."); + } + return $var; + } + } + + public static function checkMapField(&$var, $key_type, $value_type, $klass = null) + { + if (!$var instanceof MapField && !is_array($var)) { + throw new \Exception("Expect dict."); + } + if (is_array($var)) { + $tmp = new MapField($key_type, $value_type, $klass); + foreach ($var as $key => $value) { + $tmp[$key] = $value; + } + return $tmp; + } else { + if ($var->getKeyType() != $key_type) { + throw new \Exception("Expect map field of key type."); + } + if ($var->getValueType() != $value_type) { + throw new \Exception("Expect map field of value type."); + } + if ($var->getValueType() === GPBType::MESSAGE && + $var->getValueClass() !== $klass && + $var->getLegacyValueClass() !== $klass) { + throw new \Exception( + "Expect map field of " . $klass . "."); + } + return $var; + } + } + + public static function Int64($value) + { + return new Int64($value); + } + + public static function Uint64($value) + { + return new Uint64($value); + } + + public static function getClassNamePrefix( + $classname, + $file_proto) + { + $option = $file_proto->getOptions(); + $prefix = is_null($option) ? "" : $option->getPhpClassPrefix(); + if ($prefix !== "") { + return $prefix; + } + + $reserved_words = array( + "abstract"=>0, "and"=>0, "array"=>0, "as"=>0, "break"=>0, + "callable"=>0, "case"=>0, "catch"=>0, "class"=>0, "clone"=>0, + "const"=>0, "continue"=>0, "declare"=>0, "default"=>0, "die"=>0, + "do"=>0, "echo"=>0, "else"=>0, "elseif"=>0, "empty"=>0, + "enddeclare"=>0, "endfor"=>0, "endforeach"=>0, "endif"=>0, + "endswitch"=>0, "endwhile"=>0, "eval"=>0, "exit"=>0, "extends"=>0, + "final"=>0, "finally"=>0, "fn"=>0, "for"=>0, "foreach"=>0, + "function"=>0, "global"=>0, "goto"=>0, "if"=>0, "implements"=>0, + "include"=>0, "include_once"=>0, "instanceof"=>0, "insteadof"=>0, + "interface"=>0, "isset"=>0, "list"=>0, "match"=>0, "namespace"=>0, + "new"=>0, "or"=>0, "parent"=>0, "print"=>0, "private"=>0, + "protected"=>0,"public"=>0, "readonly" => 0,"require"=>0, + "require_once"=>0,"return"=>0, "self"=>0, "static"=>0, "switch"=>0, + "throw"=>0,"trait"=>0, "try"=>0,"unset"=>0, "use"=>0, "var"=>0, + "while"=>0,"xor"=>0, "yield"=>0, "int"=>0, "float"=>0, "bool"=>0, + "string"=>0,"true"=>0, "false"=>0, "null"=>0, "void"=>0, + "iterable"=>0 + ); + + if (array_key_exists(strtolower($classname), $reserved_words)) { + if ($file_proto->getPackage() === "google.protobuf") { + return "GPB"; + } else { + return "PB"; + } + } + + return ""; + } + + private static function getPreviouslyUnreservedClassNamePrefix( + $classname, + $file_proto) + { + $previously_unreserved_words = array( + "readonly"=>0 + ); + + if (array_key_exists(strtolower($classname), $previously_unreserved_words)) { + $option = $file_proto->getOptions(); + $prefix = is_null($option) ? "" : $option->getPhpClassPrefix(); + if ($prefix !== "") { + return $prefix; + } + + return ""; + } + + return self::getClassNamePrefix($classname, $file_proto); + } + + public static function getLegacyClassNameWithoutPackage( + $name, + $file_proto) + { + $classname = implode('_', explode('.', $name)); + return static::getClassNamePrefix($classname, $file_proto) . $classname; + } + + public static function getClassNameWithoutPackage( + $name, + $file_proto) + { + $parts = explode('.', $name); + foreach ($parts as $i => $part) { + $parts[$i] = static::getClassNamePrefix($parts[$i], $file_proto) . $parts[$i]; + } + return implode('\\', $parts); + } + + private static function getPreviouslyUnreservedClassNameWithoutPackage( + $name, + $file_proto) + { + $parts = explode('.', $name); + foreach ($parts as $i => $part) { + $parts[$i] = static::getPreviouslyUnreservedClassNamePrefix($parts[$i], $file_proto) . $parts[$i]; + } + return implode('\\', $parts); + } + + public static function getFullClassName( + $proto, + $containing, + $file_proto, + &$message_name_without_package, + &$classname, + &$legacy_classname, + &$fullname, + &$previous_classname) + { + // Full name needs to start with '.'. + $message_name_without_package = $proto->getName(); + if ($containing !== "") { + $message_name_without_package = + $containing . "." . $message_name_without_package; + } + + $package = $file_proto->getPackage(); + if ($package === "") { + $fullname = $message_name_without_package; + } else { + $fullname = $package . "." . $message_name_without_package; + } + + $class_name_without_package = + static::getClassNameWithoutPackage($message_name_without_package, $file_proto); + $legacy_class_name_without_package = + static::getLegacyClassNameWithoutPackage( + $message_name_without_package, $file_proto); + $previous_class_name_without_package = + static::getPreviouslyUnreservedClassNameWithoutPackage( + $message_name_without_package, $file_proto); + + $option = $file_proto->getOptions(); + if (!is_null($option) && $option->hasPhpNamespace()) { + $namespace = $option->getPhpNamespace(); + if ($namespace !== "") { + $classname = $namespace . "\\" . $class_name_without_package; + $legacy_classname = + $namespace . "\\" . $legacy_class_name_without_package; + $previous_classname = + $namespace . "\\" . $previous_class_name_without_package; + return; + } else { + $classname = $class_name_without_package; + $legacy_classname = $legacy_class_name_without_package; + $previous_classname = $previous_class_name_without_package; + return; + } + } + + if ($package === "") { + $classname = $class_name_without_package; + $legacy_classname = $legacy_class_name_without_package; + $previous_classname = $previous_class_name_without_package; + } else { + $parts = array_map('ucwords', explode('.', $package)); + foreach ($parts as $i => $part) { + $parts[$i] = self::getClassNamePrefix($part, $file_proto).$part; + } + $classname = + implode('\\', $parts) . + "\\".self::getClassNamePrefix($class_name_without_package,$file_proto). + $class_name_without_package; + $legacy_classname = + implode('\\', array_map('ucwords', explode('.', $package))). + "\\".$legacy_class_name_without_package; + $previous_classname = + implode('\\', array_map('ucwords', explode('.', $package))). + "\\".self::getPreviouslyUnreservedClassNamePrefix( + $previous_class_name_without_package, $file_proto). + $previous_class_name_without_package; + } + } + + public static function combineInt32ToInt64($high, $low) + { + $isNeg = $high < 0; + if ($isNeg) { + $high = ~$high; + $low = ~$low; + $low++; + if (!$low) { + $high = (int) ($high + 1); + } + } + $result = bcadd(bcmul($high, 4294967296), $low); + if ($low < 0) { + $result = bcadd($result, 4294967296); + } + if ($isNeg) { + $result = bcsub(0, $result); + } + return $result; + } + + public static function parseTimestamp($timestamp) + { + // prevent parsing timestamps containing with the non-existent year "0000" + // DateTime::createFromFormat parses without failing but as a nonsensical date + if (substr($timestamp, 0, 4) === "0000") { + throw new \Exception("Year cannot be zero."); + } + // prevent parsing timestamps ending with a lowercase z + if (substr($timestamp, -1, 1) === "z") { + throw new \Exception("Timezone cannot be a lowercase z."); + } + + $nanoseconds = 0; + $periodIndex = strpos($timestamp, "."); + if ($periodIndex !== false) { + $nanosecondsLength = 0; + // find the next non-numeric character in the timestamp to calculate + // the length of the nanoseconds text + for ($i = $periodIndex + 1, $length = strlen($timestamp); $i < $length; $i++) { + if (!is_numeric($timestamp[$i])) { + $nanosecondsLength = $i - ($periodIndex + 1); + break; + } + } + if ($nanosecondsLength % 3 !== 0) { + throw new \Exception("Nanoseconds must be disible by 3."); + } + if ($nanosecondsLength > 9) { + throw new \Exception("Nanoseconds must be in the range of 0 to 999,999,999 nanoseconds."); + } + if ($nanosecondsLength > 0) { + $nanoseconds = substr($timestamp, $periodIndex + 1, $nanosecondsLength); + $nanoseconds = intval($nanoseconds); + + // remove the nanoseconds and preceding period from the timestamp + $date = substr($timestamp, 0, $periodIndex); + $timezone = substr($timestamp, $periodIndex + $nanosecondsLength + 1); + $timestamp = $date.$timezone; + } + } + + $date = \DateTime::createFromFormat(\DateTime::RFC3339, $timestamp, new \DateTimeZone("UTC")); + if ($date === false) { + throw new \Exception("Invalid RFC 3339 timestamp."); + } + + $value = new \Google\Protobuf\Timestamp(); + $seconds = $date->format("U"); + $value->setSeconds($seconds); + $value->setNanos($nanoseconds); + return $value; + } + + public static function formatTimestamp($value) + { + if (bccomp($value->getSeconds(), "253402300800") != -1) { + throw new GPBDecodeException("Duration number too large."); + } + if (bccomp($value->getSeconds(), "-62135596801") != 1) { + throw new GPBDecodeException("Duration number too small."); + } + $nanoseconds = static::getNanosecondsForTimestamp($value->getNanos()); + if (!empty($nanoseconds)) { + $nanoseconds = ".".$nanoseconds; + } + $date = new \DateTime('@'.$value->getSeconds(), new \DateTimeZone("UTC")); + return $date->format("Y-m-d\TH:i:s".$nanoseconds."\Z"); + } + + public static function parseDuration($value) + { + if (strlen($value) < 2 || substr($value, -1) !== "s") { + throw new GPBDecodeException("Missing s after duration string"); + } + $number = substr($value, 0, -1); + if (bccomp($number, "315576000001") != -1) { + throw new GPBDecodeException("Duration number too large."); + } + if (bccomp($number, "-315576000001") != 1) { + throw new GPBDecodeException("Duration number too small."); + } + $pos = strrpos($number, "."); + if ($pos !== false) { + $seconds = substr($number, 0, $pos); + if (bccomp($seconds, 0) < 0) { + $nanos = bcmul("0" . substr($number, $pos), -1000000000); + } else { + $nanos = bcmul("0" . substr($number, $pos), 1000000000); + } + } else { + $seconds = $number; + $nanos = 0; + } + $duration = new Duration(); + $duration->setSeconds($seconds); + $duration->setNanos($nanos); + return $duration; + } + + public static function formatDuration($value) + { + if (bccomp($value->getSeconds(), '315576000001') != -1) { + throw new GPBDecodeException('Duration number too large.'); + } + if (bccomp($value->getSeconds(), '-315576000001') != 1) { + throw new GPBDecodeException('Duration number too small.'); + } + + $nanos = $value->getNanos(); + if ($nanos === 0) { + return (string) $value->getSeconds(); + } + + if ($nanos % 1000000 === 0) { + $digits = 3; + } elseif ($nanos % 1000 === 0) { + $digits = 6; + } else { + $digits = 9; + } + + $nanos = bcdiv($nanos, '1000000000', $digits); + return bcadd($value->getSeconds(), $nanos, $digits); + } + + public static function parseFieldMask($paths_string) + { + $field_mask = new FieldMask(); + if (strlen($paths_string) === 0) { + return $field_mask; + } + $path_strings = explode(",", $paths_string); + $paths = $field_mask->getPaths(); + foreach($path_strings as &$path_string) { + $field_strings = explode(".", $path_string); + foreach($field_strings as &$field_string) { + $field_string = camel2underscore($field_string); + } + $path_string = implode(".", $field_strings); + $paths[] = $path_string; + } + return $field_mask; + } + + public static function formatFieldMask($field_mask) + { + $converted_paths = []; + foreach($field_mask->getPaths() as $path) { + $fields = explode('.', $path); + $converted_path = []; + foreach ($fields as $field) { + $segments = explode('_', $field); + $start = true; + $converted_segments = ""; + foreach($segments as $segment) { + if (!$start) { + $converted = ucfirst($segment); + } else { + $converted = $segment; + $start = false; + } + $converted_segments .= $converted; + } + $converted_path []= $converted_segments; + } + $converted_path = implode(".", $converted_path); + $converted_paths []= $converted_path; + } + return implode(",", $converted_paths); + } + + public static function getNanosecondsForTimestamp($nanoseconds) + { + if ($nanoseconds == 0) { + return ''; + } + if ($nanoseconds % static::NANOS_PER_MILLISECOND == 0) { + return sprintf('%03d', $nanoseconds / static::NANOS_PER_MILLISECOND); + } + if ($nanoseconds % static::NANOS_PER_MICROSECOND == 0) { + return sprintf('%06d', $nanoseconds / static::NANOS_PER_MICROSECOND); + } + return sprintf('%09d', $nanoseconds); + } + + public static function hasSpecialJsonMapping($msg) + { + return is_a($msg, 'Google\Protobuf\Any') || + is_a($msg, "Google\Protobuf\ListValue") || + is_a($msg, "Google\Protobuf\Struct") || + is_a($msg, "Google\Protobuf\Value") || + is_a($msg, "Google\Protobuf\Duration") || + is_a($msg, "Google\Protobuf\Timestamp") || + is_a($msg, "Google\Protobuf\FieldMask") || + static::hasJsonValue($msg); + } + + public static function hasJsonValue($msg) + { + return is_a($msg, "Google\Protobuf\DoubleValue") || + is_a($msg, "Google\Protobuf\FloatValue") || + is_a($msg, "Google\Protobuf\Int64Value") || + is_a($msg, "Google\Protobuf\UInt64Value") || + is_a($msg, "Google\Protobuf\Int32Value") || + is_a($msg, "Google\Protobuf\UInt32Value") || + is_a($msg, "Google\Protobuf\BoolValue") || + is_a($msg, "Google\Protobuf\StringValue") || + is_a($msg, "Google\Protobuf\BytesValue"); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWire.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWire.php new file mode 100644 index 000000000..034f5df92 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWire.php @@ -0,0 +1,622 @@ +> self::TAG_TYPE_BITS) & 0x1fffffff; + } + + public static function getTagWireType($tag) + { + return $tag & 0x7; + } + + public static function getWireType($type) + { + switch ($type) { + case GPBType::FLOAT: + case GPBType::FIXED32: + case GPBType::SFIXED32: + return self::WIRETYPE_FIXED32; + case GPBType::DOUBLE: + case GPBType::FIXED64: + case GPBType::SFIXED64: + return self::WIRETYPE_FIXED64; + case GPBType::UINT32: + case GPBType::UINT64: + case GPBType::INT32: + case GPBType::INT64: + case GPBType::SINT32: + case GPBType::SINT64: + case GPBType::ENUM: + case GPBType::BOOL: + return self::WIRETYPE_VARINT; + case GPBType::STRING: + case GPBType::BYTES: + case GPBType::MESSAGE: + return self::WIRETYPE_LENGTH_DELIMITED; + case GPBType::GROUP: + user_error("Unsupported type."); + return 0; + default: + user_error("Unsupported type."); + return 0; + } + } + + // ZigZag Transform: Encodes signed integers so that they can be effectively + // used with varint encoding. + // + // varint operates on unsigned integers, encoding smaller numbers into fewer + // bytes. If you try to use it on a signed integer, it will treat this + // number as a very large unsigned integer, which means that even small + // signed numbers like -1 will take the maximum number of bytes (10) to + // encode. zigZagEncode() maps signed integers to unsigned in such a way + // that those with a small absolute value will have smaller encoded values, + // making them appropriate for encoding using varint. + // + // int32 -> uint32 + // ------------------------- + // 0 -> 0 + // -1 -> 1 + // 1 -> 2 + // -2 -> 3 + // ... -> ... + // 2147483647 -> 4294967294 + // -2147483648 -> 4294967295 + // + // >> encode >> + // << decode << + public static function zigZagEncode32($int32) + { + if (PHP_INT_SIZE == 8) { + $trim_int32 = $int32 & 0xFFFFFFFF; + return (($trim_int32 << 1) ^ ($int32 << 32 >> 63)) & 0xFFFFFFFF; + } else { + return ($int32 << 1) ^ ($int32 >> 31); + } + } + + public static function zigZagDecode32($uint32) + { + // Fill high 32 bits. + if (PHP_INT_SIZE === 8) { + $uint32 |= ($uint32 & 0xFFFFFFFF); + } + + $int32 = (($uint32 >> 1) & 0x7FFFFFFF) ^ (-($uint32 & 1)); + + return $int32; + } + + public static function zigZagEncode64($int64) + { + if (PHP_INT_SIZE == 4) { + if (bccomp($int64, 0) >= 0) { + return bcmul($int64, 2); + } else { + return bcsub(bcmul(bcsub(0, $int64), 2), 1); + } + } else { + return ((int)$int64 << 1) ^ ((int)$int64 >> 63); + } + } + + public static function zigZagDecode64($uint64) + { + if (PHP_INT_SIZE == 4) { + if (bcmod($uint64, 2) == 0) { + return bcdiv($uint64, 2, 0); + } else { + return bcsub(0, bcdiv(bcadd($uint64, 1), 2, 0)); + } + } else { + return (($uint64 >> 1) & 0x7FFFFFFFFFFFFFFF) ^ (-($uint64 & 1)); + } + } + + public static function readInt32(&$input, &$value) + { + return $input->readVarint32($value); + } + + public static function readInt64(&$input, &$value) + { + $success = $input->readVarint64($value); + if (PHP_INT_SIZE == 4 && bccomp($value, "9223372036854775807") > 0) { + $value = bcsub($value, "18446744073709551616"); + } + return $success; + } + + public static function readUint32(&$input, &$value) + { + return self::readInt32($input, $value); + } + + public static function readUint64(&$input, &$value) + { + return self::readInt64($input, $value); + } + + public static function readSint32(&$input, &$value) + { + if (!$input->readVarint32($value)) { + return false; + } + $value = GPBWire::zigZagDecode32($value); + return true; + } + + public static function readSint64(&$input, &$value) + { + if (!$input->readVarint64($value)) { + return false; + } + $value = GPBWire::zigZagDecode64($value); + return true; + } + + public static function readFixed32(&$input, &$value) + { + return $input->readLittleEndian32($value); + } + + public static function readFixed64(&$input, &$value) + { + return $input->readLittleEndian64($value); + } + + public static function readSfixed32(&$input, &$value) + { + if (!self::readFixed32($input, $value)) { + return false; + } + if (PHP_INT_SIZE === 8) { + $value |= (-($value >> 31) << 32); + } + return true; + } + + public static function readSfixed64(&$input, &$value) + { + $success = $input->readLittleEndian64($value); + if (PHP_INT_SIZE == 4 && bccomp($value, "9223372036854775807") > 0) { + $value = bcsub($value, "18446744073709551616"); + } + return $success; + } + + public static function readFloat(&$input, &$value) + { + $data = null; + if (!$input->readRaw(4, $data)) { + return false; + } + $value = unpack('f', $data)[1]; + return true; + } + + public static function readDouble(&$input, &$value) + { + $data = null; + if (!$input->readRaw(8, $data)) { + return false; + } + $value = unpack('d', $data)[1]; + return true; + } + + public static function readBool(&$input, &$value) + { + if (!$input->readVarint64($value)) { + return false; + } + if ($value == 0) { + $value = false; + } else { + $value = true; + } + return true; + } + + public static function readString(&$input, &$value) + { + $length = 0; + return $input->readVarintSizeAsInt($length) && $input->readRaw($length, $value); + } + + public static function readMessage(&$input, &$message) + { + $length = 0; + if (!$input->readVarintSizeAsInt($length)) { + return false; + } + $old_limit = 0; + $recursion_limit = 0; + $input->incrementRecursionDepthAndPushLimit( + $length, + $old_limit, + $recursion_limit); + if ($recursion_limit < 0 || !$message->parseFromStream($input)) { + return false; + } + return $input->decrementRecursionDepthAndPopLimit($old_limit); + } + + public static function writeTag(&$output, $tag) + { + return $output->writeTag($tag); + } + + public static function writeInt32(&$output, $value) + { + return $output->writeVarint32($value, false); + } + + public static function writeInt64(&$output, $value) + { + return $output->writeVarint64($value); + } + + public static function writeUint32(&$output, $value) + { + return $output->writeVarint32($value, true); + } + + public static function writeUint64(&$output, $value) + { + return $output->writeVarint64($value); + } + + public static function writeSint32(&$output, $value) + { + $value = GPBWire::zigZagEncode32($value); + return $output->writeVarint32($value, true); + } + + public static function writeSint64(&$output, $value) + { + $value = GPBWire::zigZagEncode64($value); + return $output->writeVarint64($value); + } + + public static function writeFixed32(&$output, $value) + { + return $output->writeLittleEndian32($value); + } + + public static function writeFixed64(&$output, $value) + { + return $output->writeLittleEndian64($value); + } + + public static function writeSfixed32(&$output, $value) + { + return $output->writeLittleEndian32($value); + } + + public static function writeSfixed64(&$output, $value) + { + return $output->writeLittleEndian64($value); + } + + public static function writeBool(&$output, $value) + { + if ($value) { + return $output->writeVarint32(1, true); + } else { + return $output->writeVarint32(0, true); + } + } + + public static function writeFloat(&$output, $value) + { + $data = pack("f", $value); + return $output->writeRaw($data, 4); + } + + public static function writeDouble(&$output, $value) + { + $data = pack("d", $value); + return $output->writeRaw($data, 8); + } + + public static function writeString(&$output, $value) + { + return self::writeBytes($output, $value); + } + + public static function writeBytes(&$output, $value) + { + $size = strlen($value); + if (!$output->writeVarint32($size, true)) { + return false; + } + return $output->writeRaw($value, $size); + } + + public static function writeMessage(&$output, $value) + { + $size = $value->byteSize(); + if (!$output->writeVarint32($size, true)) { + return false; + } + return $value->serializeToStream($output); + } + + public static function makeTag($number, $type) + { + return ($number << 3) | self::getWireType($type); + } + + public static function tagSize($field) + { + $tag = self::makeTag($field->getNumber(), $field->getType()); + return self::varint32Size($tag); + } + + public static function varint32Size($value, $sign_extended = false) + { + if ($value < 0) { + if ($sign_extended) { + return 10; + } else { + return 5; + } + } + if ($value < (1 << 7)) { + return 1; + } + if ($value < (1 << 14)) { + return 2; + } + if ($value < (1 << 21)) { + return 3; + } + if ($value < (1 << 28)) { + return 4; + } + return 5; + } + + public static function sint32Size($value) + { + $value = self::zigZagEncode32($value); + return self::varint32Size($value); + } + + public static function sint64Size($value) + { + $value = self::zigZagEncode64($value); + return self::varint64Size($value); + } + + public static function varint64Size($value) + { + if (PHP_INT_SIZE == 4) { + if (bccomp($value, 0) < 0 || + bccomp($value, "9223372036854775807") > 0) { + return 10; + } + if (bccomp($value, 1 << 7) < 0) { + return 1; + } + if (bccomp($value, 1 << 14) < 0) { + return 2; + } + if (bccomp($value, 1 << 21) < 0) { + return 3; + } + if (bccomp($value, 1 << 28) < 0) { + return 4; + } + if (bccomp($value, '34359738368') < 0) { + return 5; + } + if (bccomp($value, '4398046511104') < 0) { + return 6; + } + if (bccomp($value, '562949953421312') < 0) { + return 7; + } + if (bccomp($value, '72057594037927936') < 0) { + return 8; + } + return 9; + } else { + if ($value < 0) { + return 10; + } + if ($value < (1 << 7)) { + return 1; + } + if ($value < (1 << 14)) { + return 2; + } + if ($value < (1 << 21)) { + return 3; + } + if ($value < (1 << 28)) { + return 4; + } + if ($value < (1 << 35)) { + return 5; + } + if ($value < (1 << 42)) { + return 6; + } + if ($value < (1 << 49)) { + return 7; + } + if ($value < (1 << 56)) { + return 8; + } + return 9; + } + } + + public static function serializeFieldToStream( + $value, + $field, + $need_tag, + &$output) + { + if ($need_tag) { + if (!GPBWire::writeTag( + $output, + self::makeTag( + $field->getNumber(), + $field->getType()))) { + return false; + } + } + switch ($field->getType()) { + case GPBType::DOUBLE: + if (!GPBWire::writeDouble($output, $value)) { + return false; + } + break; + case GPBType::FLOAT: + if (!GPBWire::writeFloat($output, $value)) { + return false; + } + break; + case GPBType::INT64: + if (!GPBWire::writeInt64($output, $value)) { + return false; + } + break; + case GPBType::UINT64: + if (!GPBWire::writeUint64($output, $value)) { + return false; + } + break; + case GPBType::INT32: + if (!GPBWire::writeInt32($output, $value)) { + return false; + } + break; + case GPBType::FIXED32: + if (!GPBWire::writeFixed32($output, $value)) { + return false; + } + break; + case GPBType::FIXED64: + if (!GPBWire::writeFixed64($output, $value)) { + return false; + } + break; + case GPBType::BOOL: + if (!GPBWire::writeBool($output, $value)) { + return false; + } + break; + case GPBType::STRING: + if (!GPBWire::writeString($output, $value)) { + return false; + } + break; + // case GPBType::GROUP: + // echo "GROUP\xA"; + // trigger_error("Not implemented.", E_ERROR); + // break; + case GPBType::MESSAGE: + if (!GPBWire::writeMessage($output, $value)) { + return false; + } + break; + case GPBType::BYTES: + if (!GPBWire::writeBytes($output, $value)) { + return false; + } + break; + case GPBType::UINT32: + if (PHP_INT_SIZE === 8 && $value < 0) { + $value += 4294967296; + } + if (!GPBWire::writeUint32($output, $value)) { + return false; + } + break; + case GPBType::ENUM: + if (!GPBWire::writeInt32($output, $value)) { + return false; + } + break; + case GPBType::SFIXED32: + if (!GPBWire::writeSfixed32($output, $value)) { + return false; + } + break; + case GPBType::SFIXED64: + if (!GPBWire::writeSfixed64($output, $value)) { + return false; + } + break; + case GPBType::SINT32: + if (!GPBWire::writeSint32($output, $value)) { + return false; + } + break; + case GPBType::SINT64: + if (!GPBWire::writeSint64($output, $value)) { + return false; + } + break; + default: + user_error("Unsupported type."); + return false; + } + + return true; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWireType.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWireType.php new file mode 100644 index 000000000..c1ad370e0 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWireType.php @@ -0,0 +1,43 @@ +google.protobuf.GeneratedCodeInfo + */ +class GeneratedCodeInfo extends \Google\Protobuf\Internal\Message +{ + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + * + * Generated from protobuf field repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + */ + private $annotation; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Protobuf\Internal\GeneratedCodeInfo\Annotation>|\Google\Protobuf\Internal\RepeatedField $annotation + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + * + * Generated from protobuf field repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnnotation() + { + return $this->annotation; + } + + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + * + * Generated from protobuf field repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + * @param array<\Google\Protobuf\Internal\GeneratedCodeInfo\Annotation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnnotation($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation::class); + $this->annotation = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php new file mode 100644 index 000000000..b1ef4ee95 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php @@ -0,0 +1,255 @@ +google.protobuf.GeneratedCodeInfo.Annotation + */ +class Annotation extends \Google\Protobuf\Internal\Message +{ + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + * + * Generated from protobuf field repeated int32 path = 1 [packed = true]; + */ + private $path; + /** + * Identifies the filesystem path to the original source .proto. + * + * Generated from protobuf field optional string source_file = 2; + */ + protected $source_file = null; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + * + * Generated from protobuf field optional int32 begin = 3; + */ + protected $begin = null; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified object. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + * + * Generated from protobuf field optional int32 end = 4; + */ + protected $end = null; + /** + * Generated from protobuf field optional .google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5; + */ + protected $semantic = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $path + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + * @type string $source_file + * Identifies the filesystem path to the original source .proto. + * @type int $begin + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + * @type int $end + * Identifies the ending offset in bytes in the generated code that + * relates to the identified object. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + * @type int $semantic + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + * + * Generated from protobuf field repeated int32 path = 1 [packed = true]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPath() + { + return $this->path; + } + + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + * + * Generated from protobuf field repeated int32 path = 1 [packed = true]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPath($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->path = $arr; + + return $this; + } + + /** + * Identifies the filesystem path to the original source .proto. + * + * Generated from protobuf field optional string source_file = 2; + * @return string + */ + public function getSourceFile() + { + return isset($this->source_file) ? $this->source_file : ''; + } + + public function hasSourceFile() + { + return isset($this->source_file); + } + + public function clearSourceFile() + { + unset($this->source_file); + } + + /** + * Identifies the filesystem path to the original source .proto. + * + * Generated from protobuf field optional string source_file = 2; + * @param string $var + * @return $this + */ + public function setSourceFile($var) + { + GPBUtil::checkString($var, True); + $this->source_file = $var; + + return $this; + } + + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + * + * Generated from protobuf field optional int32 begin = 3; + * @return int + */ + public function getBegin() + { + return isset($this->begin) ? $this->begin : 0; + } + + public function hasBegin() + { + return isset($this->begin); + } + + public function clearBegin() + { + unset($this->begin); + } + + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + * + * Generated from protobuf field optional int32 begin = 3; + * @param int $var + * @return $this + */ + public function setBegin($var) + { + GPBUtil::checkInt32($var); + $this->begin = $var; + + return $this; + } + + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified object. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + * + * Generated from protobuf field optional int32 end = 4; + * @return int + */ + public function getEnd() + { + return isset($this->end) ? $this->end : 0; + } + + public function hasEnd() + { + return isset($this->end); + } + + public function clearEnd() + { + unset($this->end); + } + + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified object. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + * + * Generated from protobuf field optional int32 end = 4; + * @param int $var + * @return $this + */ + public function setEnd($var) + { + GPBUtil::checkInt32($var); + $this->end = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5; + * @return int + */ + public function getSemantic() + { + return isset($this->semantic) ? $this->semantic : 0; + } + + public function hasSemantic() + { + return isset($this->semantic); + } + + public function clearSemantic() + { + unset($this->semantic); + } + + /** + * Generated from protobuf field optional .google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5; + * @param int $var + * @return $this + */ + public function setSemantic($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation\Semantic::class); + $this->semantic = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Annotation::class, \Google\Protobuf\Internal\GeneratedCodeInfo_Annotation::class); + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php new file mode 100644 index 000000000..e36f1e573 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php @@ -0,0 +1,16 @@ +getPublicDescriptor(); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/HasPublicDescriptorTrait.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/HasPublicDescriptorTrait.php new file mode 100644 index 000000000..ed5d1660b --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/HasPublicDescriptorTrait.php @@ -0,0 +1,43 @@ +public_desc; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MapEntry.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MapEntry.php new file mode 100644 index 000000000..e89481f0a --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MapEntry.php @@ -0,0 +1,71 @@ +getFieldByNumber(2); + if ($value_field->getType() == GPBType::MESSAGE) { + $klass = $value_field->getMessageType()->getClass(); + $value = new $klass; + $this->setValue($value); + } + } + + public function setKey($key) { + $this->key = $key; + } + + public function getKey() { + return $this->key; + } + + public function setValue($value) { + $this->value = $value; + } + + public function getValue() { + return $this->value; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MapField.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MapField.php new file mode 100644 index 000000000..d413c6d90 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MapField.php @@ -0,0 +1,298 @@ +container = []; + $this->key_type = $key_type; + $this->value_type = $value_type; + $this->klass = $klass; + + if ($this->value_type == GPBType::MESSAGE) { + $pool = DescriptorPool::getGeneratedPool(); + $desc = $pool->getDescriptorByClassName($klass); + if ($desc == NULL) { + new $klass; // No msg class instance has been created before. + $desc = $pool->getDescriptorByClassName($klass); + } + $this->klass = $desc->getClass(); + $this->legacy_klass = $desc->getLegacyClass(); + } + } + + /** + * @ignore + */ + public function getKeyType() + { + return $this->key_type; + } + + /** + * @ignore + */ + public function getValueType() + { + return $this->value_type; + } + + /** + * @ignore + */ + public function getValueClass() + { + return $this->klass; + } + + /** + * @ignore + */ + public function getLegacyValueClass() + { + return $this->legacy_klass; + } + + /** + * Return the element at the given key. + * + * This will also be called for: $ele = $arr[$key] + * + * @param int|string $key The key of the element to be fetched. + * @return object The stored element at given key. + * @throws \ErrorException Invalid type for index. + * @throws \ErrorException Non-existing index. + * @todo need to add return type mixed (require update php version to 8.0) + */ + #[\ReturnTypeWillChange] + public function offsetGet($key) + { + return $this->container[$key]; + } + + /** + * Assign the element at the given key. + * + * This will also be called for: $arr[$key] = $value + * + * @param int|string $key The key of the element to be fetched. + * @param object $value The element to be assigned. + * @return void + * @throws \ErrorException Invalid type for key. + * @throws \ErrorException Invalid type for value. + * @throws \ErrorException Non-existing key. + * @todo need to add return type void (require update php version to 7.1) + */ + #[\ReturnTypeWillChange] + public function offsetSet($key, $value) + { + $this->checkKey($this->key_type, $key); + + switch ($this->value_type) { + case GPBType::SFIXED32: + case GPBType::SINT32: + case GPBType::INT32: + case GPBType::ENUM: + GPBUtil::checkInt32($value); + break; + case GPBType::FIXED32: + case GPBType::UINT32: + GPBUtil::checkUint32($value); + break; + case GPBType::SFIXED64: + case GPBType::SINT64: + case GPBType::INT64: + GPBUtil::checkInt64($value); + break; + case GPBType::FIXED64: + case GPBType::UINT64: + GPBUtil::checkUint64($value); + break; + case GPBType::FLOAT: + GPBUtil::checkFloat($value); + break; + case GPBType::DOUBLE: + GPBUtil::checkDouble($value); + break; + case GPBType::BOOL: + GPBUtil::checkBool($value); + break; + case GPBType::STRING: + GPBUtil::checkString($value, true); + break; + case GPBType::MESSAGE: + if (is_null($value)) { + trigger_error("Map element cannot be null.", E_USER_ERROR); + } + GPBUtil::checkMessage($value, $this->klass); + break; + default: + break; + } + + $this->container[$key] = $value; + } + + /** + * Remove the element at the given key. + * + * This will also be called for: unset($arr) + * + * @param int|string $key The key of the element to be removed. + * @return void + * @throws \ErrorException Invalid type for key. + * @todo need to add return type void (require update php version to 7.1) + */ + #[\ReturnTypeWillChange] + public function offsetUnset($key) + { + $this->checkKey($this->key_type, $key); + unset($this->container[$key]); + } + + /** + * Check the existence of the element at the given key. + * + * This will also be called for: isset($arr) + * + * @param int|string $key The key of the element to be removed. + * @return bool True if the element at the given key exists. + * @throws \ErrorException Invalid type for key. + */ + public function offsetExists($key): bool + { + $this->checkKey($this->key_type, $key); + return isset($this->container[$key]); + } + + /** + * @ignore + */ + public function getIterator(): Traversable + { + return new MapFieldIter($this->container, $this->key_type); + } + + /** + * Return the number of stored elements. + * + * This will also be called for: count($arr) + * + * @return integer The number of stored elements. + */ + public function count(): int + { + return count($this->container); + } + + /** + * @ignore + */ + private function checkKey($key_type, &$key) + { + switch ($key_type) { + case GPBType::SFIXED32: + case GPBType::SINT32: + case GPBType::INT32: + GPBUtil::checkInt32($key); + break; + case GPBType::FIXED32: + case GPBType::UINT32: + GPBUtil::checkUint32($key); + break; + case GPBType::SFIXED64: + case GPBType::SINT64: + case GPBType::INT64: + GPBUtil::checkInt64($key); + break; + case GPBType::FIXED64: + case GPBType::UINT64: + GPBUtil::checkUint64($key); + break; + case GPBType::BOOL: + GPBUtil::checkBool($key); + break; + case GPBType::STRING: + GPBUtil::checkString($key, true); + break; + default: + trigger_error( + "Given type cannot be map key.", + E_USER_ERROR); + break; + } + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MapFieldIter.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MapFieldIter.php new file mode 100644 index 000000000..a56d27e2e --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MapFieldIter.php @@ -0,0 +1,146 @@ +container = $container; + $this->key_type = $key_type; + } + + /** + * Reset the status of the iterator + * + * @return void + * @todo need to add return type void (require update php version to 7.1) + */ + #[\ReturnTypeWillChange] + public function rewind() + { + reset($this->container); + } + + /** + * Return the element at the current position. + * + * @return object The element at the current position. + * @todo need to add return type mixed (require update php version to 8.0) + */ + #[\ReturnTypeWillChange] + public function current() + { + return current($this->container); + } + + /** + * Return the current key. + * + * @return object The current key. + * @todo need to add return type mixed (require update php version to 8.0) + */ + #[\ReturnTypeWillChange] + public function key() + { + $key = key($this->container); + switch ($this->key_type) { + case GPBType::INT64: + case GPBType::UINT64: + case GPBType::FIXED64: + case GPBType::SFIXED64: + case GPBType::SINT64: + if (PHP_INT_SIZE === 8) { + return $key; + } + // Intentionally fall through + case GPBType::STRING: + // PHP associative array stores int string as int for key. + return strval($key); + case GPBType::BOOL: + // PHP associative array stores bool as integer for key. + return boolval($key); + default: + return $key; + } + } + + /** + * Move to the next position. + * + * @return void + * @todo need to add return type void (require update php version to 7.1) + */ + #[\ReturnTypeWillChange] + public function next() + { + next($this->container); + } + + /** + * Check whether there are more elements to iterate. + * + * @return bool True if there are more elements to iterate. + */ + public function valid(): bool + { + return key($this->container) !== null; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php new file mode 100644 index 000000000..357f16d69 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php @@ -0,0 +1,2040 @@ +initWithDescriptor($data); + } else { + $this->initWithGeneratedPool(); + if (is_array($data)) { + $this->mergeFromArray($data); + } else if (!empty($data)) { + throw new \InvalidArgumentException( + 'Message constructor must be an array or null.' + ); + } + } + } + + /** + * @ignore + */ + private function initWithGeneratedPool() + { + $pool = DescriptorPool::getGeneratedPool(); + $this->desc = $pool->getDescriptorByClassName(get_class($this)); + if (is_null($this->desc)) { + throw new \InvalidArgumentException( + get_class($this) ." is not found in descriptor pool. " . + 'Only generated classes may derive from Message.'); + } + foreach ($this->desc->getField() as $field) { + $setter = $field->getSetter(); + if ($field->isMap()) { + $message_type = $field->getMessageType(); + $key_field = $message_type->getFieldByNumber(1); + $value_field = $message_type->getFieldByNumber(2); + switch ($value_field->getType()) { + case GPBType::MESSAGE: + case GPBType::GROUP: + $map_field = new MapField( + $key_field->getType(), + $value_field->getType(), + $value_field->getMessageType()->getClass()); + $this->$setter($map_field); + break; + case GPBType::ENUM: + $map_field = new MapField( + $key_field->getType(), + $value_field->getType(), + $value_field->getEnumType()->getClass()); + $this->$setter($map_field); + break; + default: + $map_field = new MapField( + $key_field->getType(), + $value_field->getType()); + $this->$setter($map_field); + break; + } + } else if ($field->getLabel() === GPBLabel::REPEATED) { + switch ($field->getType()) { + case GPBType::MESSAGE: + case GPBType::GROUP: + $repeated_field = new RepeatedField( + $field->getType(), + $field->getMessageType()->getClass()); + $this->$setter($repeated_field); + break; + case GPBType::ENUM: + $repeated_field = new RepeatedField( + $field->getType(), + $field->getEnumType()->getClass()); + $this->$setter($repeated_field); + break; + default: + $repeated_field = new RepeatedField($field->getType()); + $this->$setter($repeated_field); + break; + } + } else if ($field->getOneofIndex() !== -1) { + $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()]; + $oneof_name = $oneof->getName(); + $this->$oneof_name = new OneofField($oneof); + } else if ($field->getLabel() === GPBLabel::OPTIONAL && + PHP_INT_SIZE == 4) { + switch ($field->getType()) { + case GPBType::INT64: + case GPBType::UINT64: + case GPBType::FIXED64: + case GPBType::SFIXED64: + case GPBType::SINT64: + $this->$setter("0"); + } + } + } + } + + /** + * @ignore + */ + private function initWithDescriptor(Descriptor $desc) + { + $this->desc = $desc; + foreach ($desc->getField() as $field) { + $setter = $field->getSetter(); + $defaultValue = $this->defaultValue($field); + $this->$setter($defaultValue); + } + } + + protected function readWrapperValue($member) + { + $field = $this->desc->getFieldByName($member); + $oneof_index = $field->getOneofIndex(); + if ($oneof_index === -1) { + $wrapper = $this->$member; + } else { + $wrapper = $this->readOneof($field->getNumber()); + } + + if (is_null($wrapper)) { + return NULL; + } else { + return $wrapper->getValue(); + } + } + + protected function writeWrapperValue($member, $value) + { + $field = $this->desc->getFieldByName($member); + $wrapped_value = $value; + if (!is_null($value)) { + $desc = $field->getMessageType(); + $klass = $desc->getClass(); + $wrapped_value = new $klass; + $wrapped_value->setValue($value); + } + + $oneof_index = $field->getOneofIndex(); + if ($oneof_index === -1) { + $this->$member = $wrapped_value; + } else { + $this->writeOneof($field->getNumber(), $wrapped_value); + } + } + + protected function readOneof($number) + { + $field = $this->desc->getFieldByNumber($number); + $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()]; + $oneof_name = $oneof->getName(); + $oneof_field = $this->$oneof_name; + if ($number === $oneof_field->getNumber()) { + return $oneof_field->getValue(); + } else { + return $this->defaultValue($field); + } + } + + protected function hasOneof($number) + { + $field = $this->desc->getFieldByNumber($number); + $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()]; + $oneof_name = $oneof->getName(); + $oneof_field = $this->$oneof_name; + return $number === $oneof_field->getNumber(); + } + + protected function writeOneof($number, $value) + { + $field = $this->desc->getFieldByNumber($number); + $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()]; + $oneof_name = $oneof->getName(); + if ($value === null) { + $this->$oneof_name = new OneofField($oneof); + } else { + $oneof_field = $this->$oneof_name; + $oneof_field->setValue($value); + $oneof_field->setFieldName($field->getName()); + $oneof_field->setNumber($number); + } + } + + protected function whichOneof($oneof_name) + { + $oneof_field = $this->$oneof_name; + $number = $oneof_field->getNumber(); + if ($number == 0) { + return ""; + } + $field = $this->desc->getFieldByNumber($number); + return $field->getName(); + } + + /** + * @ignore + */ + private function defaultValue($field) + { + $value = null; + + switch ($field->getType()) { + case GPBType::DOUBLE: + case GPBType::FLOAT: + return 0.0; + case GPBType::UINT32: + case GPBType::INT32: + case GPBType::FIXED32: + case GPBType::SFIXED32: + case GPBType::SINT32: + case GPBType::ENUM: + return 0; + case GPBType::INT64: + case GPBType::UINT64: + case GPBType::FIXED64: + case GPBType::SFIXED64: + case GPBType::SINT64: + if (PHP_INT_SIZE === 4) { + return '0'; + } else { + return 0; + } + case GPBType::BOOL: + return false; + case GPBType::STRING: + case GPBType::BYTES: + return ""; + case GPBType::GROUP: + case GPBType::MESSAGE: + return null; + default: + user_error("Unsupported type."); + return false; + } + } + + /** + * @ignore + */ + private function skipField($input, $tag) + { + $number = GPBWire::getTagFieldNumber($tag); + if ($number === 0) { + throw new GPBDecodeException("Illegal field number zero."); + } + + $start = $input->current(); + switch (GPBWire::getTagWireType($tag)) { + case GPBWireType::VARINT: + $uint64 = 0; + if (!$input->readVarint64($uint64)) { + throw new GPBDecodeException( + "Unexpected EOF inside varint."); + } + break; + case GPBWireType::FIXED64: + $uint64 = 0; + if (!$input->readLittleEndian64($uint64)) { + throw new GPBDecodeException( + "Unexpected EOF inside fixed64."); + } + break; + case GPBWireType::FIXED32: + $uint32 = 0; + if (!$input->readLittleEndian32($uint32)) { + throw new GPBDecodeException( + "Unexpected EOF inside fixed32."); + } + break; + case GPBWireType::LENGTH_DELIMITED: + $length = 0; + if (!$input->readVarint32($length)) { + throw new GPBDecodeException( + "Unexpected EOF inside length."); + } + $data = NULL; + if (!$input->readRaw($length, $data)) { + throw new GPBDecodeException( + "Unexpected EOF inside length delimited data."); + } + break; + case GPBWireType::START_GROUP: + case GPBWireType::END_GROUP: + throw new GPBDecodeException("Unexpected wire type."); + default: + throw new GPBDecodeException("Unexpected wire type."); + } + $end = $input->current(); + + $bytes = str_repeat(chr(0), CodedOutputStream::MAX_VARINT64_BYTES); + $size = CodedOutputStream::writeVarintToArray($tag, $bytes, true); + $this->unknown .= substr($bytes, 0, $size) . $input->substr($start, $end); + } + + /** + * @ignore + */ + private static function parseFieldFromStreamNoTag($input, $field, &$value) + { + switch ($field->getType()) { + case GPBType::DOUBLE: + if (!GPBWire::readDouble($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside double field."); + } + break; + case GPBType::FLOAT: + if (!GPBWire::readFloat($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside float field."); + } + break; + case GPBType::INT64: + if (!GPBWire::readInt64($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside int64 field."); + } + break; + case GPBType::UINT64: + if (!GPBWire::readUint64($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside uint64 field."); + } + break; + case GPBType::INT32: + if (!GPBWire::readInt32($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside int32 field."); + } + break; + case GPBType::FIXED64: + if (!GPBWire::readFixed64($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside fixed64 field."); + } + break; + case GPBType::FIXED32: + if (!GPBWire::readFixed32($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside fixed32 field."); + } + break; + case GPBType::BOOL: + if (!GPBWire::readBool($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside bool field."); + } + break; + case GPBType::STRING: + // TODO(teboring): Add utf-8 check. + if (!GPBWire::readString($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside string field."); + } + break; + case GPBType::GROUP: + trigger_error("Not implemented.", E_USER_ERROR); + break; + case GPBType::MESSAGE: + if ($field->isMap()) { + $value = new MapEntry($field->getMessageType()); + } else { + $klass = $field->getMessageType()->getClass(); + $value = new $klass; + } + if (!GPBWire::readMessage($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside message."); + } + break; + case GPBType::BYTES: + if (!GPBWire::readString($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside bytes field."); + } + break; + case GPBType::UINT32: + if (!GPBWire::readUint32($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside uint32 field."); + } + break; + case GPBType::ENUM: + // TODO(teboring): Check unknown enum value. + if (!GPBWire::readInt32($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside enum field."); + } + break; + case GPBType::SFIXED32: + if (!GPBWire::readSfixed32($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside sfixed32 field."); + } + break; + case GPBType::SFIXED64: + if (!GPBWire::readSfixed64($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside sfixed64 field."); + } + break; + case GPBType::SINT32: + if (!GPBWire::readSint32($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside sint32 field."); + } + break; + case GPBType::SINT64: + if (!GPBWire::readSint64($input, $value)) { + throw new GPBDecodeException( + "Unexpected EOF inside sint64 field."); + } + break; + default: + user_error("Unsupported type."); + return false; + } + return true; + } + + /** + * @ignore + */ + private function parseFieldFromStream($tag, $input, $field) + { + $value = null; + + if (is_null($field)) { + $value_format = GPBWire::UNKNOWN; + } elseif (GPBWire::getTagWireType($tag) === + GPBWire::getWireType($field->getType())) { + $value_format = GPBWire::NORMAL_FORMAT; + } elseif ($field->isPackable() && + GPBWire::getTagWireType($tag) === + GPBWire::WIRETYPE_LENGTH_DELIMITED) { + $value_format = GPBWire::PACKED_FORMAT; + } else { + // the wire type doesn't match. Put it in our unknown field set. + $value_format = GPBWire::UNKNOWN; + } + + if ($value_format === GPBWire::UNKNOWN) { + $this->skipField($input, $tag); + return; + } elseif ($value_format === GPBWire::NORMAL_FORMAT) { + self::parseFieldFromStreamNoTag($input, $field, $value); + } elseif ($value_format === GPBWire::PACKED_FORMAT) { + $length = 0; + if (!GPBWire::readInt32($input, $length)) { + throw new GPBDecodeException( + "Unexpected EOF inside packed length."); + } + $limit = $input->pushLimit($length); + $getter = $field->getGetter(); + while ($input->bytesUntilLimit() > 0) { + self::parseFieldFromStreamNoTag($input, $field, $value); + $this->appendHelper($field, $value); + } + $input->popLimit($limit); + return; + } else { + return; + } + + if ($field->isMap()) { + $this->kvUpdateHelper($field, $value->getKey(), $value->getValue()); + } else if ($field->isRepeated()) { + $this->appendHelper($field, $value); + } else { + $setter = $field->getSetter(); + $this->$setter($value); + } + } + + /** + * Clear all containing fields. + * @return null + */ + public function clear() + { + $this->unknown = ""; + foreach ($this->desc->getField() as $field) { + $setter = $field->getSetter(); + if ($field->isMap()) { + $message_type = $field->getMessageType(); + $key_field = $message_type->getFieldByNumber(1); + $value_field = $message_type->getFieldByNumber(2); + switch ($value_field->getType()) { + case GPBType::MESSAGE: + case GPBType::GROUP: + $map_field = new MapField( + $key_field->getType(), + $value_field->getType(), + $value_field->getMessageType()->getClass()); + $this->$setter($map_field); + break; + case GPBType::ENUM: + $map_field = new MapField( + $key_field->getType(), + $value_field->getType(), + $value_field->getEnumType()->getClass()); + $this->$setter($map_field); + break; + default: + $map_field = new MapField( + $key_field->getType(), + $value_field->getType()); + $this->$setter($map_field); + break; + } + } else if ($field->getLabel() === GPBLabel::REPEATED) { + switch ($field->getType()) { + case GPBType::MESSAGE: + case GPBType::GROUP: + $repeated_field = new RepeatedField( + $field->getType(), + $field->getMessageType()->getClass()); + $this->$setter($repeated_field); + break; + case GPBType::ENUM: + $repeated_field = new RepeatedField( + $field->getType(), + $field->getEnumType()->getClass()); + $this->$setter($repeated_field); + break; + default: + $repeated_field = new RepeatedField($field->getType()); + $this->$setter($repeated_field); + break; + } + } else if ($field->getOneofIndex() !== -1) { + $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()]; + $oneof_name = $oneof->getName(); + $this->$oneof_name = new OneofField($oneof); + } else if ($field->getLabel() === GPBLabel::OPTIONAL) { + switch ($field->getType()) { + case GPBType::DOUBLE : + case GPBType::FLOAT : + $this->$setter(0.0); + break; + case GPBType::INT32 : + case GPBType::FIXED32 : + case GPBType::UINT32 : + case GPBType::SFIXED32 : + case GPBType::SINT32 : + case GPBType::ENUM : + $this->$setter(0); + break; + case GPBType::BOOL : + $this->$setter(false); + break; + case GPBType::STRING : + case GPBType::BYTES : + $this->$setter(""); + break; + case GPBType::GROUP : + case GPBType::MESSAGE : + $null = null; + $this->$setter($null); + break; + } + if (PHP_INT_SIZE == 4) { + switch ($field->getType()) { + case GPBType::INT64: + case GPBType::UINT64: + case GPBType::FIXED64: + case GPBType::SFIXED64: + case GPBType::SINT64: + $this->$setter("0"); + } + } else { + switch ($field->getType()) { + case GPBType::INT64: + case GPBType::UINT64: + case GPBType::FIXED64: + case GPBType::SFIXED64: + case GPBType::SINT64: + $this->$setter(0); + } + } + } + } + } + + /** + * Clear all unknown fields previously parsed. + * @return null + */ + public function discardUnknownFields() + { + $this->unknown = ""; + foreach ($this->desc->getField() as $field) { + if ($field->getType() != GPBType::MESSAGE) { + continue; + } + if ($field->isMap()) { + $value_field = $field->getMessageType()->getFieldByNumber(2); + if ($value_field->getType() != GPBType::MESSAGE) { + continue; + } + $getter = $field->getGetter(); + $map = $this->$getter(); + foreach ($map as $key => $value) { + $value->discardUnknownFields(); + } + } else if ($field->getLabel() === GPBLabel::REPEATED) { + $getter = $field->getGetter(); + $arr = $this->$getter(); + foreach ($arr as $sub) { + $sub->discardUnknownFields(); + } + } else if ($field->getLabel() === GPBLabel::OPTIONAL) { + $getter = $field->getGetter(); + $sub = $this->$getter(); + if (!is_null($sub)) { + $sub->discardUnknownFields(); + } + } + } + } + + /** + * Merges the contents of the specified message into current message. + * + * This method merges the contents of the specified message into the + * current message. Singular fields that are set in the specified message + * overwrite the corresponding fields in the current message. Repeated + * fields are appended. Map fields key-value pairs are overwritten. + * Singular/Oneof sub-messages are recursively merged. All overwritten + * sub-messages are deep-copied. + * + * @param object $msg Protobuf message to be merged from. + * @return null + */ + public function mergeFrom($msg) + { + if (get_class($this) !== get_class($msg)) { + user_error("Cannot merge messages with different class."); + return; + } + + foreach ($this->desc->getField() as $field) { + $setter = $field->getSetter(); + $getter = $field->getGetter(); + if ($field->isMap()) { + if (count($msg->$getter()) != 0) { + $value_field = $field->getMessageType()->getFieldByNumber(2); + foreach ($msg->$getter() as $key => $value) { + if ($value_field->getType() == GPBType::MESSAGE) { + $klass = $value_field->getMessageType()->getClass(); + $copy = new $klass; + $copy->mergeFrom($value); + + $this->kvUpdateHelper($field, $key, $copy); + } else { + $this->kvUpdateHelper($field, $key, $value); + } + } + } + } else if ($field->getLabel() === GPBLabel::REPEATED) { + if (count($msg->$getter()) != 0) { + foreach ($msg->$getter() as $tmp) { + if ($field->getType() == GPBType::MESSAGE) { + $klass = $field->getMessageType()->getClass(); + $copy = new $klass; + $copy->mergeFrom($tmp); + $this->appendHelper($field, $copy); + } else { + $this->appendHelper($field, $tmp); + } + } + } + } else if ($field->getLabel() === GPBLabel::OPTIONAL) { + if($msg->$getter() !== $this->defaultValue($field)) { + $tmp = $msg->$getter(); + if ($field->getType() == GPBType::MESSAGE) { + if (is_null($this->$getter())) { + $klass = $field->getMessageType()->getClass(); + $new_msg = new $klass; + $this->$setter($new_msg); + } + $this->$getter()->mergeFrom($tmp); + } else { + $this->$setter($tmp); + } + } + } + } + } + + /** + * Parses a protocol buffer contained in a string. + * + * This function takes a string in the (non-human-readable) binary wire + * format, matching the encoding output by serializeToString(). + * See mergeFrom() for merging behavior, if the field is already set in the + * specified message. + * + * @param string $data Binary protobuf data. + * @return null + * @throws \Exception Invalid data. + */ + public function mergeFromString($data) + { + $input = new CodedInputStream($data); + $this->parseFromStream($input); + } + + /** + * Parses a json string to protobuf message. + * + * This function takes a string in the json wire format, matching the + * encoding output by serializeToJsonString(). + * See mergeFrom() for merging behavior, if the field is already set in the + * specified message. + * + * @param string $data Json protobuf data. + * @param bool $ignore_unknown + * @return null + * @throws \Exception Invalid data. + */ + public function mergeFromJsonString($data, $ignore_unknown = false) + { + $input = new RawInputStream($data); + $this->parseFromJsonStream($input, $ignore_unknown); + } + + /** + * @ignore + */ + public function parseFromStream($input) + { + while (true) { + $tag = $input->readTag(); + // End of input. This is a valid place to end, so return true. + if ($tag === 0) { + return true; + } + + $number = GPBWire::getTagFieldNumber($tag); + $field = $this->desc->getFieldByNumber($number); + + $this->parseFieldFromStream($tag, $input, $field); + } + } + + private function convertJsonValueToProtoValue( + $value, + $field, + $ignore_unknown, + $is_map_key = false) + { + switch ($field->getType()) { + case GPBType::MESSAGE: + $klass = $field->getMessageType()->getClass(); + $submsg = new $klass; + + if (is_a($submsg, "Google\Protobuf\Duration")) { + if (is_null($value)) { + return $this->defaultValue($field); + } else if (!is_string($value)) { + throw new GPBDecodeException("Expect string."); + } + return GPBUtil::parseDuration($value); + } else if ($field->isTimestamp()) { + if (is_null($value)) { + return $this->defaultValue($field); + } else if (!is_string($value)) { + throw new GPBDecodeException("Expect string."); + } + try { + $timestamp = GPBUtil::parseTimestamp($value); + } catch (\Exception $e) { + throw new GPBDecodeException( + "Invalid RFC 3339 timestamp: ".$e->getMessage()); + } + + $submsg->setSeconds($timestamp->getSeconds()); + $submsg->setNanos($timestamp->getNanos()); + } else if (is_a($submsg, "Google\Protobuf\FieldMask")) { + if (is_null($value)) { + return $this->defaultValue($field); + } + try { + return GPBUtil::parseFieldMask($value); + } catch (\Exception $e) { + throw new GPBDecodeException( + "Invalid FieldMask: ".$e->getMessage()); + } + } else { + if (is_null($value) && + !is_a($submsg, "Google\Protobuf\Value")) { + return $this->defaultValue($field); + } + if (GPBUtil::hasSpecialJsonMapping($submsg)) { + } elseif (!is_object($value) && !is_array($value)) { + throw new GPBDecodeException("Expect message."); + } + $submsg->mergeFromJsonArray($value, $ignore_unknown); + } + return $submsg; + case GPBType::ENUM: + if (is_null($value)) { + return $this->defaultValue($field); + } + if (is_integer($value)) { + return $value; + } + $enum_value = $field->getEnumType()->getValueByName($value); + if (!is_null($enum_value)) { + return $enum_value->getNumber(); + } else if ($ignore_unknown) { + return $this->defaultValue($field); + } else { + throw new GPBDecodeException( + "Enum field only accepts integer or enum value name"); + } + case GPBType::STRING: + if (is_null($value)) { + return $this->defaultValue($field); + } + if (is_numeric($value)) { + return strval($value); + } + if (!is_string($value)) { + throw new GPBDecodeException( + "String field only accepts string value"); + } + return $value; + case GPBType::BYTES: + if (is_null($value)) { + return $this->defaultValue($field); + } + if (!is_string($value)) { + throw new GPBDecodeException( + "Byte field only accepts string value"); + } + $proto_value = base64_decode($value, true); + if ($proto_value === false) { + throw new GPBDecodeException("Invalid base64 characters"); + } + return $proto_value; + case GPBType::BOOL: + if (is_null($value)) { + return $this->defaultValue($field); + } + if ($is_map_key) { + if ($value === "true") { + return true; + } + if ($value === "false") { + return false; + } + throw new GPBDecodeException( + "Bool field only accepts bool value"); + } + if (!is_bool($value)) { + throw new GPBDecodeException( + "Bool field only accepts bool value"); + } + return $value; + case GPBType::FLOAT: + case GPBType::DOUBLE: + if (is_null($value)) { + return $this->defaultValue($field); + } + if ($value === "Infinity") { + return INF; + } + if ($value === "-Infinity") { + return -INF; + } + if ($value === "NaN") { + return NAN; + } + return $value; + case GPBType::INT32: + case GPBType::SINT32: + case GPBType::SFIXED32: + if (is_null($value)) { + return $this->defaultValue($field); + } + if (!is_numeric($value)) { + throw new GPBDecodeException( + "Invalid data type for int32 field"); + } + if (is_string($value) && trim($value) !== $value) { + throw new GPBDecodeException( + "Invalid data type for int32 field"); + } + if (bccomp($value, "2147483647") > 0) { + throw new GPBDecodeException( + "Int32 too large"); + } + if (bccomp($value, "-2147483648") < 0) { + throw new GPBDecodeException( + "Int32 too small"); + } + return $value; + case GPBType::UINT32: + case GPBType::FIXED32: + if (is_null($value)) { + return $this->defaultValue($field); + } + if (!is_numeric($value)) { + throw new GPBDecodeException( + "Invalid data type for uint32 field"); + } + if (is_string($value) && trim($value) !== $value) { + throw new GPBDecodeException( + "Invalid data type for int32 field"); + } + if (bccomp($value, 4294967295) > 0) { + throw new GPBDecodeException( + "Uint32 too large"); + } + return $value; + case GPBType::INT64: + case GPBType::SINT64: + case GPBType::SFIXED64: + if (is_null($value)) { + return $this->defaultValue($field); + } + if (!is_numeric($value)) { + throw new GPBDecodeException( + "Invalid data type for int64 field"); + } + if (is_string($value) && trim($value) !== $value) { + throw new GPBDecodeException( + "Invalid data type for int64 field"); + } + if (bccomp($value, "9223372036854775807") > 0) { + throw new GPBDecodeException( + "Int64 too large"); + } + if (bccomp($value, "-9223372036854775808") < 0) { + throw new GPBDecodeException( + "Int64 too small"); + } + return $value; + case GPBType::UINT64: + case GPBType::FIXED64: + if (is_null($value)) { + return $this->defaultValue($field); + } + if (!is_numeric($value)) { + throw new GPBDecodeException( + "Invalid data type for int64 field"); + } + if (is_string($value) && trim($value) !== $value) { + throw new GPBDecodeException( + "Invalid data type for int64 field"); + } + if (bccomp($value, "18446744073709551615") > 0) { + throw new GPBDecodeException( + "Uint64 too large"); + } + if (bccomp($value, "9223372036854775807") > 0) { + $value = bcsub($value, "18446744073709551616"); + } + return $value; + default: + return $value; + } + } + + /** + * Populates the message from a user-supplied PHP array. Array keys + * correspond to Message properties and nested message properties. + * + * Example: + * ``` + * $message->mergeFromArray([ + * 'name' => 'This is a message name', + * 'interval' => [ + * 'startTime' => time() - 60, + * 'endTime' => time(), + * ] + * ]); + * ``` + * + * This method will trigger an error if it is passed data that cannot + * be converted to the correct type. For example, a StringValue field + * must receive data that is either a string or a StringValue object. + * + * @param array $array An array containing message properties and values. + * @return null + */ + protected function mergeFromArray(array $array) + { + // Just call the setters for the field names + foreach ($array as $key => $value) { + $field = $this->desc->getFieldByName($key); + if (is_null($field)) { + throw new \UnexpectedValueException( + 'Invalid message property: ' . $key); + } + $setter = $field->getSetter(); + if ($field->isMap()) { + $valueField = $field->getMessageType()->getFieldByName('value'); + if (!is_null($valueField) && $valueField->isWrapperType()) { + self::normalizeArrayElementsToMessageType($value, $valueField->getMessageType()->getClass()); + } + } elseif ($field->isWrapperType()) { + $class = $field->getMessageType()->getClass(); + if ($field->isRepeated()) { + self::normalizeArrayElementsToMessageType($value, $class); + } else { + self::normalizeToMessageType($value, $class); + } + } + $this->$setter($value); + } + } + + /** + * Tries to normalize the elements in $value into a provided protobuf + * wrapper type $class. If $value is any type other than array, we do + * not do any conversion, and instead rely on the existing protobuf + * type checking. If $value is an array, we process each element and + * try to convert it to an instance of $class. + * + * @param mixed $value The array of values to normalize. + * @param string $class The expected wrapper class name + */ + private static function normalizeArrayElementsToMessageType(&$value, $class) + { + if (!is_array($value)) { + // In the case that $value is not an array, we do not want to + // attempt any conversion. Note that this includes the cases + // when $value is a RepeatedField of MapField. In those cases, + // we do not need to convert the elements, as they should + // already be the correct types. + return; + } else { + // Normalize each element in the array. + foreach ($value as $key => &$elementValue) { + self::normalizeToMessageType($elementValue, $class); + } + } + } + + /** + * Tries to normalize $value into a provided protobuf wrapper type $class. + * If $value is any type other than an object, we attempt to construct an + * instance of $class and assign $value to it using the setValue method + * shared by all wrapper types. + * + * This method will raise an error if it receives a type that cannot be + * assigned to the wrapper type via setValue. + * + * @param mixed $value The value to normalize. + * @param string $class The expected wrapper class name + */ + private static function normalizeToMessageType(&$value, $class) + { + if (is_null($value) || is_object($value)) { + // This handles the case that $value is an instance of $class. We + // choose not to do any more strict checking here, relying on the + // existing type checking done by GPBUtil. + return; + } else { + // Try to instantiate $class and set the value + try { + $msg = new $class; + $msg->setValue($value); + $value = $msg; + return; + } catch (\Exception $exception) { + trigger_error( + "Error normalizing value to type '$class': " . $exception->getMessage(), + E_USER_ERROR + ); + } + } + } + + protected function mergeFromJsonArray($array, $ignore_unknown) + { + if (is_a($this, "Google\Protobuf\Any")) { + $this->clear(); + $this->setTypeUrl($array["@type"]); + $msg = $this->unpack(); + if (GPBUtil::hasSpecialJsonMapping($msg)) { + $msg->mergeFromJsonArray($array["value"], $ignore_unknown); + } else { + unset($array["@type"]); + $msg->mergeFromJsonArray($array, $ignore_unknown); + } + $this->setValue($msg->serializeToString()); + return; + } + if (is_a($this, "Google\Protobuf\DoubleValue") || + is_a($this, "Google\Protobuf\FloatValue") || + is_a($this, "Google\Protobuf\Int64Value") || + is_a($this, "Google\Protobuf\UInt64Value") || + is_a($this, "Google\Protobuf\Int32Value") || + is_a($this, "Google\Protobuf\UInt32Value") || + is_a($this, "Google\Protobuf\BoolValue") || + is_a($this, "Google\Protobuf\StringValue")) { + $this->setValue($array); + return; + } + if (is_a($this, "Google\Protobuf\BytesValue")) { + $this->setValue(base64_decode($array)); + return; + } + if (is_a($this, "Google\Protobuf\Duration")) { + $this->mergeFrom(GPBUtil::parseDuration($array)); + return; + } + if (is_a($this, "Google\Protobuf\FieldMask")) { + $this->mergeFrom(GPBUtil::parseFieldMask($array)); + return; + } + if (is_a($this, "Google\Protobuf\Timestamp")) { + $this->mergeFrom(GPBUtil::parseTimestamp($array)); + return; + } + if (is_a($this, "Google\Protobuf\Struct")) { + $fields = $this->getFields(); + foreach($array as $key => $value) { + $v = new Value(); + $v->mergeFromJsonArray($value, $ignore_unknown); + $fields[$key] = $v; + } + return; + } + if (is_a($this, "Google\Protobuf\Value")) { + if (is_bool($array)) { + $this->setBoolValue($array); + } elseif (is_string($array)) { + $this->setStringValue($array); + } elseif (is_null($array)) { + $this->setNullValue(0); + } elseif (is_double($array) || is_integer($array)) { + $this->setNumberValue($array); + } elseif (is_array($array)) { + if (array_values($array) !== $array) { + // Associative array + $struct_value = $this->getStructValue(); + if (is_null($struct_value)) { + $struct_value = new Struct(); + $this->setStructValue($struct_value); + } + foreach ($array as $key => $v) { + $value = new Value(); + $value->mergeFromJsonArray($v, $ignore_unknown); + $values = $struct_value->getFields(); + $values[$key]= $value; + } + } else { + // Array + $list_value = $this->getListValue(); + if (is_null($list_value)) { + $list_value = new ListValue(); + $this->setListValue($list_value); + } + foreach ($array as $v) { + $value = new Value(); + $value->mergeFromJsonArray($v, $ignore_unknown); + $values = $list_value->getValues(); + $values[]= $value; + } + } + } else { + throw new GPBDecodeException("Invalid type for Value."); + } + return; + } + $this->mergeFromArrayJsonImpl($array, $ignore_unknown); + } + + private function mergeFromArrayJsonImpl($array, $ignore_unknown) + { + foreach ($array as $key => $value) { + $field = $this->desc->getFieldByJsonName($key); + if (is_null($field)) { + $field = $this->desc->getFieldByName($key); + if (is_null($field)) { + if ($ignore_unknown) { + continue; + } else { + throw new GPBDecodeException( + $key . ' is unknown.' + ); + } + } + } + if ($field->isMap()) { + if (is_null($value)) { + continue; + } + $key_field = $field->getMessageType()->getFieldByNumber(1); + $value_field = $field->getMessageType()->getFieldByNumber(2); + foreach ($value as $tmp_key => $tmp_value) { + if (is_null($tmp_value)) { + throw new \Exception( + "Map value field element cannot be null."); + } + $proto_key = $this->convertJsonValueToProtoValue( + $tmp_key, + $key_field, + $ignore_unknown, + true); + $proto_value = $this->convertJsonValueToProtoValue( + $tmp_value, + $value_field, + $ignore_unknown); + self::kvUpdateHelper($field, $proto_key, $proto_value); + } + } else if ($field->isRepeated()) { + if (is_null($value)) { + continue; + } + foreach ($value as $tmp) { + if (is_null($tmp)) { + throw new \Exception( + "Repeated field elements cannot be null."); + } + $proto_value = $this->convertJsonValueToProtoValue( + $tmp, + $field, + $ignore_unknown); + self::appendHelper($field, $proto_value); + } + } else { + $setter = $field->getSetter(); + $proto_value = $this->convertJsonValueToProtoValue( + $value, + $field, + $ignore_unknown); + if ($field->getType() === GPBType::MESSAGE) { + if (is_null($proto_value)) { + continue; + } + $getter = $field->getGetter(); + $submsg = $this->$getter(); + if (!is_null($submsg)) { + $submsg->mergeFrom($proto_value); + continue; + } + } + $this->$setter($proto_value); + } + } + } + + /** + * @ignore + */ + public function parseFromJsonStream($input, $ignore_unknown) + { + $array = json_decode($input->getData(), true, 512, JSON_BIGINT_AS_STRING); + if ($this instanceof \Google\Protobuf\ListValue) { + $array = ["values"=>$array]; + } + if (is_null($array)) { + if ($this instanceof \Google\Protobuf\Value) { + $this->setNullValue(\Google\Protobuf\NullValue::NULL_VALUE); + return; + } else { + throw new GPBDecodeException( + "Cannot decode json string: " . $input->getData()); + } + } + try { + $this->mergeFromJsonArray($array, $ignore_unknown); + } catch (\Exception $e) { + throw new GPBDecodeException($e->getMessage()); + } + } + + /** + * @ignore + */ + private function serializeSingularFieldToStream($field, &$output) + { + if (!$this->existField($field)) { + return true; + } + $getter = $field->getGetter(); + $value = $this->$getter(); + if (!GPBWire::serializeFieldToStream($value, $field, true, $output)) { + return false; + } + return true; + } + + /** + * @ignore + */ + private function serializeRepeatedFieldToStream($field, &$output) + { + $getter = $field->getGetter(); + $values = $this->$getter(); + $count = count($values); + if ($count === 0) { + return true; + } + + $packed = $field->getPacked(); + if ($packed) { + if (!GPBWire::writeTag( + $output, + GPBWire::makeTag($field->getNumber(), GPBType::STRING))) { + return false; + } + $size = 0; + foreach ($values as $value) { + $size += $this->fieldDataOnlyByteSize($field, $value); + } + if (!$output->writeVarint32($size, true)) { + return false; + } + } + + foreach ($values as $value) { + if (!GPBWire::serializeFieldToStream( + $value, + $field, + !$packed, + $output)) { + return false; + } + } + return true; + } + + /** + * @ignore + */ + private function serializeMapFieldToStream($field, $output) + { + $getter = $field->getGetter(); + $values = $this->$getter(); + $count = count($values); + if ($count === 0) { + return true; + } + + foreach ($values as $key => $value) { + $map_entry = new MapEntry($field->getMessageType()); + $map_entry->setKey($key); + $map_entry->setValue($value); + if (!GPBWire::serializeFieldToStream( + $map_entry, + $field, + true, + $output)) { + return false; + } + } + return true; + } + + /** + * @ignore + */ + private function serializeFieldToStream(&$output, $field) + { + if ($field->isMap()) { + return $this->serializeMapFieldToStream($field, $output); + } elseif ($field->isRepeated()) { + return $this->serializeRepeatedFieldToStream($field, $output); + } else { + return $this->serializeSingularFieldToStream($field, $output); + } + } + + /** + * @ignore + */ + private function serializeFieldToJsonStream(&$output, $field) + { + $getter = $field->getGetter(); + $values = $this->$getter(); + return GPBJsonWire::serializeFieldToStream( + $values, $field, $output, !GPBUtil::hasSpecialJsonMapping($this)); + } + + /** + * @ignore + */ + public function serializeToStream(&$output) + { + $fields = $this->desc->getField(); + foreach ($fields as $field) { + if (!$this->serializeFieldToStream($output, $field)) { + return false; + } + } + $output->writeRaw($this->unknown, strlen($this->unknown)); + return true; + } + + /** + * @ignore + */ + public function serializeToJsonStream(&$output) + { + if (is_a($this, 'Google\Protobuf\Any')) { + $output->writeRaw("{", 1); + $type_field = $this->desc->getFieldByNumber(1); + $value_msg = $this->unpack(); + + // Serialize type url. + $output->writeRaw("\"@type\":", 8); + $output->writeRaw("\"", 1); + $output->writeRaw($this->getTypeUrl(), strlen($this->getTypeUrl())); + $output->writeRaw("\"", 1); + + // Serialize value + if (GPBUtil::hasSpecialJsonMapping($value_msg)) { + $output->writeRaw(",\"value\":", 9); + $value_msg->serializeToJsonStream($output); + } else { + $value_fields = $value_msg->desc->getField(); + foreach ($value_fields as $field) { + if ($value_msg->existField($field)) { + $output->writeRaw(",", 1); + if (!$value_msg->serializeFieldToJsonStream($output, $field)) { + return false; + } + } + } + } + + $output->writeRaw("}", 1); + } elseif (is_a($this, 'Google\Protobuf\FieldMask')) { + $field_mask = GPBUtil::formatFieldMask($this); + $output->writeRaw("\"", 1); + $output->writeRaw($field_mask, strlen($field_mask)); + $output->writeRaw("\"", 1); + } elseif (is_a($this, 'Google\Protobuf\Duration')) { + $duration = GPBUtil::formatDuration($this) . "s"; + $output->writeRaw("\"", 1); + $output->writeRaw($duration, strlen($duration)); + $output->writeRaw("\"", 1); + } elseif (get_class($this) === 'Google\Protobuf\Timestamp') { + $timestamp = GPBUtil::formatTimestamp($this); + $timestamp = json_encode($timestamp); + $output->writeRaw($timestamp, strlen($timestamp)); + } elseif (get_class($this) === 'Google\Protobuf\ListValue') { + $field = $this->desc->getField()[1]; + if (!$this->existField($field)) { + $output->writeRaw("[]", 2); + } else { + if (!$this->serializeFieldToJsonStream($output, $field)) { + return false; + } + } + } elseif (get_class($this) === 'Google\Protobuf\Struct') { + $field = $this->desc->getField()[1]; + if (!$this->existField($field)) { + $output->writeRaw("{}", 2); + } else { + if (!$this->serializeFieldToJsonStream($output, $field)) { + return false; + } + } + } else { + if (!GPBUtil::hasSpecialJsonMapping($this)) { + $output->writeRaw("{", 1); + } + $fields = $this->desc->getField(); + $first = true; + foreach ($fields as $field) { + if ($this->existField($field) || + GPBUtil::hasJsonValue($this)) { + if ($first) { + $first = false; + } else { + $output->writeRaw(",", 1); + } + if (!$this->serializeFieldToJsonStream($output, $field)) { + return false; + } + } + } + if (!GPBUtil::hasSpecialJsonMapping($this)) { + $output->writeRaw("}", 1); + } + } + return true; + } + + /** + * Serialize the message to string. + * @return string Serialized binary protobuf data. + */ + public function serializeToString() + { + $output = new CodedOutputStream($this->byteSize()); + $this->serializeToStream($output); + return $output->getData(); + } + + /** + * Serialize the message to json string. + * @return string Serialized json protobuf data. + */ + public function serializeToJsonString() + { + $output = new CodedOutputStream($this->jsonByteSize()); + $this->serializeToJsonStream($output); + return $output->getData(); + } + + /** + * @ignore + */ + private function existField($field) + { + $getter = $field->getGetter(); + $hazzer = "has" . substr($getter, 3); + + if (method_exists($this, $hazzer)) { + return $this->$hazzer(); + } else if ($field->getOneofIndex() !== -1) { + // For old generated code, which does not have hazzers for oneof + // fields. + $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()]; + $oneof_name = $oneof->getName(); + return $this->$oneof_name->getNumber() === $field->getNumber(); + } + + $values = $this->$getter(); + if ($field->isMap()) { + return count($values) !== 0; + } elseif ($field->isRepeated()) { + return count($values) !== 0; + } else { + return $values !== $this->defaultValue($field); + } + } + + /** + * @ignore + */ + private function repeatedFieldDataOnlyByteSize($field) + { + $size = 0; + + $getter = $field->getGetter(); + $values = $this->$getter(); + $count = count($values); + if ($count !== 0) { + $size += $count * GPBWire::tagSize($field); + foreach ($values as $value) { + $size += $this->singularFieldDataOnlyByteSize($field); + } + } + } + + /** + * @ignore + */ + private function fieldDataOnlyByteSize($field, $value) + { + $size = 0; + + switch ($field->getType()) { + case GPBType::BOOL: + $size += 1; + break; + case GPBType::FLOAT: + case GPBType::FIXED32: + case GPBType::SFIXED32: + $size += 4; + break; + case GPBType::DOUBLE: + case GPBType::FIXED64: + case GPBType::SFIXED64: + $size += 8; + break; + case GPBType::INT32: + case GPBType::ENUM: + $size += GPBWire::varint32Size($value, true); + break; + case GPBType::UINT32: + $size += GPBWire::varint32Size($value); + break; + case GPBType::UINT64: + case GPBType::INT64: + $size += GPBWire::varint64Size($value); + break; + case GPBType::SINT32: + $size += GPBWire::sint32Size($value); + break; + case GPBType::SINT64: + $size += GPBWire::sint64Size($value); + break; + case GPBType::STRING: + case GPBType::BYTES: + $size += strlen($value); + $size += GPBWire::varint32Size($size); + break; + case GPBType::MESSAGE: + $size += $value->byteSize(); + $size += GPBWire::varint32Size($size); + break; + case GPBType::GROUP: + // TODO(teboring): Add support. + user_error("Unsupported type."); + break; + default: + user_error("Unsupported type."); + return 0; + } + + return $size; + } + + /** + * @ignore + */ + private function fieldDataOnlyJsonByteSize($field, $value) + { + $size = 0; + + switch ($field->getType()) { + case GPBType::SFIXED32: + case GPBType::SINT32: + case GPBType::INT32: + $size += strlen(strval($value)); + break; + case GPBType::FIXED32: + case GPBType::UINT32: + if ($value < 0) { + $value = bcadd($value, "4294967296"); + } + $size += strlen(strval($value)); + break; + case GPBType::FIXED64: + case GPBType::UINT64: + if ($value < 0) { + $value = bcadd($value, "18446744073709551616"); + } + // Intentional fall through. + case GPBType::SFIXED64: + case GPBType::INT64: + case GPBType::SINT64: + $size += 2; // size for "" + $size += strlen(strval($value)); + break; + case GPBType::FLOAT: + if (is_nan($value)) { + $size += strlen("NaN") + 2; + } elseif ($value === INF) { + $size += strlen("Infinity") + 2; + } elseif ($value === -INF) { + $size += strlen("-Infinity") + 2; + } else { + $size += strlen(sprintf("%.8g", $value)); + } + break; + case GPBType::DOUBLE: + if (is_nan($value)) { + $size += strlen("NaN") + 2; + } elseif ($value === INF) { + $size += strlen("Infinity") + 2; + } elseif ($value === -INF) { + $size += strlen("-Infinity") + 2; + } else { + $size += strlen(sprintf("%.17g", $value)); + } + break; + case GPBType::ENUM: + $enum_desc = $field->getEnumType(); + if ($enum_desc->getClass() === "Google\Protobuf\NullValue") { + $size += 4; + break; + } + $enum_value_desc = $enum_desc->getValueByNumber($value); + if (!is_null($enum_value_desc)) { + $size += 2; // size for "" + $size += strlen($enum_value_desc->getName()); + } else { + $str_value = strval($value); + $size += strlen($str_value); + } + break; + case GPBType::BOOL: + if ($value) { + $size += 4; + } else { + $size += 5; + } + break; + case GPBType::STRING: + $value = json_encode($value, JSON_UNESCAPED_UNICODE); + $size += strlen($value); + break; + case GPBType::BYTES: + # if (is_a($this, "Google\Protobuf\BytesValue")) { + # $size += strlen(json_encode($value)); + # } else { + # $size += strlen(base64_encode($value)); + # $size += 2; // size for \"\" + # } + $size += strlen(base64_encode($value)); + $size += 2; // size for \"\" + break; + case GPBType::MESSAGE: + $size += $value->jsonByteSize(); + break; +# case GPBType::GROUP: +# // TODO(teboring): Add support. +# user_error("Unsupported type."); +# break; + default: + user_error("Unsupported type " . $field->getType()); + return 0; + } + + return $size; + } + + /** + * @ignore + */ + private function fieldByteSize($field) + { + $size = 0; + if ($field->isMap()) { + $getter = $field->getGetter(); + $values = $this->$getter(); + $count = count($values); + if ($count !== 0) { + $size += $count * GPBWire::tagSize($field); + $message_type = $field->getMessageType(); + $key_field = $message_type->getFieldByNumber(1); + $value_field = $message_type->getFieldByNumber(2); + foreach ($values as $key => $value) { + $data_size = 0; + if ($key != $this->defaultValue($key_field)) { + $data_size += $this->fieldDataOnlyByteSize( + $key_field, + $key); + $data_size += GPBWire::tagSize($key_field); + } + if ($value != $this->defaultValue($value_field)) { + $data_size += $this->fieldDataOnlyByteSize( + $value_field, + $value); + $data_size += GPBWire::tagSize($value_field); + } + $size += GPBWire::varint32Size($data_size) + $data_size; + } + } + } elseif ($field->isRepeated()) { + $getter = $field->getGetter(); + $values = $this->$getter(); + $count = count($values); + if ($count !== 0) { + if ($field->getPacked()) { + $data_size = 0; + foreach ($values as $value) { + $data_size += $this->fieldDataOnlyByteSize($field, $value); + } + $size += GPBWire::tagSize($field); + $size += GPBWire::varint32Size($data_size); + $size += $data_size; + } else { + $size += $count * GPBWire::tagSize($field); + foreach ($values as $value) { + $size += $this->fieldDataOnlyByteSize($field, $value); + } + } + } + } elseif ($this->existField($field)) { + $size += GPBWire::tagSize($field); + $getter = $field->getGetter(); + $value = $this->$getter(); + $size += $this->fieldDataOnlyByteSize($field, $value); + } + return $size; + } + + /** + * @ignore + */ + private function fieldJsonByteSize($field) + { + $size = 0; + + if ($field->isMap()) { + $getter = $field->getGetter(); + $values = $this->$getter(); + $count = count($values); + if ($count !== 0) { + if (!GPBUtil::hasSpecialJsonMapping($this)) { + $size += 3; // size for "\"\":". + $size += strlen($field->getJsonName()); // size for field name + } + $size += 2; // size for "{}". + $size += $count - 1; // size for commas + $getter = $field->getGetter(); + $map_entry = $field->getMessageType(); + $key_field = $map_entry->getFieldByNumber(1); + $value_field = $map_entry->getFieldByNumber(2); + switch ($key_field->getType()) { + case GPBType::STRING: + case GPBType::SFIXED64: + case GPBType::INT64: + case GPBType::SINT64: + case GPBType::FIXED64: + case GPBType::UINT64: + $additional_quote = false; + break; + default: + $additional_quote = true; + } + foreach ($values as $key => $value) { + if ($additional_quote) { + $size += 2; // size for "" + } + $size += $this->fieldDataOnlyJsonByteSize($key_field, $key); + $size += $this->fieldDataOnlyJsonByteSize($value_field, $value); + $size += 1; // size for : + } + } + } elseif ($field->isRepeated()) { + $getter = $field->getGetter(); + $values = $this->$getter(); + $count = count($values); + if ($count !== 0) { + if (!GPBUtil::hasSpecialJsonMapping($this)) { + $size += 3; // size for "\"\":". + $size += strlen($field->getJsonName()); // size for field name + } + $size += 2; // size for "[]". + $size += $count - 1; // size for commas + $getter = $field->getGetter(); + foreach ($values as $value) { + $size += $this->fieldDataOnlyJsonByteSize($field, $value); + } + } + } elseif ($this->existField($field) || GPBUtil::hasJsonValue($this)) { + if (!GPBUtil::hasSpecialJsonMapping($this)) { + $size += 3; // size for "\"\":". + $size += strlen($field->getJsonName()); // size for field name + } + $getter = $field->getGetter(); + $value = $this->$getter(); + $size += $this->fieldDataOnlyJsonByteSize($field, $value); + } + return $size; + } + + /** + * @ignore + */ + public function byteSize() + { + $size = 0; + + $fields = $this->desc->getField(); + foreach ($fields as $field) { + $size += $this->fieldByteSize($field); + } + $size += strlen($this->unknown); + return $size; + } + + private function appendHelper($field, $append_value) + { + $getter = $field->getGetter(); + $setter = $field->getSetter(); + + $field_arr_value = $this->$getter(); + $field_arr_value[] = $append_value; + + if (!is_object($field_arr_value)) { + $this->$setter($field_arr_value); + } + } + + private function kvUpdateHelper($field, $update_key, $update_value) + { + $getter = $field->getGetter(); + $setter = $field->getSetter(); + + $field_arr_value = $this->$getter(); + $field_arr_value[$update_key] = $update_value; + + if (!is_object($field_arr_value)) { + $this->$setter($field_arr_value); + } + } + + /** + * @ignore + */ + public function jsonByteSize() + { + $size = 0; + if (is_a($this, 'Google\Protobuf\Any')) { + // Size for "{}". + $size += 2; + + // Size for "\"@type\":". + $size += 8; + + // Size for url. +2 for "" /. + $size += strlen($this->getTypeUrl()) + 2; + + $value_msg = $this->unpack(); + if (GPBUtil::hasSpecialJsonMapping($value_msg)) { + // Size for "\",value\":". + $size += 9; + $size += $value_msg->jsonByteSize(); + } else { + $value_size = $value_msg->jsonByteSize(); + // size === 2 it's empty message {} which is not serialized inside any + if ($value_size !== 2) { + // Size for value. +1 for comma, -2 for "{}". + $size += $value_size -1; + } + } + } elseif (get_class($this) === 'Google\Protobuf\FieldMask') { + $field_mask = GPBUtil::formatFieldMask($this); + $size += strlen($field_mask) + 2; // 2 for "" + } elseif (get_class($this) === 'Google\Protobuf\Duration') { + $duration = GPBUtil::formatDuration($this) . "s"; + $size += strlen($duration) + 2; // 2 for "" + } elseif (get_class($this) === 'Google\Protobuf\Timestamp') { + $timestamp = GPBUtil::formatTimestamp($this); + $timestamp = json_encode($timestamp); + $size += strlen($timestamp); + } elseif (get_class($this) === 'Google\Protobuf\ListValue') { + $field = $this->desc->getField()[1]; + if ($this->existField($field)) { + $field_size = $this->fieldJsonByteSize($field); + $size += $field_size; + } else { + // Size for "[]". + $size += 2; + } + } elseif (get_class($this) === 'Google\Protobuf\Struct') { + $field = $this->desc->getField()[1]; + if ($this->existField($field)) { + $field_size = $this->fieldJsonByteSize($field); + $size += $field_size; + } else { + // Size for "{}". + $size += 2; + } + } else { + if (!GPBUtil::hasSpecialJsonMapping($this)) { + // Size for "{}". + $size += 2; + } + + $fields = $this->desc->getField(); + $count = 0; + foreach ($fields as $field) { + $field_size = $this->fieldJsonByteSize($field); + $size += $field_size; + if ($field_size != 0) { + $count++; + } + } + // size for comma + $size += $count > 0 ? ($count - 1) : 0; + } + return $size; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageBuilderContext.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageBuilderContext.php new file mode 100644 index 000000000..2724d2673 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageBuilderContext.php @@ -0,0 +1,120 @@ +descriptor = new Descriptor(); + $this->descriptor->setFullName($full_name); + $this->descriptor->setClass($klass); + $this->pool = $pool; + } + + private function getFieldDescriptor($name, $label, $type, + $number, $type_name = null) + { + $field = new FieldDescriptor(); + $field->setName($name); + $camel_name = implode('', array_map('ucwords', explode('_', $name))); + $field->setGetter('get' . $camel_name); + $field->setSetter('set' . $camel_name); + $field->setType($type); + $field->setNumber($number); + $field->setLabel($label); + + // At this time, the message/enum type may have not been added to pool. + // So we use the type name as place holder and will replace it with the + // actual descriptor in cross building. + switch ($type) { + case GPBType::MESSAGE: + $field->setMessageType($type_name); + break; + case GPBType::ENUM: + $field->setEnumType($type_name); + break; + default: + break; + } + + return $field; + } + + public function optional($name, $type, $number, $type_name = null) + { + $this->descriptor->addField($this->getFieldDescriptor( + $name, + GPBLabel::OPTIONAL, + $type, + $number, + $type_name)); + return $this; + } + + public function repeated($name, $type, $number, $type_name = null) + { + $this->descriptor->addField($this->getFieldDescriptor( + $name, + GPBLabel::REPEATED, + $type, + $number, + $type_name)); + return $this; + } + + public function required($name, $type, $number, $type_name = null) + { + $this->descriptor->addField($this->getFieldDescriptor( + $name, + GPBLabel::REQUIRED, + $type, + $number, + $type_name)); + return $this; + } + + public function finalizeToPool() + { + $this->pool->addDescriptor($this->descriptor); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageOptions.php new file mode 100644 index 000000000..f09e8de16 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageOptions.php @@ -0,0 +1,466 @@ +google.protobuf.MessageOptions + */ +class MessageOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + * + * Generated from protobuf field optional bool message_set_wire_format = 1 [default = false]; + */ + protected $message_set_wire_format = null; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + * + * Generated from protobuf field optional bool no_standard_descriptor_accessor = 2 [default = false]; + */ + protected $no_standard_descriptor_accessor = null; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + * + * Generated from protobuf field optional bool deprecated = 3 [default = false]; + */ + protected $deprecated = null; + /** + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + * Whether the message is an automatically generated map entry type for the + * maps field. + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * Generated from protobuf field optional bool map_entry = 7; + */ + protected $map_entry = null; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * TODO(b/261750190) This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + * + * Generated from protobuf field optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + * @deprecated + */ + protected $deprecated_legacy_json_field_conflicts = null; + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + private $uninterpreted_option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $message_set_wire_format + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + * @type bool $no_standard_descriptor_accessor + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + * @type bool $deprecated + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + * @type bool $map_entry + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + * Whether the message is an automatically generated map entry type for the + * maps field. + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * @type bool $deprecated_legacy_json_field_conflicts + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * TODO(b/261750190) This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * The parser stores options it doesn't recognize here. See above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + * + * Generated from protobuf field optional bool message_set_wire_format = 1 [default = false]; + * @return bool + */ + public function getMessageSetWireFormat() + { + return isset($this->message_set_wire_format) ? $this->message_set_wire_format : false; + } + + public function hasMessageSetWireFormat() + { + return isset($this->message_set_wire_format); + } + + public function clearMessageSetWireFormat() + { + unset($this->message_set_wire_format); + } + + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + * + * Generated from protobuf field optional bool message_set_wire_format = 1 [default = false]; + * @param bool $var + * @return $this + */ + public function setMessageSetWireFormat($var) + { + GPBUtil::checkBool($var); + $this->message_set_wire_format = $var; + + return $this; + } + + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + * + * Generated from protobuf field optional bool no_standard_descriptor_accessor = 2 [default = false]; + * @return bool + */ + public function getNoStandardDescriptorAccessor() + { + return isset($this->no_standard_descriptor_accessor) ? $this->no_standard_descriptor_accessor : false; + } + + public function hasNoStandardDescriptorAccessor() + { + return isset($this->no_standard_descriptor_accessor); + } + + public function clearNoStandardDescriptorAccessor() + { + unset($this->no_standard_descriptor_accessor); + } + + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + * + * Generated from protobuf field optional bool no_standard_descriptor_accessor = 2 [default = false]; + * @param bool $var + * @return $this + */ + public function setNoStandardDescriptorAccessor($var) + { + GPBUtil::checkBool($var); + $this->no_standard_descriptor_accessor = $var; + + return $this; + } + + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + * + * Generated from protobuf field optional bool deprecated = 3 [default = false]; + * @return bool + */ + public function getDeprecated() + { + return isset($this->deprecated) ? $this->deprecated : false; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + * + * Generated from protobuf field optional bool deprecated = 3 [default = false]; + * @param bool $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkBool($var); + $this->deprecated = $var; + + return $this; + } + + /** + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + * Whether the message is an automatically generated map entry type for the + * maps field. + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * Generated from protobuf field optional bool map_entry = 7; + * @return bool + */ + public function getMapEntry() + { + return isset($this->map_entry) ? $this->map_entry : false; + } + + public function hasMapEntry() + { + return isset($this->map_entry); + } + + public function clearMapEntry() + { + unset($this->map_entry); + } + + /** + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + * Whether the message is an automatically generated map entry type for the + * maps field. + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * Generated from protobuf field optional bool map_entry = 7; + * @param bool $var + * @return $this + */ + public function setMapEntry($var) + { + GPBUtil::checkBool($var); + $this->map_entry = $var; + + return $this; + } + + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * TODO(b/261750190) This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + * + * Generated from protobuf field optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + * @return bool + * @deprecated + */ + public function getDeprecatedLegacyJsonFieldConflicts() + { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + return isset($this->deprecated_legacy_json_field_conflicts) ? $this->deprecated_legacy_json_field_conflicts : false; + } + + public function hasDeprecatedLegacyJsonFieldConflicts() + { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + return isset($this->deprecated_legacy_json_field_conflicts); + } + + public function clearDeprecatedLegacyJsonFieldConflicts() + { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + unset($this->deprecated_legacy_json_field_conflicts); + } + + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * TODO(b/261750190) This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + * + * Generated from protobuf field optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setDeprecatedLegacyJsonFieldConflicts($var) + { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->deprecated_legacy_json_field_conflicts = $var; + + return $this; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUninterpretedOption() + { + return $this->uninterpreted_option; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUninterpretedOption($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class); + $this->uninterpreted_option = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodDescriptorProto.php new file mode 100644 index 000000000..96efb02d2 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodDescriptorProto.php @@ -0,0 +1,282 @@ +google.protobuf.MethodDescriptorProto + */ +class MethodDescriptorProto extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string name = 1; + */ + protected $name = null; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + * + * Generated from protobuf field optional string input_type = 2; + */ + protected $input_type = null; + /** + * Generated from protobuf field optional string output_type = 3; + */ + protected $output_type = null; + /** + * Generated from protobuf field optional .google.protobuf.MethodOptions options = 4; + */ + protected $options = null; + /** + * Identifies if client streams multiple client messages + * + * Generated from protobuf field optional bool client_streaming = 5 [default = false]; + */ + protected $client_streaming = null; + /** + * Identifies if server streams multiple server messages + * + * Generated from protobuf field optional bool server_streaming = 6 [default = false]; + */ + protected $server_streaming = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type string $input_type + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + * @type string $output_type + * @type \Google\Protobuf\Internal\MethodOptions $options + * @type bool $client_streaming + * Identifies if client streams multiple client messages + * @type bool $server_streaming + * Identifies if server streams multiple server messages + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string name = 1; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Generated from protobuf field optional string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + * + * Generated from protobuf field optional string input_type = 2; + * @return string + */ + public function getInputType() + { + return isset($this->input_type) ? $this->input_type : ''; + } + + public function hasInputType() + { + return isset($this->input_type); + } + + public function clearInputType() + { + unset($this->input_type); + } + + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + * + * Generated from protobuf field optional string input_type = 2; + * @param string $var + * @return $this + */ + public function setInputType($var) + { + GPBUtil::checkString($var, True); + $this->input_type = $var; + + return $this; + } + + /** + * Generated from protobuf field optional string output_type = 3; + * @return string + */ + public function getOutputType() + { + return isset($this->output_type) ? $this->output_type : ''; + } + + public function hasOutputType() + { + return isset($this->output_type); + } + + public function clearOutputType() + { + unset($this->output_type); + } + + /** + * Generated from protobuf field optional string output_type = 3; + * @param string $var + * @return $this + */ + public function setOutputType($var) + { + GPBUtil::checkString($var, True); + $this->output_type = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.MethodOptions options = 4; + * @return \Google\Protobuf\Internal\MethodOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Generated from protobuf field optional .google.protobuf.MethodOptions options = 4; + * @param \Google\Protobuf\Internal\MethodOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\MethodOptions::class); + $this->options = $var; + + return $this; + } + + /** + * Identifies if client streams multiple client messages + * + * Generated from protobuf field optional bool client_streaming = 5 [default = false]; + * @return bool + */ + public function getClientStreaming() + { + return isset($this->client_streaming) ? $this->client_streaming : false; + } + + public function hasClientStreaming() + { + return isset($this->client_streaming); + } + + public function clearClientStreaming() + { + unset($this->client_streaming); + } + + /** + * Identifies if client streams multiple client messages + * + * Generated from protobuf field optional bool client_streaming = 5 [default = false]; + * @param bool $var + * @return $this + */ + public function setClientStreaming($var) + { + GPBUtil::checkBool($var); + $this->client_streaming = $var; + + return $this; + } + + /** + * Identifies if server streams multiple server messages + * + * Generated from protobuf field optional bool server_streaming = 6 [default = false]; + * @return bool + */ + public function getServerStreaming() + { + return isset($this->server_streaming) ? $this->server_streaming : false; + } + + public function hasServerStreaming() + { + return isset($this->server_streaming); + } + + public function clearServerStreaming() + { + unset($this->server_streaming); + } + + /** + * Identifies if server streams multiple server messages + * + * Generated from protobuf field optional bool server_streaming = 6 [default = false]; + * @param bool $var + * @return $this + */ + public function setServerStreaming($var) + { + GPBUtil::checkBool($var); + $this->server_streaming = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions.php new file mode 100644 index 000000000..87af45167 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions.php @@ -0,0 +1,160 @@ +google.protobuf.MethodOptions + */ +class MethodOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + * + * Generated from protobuf field optional bool deprecated = 33 [default = false]; + */ + protected $deprecated = null; + /** + * Generated from protobuf field optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; + */ + protected $idempotency_level = null; + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + private $uninterpreted_option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $deprecated + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + * @type int $idempotency_level + * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * The parser stores options it doesn't recognize here. See above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + * + * Generated from protobuf field optional bool deprecated = 33 [default = false]; + * @return bool + */ + public function getDeprecated() + { + return isset($this->deprecated) ? $this->deprecated : false; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + * + * Generated from protobuf field optional bool deprecated = 33 [default = false]; + * @param bool $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkBool($var); + $this->deprecated = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; + * @return int + */ + public function getIdempotencyLevel() + { + return isset($this->idempotency_level) ? $this->idempotency_level : 0; + } + + public function hasIdempotencyLevel() + { + return isset($this->idempotency_level); + } + + public function clearIdempotencyLevel() + { + unset($this->idempotency_level); + } + + /** + * Generated from protobuf field optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; + * @param int $var + * @return $this + */ + public function setIdempotencyLevel($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\MethodOptions\IdempotencyLevel::class); + $this->idempotency_level = $var; + + return $this; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUninterpretedOption() + { + return $this->uninterpreted_option; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUninterpretedOption($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class); + $this->uninterpreted_option = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions/IdempotencyLevel.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions/IdempotencyLevel.php new file mode 100644 index 000000000..ce3c062c6 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions/IdempotencyLevel.php @@ -0,0 +1,64 @@ +google.protobuf.MethodOptions.IdempotencyLevel + */ +class IdempotencyLevel +{ + /** + * Generated from protobuf enum IDEMPOTENCY_UNKNOWN = 0; + */ + const IDEMPOTENCY_UNKNOWN = 0; + /** + * implies idempotent + * + * Generated from protobuf enum NO_SIDE_EFFECTS = 1; + */ + const NO_SIDE_EFFECTS = 1; + /** + * idempotent, but may have side effects + * + * Generated from protobuf enum IDEMPOTENT = 2; + */ + const IDEMPOTENT = 2; + + private static $valueToName = [ + self::IDEMPOTENCY_UNKNOWN => 'IDEMPOTENCY_UNKNOWN', + self::NO_SIDE_EFFECTS => 'NO_SIDE_EFFECTS', + self::IDEMPOTENT => 'IDEMPOTENT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IdempotencyLevel::class, \Google\Protobuf\Internal\MethodOptions_IdempotencyLevel::class); + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions_IdempotencyLevel.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions_IdempotencyLevel.php new file mode 100644 index 000000000..a29131145 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions_IdempotencyLevel.php @@ -0,0 +1,16 @@ +public_desc = new \Google\Protobuf\OneofDescriptor($this); + } + + public function setName($name) + { + $this->name = $name; + } + + public function getName() + { + return $this->name; + } + + public function addField(FieldDescriptor $field) + { + $this->fields[] = $field; + } + + public function getFields() + { + return $this->fields; + } + + public function isSynthetic() + { + return !is_null($this->fields) && count($this->fields) === 1 + && $this->fields[0]->getProto3Optional(); + } + + public static function buildFromProto($oneof_proto, $desc, $index) + { + $oneof = new OneofDescriptor(); + $oneof->setName($oneof_proto->getName()); + foreach ($desc->getField() as $field) { + /** @var FieldDescriptor $field */ + if ($field->getOneofIndex() == $index) { + $oneof->addField($field); + $field->setContainingOneof($oneof); + } + } + return $oneof; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptorProto.php new file mode 100644 index 000000000..3cb9f25c2 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptorProto.php @@ -0,0 +1,109 @@ +google.protobuf.OneofDescriptorProto + */ +class OneofDescriptorProto extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string name = 1; + */ + protected $name = null; + /** + * Generated from protobuf field optional .google.protobuf.OneofOptions options = 2; + */ + protected $options = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type \Google\Protobuf\Internal\OneofOptions $options + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string name = 1; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Generated from protobuf field optional string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.OneofOptions options = 2; + * @return \Google\Protobuf\Internal\OneofOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Generated from protobuf field optional .google.protobuf.OneofOptions options = 2; + * @param \Google\Protobuf\Internal\OneofOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\OneofOptions::class); + $this->options = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofField.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofField.php new file mode 100644 index 000000000..2c689e836 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofField.php @@ -0,0 +1,77 @@ +desc = $desc; + } + + public function setValue($value) + { + $this->value = $value; + } + + public function getValue() + { + return $this->value; + } + + public function setFieldName($field_name) + { + $this->field_name = $field_name; + } + + public function getFieldName() + { + return $this->field_name; + } + + public function setNumber($number) + { + $this->number = $number; + } + + public function getNumber() + { + return $this->number; + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofOptions.php new file mode 100644 index 000000000..b44d19457 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofOptions.php @@ -0,0 +1,67 @@ +google.protobuf.OneofOptions + */ +class OneofOptions extends \Google\Protobuf\Internal\Message +{ + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + private $uninterpreted_option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * The parser stores options it doesn't recognize here. See above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUninterpretedOption() + { + return $this->uninterpreted_option; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUninterpretedOption($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class); + $this->uninterpreted_option = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/RawInputStream.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/RawInputStream.php new file mode 100644 index 000000000..4e7ed5cb4 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/RawInputStream.php @@ -0,0 +1,50 @@ +buffer = $buffer; + } + + public function getData() + { + return $this->buffer; + } + +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedField.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedField.php new file mode 100644 index 000000000..f6ecd1c84 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedField.php @@ -0,0 +1,264 @@ +container = []; + $this->type = $type; + if ($this->type == GPBType::MESSAGE) { + $pool = DescriptorPool::getGeneratedPool(); + $desc = $pool->getDescriptorByClassName($klass); + if ($desc == NULL) { + new $klass; // No msg class instance has been created before. + $desc = $pool->getDescriptorByClassName($klass); + } + $this->klass = $desc->getClass(); + $this->legacy_klass = $desc->getLegacyClass(); + } + } + + /** + * @ignore + */ + public function getType() + { + return $this->type; + } + + /** + * @ignore + */ + public function getClass() + { + return $this->klass; + } + + /** + * @ignore + */ + public function getLegacyClass() + { + return $this->legacy_klass; + } + + /** + * Return the element at the given index. + * + * This will also be called for: $ele = $arr[0] + * + * @param integer $offset The index of the element to be fetched. + * @return mixed The stored element at given index. + * @throws \ErrorException Invalid type for index. + * @throws \ErrorException Non-existing index. + * @todo need to add return type mixed (require update php version to 8.0) + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset]; + } + + /** + * Assign the element at the given index. + * + * This will also be called for: $arr []= $ele and $arr[0] = ele + * + * @param int|null $offset The index of the element to be assigned. + * @param mixed $value The element to be assigned. + * @return void + * @throws \ErrorException Invalid type for index. + * @throws \ErrorException Non-existing index. + * @throws \ErrorException Incorrect type of the element. + * @todo need to add return type void (require update php version to 7.1) + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + switch ($this->type) { + case GPBType::SFIXED32: + case GPBType::SINT32: + case GPBType::INT32: + case GPBType::ENUM: + GPBUtil::checkInt32($value); + break; + case GPBType::FIXED32: + case GPBType::UINT32: + GPBUtil::checkUint32($value); + break; + case GPBType::SFIXED64: + case GPBType::SINT64: + case GPBType::INT64: + GPBUtil::checkInt64($value); + break; + case GPBType::FIXED64: + case GPBType::UINT64: + GPBUtil::checkUint64($value); + break; + case GPBType::FLOAT: + GPBUtil::checkFloat($value); + break; + case GPBType::DOUBLE: + GPBUtil::checkDouble($value); + break; + case GPBType::BOOL: + GPBUtil::checkBool($value); + break; + case GPBType::BYTES: + GPBUtil::checkString($value, false); + break; + case GPBType::STRING: + GPBUtil::checkString($value, true); + break; + case GPBType::MESSAGE: + if (is_null($value)) { + throw new \TypeError("RepeatedField element cannot be null."); + } + GPBUtil::checkMessage($value, $this->klass); + break; + default: + break; + } + if (is_null($offset)) { + $this->container[] = $value; + } else { + $count = count($this->container); + if (!is_numeric($offset) || $offset < 0 || $offset >= $count) { + trigger_error( + "Cannot modify element at the given index", + E_USER_ERROR); + return; + } + $this->container[$offset] = $value; + } + } + + /** + * Remove the element at the given index. + * + * This will also be called for: unset($arr) + * + * @param integer $offset The index of the element to be removed. + * @return void + * @throws \ErrorException Invalid type for index. + * @throws \ErrorException The element to be removed is not at the end of the + * RepeatedField. + * @todo need to add return type void (require update php version to 7.1) + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + $count = count($this->container); + if (!is_numeric($offset) || $count === 0 || $offset < 0 || $offset >= $count) { + trigger_error( + "Cannot remove element at the given index", + E_USER_ERROR); + return; + } + array_splice($this->container, $offset, 1); + } + + /** + * Check the existence of the element at the given index. + * + * This will also be called for: isset($arr) + * + * @param integer $offset The index of the element to be removed. + * @return bool True if the element at the given offset exists. + * @throws \ErrorException Invalid type for index. + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * @ignore + */ + public function getIterator(): Traversable + { + return new RepeatedFieldIter($this->container); + } + + /** + * Return the number of stored elements. + * + * This will also be called for: count($arr) + * + * @return integer The number of stored elements. + */ + public function count(): int + { + return count($this->container); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedFieldIter.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedFieldIter.php new file mode 100644 index 000000000..2b541862a --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedFieldIter.php @@ -0,0 +1,125 @@ +position = 0; + $this->container = $container; + } + + /** + * Reset the status of the iterator + * + * @return void + * @todo need to add return type void (require update php version to 7.1) + */ + #[\ReturnTypeWillChange] + public function rewind() + { + $this->position = 0; + } + + /** + * Return the element at the current position. + * + * @return object The element at the current position. + * @todo need to add return type mixed (require update php version to 8.0) + */ + #[\ReturnTypeWillChange] + public function current() + { + return $this->container[$this->position]; + } + + /** + * Return the current position. + * + * @return integer The current position. + * @todo need to add return type mixed (require update php version to 8.0) + */ + #[\ReturnTypeWillChange] + public function key() + { + return $this->position; + } + + /** + * Move to the next position. + * + * @return void + * @todo need to add return type void (require update php version to 7.1) + */ + #[\ReturnTypeWillChange] + public function next() + { + ++$this->position; + } + + /** + * Check whether there are more elements to iterate. + * + * @return bool True if there are more elements to iterate. + */ + public function valid(): bool + { + return isset($this->container[$this->position]); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceDescriptorProto.php new file mode 100644 index 000000000..e322e2abf --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceDescriptorProto.php @@ -0,0 +1,136 @@ +google.protobuf.ServiceDescriptorProto + */ +class ServiceDescriptorProto extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string name = 1; + */ + protected $name = null; + /** + * Generated from protobuf field repeated .google.protobuf.MethodDescriptorProto method = 2; + */ + private $method; + /** + * Generated from protobuf field optional .google.protobuf.ServiceOptions options = 3; + */ + protected $options = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type array<\Google\Protobuf\Internal\MethodDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $method + * @type \Google\Protobuf\Internal\ServiceOptions $options + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string name = 1; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Generated from protobuf field optional string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.MethodDescriptorProto method = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMethod() + { + return $this->method; + } + + /** + * Generated from protobuf field repeated .google.protobuf.MethodDescriptorProto method = 2; + * @param array<\Google\Protobuf\Internal\MethodDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMethod($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\MethodDescriptorProto::class); + $this->method = $arr; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.ServiceOptions options = 3; + * @return \Google\Protobuf\Internal\ServiceOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Generated from protobuf field optional .google.protobuf.ServiceOptions options = 3; + * @param \Google\Protobuf\Internal\ServiceOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\ServiceOptions::class); + $this->options = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceOptions.php new file mode 100644 index 000000000..8ac27ee80 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceOptions.php @@ -0,0 +1,123 @@ +google.protobuf.ServiceOptions + */ +class ServiceOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + * + * Generated from protobuf field optional bool deprecated = 33 [default = false]; + */ + protected $deprecated = null; + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + private $uninterpreted_option; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $deprecated + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * The parser stores options it doesn't recognize here. See above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + * + * Generated from protobuf field optional bool deprecated = 33 [default = false]; + * @return bool + */ + public function getDeprecated() + { + return isset($this->deprecated) ? $this->deprecated : false; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + * + * Generated from protobuf field optional bool deprecated = 33 [default = false]; + * @param bool $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkBool($var); + $this->deprecated = $var; + + return $this; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUninterpretedOption() + { + return $this->uninterpreted_option; + } + + /** + * The parser stores options it doesn't recognize here. See above. + * + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUninterpretedOption($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class); + $this->uninterpreted_option = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo.php new file mode 100644 index 000000000..0005bc669 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo.php @@ -0,0 +1,230 @@ +google.protobuf.SourceCodeInfo + */ +class SourceCodeInfo extends \Google\Protobuf\Internal\Message +{ + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + * + * Generated from protobuf field repeated .google.protobuf.SourceCodeInfo.Location location = 1; + */ + private $location; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Protobuf\Internal\SourceCodeInfo\Location>|\Google\Protobuf\Internal\RepeatedField $location + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + * + * Generated from protobuf field repeated .google.protobuf.SourceCodeInfo.Location location = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLocation() + { + return $this->location; + } + + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + * + * Generated from protobuf field repeated .google.protobuf.SourceCodeInfo.Location location = 1; + * @param array<\Google\Protobuf\Internal\SourceCodeInfo\Location>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLocation($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\SourceCodeInfo\Location::class); + $this->location = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php new file mode 100644 index 000000000..032be3921 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php @@ -0,0 +1,448 @@ +google.protobuf.SourceCodeInfo.Location + */ +class Location extends \Google\Protobuf\Internal\Message +{ + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition occurs. + * For example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + * + * Generated from protobuf field repeated int32 path = 1 [packed = true]; + */ + private $path; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + * + * Generated from protobuf field repeated int32 span = 2 [packed = true]; + */ + private $span; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * Examples: + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * // Comment attached to moo. + * // + * // Another line attached to moo. + * optional double moo = 4; + * // Detached comment for corge. This is not leading or trailing comments + * // to moo or corge because there are blank lines separating it from + * // both. + * // Detached comment for corge paragraph 2. + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. */ + * /* Block comment attached to + * * grault. */ + * optional int32 grault = 6; + * // ignored detached comments. + * + * Generated from protobuf field optional string leading_comments = 3; + */ + protected $leading_comments = null; + /** + * Generated from protobuf field optional string trailing_comments = 4; + */ + protected $trailing_comments = null; + /** + * Generated from protobuf field repeated string leading_detached_comments = 6; + */ + private $leading_detached_comments; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $path + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition occurs. + * For example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + * @type array|\Google\Protobuf\Internal\RepeatedField $span + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + * @type string $leading_comments + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * Examples: + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * // Comment attached to moo. + * // + * // Another line attached to moo. + * optional double moo = 4; + * // Detached comment for corge. This is not leading or trailing comments + * // to moo or corge because there are blank lines separating it from + * // both. + * // Detached comment for corge paragraph 2. + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. */ + * /* Block comment attached to + * * grault. */ + * optional int32 grault = 6; + * // ignored detached comments. + * @type string $trailing_comments + * @type array|\Google\Protobuf\Internal\RepeatedField $leading_detached_comments + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition occurs. + * For example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + * + * Generated from protobuf field repeated int32 path = 1 [packed = true]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPath() + { + return $this->path; + } + + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition occurs. + * For example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + * + * Generated from protobuf field repeated int32 path = 1 [packed = true]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPath($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->path = $arr; + + return $this; + } + + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + * + * Generated from protobuf field repeated int32 span = 2 [packed = true]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSpan() + { + return $this->span; + } + + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + * + * Generated from protobuf field repeated int32 span = 2 [packed = true]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSpan($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->span = $arr; + + return $this; + } + + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * Examples: + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * // Comment attached to moo. + * // + * // Another line attached to moo. + * optional double moo = 4; + * // Detached comment for corge. This is not leading or trailing comments + * // to moo or corge because there are blank lines separating it from + * // both. + * // Detached comment for corge paragraph 2. + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. */ + * /* Block comment attached to + * * grault. */ + * optional int32 grault = 6; + * // ignored detached comments. + * + * Generated from protobuf field optional string leading_comments = 3; + * @return string + */ + public function getLeadingComments() + { + return isset($this->leading_comments) ? $this->leading_comments : ''; + } + + public function hasLeadingComments() + { + return isset($this->leading_comments); + } + + public function clearLeadingComments() + { + unset($this->leading_comments); + } + + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * Examples: + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * // Comment attached to moo. + * // + * // Another line attached to moo. + * optional double moo = 4; + * // Detached comment for corge. This is not leading or trailing comments + * // to moo or corge because there are blank lines separating it from + * // both. + * // Detached comment for corge paragraph 2. + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. */ + * /* Block comment attached to + * * grault. */ + * optional int32 grault = 6; + * // ignored detached comments. + * + * Generated from protobuf field optional string leading_comments = 3; + * @param string $var + * @return $this + */ + public function setLeadingComments($var) + { + GPBUtil::checkString($var, True); + $this->leading_comments = $var; + + return $this; + } + + /** + * Generated from protobuf field optional string trailing_comments = 4; + * @return string + */ + public function getTrailingComments() + { + return isset($this->trailing_comments) ? $this->trailing_comments : ''; + } + + public function hasTrailingComments() + { + return isset($this->trailing_comments); + } + + public function clearTrailingComments() + { + unset($this->trailing_comments); + } + + /** + * Generated from protobuf field optional string trailing_comments = 4; + * @param string $var + * @return $this + */ + public function setTrailingComments($var) + { + GPBUtil::checkString($var, True); + $this->trailing_comments = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated string leading_detached_comments = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLeadingDetachedComments() + { + return $this->leading_detached_comments; + } + + /** + * Generated from protobuf field repeated string leading_detached_comments = 6; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLeadingDetachedComments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->leading_detached_comments = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Location::class, \Google\Protobuf\Internal\SourceCodeInfo_Location::class); + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php new file mode 100644 index 000000000..1346492d2 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php @@ -0,0 +1,16 @@ +seconds = $datetime->getTimestamp(); + $this->nanos = 1000 * $datetime->format('u'); + } + + /** + * Converts Timestamp to PHP DateTime. + * + * @return \DateTime $datetime + */ + public function toDateTime() + { + $time = sprintf('%s.%06d', $this->seconds, $this->nanos / 1000); + return \DateTime::createFromFormat('U.u', $time); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption.php new file mode 100644 index 000000000..a1cdca573 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption.php @@ -0,0 +1,300 @@ +google.protobuf.UninterpretedOption + */ +class UninterpretedOption extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption.NamePart name = 2; + */ + private $name; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + * + * Generated from protobuf field optional string identifier_value = 3; + */ + protected $identifier_value = null; + /** + * Generated from protobuf field optional uint64 positive_int_value = 4; + */ + protected $positive_int_value = null; + /** + * Generated from protobuf field optional int64 negative_int_value = 5; + */ + protected $negative_int_value = null; + /** + * Generated from protobuf field optional double double_value = 6; + */ + protected $double_value = null; + /** + * Generated from protobuf field optional bytes string_value = 7; + */ + protected $string_value = null; + /** + * Generated from protobuf field optional string aggregate_value = 8; + */ + protected $aggregate_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Protobuf\Internal\UninterpretedOption\NamePart>|\Google\Protobuf\Internal\RepeatedField $name + * @type string $identifier_value + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + * @type int|string $positive_int_value + * @type int|string $negative_int_value + * @type float $double_value + * @type string $string_value + * @type string $aggregate_value + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption.NamePart name = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getName() + { + return $this->name; + } + + /** + * Generated from protobuf field repeated .google.protobuf.UninterpretedOption.NamePart name = 2; + * @param array<\Google\Protobuf\Internal\UninterpretedOption\NamePart>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setName($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption\NamePart::class); + $this->name = $arr; + + return $this; + } + + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + * + * Generated from protobuf field optional string identifier_value = 3; + * @return string + */ + public function getIdentifierValue() + { + return isset($this->identifier_value) ? $this->identifier_value : ''; + } + + public function hasIdentifierValue() + { + return isset($this->identifier_value); + } + + public function clearIdentifierValue() + { + unset($this->identifier_value); + } + + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + * + * Generated from protobuf field optional string identifier_value = 3; + * @param string $var + * @return $this + */ + public function setIdentifierValue($var) + { + GPBUtil::checkString($var, True); + $this->identifier_value = $var; + + return $this; + } + + /** + * Generated from protobuf field optional uint64 positive_int_value = 4; + * @return int|string + */ + public function getPositiveIntValue() + { + return isset($this->positive_int_value) ? $this->positive_int_value : 0; + } + + public function hasPositiveIntValue() + { + return isset($this->positive_int_value); + } + + public function clearPositiveIntValue() + { + unset($this->positive_int_value); + } + + /** + * Generated from protobuf field optional uint64 positive_int_value = 4; + * @param int|string $var + * @return $this + */ + public function setPositiveIntValue($var) + { + GPBUtil::checkUint64($var); + $this->positive_int_value = $var; + + return $this; + } + + /** + * Generated from protobuf field optional int64 negative_int_value = 5; + * @return int|string + */ + public function getNegativeIntValue() + { + return isset($this->negative_int_value) ? $this->negative_int_value : 0; + } + + public function hasNegativeIntValue() + { + return isset($this->negative_int_value); + } + + public function clearNegativeIntValue() + { + unset($this->negative_int_value); + } + + /** + * Generated from protobuf field optional int64 negative_int_value = 5; + * @param int|string $var + * @return $this + */ + public function setNegativeIntValue($var) + { + GPBUtil::checkInt64($var); + $this->negative_int_value = $var; + + return $this; + } + + /** + * Generated from protobuf field optional double double_value = 6; + * @return float + */ + public function getDoubleValue() + { + return isset($this->double_value) ? $this->double_value : 0.0; + } + + public function hasDoubleValue() + { + return isset($this->double_value); + } + + public function clearDoubleValue() + { + unset($this->double_value); + } + + /** + * Generated from protobuf field optional double double_value = 6; + * @param float $var + * @return $this + */ + public function setDoubleValue($var) + { + GPBUtil::checkDouble($var); + $this->double_value = $var; + + return $this; + } + + /** + * Generated from protobuf field optional bytes string_value = 7; + * @return string + */ + public function getStringValue() + { + return isset($this->string_value) ? $this->string_value : ''; + } + + public function hasStringValue() + { + return isset($this->string_value); + } + + public function clearStringValue() + { + unset($this->string_value); + } + + /** + * Generated from protobuf field optional bytes string_value = 7; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, False); + $this->string_value = $var; + + return $this; + } + + /** + * Generated from protobuf field optional string aggregate_value = 8; + * @return string + */ + public function getAggregateValue() + { + return isset($this->aggregate_value) ? $this->aggregate_value : ''; + } + + public function hasAggregateValue() + { + return isset($this->aggregate_value); + } + + public function clearAggregateValue() + { + unset($this->aggregate_value); + } + + /** + * Generated from protobuf field optional string aggregate_value = 8; + * @param string $var + * @return $this + */ + public function setAggregateValue($var) + { + GPBUtil::checkString($var, True); + $this->aggregate_value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php new file mode 100644 index 000000000..2debf83a6 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php @@ -0,0 +1,116 @@ +google.protobuf.UninterpretedOption.NamePart + */ +class NamePart extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field required string name_part = 1; + */ + protected $name_part = null; + /** + * Generated from protobuf field required bool is_extension = 2; + */ + protected $is_extension = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name_part + * @type bool $is_extension + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field required string name_part = 1; + * @return string + */ + public function getNamePart() + { + return isset($this->name_part) ? $this->name_part : ''; + } + + public function hasNamePart() + { + return isset($this->name_part); + } + + public function clearNamePart() + { + unset($this->name_part); + } + + /** + * Generated from protobuf field required string name_part = 1; + * @param string $var + * @return $this + */ + public function setNamePart($var) + { + GPBUtil::checkString($var, True); + $this->name_part = $var; + + return $this; + } + + /** + * Generated from protobuf field required bool is_extension = 2; + * @return bool + */ + public function getIsExtension() + { + return isset($this->is_extension) ? $this->is_extension : false; + } + + public function hasIsExtension() + { + return isset($this->is_extension); + } + + public function clearIsExtension() + { + unset($this->is_extension); + } + + /** + * Generated from protobuf field required bool is_extension = 2; + * @param bool $var + * @return $this + */ + public function setIsExtension($var) + { + GPBUtil::checkBool($var); + $this->is_extension = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NamePart::class, \Google\Protobuf\Internal\UninterpretedOption_NamePart::class); + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php new file mode 100644 index 000000000..9750eb010 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php @@ -0,0 +1,16 @@ +google.protobuf.ListValue + */ +class ListValue extends \Google\Protobuf\Internal\Message +{ + /** + * Repeated field of dynamically typed values. + * + * Generated from protobuf field repeated .google.protobuf.Value values = 1; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Protobuf\Value>|\Google\Protobuf\Internal\RepeatedField $values + * Repeated field of dynamically typed values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Struct::initOnce(); + parent::__construct($data); + } + + /** + * Repeated field of dynamically typed values. + * + * Generated from protobuf field repeated .google.protobuf.Value values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * Repeated field of dynamically typed values. + * + * Generated from protobuf field repeated .google.protobuf.Value values = 1; + * @param array<\Google\Protobuf\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); + $this->values = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Method.php b/vendor/google/protobuf/src/Google/Protobuf/Method.php new file mode 100644 index 000000000..eda00bf61 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Method.php @@ -0,0 +1,271 @@ +google.protobuf.Method + */ +class Method extends \Google\Protobuf\Internal\Message +{ + /** + * The simple name of this method. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * A URL of the input message type. + * + * Generated from protobuf field string request_type_url = 2; + */ + protected $request_type_url = ''; + /** + * If true, the request is streamed. + * + * Generated from protobuf field bool request_streaming = 3; + */ + protected $request_streaming = false; + /** + * The URL of the output message type. + * + * Generated from protobuf field string response_type_url = 4; + */ + protected $response_type_url = ''; + /** + * If true, the response is streamed. + * + * Generated from protobuf field bool response_streaming = 5; + */ + protected $response_streaming = false; + /** + * Any metadata attached to the method. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 6; + */ + private $options; + /** + * The source syntax of this method. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 7; + */ + protected $syntax = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The simple name of this method. + * @type string $request_type_url + * A URL of the input message type. + * @type bool $request_streaming + * If true, the request is streamed. + * @type string $response_type_url + * The URL of the output message type. + * @type bool $response_streaming + * If true, the response is streamed. + * @type array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $options + * Any metadata attached to the method. + * @type int $syntax + * The source syntax of this method. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Api::initOnce(); + parent::__construct($data); + } + + /** + * The simple name of this method. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The simple name of this method. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * A URL of the input message type. + * + * Generated from protobuf field string request_type_url = 2; + * @return string + */ + public function getRequestTypeUrl() + { + return $this->request_type_url; + } + + /** + * A URL of the input message type. + * + * Generated from protobuf field string request_type_url = 2; + * @param string $var + * @return $this + */ + public function setRequestTypeUrl($var) + { + GPBUtil::checkString($var, True); + $this->request_type_url = $var; + + return $this; + } + + /** + * If true, the request is streamed. + * + * Generated from protobuf field bool request_streaming = 3; + * @return bool + */ + public function getRequestStreaming() + { + return $this->request_streaming; + } + + /** + * If true, the request is streamed. + * + * Generated from protobuf field bool request_streaming = 3; + * @param bool $var + * @return $this + */ + public function setRequestStreaming($var) + { + GPBUtil::checkBool($var); + $this->request_streaming = $var; + + return $this; + } + + /** + * The URL of the output message type. + * + * Generated from protobuf field string response_type_url = 4; + * @return string + */ + public function getResponseTypeUrl() + { + return $this->response_type_url; + } + + /** + * The URL of the output message type. + * + * Generated from protobuf field string response_type_url = 4; + * @param string $var + * @return $this + */ + public function setResponseTypeUrl($var) + { + GPBUtil::checkString($var, True); + $this->response_type_url = $var; + + return $this; + } + + /** + * If true, the response is streamed. + * + * Generated from protobuf field bool response_streaming = 5; + * @return bool + */ + public function getResponseStreaming() + { + return $this->response_streaming; + } + + /** + * If true, the response is streamed. + * + * Generated from protobuf field bool response_streaming = 5; + * @param bool $var + * @return $this + */ + public function setResponseStreaming($var) + { + GPBUtil::checkBool($var); + $this->response_streaming = $var; + + return $this; + } + + /** + * Any metadata attached to the method. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOptions() + { + return $this->options; + } + + /** + * Any metadata attached to the method. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 6; + * @param array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class); + $this->options = $arr; + + return $this; + } + + /** + * The source syntax of this method. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 7; + * @return int + */ + public function getSyntax() + { + return $this->syntax; + } + + /** + * The source syntax of this method. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 7; + * @param int $var + * @return $this + */ + public function setSyntax($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class); + $this->syntax = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Mixin.php b/vendor/google/protobuf/src/Google/Protobuf/Mixin.php new file mode 100644 index 000000000..4f7bf844c --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Mixin.php @@ -0,0 +1,166 @@ +google.protobuf.Mixin + */ +class Mixin extends \Google\Protobuf\Internal\Message +{ + /** + * The fully qualified name of the interface which is included. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + * + * Generated from protobuf field string root = 2; + */ + protected $root = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The fully qualified name of the interface which is included. + * @type string $root + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Api::initOnce(); + parent::__construct($data); + } + + /** + * The fully qualified name of the interface which is included. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The fully qualified name of the interface which is included. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + * + * Generated from protobuf field string root = 2; + * @return string + */ + public function getRoot() + { + return $this->root; + } + + /** + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + * + * Generated from protobuf field string root = 2; + * @param string $var + * @return $this + */ + public function setRoot($var) + { + GPBUtil::checkString($var, True); + $this->root = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/NullValue.php b/vendor/google/protobuf/src/Google/Protobuf/NullValue.php new file mode 100644 index 000000000..61569f8a3 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/NullValue.php @@ -0,0 +1,49 @@ +google.protobuf.NullValue + */ +class NullValue +{ + /** + * Null value. + * + * Generated from protobuf enum NULL_VALUE = 0; + */ + const NULL_VALUE = 0; + + private static $valueToName = [ + self::NULL_VALUE => 'NULL_VALUE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/OneofDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/OneofDescriptor.php new file mode 100644 index 000000000..66ffbd5ca --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/OneofDescriptor.php @@ -0,0 +1,87 @@ +internal_desc = $internal_desc; + } + + /** + * @return string The name of the oneof + */ + public function getName() + { + return $this->internal_desc->getName(); + } + + /** + * @param int $index Must be >= 0 and < getFieldCount() + * @return FieldDescriptor + */ + public function getField($index) + { + if ( + is_null($this->internal_desc->getFields()) + || !isset($this->internal_desc->getFields()[$index]) + ) { + return null; + } + return $this->getPublicDescriptor($this->internal_desc->getFields()[$index]); + } + + /** + * @return int Number of fields in the oneof + */ + public function getFieldCount() + { + return count($this->internal_desc->getFields()); + } + + public function isSynthetic() + { + return $this->internal_desc->isSynthetic(); + } +} diff --git a/vendor/google/protobuf/src/Google/Protobuf/Option.php b/vendor/google/protobuf/src/Google/Protobuf/Option.php new file mode 100644 index 000000000..31249e513 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Option.php @@ -0,0 +1,136 @@ +google.protobuf.Option + */ +class Option extends \Google\Protobuf\Internal\Message +{ + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, `"map_entry"`. + * For custom options, it should be the fully-qualified name. For example, + * `"google.api.http"`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The option's value packed in an Any message. If the value is a primitive, + * the corresponding wrapper type defined in google/protobuf/wrappers.proto + * should be used. If the value is an enum, it should be stored as an int32 + * value using the google.protobuf.Int32Value type. + * + * Generated from protobuf field .google.protobuf.Any value = 2; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, `"map_entry"`. + * For custom options, it should be the fully-qualified name. For example, + * `"google.api.http"`. + * @type \Google\Protobuf\Any $value + * The option's value packed in an Any message. If the value is a primitive, + * the corresponding wrapper type defined in google/protobuf/wrappers.proto + * should be used. If the value is an enum, it should be stored as an int32 + * value using the google.protobuf.Int32Value type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Type::initOnce(); + parent::__construct($data); + } + + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, `"map_entry"`. + * For custom options, it should be the fully-qualified name. For example, + * `"google.api.http"`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, `"map_entry"`. + * For custom options, it should be the fully-qualified name. For example, + * `"google.api.http"`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The option's value packed in an Any message. If the value is a primitive, + * the corresponding wrapper type defined in google/protobuf/wrappers.proto + * should be used. If the value is an enum, it should be stored as an int32 + * value using the google.protobuf.Int32Value type. + * + * Generated from protobuf field .google.protobuf.Any value = 2; + * @return \Google\Protobuf\Any|null + */ + public function getValue() + { + return $this->value; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * The option's value packed in an Any message. If the value is a primitive, + * the corresponding wrapper type defined in google/protobuf/wrappers.proto + * should be used. If the value is an enum, it should be stored as an int32 + * value using the google.protobuf.Int32Value type. + * + * Generated from protobuf field .google.protobuf.Any value = 2; + * @param \Google\Protobuf\Any $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Any::class); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/SourceContext.php b/vendor/google/protobuf/src/Google/Protobuf/SourceContext.php new file mode 100644 index 000000000..8b3ea1122 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/SourceContext.php @@ -0,0 +1,72 @@ +google.protobuf.SourceContext + */ +class SourceContext extends \Google\Protobuf\Internal\Message +{ + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + * + * Generated from protobuf field string file_name = 1; + */ + protected $file_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $file_name + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\SourceContext::initOnce(); + parent::__construct($data); + } + + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + * + * Generated from protobuf field string file_name = 1; + * @return string + */ + public function getFileName() + { + return $this->file_name; + } + + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + * + * Generated from protobuf field string file_name = 1; + * @param string $var + * @return $this + */ + public function setFileName($var) + { + GPBUtil::checkString($var, True); + $this->file_name = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/StringValue.php b/vendor/google/protobuf/src/Google/Protobuf/StringValue.php new file mode 100644 index 000000000..ad98316b2 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/StringValue.php @@ -0,0 +1,68 @@ +google.protobuf.StringValue + */ +class StringValue extends \Google\Protobuf\Internal\Message +{ + /** + * The string value. + * + * Generated from protobuf field string value = 1; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $value + * The string value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct($data); + } + + /** + * The string value. + * + * Generated from protobuf field string value = 1; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The string value. + * + * Generated from protobuf field string value = 1; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Struct.php b/vendor/google/protobuf/src/Google/Protobuf/Struct.php new file mode 100644 index 000000000..0456541cb --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Struct.php @@ -0,0 +1,73 @@ +google.protobuf.Struct + */ +class Struct extends \Google\Protobuf\Internal\Message +{ + /** + * Unordered map of dynamically typed values. + * + * Generated from protobuf field map fields = 1; + */ + private $fields; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $fields + * Unordered map of dynamically typed values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Struct::initOnce(); + parent::__construct($data); + } + + /** + * Unordered map of dynamically typed values. + * + * Generated from protobuf field map fields = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getFields() + { + return $this->fields; + } + + /** + * Unordered map of dynamically typed values. + * + * Generated from protobuf field map fields = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); + $this->fields = $arr; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Syntax.php b/vendor/google/protobuf/src/Google/Protobuf/Syntax.php new file mode 100644 index 000000000..10952bfd4 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Syntax.php @@ -0,0 +1,54 @@ +google.protobuf.Syntax + */ +class Syntax +{ + /** + * Syntax `proto2`. + * + * Generated from protobuf enum SYNTAX_PROTO2 = 0; + */ + const SYNTAX_PROTO2 = 0; + /** + * Syntax `proto3`. + * + * Generated from protobuf enum SYNTAX_PROTO3 = 1; + */ + const SYNTAX_PROTO3 = 1; + + private static $valueToName = [ + self::SYNTAX_PROTO2 => 'SYNTAX_PROTO2', + self::SYNTAX_PROTO3 => 'SYNTAX_PROTO3', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Timestamp.php b/vendor/google/protobuf/src/Google/Protobuf/Timestamp.php new file mode 100644 index 000000000..a12f48520 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Timestamp.php @@ -0,0 +1,186 @@ +google.protobuf.Timestamp + */ +class Timestamp extends \Google\Protobuf\Internal\TimestampBase +{ + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + * + * Generated from protobuf field int64 seconds = 1; + */ + protected $seconds = 0; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + * + * Generated from protobuf field int32 nanos = 2; + */ + protected $nanos = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $seconds + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + * @type int $nanos + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); + parent::__construct($data); + } + + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + * + * Generated from protobuf field int64 seconds = 1; + * @return int|string + */ + public function getSeconds() + { + return $this->seconds; + } + + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + * + * Generated from protobuf field int64 seconds = 1; + * @param int|string $var + * @return $this + */ + public function setSeconds($var) + { + GPBUtil::checkInt64($var); + $this->seconds = $var; + + return $this; + } + + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + * + * Generated from protobuf field int32 nanos = 2; + * @return int + */ + public function getNanos() + { + return $this->nanos; + } + + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + * + * Generated from protobuf field int32 nanos = 2; + * @param int $var + * @return $this + */ + public function setNanos($var) + { + GPBUtil::checkInt32($var); + $this->nanos = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Type.php b/vendor/google/protobuf/src/Google/Protobuf/Type.php new file mode 100644 index 000000000..d4af7dfec --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Type.php @@ -0,0 +1,247 @@ +google.protobuf.Type + */ +class Type extends \Google\Protobuf\Internal\Message +{ + /** + * The fully qualified message name. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The list of fields. + * + * Generated from protobuf field repeated .google.protobuf.Field fields = 2; + */ + private $fields; + /** + * The list of types appearing in `oneof` definitions in this type. + * + * Generated from protobuf field repeated string oneofs = 3; + */ + private $oneofs; + /** + * The protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 4; + */ + private $options; + /** + * The source context. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; + */ + protected $source_context = null; + /** + * The source syntax. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 6; + */ + protected $syntax = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The fully qualified message name. + * @type array<\Google\Protobuf\Field>|\Google\Protobuf\Internal\RepeatedField $fields + * The list of fields. + * @type array|\Google\Protobuf\Internal\RepeatedField $oneofs + * The list of types appearing in `oneof` definitions in this type. + * @type array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $options + * The protocol buffer options. + * @type \Google\Protobuf\SourceContext $source_context + * The source context. + * @type int $syntax + * The source syntax. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Type::initOnce(); + parent::__construct($data); + } + + /** + * The fully qualified message name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The fully qualified message name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The list of fields. + * + * Generated from protobuf field repeated .google.protobuf.Field fields = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFields() + { + return $this->fields; + } + + /** + * The list of fields. + * + * Generated from protobuf field repeated .google.protobuf.Field fields = 2; + * @param array<\Google\Protobuf\Field>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Field::class); + $this->fields = $arr; + + return $this; + } + + /** + * The list of types appearing in `oneof` definitions in this type. + * + * Generated from protobuf field repeated string oneofs = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOneofs() + { + return $this->oneofs; + } + + /** + * The list of types appearing in `oneof` definitions in this type. + * + * Generated from protobuf field repeated string oneofs = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOneofs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->oneofs = $arr; + + return $this; + } + + /** + * The protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOptions() + { + return $this->options; + } + + /** + * The protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 4; + * @param array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class); + $this->options = $arr; + + return $this; + } + + /** + * The source context. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; + * @return \Google\Protobuf\SourceContext|null + */ + public function getSourceContext() + { + return $this->source_context; + } + + public function hasSourceContext() + { + return isset($this->source_context); + } + + public function clearSourceContext() + { + unset($this->source_context); + } + + /** + * The source context. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; + * @param \Google\Protobuf\SourceContext $var + * @return $this + */ + public function setSourceContext($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\SourceContext::class); + $this->source_context = $var; + + return $this; + } + + /** + * The source syntax. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 6; + * @return int + */ + public function getSyntax() + { + return $this->syntax; + } + + /** + * The source syntax. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 6; + * @param int $var + * @return $this + */ + public function setSyntax($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class); + $this->syntax = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/UInt32Value.php b/vendor/google/protobuf/src/Google/Protobuf/UInt32Value.php new file mode 100644 index 000000000..ae5fc5b42 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/UInt32Value.php @@ -0,0 +1,68 @@ +google.protobuf.UInt32Value + */ +class UInt32Value extends \Google\Protobuf\Internal\Message +{ + /** + * The uint32 value. + * + * Generated from protobuf field uint32 value = 1; + */ + protected $value = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $value + * The uint32 value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct($data); + } + + /** + * The uint32 value. + * + * Generated from protobuf field uint32 value = 1; + * @return int + */ + public function getValue() + { + return $this->value; + } + + /** + * The uint32 value. + * + * Generated from protobuf field uint32 value = 1; + * @param int $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkUint32($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/UInt64Value.php b/vendor/google/protobuf/src/Google/Protobuf/UInt64Value.php new file mode 100644 index 000000000..aa9686726 --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/UInt64Value.php @@ -0,0 +1,68 @@ +google.protobuf.UInt64Value + */ +class UInt64Value extends \Google\Protobuf\Internal\Message +{ + /** + * The uint64 value. + * + * Generated from protobuf field uint64 value = 1; + */ + protected $value = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $value + * The uint64 value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct($data); + } + + /** + * The uint64 value. + * + * Generated from protobuf field uint64 value = 1; + * @return int|string + */ + public function getValue() + { + return $this->value; + } + + /** + * The uint64 value. + * + * Generated from protobuf field uint64 value = 1; + * @param int|string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkUint64($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/google/protobuf/src/Google/Protobuf/Value.php b/vendor/google/protobuf/src/Google/Protobuf/Value.php new file mode 100644 index 000000000..dcc0bdf7c --- /dev/null +++ b/vendor/google/protobuf/src/Google/Protobuf/Value.php @@ -0,0 +1,244 @@ +google.protobuf.Value + */ +class Value extends \Google\Protobuf\Internal\Message +{ + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $null_value + * Represents a null value. + * @type float $number_value + * Represents a double value. + * @type string $string_value + * Represents a string value. + * @type bool $bool_value + * Represents a boolean value. + * @type \Google\Protobuf\Struct $struct_value + * Represents a structured value. + * @type \Google\Protobuf\ListValue $list_value + * Represents a repeated `Value`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Struct::initOnce(); + parent::__construct($data); + } + + /** + * Represents a null value. + * + * Generated from protobuf field .google.protobuf.NullValue null_value = 1; + * @return int + */ + public function getNullValue() + { + return $this->readOneof(1); + } + + public function hasNullValue() + { + return $this->hasOneof(1); + } + + /** + * Represents a null value. + * + * Generated from protobuf field .google.protobuf.NullValue null_value = 1; + * @param int $var + * @return $this + */ + public function setNullValue($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\NullValue::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Represents a double value. + * + * Generated from protobuf field double number_value = 2; + * @return float + */ + public function getNumberValue() + { + return $this->readOneof(2); + } + + public function hasNumberValue() + { + return $this->hasOneof(2); + } + + /** + * Represents a double value. + * + * Generated from protobuf field double number_value = 2; + * @param float $var + * @return $this + */ + public function setNumberValue($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Represents a string value. + * + * Generated from protobuf field string string_value = 3; + * @return string + */ + public function getStringValue() + { + return $this->readOneof(3); + } + + public function hasStringValue() + { + return $this->hasOneof(3); + } + + /** + * Represents a string value. + * + * Generated from protobuf field string string_value = 3; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Represents a boolean value. + * + * Generated from protobuf field bool bool_value = 4; + * @return bool + */ + public function getBoolValue() + { + return $this->readOneof(4); + } + + public function hasBoolValue() + { + return $this->hasOneof(4); + } + + /** + * Represents a boolean value. + * + * Generated from protobuf field bool bool_value = 4; + * @param bool $var + * @return $this + */ + public function setBoolValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Represents a structured value. + * + * Generated from protobuf field .google.protobuf.Struct struct_value = 5; + * @return \Google\Protobuf\Struct|null + */ + public function getStructValue() + { + return $this->readOneof(5); + } + + public function hasStructValue() + { + return $this->hasOneof(5); + } + + /** + * Represents a structured value. + * + * Generated from protobuf field .google.protobuf.Struct struct_value = 5; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setStructValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Represents a repeated `Value`. + * + * Generated from protobuf field .google.protobuf.ListValue list_value = 6; + * @return \Google\Protobuf\ListValue|null + */ + public function getListValue() + { + return $this->readOneof(6); + } + + public function hasListValue() + { + return $this->hasOneof(6); + } + + /** + * Represents a repeated `Value`. + * + * Generated from protobuf field .google.protobuf.ListValue list_value = 6; + * @param \Google\Protobuf\ListValue $var + * @return $this + */ + public function setListValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\ListValue::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + diff --git a/vendor/google/protobuf/src/phpdoc.dist.xml b/vendor/google/protobuf/src/phpdoc.dist.xml new file mode 100644 index 000000000..dd3130253 --- /dev/null +++ b/vendor/google/protobuf/src/phpdoc.dist.xml @@ -0,0 +1,15 @@ + + + + + doc + + + doc + + + Google/Protobuf/Internal/MapField.php + Google/Protobuf/Internal/Message.php + Google/Protobuf/Internal/RepeatedField.php + + diff --git a/vendor/guzzlehttp/guzzle/CHANGELOG.md b/vendor/guzzlehttp/guzzle/CHANGELOG.md new file mode 100644 index 000000000..990b86c9e --- /dev/null +++ b/vendor/guzzlehttp/guzzle/CHANGELOG.md @@ -0,0 +1,1624 @@ +# Change Log + +Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version. + + +## 7.8.0 - 2023-08-27 + +### Added + +- Support for PHP 8.3 +- Added automatic closing of handles on `CurlFactory` object destruction + + +## 7.7.1 - 2023-08-27 + +### Changed + +- Remove the need for `AllowDynamicProperties` in `CurlMultiHandler` + + +## 7.7.0 - 2023-05-21 + +### Added + +- Support `guzzlehttp/promises` v2 + + +## 7.6.1 - 2023-05-15 + +### Fixed + +- Fix `SetCookie::fromString` MaxAge deprecation warning and skip invalid MaxAge values + + +## 7.6.0 - 2023-05-14 + +### Added + +- Support for setting the minimum TLS version in a unified way +- Apply on request the version set in options parameters + + +## 7.5.2 - 2023-05-14 + +### Fixed + +- Fixed set cookie constructor validation +- Fixed handling of files with `'0'` body + +### Changed + +- Corrected docs and default connect timeout value to 300 seconds + + +## 7.5.1 - 2023-04-17 + +### Fixed + +- Fixed `NO_PROXY` settings so that setting the `proxy` option to `no` overrides the env variable + +### Changed + +- Adjusted `guzzlehttp/psr7` version constraint to `^1.9.1 || ^2.4.5` + + +## 7.5.0 - 2022-08-28 + +### Added + +- Support PHP 8.2 +- Add request to delay closure params + + +## 7.4.5 - 2022-06-20 + +### Fixed + +* Fix change in port should be considered a change in origin +* Fix `CURLOPT_HTTPAUTH` option not cleared on change of origin + + +## 7.4.4 - 2022-06-09 + +### Fixed + +* Fix failure to strip Authorization header on HTTP downgrade +* Fix failure to strip the Cookie header on change in host or HTTP downgrade + + +## 7.4.3 - 2022-05-25 + +### Fixed + +* Fix cross-domain cookie leakage + + +## 7.4.2 - 2022-03-20 + +### Fixed + +- Remove curl auth on cross-domain redirects to align with the Authorization HTTP header +- Reject non-HTTP schemes in StreamHandler +- Set a default ssl.peer_name context in StreamHandler to allow `force_ip_resolve` + + +## 7.4.1 - 2021-12-06 + +### Changed + +- Replaced implicit URI to string coercion [#2946](https://github.com/guzzle/guzzle/pull/2946) +- Allow `symfony/deprecation-contracts` version 3 [#2961](https://github.com/guzzle/guzzle/pull/2961) + +### Fixed + +- Only close curl handle if it's done [#2950](https://github.com/guzzle/guzzle/pull/2950) + + +## 7.4.0 - 2021-10-18 + +### Added + +- Support PHP 8.1 [#2929](https://github.com/guzzle/guzzle/pull/2929), [#2939](https://github.com/guzzle/guzzle/pull/2939) +- Support `psr/log` version 2 and 3 [#2943](https://github.com/guzzle/guzzle/pull/2943) + +### Fixed + +- Make sure we always call `restore_error_handler()` [#2915](https://github.com/guzzle/guzzle/pull/2915) +- Fix progress parameter type compatibility between the cURL and stream handlers [#2936](https://github.com/guzzle/guzzle/pull/2936) +- Throw `InvalidArgumentException` when an incorrect `headers` array is provided [#2916](https://github.com/guzzle/guzzle/pull/2916), [#2942](https://github.com/guzzle/guzzle/pull/2942) + +### Changed + +- Be more strict with types [#2914](https://github.com/guzzle/guzzle/pull/2914), [#2917](https://github.com/guzzle/guzzle/pull/2917), [#2919](https://github.com/guzzle/guzzle/pull/2919), [#2945](https://github.com/guzzle/guzzle/pull/2945) + + +## 7.3.0 - 2021-03-23 + +### Added + +- Support for DER and P12 certificates [#2413](https://github.com/guzzle/guzzle/pull/2413) +- Support the cURL (http://) scheme for StreamHandler proxies [#2850](https://github.com/guzzle/guzzle/pull/2850) +- Support for `guzzlehttp/psr7:^2.0` [#2878](https://github.com/guzzle/guzzle/pull/2878) + +### Fixed + +- Handle exceptions on invalid header consistently between PHP versions and handlers [#2872](https://github.com/guzzle/guzzle/pull/2872) + + +## 7.2.0 - 2020-10-10 + +### Added + +- Support for PHP 8 [#2712](https://github.com/guzzle/guzzle/pull/2712), [#2715](https://github.com/guzzle/guzzle/pull/2715), [#2789](https://github.com/guzzle/guzzle/pull/2789) +- Support passing a body summarizer to the http errors middleware [#2795](https://github.com/guzzle/guzzle/pull/2795) + +### Fixed + +- Handle exceptions during response creation [#2591](https://github.com/guzzle/guzzle/pull/2591) +- Fix CURLOPT_ENCODING not to be overwritten [#2595](https://github.com/guzzle/guzzle/pull/2595) +- Make sure the Request always has a body object [#2804](https://github.com/guzzle/guzzle/pull/2804) + +### Changed + +- The `TooManyRedirectsException` has a response [#2660](https://github.com/guzzle/guzzle/pull/2660) +- Avoid "functions" from dependencies [#2712](https://github.com/guzzle/guzzle/pull/2712) + +### Deprecated + +- Using environment variable GUZZLE_CURL_SELECT_TIMEOUT [#2786](https://github.com/guzzle/guzzle/pull/2786) + + +## 7.1.1 - 2020-09-30 + +### Fixed + +- Incorrect EOF detection for response body streams on Windows. + +### Changed + +- We dont connect curl `sink` on HEAD requests. +- Removed some PHP 5 workarounds + + +## 7.1.0 - 2020-09-22 + +### Added + +- `GuzzleHttp\MessageFormatterInterface` + +### Fixed + +- Fixed issue that caused cookies with no value not to be stored. +- On redirects, we allow all safe methods like GET, HEAD and OPTIONS. +- Fixed logging on empty responses. +- Make sure MessageFormatter::format returns string + +### Deprecated + +- All functions in `GuzzleHttp` has been deprecated. Use static methods on `Utils` instead. +- `ClientInterface::getConfig()` +- `Client::getConfig()` +- `Client::__call()` +- `Utils::defaultCaBundle()` +- `CurlFactory::LOW_CURL_VERSION_NUMBER` + + +## 7.0.1 - 2020-06-27 + +* Fix multiply defined functions fatal error [#2699](https://github.com/guzzle/guzzle/pull/2699) + + +## 7.0.0 - 2020-06-27 + +No changes since 7.0.0-rc1. + + +## 7.0.0-rc1 - 2020-06-15 + +### Changed + +* Use error level for logging errors in Middleware [#2629](https://github.com/guzzle/guzzle/pull/2629) +* Disabled IDN support by default and require ext-intl to use it [#2675](https://github.com/guzzle/guzzle/pull/2675) + + +## 7.0.0-beta2 - 2020-05-25 + +### Added + +* Using `Utils` class instead of functions in the `GuzzleHttp` namespace. [#2546](https://github.com/guzzle/guzzle/pull/2546) +* `ClientInterface::MAJOR_VERSION` [#2583](https://github.com/guzzle/guzzle/pull/2583) + +### Changed + +* Avoid the `getenv` function when unsafe [#2531](https://github.com/guzzle/guzzle/pull/2531) +* Added real client methods [#2529](https://github.com/guzzle/guzzle/pull/2529) +* Avoid functions due to global install conflicts [#2546](https://github.com/guzzle/guzzle/pull/2546) +* Use Symfony intl-idn polyfill [#2550](https://github.com/guzzle/guzzle/pull/2550) +* Adding methods for HTTP verbs like `Client::get()`, `Client::head()`, `Client::patch()` etc [#2529](https://github.com/guzzle/guzzle/pull/2529) +* `ConnectException` extends `TransferException` [#2541](https://github.com/guzzle/guzzle/pull/2541) +* Updated the default User Agent to "GuzzleHttp/7" [#2654](https://github.com/guzzle/guzzle/pull/2654) + +### Fixed + +* Various intl icu issues [#2626](https://github.com/guzzle/guzzle/pull/2626) + +### Removed + +* Pool option `pool_size` [#2528](https://github.com/guzzle/guzzle/pull/2528) + + +## 7.0.0-beta1 - 2019-12-30 + +The diff might look very big but 95% of Guzzle users will be able to upgrade without modification. +Please see [the upgrade document](UPGRADING.md) that describes all BC breaking changes. + +### Added + +* Implement PSR-18 and dropped PHP 5 support [#2421](https://github.com/guzzle/guzzle/pull/2421) [#2474](https://github.com/guzzle/guzzle/pull/2474) +* PHP 7 types [#2442](https://github.com/guzzle/guzzle/pull/2442) [#2449](https://github.com/guzzle/guzzle/pull/2449) [#2466](https://github.com/guzzle/guzzle/pull/2466) [#2497](https://github.com/guzzle/guzzle/pull/2497) [#2499](https://github.com/guzzle/guzzle/pull/2499) +* IDN support for redirects [2424](https://github.com/guzzle/guzzle/pull/2424) + +### Changed + +* Dont allow passing null as third argument to `BadResponseException::__construct()` [#2427](https://github.com/guzzle/guzzle/pull/2427) +* Use SAPI constant instead of method call [#2450](https://github.com/guzzle/guzzle/pull/2450) +* Use native function invocation [#2444](https://github.com/guzzle/guzzle/pull/2444) +* Better defaults for PHP installations with old ICU lib [2454](https://github.com/guzzle/guzzle/pull/2454) +* Added visibility to all constants [#2462](https://github.com/guzzle/guzzle/pull/2462) +* Dont allow passing `null` as URI to `Client::request()` and `Client::requestAsync()` [#2461](https://github.com/guzzle/guzzle/pull/2461) +* Widen the exception argument to throwable [#2495](https://github.com/guzzle/guzzle/pull/2495) + +### Fixed + +* Logging when Promise rejected with a string [#2311](https://github.com/guzzle/guzzle/pull/2311) + +### Removed + +* Class `SeekException` [#2162](https://github.com/guzzle/guzzle/pull/2162) +* `RequestException::getResponseBodySummary()` [#2425](https://github.com/guzzle/guzzle/pull/2425) +* `CookieJar::getCookieValue()` [#2433](https://github.com/guzzle/guzzle/pull/2433) +* `uri_template()` and `UriTemplate` [#2440](https://github.com/guzzle/guzzle/pull/2440) +* Request options `save_to` and `exceptions` [#2464](https://github.com/guzzle/guzzle/pull/2464) + + +## 6.5.2 - 2019-12-23 + +* idn_to_ascii() fix for old PHP versions [#2489](https://github.com/guzzle/guzzle/pull/2489) + + +## 6.5.1 - 2019-12-21 + +* Better defaults for PHP installations with old ICU lib [#2454](https://github.com/guzzle/guzzle/pull/2454) +* IDN support for redirects [#2424](https://github.com/guzzle/guzzle/pull/2424) + + +## 6.5.0 - 2019-12-07 + +* Improvement: Added support for reset internal queue in MockHandler. [#2143](https://github.com/guzzle/guzzle/pull/2143) +* Improvement: Added support to pass arbitrary options to `curl_multi_init`. [#2287](https://github.com/guzzle/guzzle/pull/2287) +* Fix: Gracefully handle passing `null` to the `header` option. [#2132](https://github.com/guzzle/guzzle/pull/2132) +* Fix: `RetryMiddleware` did not do exponential delay between retires due unit mismatch. [#2132](https://github.com/guzzle/guzzle/pull/2132) +* Fix: Prevent undefined offset when using array for ssl_key options. [#2348](https://github.com/guzzle/guzzle/pull/2348) +* Deprecated `ClientInterface::VERSION` + + +## 6.4.1 - 2019-10-23 + +* No `guzzle.phar` was created in 6.4.0 due expired API token. This release will fix that +* Added `parent::__construct()` to `FileCookieJar` and `SessionCookieJar` + + +## 6.4.0 - 2019-10-23 + +* Improvement: Improved error messages when using curl < 7.21.2 [#2108](https://github.com/guzzle/guzzle/pull/2108) +* Fix: Test if response is readable before returning a summary in `RequestException::getResponseBodySummary()` [#2081](https://github.com/guzzle/guzzle/pull/2081) +* Fix: Add support for GUZZLE_CURL_SELECT_TIMEOUT environment variable [#2161](https://github.com/guzzle/guzzle/pull/2161) +* Improvement: Added `GuzzleHttp\Exception\InvalidArgumentException` [#2163](https://github.com/guzzle/guzzle/pull/2163) +* Improvement: Added `GuzzleHttp\_current_time()` to use `hrtime()` if that function exists. [#2242](https://github.com/guzzle/guzzle/pull/2242) +* Improvement: Added curl's `appconnect_time` in `TransferStats` [#2284](https://github.com/guzzle/guzzle/pull/2284) +* Improvement: Make GuzzleException extend Throwable wherever it's available [#2273](https://github.com/guzzle/guzzle/pull/2273) +* Fix: Prevent concurrent writes to file when saving `CookieJar` [#2335](https://github.com/guzzle/guzzle/pull/2335) +* Improvement: Update `MockHandler` so we can test transfer time [#2362](https://github.com/guzzle/guzzle/pull/2362) + + +## 6.3.3 - 2018-04-22 + +* Fix: Default headers when decode_content is specified + + +## 6.3.2 - 2018-03-26 + +* Fix: Release process + + +## 6.3.1 - 2018-03-26 + +* Bug fix: Parsing 0 epoch expiry times in cookies [#2014](https://github.com/guzzle/guzzle/pull/2014) +* Improvement: Better ConnectException detection [#2012](https://github.com/guzzle/guzzle/pull/2012) +* Bug fix: Malformed domain that contains a "/" [#1999](https://github.com/guzzle/guzzle/pull/1999) +* Bug fix: Undefined offset when a cookie has no first key-value pair [#1998](https://github.com/guzzle/guzzle/pull/1998) +* Improvement: Support PHPUnit 6 [#1953](https://github.com/guzzle/guzzle/pull/1953) +* Bug fix: Support empty headers [#1915](https://github.com/guzzle/guzzle/pull/1915) +* Bug fix: Ignore case during header modifications [#1916](https://github.com/guzzle/guzzle/pull/1916) + ++ Minor code cleanups, documentation fixes and clarifications. + + +## 6.3.0 - 2017-06-22 + +* Feature: force IP resolution (ipv4 or ipv6) [#1608](https://github.com/guzzle/guzzle/pull/1608), [#1659](https://github.com/guzzle/guzzle/pull/1659) +* Improvement: Don't include summary in exception message when body is empty [#1621](https://github.com/guzzle/guzzle/pull/1621) +* Improvement: Handle `on_headers` option in MockHandler [#1580](https://github.com/guzzle/guzzle/pull/1580) +* Improvement: Added SUSE Linux CA path [#1609](https://github.com/guzzle/guzzle/issues/1609) +* Improvement: Use class reference for getting the name of the class instead of using hardcoded strings [#1641](https://github.com/guzzle/guzzle/pull/1641) +* Feature: Added `read_timeout` option [#1611](https://github.com/guzzle/guzzle/pull/1611) +* Bug fix: PHP 7.x fixes [#1685](https://github.com/guzzle/guzzle/pull/1685), [#1686](https://github.com/guzzle/guzzle/pull/1686), [#1811](https://github.com/guzzle/guzzle/pull/1811) +* Deprecation: BadResponseException instantiation without a response [#1642](https://github.com/guzzle/guzzle/pull/1642) +* Feature: Added NTLM auth [#1569](https://github.com/guzzle/guzzle/pull/1569) +* Feature: Track redirect HTTP status codes [#1711](https://github.com/guzzle/guzzle/pull/1711) +* Improvement: Check handler type during construction [#1745](https://github.com/guzzle/guzzle/pull/1745) +* Improvement: Always include the Content-Length if there's a body [#1721](https://github.com/guzzle/guzzle/pull/1721) +* Feature: Added convenience method to access a cookie by name [#1318](https://github.com/guzzle/guzzle/pull/1318) +* Bug fix: Fill `CURLOPT_CAPATH` and `CURLOPT_CAINFO` properly [#1684](https://github.com/guzzle/guzzle/pull/1684) +* Improvement: Use `\GuzzleHttp\Promise\rejection_for` function instead of object init [#1827](https://github.com/guzzle/guzzle/pull/1827) + ++ Minor code cleanups, documentation fixes and clarifications. + + +## 6.2.3 - 2017-02-28 + +* Fix deprecations with guzzle/psr7 version 1.4 + + +## 6.2.2 - 2016-10-08 + +* Allow to pass nullable Response to delay callable +* Only add scheme when host is present +* Fix drain case where content-length is the literal string zero +* Obfuscate in-URL credentials in exceptions + + +## 6.2.1 - 2016-07-18 + +* Address HTTP_PROXY security vulnerability, CVE-2016-5385: + https://httpoxy.org/ +* Fixing timeout bug with StreamHandler: + https://github.com/guzzle/guzzle/pull/1488 +* Only read up to `Content-Length` in PHP StreamHandler to avoid timeouts when + a server does not honor `Connection: close`. +* Ignore URI fragment when sending requests. + + +## 6.2.0 - 2016-03-21 + +* Feature: added `GuzzleHttp\json_encode` and `GuzzleHttp\json_decode`. + https://github.com/guzzle/guzzle/pull/1389 +* Bug fix: Fix sleep calculation when waiting for delayed requests. + https://github.com/guzzle/guzzle/pull/1324 +* Feature: More flexible history containers. + https://github.com/guzzle/guzzle/pull/1373 +* Bug fix: defer sink stream opening in StreamHandler. + https://github.com/guzzle/guzzle/pull/1377 +* Bug fix: do not attempt to escape cookie values. + https://github.com/guzzle/guzzle/pull/1406 +* Feature: report original content encoding and length on decoded responses. + https://github.com/guzzle/guzzle/pull/1409 +* Bug fix: rewind seekable request bodies before dispatching to cURL. + https://github.com/guzzle/guzzle/pull/1422 +* Bug fix: provide an empty string to `http_build_query` for HHVM workaround. + https://github.com/guzzle/guzzle/pull/1367 + + +## 6.1.1 - 2015-11-22 + +* Bug fix: Proxy::wrapSync() now correctly proxies to the appropriate handler + https://github.com/guzzle/guzzle/commit/911bcbc8b434adce64e223a6d1d14e9a8f63e4e4 +* Feature: HandlerStack is now more generic. + https://github.com/guzzle/guzzle/commit/f2102941331cda544745eedd97fc8fd46e1ee33e +* Bug fix: setting verify to false in the StreamHandler now disables peer + verification. https://github.com/guzzle/guzzle/issues/1256 +* Feature: Middleware now uses an exception factory, including more error + context. https://github.com/guzzle/guzzle/pull/1282 +* Feature: better support for disabled functions. + https://github.com/guzzle/guzzle/pull/1287 +* Bug fix: fixed regression where MockHandler was not using `sink`. + https://github.com/guzzle/guzzle/pull/1292 + + +## 6.1.0 - 2015-09-08 + +* Feature: Added the `on_stats` request option to provide access to transfer + statistics for requests. https://github.com/guzzle/guzzle/pull/1202 +* Feature: Added the ability to persist session cookies in CookieJars. + https://github.com/guzzle/guzzle/pull/1195 +* Feature: Some compatibility updates for Google APP Engine + https://github.com/guzzle/guzzle/pull/1216 +* Feature: Added support for NO_PROXY to prevent the use of a proxy based on + a simple set of rules. https://github.com/guzzle/guzzle/pull/1197 +* Feature: Cookies can now contain square brackets. + https://github.com/guzzle/guzzle/pull/1237 +* Bug fix: Now correctly parsing `=` inside of quotes in Cookies. + https://github.com/guzzle/guzzle/pull/1232 +* Bug fix: Cusotm cURL options now correctly override curl options of the + same name. https://github.com/guzzle/guzzle/pull/1221 +* Bug fix: Content-Type header is now added when using an explicitly provided + multipart body. https://github.com/guzzle/guzzle/pull/1218 +* Bug fix: Now ignoring Set-Cookie headers that have no name. +* Bug fix: Reason phrase is no longer cast to an int in some cases in the + cURL handler. https://github.com/guzzle/guzzle/pull/1187 +* Bug fix: Remove the Authorization header when redirecting if the Host + header changes. https://github.com/guzzle/guzzle/pull/1207 +* Bug fix: Cookie path matching fixes + https://github.com/guzzle/guzzle/issues/1129 +* Bug fix: Fixing the cURL `body_as_string` setting + https://github.com/guzzle/guzzle/pull/1201 +* Bug fix: quotes are no longer stripped when parsing cookies. + https://github.com/guzzle/guzzle/issues/1172 +* Bug fix: `form_params` and `query` now always uses the `&` separator. + https://github.com/guzzle/guzzle/pull/1163 +* Bug fix: Adding a Content-Length to PHP stream wrapper requests if not set. + https://github.com/guzzle/guzzle/pull/1189 + + +## 6.0.2 - 2015-07-04 + +* Fixed a memory leak in the curl handlers in which references to callbacks + were not being removed by `curl_reset`. +* Cookies are now extracted properly before redirects. +* Cookies now allow more character ranges. +* Decoded Content-Encoding responses are now modified to correctly reflect + their state if the encoding was automatically removed by a handler. This + means that the `Content-Encoding` header may be removed an the + `Content-Length` modified to reflect the message size after removing the + encoding. +* Added a more explicit error message when trying to use `form_params` and + `multipart` in the same request. +* Several fixes for HHVM support. +* Functions are now conditionally required using an additional level of + indirection to help with global Composer installations. + + +## 6.0.1 - 2015-05-27 + +* Fixed a bug with serializing the `query` request option where the `&` + separator was missing. +* Added a better error message for when `body` is provided as an array. Please + use `form_params` or `multipart` instead. +* Various doc fixes. + + +## 6.0.0 - 2015-05-26 + +* See the UPGRADING.md document for more information. +* Added `multipart` and `form_params` request options. +* Added `synchronous` request option. +* Added the `on_headers` request option. +* Fixed `expect` handling. +* No longer adding default middlewares in the client ctor. These need to be + present on the provided handler in order to work. +* Requests are no longer initiated when sending async requests with the + CurlMultiHandler. This prevents unexpected recursion from requests completing + while ticking the cURL loop. +* Removed the semantics of setting `default` to `true`. This is no longer + required now that the cURL loop is not ticked for async requests. +* Added request and response logging middleware. +* No longer allowing self signed certificates when using the StreamHandler. +* Ensuring that `sink` is valid if saving to a file. +* Request exceptions now include a "handler context" which provides handler + specific contextual information. +* Added `GuzzleHttp\RequestOptions` to allow request options to be applied + using constants. +* `$maxHandles` has been removed from CurlMultiHandler. +* `MultipartPostBody` is now part of the `guzzlehttp/psr7` package. + + +## 5.3.0 - 2015-05-19 + +* Mock now supports `save_to` +* Marked `AbstractRequestEvent::getTransaction()` as public. +* Fixed a bug in which multiple headers using different casing would overwrite + previous headers in the associative array. +* Added `Utils::getDefaultHandler()` +* Marked `GuzzleHttp\Client::getDefaultUserAgent` as deprecated. +* URL scheme is now always lowercased. + + +## 6.0.0-beta.1 + +* Requires PHP >= 5.5 +* Updated to use PSR-7 + * Requires immutable messages, which basically means an event based system + owned by a request instance is no longer possible. + * Utilizing the [Guzzle PSR-7 package](https://github.com/guzzle/psr7). + * Removed the dependency on `guzzlehttp/streams`. These stream abstractions + are available in the `guzzlehttp/psr7` package under the `GuzzleHttp\Psr7` + namespace. +* Added middleware and handler system + * Replaced the Guzzle event and subscriber system with a middleware system. + * No longer depends on RingPHP, but rather places the HTTP handlers directly + in Guzzle, operating on PSR-7 messages. + * Retry logic is now encapsulated in `GuzzleHttp\Middleware::retry`, which + means the `guzzlehttp/retry-subscriber` is now obsolete. + * Mocking responses is now handled using `GuzzleHttp\Handler\MockHandler`. +* Asynchronous responses + * No longer supports the `future` request option to send an async request. + Instead, use one of the `*Async` methods of a client (e.g., `requestAsync`, + `getAsync`, etc.). + * Utilizing `GuzzleHttp\Promise` instead of React's promise library to avoid + recursion required by chaining and forwarding react promises. See + https://github.com/guzzle/promises + * Added `requestAsync` and `sendAsync` to send request asynchronously. + * Added magic methods for `getAsync()`, `postAsync()`, etc. to send requests + asynchronously. +* Request options + * POST and form updates + * Added the `form_fields` and `form_files` request options. + * Removed the `GuzzleHttp\Post` namespace. + * The `body` request option no longer accepts an array for POST requests. + * The `exceptions` request option has been deprecated in favor of the + `http_errors` request options. + * The `save_to` request option has been deprecated in favor of `sink` request + option. +* Clients no longer accept an array of URI template string and variables for + URI variables. You will need to expand URI templates before passing them + into a client constructor or request method. +* Client methods `get()`, `post()`, `put()`, `patch()`, `options()`, etc. are + now magic methods that will send synchronous requests. +* Replaced `Utils.php` with plain functions in `functions.php`. +* Removed `GuzzleHttp\Collection`. +* Removed `GuzzleHttp\BatchResults`. Batched pool results are now returned as + an array. +* Removed `GuzzleHttp\Query`. Query string handling is now handled using an + associative array passed into the `query` request option. The query string + is serialized using PHP's `http_build_query`. If you need more control, you + can pass the query string in as a string. +* `GuzzleHttp\QueryParser` has been replaced with the + `GuzzleHttp\Psr7\parse_query`. + + +## 5.2.0 - 2015-01-27 + +* Added `AppliesHeadersInterface` to make applying headers to a request based + on the body more generic and not specific to `PostBodyInterface`. +* Reduced the number of stack frames needed to send requests. +* Nested futures are now resolved in the client rather than the RequestFsm +* Finishing state transitions is now handled in the RequestFsm rather than the + RingBridge. +* Added a guard in the Pool class to not use recursion for request retries. + + +## 5.1.0 - 2014-12-19 + +* Pool class no longer uses recursion when a request is intercepted. +* The size of a Pool can now be dynamically adjusted using a callback. + See https://github.com/guzzle/guzzle/pull/943. +* Setting a request option to `null` when creating a request with a client will + ensure that the option is not set. This allows you to overwrite default + request options on a per-request basis. + See https://github.com/guzzle/guzzle/pull/937. +* Added the ability to limit which protocols are allowed for redirects by + specifying a `protocols` array in the `allow_redirects` request option. +* Nested futures due to retries are now resolved when waiting for synchronous + responses. See https://github.com/guzzle/guzzle/pull/947. +* `"0"` is now an allowed URI path. See + https://github.com/guzzle/guzzle/pull/935. +* `Query` no longer typehints on the `$query` argument in the constructor, + allowing for strings and arrays. +* Exceptions thrown in the `end` event are now correctly wrapped with Guzzle + specific exceptions if necessary. + + +## 5.0.3 - 2014-11-03 + +This change updates query strings so that they are treated as un-encoded values +by default where the value represents an un-encoded value to send over the +wire. A Query object then encodes the value before sending over the wire. This +means that even value query string values (e.g., ":") are url encoded. This +makes the Query class match PHP's http_build_query function. However, if you +want to send requests over the wire using valid query string characters that do +not need to be encoded, then you can provide a string to Url::setQuery() and +pass true as the second argument to specify that the query string is a raw +string that should not be parsed or encoded (unless a call to getQuery() is +subsequently made, forcing the query-string to be converted into a Query +object). + + +## 5.0.2 - 2014-10-30 + +* Added a trailing `\r\n` to multipart/form-data payloads. See + https://github.com/guzzle/guzzle/pull/871 +* Added a `GuzzleHttp\Pool::send()` convenience method to match the docs. +* Status codes are now returned as integers. See + https://github.com/guzzle/guzzle/issues/881 +* No longer overwriting an existing `application/x-www-form-urlencoded` header + when sending POST requests, allowing for customized headers. See + https://github.com/guzzle/guzzle/issues/877 +* Improved path URL serialization. + + * No longer double percent-encoding characters in the path or query string if + they are already encoded. + * Now properly encoding the supplied path to a URL object, instead of only + encoding ' ' and '?'. + * Note: This has been changed in 5.0.3 to now encode query string values by + default unless the `rawString` argument is provided when setting the query + string on a URL: Now allowing many more characters to be present in the + query string without being percent encoded. See https://tools.ietf.org/html/rfc3986#appendix-A + + +## 5.0.1 - 2014-10-16 + +Bugfix release. + +* Fixed an issue where connection errors still returned response object in + error and end events event though the response is unusable. This has been + corrected so that a response is not returned in the `getResponse` method of + these events if the response did not complete. https://github.com/guzzle/guzzle/issues/867 +* Fixed an issue where transfer statistics were not being populated in the + RingBridge. https://github.com/guzzle/guzzle/issues/866 + + +## 5.0.0 - 2014-10-12 + +Adding support for non-blocking responses and some minor API cleanup. + +### New Features + +* Added support for non-blocking responses based on `guzzlehttp/guzzle-ring`. +* Added a public API for creating a default HTTP adapter. +* Updated the redirect plugin to be non-blocking so that redirects are sent + concurrently. Other plugins like this can now be updated to be non-blocking. +* Added a "progress" event so that you can get upload and download progress + events. +* Added `GuzzleHttp\Pool` which implements FutureInterface and transfers + requests concurrently using a capped pool size as efficiently as possible. +* Added `hasListeners()` to EmitterInterface. +* Removed `GuzzleHttp\ClientInterface::sendAll` and marked + `GuzzleHttp\Client::sendAll` as deprecated (it's still there, just not the + recommended way). + +### Breaking changes + +The breaking changes in this release are relatively minor. The biggest thing to +look out for is that request and response objects no longer implement fluent +interfaces. + +* Removed the fluent interfaces (i.e., `return $this`) from requests, + responses, `GuzzleHttp\Collection`, `GuzzleHttp\Url`, + `GuzzleHttp\Query`, `GuzzleHttp\Post\PostBody`, and + `GuzzleHttp\Cookie\SetCookie`. This blog post provides a good outline of + why I did this: https://ocramius.github.io/blog/fluent-interfaces-are-evil/. + This also makes the Guzzle message interfaces compatible with the current + PSR-7 message proposal. +* Removed "functions.php", so that Guzzle is truly PSR-4 compliant. Except + for the HTTP request functions from function.php, these functions are now + implemented in `GuzzleHttp\Utils` using camelCase. `GuzzleHttp\json_decode` + moved to `GuzzleHttp\Utils::jsonDecode`. `GuzzleHttp\get_path` moved to + `GuzzleHttp\Utils::getPath`. `GuzzleHttp\set_path` moved to + `GuzzleHttp\Utils::setPath`. `GuzzleHttp\batch` should now be + `GuzzleHttp\Pool::batch`, which returns an `objectStorage`. Using functions.php + caused problems for many users: they aren't PSR-4 compliant, require an + explicit include, and needed an if-guard to ensure that the functions are not + declared multiple times. +* Rewrote adapter layer. + * Removing all classes from `GuzzleHttp\Adapter`, these are now + implemented as callables that are stored in `GuzzleHttp\Ring\Client`. + * Removed the concept of "parallel adapters". Sending requests serially or + concurrently is now handled using a single adapter. + * Moved `GuzzleHttp\Adapter\Transaction` to `GuzzleHttp\Transaction`. The + Transaction object now exposes the request, response, and client as public + properties. The getters and setters have been removed. +* Removed the "headers" event. This event was only useful for changing the + body a response once the headers of the response were known. You can implement + a similar behavior in a number of ways. One example might be to use a + FnStream that has access to the transaction being sent. For example, when the + first byte is written, you could check if the response headers match your + expectations, and if so, change the actual stream body that is being + written to. +* Removed the `asArray` parameter from + `GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header + value as an array, then use the newly added `getHeaderAsArray()` method of + `MessageInterface`. This change makes the Guzzle interfaces compatible with + the PSR-7 interfaces. +* `GuzzleHttp\Message\MessageFactory` no longer allows subclasses to add + custom request options using double-dispatch (this was an implementation + detail). Instead, you should now provide an associative array to the + constructor which is a mapping of the request option name mapping to a + function that applies the option value to a request. +* Removed the concept of "throwImmediately" from exceptions and error events. + This control mechanism was used to stop a transfer of concurrent requests + from completing. This can now be handled by throwing the exception or by + cancelling a pool of requests or each outstanding future request individually. +* Updated to "GuzzleHttp\Streams" 3.0. + * `GuzzleHttp\Stream\StreamInterface::getContents()` no longer accepts a + `maxLen` parameter. This update makes the Guzzle streams project + compatible with the current PSR-7 proposal. + * `GuzzleHttp\Stream\Stream::__construct`, + `GuzzleHttp\Stream\Stream::factory`, and + `GuzzleHttp\Stream\Utils::create` no longer accept a size in the second + argument. They now accept an associative array of options, including the + "size" key and "metadata" key which can be used to provide custom metadata. + + +## 4.2.2 - 2014-09-08 + +* Fixed a memory leak in the CurlAdapter when reusing cURL handles. +* No longer using `request_fulluri` in stream adapter proxies. +* Relative redirects are now based on the last response, not the first response. + +## 4.2.1 - 2014-08-19 + +* Ensuring that the StreamAdapter does not always add a Content-Type header +* Adding automated github releases with a phar and zip + +## 4.2.0 - 2014-08-17 + +* Now merging in default options using a case-insensitive comparison. + Closes https://github.com/guzzle/guzzle/issues/767 +* Added the ability to automatically decode `Content-Encoding` response bodies + using the `decode_content` request option. This is set to `true` by default + to decode the response body if it comes over the wire with a + `Content-Encoding`. Set this value to `false` to disable decoding the + response content, and pass a string to provide a request `Accept-Encoding` + header and turn on automatic response decoding. This feature now allows you + to pass an `Accept-Encoding` header in the headers of a request but still + disable automatic response decoding. + Closes https://github.com/guzzle/guzzle/issues/764 +* Added the ability to throw an exception immediately when transferring + requests in parallel. Closes https://github.com/guzzle/guzzle/issues/760 +* Updating guzzlehttp/streams dependency to ~2.1 +* No longer utilizing the now deprecated namespaced methods from the stream + package. + +## 4.1.8 - 2014-08-14 + +* Fixed an issue in the CurlFactory that caused setting the `stream=false` + request option to throw an exception. + See: https://github.com/guzzle/guzzle/issues/769 +* TransactionIterator now calls rewind on the inner iterator. + See: https://github.com/guzzle/guzzle/pull/765 +* You can now set the `Content-Type` header to `multipart/form-data` + when creating POST requests to force multipart bodies. + See https://github.com/guzzle/guzzle/issues/768 + +## 4.1.7 - 2014-08-07 + +* Fixed an error in the HistoryPlugin that caused the same request and response + to be logged multiple times when an HTTP protocol error occurs. +* Ensuring that cURL does not add a default Content-Type when no Content-Type + has been supplied by the user. This prevents the adapter layer from modifying + the request that is sent over the wire after any listeners may have already + put the request in a desired state (e.g., signed the request). +* Throwing an exception when you attempt to send requests that have the + "stream" set to true in parallel using the MultiAdapter. +* Only calling curl_multi_select when there are active cURL handles. This was + previously changed and caused performance problems on some systems due to PHP + always selecting until the maximum select timeout. +* Fixed a bug where multipart/form-data POST fields were not correctly + aggregated (e.g., values with "&"). + +## 4.1.6 - 2014-08-03 + +* Added helper methods to make it easier to represent messages as strings, + including getting the start line and getting headers as a string. + +## 4.1.5 - 2014-08-02 + +* Automatically retrying cURL "Connection died, retrying a fresh connect" + errors when possible. +* cURL implementation cleanup +* Allowing multiple event subscriber listeners to be registered per event by + passing an array of arrays of listener configuration. + +## 4.1.4 - 2014-07-22 + +* Fixed a bug that caused multi-part POST requests with more than one field to + serialize incorrectly. +* Paths can now be set to "0" +* `ResponseInterface::xml` now accepts a `libxml_options` option and added a + missing default argument that was required when parsing XML response bodies. +* A `save_to` stream is now created lazily, which means that files are not + created on disk unless a request succeeds. + +## 4.1.3 - 2014-07-15 + +* Various fixes to multipart/form-data POST uploads +* Wrapping function.php in an if-statement to ensure Guzzle can be used + globally and in a Composer install +* Fixed an issue with generating and merging in events to an event array +* POST headers are only applied before sending a request to allow you to change + the query aggregator used before uploading +* Added much more robust query string parsing +* Fixed various parsing and normalization issues with URLs +* Fixing an issue where multi-valued headers were not being utilized correctly + in the StreamAdapter + +## 4.1.2 - 2014-06-18 + +* Added support for sending payloads with GET requests + +## 4.1.1 - 2014-06-08 + +* Fixed an issue related to using custom message factory options in subclasses +* Fixed an issue with nested form fields in a multi-part POST +* Fixed an issue with using the `json` request option for POST requests +* Added `ToArrayInterface` to `GuzzleHttp\Cookie\CookieJar` + +## 4.1.0 - 2014-05-27 + +* Added a `json` request option to easily serialize JSON payloads. +* Added a `GuzzleHttp\json_decode()` wrapper to safely parse JSON. +* Added `setPort()` and `getPort()` to `GuzzleHttp\Message\RequestInterface`. +* Added the ability to provide an emitter to a client in the client constructor. +* Added the ability to persist a cookie session using $_SESSION. +* Added a trait that can be used to add event listeners to an iterator. +* Removed request method constants from RequestInterface. +* Fixed warning when invalid request start-lines are received. +* Updated MessageFactory to work with custom request option methods. +* Updated cacert bundle to latest build. + +4.0.2 (2014-04-16) +------------------ + +* Proxy requests using the StreamAdapter now properly use request_fulluri (#632) +* Added the ability to set scalars as POST fields (#628) + +## 4.0.1 - 2014-04-04 + +* The HTTP status code of a response is now set as the exception code of + RequestException objects. +* 303 redirects will now correctly switch from POST to GET requests. +* The default parallel adapter of a client now correctly uses the MultiAdapter. +* HasDataTrait now initializes the internal data array as an empty array so + that the toArray() method always returns an array. + +## 4.0.0 - 2014-03-29 + +* For information on changes and upgrading, see: + https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 +* Added `GuzzleHttp\batch()` as a convenience function for sending requests in + parallel without needing to write asynchronous code. +* Restructured how events are added to `GuzzleHttp\ClientInterface::sendAll()`. + You can now pass a callable or an array of associative arrays where each + associative array contains the "fn", "priority", and "once" keys. + +## 4.0.0.rc-2 - 2014-03-25 + +* Removed `getConfig()` and `setConfig()` from clients to avoid confusion + around whether things like base_url, message_factory, etc. should be able to + be retrieved or modified. +* Added `getDefaultOption()` and `setDefaultOption()` to ClientInterface +* functions.php functions were renamed using snake_case to match PHP idioms +* Added support for `HTTP_PROXY`, `HTTPS_PROXY`, and + `GUZZLE_CURL_SELECT_TIMEOUT` environment variables +* Added the ability to specify custom `sendAll()` event priorities +* Added the ability to specify custom stream context options to the stream + adapter. +* Added a functions.php function for `get_path()` and `set_path()` +* CurlAdapter and MultiAdapter now use a callable to generate curl resources +* MockAdapter now properly reads a body and emits a `headers` event +* Updated Url class to check if a scheme and host are set before adding ":" + and "//". This allows empty Url (e.g., "") to be serialized as "". +* Parsing invalid XML no longer emits warnings +* Curl classes now properly throw AdapterExceptions +* Various performance optimizations +* Streams are created with the faster `Stream\create()` function +* Marked deprecation_proxy() as internal +* Test server is now a collection of static methods on a class + +## 4.0.0-rc.1 - 2014-03-15 + +* See https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 + +## 3.8.1 - 2014-01-28 + +* Bug: Always using GET requests when redirecting from a 303 response +* Bug: CURLOPT_SSL_VERIFYHOST is now correctly set to false when setting `$certificateAuthority` to false in + `Guzzle\Http\ClientInterface::setSslVerification()` +* Bug: RedirectPlugin now uses strict RFC 3986 compliance when combining a base URL with a relative URL +* Bug: The body of a request can now be set to `"0"` +* Sending PHP stream requests no longer forces `HTTP/1.0` +* Adding more information to ExceptionCollection exceptions so that users have more context, including a stack trace of + each sub-exception +* Updated the `$ref` attribute in service descriptions to merge over any existing parameters of a schema (rather than + clobbering everything). +* Merging URLs will now use the query string object from the relative URL (thus allowing custom query aggregators) +* Query strings are now parsed in a way that they do no convert empty keys with no value to have a dangling `=`. + For example `foo&bar=baz` is now correctly parsed and recognized as `foo&bar=baz` rather than `foo=&bar=baz`. +* Now properly escaping the regular expression delimiter when matching Cookie domains. +* Network access is now disabled when loading XML documents + +## 3.8.0 - 2013-12-05 + +* Added the ability to define a POST name for a file +* JSON response parsing now properly walks additionalProperties +* cURL error code 18 is now retried automatically in the BackoffPlugin +* Fixed a cURL error when URLs contain fragments +* Fixed an issue in the BackoffPlugin retry event where it was trying to access all exceptions as if they were + CurlExceptions +* CURLOPT_PROGRESS function fix for PHP 5.5 (69fcc1e) +* Added the ability for Guzzle to work with older versions of cURL that do not support `CURLOPT_TIMEOUT_MS` +* Fixed a bug that was encountered when parsing empty header parameters +* UriTemplate now has a `setRegex()` method to match the docs +* The `debug` request parameter now checks if it is truthy rather than if it exists +* Setting the `debug` request parameter to true shows verbose cURL output instead of using the LogPlugin +* Added the ability to combine URLs using strict RFC 3986 compliance +* Command objects can now return the validation errors encountered by the command +* Various fixes to cache revalidation (#437 and 29797e5) +* Various fixes to the AsyncPlugin +* Cleaned up build scripts + +## 3.7.4 - 2013-10-02 + +* Bug fix: 0 is now an allowed value in a description parameter that has a default value (#430) +* Bug fix: SchemaFormatter now returns an integer when formatting to a Unix timestamp + (see https://github.com/aws/aws-sdk-php/issues/147) +* Bug fix: Cleaned up and fixed URL dot segment removal to properly resolve internal dots +* Minimum PHP version is now properly specified as 5.3.3 (up from 5.3.2) (#420) +* Updated the bundled cacert.pem (#419) +* OauthPlugin now supports adding authentication to headers or query string (#425) + +## 3.7.3 - 2013-09-08 + +* Added the ability to get the exception associated with a request/command when using `MultiTransferException` and + `CommandTransferException`. +* Setting `additionalParameters` of a response to false is now honored when parsing responses with a service description +* Schemas are only injected into response models when explicitly configured. +* No longer guessing Content-Type based on the path of a request. Content-Type is now only guessed based on the path of + an EntityBody. +* Bug fix: ChunkedIterator can now properly chunk a \Traversable as well as an \Iterator. +* Bug fix: FilterIterator now relies on `\Iterator` instead of `\Traversable`. +* Bug fix: Gracefully handling malformed responses in RequestMediator::writeResponseBody() +* Bug fix: Replaced call to canCache with canCacheRequest in the CallbackCanCacheStrategy of the CachePlugin +* Bug fix: Visiting XML attributes first before visiting XML children when serializing requests +* Bug fix: Properly parsing headers that contain commas contained in quotes +* Bug fix: mimetype guessing based on a filename is now case-insensitive + +## 3.7.2 - 2013-08-02 + +* Bug fix: Properly URL encoding paths when using the PHP-only version of the UriTemplate expander + See https://github.com/guzzle/guzzle/issues/371 +* Bug fix: Cookie domains are now matched correctly according to RFC 6265 + See https://github.com/guzzle/guzzle/issues/377 +* Bug fix: GET parameters are now used when calculating an OAuth signature +* Bug fix: Fixed an issue with cache revalidation where the If-None-Match header was being double quoted +* `Guzzle\Common\AbstractHasDispatcher::dispatch()` now returns the event that was dispatched +* `Guzzle\Http\QueryString::factory()` now guesses the most appropriate query aggregator to used based on the input. + See https://github.com/guzzle/guzzle/issues/379 +* Added a way to add custom domain objects to service description parsing using the `operation.parse_class` event. See + https://github.com/guzzle/guzzle/pull/380 +* cURL multi cleanup and optimizations + +## 3.7.1 - 2013-07-05 + +* Bug fix: Setting default options on a client now works +* Bug fix: Setting options on HEAD requests now works. See #352 +* Bug fix: Moving stream factory before send event to before building the stream. See #353 +* Bug fix: Cookies no longer match on IP addresses per RFC 6265 +* Bug fix: Correctly parsing header parameters that are in `<>` and quotes +* Added `cert` and `ssl_key` as request options +* `Host` header can now diverge from the host part of a URL if the header is set manually +* `Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor` was rewritten to change from using SimpleXML to XMLWriter +* OAuth parameters are only added via the plugin if they aren't already set +* Exceptions are now thrown when a URL cannot be parsed +* Returning `false` if `Guzzle\Http\EntityBody::getContentMd5()` fails +* Not setting a `Content-MD5` on a command if calculating the Content-MD5 fails via the CommandContentMd5Plugin + +## 3.7.0 - 2013-06-10 + +* See UPGRADING.md for more information on how to upgrade. +* Requests now support the ability to specify an array of $options when creating a request to more easily modify a + request. You can pass a 'request.options' configuration setting to a client to apply default request options to + every request created by a client (e.g. default query string variables, headers, curl options, etc.). +* Added a static facade class that allows you to use Guzzle with static methods and mount the class to `\Guzzle`. + See `Guzzle\Http\StaticClient::mount`. +* Added `command.request_options` to `Guzzle\Service\Command\AbstractCommand` to pass request options to requests + created by a command (e.g. custom headers, query string variables, timeout settings, etc.). +* Stream size in `Guzzle\Stream\PhpStreamRequestFactory` will now be set if Content-Length is returned in the + headers of a response +* Added `Guzzle\Common\Collection::setPath($path, $value)` to set a value into an array using a nested key + (e.g. `$collection->setPath('foo/baz/bar', 'test'); echo $collection['foo']['bar']['bar'];`) +* ServiceBuilders now support storing and retrieving arbitrary data +* CachePlugin can now purge all resources for a given URI +* CachePlugin can automatically purge matching cached items when a non-idempotent request is sent to a resource +* CachePlugin now uses the Vary header to determine if a resource is a cache hit +* `Guzzle\Http\Message\Response` now implements `\Serializable` +* Added `Guzzle\Cache\CacheAdapterFactory::fromCache()` to more easily create cache adapters +* `Guzzle\Service\ClientInterface::execute()` now accepts an array, single command, or Traversable +* Fixed a bug in `Guzzle\Http\Message\Header\Link::addLink()` +* Better handling of calculating the size of a stream in `Guzzle\Stream\Stream` using fstat() and caching the size +* `Guzzle\Common\Exception\ExceptionCollection` now creates a more readable exception message +* Fixing BC break: Added back the MonologLogAdapter implementation rather than extending from PsrLog so that older + Symfony users can still use the old version of Monolog. +* Fixing BC break: Added the implementation back in for `Guzzle\Http\Message\AbstractMessage::getTokenizedHeader()`. + Now triggering an E_USER_DEPRECATED warning when used. Use `$message->getHeader()->parseParams()`. +* Several performance improvements to `Guzzle\Common\Collection` +* Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: + createRequest, head, delete, put, patch, post, options, prepareRequest +* Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` +* Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` +* Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to + `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a + resource, string, or EntityBody into the $options parameter to specify the download location of the response. +* Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a + default `array()` +* Added `Guzzle\Stream\StreamInterface::isRepeatable` +* Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use + $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or + $client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))`. +* Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use $client->getConfig()->getPath('request.options/headers')`. +* Removed `Guzzle\Http\ClientInterface::expandTemplate()` +* Removed `Guzzle\Http\ClientInterface::setRequestFactory()` +* Removed `Guzzle\Http\ClientInterface::getCurlMulti()` +* Removed `Guzzle\Http\Message\RequestInterface::canCache` +* Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect` +* Removed `Guzzle\Http\Message\RequestInterface::isRedirect` +* Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. +* You can now enable E_USER_DEPRECATED warnings to see if you are using a deprecated method by setting + `Guzzle\Common\Version::$emitWarnings` to true. +* Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use + `$request->getResponseBody()->isRepeatable()` instead. +* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use + `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use + `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +* Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. +* Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. +* Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated +* Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. + These will work through Guzzle 4.0 +* Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use [request.options][params]. +* Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. +* Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use $client->getConfig()->getPath('request.options/headers')`. +* Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. +* Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. +* Marked `Guzzle\Common\Collection::inject()` as deprecated. +* Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');` +* CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a + CacheStorageInterface. These two objects and interface will be removed in a future version. +* Always setting X-cache headers on cached responses +* Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin +* `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface + $request, Response $response);` +* `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` +* `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` +* Added `CacheStorageInterface::purge($url)` +* `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin + $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, + CanCacheStrategyInterface $canCache = null)` +* Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` + +## 3.6.0 - 2013-05-29 + +* ServiceDescription now implements ToArrayInterface +* Added command.hidden_params to blacklist certain headers from being treated as additionalParameters +* Guzzle can now correctly parse incomplete URLs +* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. +* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution +* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). +* Specific header implementations can be created for complex headers. When a message creates a header, it uses a + HeaderFactory which can map specific headers to specific header classes. There is now a Link header and + CacheControl header implementation. +* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate +* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() +* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in + Guzzle\Http\Curl\RequestMediator +* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. +* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface +* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() +* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() +* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). +* All response header helper functions return a string rather than mixing Header objects and strings inconsistently +* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle + directly via interfaces +* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist + but are a no-op until removed. +* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a + `Guzzle\Service\Command\ArrayCommandInterface`. +* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response + on a request while the request is still being transferred +* The ability to case-insensitively search for header values +* Guzzle\Http\Message\Header::hasExactHeader +* Guzzle\Http\Message\Header::raw. Use getAll() +* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object + instead. +* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess +* Added the ability to cast Model objects to a string to view debug information. + +## 3.5.0 - 2013-05-13 + +* Bug: Fixed a regression so that request responses are parsed only once per oncomplete event rather than multiple times +* Bug: Better cleanup of one-time events across the board (when an event is meant to fire once, it will now remove + itself from the EventDispatcher) +* Bug: `Guzzle\Log\MessageFormatter` now properly writes "total_time" and "connect_time" values +* Bug: Cloning an EntityEnclosingRequest now clones the EntityBody too +* Bug: Fixed an undefined index error when parsing nested JSON responses with a sentAs parameter that reference a + non-existent key +* Bug: All __call() method arguments are now required (helps with mocking frameworks) +* Deprecating Response::getRequest() and now using a shallow clone of a request object to remove a circular reference + to help with refcount based garbage collection of resources created by sending a request +* Deprecating ZF1 cache and log adapters. These will be removed in the next major version. +* Deprecating `Response::getPreviousResponse()` (method signature still exists, but it's deprecated). Use the + HistoryPlugin for a history. +* Added a `responseBody` alias for the `response_body` location +* Refactored internals to no longer rely on Response::getRequest() +* HistoryPlugin can now be cast to a string +* HistoryPlugin now logs transactions rather than requests and responses to more accurately keep track of the requests + and responses that are sent over the wire +* Added `getEffectiveUrl()` and `getRedirectCount()` to Response objects + +## 3.4.3 - 2013-04-30 + +* Bug fix: Fixing bug introduced in 3.4.2 where redirect responses are duplicated on the final redirected response +* Added a check to re-extract the temp cacert bundle from the phar before sending each request + +## 3.4.2 - 2013-04-29 + +* Bug fix: Stream objects now work correctly with "a" and "a+" modes +* Bug fix: Removing `Transfer-Encoding: chunked` header when a Content-Length is present +* Bug fix: AsyncPlugin no longer forces HEAD requests +* Bug fix: DateTime timezones are now properly handled when using the service description schema formatter +* Bug fix: CachePlugin now properly handles stale-if-error directives when a request to the origin server fails +* Setting a response on a request will write to the custom request body from the response body if one is specified +* LogPlugin now writes to php://output when STDERR is undefined +* Added the ability to set multiple POST files for the same key in a single call +* application/x-www-form-urlencoded POSTs now use the utf-8 charset by default +* Added the ability to queue CurlExceptions to the MockPlugin +* Cleaned up how manual responses are queued on requests (removed "queued_response" and now using request.before_send) +* Configuration loading now allows remote files + +## 3.4.1 - 2013-04-16 + +* Large refactoring to how CurlMulti handles work. There is now a proxy that sits in front of a pool of CurlMulti + handles. This greatly simplifies the implementation, fixes a couple bugs, and provides a small performance boost. +* Exceptions are now properly grouped when sending requests in parallel +* Redirects are now properly aggregated when a multi transaction fails +* Redirects now set the response on the original object even in the event of a failure +* Bug fix: Model names are now properly set even when using $refs +* Added support for PHP 5.5's CurlFile to prevent warnings with the deprecated @ syntax +* Added support for oauth_callback in OAuth signatures +* Added support for oauth_verifier in OAuth signatures +* Added support to attempt to retrieve a command first literally, then ucfirst, the with inflection + +## 3.4.0 - 2013-04-11 + +* Bug fix: URLs are now resolved correctly based on https://tools.ietf.org/html/rfc3986#section-5.2. #289 +* Bug fix: Absolute URLs with a path in a service description will now properly override the base URL. #289 +* Bug fix: Parsing a query string with a single PHP array value will now result in an array. #263 +* Bug fix: Better normalization of the User-Agent header to prevent duplicate headers. #264. +* Bug fix: Added `number` type to service descriptions. +* Bug fix: empty parameters are removed from an OAuth signature +* Bug fix: Revalidating a cache entry prefers the Last-Modified over the Date header +* Bug fix: Fixed "array to string" error when validating a union of types in a service description +* Bug fix: Removed code that attempted to determine the size of a stream when data is written to the stream +* Bug fix: Not including an `oauth_token` if the value is null in the OauthPlugin. +* Bug fix: Now correctly aggregating successful requests and failed requests in CurlMulti when a redirect occurs. +* The new default CURLOPT_TIMEOUT setting has been increased to 150 seconds so that Guzzle works on poor connections. +* Added a feature to EntityEnclosingRequest::setBody() that will automatically set the Content-Type of the request if + the Content-Type can be determined based on the entity body or the path of the request. +* Added the ability to overwrite configuration settings in a client when grabbing a throwaway client from a builder. +* Added support for a PSR-3 LogAdapter. +* Added a `command.after_prepare` event +* Added `oauth_callback` parameter to the OauthPlugin +* Added the ability to create a custom stream class when using a stream factory +* Added a CachingEntityBody decorator +* Added support for `additionalParameters` in service descriptions to define how custom parameters are serialized. +* The bundled SSL certificate is now provided in the phar file and extracted when running Guzzle from a phar. +* You can now send any EntityEnclosingRequest with POST fields or POST files and cURL will handle creating bodies +* POST requests using a custom entity body are now treated exactly like PUT requests but with a custom cURL method. This + means that the redirect behavior of POST requests with custom bodies will not be the same as POST requests that use + POST fields or files (the latter is only used when emulating a form POST in the browser). +* Lots of cleanup to CurlHandle::factory and RequestFactory::createRequest + +## 3.3.1 - 2013-03-10 + +* Added the ability to create PHP streaming responses from HTTP requests +* Bug fix: Running any filters when parsing response headers with service descriptions +* Bug fix: OauthPlugin fixes to allow for multi-dimensional array signing, and sorting parameters before signing +* Bug fix: Removed the adding of default empty arrays and false Booleans to responses in order to be consistent across + response location visitors. +* Bug fix: Removed the possibility of creating configuration files with circular dependencies +* RequestFactory::create() now uses the key of a POST file when setting the POST file name +* Added xmlAllowEmpty to serialize an XML body even if no XML specific parameters are set + +## 3.3.0 - 2013-03-03 + +* A large number of performance optimizations have been made +* Bug fix: Added 'wb' as a valid write mode for streams +* Bug fix: `Guzzle\Http\Message\Response::json()` now allows scalar values to be returned +* Bug fix: Fixed bug in `Guzzle\Http\Message\Response` where wrapping quotes were stripped from `getEtag()` +* BC: Removed `Guzzle\Http\Utils` class +* BC: Setting a service description on a client will no longer modify the client's command factories. +* BC: Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using + the 'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' +* BC: `Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getSteamType()` are no longer converted to + lowercase +* Operation parameter objects are now lazy loaded internally +* Added ErrorResponsePlugin that can throw errors for responses defined in service description operations' errorResponses +* Added support for instantiating responseType=class responseClass classes. Classes must implement + `Guzzle\Service\Command\ResponseClassInterface` +* Added support for additionalProperties for top-level parameters in responseType=model responseClasses. These + additional properties also support locations and can be used to parse JSON responses where the outermost part of the + JSON is an array +* Added support for nested renaming of JSON models (rename sentAs to name) +* CachePlugin + * Added support for stale-if-error so that the CachePlugin can now serve stale content from the cache on error + * Debug headers can now added to cached response in the CachePlugin + +## 3.2.0 - 2013-02-14 + +* CurlMulti is no longer reused globally. A new multi object is created per-client. This helps to isolate clients. +* URLs with no path no longer contain a "/" by default +* Guzzle\Http\QueryString does no longer manages the leading "?". This is now handled in Guzzle\Http\Url. +* BadResponseException no longer includes the full request and response message +* Adding setData() to Guzzle\Service\Description\ServiceDescriptionInterface +* Adding getResponseBody() to Guzzle\Http\Message\RequestInterface +* Various updates to classes to use ServiceDescriptionInterface type hints rather than ServiceDescription +* Header values can now be normalized into distinct values when multiple headers are combined with a comma separated list +* xmlEncoding can now be customized for the XML declaration of a XML service description operation +* Guzzle\Http\QueryString now uses Guzzle\Http\QueryAggregator\QueryAggregatorInterface objects to add custom value + aggregation and no longer uses callbacks +* The URL encoding implementation of Guzzle\Http\QueryString can now be customized +* Bug fix: Filters were not always invoked for array service description parameters +* Bug fix: Redirects now use a target response body rather than a temporary response body +* Bug fix: The default exponential backoff BackoffPlugin was not giving when the request threshold was exceeded +* Bug fix: Guzzle now takes the first found value when grabbing Cache-Control directives + +## 3.1.2 - 2013-01-27 + +* Refactored how operation responses are parsed. Visitors now include a before() method responsible for parsing the + response body. For example, the XmlVisitor now parses the XML response into an array in the before() method. +* Fixed an issue where cURL would not automatically decompress responses when the Accept-Encoding header was sent +* CURLOPT_SSL_VERIFYHOST is never set to 1 because it is deprecated (see 5e0ff2ef20f839e19d1eeb298f90ba3598784444) +* Fixed a bug where redirect responses were not chained correctly using getPreviousResponse() +* Setting default headers on a client after setting the user-agent will not erase the user-agent setting + +## 3.1.1 - 2013-01-20 + +* Adding wildcard support to Guzzle\Common\Collection::getPath() +* Adding alias support to ServiceBuilder configs +* Adding Guzzle\Service\Resource\CompositeResourceIteratorFactory and cleaning up factory interface + +## 3.1.0 - 2013-01-12 + +* BC: CurlException now extends from RequestException rather than BadResponseException +* BC: Renamed Guzzle\Plugin\Cache\CanCacheStrategyInterface::canCache() to canCacheRequest() and added CanCacheResponse() +* Added getData to ServiceDescriptionInterface +* Added context array to RequestInterface::setState() +* Bug: Removing hard dependency on the BackoffPlugin from Guzzle\Http +* Bug: Adding required content-type when JSON request visitor adds JSON to a command +* Bug: Fixing the serialization of a service description with custom data +* Made it easier to deal with exceptions thrown when transferring commands or requests in parallel by providing + an array of successful and failed responses +* Moved getPath from Guzzle\Service\Resource\Model to Guzzle\Common\Collection +* Added Guzzle\Http\IoEmittingEntityBody +* Moved command filtration from validators to location visitors +* Added `extends` attributes to service description parameters +* Added getModels to ServiceDescriptionInterface + +## 3.0.7 - 2012-12-19 + +* Fixing phar detection when forcing a cacert to system if null or true +* Allowing filename to be passed to `Guzzle\Http\Message\Request::setResponseBody()` +* Cleaning up `Guzzle\Common\Collection::inject` method +* Adding a response_body location to service descriptions + +## 3.0.6 - 2012-12-09 + +* CurlMulti performance improvements +* Adding setErrorResponses() to Operation +* composer.json tweaks + +## 3.0.5 - 2012-11-18 + +* Bug: Fixing an infinite recursion bug caused from revalidating with the CachePlugin +* Bug: Response body can now be a string containing "0" +* Bug: Using Guzzle inside of a phar uses system by default but now allows for a custom cacert +* Bug: QueryString::fromString now properly parses query string parameters that contain equal signs +* Added support for XML attributes in service description responses +* DefaultRequestSerializer now supports array URI parameter values for URI template expansion +* Added better mimetype guessing to requests and post files + +## 3.0.4 - 2012-11-11 + +* Bug: Fixed a bug when adding multiple cookies to a request to use the correct glue value +* Bug: Cookies can now be added that have a name, domain, or value set to "0" +* Bug: Using the system cacert bundle when using the Phar +* Added json and xml methods to Response to make it easier to parse JSON and XML response data into data structures +* Enhanced cookie jar de-duplication +* Added the ability to enable strict cookie jars that throw exceptions when invalid cookies are added +* Added setStream to StreamInterface to actually make it possible to implement custom rewind behavior for entity bodies +* Added the ability to create any sort of hash for a stream rather than just an MD5 hash + +## 3.0.3 - 2012-11-04 + +* Implementing redirects in PHP rather than cURL +* Added PECL URI template extension and using as default parser if available +* Bug: Fixed Content-Length parsing of Response factory +* Adding rewind() method to entity bodies and streams. Allows for custom rewinding of non-repeatable streams. +* Adding ToArrayInterface throughout library +* Fixing OauthPlugin to create unique nonce values per request + +## 3.0.2 - 2012-10-25 + +* Magic methods are enabled by default on clients +* Magic methods return the result of a command +* Service clients no longer require a base_url option in the factory +* Bug: Fixed an issue with URI templates where null template variables were being expanded + +## 3.0.1 - 2012-10-22 + +* Models can now be used like regular collection objects by calling filter, map, etc. +* Models no longer require a Parameter structure or initial data in the constructor +* Added a custom AppendIterator to get around a PHP bug with the `\AppendIterator` + +## 3.0.0 - 2012-10-15 + +* Rewrote service description format to be based on Swagger + * Now based on JSON schema + * Added nested input structures and nested response models + * Support for JSON and XML input and output models + * Renamed `commands` to `operations` + * Removed dot class notation + * Removed custom types +* Broke the project into smaller top-level namespaces to be more component friendly +* Removed support for XML configs and descriptions. Use arrays or JSON files. +* Removed the Validation component and Inspector +* Moved all cookie code to Guzzle\Plugin\Cookie +* Magic methods on a Guzzle\Service\Client now return the command un-executed. +* Calling getResult() or getResponse() on a command will lazily execute the command if needed. +* Now shipping with cURL's CA certs and using it by default +* Added previousResponse() method to response objects +* No longer sending Accept and Accept-Encoding headers on every request +* Only sending an Expect header by default when a payload is greater than 1MB +* Added/moved client options: + * curl.blacklist to curl.option.blacklist + * Added ssl.certificate_authority +* Added a Guzzle\Iterator component +* Moved plugins from Guzzle\Http\Plugin to Guzzle\Plugin +* Added a more robust backoff retry strategy (replaced the ExponentialBackoffPlugin) +* Added a more robust caching plugin +* Added setBody to response objects +* Updating LogPlugin to use a more flexible MessageFormatter +* Added a completely revamped build process +* Cleaning up Collection class and removing default values from the get method +* Fixed ZF2 cache adapters + +## 2.8.8 - 2012-10-15 + +* Bug: Fixed a cookie issue that caused dot prefixed domains to not match where popular browsers did + +## 2.8.7 - 2012-09-30 + +* Bug: Fixed config file aliases for JSON includes +* Bug: Fixed cookie bug on a request object by using CookieParser to parse cookies on requests +* Bug: Removing the path to a file when sending a Content-Disposition header on a POST upload +* Bug: Hardening request and response parsing to account for missing parts +* Bug: Fixed PEAR packaging +* Bug: Fixed Request::getInfo +* Bug: Fixed cases where CURLM_CALL_MULTI_PERFORM return codes were causing curl transactions to fail +* Adding the ability for the namespace Iterator factory to look in multiple directories +* Added more getters/setters/removers from service descriptions +* Added the ability to remove POST fields from OAuth signatures +* OAuth plugin now supports 2-legged OAuth + +## 2.8.6 - 2012-09-05 + +* Added the ability to modify and build service descriptions +* Added the use of visitors to apply parameters to locations in service descriptions using the dynamic command +* Added a `json` parameter location +* Now allowing dot notation for classes in the CacheAdapterFactory +* Using the union of two arrays rather than an array_merge when extending service builder services and service params +* Ensuring that a service is a string before doing strpos() checks on it when substituting services for references + in service builder config files. +* Services defined in two different config files that include one another will by default replace the previously + defined service, but you can now create services that extend themselves and merge their settings over the previous +* The JsonLoader now supports aliasing filenames with different filenames. This allows you to alias something like + '_default' with a default JSON configuration file. + +## 2.8.5 - 2012-08-29 + +* Bug: Suppressed empty arrays from URI templates +* Bug: Added the missing $options argument from ServiceDescription::factory to enable caching +* Added support for HTTP responses that do not contain a reason phrase in the start-line +* AbstractCommand commands are now invokable +* Added a way to get the data used when signing an Oauth request before a request is sent + +## 2.8.4 - 2012-08-15 + +* Bug: Custom delay time calculations are no longer ignored in the ExponentialBackoffPlugin +* Added the ability to transfer entity bodies as a string rather than streamed. This gets around curl error 65. Set `body_as_string` in a request's curl options to enable. +* Added a StreamInterface, EntityBodyInterface, and added ftell() to Guzzle\Common\Stream +* Added an AbstractEntityBodyDecorator and a ReadLimitEntityBody decorator to transfer only a subset of a decorated stream +* Stream and EntityBody objects will now return the file position to the previous position after a read required operation (e.g. getContentMd5()) +* Added additional response status codes +* Removed SSL information from the default User-Agent header +* DELETE requests can now send an entity body +* Added an EventDispatcher to the ExponentialBackoffPlugin and added an ExponentialBackoffLogger to log backoff retries +* Added the ability of the MockPlugin to consume mocked request bodies +* LogPlugin now exposes request and response objects in the extras array + +## 2.8.3 - 2012-07-30 + +* Bug: Fixed a case where empty POST requests were sent as GET requests +* Bug: Fixed a bug in ExponentialBackoffPlugin that caused fatal errors when retrying an EntityEnclosingRequest that does not have a body +* Bug: Setting the response body of a request to null after completing a request, not when setting the state of a request to new +* Added multiple inheritance to service description commands +* Added an ApiCommandInterface and added `getParamNames()` and `hasParam()` +* Removed the default 2mb size cutoff from the Md5ValidatorPlugin so that it now defaults to validating everything +* Changed CurlMulti::perform to pass a smaller timeout to CurlMulti::executeHandles + +## 2.8.2 - 2012-07-24 + +* Bug: Query string values set to 0 are no longer dropped from the query string +* Bug: A Collection object is no longer created each time a call is made to `Guzzle\Service\Command\AbstractCommand::getRequestHeaders()` +* Bug: `+` is now treated as an encoded space when parsing query strings +* QueryString and Collection performance improvements +* Allowing dot notation for class paths in filters attribute of a service descriptions + +## 2.8.1 - 2012-07-16 + +* Loosening Event Dispatcher dependency +* POST redirects can now be customized using CURLOPT_POSTREDIR + +## 2.8.0 - 2012-07-15 + +* BC: Guzzle\Http\Query + * Query strings with empty variables will always show an equal sign unless the variable is set to QueryString::BLANK (e.g. ?acl= vs ?acl) + * Changed isEncodingValues() and isEncodingFields() to isUrlEncoding() + * Changed setEncodeValues(bool) and setEncodeFields(bool) to useUrlEncoding(bool) + * Changed the aggregation functions of QueryString to be static methods + * Can now use fromString() with querystrings that have a leading ? +* cURL configuration values can be specified in service descriptions using `curl.` prefixed parameters +* Content-Length is set to 0 before emitting the request.before_send event when sending an empty request body +* Cookies are no longer URL decoded by default +* Bug: URI template variables set to null are no longer expanded + +## 2.7.2 - 2012-07-02 + +* BC: Moving things to get ready for subtree splits. Moving Inflection into Common. Moving Guzzle\Http\Parser to Guzzle\Parser. +* BC: Removing Guzzle\Common\Batch\Batch::count() and replacing it with isEmpty() +* CachePlugin now allows for a custom request parameter function to check if a request can be cached +* Bug fix: CachePlugin now only caches GET and HEAD requests by default +* Bug fix: Using header glue when transferring headers over the wire +* Allowing deeply nested arrays for composite variables in URI templates +* Batch divisors can now return iterators or arrays + +## 2.7.1 - 2012-06-26 + +* Minor patch to update version number in UA string +* Updating build process + +## 2.7.0 - 2012-06-25 + +* BC: Inflection classes moved to Guzzle\Inflection. No longer static methods. Can now inject custom inflectors into classes. +* BC: Removed magic setX methods from commands +* BC: Magic methods mapped to service description commands are now inflected in the command factory rather than the client __call() method +* Verbose cURL options are no longer enabled by default. Set curl.debug to true on a client to enable. +* Bug: Now allowing colons in a response start-line (e.g. HTTP/1.1 503 Service Unavailable: Back-end server is at capacity) +* Guzzle\Service\Resource\ResourceIteratorApplyBatched now internally uses the Guzzle\Common\Batch namespace +* Added Guzzle\Service\Plugin namespace and a PluginCollectionPlugin +* Added the ability to set POST fields and files in a service description +* Guzzle\Http\EntityBody::factory() now accepts objects with a __toString() method +* Adding a command.before_prepare event to clients +* Added BatchClosureTransfer and BatchClosureDivisor +* BatchTransferException now includes references to the batch divisor and transfer strategies +* Fixed some tests so that they pass more reliably +* Added Guzzle\Common\Log\ArrayLogAdapter + +## 2.6.6 - 2012-06-10 + +* BC: Removing Guzzle\Http\Plugin\BatchQueuePlugin +* BC: Removing Guzzle\Service\Command\CommandSet +* Adding generic batching system (replaces the batch queue plugin and command set) +* Updating ZF cache and log adapters and now using ZF's composer repository +* Bug: Setting the name of each ApiParam when creating through an ApiCommand +* Adding result_type, result_doc, deprecated, and doc_url to service descriptions +* Bug: Changed the default cookie header casing back to 'Cookie' + +## 2.6.5 - 2012-06-03 + +* BC: Renaming Guzzle\Http\Message\RequestInterface::getResourceUri() to getResource() +* BC: Removing unused AUTH_BASIC and AUTH_DIGEST constants from +* BC: Guzzle\Http\Cookie is now used to manage Set-Cookie data, not Cookie data +* BC: Renaming methods in the CookieJarInterface +* Moving almost all cookie logic out of the CookiePlugin and into the Cookie or CookieJar implementations +* Making the default glue for HTTP headers ';' instead of ',' +* Adding a removeValue to Guzzle\Http\Message\Header +* Adding getCookies() to request interface. +* Making it easier to add event subscribers to HasDispatcherInterface classes. Can now directly call addSubscriber() + +## 2.6.4 - 2012-05-30 + +* BC: Cleaning up how POST files are stored in EntityEnclosingRequest objects. Adding PostFile class. +* BC: Moving ApiCommand specific functionality from the Inspector and on to the ApiCommand +* Bug: Fixing magic method command calls on clients +* Bug: Email constraint only validates strings +* Bug: Aggregate POST fields when POST files are present in curl handle +* Bug: Fixing default User-Agent header +* Bug: Only appending or prepending parameters in commands if they are specified +* Bug: Not requiring response reason phrases or status codes to match a predefined list of codes +* Allowing the use of dot notation for class namespaces when using instance_of constraint +* Added any_match validation constraint +* Added an AsyncPlugin +* Passing request object to the calculateWait method of the ExponentialBackoffPlugin +* Allowing the result of a command object to be changed +* Parsing location and type sub values when instantiating a service description rather than over and over at runtime + +## 2.6.3 - 2012-05-23 + +* [BC] Guzzle\Common\FromConfigInterface no longer requires any config options. +* [BC] Refactoring how POST files are stored on an EntityEnclosingRequest. They are now separate from POST fields. +* You can now use an array of data when creating PUT request bodies in the request factory. +* Removing the requirement that HTTPS requests needed a Cache-Control: public directive to be cacheable. +* [Http] Adding support for Content-Type in multipart POST uploads per upload +* [Http] Added support for uploading multiple files using the same name (foo[0], foo[1]) +* Adding more POST data operations for easier manipulation of POST data. +* You can now set empty POST fields. +* The body of a request is only shown on EntityEnclosingRequest objects that do not use POST files. +* Split the Guzzle\Service\Inspector::validateConfig method into two methods. One to initialize when a command is created, and one to validate. +* CS updates + +## 2.6.2 - 2012-05-19 + +* [Http] Better handling of nested scope requests in CurlMulti. Requests are now always prepares in the send() method rather than the addRequest() method. + +## 2.6.1 - 2012-05-19 + +* [BC] Removing 'path' support in service descriptions. Use 'uri'. +* [BC] Guzzle\Service\Inspector::parseDocBlock is now protected. Adding getApiParamsForClass() with cache. +* [BC] Removing Guzzle\Common\NullObject. Use https://github.com/mtdowling/NullObject if you need it. +* [BC] Removing Guzzle\Common\XmlElement. +* All commands, both dynamic and concrete, have ApiCommand objects. +* Adding a fix for CurlMulti so that if all of the connections encounter some sort of curl error, then the loop exits. +* Adding checks to EntityEnclosingRequest so that empty POST files and fields are ignored. +* Making the method signature of Guzzle\Service\Builder\ServiceBuilder::factory more flexible. + +## 2.6.0 - 2012-05-15 + +* [BC] Moving Guzzle\Service\Builder to Guzzle\Service\Builder\ServiceBuilder +* [BC] Executing a Command returns the result of the command rather than the command +* [BC] Moving all HTTP parsing logic to Guzzle\Http\Parsers. Allows for faster C implementations if needed. +* [BC] Changing the Guzzle\Http\Message\Response::setProtocol() method to accept a protocol and version in separate args. +* [BC] Moving ResourceIterator* to Guzzle\Service\Resource +* [BC] Completely refactored ResourceIterators to iterate over a cloned command object +* [BC] Moved Guzzle\Http\UriTemplate to Guzzle\Http\Parser\UriTemplate\UriTemplate +* [BC] Guzzle\Guzzle is now deprecated +* Moving Guzzle\Common\Guzzle::inject to Guzzle\Common\Collection::inject +* Adding Guzzle\Version class to give version information about Guzzle +* Adding Guzzle\Http\Utils class to provide getDefaultUserAgent() and getHttpDate() +* Adding Guzzle\Curl\CurlVersion to manage caching curl_version() data +* ServiceDescription and ServiceBuilder are now cacheable using similar configs +* Changing the format of XML and JSON service builder configs. Backwards compatible. +* Cleaned up Cookie parsing +* Trimming the default Guzzle User-Agent header +* Adding a setOnComplete() method to Commands that is called when a command completes +* Keeping track of requests that were mocked in the MockPlugin +* Fixed a caching bug in the CacheAdapterFactory +* Inspector objects can be injected into a Command object +* Refactoring a lot of code and tests to be case insensitive when dealing with headers +* Adding Guzzle\Http\Message\HeaderComparison for easy comparison of HTTP headers using a DSL +* Adding the ability to set global option overrides to service builder configs +* Adding the ability to include other service builder config files from within XML and JSON files +* Moving the parseQuery method out of Url and on to QueryString::fromString() as a static factory method. + +## 2.5.0 - 2012-05-08 + +* Major performance improvements +* [BC] Simplifying Guzzle\Common\Collection. Please check to see if you are using features that are now deprecated. +* [BC] Using a custom validation system that allows a flyweight implementation for much faster validation. No longer using Symfony2 Validation component. +* [BC] No longer supporting "{{ }}" for injecting into command or UriTemplates. Use "{}" +* Added the ability to passed parameters to all requests created by a client +* Added callback functionality to the ExponentialBackoffPlugin +* Using microtime in ExponentialBackoffPlugin to allow more granular backoff strategies. +* Rewinding request stream bodies when retrying requests +* Exception is thrown when JSON response body cannot be decoded +* Added configurable magic method calls to clients and commands. This is off by default. +* Fixed a defect that added a hash to every parsed URL part +* Fixed duplicate none generation for OauthPlugin. +* Emitting an event each time a client is generated by a ServiceBuilder +* Using an ApiParams object instead of a Collection for parameters of an ApiCommand +* cache.* request parameters should be renamed to params.cache.* +* Added the ability to set arbitrary curl options on requests (disable_wire, progress, etc.). See CurlHandle. +* Added the ability to disable type validation of service descriptions +* ServiceDescriptions and ServiceBuilders are now Serializable diff --git a/vendor/guzzlehttp/guzzle/LICENSE b/vendor/guzzlehttp/guzzle/LICENSE new file mode 100644 index 000000000..fd2375d88 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/LICENSE @@ -0,0 +1,27 @@ +The MIT License (MIT) + +Copyright (c) 2011 Michael Dowling +Copyright (c) 2012 Jeremy Lindblom +Copyright (c) 2014 Graham Campbell +Copyright (c) 2015 Márk Sági-Kazár +Copyright (c) 2015 Tobias Schultze +Copyright (c) 2016 Tobias Nyholm +Copyright (c) 2016 George Mponos + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/guzzlehttp/guzzle/README.md b/vendor/guzzlehttp/guzzle/README.md new file mode 100644 index 000000000..0786462b3 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/README.md @@ -0,0 +1,94 @@ +![Guzzle](.github/logo.png?raw=true) + +# Guzzle, PHP HTTP client + +[![Latest Version](https://img.shields.io/github/release/guzzle/guzzle.svg?style=flat-square)](https://github.com/guzzle/guzzle/releases) +[![Build Status](https://img.shields.io/github/workflow/status/guzzle/guzzle/CI?label=ci%20build&style=flat-square)](https://github.com/guzzle/guzzle/actions?query=workflow%3ACI) +[![Total Downloads](https://img.shields.io/packagist/dt/guzzlehttp/guzzle.svg?style=flat-square)](https://packagist.org/packages/guzzlehttp/guzzle) + +Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and +trivial to integrate with web services. + +- Simple interface for building query strings, POST requests, streaming large + uploads, streaming large downloads, using HTTP cookies, uploading JSON data, + etc... +- Can send both synchronous and asynchronous requests using the same interface. +- Uses PSR-7 interfaces for requests, responses, and streams. This allows you + to utilize other PSR-7 compatible libraries with Guzzle. +- Supports PSR-18 allowing interoperability between other PSR-18 HTTP Clients. +- Abstracts away the underlying HTTP transport, allowing you to write + environment and transport agnostic code; i.e., no hard dependency on cURL, + PHP streams, sockets, or non-blocking event loops. +- Middleware system allows you to augment and compose client behavior. + +```php +$client = new \GuzzleHttp\Client(); +$response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle'); + +echo $response->getStatusCode(); // 200 +echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8' +echo $response->getBody(); // '{"id": 1420053, "name": "guzzle", ...}' + +// Send an asynchronous request. +$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org'); +$promise = $client->sendAsync($request)->then(function ($response) { + echo 'I completed! ' . $response->getBody(); +}); + +$promise->wait(); +``` + +## Help and docs + +We use GitHub issues only to discuss bugs and new features. For support please refer to: + +- [Documentation](https://docs.guzzlephp.org) +- [Stack Overflow](https://stackoverflow.com/questions/tagged/guzzle) +- [#guzzle](https://app.slack.com/client/T0D2S9JCT/CE6UAAKL4) channel on [PHP-HTTP Slack](https://slack.httplug.io/) +- [Gitter](https://gitter.im/guzzle/guzzle) + + +## Installing Guzzle + +The recommended way to install Guzzle is through +[Composer](https://getcomposer.org/). + +```bash +composer require guzzlehttp/guzzle +``` + + +## Version Guidance + +| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version | +|---------|---------------------|---------------------|--------------|---------------------|---------------------|-------|--------------| +| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >=5.3.3,<7.0 | +| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >=5.4,<7.0 | +| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >=5.4,<7.4 | +| 6.x | Security fixes only | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >=5.5,<8.0 | +| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >=7.2.5,<8.3 | + +[guzzle-3-repo]: https://github.com/guzzle/guzzle3 +[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x +[guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3 +[guzzle-6-repo]: https://github.com/guzzle/guzzle/tree/6.5 +[guzzle-7-repo]: https://github.com/guzzle/guzzle +[guzzle-3-docs]: https://guzzle3.readthedocs.io/ +[guzzle-5-docs]: https://docs.guzzlephp.org/en/5.3/ +[guzzle-6-docs]: https://docs.guzzlephp.org/en/6.5/ +[guzzle-7-docs]: https://docs.guzzlephp.org/en/latest/ + + +## Security + +If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/guzzle/security/policy) for more information. + +## License + +Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. + +## For Enterprise + +Available as part of the Tidelift Subscription + +The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-guzzle?utm_source=packagist-guzzlehttp-guzzle&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/vendor/guzzlehttp/guzzle/UPGRADING.md b/vendor/guzzlehttp/guzzle/UPGRADING.md new file mode 100644 index 000000000..8fa0afb5d --- /dev/null +++ b/vendor/guzzlehttp/guzzle/UPGRADING.md @@ -0,0 +1,1253 @@ +Guzzle Upgrade Guide +==================== + +6.0 to 7.0 +---------- + +In order to take advantage of the new features of PHP, Guzzle dropped the support +of PHP 5. The minimum supported PHP version is now PHP 7.2. Type hints and return +types for functions and methods have been added wherever possible. + +Please make sure: +- You are calling a function or a method with the correct type. +- If you extend a class of Guzzle; update all signatures on methods you override. + +#### Other backwards compatibility breaking changes + +- Class `GuzzleHttp\UriTemplate` is removed. +- Class `GuzzleHttp\Exception\SeekException` is removed. +- Classes `GuzzleHttp\Exception\BadResponseException`, `GuzzleHttp\Exception\ClientException`, + `GuzzleHttp\Exception\ServerException` can no longer be initialized with an empty + Response as argument. +- Class `GuzzleHttp\Exception\ConnectException` now extends `GuzzleHttp\Exception\TransferException` + instead of `GuzzleHttp\Exception\RequestException`. +- Function `GuzzleHttp\Exception\ConnectException::getResponse()` is removed. +- Function `GuzzleHttp\Exception\ConnectException::hasResponse()` is removed. +- Constant `GuzzleHttp\ClientInterface::VERSION` is removed. Added `GuzzleHttp\ClientInterface::MAJOR_VERSION` instead. +- Function `GuzzleHttp\Exception\RequestException::getResponseBodySummary` is removed. + Use `\GuzzleHttp\Psr7\get_message_body_summary` as an alternative. +- Function `GuzzleHttp\Cookie\CookieJar::getCookieValue` is removed. +- Request option `exceptions` is removed. Please use `http_errors`. +- Request option `save_to` is removed. Please use `sink`. +- Pool option `pool_size` is removed. Please use `concurrency`. +- We now look for environment variables in the `$_SERVER` super global, due to thread safety issues with `getenv`. We continue to fallback to `getenv` in CLI environments, for maximum compatibility. +- The `get`, `head`, `put`, `post`, `patch`, `delete`, `getAsync`, `headAsync`, `putAsync`, `postAsync`, `patchAsync`, and `deleteAsync` methods are now implemented as genuine methods on `GuzzleHttp\Client`, with strong typing. The original `__call` implementation remains unchanged for now, for maximum backwards compatibility, but won't be invoked under normal operation. +- The `log` middleware will log the errors with level `error` instead of `notice` +- Support for international domain names (IDN) is now disabled by default, and enabling it requires installing ext-intl, linked against a modern version of the C library (ICU 4.6 or higher). + +#### Native functions calls + +All internal native functions calls of Guzzle are now prefixed with a slash. This +change makes it impossible for method overloading by other libraries or applications. +Example: + +```php +// Before: +curl_version(); + +// After: +\curl_version(); +``` + +For the full diff you can check [here](https://github.com/guzzle/guzzle/compare/6.5.4..master). + +5.0 to 6.0 +---------- + +Guzzle now uses [PSR-7](https://www.php-fig.org/psr/psr-7/) for HTTP messages. +Due to the fact that these messages are immutable, this prompted a refactoring +of Guzzle to use a middleware based system rather than an event system. Any +HTTP message interaction (e.g., `GuzzleHttp\Message\Request`) need to be +updated to work with the new immutable PSR-7 request and response objects. Any +event listeners or subscribers need to be updated to become middleware +functions that wrap handlers (or are injected into a +`GuzzleHttp\HandlerStack`). + +- Removed `GuzzleHttp\BatchResults` +- Removed `GuzzleHttp\Collection` +- Removed `GuzzleHttp\HasDataTrait` +- Removed `GuzzleHttp\ToArrayInterface` +- The `guzzlehttp/streams` dependency has been removed. Stream functionality + is now present in the `GuzzleHttp\Psr7` namespace provided by the + `guzzlehttp/psr7` package. +- Guzzle no longer uses ReactPHP promises and now uses the + `guzzlehttp/promises` library. We use a custom promise library for three + significant reasons: + 1. React promises (at the time of writing this) are recursive. Promise + chaining and promise resolution will eventually blow the stack. Guzzle + promises are not recursive as they use a sort of trampolining technique. + Note: there has been movement in the React project to modify promises to + no longer utilize recursion. + 2. Guzzle needs to have the ability to synchronously block on a promise to + wait for a result. Guzzle promises allows this functionality (and does + not require the use of recursion). + 3. Because we need to be able to wait on a result, doing so using React + promises requires wrapping react promises with RingPHP futures. This + overhead is no longer needed, reducing stack sizes, reducing complexity, + and improving performance. +- `GuzzleHttp\Mimetypes` has been moved to a function in + `GuzzleHttp\Psr7\mimetype_from_extension` and + `GuzzleHttp\Psr7\mimetype_from_filename`. +- `GuzzleHttp\Query` and `GuzzleHttp\QueryParser` have been removed. Query + strings must now be passed into request objects as strings, or provided to + the `query` request option when creating requests with clients. The `query` + option uses PHP's `http_build_query` to convert an array to a string. If you + need a different serialization technique, you will need to pass the query + string in as a string. There are a couple helper functions that will make + working with query strings easier: `GuzzleHttp\Psr7\parse_query` and + `GuzzleHttp\Psr7\build_query`. +- Guzzle no longer has a dependency on RingPHP. Due to the use of a middleware + system based on PSR-7, using RingPHP and it's middleware system as well adds + more complexity than the benefits it provides. All HTTP handlers that were + present in RingPHP have been modified to work directly with PSR-7 messages + and placed in the `GuzzleHttp\Handler` namespace. This significantly reduces + complexity in Guzzle, removes a dependency, and improves performance. RingPHP + will be maintained for Guzzle 5 support, but will no longer be a part of + Guzzle 6. +- As Guzzle now uses a middleware based systems the event system and RingPHP + integration has been removed. Note: while the event system has been removed, + it is possible to add your own type of event system that is powered by the + middleware system. + - Removed the `Event` namespace. + - Removed the `Subscriber` namespace. + - Removed `Transaction` class + - Removed `RequestFsm` + - Removed `RingBridge` + - `GuzzleHttp\Subscriber\Cookie` is now provided by + `GuzzleHttp\Middleware::cookies` + - `GuzzleHttp\Subscriber\HttpError` is now provided by + `GuzzleHttp\Middleware::httpError` + - `GuzzleHttp\Subscriber\History` is now provided by + `GuzzleHttp\Middleware::history` + - `GuzzleHttp\Subscriber\Mock` is now provided by + `GuzzleHttp\Handler\MockHandler` + - `GuzzleHttp\Subscriber\Prepare` is now provided by + `GuzzleHttp\PrepareBodyMiddleware` + - `GuzzleHttp\Subscriber\Redirect` is now provided by + `GuzzleHttp\RedirectMiddleware` +- Guzzle now uses `Psr\Http\Message\UriInterface` (implements in + `GuzzleHttp\Psr7\Uri`) for URI support. `GuzzleHttp\Url` is now gone. +- Static functions in `GuzzleHttp\Utils` have been moved to namespaced + functions under the `GuzzleHttp` namespace. This requires either a Composer + based autoloader or you to include functions.php. +- `GuzzleHttp\ClientInterface::getDefaultOption` has been renamed to + `GuzzleHttp\ClientInterface::getConfig`. +- `GuzzleHttp\ClientInterface::setDefaultOption` has been removed. +- The `json` and `xml` methods of response objects has been removed. With the + migration to strictly adhering to PSR-7 as the interface for Guzzle messages, + adding methods to message interfaces would actually require Guzzle messages + to extend from PSR-7 messages rather then work with them directly. + +## Migrating to middleware + +The change to PSR-7 unfortunately required significant refactoring to Guzzle +due to the fact that PSR-7 messages are immutable. Guzzle 5 relied on an event +system from plugins. The event system relied on mutability of HTTP messages and +side effects in order to work. With immutable messages, you have to change your +workflow to become more about either returning a value (e.g., functional +middlewares) or setting a value on an object. Guzzle v6 has chosen the +functional middleware approach. + +Instead of using the event system to listen for things like the `before` event, +you now create a stack based middleware function that intercepts a request on +the way in and the promise of the response on the way out. This is a much +simpler and more predictable approach than the event system and works nicely +with PSR-7 middleware. Due to the use of promises, the middleware system is +also asynchronous. + +v5: + +```php +use GuzzleHttp\Event\BeforeEvent; +$client = new GuzzleHttp\Client(); +// Get the emitter and listen to the before event. +$client->getEmitter()->on('before', function (BeforeEvent $e) { + // Guzzle v5 events relied on mutation + $e->getRequest()->setHeader('X-Foo', 'Bar'); +}); +``` + +v6: + +In v6, you can modify the request before it is sent using the `mapRequest` +middleware. The idiomatic way in v6 to modify the request/response lifecycle is +to setup a handler middleware stack up front and inject the handler into a +client. + +```php +use GuzzleHttp\Middleware; +// Create a handler stack that has all of the default middlewares attached +$handler = GuzzleHttp\HandlerStack::create(); +// Push the handler onto the handler stack +$handler->push(Middleware::mapRequest(function (RequestInterface $request) { + // Notice that we have to return a request object + return $request->withHeader('X-Foo', 'Bar'); +})); +// Inject the handler into the client +$client = new GuzzleHttp\Client(['handler' => $handler]); +``` + +## POST Requests + +This version added the [`form_params`](http://guzzle.readthedocs.org/en/latest/request-options.html#form_params) +and `multipart` request options. `form_params` is an associative array of +strings or array of strings and is used to serialize an +`application/x-www-form-urlencoded` POST request. The +[`multipart`](http://guzzle.readthedocs.org/en/latest/request-options.html#multipart) +option is now used to send a multipart/form-data POST request. + +`GuzzleHttp\Post\PostFile` has been removed. Use the `multipart` option to add +POST files to a multipart/form-data request. + +The `body` option no longer accepts an array to send POST requests. Please use +`multipart` or `form_params` instead. + +The `base_url` option has been renamed to `base_uri`. + +4.x to 5.0 +---------- + +## Rewritten Adapter Layer + +Guzzle now uses [RingPHP](http://ringphp.readthedocs.org/en/latest) to send +HTTP requests. The `adapter` option in a `GuzzleHttp\Client` constructor +is still supported, but it has now been renamed to `handler`. Instead of +passing a `GuzzleHttp\Adapter\AdapterInterface`, you must now pass a PHP +`callable` that follows the RingPHP specification. + +## Removed Fluent Interfaces + +[Fluent interfaces were removed](https://ocramius.github.io/blog/fluent-interfaces-are-evil/) +from the following classes: + +- `GuzzleHttp\Collection` +- `GuzzleHttp\Url` +- `GuzzleHttp\Query` +- `GuzzleHttp\Post\PostBody` +- `GuzzleHttp\Cookie\SetCookie` + +## Removed functions.php + +Removed "functions.php", so that Guzzle is truly PSR-4 compliant. The following +functions can be used as replacements. + +- `GuzzleHttp\json_decode` -> `GuzzleHttp\Utils::jsonDecode` +- `GuzzleHttp\get_path` -> `GuzzleHttp\Utils::getPath` +- `GuzzleHttp\Utils::setPath` -> `GuzzleHttp\set_path` +- `GuzzleHttp\Pool::batch` -> `GuzzleHttp\batch`. This function is, however, + deprecated in favor of using `GuzzleHttp\Pool::batch()`. + +The "procedural" global client has been removed with no replacement (e.g., +`GuzzleHttp\get()`, `GuzzleHttp\post()`, etc.). Use a `GuzzleHttp\Client` +object as a replacement. + +## `throwImmediately` has been removed + +The concept of "throwImmediately" has been removed from exceptions and error +events. This control mechanism was used to stop a transfer of concurrent +requests from completing. This can now be handled by throwing the exception or +by cancelling a pool of requests or each outstanding future request +individually. + +## headers event has been removed + +Removed the "headers" event. This event was only useful for changing the +body a response once the headers of the response were known. You can implement +a similar behavior in a number of ways. One example might be to use a +FnStream that has access to the transaction being sent. For example, when the +first byte is written, you could check if the response headers match your +expectations, and if so, change the actual stream body that is being +written to. + +## Updates to HTTP Messages + +Removed the `asArray` parameter from +`GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header +value as an array, then use the newly added `getHeaderAsArray()` method of +`MessageInterface`. This change makes the Guzzle interfaces compatible with +the PSR-7 interfaces. + +3.x to 4.0 +---------- + +## Overarching changes: + +- Now requires PHP 5.4 or greater. +- No longer requires cURL to send requests. +- Guzzle no longer wraps every exception it throws. Only exceptions that are + recoverable are now wrapped by Guzzle. +- Various namespaces have been removed or renamed. +- No longer requiring the Symfony EventDispatcher. A custom event dispatcher + based on the Symfony EventDispatcher is + now utilized in `GuzzleHttp\Event\EmitterInterface` (resulting in significant + speed and functionality improvements). + +Changes per Guzzle 3.x namespace are described below. + +## Batch + +The `Guzzle\Batch` namespace has been removed. This is best left to +third-parties to implement on top of Guzzle's core HTTP library. + +## Cache + +The `Guzzle\Cache` namespace has been removed. (Todo: No suitable replacement +has been implemented yet, but hoping to utilize a PSR cache interface). + +## Common + +- Removed all of the wrapped exceptions. It's better to use the standard PHP + library for unrecoverable exceptions. +- `FromConfigInterface` has been removed. +- `Guzzle\Common\Version` has been removed. The VERSION constant can be found + at `GuzzleHttp\ClientInterface::VERSION`. + +### Collection + +- `getAll` has been removed. Use `toArray` to convert a collection to an array. +- `inject` has been removed. +- `keySearch` has been removed. +- `getPath` no longer supports wildcard expressions. Use something better like + JMESPath for this. +- `setPath` now supports appending to an existing array via the `[]` notation. + +### Events + +Guzzle no longer requires Symfony's EventDispatcher component. Guzzle now uses +`GuzzleHttp\Event\Emitter`. + +- `Symfony\Component\EventDispatcher\EventDispatcherInterface` is replaced by + `GuzzleHttp\Event\EmitterInterface`. +- `Symfony\Component\EventDispatcher\EventDispatcher` is replaced by + `GuzzleHttp\Event\Emitter`. +- `Symfony\Component\EventDispatcher\Event` is replaced by + `GuzzleHttp\Event\Event`, and Guzzle now has an EventInterface in + `GuzzleHttp\Event\EventInterface`. +- `AbstractHasDispatcher` has moved to a trait, `HasEmitterTrait`, and + `HasDispatcherInterface` has moved to `HasEmitterInterface`. Retrieving the + event emitter of a request, client, etc. now uses the `getEmitter` method + rather than the `getDispatcher` method. + +#### Emitter + +- Use the `once()` method to add a listener that automatically removes itself + the first time it is invoked. +- Use the `listeners()` method to retrieve a list of event listeners rather than + the `getListeners()` method. +- Use `emit()` instead of `dispatch()` to emit an event from an emitter. +- Use `attach()` instead of `addSubscriber()` and `detach()` instead of + `removeSubscriber()`. + +```php +$mock = new Mock(); +// 3.x +$request->getEventDispatcher()->addSubscriber($mock); +$request->getEventDispatcher()->removeSubscriber($mock); +// 4.x +$request->getEmitter()->attach($mock); +$request->getEmitter()->detach($mock); +``` + +Use the `on()` method to add a listener rather than the `addListener()` method. + +```php +// 3.x +$request->getEventDispatcher()->addListener('foo', function (Event $event) { /* ... */ } ); +// 4.x +$request->getEmitter()->on('foo', function (Event $event, $name) { /* ... */ } ); +``` + +## Http + +### General changes + +- The cacert.pem certificate has been moved to `src/cacert.pem`. +- Added the concept of adapters that are used to transfer requests over the + wire. +- Simplified the event system. +- Sending requests in parallel is still possible, but batching is no longer a + concept of the HTTP layer. Instead, you must use the `complete` and `error` + events to asynchronously manage parallel request transfers. +- `Guzzle\Http\Url` has moved to `GuzzleHttp\Url`. +- `Guzzle\Http\QueryString` has moved to `GuzzleHttp\Query`. +- QueryAggregators have been rewritten so that they are simply callable + functions. +- `GuzzleHttp\StaticClient` has been removed. Use the functions provided in + `functions.php` for an easy to use static client instance. +- Exceptions in `GuzzleHttp\Exception` have been updated to all extend from + `GuzzleHttp\Exception\TransferException`. + +### Client + +Calling methods like `get()`, `post()`, `head()`, etc. no longer create and +return a request, but rather creates a request, sends the request, and returns +the response. + +```php +// 3.0 +$request = $client->get('/'); +$response = $request->send(); + +// 4.0 +$response = $client->get('/'); + +// or, to mirror the previous behavior +$request = $client->createRequest('GET', '/'); +$response = $client->send($request); +``` + +`GuzzleHttp\ClientInterface` has changed. + +- The `send` method no longer accepts more than one request. Use `sendAll` to + send multiple requests in parallel. +- `setUserAgent()` has been removed. Use a default request option instead. You + could, for example, do something like: + `$client->setConfig('defaults/headers/User-Agent', 'Foo/Bar ' . $client::getDefaultUserAgent())`. +- `setSslVerification()` has been removed. Use default request options instead, + like `$client->setConfig('defaults/verify', true)`. + +`GuzzleHttp\Client` has changed. + +- The constructor now accepts only an associative array. You can include a + `base_url` string or array to use a URI template as the base URL of a client. + You can also specify a `defaults` key that is an associative array of default + request options. You can pass an `adapter` to use a custom adapter, + `batch_adapter` to use a custom adapter for sending requests in parallel, or + a `message_factory` to change the factory used to create HTTP requests and + responses. +- The client no longer emits a `client.create_request` event. +- Creating requests with a client no longer automatically utilize a URI + template. You must pass an array into a creational method (e.g., + `createRequest`, `get`, `put`, etc.) in order to expand a URI template. + +### Messages + +Messages no longer have references to their counterparts (i.e., a request no +longer has a reference to it's response, and a response no loger has a +reference to its request). This association is now managed through a +`GuzzleHttp\Adapter\TransactionInterface` object. You can get references to +these transaction objects using request events that are emitted over the +lifecycle of a request. + +#### Requests with a body + +- `GuzzleHttp\Message\EntityEnclosingRequest` and + `GuzzleHttp\Message\EntityEnclosingRequestInterface` have been removed. The + separation between requests that contain a body and requests that do not + contain a body has been removed, and now `GuzzleHttp\Message\RequestInterface` + handles both use cases. +- Any method that previously accepts a `GuzzleHttp\Response` object now accept a + `GuzzleHttp\Message\ResponseInterface`. +- `GuzzleHttp\Message\RequestFactoryInterface` has been renamed to + `GuzzleHttp\Message\MessageFactoryInterface`. This interface is used to create + both requests and responses and is implemented in + `GuzzleHttp\Message\MessageFactory`. +- POST field and file methods have been removed from the request object. You + must now use the methods made available to `GuzzleHttp\Post\PostBodyInterface` + to control the format of a POST body. Requests that are created using a + standard `GuzzleHttp\Message\MessageFactoryInterface` will automatically use + a `GuzzleHttp\Post\PostBody` body if the body was passed as an array or if + the method is POST and no body is provided. + +```php +$request = $client->createRequest('POST', '/'); +$request->getBody()->setField('foo', 'bar'); +$request->getBody()->addFile(new PostFile('file_key', fopen('/path/to/content', 'r'))); +``` + +#### Headers + +- `GuzzleHttp\Message\Header` has been removed. Header values are now simply + represented by an array of values or as a string. Header values are returned + as a string by default when retrieving a header value from a message. You can + pass an optional argument of `true` to retrieve a header value as an array + of strings instead of a single concatenated string. +- `GuzzleHttp\PostFile` and `GuzzleHttp\PostFileInterface` have been moved to + `GuzzleHttp\Post`. This interface has been simplified and now allows the + addition of arbitrary headers. +- Custom headers like `GuzzleHttp\Message\Header\Link` have been removed. Most + of the custom headers are now handled separately in specific + subscribers/plugins, and `GuzzleHttp\Message\HeaderValues::parseParams()` has + been updated to properly handle headers that contain parameters (like the + `Link` header). + +#### Responses + +- `GuzzleHttp\Message\Response::getInfo()` and + `GuzzleHttp\Message\Response::setInfo()` have been removed. Use the event + system to retrieve this type of information. +- `GuzzleHttp\Message\Response::getRawHeaders()` has been removed. +- `GuzzleHttp\Message\Response::getMessage()` has been removed. +- `GuzzleHttp\Message\Response::calculateAge()` and other cache specific + methods have moved to the CacheSubscriber. +- Header specific helper functions like `getContentMd5()` have been removed. + Just use `getHeader('Content-MD5')` instead. +- `GuzzleHttp\Message\Response::setRequest()` and + `GuzzleHttp\Message\Response::getRequest()` have been removed. Use the event + system to work with request and response objects as a transaction. +- `GuzzleHttp\Message\Response::getRedirectCount()` has been removed. Use the + Redirect subscriber instead. +- `GuzzleHttp\Message\Response::isSuccessful()` and other related methods have + been removed. Use `getStatusCode()` instead. + +#### Streaming responses + +Streaming requests can now be created by a client directly, returning a +`GuzzleHttp\Message\ResponseInterface` object that contains a body stream +referencing an open PHP HTTP stream. + +```php +// 3.0 +use Guzzle\Stream\PhpStreamRequestFactory; +$request = $client->get('/'); +$factory = new PhpStreamRequestFactory(); +$stream = $factory->fromRequest($request); +$data = $stream->read(1024); + +// 4.0 +$response = $client->get('/', ['stream' => true]); +// Read some data off of the stream in the response body +$data = $response->getBody()->read(1024); +``` + +#### Redirects + +The `configureRedirects()` method has been removed in favor of a +`allow_redirects` request option. + +```php +// Standard redirects with a default of a max of 5 redirects +$request = $client->createRequest('GET', '/', ['allow_redirects' => true]); + +// Strict redirects with a custom number of redirects +$request = $client->createRequest('GET', '/', [ + 'allow_redirects' => ['max' => 5, 'strict' => true] +]); +``` + +#### EntityBody + +EntityBody interfaces and classes have been removed or moved to +`GuzzleHttp\Stream`. All classes and interfaces that once required +`GuzzleHttp\EntityBodyInterface` now require +`GuzzleHttp\Stream\StreamInterface`. Creating a new body for a request no +longer uses `GuzzleHttp\EntityBody::factory` but now uses +`GuzzleHttp\Stream\Stream::factory` or even better: +`GuzzleHttp\Stream\create()`. + +- `Guzzle\Http\EntityBodyInterface` is now `GuzzleHttp\Stream\StreamInterface` +- `Guzzle\Http\EntityBody` is now `GuzzleHttp\Stream\Stream` +- `Guzzle\Http\CachingEntityBody` is now `GuzzleHttp\Stream\CachingStream` +- `Guzzle\Http\ReadLimitEntityBody` is now `GuzzleHttp\Stream\LimitStream` +- `Guzzle\Http\IoEmittyinEntityBody` has been removed. + +#### Request lifecycle events + +Requests previously submitted a large number of requests. The number of events +emitted over the lifecycle of a request has been significantly reduced to make +it easier to understand how to extend the behavior of a request. All events +emitted during the lifecycle of a request now emit a custom +`GuzzleHttp\Event\EventInterface` object that contains context providing +methods and a way in which to modify the transaction at that specific point in +time (e.g., intercept the request and set a response on the transaction). + +- `request.before_send` has been renamed to `before` and now emits a + `GuzzleHttp\Event\BeforeEvent` +- `request.complete` has been renamed to `complete` and now emits a + `GuzzleHttp\Event\CompleteEvent`. +- `request.sent` has been removed. Use `complete`. +- `request.success` has been removed. Use `complete`. +- `error` is now an event that emits a `GuzzleHttp\Event\ErrorEvent`. +- `request.exception` has been removed. Use `error`. +- `request.receive.status_line` has been removed. +- `curl.callback.progress` has been removed. Use a custom `StreamInterface` to + maintain a status update. +- `curl.callback.write` has been removed. Use a custom `StreamInterface` to + intercept writes. +- `curl.callback.read` has been removed. Use a custom `StreamInterface` to + intercept reads. + +`headers` is a new event that is emitted after the response headers of a +request have been received before the body of the response is downloaded. This +event emits a `GuzzleHttp\Event\HeadersEvent`. + +You can intercept a request and inject a response using the `intercept()` event +of a `GuzzleHttp\Event\BeforeEvent`, `GuzzleHttp\Event\CompleteEvent`, and +`GuzzleHttp\Event\ErrorEvent` event. + +See: http://docs.guzzlephp.org/en/latest/events.html + +## Inflection + +The `Guzzle\Inflection` namespace has been removed. This is not a core concern +of Guzzle. + +## Iterator + +The `Guzzle\Iterator` namespace has been removed. + +- `Guzzle\Iterator\AppendIterator`, `Guzzle\Iterator\ChunkedIterator`, and + `Guzzle\Iterator\MethodProxyIterator` are nice, but not a core requirement of + Guzzle itself. +- `Guzzle\Iterator\FilterIterator` is no longer needed because an equivalent + class is shipped with PHP 5.4. +- `Guzzle\Iterator\MapIterator` is not really needed when using PHP 5.5 because + it's easier to just wrap an iterator in a generator that maps values. + +For a replacement of these iterators, see https://github.com/nikic/iter + +## Log + +The LogPlugin has moved to https://github.com/guzzle/log-subscriber. The +`Guzzle\Log` namespace has been removed. Guzzle now relies on +`Psr\Log\LoggerInterface` for all logging. The MessageFormatter class has been +moved to `GuzzleHttp\Subscriber\Log\Formatter`. + +## Parser + +The `Guzzle\Parser` namespace has been removed. This was previously used to +make it possible to plug in custom parsers for cookies, messages, URI +templates, and URLs; however, this level of complexity is not needed in Guzzle +so it has been removed. + +- Cookie: Cookie parsing logic has been moved to + `GuzzleHttp\Cookie\SetCookie::fromString`. +- Message: Message parsing logic for both requests and responses has been moved + to `GuzzleHttp\Message\MessageFactory::fromMessage`. Message parsing is only + used in debugging or deserializing messages, so it doesn't make sense for + Guzzle as a library to add this level of complexity to parsing messages. +- UriTemplate: URI template parsing has been moved to + `GuzzleHttp\UriTemplate`. The Guzzle library will automatically use the PECL + URI template library if it is installed. +- Url: URL parsing is now performed in `GuzzleHttp\Url::fromString` (previously + it was `Guzzle\Http\Url::factory()`). If custom URL parsing is necessary, + then developers are free to subclass `GuzzleHttp\Url`. + +## Plugin + +The `Guzzle\Plugin` namespace has been renamed to `GuzzleHttp\Subscriber`. +Several plugins are shipping with the core Guzzle library under this namespace. + +- `GuzzleHttp\Subscriber\Cookie`: Replaces the old CookiePlugin. Cookie jar + code has moved to `GuzzleHttp\Cookie`. +- `GuzzleHttp\Subscriber\History`: Replaces the old HistoryPlugin. +- `GuzzleHttp\Subscriber\HttpError`: Throws errors when a bad HTTP response is + received. +- `GuzzleHttp\Subscriber\Mock`: Replaces the old MockPlugin. +- `GuzzleHttp\Subscriber\Prepare`: Prepares the body of a request just before + sending. This subscriber is attached to all requests by default. +- `GuzzleHttp\Subscriber\Redirect`: Replaces the RedirectPlugin. + +The following plugins have been removed (third-parties are free to re-implement +these if needed): + +- `GuzzleHttp\Plugin\Async` has been removed. +- `GuzzleHttp\Plugin\CurlAuth` has been removed. +- `GuzzleHttp\Plugin\ErrorResponse\ErrorResponsePlugin` has been removed. This + functionality should instead be implemented with event listeners that occur + after normal response parsing occurs in the guzzle/command package. + +The following plugins are not part of the core Guzzle package, but are provided +in separate repositories: + +- `Guzzle\Http\Plugin\BackoffPlugin` has been rewritten to be much simpler + to build custom retry policies using simple functions rather than various + chained classes. See: https://github.com/guzzle/retry-subscriber +- `Guzzle\Http\Plugin\Cache\CachePlugin` has moved to + https://github.com/guzzle/cache-subscriber +- `Guzzle\Http\Plugin\Log\LogPlugin` has moved to + https://github.com/guzzle/log-subscriber +- `Guzzle\Http\Plugin\Md5\Md5Plugin` has moved to + https://github.com/guzzle/message-integrity-subscriber +- `Guzzle\Http\Plugin\Mock\MockPlugin` has moved to + `GuzzleHttp\Subscriber\MockSubscriber`. +- `Guzzle\Http\Plugin\Oauth\OauthPlugin` has moved to + https://github.com/guzzle/oauth-subscriber + +## Service + +The service description layer of Guzzle has moved into two separate packages: + +- http://github.com/guzzle/command Provides a high level abstraction over web + services by representing web service operations using commands. +- http://github.com/guzzle/guzzle-services Provides an implementation of + guzzle/command that provides request serialization and response parsing using + Guzzle service descriptions. + +## Stream + +Stream have moved to a separate package available at +https://github.com/guzzle/streams. + +`Guzzle\Stream\StreamInterface` has been given a large update to cleanly take +on the responsibilities of `Guzzle\Http\EntityBody` and +`Guzzle\Http\EntityBodyInterface` now that they have been removed. The number +of methods implemented by the `StreamInterface` has been drastically reduced to +allow developers to more easily extend and decorate stream behavior. + +## Removed methods from StreamInterface + +- `getStream` and `setStream` have been removed to better encapsulate streams. +- `getMetadata` and `setMetadata` have been removed in favor of + `GuzzleHttp\Stream\MetadataStreamInterface`. +- `getWrapper`, `getWrapperData`, `getStreamType`, and `getUri` have all been + removed. This data is accessible when + using streams that implement `GuzzleHttp\Stream\MetadataStreamInterface`. +- `rewind` has been removed. Use `seek(0)` for a similar behavior. + +## Renamed methods + +- `detachStream` has been renamed to `detach`. +- `feof` has been renamed to `eof`. +- `ftell` has been renamed to `tell`. +- `readLine` has moved from an instance method to a static class method of + `GuzzleHttp\Stream\Stream`. + +## Metadata streams + +`GuzzleHttp\Stream\MetadataStreamInterface` has been added to denote streams +that contain additional metadata accessible via `getMetadata()`. +`GuzzleHttp\Stream\StreamInterface::getMetadata` and +`GuzzleHttp\Stream\StreamInterface::setMetadata` have been removed. + +## StreamRequestFactory + +The entire concept of the StreamRequestFactory has been removed. The way this +was used in Guzzle 3 broke the actual interface of sending streaming requests +(instead of getting back a Response, you got a StreamInterface). Streaming +PHP requests are now implemented through the `GuzzleHttp\Adapter\StreamAdapter`. + +3.6 to 3.7 +---------- + +### Deprecations + +- You can now enable E_USER_DEPRECATED warnings to see if you are using any deprecated methods.: + +```php +\Guzzle\Common\Version::$emitWarnings = true; +``` + +The following APIs and options have been marked as deprecated: + +- Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use `$request->getResponseBody()->isRepeatable()` instead. +- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +- Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. +- Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. +- Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated +- Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. +- Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. +- Marked `Guzzle\Common\Collection::inject()` as deprecated. +- Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use + `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` or + `$client->setDefaultOption('auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` + +3.7 introduces `request.options` as a parameter for a client configuration and as an optional argument to all creational +request methods. When paired with a client's configuration settings, these options allow you to specify default settings +for various aspects of a request. Because these options make other previous configuration options redundant, several +configuration options and methods of a client and AbstractCommand have been deprecated. + +- Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use `$client->getDefaultOption('headers')`. +- Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use `$client->setDefaultOption('headers/{header_name}', 'value')`. +- Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use `$client->setDefaultOption('params/{param_name}', 'value')` +- Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. These will work through Guzzle 4.0 + + $command = $client->getCommand('foo', array( + 'command.headers' => array('Test' => '123'), + 'command.response_body' => '/path/to/file' + )); + + // Should be changed to: + + $command = $client->getCommand('foo', array( + 'command.request_options' => array( + 'headers' => array('Test' => '123'), + 'save_as' => '/path/to/file' + ) + )); + +### Interface changes + +Additions and changes (you will need to update any implementations or subclasses you may have created): + +- Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: + createRequest, head, delete, put, patch, post, options, prepareRequest +- Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` +- Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` +- Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to + `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a + resource, string, or EntityBody into the $options parameter to specify the download location of the response. +- Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a + default `array()` +- Added `Guzzle\Stream\StreamInterface::isRepeatable` +- Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. + +The following methods were removed from interfaces. All of these methods are still available in the concrete classes +that implement them, but you should update your code to use alternative methods: + +- Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use + `$client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or + `$client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))` or + `$client->setDefaultOption('headers/{header_name}', 'value')`. or + `$client->setDefaultOption('headers', array('header_name' => 'value'))`. +- Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use `$client->getConfig()->getPath('request.options/headers')`. +- Removed `Guzzle\Http\ClientInterface::expandTemplate()`. This is an implementation detail. +- Removed `Guzzle\Http\ClientInterface::setRequestFactory()`. This is an implementation detail. +- Removed `Guzzle\Http\ClientInterface::getCurlMulti()`. This is a very specific implementation detail. +- Removed `Guzzle\Http\Message\RequestInterface::canCache`. Use the CachePlugin. +- Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect`. Use the HistoryPlugin. +- Removed `Guzzle\Http\Message\RequestInterface::isRedirect`. Use the HistoryPlugin. + +### Cache plugin breaking changes + +- CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a + CacheStorageInterface. These two objects and interface will be removed in a future version. +- Always setting X-cache headers on cached responses +- Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin +- `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface + $request, Response $response);` +- `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` +- `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` +- Added `CacheStorageInterface::purge($url)` +- `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin + $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, + CanCacheStrategyInterface $canCache = null)` +- Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` + +3.5 to 3.6 +---------- + +* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. +* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution +* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). + For example, setHeader() first removes the header using unset on a HeaderCollection and then calls addHeader(). + Keeping the Host header and URL host in sync is now handled by overriding the addHeader method in Request. +* Specific header implementations can be created for complex headers. When a message creates a header, it uses a + HeaderFactory which can map specific headers to specific header classes. There is now a Link header and + CacheControl header implementation. +* Moved getLinks() from Response to just be used on a Link header object. + +If you previously relied on Guzzle\Http\Message\Header::raw(), then you will need to update your code to use the +HeaderInterface (e.g. toArray(), getAll(), etc.). + +### Interface changes + +* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate +* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() +* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in + Guzzle\Http\Curl\RequestMediator +* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. +* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface +* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() + +### Removed deprecated functions + +* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() +* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). + +### Deprecations + +* The ability to case-insensitively search for header values +* Guzzle\Http\Message\Header::hasExactHeader +* Guzzle\Http\Message\Header::raw. Use getAll() +* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object + instead. + +### Other changes + +* All response header helper functions return a string rather than mixing Header objects and strings inconsistently +* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle + directly via interfaces +* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist + but are a no-op until removed. +* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a + `Guzzle\Service\Command\ArrayCommandInterface`. +* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response + on a request while the request is still being transferred +* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess + +3.3 to 3.4 +---------- + +Base URLs of a client now follow the rules of https://tools.ietf.org/html/rfc3986#section-5.2.2 when merging URLs. + +3.2 to 3.3 +---------- + +### Response::getEtag() quote stripping removed + +`Guzzle\Http\Message\Response::getEtag()` no longer strips quotes around the ETag response header + +### Removed `Guzzle\Http\Utils` + +The `Guzzle\Http\Utils` class was removed. This class was only used for testing. + +### Stream wrapper and type + +`Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getStreamType()` are no longer converted to lowercase. + +### curl.emit_io became emit_io + +Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using the +'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' + +3.1 to 3.2 +---------- + +### CurlMulti is no longer reused globally + +Before 3.2, the same CurlMulti object was reused globally for each client. This can cause issue where plugins added +to a single client can pollute requests dispatched from other clients. + +If you still wish to reuse the same CurlMulti object with each client, then you can add a listener to the +ServiceBuilder's `service_builder.create_client` event to inject a custom CurlMulti object into each client as it is +created. + +```php +$multi = new Guzzle\Http\Curl\CurlMulti(); +$builder = Guzzle\Service\Builder\ServiceBuilder::factory('/path/to/config.json'); +$builder->addListener('service_builder.create_client', function ($event) use ($multi) { + $event['client']->setCurlMulti($multi); +} +}); +``` + +### No default path + +URLs no longer have a default path value of '/' if no path was specified. + +Before: + +```php +$request = $client->get('http://www.foo.com'); +echo $request->getUrl(); +// >> http://www.foo.com/ +``` + +After: + +```php +$request = $client->get('http://www.foo.com'); +echo $request->getUrl(); +// >> http://www.foo.com +``` + +### Less verbose BadResponseException + +The exception message for `Guzzle\Http\Exception\BadResponseException` no longer contains the full HTTP request and +response information. You can, however, get access to the request and response object by calling `getRequest()` or +`getResponse()` on the exception object. + +### Query parameter aggregation + +Multi-valued query parameters are no longer aggregated using a callback function. `Guzzle\Http\Query` now has a +setAggregator() method that accepts a `Guzzle\Http\QueryAggregator\QueryAggregatorInterface` object. This object is +responsible for handling the aggregation of multi-valued query string variables into a flattened hash. + +2.8 to 3.x +---------- + +### Guzzle\Service\Inspector + +Change `\Guzzle\Service\Inspector::fromConfig` to `\Guzzle\Common\Collection::fromConfig` + +**Before** + +```php +use Guzzle\Service\Inspector; + +class YourClient extends \Guzzle\Service\Client +{ + public static function factory($config = array()) + { + $default = array(); + $required = array('base_url', 'username', 'api_key'); + $config = Inspector::fromConfig($config, $default, $required); + + $client = new self( + $config->get('base_url'), + $config->get('username'), + $config->get('api_key') + ); + $client->setConfig($config); + + $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); + + return $client; + } +``` + +**After** + +```php +use Guzzle\Common\Collection; + +class YourClient extends \Guzzle\Service\Client +{ + public static function factory($config = array()) + { + $default = array(); + $required = array('base_url', 'username', 'api_key'); + $config = Collection::fromConfig($config, $default, $required); + + $client = new self( + $config->get('base_url'), + $config->get('username'), + $config->get('api_key') + ); + $client->setConfig($config); + + $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); + + return $client; + } +``` + +### Convert XML Service Descriptions to JSON + +**Before** + +```xml + + + + + + Get a list of groups + + + Uses a search query to get a list of groups + + + + Create a group + + + + + Delete a group by ID + + + + + + + Update a group + + + + + + +``` + +**After** + +```json +{ + "name": "Zendesk REST API v2", + "apiVersion": "2012-12-31", + "description":"Provides access to Zendesk views, groups, tickets, ticket fields, and users", + "operations": { + "list_groups": { + "httpMethod":"GET", + "uri": "groups.json", + "summary": "Get a list of groups" + }, + "search_groups":{ + "httpMethod":"GET", + "uri": "search.json?query=\"{query} type:group\"", + "summary": "Uses a search query to get a list of groups", + "parameters":{ + "query":{ + "location": "uri", + "description":"Zendesk Search Query", + "type": "string", + "required": true + } + } + }, + "create_group": { + "httpMethod":"POST", + "uri": "groups.json", + "summary": "Create a group", + "parameters":{ + "data": { + "type": "array", + "location": "body", + "description":"Group JSON", + "filters": "json_encode", + "required": true + }, + "Content-Type":{ + "type": "string", + "location":"header", + "static": "application/json" + } + } + }, + "delete_group": { + "httpMethod":"DELETE", + "uri": "groups/{id}.json", + "summary": "Delete a group", + "parameters":{ + "id":{ + "location": "uri", + "description":"Group to delete by ID", + "type": "integer", + "required": true + } + } + }, + "get_group": { + "httpMethod":"GET", + "uri": "groups/{id}.json", + "summary": "Get a ticket", + "parameters":{ + "id":{ + "location": "uri", + "description":"Group to get by ID", + "type": "integer", + "required": true + } + } + }, + "update_group": { + "httpMethod":"PUT", + "uri": "groups/{id}.json", + "summary": "Update a group", + "parameters":{ + "id": { + "location": "uri", + "description":"Group to update by ID", + "type": "integer", + "required": true + }, + "data": { + "type": "array", + "location": "body", + "description":"Group JSON", + "filters": "json_encode", + "required": true + }, + "Content-Type":{ + "type": "string", + "location":"header", + "static": "application/json" + } + } + } +} +``` + +### Guzzle\Service\Description\ServiceDescription + +Commands are now called Operations + +**Before** + +```php +use Guzzle\Service\Description\ServiceDescription; + +$sd = new ServiceDescription(); +$sd->getCommands(); // @returns ApiCommandInterface[] +$sd->hasCommand($name); +$sd->getCommand($name); // @returns ApiCommandInterface|null +$sd->addCommand($command); // @param ApiCommandInterface $command +``` + +**After** + +```php +use Guzzle\Service\Description\ServiceDescription; + +$sd = new ServiceDescription(); +$sd->getOperations(); // @returns OperationInterface[] +$sd->hasOperation($name); +$sd->getOperation($name); // @returns OperationInterface|null +$sd->addOperation($operation); // @param OperationInterface $operation +``` + +### Guzzle\Common\Inflection\Inflector + +Namespace is now `Guzzle\Inflection\Inflector` + +### Guzzle\Http\Plugin + +Namespace is now `Guzzle\Plugin`. Many other changes occur within this namespace and are detailed in their own sections below. + +### Guzzle\Http\Plugin\LogPlugin and Guzzle\Common\Log + +Now `Guzzle\Plugin\Log\LogPlugin` and `Guzzle\Log` respectively. + +**Before** + +```php +use Guzzle\Common\Log\ClosureLogAdapter; +use Guzzle\Http\Plugin\LogPlugin; + +/** @var \Guzzle\Http\Client */ +$client; + +// $verbosity is an integer indicating desired message verbosity level +$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $verbosity = LogPlugin::LOG_VERBOSE); +``` + +**After** + +```php +use Guzzle\Log\ClosureLogAdapter; +use Guzzle\Log\MessageFormatter; +use Guzzle\Plugin\Log\LogPlugin; + +/** @var \Guzzle\Http\Client */ +$client; + +// $format is a string indicating desired message format -- @see MessageFormatter +$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $format = MessageFormatter::DEBUG_FORMAT); +``` + +### Guzzle\Http\Plugin\CurlAuthPlugin + +Now `Guzzle\Plugin\CurlAuth\CurlAuthPlugin`. + +### Guzzle\Http\Plugin\ExponentialBackoffPlugin + +Now `Guzzle\Plugin\Backoff\BackoffPlugin`, and other changes. + +**Before** + +```php +use Guzzle\Http\Plugin\ExponentialBackoffPlugin; + +$backoffPlugin = new ExponentialBackoffPlugin($maxRetries, array_merge( + ExponentialBackoffPlugin::getDefaultFailureCodes(), array(429) + )); + +$client->addSubscriber($backoffPlugin); +``` + +**After** + +```php +use Guzzle\Plugin\Backoff\BackoffPlugin; +use Guzzle\Plugin\Backoff\HttpBackoffStrategy; + +// Use convenient factory method instead -- see implementation for ideas of what +// you can do with chaining backoff strategies +$backoffPlugin = BackoffPlugin::getExponentialBackoff($maxRetries, array_merge( + HttpBackoffStrategy::getDefaultFailureCodes(), array(429) + )); +$client->addSubscriber($backoffPlugin); +``` + +### Known Issues + +#### [BUG] Accept-Encoding header behavior changed unintentionally. + +(See #217) (Fixed in 09daeb8c666fb44499a0646d655a8ae36456575e) + +In version 2.8 setting the `Accept-Encoding` header would set the CURLOPT_ENCODING option, which permitted cURL to +properly handle gzip/deflate compressed responses from the server. In versions affected by this bug this does not happen. +See issue #217 for a workaround, or use a version containing the fix. diff --git a/vendor/guzzlehttp/guzzle/composer.json b/vendor/guzzlehttp/guzzle/composer.json new file mode 100644 index 000000000..72defd614 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/composer.json @@ -0,0 +1,103 @@ +{ + "name": "guzzlehttp/guzzle", + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "framework", + "http", + "rest", + "web service", + "curl", + "client", + "HTTP client", + "PSR-7", + "PSR-18" + ], + "license": "MIT", + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "require": { + "php": "^7.2.5 || ^8.0", + "ext-json": "*", + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "ext-curl": "*", + "bamarni/composer-bin-plugin": "^1.8.1", + "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "config": { + "allow-plugins": { + "bamarni/composer-bin-plugin": true + }, + "preferred-install": "dist", + "sort-packages": true + }, + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Tests\\": "tests/" + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/BodySummarizer.php b/vendor/guzzlehttp/guzzle/src/BodySummarizer.php new file mode 100644 index 000000000..6eca94ef9 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/BodySummarizer.php @@ -0,0 +1,28 @@ +truncateAt = $truncateAt; + } + + /** + * Returns a summarized message body. + */ + public function summarize(MessageInterface $message): ?string + { + return $this->truncateAt === null + ? \GuzzleHttp\Psr7\Message::bodySummary($message) + : \GuzzleHttp\Psr7\Message::bodySummary($message, $this->truncateAt); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php b/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php new file mode 100644 index 000000000..3e02e036e --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php @@ -0,0 +1,13 @@ + 'http://www.foo.com/1.0/', + * 'timeout' => 0, + * 'allow_redirects' => false, + * 'proxy' => '192.168.16.1:10' + * ]); + * + * Client configuration settings include the following options: + * + * - handler: (callable) Function that transfers HTTP requests over the + * wire. The function is called with a Psr7\Http\Message\RequestInterface + * and array of transfer options, and must return a + * GuzzleHttp\Promise\PromiseInterface that is fulfilled with a + * Psr7\Http\Message\ResponseInterface on success. + * If no handler is provided, a default handler will be created + * that enables all of the request options below by attaching all of the + * default middleware to the handler. + * - base_uri: (string|UriInterface) Base URI of the client that is merged + * into relative URIs. Can be a string or instance of UriInterface. + * - **: any request option + * + * @param array $config Client configuration settings. + * + * @see \GuzzleHttp\RequestOptions for a list of available request options. + */ + public function __construct(array $config = []) + { + if (!isset($config['handler'])) { + $config['handler'] = HandlerStack::create(); + } elseif (!\is_callable($config['handler'])) { + throw new InvalidArgumentException('handler must be a callable'); + } + + // Convert the base_uri to a UriInterface + if (isset($config['base_uri'])) { + $config['base_uri'] = Psr7\Utils::uriFor($config['base_uri']); + } + + $this->configureDefaults($config); + } + + /** + * @param string $method + * @param array $args + * + * @return PromiseInterface|ResponseInterface + * + * @deprecated Client::__call will be removed in guzzlehttp/guzzle:8.0. + */ + public function __call($method, $args) + { + if (\count($args) < 1) { + throw new InvalidArgumentException('Magic request methods require a URI and optional options array'); + } + + $uri = $args[0]; + $opts = $args[1] ?? []; + + return \substr($method, -5) === 'Async' + ? $this->requestAsync(\substr($method, 0, -5), $uri, $opts) + : $this->request($method, $uri, $opts); + } + + /** + * Asynchronously send an HTTP request. + * + * @param array $options Request options to apply to the given + * request and to the transfer. See \GuzzleHttp\RequestOptions. + */ + public function sendAsync(RequestInterface $request, array $options = []): PromiseInterface + { + // Merge the base URI into the request URI if needed. + $options = $this->prepareDefaults($options); + + return $this->transfer( + $request->withUri($this->buildUri($request->getUri(), $options), $request->hasHeader('Host')), + $options + ); + } + + /** + * Send an HTTP request. + * + * @param array $options Request options to apply to the given + * request and to the transfer. See \GuzzleHttp\RequestOptions. + * + * @throws GuzzleException + */ + public function send(RequestInterface $request, array $options = []): ResponseInterface + { + $options[RequestOptions::SYNCHRONOUS] = true; + + return $this->sendAsync($request, $options)->wait(); + } + + /** + * The HttpClient PSR (PSR-18) specify this method. + * + * {@inheritDoc} + */ + public function sendRequest(RequestInterface $request): ResponseInterface + { + $options[RequestOptions::SYNCHRONOUS] = true; + $options[RequestOptions::ALLOW_REDIRECTS] = false; + $options[RequestOptions::HTTP_ERRORS] = false; + + return $this->sendAsync($request, $options)->wait(); + } + + /** + * Create and send an asynchronous HTTP request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string $method HTTP method + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. + */ + public function requestAsync(string $method, $uri = '', array $options = []): PromiseInterface + { + $options = $this->prepareDefaults($options); + // Remove request modifying parameter because it can be done up-front. + $headers = $options['headers'] ?? []; + $body = $options['body'] ?? null; + $version = $options['version'] ?? '1.1'; + // Merge the URI into the base URI. + $uri = $this->buildUri(Psr7\Utils::uriFor($uri), $options); + if (\is_array($body)) { + throw $this->invalidBody(); + } + $request = new Psr7\Request($method, $uri, $headers, $body, $version); + // Remove the option so that they are not doubly-applied. + unset($options['headers'], $options['body'], $options['version']); + + return $this->transfer($request, $options); + } + + /** + * Create and send an HTTP request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string $method HTTP method. + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. + * + * @throws GuzzleException + */ + public function request(string $method, $uri = '', array $options = []): ResponseInterface + { + $options[RequestOptions::SYNCHRONOUS] = true; + + return $this->requestAsync($method, $uri, $options)->wait(); + } + + /** + * Get a client configuration option. + * + * These options include default request options of the client, a "handler" + * (if utilized by the concrete client), and a "base_uri" if utilized by + * the concrete client. + * + * @param string|null $option The config option to retrieve. + * + * @return mixed + * + * @deprecated Client::getConfig will be removed in guzzlehttp/guzzle:8.0. + */ + public function getConfig(string $option = null) + { + return $option === null + ? $this->config + : ($this->config[$option] ?? null); + } + + private function buildUri(UriInterface $uri, array $config): UriInterface + { + if (isset($config['base_uri'])) { + $uri = Psr7\UriResolver::resolve(Psr7\Utils::uriFor($config['base_uri']), $uri); + } + + if (isset($config['idn_conversion']) && ($config['idn_conversion'] !== false)) { + $idnOptions = ($config['idn_conversion'] === true) ? \IDNA_DEFAULT : $config['idn_conversion']; + $uri = Utils::idnUriConvert($uri, $idnOptions); + } + + return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri; + } + + /** + * Configures the default options for a client. + */ + private function configureDefaults(array $config): void + { + $defaults = [ + 'allow_redirects' => RedirectMiddleware::$defaultSettings, + 'http_errors' => true, + 'decode_content' => true, + 'verify' => true, + 'cookies' => false, + 'idn_conversion' => false, + ]; + + // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set. + + // We can only trust the HTTP_PROXY environment variable in a CLI + // process due to the fact that PHP has no reliable mechanism to + // get environment variables that start with "HTTP_". + if (\PHP_SAPI === 'cli' && ($proxy = Utils::getenv('HTTP_PROXY'))) { + $defaults['proxy']['http'] = $proxy; + } + + if ($proxy = Utils::getenv('HTTPS_PROXY')) { + $defaults['proxy']['https'] = $proxy; + } + + if ($noProxy = Utils::getenv('NO_PROXY')) { + $cleanedNoProxy = \str_replace(' ', '', $noProxy); + $defaults['proxy']['no'] = \explode(',', $cleanedNoProxy); + } + + $this->config = $config + $defaults; + + if (!empty($config['cookies']) && $config['cookies'] === true) { + $this->config['cookies'] = new CookieJar(); + } + + // Add the default user-agent header. + if (!isset($this->config['headers'])) { + $this->config['headers'] = ['User-Agent' => Utils::defaultUserAgent()]; + } else { + // Add the User-Agent header if one was not already set. + foreach (\array_keys($this->config['headers']) as $name) { + if (\strtolower($name) === 'user-agent') { + return; + } + } + $this->config['headers']['User-Agent'] = Utils::defaultUserAgent(); + } + } + + /** + * Merges default options into the array. + * + * @param array $options Options to modify by reference + */ + private function prepareDefaults(array $options): array + { + $defaults = $this->config; + + if (!empty($defaults['headers'])) { + // Default headers are only added if they are not present. + $defaults['_conditional'] = $defaults['headers']; + unset($defaults['headers']); + } + + // Special handling for headers is required as they are added as + // conditional headers and as headers passed to a request ctor. + if (\array_key_exists('headers', $options)) { + // Allows default headers to be unset. + if ($options['headers'] === null) { + $defaults['_conditional'] = []; + unset($options['headers']); + } elseif (!\is_array($options['headers'])) { + throw new InvalidArgumentException('headers must be an array'); + } + } + + // Shallow merge defaults underneath options. + $result = $options + $defaults; + + // Remove null values. + foreach ($result as $k => $v) { + if ($v === null) { + unset($result[$k]); + } + } + + return $result; + } + + /** + * Transfers the given request and applies request options. + * + * The URI of the request is not modified and the request options are used + * as-is without merging in default options. + * + * @param array $options See \GuzzleHttp\RequestOptions. + */ + private function transfer(RequestInterface $request, array $options): PromiseInterface + { + $request = $this->applyOptions($request, $options); + /** @var HandlerStack $handler */ + $handler = $options['handler']; + + try { + return P\Create::promiseFor($handler($request, $options)); + } catch (\Exception $e) { + return P\Create::rejectionFor($e); + } + } + + /** + * Applies the array of request options to a request. + */ + private function applyOptions(RequestInterface $request, array &$options): RequestInterface + { + $modify = [ + 'set_headers' => [], + ]; + + if (isset($options['headers'])) { + if (array_keys($options['headers']) === range(0, count($options['headers']) - 1)) { + throw new InvalidArgumentException('The headers array must have header name as keys.'); + } + $modify['set_headers'] = $options['headers']; + unset($options['headers']); + } + + if (isset($options['form_params'])) { + if (isset($options['multipart'])) { + throw new InvalidArgumentException('You cannot use ' + .'form_params and multipart at the same time. Use the ' + .'form_params option if you want to send application/' + .'x-www-form-urlencoded requests, and the multipart ' + .'option to send multipart/form-data requests.'); + } + $options['body'] = \http_build_query($options['form_params'], '', '&'); + unset($options['form_params']); + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded'; + } + + if (isset($options['multipart'])) { + $options['body'] = new Psr7\MultipartStream($options['multipart']); + unset($options['multipart']); + } + + if (isset($options['json'])) { + $options['body'] = Utils::jsonEncode($options['json']); + unset($options['json']); + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'application/json'; + } + + if (!empty($options['decode_content']) + && $options['decode_content'] !== true + ) { + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\Utils::caselessRemove(['Accept-Encoding'], $options['_conditional']); + $modify['set_headers']['Accept-Encoding'] = $options['decode_content']; + } + + if (isset($options['body'])) { + if (\is_array($options['body'])) { + throw $this->invalidBody(); + } + $modify['body'] = Psr7\Utils::streamFor($options['body']); + unset($options['body']); + } + + if (!empty($options['auth']) && \is_array($options['auth'])) { + $value = $options['auth']; + $type = isset($value[2]) ? \strtolower($value[2]) : 'basic'; + switch ($type) { + case 'basic': + // Ensure that we don't have the header in different case and set the new value. + $modify['set_headers'] = Psr7\Utils::caselessRemove(['Authorization'], $modify['set_headers']); + $modify['set_headers']['Authorization'] = 'Basic ' + .\base64_encode("$value[0]:$value[1]"); + break; + case 'digest': + // @todo: Do not rely on curl + $options['curl'][\CURLOPT_HTTPAUTH] = \CURLAUTH_DIGEST; + $options['curl'][\CURLOPT_USERPWD] = "$value[0]:$value[1]"; + break; + case 'ntlm': + $options['curl'][\CURLOPT_HTTPAUTH] = \CURLAUTH_NTLM; + $options['curl'][\CURLOPT_USERPWD] = "$value[0]:$value[1]"; + break; + } + } + + if (isset($options['query'])) { + $value = $options['query']; + if (\is_array($value)) { + $value = \http_build_query($value, '', '&', \PHP_QUERY_RFC3986); + } + if (!\is_string($value)) { + throw new InvalidArgumentException('query must be a string or array'); + } + $modify['query'] = $value; + unset($options['query']); + } + + // Ensure that sink is not an invalid value. + if (isset($options['sink'])) { + // TODO: Add more sink validation? + if (\is_bool($options['sink'])) { + throw new InvalidArgumentException('sink must not be a boolean'); + } + } + + if (isset($options['version'])) { + $modify['version'] = $options['version']; + } + + $request = Psr7\Utils::modifyRequest($request, $modify); + if ($request->getBody() instanceof Psr7\MultipartStream) { + // Use a multipart/form-data POST if a Content-Type is not set. + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'multipart/form-data; boundary=' + .$request->getBody()->getBoundary(); + } + + // Merge in conditional headers if they are not present. + if (isset($options['_conditional'])) { + // Build up the changes so it's in a single clone of the message. + $modify = []; + foreach ($options['_conditional'] as $k => $v) { + if (!$request->hasHeader($k)) { + $modify['set_headers'][$k] = $v; + } + } + $request = Psr7\Utils::modifyRequest($request, $modify); + // Don't pass this internal value along to middleware/handlers. + unset($options['_conditional']); + } + + return $request; + } + + /** + * Return an InvalidArgumentException with pre-set message. + */ + private function invalidBody(): InvalidArgumentException + { + return new InvalidArgumentException('Passing in the "body" request ' + .'option as an array to send a request is not supported. ' + .'Please use the "form_params" request option to send a ' + .'application/x-www-form-urlencoded request, or the "multipart" ' + .'request option to send a multipart/form-data request.'); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/vendor/guzzlehttp/guzzle/src/ClientInterface.php new file mode 100644 index 000000000..1788e16ab --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/ClientInterface.php @@ -0,0 +1,84 @@ +request('GET', $uri, $options); + } + + /** + * Create and send an HTTP HEAD request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + * + * @throws GuzzleException + */ + public function head($uri, array $options = []): ResponseInterface + { + return $this->request('HEAD', $uri, $options); + } + + /** + * Create and send an HTTP PUT request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + * + * @throws GuzzleException + */ + public function put($uri, array $options = []): ResponseInterface + { + return $this->request('PUT', $uri, $options); + } + + /** + * Create and send an HTTP POST request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + * + * @throws GuzzleException + */ + public function post($uri, array $options = []): ResponseInterface + { + return $this->request('POST', $uri, $options); + } + + /** + * Create and send an HTTP PATCH request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + * + * @throws GuzzleException + */ + public function patch($uri, array $options = []): ResponseInterface + { + return $this->request('PATCH', $uri, $options); + } + + /** + * Create and send an HTTP DELETE request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + * + * @throws GuzzleException + */ + public function delete($uri, array $options = []): ResponseInterface + { + return $this->request('DELETE', $uri, $options); + } + + /** + * Create and send an asynchronous HTTP request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string $method HTTP method + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + abstract public function requestAsync(string $method, $uri, array $options = []): PromiseInterface; + + /** + * Create and send an asynchronous HTTP GET request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + public function getAsync($uri, array $options = []): PromiseInterface + { + return $this->requestAsync('GET', $uri, $options); + } + + /** + * Create and send an asynchronous HTTP HEAD request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + public function headAsync($uri, array $options = []): PromiseInterface + { + return $this->requestAsync('HEAD', $uri, $options); + } + + /** + * Create and send an asynchronous HTTP PUT request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + public function putAsync($uri, array $options = []): PromiseInterface + { + return $this->requestAsync('PUT', $uri, $options); + } + + /** + * Create and send an asynchronous HTTP POST request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + public function postAsync($uri, array $options = []): PromiseInterface + { + return $this->requestAsync('POST', $uri, $options); + } + + /** + * Create and send an asynchronous HTTP PATCH request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + public function patchAsync($uri, array $options = []): PromiseInterface + { + return $this->requestAsync('PATCH', $uri, $options); + } + + /** + * Create and send an asynchronous HTTP DELETE request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + public function deleteAsync($uri, array $options = []): PromiseInterface + { + return $this->requestAsync('DELETE', $uri, $options); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php new file mode 100644 index 000000000..fa2b10a8c --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php @@ -0,0 +1,307 @@ +strictMode = $strictMode; + + foreach ($cookieArray as $cookie) { + if (!($cookie instanceof SetCookie)) { + $cookie = new SetCookie($cookie); + } + $this->setCookie($cookie); + } + } + + /** + * Create a new Cookie jar from an associative array and domain. + * + * @param array $cookies Cookies to create the jar from + * @param string $domain Domain to set the cookies to + */ + public static function fromArray(array $cookies, string $domain): self + { + $cookieJar = new self(); + foreach ($cookies as $name => $value) { + $cookieJar->setCookie(new SetCookie([ + 'Domain' => $domain, + 'Name' => $name, + 'Value' => $value, + 'Discard' => true, + ])); + } + + return $cookieJar; + } + + /** + * Evaluate if this cookie should be persisted to storage + * that survives between requests. + * + * @param SetCookie $cookie Being evaluated. + * @param bool $allowSessionCookies If we should persist session cookies + */ + public static function shouldPersist(SetCookie $cookie, bool $allowSessionCookies = false): bool + { + if ($cookie->getExpires() || $allowSessionCookies) { + if (!$cookie->getDiscard()) { + return true; + } + } + + return false; + } + + /** + * Finds and returns the cookie based on the name + * + * @param string $name cookie name to search for + * + * @return SetCookie|null cookie that was found or null if not found + */ + public function getCookieByName(string $name): ?SetCookie + { + foreach ($this->cookies as $cookie) { + if ($cookie->getName() !== null && \strcasecmp($cookie->getName(), $name) === 0) { + return $cookie; + } + } + + return null; + } + + public function toArray(): array + { + return \array_map(static function (SetCookie $cookie): array { + return $cookie->toArray(); + }, $this->getIterator()->getArrayCopy()); + } + + public function clear(string $domain = null, string $path = null, string $name = null): void + { + if (!$domain) { + $this->cookies = []; + + return; + } elseif (!$path) { + $this->cookies = \array_filter( + $this->cookies, + static function (SetCookie $cookie) use ($domain): bool { + return !$cookie->matchesDomain($domain); + } + ); + } elseif (!$name) { + $this->cookies = \array_filter( + $this->cookies, + static function (SetCookie $cookie) use ($path, $domain): bool { + return !($cookie->matchesPath($path) + && $cookie->matchesDomain($domain)); + } + ); + } else { + $this->cookies = \array_filter( + $this->cookies, + static function (SetCookie $cookie) use ($path, $domain, $name) { + return !($cookie->getName() == $name + && $cookie->matchesPath($path) + && $cookie->matchesDomain($domain)); + } + ); + } + } + + public function clearSessionCookies(): void + { + $this->cookies = \array_filter( + $this->cookies, + static function (SetCookie $cookie): bool { + return !$cookie->getDiscard() && $cookie->getExpires(); + } + ); + } + + public function setCookie(SetCookie $cookie): bool + { + // If the name string is empty (but not 0), ignore the set-cookie + // string entirely. + $name = $cookie->getName(); + if (!$name && $name !== '0') { + return false; + } + + // Only allow cookies with set and valid domain, name, value + $result = $cookie->validate(); + if ($result !== true) { + if ($this->strictMode) { + throw new \RuntimeException('Invalid cookie: '.$result); + } + $this->removeCookieIfEmpty($cookie); + + return false; + } + + // Resolve conflicts with previously set cookies + foreach ($this->cookies as $i => $c) { + // Two cookies are identical, when their path, and domain are + // identical. + if ($c->getPath() != $cookie->getPath() + || $c->getDomain() != $cookie->getDomain() + || $c->getName() != $cookie->getName() + ) { + continue; + } + + // The previously set cookie is a discard cookie and this one is + // not so allow the new cookie to be set + if (!$cookie->getDiscard() && $c->getDiscard()) { + unset($this->cookies[$i]); + continue; + } + + // If the new cookie's expiration is further into the future, then + // replace the old cookie + if ($cookie->getExpires() > $c->getExpires()) { + unset($this->cookies[$i]); + continue; + } + + // If the value has changed, we better change it + if ($cookie->getValue() !== $c->getValue()) { + unset($this->cookies[$i]); + continue; + } + + // The cookie exists, so no need to continue + return false; + } + + $this->cookies[] = $cookie; + + return true; + } + + public function count(): int + { + return \count($this->cookies); + } + + /** + * @return \ArrayIterator + */ + public function getIterator(): \ArrayIterator + { + return new \ArrayIterator(\array_values($this->cookies)); + } + + public function extractCookies(RequestInterface $request, ResponseInterface $response): void + { + if ($cookieHeader = $response->getHeader('Set-Cookie')) { + foreach ($cookieHeader as $cookie) { + $sc = SetCookie::fromString($cookie); + if (!$sc->getDomain()) { + $sc->setDomain($request->getUri()->getHost()); + } + if (0 !== \strpos($sc->getPath(), '/')) { + $sc->setPath($this->getCookiePathFromRequest($request)); + } + if (!$sc->matchesDomain($request->getUri()->getHost())) { + continue; + } + // Note: At this point `$sc->getDomain()` being a public suffix should + // be rejected, but we don't want to pull in the full PSL dependency. + $this->setCookie($sc); + } + } + } + + /** + * Computes cookie path following RFC 6265 section 5.1.4 + * + * @see https://tools.ietf.org/html/rfc6265#section-5.1.4 + */ + private function getCookiePathFromRequest(RequestInterface $request): string + { + $uriPath = $request->getUri()->getPath(); + if ('' === $uriPath) { + return '/'; + } + if (0 !== \strpos($uriPath, '/')) { + return '/'; + } + if ('/' === $uriPath) { + return '/'; + } + $lastSlashPos = \strrpos($uriPath, '/'); + if (0 === $lastSlashPos || false === $lastSlashPos) { + return '/'; + } + + return \substr($uriPath, 0, $lastSlashPos); + } + + public function withCookieHeader(RequestInterface $request): RequestInterface + { + $values = []; + $uri = $request->getUri(); + $scheme = $uri->getScheme(); + $host = $uri->getHost(); + $path = $uri->getPath() ?: '/'; + + foreach ($this->cookies as $cookie) { + if ($cookie->matchesPath($path) + && $cookie->matchesDomain($host) + && !$cookie->isExpired() + && (!$cookie->getSecure() || $scheme === 'https') + ) { + $values[] = $cookie->getName().'=' + .$cookie->getValue(); + } + } + + return $values + ? $request->withHeader('Cookie', \implode('; ', $values)) + : $request; + } + + /** + * If a cookie already exists and the server asks to set it again with a + * null value, the cookie must be deleted. + */ + private function removeCookieIfEmpty(SetCookie $cookie): void + { + $cookieValue = $cookie->getValue(); + if ($cookieValue === null || $cookieValue === '') { + $this->clear( + $cookie->getDomain(), + $cookie->getPath(), + $cookie->getName() + ); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php new file mode 100644 index 000000000..8c55cc6f7 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php @@ -0,0 +1,80 @@ + + */ +interface CookieJarInterface extends \Countable, \IteratorAggregate +{ + /** + * Create a request with added cookie headers. + * + * If no matching cookies are found in the cookie jar, then no Cookie + * header is added to the request and the same request is returned. + * + * @param RequestInterface $request Request object to modify. + * + * @return RequestInterface returns the modified request. + */ + public function withCookieHeader(RequestInterface $request): RequestInterface; + + /** + * Extract cookies from an HTTP response and store them in the CookieJar. + * + * @param RequestInterface $request Request that was sent + * @param ResponseInterface $response Response that was received + */ + public function extractCookies(RequestInterface $request, ResponseInterface $response): void; + + /** + * Sets a cookie in the cookie jar. + * + * @param SetCookie $cookie Cookie to set. + * + * @return bool Returns true on success or false on failure + */ + public function setCookie(SetCookie $cookie): bool; + + /** + * Remove cookies currently held in the cookie jar. + * + * Invoking this method without arguments will empty the whole cookie jar. + * If given a $domain argument only cookies belonging to that domain will + * be removed. If given a $domain and $path argument, cookies belonging to + * the specified path within that domain are removed. If given all three + * arguments, then the cookie with the specified name, path and domain is + * removed. + * + * @param string|null $domain Clears cookies matching a domain + * @param string|null $path Clears cookies matching a domain and path + * @param string|null $name Clears cookies matching a domain, path, and name + */ + public function clear(string $domain = null, string $path = null, string $name = null): void; + + /** + * Discard all sessions cookies. + * + * Removes cookies that don't have an expire field or a have a discard + * field set to true. To be called when the user agent shuts down according + * to RFC 2965. + */ + public function clearSessionCookies(): void; + + /** + * Converts the cookie jar to an array. + */ + public function toArray(): array; +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php b/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php new file mode 100644 index 000000000..290236d54 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php @@ -0,0 +1,101 @@ +filename = $cookieFile; + $this->storeSessionCookies = $storeSessionCookies; + + if (\file_exists($cookieFile)) { + $this->load($cookieFile); + } + } + + /** + * Saves the file when shutting down + */ + public function __destruct() + { + $this->save($this->filename); + } + + /** + * Saves the cookies to a file. + * + * @param string $filename File to save + * + * @throws \RuntimeException if the file cannot be found or created + */ + public function save(string $filename): void + { + $json = []; + /** @var SetCookie $cookie */ + foreach ($this as $cookie) { + if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { + $json[] = $cookie->toArray(); + } + } + + $jsonStr = Utils::jsonEncode($json); + if (false === \file_put_contents($filename, $jsonStr, \LOCK_EX)) { + throw new \RuntimeException("Unable to save file {$filename}"); + } + } + + /** + * Load cookies from a JSON formatted file. + * + * Old cookies are kept unless overwritten by newly loaded ones. + * + * @param string $filename Cookie file to load. + * + * @throws \RuntimeException if the file cannot be loaded. + */ + public function load(string $filename): void + { + $json = \file_get_contents($filename); + if (false === $json) { + throw new \RuntimeException("Unable to load file {$filename}"); + } + if ($json === '') { + return; + } + + $data = Utils::jsonDecode($json, true); + if (\is_array($data)) { + foreach ($data as $cookie) { + $this->setCookie(new SetCookie($cookie)); + } + } elseif (\is_scalar($data) && !empty($data)) { + throw new \RuntimeException("Invalid cookie file: {$filename}"); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php b/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php new file mode 100644 index 000000000..cb3e67c6a --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php @@ -0,0 +1,77 @@ +sessionKey = $sessionKey; + $this->storeSessionCookies = $storeSessionCookies; + $this->load(); + } + + /** + * Saves cookies to session when shutting down + */ + public function __destruct() + { + $this->save(); + } + + /** + * Save cookies to the client session + */ + public function save(): void + { + $json = []; + /** @var SetCookie $cookie */ + foreach ($this as $cookie) { + if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { + $json[] = $cookie->toArray(); + } + } + + $_SESSION[$this->sessionKey] = \json_encode($json); + } + + /** + * Load the contents of the client session into the data array + */ + protected function load(): void + { + if (!isset($_SESSION[$this->sessionKey])) { + return; + } + $data = \json_decode($_SESSION[$this->sessionKey], true); + if (\is_array($data)) { + foreach ($data as $cookie) { + $this->setCookie(new SetCookie($cookie)); + } + } elseif (\strlen($data)) { + throw new \RuntimeException('Invalid cookie data'); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php b/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php new file mode 100644 index 000000000..d74915bed --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php @@ -0,0 +1,488 @@ + null, + 'Value' => null, + 'Domain' => null, + 'Path' => '/', + 'Max-Age' => null, + 'Expires' => null, + 'Secure' => false, + 'Discard' => false, + 'HttpOnly' => false, + ]; + + /** + * @var array Cookie data + */ + private $data; + + /** + * Create a new SetCookie object from a string. + * + * @param string $cookie Set-Cookie header string + */ + public static function fromString(string $cookie): self + { + // Create the default return array + $data = self::$defaults; + // Explode the cookie string using a series of semicolons + $pieces = \array_filter(\array_map('trim', \explode(';', $cookie))); + // The name of the cookie (first kvp) must exist and include an equal sign. + if (!isset($pieces[0]) || \strpos($pieces[0], '=') === false) { + return new self($data); + } + + // Add the cookie pieces into the parsed data array + foreach ($pieces as $part) { + $cookieParts = \explode('=', $part, 2); + $key = \trim($cookieParts[0]); + $value = isset($cookieParts[1]) + ? \trim($cookieParts[1], " \n\r\t\0\x0B") + : true; + + // Only check for non-cookies when cookies have been found + if (!isset($data['Name'])) { + $data['Name'] = $key; + $data['Value'] = $value; + } else { + foreach (\array_keys(self::$defaults) as $search) { + if (!\strcasecmp($search, $key)) { + if ($search === 'Max-Age') { + if (is_numeric($value)) { + $data[$search] = (int) $value; + } + } else { + $data[$search] = $value; + } + continue 2; + } + } + $data[$key] = $value; + } + } + + return new self($data); + } + + /** + * @param array $data Array of cookie data provided by a Cookie parser + */ + public function __construct(array $data = []) + { + $this->data = self::$defaults; + + if (isset($data['Name'])) { + $this->setName($data['Name']); + } + + if (isset($data['Value'])) { + $this->setValue($data['Value']); + } + + if (isset($data['Domain'])) { + $this->setDomain($data['Domain']); + } + + if (isset($data['Path'])) { + $this->setPath($data['Path']); + } + + if (isset($data['Max-Age'])) { + $this->setMaxAge($data['Max-Age']); + } + + if (isset($data['Expires'])) { + $this->setExpires($data['Expires']); + } + + if (isset($data['Secure'])) { + $this->setSecure($data['Secure']); + } + + if (isset($data['Discard'])) { + $this->setDiscard($data['Discard']); + } + + if (isset($data['HttpOnly'])) { + $this->setHttpOnly($data['HttpOnly']); + } + + // Set the remaining values that don't have extra validation logic + foreach (array_diff(array_keys($data), array_keys(self::$defaults)) as $key) { + $this->data[$key] = $data[$key]; + } + + // Extract the Expires value and turn it into a UNIX timestamp if needed + if (!$this->getExpires() && $this->getMaxAge()) { + // Calculate the Expires date + $this->setExpires(\time() + $this->getMaxAge()); + } elseif (null !== ($expires = $this->getExpires()) && !\is_numeric($expires)) { + $this->setExpires($expires); + } + } + + public function __toString() + { + $str = $this->data['Name'].'='.($this->data['Value'] ?? '').'; '; + foreach ($this->data as $k => $v) { + if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) { + if ($k === 'Expires') { + $str .= 'Expires='.\gmdate('D, d M Y H:i:s \G\M\T', $v).'; '; + } else { + $str .= ($v === true ? $k : "{$k}={$v}").'; '; + } + } + } + + return \rtrim($str, '; '); + } + + public function toArray(): array + { + return $this->data; + } + + /** + * Get the cookie name. + * + * @return string + */ + public function getName() + { + return $this->data['Name']; + } + + /** + * Set the cookie name. + * + * @param string $name Cookie name + */ + public function setName($name): void + { + if (!is_string($name)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Name'] = (string) $name; + } + + /** + * Get the cookie value. + * + * @return string|null + */ + public function getValue() + { + return $this->data['Value']; + } + + /** + * Set the cookie value. + * + * @param string $value Cookie value + */ + public function setValue($value): void + { + if (!is_string($value)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Value'] = (string) $value; + } + + /** + * Get the domain. + * + * @return string|null + */ + public function getDomain() + { + return $this->data['Domain']; + } + + /** + * Set the domain of the cookie. + * + * @param string|null $domain + */ + public function setDomain($domain): void + { + if (!is_string($domain) && null !== $domain) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Domain'] = null === $domain ? null : (string) $domain; + } + + /** + * Get the path. + * + * @return string + */ + public function getPath() + { + return $this->data['Path']; + } + + /** + * Set the path of the cookie. + * + * @param string $path Path of the cookie + */ + public function setPath($path): void + { + if (!is_string($path)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Path'] = (string) $path; + } + + /** + * Maximum lifetime of the cookie in seconds. + * + * @return int|null + */ + public function getMaxAge() + { + return null === $this->data['Max-Age'] ? null : (int) $this->data['Max-Age']; + } + + /** + * Set the max-age of the cookie. + * + * @param int|null $maxAge Max age of the cookie in seconds + */ + public function setMaxAge($maxAge): void + { + if (!is_int($maxAge) && null !== $maxAge) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Max-Age'] = $maxAge === null ? null : (int) $maxAge; + } + + /** + * The UNIX timestamp when the cookie Expires. + * + * @return string|int|null + */ + public function getExpires() + { + return $this->data['Expires']; + } + + /** + * Set the unix timestamp for which the cookie will expire. + * + * @param int|string|null $timestamp Unix timestamp or any English textual datetime description. + */ + public function setExpires($timestamp): void + { + if (!is_int($timestamp) && !is_string($timestamp) && null !== $timestamp) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int, string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Expires'] = null === $timestamp ? null : (\is_numeric($timestamp) ? (int) $timestamp : \strtotime((string) $timestamp)); + } + + /** + * Get whether or not this is a secure cookie. + * + * @return bool + */ + public function getSecure() + { + return $this->data['Secure']; + } + + /** + * Set whether or not the cookie is secure. + * + * @param bool $secure Set to true or false if secure + */ + public function setSecure($secure): void + { + if (!is_bool($secure)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Secure'] = (bool) $secure; + } + + /** + * Get whether or not this is a session cookie. + * + * @return bool|null + */ + public function getDiscard() + { + return $this->data['Discard']; + } + + /** + * Set whether or not this is a session cookie. + * + * @param bool $discard Set to true or false if this is a session cookie + */ + public function setDiscard($discard): void + { + if (!is_bool($discard)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Discard'] = (bool) $discard; + } + + /** + * Get whether or not this is an HTTP only cookie. + * + * @return bool + */ + public function getHttpOnly() + { + return $this->data['HttpOnly']; + } + + /** + * Set whether or not this is an HTTP only cookie. + * + * @param bool $httpOnly Set to true or false if this is HTTP only + */ + public function setHttpOnly($httpOnly): void + { + if (!is_bool($httpOnly)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['HttpOnly'] = (bool) $httpOnly; + } + + /** + * Check if the cookie matches a path value. + * + * A request-path path-matches a given cookie-path if at least one of + * the following conditions holds: + * + * - The cookie-path and the request-path are identical. + * - The cookie-path is a prefix of the request-path, and the last + * character of the cookie-path is %x2F ("/"). + * - The cookie-path is a prefix of the request-path, and the first + * character of the request-path that is not included in the cookie- + * path is a %x2F ("/") character. + * + * @param string $requestPath Path to check against + */ + public function matchesPath(string $requestPath): bool + { + $cookiePath = $this->getPath(); + + // Match on exact matches or when path is the default empty "/" + if ($cookiePath === '/' || $cookiePath == $requestPath) { + return true; + } + + // Ensure that the cookie-path is a prefix of the request path. + if (0 !== \strpos($requestPath, $cookiePath)) { + return false; + } + + // Match if the last character of the cookie-path is "/" + if (\substr($cookiePath, -1, 1) === '/') { + return true; + } + + // Match if the first character not included in cookie path is "/" + return \substr($requestPath, \strlen($cookiePath), 1) === '/'; + } + + /** + * Check if the cookie matches a domain value. + * + * @param string $domain Domain to check against + */ + public function matchesDomain(string $domain): bool + { + $cookieDomain = $this->getDomain(); + if (null === $cookieDomain) { + return true; + } + + // Remove the leading '.' as per spec in RFC 6265. + // https://tools.ietf.org/html/rfc6265#section-5.2.3 + $cookieDomain = \ltrim(\strtolower($cookieDomain), '.'); + + $domain = \strtolower($domain); + + // Domain not set or exact match. + if ('' === $cookieDomain || $domain === $cookieDomain) { + return true; + } + + // Matching the subdomain according to RFC 6265. + // https://tools.ietf.org/html/rfc6265#section-5.1.3 + if (\filter_var($domain, \FILTER_VALIDATE_IP)) { + return false; + } + + return (bool) \preg_match('/\.'.\preg_quote($cookieDomain, '/').'$/', $domain); + } + + /** + * Check if the cookie is expired. + */ + public function isExpired(): bool + { + return $this->getExpires() !== null && \time() > $this->getExpires(); + } + + /** + * Check if the cookie is valid according to RFC 6265. + * + * @return bool|string Returns true if valid or an error message if invalid + */ + public function validate() + { + $name = $this->getName(); + if ($name === '') { + return 'The cookie name must not be empty'; + } + + // Check if any of the invalid characters are present in the cookie name + if (\preg_match( + '/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/', + $name + )) { + return 'Cookie name must not contain invalid characters: ASCII ' + .'Control characters (0-31;127), space, tab and the ' + .'following characters: ()<>@,;:\"/?={}'; + } + + // Value must not be null. 0 and empty string are valid. Empty strings + // are technically against RFC 6265, but known to happen in the wild. + $value = $this->getValue(); + if ($value === null) { + return 'The cookie value must not be empty'; + } + + // Domains must not be empty, but can be 0. "0" is not a valid internet + // domain, but may be used as server name in a private network. + $domain = $this->getDomain(); + if ($domain === null || $domain === '') { + return 'The cookie domain must not be empty'; + } + + return true; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php b/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php new file mode 100644 index 000000000..a80956c9d --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php @@ -0,0 +1,39 @@ +request = $request; + $this->handlerContext = $handlerContext; + } + + /** + * Get the request that caused the exception + */ + public function getRequest(): RequestInterface + { + return $this->request; + } + + /** + * Get contextual information about the error from the underlying handler. + * + * The contents of this array will vary depending on which handler you are + * using. It may also be just an empty array. Relying on this data will + * couple you to a specific handler, but can give more debug information + * when needed. + */ + public function getHandlerContext(): array + { + return $this->handlerContext; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php b/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php new file mode 100644 index 000000000..fa3ed6998 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php @@ -0,0 +1,9 @@ +getStatusCode() : 0; + parent::__construct($message, $code, $previous); + $this->request = $request; + $this->response = $response; + $this->handlerContext = $handlerContext; + } + + /** + * Wrap non-RequestExceptions with a RequestException + */ + public static function wrapException(RequestInterface $request, \Throwable $e): RequestException + { + return $e instanceof RequestException ? $e : new RequestException($e->getMessage(), $request, null, $e); + } + + /** + * Factory method to create a new exception with a normalized error message + * + * @param RequestInterface $request Request sent + * @param ResponseInterface $response Response received + * @param \Throwable|null $previous Previous exception + * @param array $handlerContext Optional handler context + * @param BodySummarizerInterface|null $bodySummarizer Optional body summarizer + */ + public static function create( + RequestInterface $request, + ResponseInterface $response = null, + \Throwable $previous = null, + array $handlerContext = [], + BodySummarizerInterface $bodySummarizer = null + ): self { + if (!$response) { + return new self( + 'Error completing request', + $request, + null, + $previous, + $handlerContext + ); + } + + $level = (int) \floor($response->getStatusCode() / 100); + if ($level === 4) { + $label = 'Client error'; + $className = ClientException::class; + } elseif ($level === 5) { + $label = 'Server error'; + $className = ServerException::class; + } else { + $label = 'Unsuccessful request'; + $className = __CLASS__; + } + + $uri = $request->getUri(); + $uri = static::obfuscateUri($uri); + + // Client Error: `GET /` resulted in a `404 Not Found` response: + // ... (truncated) + $message = \sprintf( + '%s: `%s %s` resulted in a `%s %s` response', + $label, + $request->getMethod(), + $uri->__toString(), + $response->getStatusCode(), + $response->getReasonPhrase() + ); + + $summary = ($bodySummarizer ?? new BodySummarizer())->summarize($response); + + if ($summary !== null) { + $message .= ":\n{$summary}\n"; + } + + return new $className($message, $request, $response, $previous, $handlerContext); + } + + /** + * Obfuscates URI if there is a username and a password present + */ + private static function obfuscateUri(UriInterface $uri): UriInterface + { + $userInfo = $uri->getUserInfo(); + + if (false !== ($pos = \strpos($userInfo, ':'))) { + return $uri->withUserInfo(\substr($userInfo, 0, $pos), '***'); + } + + return $uri; + } + + /** + * Get the request that caused the exception + */ + public function getRequest(): RequestInterface + { + return $this->request; + } + + /** + * Get the associated response + */ + public function getResponse(): ?ResponseInterface + { + return $this->response; + } + + /** + * Check if a response was received + */ + public function hasResponse(): bool + { + return $this->response !== null; + } + + /** + * Get contextual information about the error from the underlying handler. + * + * The contents of this array will vary depending on which handler you are + * using. It may also be just an empty array. Relying on this data will + * couple you to a specific handler, but can give more debug information + * when needed. + */ + public function getHandlerContext(): array + { + return $this->handlerContext; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php b/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php new file mode 100644 index 000000000..8055e067c --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php @@ -0,0 +1,10 @@ +maxHandles = $maxHandles; + } + + public function create(RequestInterface $request, array $options): EasyHandle + { + if (isset($options['curl']['body_as_string'])) { + $options['_body_as_string'] = $options['curl']['body_as_string']; + unset($options['curl']['body_as_string']); + } + + $easy = new EasyHandle(); + $easy->request = $request; + $easy->options = $options; + $conf = $this->getDefaultConf($easy); + $this->applyMethod($easy, $conf); + $this->applyHandlerOptions($easy, $conf); + $this->applyHeaders($easy, $conf); + unset($conf['_headers']); + + // Add handler options from the request configuration options + if (isset($options['curl'])) { + $conf = \array_replace($conf, $options['curl']); + } + + $conf[\CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy); + $easy->handle = $this->handles ? \array_pop($this->handles) : \curl_init(); + curl_setopt_array($easy->handle, $conf); + + return $easy; + } + + public function release(EasyHandle $easy): void + { + $resource = $easy->handle; + unset($easy->handle); + + if (\count($this->handles) >= $this->maxHandles) { + \curl_close($resource); + } else { + // Remove all callback functions as they can hold onto references + // and are not cleaned up by curl_reset. Using curl_setopt_array + // does not work for some reason, so removing each one + // individually. + \curl_setopt($resource, \CURLOPT_HEADERFUNCTION, null); + \curl_setopt($resource, \CURLOPT_READFUNCTION, null); + \curl_setopt($resource, \CURLOPT_WRITEFUNCTION, null); + \curl_setopt($resource, \CURLOPT_PROGRESSFUNCTION, null); + \curl_reset($resource); + $this->handles[] = $resource; + } + } + + /** + * Completes a cURL transaction, either returning a response promise or a + * rejected promise. + * + * @param callable(RequestInterface, array): PromiseInterface $handler + * @param CurlFactoryInterface $factory Dictates how the handle is released + */ + public static function finish(callable $handler, EasyHandle $easy, CurlFactoryInterface $factory): PromiseInterface + { + if (isset($easy->options['on_stats'])) { + self::invokeStats($easy); + } + + if (!$easy->response || $easy->errno) { + return self::finishError($handler, $easy, $factory); + } + + // Return the response if it is present and there is no error. + $factory->release($easy); + + // Rewind the body of the response if possible. + $body = $easy->response->getBody(); + if ($body->isSeekable()) { + $body->rewind(); + } + + return new FulfilledPromise($easy->response); + } + + private static function invokeStats(EasyHandle $easy): void + { + $curlStats = \curl_getinfo($easy->handle); + $curlStats['appconnect_time'] = \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME); + $stats = new TransferStats( + $easy->request, + $easy->response, + $curlStats['total_time'], + $easy->errno, + $curlStats + ); + ($easy->options['on_stats'])($stats); + } + + /** + * @param callable(RequestInterface, array): PromiseInterface $handler + */ + private static function finishError(callable $handler, EasyHandle $easy, CurlFactoryInterface $factory): PromiseInterface + { + // Get error information and release the handle to the factory. + $ctx = [ + 'errno' => $easy->errno, + 'error' => \curl_error($easy->handle), + 'appconnect_time' => \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME), + ] + \curl_getinfo($easy->handle); + $ctx[self::CURL_VERSION_STR] = \curl_version()['version']; + $factory->release($easy); + + // Retry when nothing is present or when curl failed to rewind. + if (empty($easy->options['_err_message']) && (!$easy->errno || $easy->errno == 65)) { + return self::retryFailedRewind($handler, $easy, $ctx); + } + + return self::createRejection($easy, $ctx); + } + + private static function createRejection(EasyHandle $easy, array $ctx): PromiseInterface + { + static $connectionErrors = [ + \CURLE_OPERATION_TIMEOUTED => true, + \CURLE_COULDNT_RESOLVE_HOST => true, + \CURLE_COULDNT_CONNECT => true, + \CURLE_SSL_CONNECT_ERROR => true, + \CURLE_GOT_NOTHING => true, + ]; + + if ($easy->createResponseException) { + return P\Create::rejectionFor( + new RequestException( + 'An error was encountered while creating the response', + $easy->request, + $easy->response, + $easy->createResponseException, + $ctx + ) + ); + } + + // If an exception was encountered during the onHeaders event, then + // return a rejected promise that wraps that exception. + if ($easy->onHeadersException) { + return P\Create::rejectionFor( + new RequestException( + 'An error was encountered during the on_headers event', + $easy->request, + $easy->response, + $easy->onHeadersException, + $ctx + ) + ); + } + + $message = \sprintf( + 'cURL error %s: %s (%s)', + $ctx['errno'], + $ctx['error'], + 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html' + ); + $uriString = (string) $easy->request->getUri(); + if ($uriString !== '' && false === \strpos($ctx['error'], $uriString)) { + $message .= \sprintf(' for %s', $uriString); + } + + // Create a connection exception if it was a specific error code. + $error = isset($connectionErrors[$easy->errno]) + ? new ConnectException($message, $easy->request, null, $ctx) + : new RequestException($message, $easy->request, $easy->response, null, $ctx); + + return P\Create::rejectionFor($error); + } + + /** + * @return array + */ + private function getDefaultConf(EasyHandle $easy): array + { + $conf = [ + '_headers' => $easy->request->getHeaders(), + \CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(), + \CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''), + \CURLOPT_RETURNTRANSFER => false, + \CURLOPT_HEADER => false, + \CURLOPT_CONNECTTIMEOUT => 300, + ]; + + if (\defined('CURLOPT_PROTOCOLS')) { + $conf[\CURLOPT_PROTOCOLS] = \CURLPROTO_HTTP | \CURLPROTO_HTTPS; + } + + $version = $easy->request->getProtocolVersion(); + if ($version == 1.1) { + $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_1; + } elseif ($version == 2.0) { + $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_2_0; + } else { + $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_0; + } + + return $conf; + } + + private function applyMethod(EasyHandle $easy, array &$conf): void + { + $body = $easy->request->getBody(); + $size = $body->getSize(); + + if ($size === null || $size > 0) { + $this->applyBody($easy->request, $easy->options, $conf); + + return; + } + + $method = $easy->request->getMethod(); + if ($method === 'PUT' || $method === 'POST') { + // See https://tools.ietf.org/html/rfc7230#section-3.3.2 + if (!$easy->request->hasHeader('Content-Length')) { + $conf[\CURLOPT_HTTPHEADER][] = 'Content-Length: 0'; + } + } elseif ($method === 'HEAD') { + $conf[\CURLOPT_NOBODY] = true; + unset( + $conf[\CURLOPT_WRITEFUNCTION], + $conf[\CURLOPT_READFUNCTION], + $conf[\CURLOPT_FILE], + $conf[\CURLOPT_INFILE] + ); + } + } + + private function applyBody(RequestInterface $request, array $options, array &$conf): void + { + $size = $request->hasHeader('Content-Length') + ? (int) $request->getHeaderLine('Content-Length') + : null; + + // Send the body as a string if the size is less than 1MB OR if the + // [curl][body_as_string] request value is set. + if (($size !== null && $size < 1000000) || !empty($options['_body_as_string'])) { + $conf[\CURLOPT_POSTFIELDS] = (string) $request->getBody(); + // Don't duplicate the Content-Length header + $this->removeHeader('Content-Length', $conf); + $this->removeHeader('Transfer-Encoding', $conf); + } else { + $conf[\CURLOPT_UPLOAD] = true; + if ($size !== null) { + $conf[\CURLOPT_INFILESIZE] = $size; + $this->removeHeader('Content-Length', $conf); + } + $body = $request->getBody(); + if ($body->isSeekable()) { + $body->rewind(); + } + $conf[\CURLOPT_READFUNCTION] = static function ($ch, $fd, $length) use ($body) { + return $body->read($length); + }; + } + + // If the Expect header is not present, prevent curl from adding it + if (!$request->hasHeader('Expect')) { + $conf[\CURLOPT_HTTPHEADER][] = 'Expect:'; + } + + // cURL sometimes adds a content-type by default. Prevent this. + if (!$request->hasHeader('Content-Type')) { + $conf[\CURLOPT_HTTPHEADER][] = 'Content-Type:'; + } + } + + private function applyHeaders(EasyHandle $easy, array &$conf): void + { + foreach ($conf['_headers'] as $name => $values) { + foreach ($values as $value) { + $value = (string) $value; + if ($value === '') { + // cURL requires a special format for empty headers. + // See https://github.com/guzzle/guzzle/issues/1882 for more details. + $conf[\CURLOPT_HTTPHEADER][] = "$name;"; + } else { + $conf[\CURLOPT_HTTPHEADER][] = "$name: $value"; + } + } + } + + // Remove the Accept header if one was not set + if (!$easy->request->hasHeader('Accept')) { + $conf[\CURLOPT_HTTPHEADER][] = 'Accept:'; + } + } + + /** + * Remove a header from the options array. + * + * @param string $name Case-insensitive header to remove + * @param array $options Array of options to modify + */ + private function removeHeader(string $name, array &$options): void + { + foreach (\array_keys($options['_headers']) as $key) { + if (!\strcasecmp($key, $name)) { + unset($options['_headers'][$key]); + + return; + } + } + } + + private function applyHandlerOptions(EasyHandle $easy, array &$conf): void + { + $options = $easy->options; + if (isset($options['verify'])) { + if ($options['verify'] === false) { + unset($conf[\CURLOPT_CAINFO]); + $conf[\CURLOPT_SSL_VERIFYHOST] = 0; + $conf[\CURLOPT_SSL_VERIFYPEER] = false; + } else { + $conf[\CURLOPT_SSL_VERIFYHOST] = 2; + $conf[\CURLOPT_SSL_VERIFYPEER] = true; + if (\is_string($options['verify'])) { + // Throw an error if the file/folder/link path is not valid or doesn't exist. + if (!\file_exists($options['verify'])) { + throw new \InvalidArgumentException("SSL CA bundle not found: {$options['verify']}"); + } + // If it's a directory or a link to a directory use CURLOPT_CAPATH. + // If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO. + if ( + \is_dir($options['verify']) + || ( + \is_link($options['verify']) === true + && ($verifyLink = \readlink($options['verify'])) !== false + && \is_dir($verifyLink) + ) + ) { + $conf[\CURLOPT_CAPATH] = $options['verify']; + } else { + $conf[\CURLOPT_CAINFO] = $options['verify']; + } + } + } + } + + if (!isset($options['curl'][\CURLOPT_ENCODING]) && !empty($options['decode_content'])) { + $accept = $easy->request->getHeaderLine('Accept-Encoding'); + if ($accept) { + $conf[\CURLOPT_ENCODING] = $accept; + } else { + // The empty string enables all available decoders and implicitly + // sets a matching 'Accept-Encoding' header. + $conf[\CURLOPT_ENCODING] = ''; + // But as the user did not specify any acceptable encodings we need + // to overwrite this implicit header with an empty one. + $conf[\CURLOPT_HTTPHEADER][] = 'Accept-Encoding:'; + } + } + + if (!isset($options['sink'])) { + // Use a default temp stream if no sink was set. + $options['sink'] = \GuzzleHttp\Psr7\Utils::tryFopen('php://temp', 'w+'); + } + $sink = $options['sink']; + if (!\is_string($sink)) { + $sink = \GuzzleHttp\Psr7\Utils::streamFor($sink); + } elseif (!\is_dir(\dirname($sink))) { + // Ensure that the directory exists before failing in curl. + throw new \RuntimeException(\sprintf('Directory %s does not exist for sink value of %s', \dirname($sink), $sink)); + } else { + $sink = new LazyOpenStream($sink, 'w+'); + } + $easy->sink = $sink; + $conf[\CURLOPT_WRITEFUNCTION] = static function ($ch, $write) use ($sink): int { + return $sink->write($write); + }; + + $timeoutRequiresNoSignal = false; + if (isset($options['timeout'])) { + $timeoutRequiresNoSignal |= $options['timeout'] < 1; + $conf[\CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000; + } + + // CURL default value is CURL_IPRESOLVE_WHATEVER + if (isset($options['force_ip_resolve'])) { + if ('v4' === $options['force_ip_resolve']) { + $conf[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V4; + } elseif ('v6' === $options['force_ip_resolve']) { + $conf[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V6; + } + } + + if (isset($options['connect_timeout'])) { + $timeoutRequiresNoSignal |= $options['connect_timeout'] < 1; + $conf[\CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000; + } + + if ($timeoutRequiresNoSignal && \strtoupper(\substr(\PHP_OS, 0, 3)) !== 'WIN') { + $conf[\CURLOPT_NOSIGNAL] = true; + } + + if (isset($options['proxy'])) { + if (!\is_array($options['proxy'])) { + $conf[\CURLOPT_PROXY] = $options['proxy']; + } else { + $scheme = $easy->request->getUri()->getScheme(); + if (isset($options['proxy'][$scheme])) { + $host = $easy->request->getUri()->getHost(); + if (isset($options['proxy']['no']) && Utils::isHostInNoProxy($host, $options['proxy']['no'])) { + unset($conf[\CURLOPT_PROXY]); + } else { + $conf[\CURLOPT_PROXY] = $options['proxy'][$scheme]; + } + } + } + } + + if (isset($options['crypto_method'])) { + if (\STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT === $options['crypto_method']) { + if (!defined('CURL_SSLVERSION_TLSv1_0')) { + throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.0 not supported by your version of cURL'); + } + $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_0; + } elseif (\STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT === $options['crypto_method']) { + if (!defined('CURL_SSLVERSION_TLSv1_1')) { + throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.1 not supported by your version of cURL'); + } + $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_1; + } elseif (\STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT === $options['crypto_method']) { + if (!defined('CURL_SSLVERSION_TLSv1_2')) { + throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.2 not supported by your version of cURL'); + } + $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_2; + } elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT === $options['crypto_method']) { + if (!defined('CURL_SSLVERSION_TLSv1_3')) { + throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.3 not supported by your version of cURL'); + } + $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_3; + } else { + throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided'); + } + } + + if (isset($options['cert'])) { + $cert = $options['cert']; + if (\is_array($cert)) { + $conf[\CURLOPT_SSLCERTPASSWD] = $cert[1]; + $cert = $cert[0]; + } + if (!\file_exists($cert)) { + throw new \InvalidArgumentException("SSL certificate not found: {$cert}"); + } + // OpenSSL (versions 0.9.3 and later) also support "P12" for PKCS#12-encoded files. + // see https://curl.se/libcurl/c/CURLOPT_SSLCERTTYPE.html + $ext = pathinfo($cert, \PATHINFO_EXTENSION); + if (preg_match('#^(der|p12)$#i', $ext)) { + $conf[\CURLOPT_SSLCERTTYPE] = strtoupper($ext); + } + $conf[\CURLOPT_SSLCERT] = $cert; + } + + if (isset($options['ssl_key'])) { + if (\is_array($options['ssl_key'])) { + if (\count($options['ssl_key']) === 2) { + [$sslKey, $conf[\CURLOPT_SSLKEYPASSWD]] = $options['ssl_key']; + } else { + [$sslKey] = $options['ssl_key']; + } + } + + $sslKey = $sslKey ?? $options['ssl_key']; + + if (!\file_exists($sslKey)) { + throw new \InvalidArgumentException("SSL private key not found: {$sslKey}"); + } + $conf[\CURLOPT_SSLKEY] = $sslKey; + } + + if (isset($options['progress'])) { + $progress = $options['progress']; + if (!\is_callable($progress)) { + throw new \InvalidArgumentException('progress client option must be callable'); + } + $conf[\CURLOPT_NOPROGRESS] = false; + $conf[\CURLOPT_PROGRESSFUNCTION] = static function ($resource, int $downloadSize, int $downloaded, int $uploadSize, int $uploaded) use ($progress) { + $progress($downloadSize, $downloaded, $uploadSize, $uploaded); + }; + } + + if (!empty($options['debug'])) { + $conf[\CURLOPT_STDERR] = Utils::debugResource($options['debug']); + $conf[\CURLOPT_VERBOSE] = true; + } + } + + /** + * This function ensures that a response was set on a transaction. If one + * was not set, then the request is retried if possible. This error + * typically means you are sending a payload, curl encountered a + * "Connection died, retrying a fresh connect" error, tried to rewind the + * stream, and then encountered a "necessary data rewind wasn't possible" + * error, causing the request to be sent through curl_multi_info_read() + * without an error status. + * + * @param callable(RequestInterface, array): PromiseInterface $handler + */ + private static function retryFailedRewind(callable $handler, EasyHandle $easy, array $ctx): PromiseInterface + { + try { + // Only rewind if the body has been read from. + $body = $easy->request->getBody(); + if ($body->tell() > 0) { + $body->rewind(); + } + } catch (\RuntimeException $e) { + $ctx['error'] = 'The connection unexpectedly failed without ' + .'providing an error. The request would have been retried, ' + .'but attempting to rewind the request body failed. ' + .'Exception: '.$e; + + return self::createRejection($easy, $ctx); + } + + // Retry no more than 3 times before giving up. + if (!isset($easy->options['_curl_retries'])) { + $easy->options['_curl_retries'] = 1; + } elseif ($easy->options['_curl_retries'] == 2) { + $ctx['error'] = 'The cURL request was retried 3 times ' + .'and did not succeed. The most likely reason for the failure ' + .'is that cURL was unable to rewind the body of the request ' + .'and subsequent retries resulted in the same error. Turn on ' + .'the debug option to see what went wrong. See ' + .'https://bugs.php.net/bug.php?id=47204 for more information.'; + + return self::createRejection($easy, $ctx); + } else { + ++$easy->options['_curl_retries']; + } + + return $handler($easy->request, $easy->options); + } + + private function createHeaderFn(EasyHandle $easy): callable + { + if (isset($easy->options['on_headers'])) { + $onHeaders = $easy->options['on_headers']; + + if (!\is_callable($onHeaders)) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + } else { + $onHeaders = null; + } + + return static function ($ch, $h) use ( + $onHeaders, + $easy, + &$startingResponse + ) { + $value = \trim($h); + if ($value === '') { + $startingResponse = true; + try { + $easy->createResponse(); + } catch (\Exception $e) { + $easy->createResponseException = $e; + + return -1; + } + if ($onHeaders !== null) { + try { + $onHeaders($easy->response); + } catch (\Exception $e) { + // Associate the exception with the handle and trigger + // a curl header write error by returning 0. + $easy->onHeadersException = $e; + + return -1; + } + } + } elseif ($startingResponse) { + $startingResponse = false; + $easy->headers = [$value]; + } else { + $easy->headers[] = $value; + } + + return \strlen($h); + }; + } + + public function __destruct() + { + foreach ($this->handles as $id => $handle) { + \curl_close($handle); + unset($this->handles[$id]); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php new file mode 100644 index 000000000..fe57ed5d5 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php @@ -0,0 +1,25 @@ +factory = $options['handle_factory'] + ?? new CurlFactory(3); + } + + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + if (isset($options['delay'])) { + \usleep($options['delay'] * 1000); + } + + $easy = $this->factory->create($request, $options); + \curl_exec($easy->handle); + $easy->errno = \curl_errno($easy->handle); + + return CurlFactory::finish($this, $easy, $this->factory); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php new file mode 100644 index 000000000..a64e1821a --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php @@ -0,0 +1,267 @@ + An array of delay times, indexed by handle id in `addRequest`. + * + * @see CurlMultiHandler::addRequest + */ + private $delays = []; + + /** + * @var array An associative array of CURLMOPT_* options and corresponding values for curl_multi_setopt() + */ + private $options = []; + + /** @var resource|\CurlMultiHandle */ + private $_mh; + + /** + * This handler accepts the following options: + * + * - handle_factory: An optional factory used to create curl handles + * - select_timeout: Optional timeout (in seconds) to block before timing + * out while selecting curl handles. Defaults to 1 second. + * - options: An associative array of CURLMOPT_* options and + * corresponding values for curl_multi_setopt() + */ + public function __construct(array $options = []) + { + $this->factory = $options['handle_factory'] ?? new CurlFactory(50); + + if (isset($options['select_timeout'])) { + $this->selectTimeout = $options['select_timeout']; + } elseif ($selectTimeout = Utils::getenv('GUZZLE_CURL_SELECT_TIMEOUT')) { + @trigger_error('Since guzzlehttp/guzzle 7.2.0: Using environment variable GUZZLE_CURL_SELECT_TIMEOUT is deprecated. Use option "select_timeout" instead.', \E_USER_DEPRECATED); + $this->selectTimeout = (int) $selectTimeout; + } else { + $this->selectTimeout = 1; + } + + $this->options = $options['options'] ?? []; + + // unsetting the property forces the first access to go through + // __get(). + unset($this->_mh); + } + + /** + * @param string $name + * + * @return resource|\CurlMultiHandle + * + * @throws \BadMethodCallException when another field as `_mh` will be gotten + * @throws \RuntimeException when curl can not initialize a multi handle + */ + public function __get($name) + { + if ($name !== '_mh') { + throw new \BadMethodCallException("Can not get other property as '_mh'."); + } + + $multiHandle = \curl_multi_init(); + + if (false === $multiHandle) { + throw new \RuntimeException('Can not initialize curl multi handle.'); + } + + $this->_mh = $multiHandle; + + foreach ($this->options as $option => $value) { + // A warning is raised in case of a wrong option. + curl_multi_setopt($this->_mh, $option, $value); + } + + return $this->_mh; + } + + public function __destruct() + { + if (isset($this->_mh)) { + \curl_multi_close($this->_mh); + unset($this->_mh); + } + } + + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + $easy = $this->factory->create($request, $options); + $id = (int) $easy->handle; + + $promise = new Promise( + [$this, 'execute'], + function () use ($id) { + return $this->cancel($id); + } + ); + + $this->addRequest(['easy' => $easy, 'deferred' => $promise]); + + return $promise; + } + + /** + * Ticks the curl event loop. + */ + public function tick(): void + { + // Add any delayed handles if needed. + if ($this->delays) { + $currentTime = Utils::currentTime(); + foreach ($this->delays as $id => $delay) { + if ($currentTime >= $delay) { + unset($this->delays[$id]); + \curl_multi_add_handle( + $this->_mh, + $this->handles[$id]['easy']->handle + ); + } + } + } + + // Step through the task queue which may add additional requests. + P\Utils::queue()->run(); + + if ($this->active && \curl_multi_select($this->_mh, $this->selectTimeout) === -1) { + // Perform a usleep if a select returns -1. + // See: https://bugs.php.net/bug.php?id=61141 + \usleep(250); + } + + while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM) { + } + + $this->processMessages(); + } + + /** + * Runs until all outstanding connections have completed. + */ + public function execute(): void + { + $queue = P\Utils::queue(); + + while ($this->handles || !$queue->isEmpty()) { + // If there are no transfers, then sleep for the next delay + if (!$this->active && $this->delays) { + \usleep($this->timeToNext()); + } + $this->tick(); + } + } + + private function addRequest(array $entry): void + { + $easy = $entry['easy']; + $id = (int) $easy->handle; + $this->handles[$id] = $entry; + if (empty($easy->options['delay'])) { + \curl_multi_add_handle($this->_mh, $easy->handle); + } else { + $this->delays[$id] = Utils::currentTime() + ($easy->options['delay'] / 1000); + } + } + + /** + * Cancels a handle from sending and removes references to it. + * + * @param int $id Handle ID to cancel and remove. + * + * @return bool True on success, false on failure. + */ + private function cancel($id): bool + { + if (!is_int($id)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an integer to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + // Cannot cancel if it has been processed. + if (!isset($this->handles[$id])) { + return false; + } + + $handle = $this->handles[$id]['easy']->handle; + unset($this->delays[$id], $this->handles[$id]); + \curl_multi_remove_handle($this->_mh, $handle); + \curl_close($handle); + + return true; + } + + private function processMessages(): void + { + while ($done = \curl_multi_info_read($this->_mh)) { + if ($done['msg'] !== \CURLMSG_DONE) { + // if it's not done, then it would be premature to remove the handle. ref https://github.com/guzzle/guzzle/pull/2892#issuecomment-945150216 + continue; + } + $id = (int) $done['handle']; + \curl_multi_remove_handle($this->_mh, $done['handle']); + + if (!isset($this->handles[$id])) { + // Probably was cancelled. + continue; + } + + $entry = $this->handles[$id]; + unset($this->handles[$id], $this->delays[$id]); + $entry['easy']->errno = $done['result']; + $entry['deferred']->resolve( + CurlFactory::finish($this, $entry['easy'], $this->factory) + ); + } + } + + private function timeToNext(): int + { + $currentTime = Utils::currentTime(); + $nextTime = \PHP_INT_MAX; + foreach ($this->delays as $time) { + if ($time < $nextTime) { + $nextTime = $time; + } + } + + return ((int) \max(0, $nextTime - $currentTime)) * 1000000; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php b/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php new file mode 100644 index 000000000..1bc39f4b4 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php @@ -0,0 +1,112 @@ +headers); + + $normalizedKeys = Utils::normalizeHeaderKeys($headers); + + if (!empty($this->options['decode_content']) && isset($normalizedKeys['content-encoding'])) { + $headers['x-encoded-content-encoding'] = $headers[$normalizedKeys['content-encoding']]; + unset($headers[$normalizedKeys['content-encoding']]); + if (isset($normalizedKeys['content-length'])) { + $headers['x-encoded-content-length'] = $headers[$normalizedKeys['content-length']]; + + $bodyLength = (int) $this->sink->getSize(); + if ($bodyLength) { + $headers[$normalizedKeys['content-length']] = $bodyLength; + } else { + unset($headers[$normalizedKeys['content-length']]); + } + } + } + + // Attach a response to the easy handle with the parsed headers. + $this->response = new Response( + $status, + $headers, + $this->sink, + $ver, + $reason + ); + } + + /** + * @param string $name + * + * @return void + * + * @throws \BadMethodCallException + */ + public function __get($name) + { + $msg = $name === 'handle' ? 'The EasyHandle has been released' : 'Invalid property: '.$name; + throw new \BadMethodCallException($msg); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php b/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php new file mode 100644 index 000000000..5554b8fa9 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php @@ -0,0 +1,42 @@ +|null $queue The parameters to be passed to the append function, as an indexed array. + * @param callable|null $onFulfilled Callback to invoke when the return value is fulfilled. + * @param callable|null $onRejected Callback to invoke when the return value is rejected. + */ + public function __construct(array $queue = null, callable $onFulfilled = null, callable $onRejected = null) + { + $this->onFulfilled = $onFulfilled; + $this->onRejected = $onRejected; + + if ($queue) { + // array_values included for BC + $this->append(...array_values($queue)); + } + } + + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + if (!$this->queue) { + throw new \OutOfBoundsException('Mock queue is empty'); + } + + if (isset($options['delay']) && \is_numeric($options['delay'])) { + \usleep((int) $options['delay'] * 1000); + } + + $this->lastRequest = $request; + $this->lastOptions = $options; + $response = \array_shift($this->queue); + + if (isset($options['on_headers'])) { + if (!\is_callable($options['on_headers'])) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + try { + $options['on_headers']($response); + } catch (\Exception $e) { + $msg = 'An error was encountered during the on_headers event'; + $response = new RequestException($msg, $request, $response, $e); + } + } + + if (\is_callable($response)) { + $response = $response($request, $options); + } + + $response = $response instanceof \Throwable + ? P\Create::rejectionFor($response) + : P\Create::promiseFor($response); + + return $response->then( + function (?ResponseInterface $value) use ($request, $options) { + $this->invokeStats($request, $options, $value); + if ($this->onFulfilled) { + ($this->onFulfilled)($value); + } + + if ($value !== null && isset($options['sink'])) { + $contents = (string) $value->getBody(); + $sink = $options['sink']; + + if (\is_resource($sink)) { + \fwrite($sink, $contents); + } elseif (\is_string($sink)) { + \file_put_contents($sink, $contents); + } elseif ($sink instanceof StreamInterface) { + $sink->write($contents); + } + } + + return $value; + }, + function ($reason) use ($request, $options) { + $this->invokeStats($request, $options, null, $reason); + if ($this->onRejected) { + ($this->onRejected)($reason); + } + + return P\Create::rejectionFor($reason); + } + ); + } + + /** + * Adds one or more variadic requests, exceptions, callables, or promises + * to the queue. + * + * @param mixed ...$values + */ + public function append(...$values): void + { + foreach ($values as $value) { + if ($value instanceof ResponseInterface + || $value instanceof \Throwable + || $value instanceof PromiseInterface + || \is_callable($value) + ) { + $this->queue[] = $value; + } else { + throw new \TypeError('Expected a Response, Promise, Throwable or callable. Found '.Utils::describeType($value)); + } + } + } + + /** + * Get the last received request. + */ + public function getLastRequest(): ?RequestInterface + { + return $this->lastRequest; + } + + /** + * Get the last received request options. + */ + public function getLastOptions(): array + { + return $this->lastOptions; + } + + /** + * Returns the number of remaining items in the queue. + */ + public function count(): int + { + return \count($this->queue); + } + + public function reset(): void + { + $this->queue = []; + } + + /** + * @param mixed $reason Promise or reason. + */ + private function invokeStats( + RequestInterface $request, + array $options, + ResponseInterface $response = null, + $reason = null + ): void { + if (isset($options['on_stats'])) { + $transferTime = $options['transfer_time'] ?? 0; + $stats = new TransferStats($request, $response, $transferTime, $reason); + ($options['on_stats'])($stats); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php b/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php new file mode 100644 index 000000000..f045b526c --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php @@ -0,0 +1,51 @@ +withoutHeader('Expect'); + + // Append a content-length header if body size is zero to match + // cURL's behavior. + if (0 === $request->getBody()->getSize()) { + $request = $request->withHeader('Content-Length', '0'); + } + + return $this->createResponse( + $request, + $options, + $this->createStream($request, $options), + $startTime + ); + } catch (\InvalidArgumentException $e) { + throw $e; + } catch (\Exception $e) { + // Determine if the error was a networking error. + $message = $e->getMessage(); + // This list can probably get more comprehensive. + if (false !== \strpos($message, 'getaddrinfo') // DNS lookup failed + || false !== \strpos($message, 'Connection refused') + || false !== \strpos($message, "couldn't connect to host") // error on HHVM + || false !== \strpos($message, 'connection attempt failed') + ) { + $e = new ConnectException($e->getMessage(), $request, $e); + } else { + $e = RequestException::wrapException($request, $e); + } + $this->invokeStats($options, $request, $startTime, null, $e); + + return P\Create::rejectionFor($e); + } + } + + private function invokeStats( + array $options, + RequestInterface $request, + ?float $startTime, + ResponseInterface $response = null, + \Throwable $error = null + ): void { + if (isset($options['on_stats'])) { + $stats = new TransferStats($request, $response, Utils::currentTime() - $startTime, $error, []); + ($options['on_stats'])($stats); + } + } + + /** + * @param resource $stream + */ + private function createResponse(RequestInterface $request, array $options, $stream, ?float $startTime): PromiseInterface + { + $hdrs = $this->lastHeaders; + $this->lastHeaders = []; + + try { + [$ver, $status, $reason, $headers] = HeaderProcessor::parseHeaders($hdrs); + } catch (\Exception $e) { + return P\Create::rejectionFor( + new RequestException('An error was encountered while creating the response', $request, null, $e) + ); + } + + [$stream, $headers] = $this->checkDecode($options, $headers, $stream); + $stream = Psr7\Utils::streamFor($stream); + $sink = $stream; + + if (\strcasecmp('HEAD', $request->getMethod())) { + $sink = $this->createSink($stream, $options); + } + + try { + $response = new Psr7\Response($status, $headers, $sink, $ver, $reason); + } catch (\Exception $e) { + return P\Create::rejectionFor( + new RequestException('An error was encountered while creating the response', $request, null, $e) + ); + } + + if (isset($options['on_headers'])) { + try { + $options['on_headers']($response); + } catch (\Exception $e) { + return P\Create::rejectionFor( + new RequestException('An error was encountered during the on_headers event', $request, $response, $e) + ); + } + } + + // Do not drain when the request is a HEAD request because they have + // no body. + if ($sink !== $stream) { + $this->drain($stream, $sink, $response->getHeaderLine('Content-Length')); + } + + $this->invokeStats($options, $request, $startTime, $response, null); + + return new FulfilledPromise($response); + } + + private function createSink(StreamInterface $stream, array $options): StreamInterface + { + if (!empty($options['stream'])) { + return $stream; + } + + $sink = $options['sink'] ?? Psr7\Utils::tryFopen('php://temp', 'r+'); + + return \is_string($sink) ? new Psr7\LazyOpenStream($sink, 'w+') : Psr7\Utils::streamFor($sink); + } + + /** + * @param resource $stream + */ + private function checkDecode(array $options, array $headers, $stream): array + { + // Automatically decode responses when instructed. + if (!empty($options['decode_content'])) { + $normalizedKeys = Utils::normalizeHeaderKeys($headers); + if (isset($normalizedKeys['content-encoding'])) { + $encoding = $headers[$normalizedKeys['content-encoding']]; + if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') { + $stream = new Psr7\InflateStream(Psr7\Utils::streamFor($stream)); + $headers['x-encoded-content-encoding'] = $headers[$normalizedKeys['content-encoding']]; + + // Remove content-encoding header + unset($headers[$normalizedKeys['content-encoding']]); + + // Fix content-length header + if (isset($normalizedKeys['content-length'])) { + $headers['x-encoded-content-length'] = $headers[$normalizedKeys['content-length']]; + $length = (int) $stream->getSize(); + if ($length === 0) { + unset($headers[$normalizedKeys['content-length']]); + } else { + $headers[$normalizedKeys['content-length']] = [$length]; + } + } + } + } + } + + return [$stream, $headers]; + } + + /** + * Drains the source stream into the "sink" client option. + * + * @param string $contentLength Header specifying the amount of + * data to read. + * + * @throws \RuntimeException when the sink option is invalid. + */ + private function drain(StreamInterface $source, StreamInterface $sink, string $contentLength): StreamInterface + { + // If a content-length header is provided, then stop reading once + // that number of bytes has been read. This can prevent infinitely + // reading from a stream when dealing with servers that do not honor + // Connection: Close headers. + Psr7\Utils::copyToStream( + $source, + $sink, + (\strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1 + ); + + $sink->seek(0); + $source->close(); + + return $sink; + } + + /** + * Create a resource and check to ensure it was created successfully + * + * @param callable $callback Callable that returns stream resource + * + * @return resource + * + * @throws \RuntimeException on error + */ + private function createResource(callable $callback) + { + $errors = []; + \set_error_handler(static function ($_, $msg, $file, $line) use (&$errors): bool { + $errors[] = [ + 'message' => $msg, + 'file' => $file, + 'line' => $line, + ]; + + return true; + }); + + try { + $resource = $callback(); + } finally { + \restore_error_handler(); + } + + if (!$resource) { + $message = 'Error creating resource: '; + foreach ($errors as $err) { + foreach ($err as $key => $value) { + $message .= "[$key] $value".\PHP_EOL; + } + } + throw new \RuntimeException(\trim($message)); + } + + return $resource; + } + + /** + * @return resource + */ + private function createStream(RequestInterface $request, array $options) + { + static $methods; + if (!$methods) { + $methods = \array_flip(\get_class_methods(__CLASS__)); + } + + if (!\in_array($request->getUri()->getScheme(), ['http', 'https'])) { + throw new RequestException(\sprintf("The scheme '%s' is not supported.", $request->getUri()->getScheme()), $request); + } + + // HTTP/1.1 streams using the PHP stream wrapper require a + // Connection: close header + if ($request->getProtocolVersion() == '1.1' + && !$request->hasHeader('Connection') + ) { + $request = $request->withHeader('Connection', 'close'); + } + + // Ensure SSL is verified by default + if (!isset($options['verify'])) { + $options['verify'] = true; + } + + $params = []; + $context = $this->getDefaultContext($request); + + if (isset($options['on_headers']) && !\is_callable($options['on_headers'])) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + + if (!empty($options)) { + foreach ($options as $key => $value) { + $method = "add_{$key}"; + if (isset($methods[$method])) { + $this->{$method}($request, $context, $value, $params); + } + } + } + + if (isset($options['stream_context'])) { + if (!\is_array($options['stream_context'])) { + throw new \InvalidArgumentException('stream_context must be an array'); + } + $context = \array_replace_recursive($context, $options['stream_context']); + } + + // Microsoft NTLM authentication only supported with curl handler + if (isset($options['auth'][2]) && 'ntlm' === $options['auth'][2]) { + throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler'); + } + + $uri = $this->resolveHost($request, $options); + + $contextResource = $this->createResource( + static function () use ($context, $params) { + return \stream_context_create($context, $params); + } + ); + + return $this->createResource( + function () use ($uri, &$http_response_header, $contextResource, $context, $options, $request) { + $resource = @\fopen((string) $uri, 'r', false, $contextResource); + $this->lastHeaders = $http_response_header ?? []; + + if (false === $resource) { + throw new ConnectException(sprintf('Connection refused for URI %s', $uri), $request, null, $context); + } + + if (isset($options['read_timeout'])) { + $readTimeout = $options['read_timeout']; + $sec = (int) $readTimeout; + $usec = ($readTimeout - $sec) * 100000; + \stream_set_timeout($resource, $sec, $usec); + } + + return $resource; + } + ); + } + + private function resolveHost(RequestInterface $request, array $options): UriInterface + { + $uri = $request->getUri(); + + if (isset($options['force_ip_resolve']) && !\filter_var($uri->getHost(), \FILTER_VALIDATE_IP)) { + if ('v4' === $options['force_ip_resolve']) { + $records = \dns_get_record($uri->getHost(), \DNS_A); + if (false === $records || !isset($records[0]['ip'])) { + throw new ConnectException(\sprintf("Could not resolve IPv4 address for host '%s'", $uri->getHost()), $request); + } + + return $uri->withHost($records[0]['ip']); + } + if ('v6' === $options['force_ip_resolve']) { + $records = \dns_get_record($uri->getHost(), \DNS_AAAA); + if (false === $records || !isset($records[0]['ipv6'])) { + throw new ConnectException(\sprintf("Could not resolve IPv6 address for host '%s'", $uri->getHost()), $request); + } + + return $uri->withHost('['.$records[0]['ipv6'].']'); + } + } + + return $uri; + } + + private function getDefaultContext(RequestInterface $request): array + { + $headers = ''; + foreach ($request->getHeaders() as $name => $value) { + foreach ($value as $val) { + $headers .= "$name: $val\r\n"; + } + } + + $context = [ + 'http' => [ + 'method' => $request->getMethod(), + 'header' => $headers, + 'protocol_version' => $request->getProtocolVersion(), + 'ignore_errors' => true, + 'follow_location' => 0, + ], + 'ssl' => [ + 'peer_name' => $request->getUri()->getHost(), + ], + ]; + + $body = (string) $request->getBody(); + + if ('' !== $body) { + $context['http']['content'] = $body; + // Prevent the HTTP handler from adding a Content-Type header. + if (!$request->hasHeader('Content-Type')) { + $context['http']['header'] .= "Content-Type:\r\n"; + } + } + + $context['http']['header'] = \rtrim($context['http']['header']); + + return $context; + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_proxy(RequestInterface $request, array &$options, $value, array &$params): void + { + $uri = null; + + if (!\is_array($value)) { + $uri = $value; + } else { + $scheme = $request->getUri()->getScheme(); + if (isset($value[$scheme])) { + if (!isset($value['no']) || !Utils::isHostInNoProxy($request->getUri()->getHost(), $value['no'])) { + $uri = $value[$scheme]; + } + } + } + + if (!$uri) { + return; + } + + $parsed = $this->parse_proxy($uri); + $options['http']['proxy'] = $parsed['proxy']; + + if ($parsed['auth']) { + if (!isset($options['http']['header'])) { + $options['http']['header'] = []; + } + $options['http']['header'] .= "\r\nProxy-Authorization: {$parsed['auth']}"; + } + } + + /** + * Parses the given proxy URL to make it compatible with the format PHP's stream context expects. + */ + private function parse_proxy(string $url): array + { + $parsed = \parse_url($url); + + if ($parsed !== false && isset($parsed['scheme']) && $parsed['scheme'] === 'http') { + if (isset($parsed['host']) && isset($parsed['port'])) { + $auth = null; + if (isset($parsed['user']) && isset($parsed['pass'])) { + $auth = \base64_encode("{$parsed['user']}:{$parsed['pass']}"); + } + + return [ + 'proxy' => "tcp://{$parsed['host']}:{$parsed['port']}", + 'auth' => $auth ? "Basic {$auth}" : null, + ]; + } + } + + // Return proxy as-is. + return [ + 'proxy' => $url, + 'auth' => null, + ]; + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_timeout(RequestInterface $request, array &$options, $value, array &$params): void + { + if ($value > 0) { + $options['http']['timeout'] = $value; + } + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_crypto_method(RequestInterface $request, array &$options, $value, array &$params): void + { + if ( + $value === \STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT + || $value === \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT + || $value === \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT + || (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && $value === \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT) + ) { + $options['http']['crypto_method'] = $value; + + return; + } + + throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided'); + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_verify(RequestInterface $request, array &$options, $value, array &$params): void + { + if ($value === false) { + $options['ssl']['verify_peer'] = false; + $options['ssl']['verify_peer_name'] = false; + + return; + } + + if (\is_string($value)) { + $options['ssl']['cafile'] = $value; + if (!\file_exists($value)) { + throw new \RuntimeException("SSL CA bundle not found: $value"); + } + } elseif ($value !== true) { + throw new \InvalidArgumentException('Invalid verify request option'); + } + + $options['ssl']['verify_peer'] = true; + $options['ssl']['verify_peer_name'] = true; + $options['ssl']['allow_self_signed'] = false; + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_cert(RequestInterface $request, array &$options, $value, array &$params): void + { + if (\is_array($value)) { + $options['ssl']['passphrase'] = $value[1]; + $value = $value[0]; + } + + if (!\file_exists($value)) { + throw new \RuntimeException("SSL certificate not found: {$value}"); + } + + $options['ssl']['local_cert'] = $value; + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_progress(RequestInterface $request, array &$options, $value, array &$params): void + { + self::addNotification( + $params, + static function ($code, $a, $b, $c, $transferred, $total) use ($value) { + if ($code == \STREAM_NOTIFY_PROGRESS) { + // The upload progress cannot be determined. Use 0 for cURL compatibility: + // https://curl.se/libcurl/c/CURLOPT_PROGRESSFUNCTION.html + $value($total, $transferred, 0, 0); + } + } + ); + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_debug(RequestInterface $request, array &$options, $value, array &$params): void + { + if ($value === false) { + return; + } + + static $map = [ + \STREAM_NOTIFY_CONNECT => 'CONNECT', + \STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED', + \STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT', + \STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS', + \STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS', + \STREAM_NOTIFY_REDIRECTED => 'REDIRECTED', + \STREAM_NOTIFY_PROGRESS => 'PROGRESS', + \STREAM_NOTIFY_FAILURE => 'FAILURE', + \STREAM_NOTIFY_COMPLETED => 'COMPLETED', + \STREAM_NOTIFY_RESOLVE => 'RESOLVE', + ]; + static $args = ['severity', 'message', 'message_code', 'bytes_transferred', 'bytes_max']; + + $value = Utils::debugResource($value); + $ident = $request->getMethod().' '.$request->getUri()->withFragment(''); + self::addNotification( + $params, + static function (int $code, ...$passed) use ($ident, $value, $map, $args): void { + \fprintf($value, '<%s> [%s] ', $ident, $map[$code]); + foreach (\array_filter($passed) as $i => $v) { + \fwrite($value, $args[$i].': "'.$v.'" '); + } + \fwrite($value, "\n"); + } + ); + } + + private static function addNotification(array &$params, callable $notify): void + { + // Wrap the existing function if needed. + if (!isset($params['notification'])) { + $params['notification'] = $notify; + } else { + $params['notification'] = self::callArray([ + $params['notification'], + $notify, + ]); + } + } + + private static function callArray(array $functions): callable + { + return static function (...$args) use ($functions) { + foreach ($functions as $fn) { + $fn(...$args); + } + }; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/HandlerStack.php b/vendor/guzzlehttp/guzzle/src/HandlerStack.php new file mode 100644 index 000000000..6cb12f07a --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/HandlerStack.php @@ -0,0 +1,275 @@ +push(Middleware::httpErrors(), 'http_errors'); + $stack->push(Middleware::redirect(), 'allow_redirects'); + $stack->push(Middleware::cookies(), 'cookies'); + $stack->push(Middleware::prepareBody(), 'prepare_body'); + + return $stack; + } + + /** + * @param (callable(RequestInterface, array): PromiseInterface)|null $handler Underlying HTTP handler. + */ + public function __construct(callable $handler = null) + { + $this->handler = $handler; + } + + /** + * Invokes the handler stack as a composed handler + * + * @return ResponseInterface|PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + $handler = $this->resolve(); + + return $handler($request, $options); + } + + /** + * Dumps a string representation of the stack. + * + * @return string + */ + public function __toString() + { + $depth = 0; + $stack = []; + + if ($this->handler !== null) { + $stack[] = '0) Handler: '.$this->debugCallable($this->handler); + } + + $result = ''; + foreach (\array_reverse($this->stack) as $tuple) { + ++$depth; + $str = "{$depth}) Name: '{$tuple[1]}', "; + $str .= 'Function: '.$this->debugCallable($tuple[0]); + $result = "> {$str}\n{$result}"; + $stack[] = $str; + } + + foreach (\array_keys($stack) as $k) { + $result .= "< {$stack[$k]}\n"; + } + + return $result; + } + + /** + * Set the HTTP handler that actually returns a promise. + * + * @param callable(RequestInterface, array): PromiseInterface $handler Accepts a request and array of options and + * returns a Promise. + */ + public function setHandler(callable $handler): void + { + $this->handler = $handler; + $this->cached = null; + } + + /** + * Returns true if the builder has a handler. + */ + public function hasHandler(): bool + { + return $this->handler !== null; + } + + /** + * Unshift a middleware to the bottom of the stack. + * + * @param callable(callable): callable $middleware Middleware function + * @param string $name Name to register for this middleware. + */ + public function unshift(callable $middleware, string $name = null): void + { + \array_unshift($this->stack, [$middleware, $name]); + $this->cached = null; + } + + /** + * Push a middleware to the top of the stack. + * + * @param callable(callable): callable $middleware Middleware function + * @param string $name Name to register for this middleware. + */ + public function push(callable $middleware, string $name = ''): void + { + $this->stack[] = [$middleware, $name]; + $this->cached = null; + } + + /** + * Add a middleware before another middleware by name. + * + * @param string $findName Middleware to find + * @param callable(callable): callable $middleware Middleware function + * @param string $withName Name to register for this middleware. + */ + public function before(string $findName, callable $middleware, string $withName = ''): void + { + $this->splice($findName, $withName, $middleware, true); + } + + /** + * Add a middleware after another middleware by name. + * + * @param string $findName Middleware to find + * @param callable(callable): callable $middleware Middleware function + * @param string $withName Name to register for this middleware. + */ + public function after(string $findName, callable $middleware, string $withName = ''): void + { + $this->splice($findName, $withName, $middleware, false); + } + + /** + * Remove a middleware by instance or name from the stack. + * + * @param callable|string $remove Middleware to remove by instance or name. + */ + public function remove($remove): void + { + if (!is_string($remove) && !is_callable($remove)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a callable or string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->cached = null; + $idx = \is_callable($remove) ? 0 : 1; + $this->stack = \array_values(\array_filter( + $this->stack, + static function ($tuple) use ($idx, $remove) { + return $tuple[$idx] !== $remove; + } + )); + } + + /** + * Compose the middleware and handler into a single callable function. + * + * @return callable(RequestInterface, array): PromiseInterface + */ + public function resolve(): callable + { + if ($this->cached === null) { + if (($prev = $this->handler) === null) { + throw new \LogicException('No handler has been specified'); + } + + foreach (\array_reverse($this->stack) as $fn) { + /** @var callable(RequestInterface, array): PromiseInterface $prev */ + $prev = $fn[0]($prev); + } + + $this->cached = $prev; + } + + return $this->cached; + } + + private function findByName(string $name): int + { + foreach ($this->stack as $k => $v) { + if ($v[1] === $name) { + return $k; + } + } + + throw new \InvalidArgumentException("Middleware not found: $name"); + } + + /** + * Splices a function into the middleware list at a specific position. + */ + private function splice(string $findName, string $withName, callable $middleware, bool $before): void + { + $this->cached = null; + $idx = $this->findByName($findName); + $tuple = [$middleware, $withName]; + + if ($before) { + if ($idx === 0) { + \array_unshift($this->stack, $tuple); + } else { + $replacement = [$tuple, $this->stack[$idx]]; + \array_splice($this->stack, $idx, 1, $replacement); + } + } elseif ($idx === \count($this->stack) - 1) { + $this->stack[] = $tuple; + } else { + $replacement = [$this->stack[$idx], $tuple]; + \array_splice($this->stack, $idx, 1, $replacement); + } + } + + /** + * Provides a debug string for a given callable. + * + * @param callable|string $fn Function to write as a string. + */ + private function debugCallable($fn): string + { + if (\is_string($fn)) { + return "callable({$fn})"; + } + + if (\is_array($fn)) { + return \is_string($fn[0]) + ? "callable({$fn[0]}::{$fn[1]})" + : "callable(['".\get_class($fn[0])."', '{$fn[1]}'])"; + } + + /** @var object $fn */ + return 'callable('.\spl_object_hash($fn).')'; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/MessageFormatter.php b/vendor/guzzlehttp/guzzle/src/MessageFormatter.php new file mode 100644 index 000000000..04e9eb37a --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/MessageFormatter.php @@ -0,0 +1,199 @@ +>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}"; + public const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}'; + + /** + * @var string Template used to format log messages + */ + private $template; + + /** + * @param string $template Log message template + */ + public function __construct(?string $template = self::CLF) + { + $this->template = $template ?: self::CLF; + } + + /** + * Returns a formatted message string. + * + * @param RequestInterface $request Request that was sent + * @param ResponseInterface|null $response Response that was received + * @param \Throwable|null $error Exception that was received + */ + public function format(RequestInterface $request, ResponseInterface $response = null, \Throwable $error = null): string + { + $cache = []; + + /** @var string */ + return \preg_replace_callback( + '/{\s*([A-Za-z_\-\.0-9]+)\s*}/', + function (array $matches) use ($request, $response, $error, &$cache) { + if (isset($cache[$matches[1]])) { + return $cache[$matches[1]]; + } + + $result = ''; + switch ($matches[1]) { + case 'request': + $result = Psr7\Message::toString($request); + break; + case 'response': + $result = $response ? Psr7\Message::toString($response) : ''; + break; + case 'req_headers': + $result = \trim($request->getMethod() + .' '.$request->getRequestTarget()) + .' HTTP/'.$request->getProtocolVersion()."\r\n" + .$this->headers($request); + break; + case 'res_headers': + $result = $response ? + \sprintf( + 'HTTP/%s %d %s', + $response->getProtocolVersion(), + $response->getStatusCode(), + $response->getReasonPhrase() + )."\r\n".$this->headers($response) + : 'NULL'; + break; + case 'req_body': + $result = $request->getBody()->__toString(); + break; + case 'res_body': + if (!$response instanceof ResponseInterface) { + $result = 'NULL'; + break; + } + + $body = $response->getBody(); + + if (!$body->isSeekable()) { + $result = 'RESPONSE_NOT_LOGGEABLE'; + break; + } + + $result = $response->getBody()->__toString(); + break; + case 'ts': + case 'date_iso_8601': + $result = \gmdate('c'); + break; + case 'date_common_log': + $result = \date('d/M/Y:H:i:s O'); + break; + case 'method': + $result = $request->getMethod(); + break; + case 'version': + $result = $request->getProtocolVersion(); + break; + case 'uri': + case 'url': + $result = $request->getUri()->__toString(); + break; + case 'target': + $result = $request->getRequestTarget(); + break; + case 'req_version': + $result = $request->getProtocolVersion(); + break; + case 'res_version': + $result = $response + ? $response->getProtocolVersion() + : 'NULL'; + break; + case 'host': + $result = $request->getHeaderLine('Host'); + break; + case 'hostname': + $result = \gethostname(); + break; + case 'code': + $result = $response ? $response->getStatusCode() : 'NULL'; + break; + case 'phrase': + $result = $response ? $response->getReasonPhrase() : 'NULL'; + break; + case 'error': + $result = $error ? $error->getMessage() : 'NULL'; + break; + default: + // handle prefixed dynamic headers + if (\strpos($matches[1], 'req_header_') === 0) { + $result = $request->getHeaderLine(\substr($matches[1], 11)); + } elseif (\strpos($matches[1], 'res_header_') === 0) { + $result = $response + ? $response->getHeaderLine(\substr($matches[1], 11)) + : 'NULL'; + } + } + + $cache[$matches[1]] = $result; + + return $result; + }, + $this->template + ); + } + + /** + * Get headers from message as string + */ + private function headers(MessageInterface $message): string + { + $result = ''; + foreach ($message->getHeaders() as $name => $values) { + $result .= $name.': '.\implode(', ', $values)."\r\n"; + } + + return \trim($result); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php b/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php new file mode 100644 index 000000000..47934614a --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php @@ -0,0 +1,18 @@ +withCookieHeader($request); + + return $handler($request, $options) + ->then( + static function (ResponseInterface $response) use ($cookieJar, $request): ResponseInterface { + $cookieJar->extractCookies($request, $response); + + return $response; + } + ); + }; + }; + } + + /** + * Middleware that throws exceptions for 4xx or 5xx responses when the + * "http_errors" request option is set to true. + * + * @param BodySummarizerInterface|null $bodySummarizer The body summarizer to use in exception messages. + * + * @return callable(callable): callable Returns a function that accepts the next handler. + */ + public static function httpErrors(BodySummarizerInterface $bodySummarizer = null): callable + { + return static function (callable $handler) use ($bodySummarizer): callable { + return static function ($request, array $options) use ($handler, $bodySummarizer) { + if (empty($options['http_errors'])) { + return $handler($request, $options); + } + + return $handler($request, $options)->then( + static function (ResponseInterface $response) use ($request, $bodySummarizer) { + $code = $response->getStatusCode(); + if ($code < 400) { + return $response; + } + throw RequestException::create($request, $response, null, [], $bodySummarizer); + } + ); + }; + }; + } + + /** + * Middleware that pushes history data to an ArrayAccess container. + * + * @param array|\ArrayAccess $container Container to hold the history (by reference). + * + * @return callable(callable): callable Returns a function that accepts the next handler. + * + * @throws \InvalidArgumentException if container is not an array or ArrayAccess. + */ + public static function history(&$container): callable + { + if (!\is_array($container) && !$container instanceof \ArrayAccess) { + throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess'); + } + + return static function (callable $handler) use (&$container): callable { + return static function (RequestInterface $request, array $options) use ($handler, &$container) { + return $handler($request, $options)->then( + static function ($value) use ($request, &$container, $options) { + $container[] = [ + 'request' => $request, + 'response' => $value, + 'error' => null, + 'options' => $options, + ]; + + return $value; + }, + static function ($reason) use ($request, &$container, $options) { + $container[] = [ + 'request' => $request, + 'response' => null, + 'error' => $reason, + 'options' => $options, + ]; + + return P\Create::rejectionFor($reason); + } + ); + }; + }; + } + + /** + * Middleware that invokes a callback before and after sending a request. + * + * The provided listener cannot modify or alter the response. It simply + * "taps" into the chain to be notified before returning the promise. The + * before listener accepts a request and options array, and the after + * listener accepts a request, options array, and response promise. + * + * @param callable $before Function to invoke before forwarding the request. + * @param callable $after Function invoked after forwarding. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function tap(callable $before = null, callable $after = null): callable + { + return static function (callable $handler) use ($before, $after): callable { + return static function (RequestInterface $request, array $options) use ($handler, $before, $after) { + if ($before) { + $before($request, $options); + } + $response = $handler($request, $options); + if ($after) { + $after($request, $options, $response); + } + + return $response; + }; + }; + } + + /** + * Middleware that handles request redirects. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function redirect(): callable + { + return static function (callable $handler): RedirectMiddleware { + return new RedirectMiddleware($handler); + }; + } + + /** + * Middleware that retries requests based on the boolean result of + * invoking the provided "decider" function. + * + * If no delay function is provided, a simple implementation of exponential + * backoff will be utilized. + * + * @param callable $decider Function that accepts the number of retries, + * a request, [response], and [exception] and + * returns true if the request is to be retried. + * @param callable $delay Function that accepts the number of retries and + * returns the number of milliseconds to delay. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function retry(callable $decider, callable $delay = null): callable + { + return static function (callable $handler) use ($decider, $delay): RetryMiddleware { + return new RetryMiddleware($decider, $handler, $delay); + }; + } + + /** + * Middleware that logs requests, responses, and errors using a message + * formatter. + * + * @phpstan-param \Psr\Log\LogLevel::* $logLevel Level at which to log requests. + * + * @param LoggerInterface $logger Logs messages. + * @param MessageFormatterInterface|MessageFormatter $formatter Formatter used to create message strings. + * @param string $logLevel Level at which to log requests. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function log(LoggerInterface $logger, $formatter, string $logLevel = 'info'): callable + { + // To be compatible with Guzzle 7.1.x we need to allow users to pass a MessageFormatter + if (!$formatter instanceof MessageFormatter && !$formatter instanceof MessageFormatterInterface) { + throw new \LogicException(sprintf('Argument 2 to %s::log() must be of type %s', self::class, MessageFormatterInterface::class)); + } + + return static function (callable $handler) use ($logger, $formatter, $logLevel): callable { + return static function (RequestInterface $request, array $options = []) use ($handler, $logger, $formatter, $logLevel) { + return $handler($request, $options)->then( + static function ($response) use ($logger, $request, $formatter, $logLevel): ResponseInterface { + $message = $formatter->format($request, $response); + $logger->log($logLevel, $message); + + return $response; + }, + static function ($reason) use ($logger, $request, $formatter): PromiseInterface { + $response = $reason instanceof RequestException ? $reason->getResponse() : null; + $message = $formatter->format($request, $response, P\Create::exceptionFor($reason)); + $logger->error($message); + + return P\Create::rejectionFor($reason); + } + ); + }; + }; + } + + /** + * This middleware adds a default content-type if possible, a default + * content-length or transfer-encoding header, and the expect header. + */ + public static function prepareBody(): callable + { + return static function (callable $handler): PrepareBodyMiddleware { + return new PrepareBodyMiddleware($handler); + }; + } + + /** + * Middleware that applies a map function to the request before passing to + * the next handler. + * + * @param callable $fn Function that accepts a RequestInterface and returns + * a RequestInterface. + */ + public static function mapRequest(callable $fn): callable + { + return static function (callable $handler) use ($fn): callable { + return static function (RequestInterface $request, array $options) use ($handler, $fn) { + return $handler($fn($request), $options); + }; + }; + } + + /** + * Middleware that applies a map function to the resolved promise's + * response. + * + * @param callable $fn Function that accepts a ResponseInterface and + * returns a ResponseInterface. + */ + public static function mapResponse(callable $fn): callable + { + return static function (callable $handler) use ($fn): callable { + return static function (RequestInterface $request, array $options) use ($handler, $fn) { + return $handler($request, $options)->then($fn); + }; + }; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Pool.php b/vendor/guzzlehttp/guzzle/src/Pool.php new file mode 100644 index 000000000..6277c61fb --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Pool.php @@ -0,0 +1,125 @@ + $rfn) { + if ($rfn instanceof RequestInterface) { + yield $key => $client->sendAsync($rfn, $opts); + } elseif (\is_callable($rfn)) { + yield $key => $rfn($opts); + } else { + throw new \InvalidArgumentException('Each value yielded by the iterator must be a Psr7\Http\Message\RequestInterface or a callable that returns a promise that fulfills with a Psr7\Message\Http\ResponseInterface object.'); + } + } + }; + + $this->each = new EachPromise($requests(), $config); + } + + /** + * Get promise + */ + public function promise(): PromiseInterface + { + return $this->each->promise(); + } + + /** + * Sends multiple requests concurrently and returns an array of responses + * and exceptions that uses the same ordering as the provided requests. + * + * IMPORTANT: This method keeps every request and response in memory, and + * as such, is NOT recommended when sending a large number or an + * indeterminate number of requests concurrently. + * + * @param ClientInterface $client Client used to send the requests + * @param array|\Iterator $requests Requests to send concurrently. + * @param array $options Passes through the options available in + * {@see \GuzzleHttp\Pool::__construct} + * + * @return array Returns an array containing the response or an exception + * in the same order that the requests were sent. + * + * @throws \InvalidArgumentException if the event format is incorrect. + */ + public static function batch(ClientInterface $client, $requests, array $options = []): array + { + $res = []; + self::cmpCallback($options, 'fulfilled', $res); + self::cmpCallback($options, 'rejected', $res); + $pool = new static($client, $requests, $options); + $pool->promise()->wait(); + \ksort($res); + + return $res; + } + + /** + * Execute callback(s) + */ + private static function cmpCallback(array &$options, string $name, array &$results): void + { + if (!isset($options[$name])) { + $options[$name] = static function ($v, $k) use (&$results) { + $results[$k] = $v; + }; + } else { + $currentFn = $options[$name]; + $options[$name] = static function ($v, $k) use (&$results, $currentFn) { + $currentFn($v, $k); + $results[$k] = $v; + }; + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php b/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php new file mode 100644 index 000000000..0a8de8128 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php @@ -0,0 +1,105 @@ +nextHandler = $nextHandler; + } + + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + $fn = $this->nextHandler; + + // Don't do anything if the request has no body. + if ($request->getBody()->getSize() === 0) { + return $fn($request, $options); + } + + $modify = []; + + // Add a default content-type if possible. + if (!$request->hasHeader('Content-Type')) { + if ($uri = $request->getBody()->getMetadata('uri')) { + if (is_string($uri) && $type = Psr7\MimeType::fromFilename($uri)) { + $modify['set_headers']['Content-Type'] = $type; + } + } + } + + // Add a default content-length or transfer-encoding header. + if (!$request->hasHeader('Content-Length') + && !$request->hasHeader('Transfer-Encoding') + ) { + $size = $request->getBody()->getSize(); + if ($size !== null) { + $modify['set_headers']['Content-Length'] = $size; + } else { + $modify['set_headers']['Transfer-Encoding'] = 'chunked'; + } + } + + // Add the expect header if needed. + $this->addExpectHeader($request, $options, $modify); + + return $fn(Psr7\Utils::modifyRequest($request, $modify), $options); + } + + /** + * Add expect header + */ + private function addExpectHeader(RequestInterface $request, array $options, array &$modify): void + { + // Determine if the Expect header should be used + if ($request->hasHeader('Expect')) { + return; + } + + $expect = $options['expect'] ?? null; + + // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0 + if ($expect === false || $request->getProtocolVersion() < 1.1) { + return; + } + + // The expect header is unconditionally enabled + if ($expect === true) { + $modify['set_headers']['Expect'] = '100-Continue'; + + return; + } + + // By default, send the expect header when the payload is > 1mb + if ($expect === null) { + $expect = 1048576; + } + + // Always add if the body cannot be rewound, the size cannot be + // determined, or the size is greater than the cutoff threshold + $body = $request->getBody(); + $size = $body->getSize(); + + if ($size === null || $size >= (int) $expect || !$body->isSeekable()) { + $modify['set_headers']['Expect'] = '100-Continue'; + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php new file mode 100644 index 000000000..7aa21a623 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php @@ -0,0 +1,228 @@ + 5, + 'protocols' => ['http', 'https'], + 'strict' => false, + 'referer' => false, + 'track_redirects' => false, + ]; + + /** + * @var callable(RequestInterface, array): PromiseInterface + */ + private $nextHandler; + + /** + * @param callable(RequestInterface, array): PromiseInterface $nextHandler Next handler to invoke. + */ + public function __construct(callable $nextHandler) + { + $this->nextHandler = $nextHandler; + } + + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + $fn = $this->nextHandler; + + if (empty($options['allow_redirects'])) { + return $fn($request, $options); + } + + if ($options['allow_redirects'] === true) { + $options['allow_redirects'] = self::$defaultSettings; + } elseif (!\is_array($options['allow_redirects'])) { + throw new \InvalidArgumentException('allow_redirects must be true, false, or array'); + } else { + // Merge the default settings with the provided settings + $options['allow_redirects'] += self::$defaultSettings; + } + + if (empty($options['allow_redirects']['max'])) { + return $fn($request, $options); + } + + return $fn($request, $options) + ->then(function (ResponseInterface $response) use ($request, $options) { + return $this->checkRedirect($request, $options, $response); + }); + } + + /** + * @return ResponseInterface|PromiseInterface + */ + public function checkRedirect(RequestInterface $request, array $options, ResponseInterface $response) + { + if (\strpos((string) $response->getStatusCode(), '3') !== 0 + || !$response->hasHeader('Location') + ) { + return $response; + } + + $this->guardMax($request, $response, $options); + $nextRequest = $this->modifyRequest($request, $options, $response); + + // If authorization is handled by curl, unset it if URI is cross-origin. + if (Psr7\UriComparator::isCrossOrigin($request->getUri(), $nextRequest->getUri()) && defined('\CURLOPT_HTTPAUTH')) { + unset( + $options['curl'][\CURLOPT_HTTPAUTH], + $options['curl'][\CURLOPT_USERPWD] + ); + } + + if (isset($options['allow_redirects']['on_redirect'])) { + ($options['allow_redirects']['on_redirect'])( + $request, + $response, + $nextRequest->getUri() + ); + } + + $promise = $this($nextRequest, $options); + + // Add headers to be able to track history of redirects. + if (!empty($options['allow_redirects']['track_redirects'])) { + return $this->withTracking( + $promise, + (string) $nextRequest->getUri(), + $response->getStatusCode() + ); + } + + return $promise; + } + + /** + * Enable tracking on promise. + */ + private function withTracking(PromiseInterface $promise, string $uri, int $statusCode): PromiseInterface + { + return $promise->then( + static function (ResponseInterface $response) use ($uri, $statusCode) { + // Note that we are pushing to the front of the list as this + // would be an earlier response than what is currently present + // in the history header. + $historyHeader = $response->getHeader(self::HISTORY_HEADER); + $statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER); + \array_unshift($historyHeader, $uri); + \array_unshift($statusHeader, (string) $statusCode); + + return $response->withHeader(self::HISTORY_HEADER, $historyHeader) + ->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader); + } + ); + } + + /** + * Check for too many redirects. + * + * @throws TooManyRedirectsException Too many redirects. + */ + private function guardMax(RequestInterface $request, ResponseInterface $response, array &$options): void + { + $current = $options['__redirect_count'] + ?? 0; + $options['__redirect_count'] = $current + 1; + $max = $options['allow_redirects']['max']; + + if ($options['__redirect_count'] > $max) { + throw new TooManyRedirectsException("Will not follow more than {$max} redirects", $request, $response); + } + } + + public function modifyRequest(RequestInterface $request, array $options, ResponseInterface $response): RequestInterface + { + // Request modifications to apply. + $modify = []; + $protocols = $options['allow_redirects']['protocols']; + + // Use a GET request if this is an entity enclosing request and we are + // not forcing RFC compliance, but rather emulating what all browsers + // would do. + $statusCode = $response->getStatusCode(); + if ($statusCode == 303 + || ($statusCode <= 302 && !$options['allow_redirects']['strict']) + ) { + $safeMethods = ['GET', 'HEAD', 'OPTIONS']; + $requestMethod = $request->getMethod(); + + $modify['method'] = in_array($requestMethod, $safeMethods) ? $requestMethod : 'GET'; + $modify['body'] = ''; + } + + $uri = self::redirectUri($request, $response, $protocols); + if (isset($options['idn_conversion']) && ($options['idn_conversion'] !== false)) { + $idnOptions = ($options['idn_conversion'] === true) ? \IDNA_DEFAULT : $options['idn_conversion']; + $uri = Utils::idnUriConvert($uri, $idnOptions); + } + + $modify['uri'] = $uri; + Psr7\Message::rewindBody($request); + + // Add the Referer header if it is told to do so and only + // add the header if we are not redirecting from https to http. + if ($options['allow_redirects']['referer'] + && $modify['uri']->getScheme() === $request->getUri()->getScheme() + ) { + $uri = $request->getUri()->withUserInfo(''); + $modify['set_headers']['Referer'] = (string) $uri; + } else { + $modify['remove_headers'][] = 'Referer'; + } + + // Remove Authorization and Cookie headers if URI is cross-origin. + if (Psr7\UriComparator::isCrossOrigin($request->getUri(), $modify['uri'])) { + $modify['remove_headers'][] = 'Authorization'; + $modify['remove_headers'][] = 'Cookie'; + } + + return Psr7\Utils::modifyRequest($request, $modify); + } + + /** + * Set the appropriate URL on the request based on the location header. + */ + private static function redirectUri( + RequestInterface $request, + ResponseInterface $response, + array $protocols + ): UriInterface { + $location = Psr7\UriResolver::resolve( + $request->getUri(), + new Psr7\Uri($response->getHeaderLine('Location')) + ); + + // Ensure that the redirect URI is allowed based on the protocols. + if (!\in_array($location->getScheme(), $protocols)) { + throw new BadResponseException(\sprintf('Redirect URI, %s, does not use one of the allowed redirect protocols: %s', $location, \implode(', ', $protocols)), $request, $response); + } + + return $location; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/RequestOptions.php b/vendor/guzzlehttp/guzzle/src/RequestOptions.php new file mode 100644 index 000000000..bf3b02b6b --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/RequestOptions.php @@ -0,0 +1,276 @@ +decider = $decider; + $this->nextHandler = $nextHandler; + $this->delay = $delay ?: __CLASS__.'::exponentialDelay'; + } + + /** + * Default exponential backoff delay function. + * + * @return int milliseconds. + */ + public static function exponentialDelay(int $retries): int + { + return (int) 2 ** ($retries - 1) * 1000; + } + + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + if (!isset($options['retries'])) { + $options['retries'] = 0; + } + + $fn = $this->nextHandler; + + return $fn($request, $options) + ->then( + $this->onFulfilled($request, $options), + $this->onRejected($request, $options) + ); + } + + /** + * Execute fulfilled closure + */ + private function onFulfilled(RequestInterface $request, array $options): callable + { + return function ($value) use ($request, $options) { + if (!($this->decider)( + $options['retries'], + $request, + $value, + null + )) { + return $value; + } + + return $this->doRetry($request, $options, $value); + }; + } + + /** + * Execute rejected closure + */ + private function onRejected(RequestInterface $req, array $options): callable + { + return function ($reason) use ($req, $options) { + if (!($this->decider)( + $options['retries'], + $req, + null, + $reason + )) { + return P\Create::rejectionFor($reason); + } + + return $this->doRetry($req, $options); + }; + } + + private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null): PromiseInterface + { + $options['delay'] = ($this->delay)(++$options['retries'], $response, $request); + + return $this($request, $options); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/TransferStats.php b/vendor/guzzlehttp/guzzle/src/TransferStats.php new file mode 100644 index 000000000..2ce9e38f2 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/TransferStats.php @@ -0,0 +1,133 @@ +request = $request; + $this->response = $response; + $this->transferTime = $transferTime; + $this->handlerErrorData = $handlerErrorData; + $this->handlerStats = $handlerStats; + } + + public function getRequest(): RequestInterface + { + return $this->request; + } + + /** + * Returns the response that was received (if any). + */ + public function getResponse(): ?ResponseInterface + { + return $this->response; + } + + /** + * Returns true if a response was received. + */ + public function hasResponse(): bool + { + return $this->response !== null; + } + + /** + * Gets handler specific error data. + * + * This might be an exception, a integer representing an error code, or + * anything else. Relying on this value assumes that you know what handler + * you are using. + * + * @return mixed + */ + public function getHandlerErrorData() + { + return $this->handlerErrorData; + } + + /** + * Get the effective URI the request was sent to. + */ + public function getEffectiveUri(): UriInterface + { + return $this->request->getUri(); + } + + /** + * Get the estimated time the request was being transferred by the handler. + * + * @return float|null Time in seconds. + */ + public function getTransferTime(): ?float + { + return $this->transferTime; + } + + /** + * Gets an array of all of the handler specific transfer data. + */ + public function getHandlerStats(): array + { + return $this->handlerStats; + } + + /** + * Get a specific handler statistic from the handler by name. + * + * @param string $stat Handler specific transfer stat to retrieve. + * + * @return mixed|null + */ + public function getHandlerStat(string $stat) + { + return $this->handlerStats[$stat] ?? null; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Utils.php b/vendor/guzzlehttp/guzzle/src/Utils.php new file mode 100644 index 000000000..fcf571d6b --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Utils.php @@ -0,0 +1,385 @@ +getHost()) { + $asciiHost = self::idnToAsci($uri->getHost(), $options, $info); + if ($asciiHost === false) { + $errorBitSet = $info['errors'] ?? 0; + + $errorConstants = array_filter(array_keys(get_defined_constants()), static function (string $name): bool { + return substr($name, 0, 11) === 'IDNA_ERROR_'; + }); + + $errors = []; + foreach ($errorConstants as $errorConstant) { + if ($errorBitSet & constant($errorConstant)) { + $errors[] = $errorConstant; + } + } + + $errorMessage = 'IDN conversion failed'; + if ($errors) { + $errorMessage .= ' (errors: '.implode(', ', $errors).')'; + } + + throw new InvalidArgumentException($errorMessage); + } + if ($uri->getHost() !== $asciiHost) { + // Replace URI only if the ASCII version is different + $uri = $uri->withHost($asciiHost); + } + } + + return $uri; + } + + /** + * @internal + */ + public static function getenv(string $name): ?string + { + if (isset($_SERVER[$name])) { + return (string) $_SERVER[$name]; + } + + if (\PHP_SAPI === 'cli' && ($value = \getenv($name)) !== false && $value !== null) { + return (string) $value; + } + + return null; + } + + /** + * @return string|false + */ + private static function idnToAsci(string $domain, int $options, ?array &$info = []) + { + if (\function_exists('idn_to_ascii') && \defined('INTL_IDNA_VARIANT_UTS46')) { + return \idn_to_ascii($domain, $options, \INTL_IDNA_VARIANT_UTS46, $info); + } + + throw new \Error('ext-idn or symfony/polyfill-intl-idn not loaded or too old'); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/functions.php b/vendor/guzzlehttp/guzzle/src/functions.php new file mode 100644 index 000000000..5edc66ab1 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/functions.php @@ -0,0 +1,167 @@ + +Copyright (c) 2015 Graham Campbell +Copyright (c) 2017 Tobias Schultze +Copyright (c) 2020 Tobias Nyholm + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/guzzlehttp/promises/README.md b/vendor/guzzlehttp/promises/README.md new file mode 100644 index 000000000..a32d3d29c --- /dev/null +++ b/vendor/guzzlehttp/promises/README.md @@ -0,0 +1,559 @@ +# Guzzle Promises + +[Promises/A+](https://promisesaplus.com/) implementation that handles promise +chaining and resolution iteratively, allowing for "infinite" promise chaining +while keeping the stack size constant. Read [this blog post](https://blog.domenic.me/youre-missing-the-point-of-promises/) +for a general introduction to promises. + +- [Features](#features) +- [Quick start](#quick-start) +- [Synchronous wait](#synchronous-wait) +- [Cancellation](#cancellation) +- [API](#api) + - [Promise](#promise) + - [FulfilledPromise](#fulfilledpromise) + - [RejectedPromise](#rejectedpromise) +- [Promise interop](#promise-interop) +- [Implementation notes](#implementation-notes) + + +## Features + +- [Promises/A+](https://promisesaplus.com/) implementation. +- Promise resolution and chaining is handled iteratively, allowing for + "infinite" promise chaining. +- Promises have a synchronous `wait` method. +- Promises can be cancelled. +- Works with any object that has a `then` function. +- C# style async/await coroutine promises using + `GuzzleHttp\Promise\Coroutine::of()`. + + +## Installation + +```shell +composer require guzzlehttp/promises +``` + + +## Version Guidance + +| Version | Status | PHP Version | +|---------|------------------------|--------------| +| 1.x | Bug and security fixes | >=5.5,<8.3 | +| 2.x | Latest | >=7.2.5,<8.4 | + + +## Quick Start + +A *promise* represents the eventual result of an asynchronous operation. The +primary way of interacting with a promise is through its `then` method, which +registers callbacks to receive either a promise's eventual value or the reason +why the promise cannot be fulfilled. + +### Callbacks + +Callbacks are registered with the `then` method by providing an optional +`$onFulfilled` followed by an optional `$onRejected` function. + + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise->then( + // $onFulfilled + function ($value) { + echo 'The promise was fulfilled.'; + }, + // $onRejected + function ($reason) { + echo 'The promise was rejected.'; + } +); +``` + +*Resolving* a promise means that you either fulfill a promise with a *value* or +reject a promise with a *reason*. Resolving a promise triggers callbacks +registered with the promise's `then` method. These callbacks are triggered +only once and in the order in which they were added. + +### Resolving a Promise + +Promises are fulfilled using the `resolve($value)` method. Resolving a promise +with any value other than a `GuzzleHttp\Promise\RejectedPromise` will trigger +all of the onFulfilled callbacks (resolving a promise with a rejected promise +will reject the promise and trigger the `$onRejected` callbacks). + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise + ->then(function ($value) { + // Return a value and don't break the chain + return "Hello, " . $value; + }) + // This then is executed after the first then and receives the value + // returned from the first then. + ->then(function ($value) { + echo $value; + }); + +// Resolving the promise triggers the $onFulfilled callbacks and outputs +// "Hello, reader." +$promise->resolve('reader.'); +``` + +### Promise Forwarding + +Promises can be chained one after the other. Each then in the chain is a new +promise. The return value of a promise is what's forwarded to the next +promise in the chain. Returning a promise in a `then` callback will cause the +subsequent promises in the chain to only be fulfilled when the returned promise +has been fulfilled. The next promise in the chain will be invoked with the +resolved value of the promise. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$nextPromise = new Promise(); + +$promise + ->then(function ($value) use ($nextPromise) { + echo $value; + return $nextPromise; + }) + ->then(function ($value) { + echo $value; + }); + +// Triggers the first callback and outputs "A" +$promise->resolve('A'); +// Triggers the second callback and outputs "B" +$nextPromise->resolve('B'); +``` + +### Promise Rejection + +When a promise is rejected, the `$onRejected` callbacks are invoked with the +rejection reason. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise->then(null, function ($reason) { + echo $reason; +}); + +$promise->reject('Error!'); +// Outputs "Error!" +``` + +### Rejection Forwarding + +If an exception is thrown in an `$onRejected` callback, subsequent +`$onRejected` callbacks are invoked with the thrown exception as the reason. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise->then(null, function ($reason) { + throw new Exception($reason); +})->then(null, function ($reason) { + assert($reason->getMessage() === 'Error!'); +}); + +$promise->reject('Error!'); +``` + +You can also forward a rejection down the promise chain by returning a +`GuzzleHttp\Promise\RejectedPromise` in either an `$onFulfilled` or +`$onRejected` callback. + +```php +use GuzzleHttp\Promise\Promise; +use GuzzleHttp\Promise\RejectedPromise; + +$promise = new Promise(); +$promise->then(null, function ($reason) { + return new RejectedPromise($reason); +})->then(null, function ($reason) { + assert($reason === 'Error!'); +}); + +$promise->reject('Error!'); +``` + +If an exception is not thrown in a `$onRejected` callback and the callback +does not return a rejected promise, downstream `$onFulfilled` callbacks are +invoked using the value returned from the `$onRejected` callback. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise + ->then(null, function ($reason) { + return "It's ok"; + }) + ->then(function ($value) { + assert($value === "It's ok"); + }); + +$promise->reject('Error!'); +``` + + +## Synchronous Wait + +You can synchronously force promises to complete using a promise's `wait` +method. When creating a promise, you can provide a wait function that is used +to synchronously force a promise to complete. When a wait function is invoked +it is expected to deliver a value to the promise or reject the promise. If the +wait function does not deliver a value, then an exception is thrown. The wait +function provided to a promise constructor is invoked when the `wait` function +of the promise is called. + +```php +$promise = new Promise(function () use (&$promise) { + $promise->resolve('foo'); +}); + +// Calling wait will return the value of the promise. +echo $promise->wait(); // outputs "foo" +``` + +If an exception is encountered while invoking the wait function of a promise, +the promise is rejected with the exception and the exception is thrown. + +```php +$promise = new Promise(function () use (&$promise) { + throw new Exception('foo'); +}); + +$promise->wait(); // throws the exception. +``` + +Calling `wait` on a promise that has been fulfilled will not trigger the wait +function. It will simply return the previously resolved value. + +```php +$promise = new Promise(function () { die('this is not called!'); }); +$promise->resolve('foo'); +echo $promise->wait(); // outputs "foo" +``` + +Calling `wait` on a promise that has been rejected will throw an exception. If +the rejection reason is an instance of `\Exception` the reason is thrown. +Otherwise, a `GuzzleHttp\Promise\RejectionException` is thrown and the reason +can be obtained by calling the `getReason` method of the exception. + +```php +$promise = new Promise(); +$promise->reject('foo'); +$promise->wait(); +``` + +> PHP Fatal error: Uncaught exception 'GuzzleHttp\Promise\RejectionException' with message 'The promise was rejected with value: foo' + +### Unwrapping a Promise + +When synchronously waiting on a promise, you are joining the state of the +promise into the current state of execution (i.e., return the value of the +promise if it was fulfilled or throw an exception if it was rejected). This is +called "unwrapping" the promise. Waiting on a promise will by default unwrap +the promise state. + +You can force a promise to resolve and *not* unwrap the state of the promise +by passing `false` to the first argument of the `wait` function: + +```php +$promise = new Promise(); +$promise->reject('foo'); +// This will not throw an exception. It simply ensures the promise has +// been resolved. +$promise->wait(false); +``` + +When unwrapping a promise, the resolved value of the promise will be waited +upon until the unwrapped value is not a promise. This means that if you resolve +promise A with a promise B and unwrap promise A, the value returned by the +wait function will be the value delivered to promise B. + +**Note**: when you do not unwrap the promise, no value is returned. + + +## Cancellation + +You can cancel a promise that has not yet been fulfilled using the `cancel()` +method of a promise. When creating a promise you can provide an optional +cancel function that when invoked cancels the action of computing a resolution +of the promise. + + +## API + +### Promise + +When creating a promise object, you can provide an optional `$waitFn` and +`$cancelFn`. `$waitFn` is a function that is invoked with no arguments and is +expected to resolve the promise. `$cancelFn` is a function with no arguments +that is expected to cancel the computation of a promise. It is invoked when the +`cancel()` method of a promise is called. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise( + function () use (&$promise) { + $promise->resolve('waited'); + }, + function () { + // do something that will cancel the promise computation (e.g., close + // a socket, cancel a database query, etc...) + } +); + +assert('waited' === $promise->wait()); +``` + +A promise has the following methods: + +- `then(callable $onFulfilled, callable $onRejected) : PromiseInterface` + + Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler. + +- `otherwise(callable $onRejected) : PromiseInterface` + + Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled. + +- `wait($unwrap = true) : mixed` + + Synchronously waits on the promise to complete. + + `$unwrap` controls whether or not the value of the promise is returned for a + fulfilled promise or if an exception is thrown if the promise is rejected. + This is set to `true` by default. + +- `cancel()` + + Attempts to cancel the promise if possible. The promise being cancelled and + the parent most ancestor that has not yet been resolved will also be + cancelled. Any promises waiting on the cancelled promise to resolve will also + be cancelled. + +- `getState() : string` + + Returns the state of the promise. One of `pending`, `fulfilled`, or + `rejected`. + +- `resolve($value)` + + Fulfills the promise with the given `$value`. + +- `reject($reason)` + + Rejects the promise with the given `$reason`. + + +### FulfilledPromise + +A fulfilled promise can be created to represent a promise that has been +fulfilled. + +```php +use GuzzleHttp\Promise\FulfilledPromise; + +$promise = new FulfilledPromise('value'); + +// Fulfilled callbacks are immediately invoked. +$promise->then(function ($value) { + echo $value; +}); +``` + + +### RejectedPromise + +A rejected promise can be created to represent a promise that has been +rejected. + +```php +use GuzzleHttp\Promise\RejectedPromise; + +$promise = new RejectedPromise('Error'); + +// Rejected callbacks are immediately invoked. +$promise->then(null, function ($reason) { + echo $reason; +}); +``` + + +## Promise Interoperability + +This library works with foreign promises that have a `then` method. This means +you can use Guzzle promises with [React promises](https://github.com/reactphp/promise) +for example. When a foreign promise is returned inside of a then method +callback, promise resolution will occur recursively. + +```php +// Create a React promise +$deferred = new React\Promise\Deferred(); +$reactPromise = $deferred->promise(); + +// Create a Guzzle promise that is fulfilled with a React promise. +$guzzlePromise = new GuzzleHttp\Promise\Promise(); +$guzzlePromise->then(function ($value) use ($reactPromise) { + // Do something something with the value... + // Return the React promise + return $reactPromise; +}); +``` + +Please note that wait and cancel chaining is no longer possible when forwarding +a foreign promise. You will need to wrap a third-party promise with a Guzzle +promise in order to utilize wait and cancel functions with foreign promises. + + +### Event Loop Integration + +In order to keep the stack size constant, Guzzle promises are resolved +asynchronously using a task queue. When waiting on promises synchronously, the +task queue will be automatically run to ensure that the blocking promise and +any forwarded promises are resolved. When using promises asynchronously in an +event loop, you will need to run the task queue on each tick of the loop. If +you do not run the task queue, then promises will not be resolved. + +You can run the task queue using the `run()` method of the global task queue +instance. + +```php +// Get the global task queue +$queue = GuzzleHttp\Promise\Utils::queue(); +$queue->run(); +``` + +For example, you could use Guzzle promises with React using a periodic timer: + +```php +$loop = React\EventLoop\Factory::create(); +$loop->addPeriodicTimer(0, [$queue, 'run']); +``` + + +## Implementation Notes + +### Promise Resolution and Chaining is Handled Iteratively + +By shuffling pending handlers from one owner to another, promises are +resolved iteratively, allowing for "infinite" then chaining. + +```php +then(function ($v) { + // The stack size remains constant (a good thing) + echo xdebug_get_stack_depth() . ', '; + return $v + 1; + }); +} + +$parent->resolve(0); +var_dump($p->wait()); // int(1000) + +``` + +When a promise is fulfilled or rejected with a non-promise value, the promise +then takes ownership of the handlers of each child promise and delivers values +down the chain without using recursion. + +When a promise is resolved with another promise, the original promise transfers +all of its pending handlers to the new promise. When the new promise is +eventually resolved, all of the pending handlers are delivered the forwarded +value. + +### A Promise is the Deferred + +Some promise libraries implement promises using a deferred object to represent +a computation and a promise object to represent the delivery of the result of +the computation. This is a nice separation of computation and delivery because +consumers of the promise cannot modify the value that will be eventually +delivered. + +One side effect of being able to implement promise resolution and chaining +iteratively is that you need to be able for one promise to reach into the state +of another promise to shuffle around ownership of handlers. In order to achieve +this without making the handlers of a promise publicly mutable, a promise is +also the deferred value, allowing promises of the same parent class to reach +into and modify the private properties of promises of the same type. While this +does allow consumers of the value to modify the resolution or rejection of the +deferred, it is a small price to pay for keeping the stack size constant. + +```php +$promise = new Promise(); +$promise->then(function ($value) { echo $value; }); +// The promise is the deferred value, so you can deliver a value to it. +$promise->resolve('foo'); +// prints "foo" +``` + + +## Upgrading from Function API + +A static API was first introduced in 1.4.0, in order to mitigate problems with +functions conflicting between global and local copies of the package. The +function API was removed in 2.0.0. A migration table has been provided here for +your convenience: + +| Original Function | Replacement Method | +|----------------|----------------| +| `queue` | `Utils::queue` | +| `task` | `Utils::task` | +| `promise_for` | `Create::promiseFor` | +| `rejection_for` | `Create::rejectionFor` | +| `exception_for` | `Create::exceptionFor` | +| `iter_for` | `Create::iterFor` | +| `inspect` | `Utils::inspect` | +| `inspect_all` | `Utils::inspectAll` | +| `unwrap` | `Utils::unwrap` | +| `all` | `Utils::all` | +| `some` | `Utils::some` | +| `any` | `Utils::any` | +| `settle` | `Utils::settle` | +| `each` | `Each::of` | +| `each_limit` | `Each::ofLimit` | +| `each_limit_all` | `Each::ofLimitAll` | +| `!is_fulfilled` | `Is::pending` | +| `is_fulfilled` | `Is::fulfilled` | +| `is_rejected` | `Is::rejected` | +| `is_settled` | `Is::settled` | +| `coroutine` | `Coroutine::of` | + + +## Security + +If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/promises/security/policy) for more information. + + +## License + +Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. + + +## For Enterprise + +Available as part of the Tidelift Subscription + +The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-promises?utm_source=packagist-guzzlehttp-promises&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/vendor/guzzlehttp/promises/composer.json b/vendor/guzzlehttp/promises/composer.json new file mode 100644 index 000000000..fc1989ec1 --- /dev/null +++ b/vendor/guzzlehttp/promises/composer.json @@ -0,0 +1,58 @@ +{ + "name": "guzzlehttp/promises", + "description": "Guzzle promises library", + "keywords": ["promise"], + "license": "MIT", + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Promise\\Tests\\": "tests/" + } + }, + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "config": { + "allow-plugins": { + "bamarni/composer-bin-plugin": true + }, + "preferred-install": "dist", + "sort-packages": true + } +} diff --git a/vendor/guzzlehttp/promises/src/AggregateException.php b/vendor/guzzlehttp/promises/src/AggregateException.php new file mode 100644 index 000000000..40ffdbcf1 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/AggregateException.php @@ -0,0 +1,19 @@ +then(function ($v) { echo $v; }); + * + * @param callable $generatorFn Generator function to wrap into a promise. + * + * @return Promise + * + * @see https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration + */ +final class Coroutine implements PromiseInterface +{ + /** + * @var PromiseInterface|null + */ + private $currentPromise; + + /** + * @var Generator + */ + private $generator; + + /** + * @var Promise + */ + private $result; + + public function __construct(callable $generatorFn) + { + $this->generator = $generatorFn(); + $this->result = new Promise(function (): void { + while (isset($this->currentPromise)) { + $this->currentPromise->wait(); + } + }); + try { + $this->nextCoroutine($this->generator->current()); + } catch (Throwable $throwable) { + $this->result->reject($throwable); + } + } + + /** + * Create a new coroutine. + */ + public static function of(callable $generatorFn): self + { + return new self($generatorFn); + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ): PromiseInterface { + return $this->result->then($onFulfilled, $onRejected); + } + + public function otherwise(callable $onRejected): PromiseInterface + { + return $this->result->otherwise($onRejected); + } + + public function wait(bool $unwrap = true) + { + return $this->result->wait($unwrap); + } + + public function getState(): string + { + return $this->result->getState(); + } + + public function resolve($value): void + { + $this->result->resolve($value); + } + + public function reject($reason): void + { + $this->result->reject($reason); + } + + public function cancel(): void + { + $this->currentPromise->cancel(); + $this->result->cancel(); + } + + private function nextCoroutine($yielded): void + { + $this->currentPromise = Create::promiseFor($yielded) + ->then([$this, '_handleSuccess'], [$this, '_handleFailure']); + } + + /** + * @internal + */ + public function _handleSuccess($value): void + { + unset($this->currentPromise); + try { + $next = $this->generator->send($value); + if ($this->generator->valid()) { + $this->nextCoroutine($next); + } else { + $this->result->resolve($value); + } + } catch (Throwable $throwable) { + $this->result->reject($throwable); + } + } + + /** + * @internal + */ + public function _handleFailure($reason): void + { + unset($this->currentPromise); + try { + $nextYield = $this->generator->throw(Create::exceptionFor($reason)); + // The throw was caught, so keep iterating on the coroutine + $this->nextCoroutine($nextYield); + } catch (Throwable $throwable) { + $this->result->reject($throwable); + } + } +} diff --git a/vendor/guzzlehttp/promises/src/Create.php b/vendor/guzzlehttp/promises/src/Create.php new file mode 100644 index 000000000..9d3fc4a1e --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Create.php @@ -0,0 +1,79 @@ +then([$promise, 'resolve'], [$promise, 'reject']); + + return $promise; + } + + return new FulfilledPromise($value); + } + + /** + * Creates a rejected promise for a reason if the reason is not a promise. + * If the provided reason is a promise, then it is returned as-is. + * + * @param mixed $reason Promise or reason. + */ + public static function rejectionFor($reason): PromiseInterface + { + if ($reason instanceof PromiseInterface) { + return $reason; + } + + return new RejectedPromise($reason); + } + + /** + * Create an exception for a rejected promise value. + * + * @param mixed $reason + */ + public static function exceptionFor($reason): \Throwable + { + if ($reason instanceof \Throwable) { + return $reason; + } + + return new RejectionException($reason); + } + + /** + * Returns an iterator for the given value. + * + * @param mixed $value + */ + public static function iterFor($value): \Iterator + { + if ($value instanceof \Iterator) { + return $value; + } + + if (is_array($value)) { + return new \ArrayIterator($value); + } + + return new \ArrayIterator([$value]); + } +} diff --git a/vendor/guzzlehttp/promises/src/Each.php b/vendor/guzzlehttp/promises/src/Each.php new file mode 100644 index 000000000..1a7aa0fb6 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Each.php @@ -0,0 +1,86 @@ + $onFulfilled, + 'rejected' => $onRejected, + ]))->promise(); + } + + /** + * Like of, but only allows a certain number of outstanding promises at any + * given time. + * + * $concurrency may be an integer or a function that accepts the number of + * pending promises and returns a numeric concurrency limit value to allow + * for dynamic a concurrency size. + * + * @param mixed $iterable + * @param int|callable $concurrency + * @param callable $onFulfilled + * @param callable $onRejected + */ + public static function ofLimit( + $iterable, + $concurrency, + callable $onFulfilled = null, + callable $onRejected = null + ): PromiseInterface { + return (new EachPromise($iterable, [ + 'fulfilled' => $onFulfilled, + 'rejected' => $onRejected, + 'concurrency' => $concurrency, + ]))->promise(); + } + + /** + * Like limit, but ensures that no promise in the given $iterable argument + * is rejected. If any promise is rejected, then the aggregate promise is + * rejected with the encountered rejection. + * + * @param mixed $iterable + * @param int|callable $concurrency + * @param callable $onFulfilled + */ + public static function ofLimitAll( + $iterable, + $concurrency, + callable $onFulfilled = null + ): PromiseInterface { + return self::ofLimit( + $iterable, + $concurrency, + $onFulfilled, + function ($reason, $idx, PromiseInterface $aggregate): void { + $aggregate->reject($reason); + } + ); + } +} diff --git a/vendor/guzzlehttp/promises/src/EachPromise.php b/vendor/guzzlehttp/promises/src/EachPromise.php new file mode 100644 index 000000000..28dd9793a --- /dev/null +++ b/vendor/guzzlehttp/promises/src/EachPromise.php @@ -0,0 +1,250 @@ +iterable = Create::iterFor($iterable); + + if (isset($config['concurrency'])) { + $this->concurrency = $config['concurrency']; + } + + if (isset($config['fulfilled'])) { + $this->onFulfilled = $config['fulfilled']; + } + + if (isset($config['rejected'])) { + $this->onRejected = $config['rejected']; + } + } + + /** @psalm-suppress InvalidNullableReturnType */ + public function promise(): PromiseInterface + { + if ($this->aggregate) { + return $this->aggregate; + } + + try { + $this->createPromise(); + /** @psalm-assert Promise $this->aggregate */ + $this->iterable->rewind(); + $this->refillPending(); + } catch (\Throwable $e) { + $this->aggregate->reject($e); + } + + /** + * @psalm-suppress NullableReturnStatement + */ + return $this->aggregate; + } + + private function createPromise(): void + { + $this->mutex = false; + $this->aggregate = new Promise(function (): void { + if ($this->checkIfFinished()) { + return; + } + reset($this->pending); + // Consume a potentially fluctuating list of promises while + // ensuring that indexes are maintained (precluding array_shift). + while ($promise = current($this->pending)) { + next($this->pending); + $promise->wait(); + if (Is::settled($this->aggregate)) { + return; + } + } + }); + + // Clear the references when the promise is resolved. + $clearFn = function (): void { + $this->iterable = $this->concurrency = $this->pending = null; + $this->onFulfilled = $this->onRejected = null; + $this->nextPendingIndex = 0; + }; + + $this->aggregate->then($clearFn, $clearFn); + } + + private function refillPending(): void + { + if (!$this->concurrency) { + // Add all pending promises. + while ($this->addPending() && $this->advanceIterator()) { + } + + return; + } + + // Add only up to N pending promises. + $concurrency = is_callable($this->concurrency) + ? call_user_func($this->concurrency, count($this->pending)) + : $this->concurrency; + $concurrency = max($concurrency - count($this->pending), 0); + // Concurrency may be set to 0 to disallow new promises. + if (!$concurrency) { + return; + } + // Add the first pending promise. + $this->addPending(); + // Note this is special handling for concurrency=1 so that we do + // not advance the iterator after adding the first promise. This + // helps work around issues with generators that might not have the + // next value to yield until promise callbacks are called. + while (--$concurrency + && $this->advanceIterator() + && $this->addPending()) { + } + } + + private function addPending(): bool + { + if (!$this->iterable || !$this->iterable->valid()) { + return false; + } + + $promise = Create::promiseFor($this->iterable->current()); + $key = $this->iterable->key(); + + // Iterable keys may not be unique, so we use a counter to + // guarantee uniqueness + $idx = $this->nextPendingIndex++; + + $this->pending[$idx] = $promise->then( + function ($value) use ($idx, $key): void { + if ($this->onFulfilled) { + call_user_func( + $this->onFulfilled, + $value, + $key, + $this->aggregate + ); + } + $this->step($idx); + }, + function ($reason) use ($idx, $key): void { + if ($this->onRejected) { + call_user_func( + $this->onRejected, + $reason, + $key, + $this->aggregate + ); + } + $this->step($idx); + } + ); + + return true; + } + + private function advanceIterator(): bool + { + // Place a lock on the iterator so that we ensure to not recurse, + // preventing fatal generator errors. + if ($this->mutex) { + return false; + } + + $this->mutex = true; + + try { + $this->iterable->next(); + $this->mutex = false; + + return true; + } catch (\Throwable $e) { + $this->aggregate->reject($e); + $this->mutex = false; + + return false; + } + } + + private function step(int $idx): void + { + // If the promise was already resolved, then ignore this step. + if (Is::settled($this->aggregate)) { + return; + } + + unset($this->pending[$idx]); + + // Only refill pending promises if we are not locked, preventing the + // EachPromise to recursively invoke the provided iterator, which + // cause a fatal error: "Cannot resume an already running generator" + if ($this->advanceIterator() && !$this->checkIfFinished()) { + // Add more pending promises if possible. + $this->refillPending(); + } + } + + private function checkIfFinished(): bool + { + if (!$this->pending && !$this->iterable->valid()) { + // Resolve the promise if there's nothing left to do. + $this->aggregate->resolve(null); + + return true; + } + + return false; + } +} diff --git a/vendor/guzzlehttp/promises/src/FulfilledPromise.php b/vendor/guzzlehttp/promises/src/FulfilledPromise.php new file mode 100644 index 000000000..ab7129659 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/FulfilledPromise.php @@ -0,0 +1,89 @@ +value = $value; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ): PromiseInterface { + // Return itself if there is no onFulfilled function. + if (!$onFulfilled) { + return $this; + } + + $queue = Utils::queue(); + $p = new Promise([$queue, 'run']); + $value = $this->value; + $queue->add(static function () use ($p, $value, $onFulfilled): void { + if (Is::pending($p)) { + try { + $p->resolve($onFulfilled($value)); + } catch (\Throwable $e) { + $p->reject($e); + } + } + }); + + return $p; + } + + public function otherwise(callable $onRejected): PromiseInterface + { + return $this->then(null, $onRejected); + } + + public function wait(bool $unwrap = true) + { + return $unwrap ? $this->value : null; + } + + public function getState(): string + { + return self::FULFILLED; + } + + public function resolve($value): void + { + if ($value !== $this->value) { + throw new \LogicException('Cannot resolve a fulfilled promise'); + } + } + + public function reject($reason): void + { + throw new \LogicException('Cannot reject a fulfilled promise'); + } + + public function cancel(): void + { + // pass + } +} diff --git a/vendor/guzzlehttp/promises/src/Is.php b/vendor/guzzlehttp/promises/src/Is.php new file mode 100644 index 000000000..f3f050384 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Is.php @@ -0,0 +1,40 @@ +getState() === PromiseInterface::PENDING; + } + + /** + * Returns true if a promise is fulfilled or rejected. + */ + public static function settled(PromiseInterface $promise): bool + { + return $promise->getState() !== PromiseInterface::PENDING; + } + + /** + * Returns true if a promise is fulfilled. + */ + public static function fulfilled(PromiseInterface $promise): bool + { + return $promise->getState() === PromiseInterface::FULFILLED; + } + + /** + * Returns true if a promise is rejected. + */ + public static function rejected(PromiseInterface $promise): bool + { + return $promise->getState() === PromiseInterface::REJECTED; + } +} diff --git a/vendor/guzzlehttp/promises/src/Promise.php b/vendor/guzzlehttp/promises/src/Promise.php new file mode 100644 index 000000000..1b07bdc9a --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Promise.php @@ -0,0 +1,281 @@ +waitFn = $waitFn; + $this->cancelFn = $cancelFn; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ): PromiseInterface { + if ($this->state === self::PENDING) { + $p = new Promise(null, [$this, 'cancel']); + $this->handlers[] = [$p, $onFulfilled, $onRejected]; + $p->waitList = $this->waitList; + $p->waitList[] = $this; + + return $p; + } + + // Return a fulfilled promise and immediately invoke any callbacks. + if ($this->state === self::FULFILLED) { + $promise = Create::promiseFor($this->result); + + return $onFulfilled ? $promise->then($onFulfilled) : $promise; + } + + // It's either cancelled or rejected, so return a rejected promise + // and immediately invoke any callbacks. + $rejection = Create::rejectionFor($this->result); + + return $onRejected ? $rejection->then(null, $onRejected) : $rejection; + } + + public function otherwise(callable $onRejected): PromiseInterface + { + return $this->then(null, $onRejected); + } + + public function wait(bool $unwrap = true) + { + $this->waitIfPending(); + + if ($this->result instanceof PromiseInterface) { + return $this->result->wait($unwrap); + } + if ($unwrap) { + if ($this->state === self::FULFILLED) { + return $this->result; + } + // It's rejected so "unwrap" and throw an exception. + throw Create::exceptionFor($this->result); + } + } + + public function getState(): string + { + return $this->state; + } + + public function cancel(): void + { + if ($this->state !== self::PENDING) { + return; + } + + $this->waitFn = $this->waitList = null; + + if ($this->cancelFn) { + $fn = $this->cancelFn; + $this->cancelFn = null; + try { + $fn(); + } catch (\Throwable $e) { + $this->reject($e); + } + } + + // Reject the promise only if it wasn't rejected in a then callback. + /** @psalm-suppress RedundantCondition */ + if ($this->state === self::PENDING) { + $this->reject(new CancellationException('Promise has been cancelled')); + } + } + + public function resolve($value): void + { + $this->settle(self::FULFILLED, $value); + } + + public function reject($reason): void + { + $this->settle(self::REJECTED, $reason); + } + + private function settle(string $state, $value): void + { + if ($this->state !== self::PENDING) { + // Ignore calls with the same resolution. + if ($state === $this->state && $value === $this->result) { + return; + } + throw $this->state === $state + ? new \LogicException("The promise is already {$state}.") + : new \LogicException("Cannot change a {$this->state} promise to {$state}"); + } + + if ($value === $this) { + throw new \LogicException('Cannot fulfill or reject a promise with itself'); + } + + // Clear out the state of the promise but stash the handlers. + $this->state = $state; + $this->result = $value; + $handlers = $this->handlers; + $this->handlers = null; + $this->waitList = $this->waitFn = null; + $this->cancelFn = null; + + if (!$handlers) { + return; + } + + // If the value was not a settled promise or a thenable, then resolve + // it in the task queue using the correct ID. + if (!is_object($value) || !method_exists($value, 'then')) { + $id = $state === self::FULFILLED ? 1 : 2; + // It's a success, so resolve the handlers in the queue. + Utils::queue()->add(static function () use ($id, $value, $handlers): void { + foreach ($handlers as $handler) { + self::callHandler($id, $value, $handler); + } + }); + } elseif ($value instanceof Promise && Is::pending($value)) { + // We can just merge our handlers onto the next promise. + $value->handlers = array_merge($value->handlers, $handlers); + } else { + // Resolve the handlers when the forwarded promise is resolved. + $value->then( + static function ($value) use ($handlers): void { + foreach ($handlers as $handler) { + self::callHandler(1, $value, $handler); + } + }, + static function ($reason) use ($handlers): void { + foreach ($handlers as $handler) { + self::callHandler(2, $reason, $handler); + } + } + ); + } + } + + /** + * Call a stack of handlers using a specific callback index and value. + * + * @param int $index 1 (resolve) or 2 (reject). + * @param mixed $value Value to pass to the callback. + * @param array $handler Array of handler data (promise and callbacks). + */ + private static function callHandler(int $index, $value, array $handler): void + { + /** @var PromiseInterface $promise */ + $promise = $handler[0]; + + // The promise may have been cancelled or resolved before placing + // this thunk in the queue. + if (Is::settled($promise)) { + return; + } + + try { + if (isset($handler[$index])) { + /* + * If $f throws an exception, then $handler will be in the exception + * stack trace. Since $handler contains a reference to the callable + * itself we get a circular reference. We clear the $handler + * here to avoid that memory leak. + */ + $f = $handler[$index]; + unset($handler); + $promise->resolve($f($value)); + } elseif ($index === 1) { + // Forward resolution values as-is. + $promise->resolve($value); + } else { + // Forward rejections down the chain. + $promise->reject($value); + } + } catch (\Throwable $reason) { + $promise->reject($reason); + } + } + + private function waitIfPending(): void + { + if ($this->state !== self::PENDING) { + return; + } elseif ($this->waitFn) { + $this->invokeWaitFn(); + } elseif ($this->waitList) { + $this->invokeWaitList(); + } else { + // If there's no wait function, then reject the promise. + $this->reject('Cannot wait on a promise that has ' + .'no internal wait function. You must provide a wait ' + .'function when constructing the promise to be able to ' + .'wait on a promise.'); + } + + Utils::queue()->run(); + + /** @psalm-suppress RedundantCondition */ + if ($this->state === self::PENDING) { + $this->reject('Invoking the wait callback did not resolve the promise'); + } + } + + private function invokeWaitFn(): void + { + try { + $wfn = $this->waitFn; + $this->waitFn = null; + $wfn(true); + } catch (\Throwable $reason) { + if ($this->state === self::PENDING) { + // The promise has not been resolved yet, so reject the promise + // with the exception. + $this->reject($reason); + } else { + // The promise was already resolved, so there's a problem in + // the application. + throw $reason; + } + } + } + + private function invokeWaitList(): void + { + $waitList = $this->waitList; + $this->waitList = null; + + foreach ($waitList as $result) { + do { + $result->waitIfPending(); + $result = $result->result; + } while ($result instanceof Promise); + + if ($result instanceof PromiseInterface) { + $result->wait(false); + } + } + } +} diff --git a/vendor/guzzlehttp/promises/src/PromiseInterface.php b/vendor/guzzlehttp/promises/src/PromiseInterface.php new file mode 100644 index 000000000..2824802bb --- /dev/null +++ b/vendor/guzzlehttp/promises/src/PromiseInterface.php @@ -0,0 +1,91 @@ +reason = $reason; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ): PromiseInterface { + // If there's no onRejected callback then just return self. + if (!$onRejected) { + return $this; + } + + $queue = Utils::queue(); + $reason = $this->reason; + $p = new Promise([$queue, 'run']); + $queue->add(static function () use ($p, $reason, $onRejected): void { + if (Is::pending($p)) { + try { + // Return a resolved promise if onRejected does not throw. + $p->resolve($onRejected($reason)); + } catch (\Throwable $e) { + // onRejected threw, so return a rejected promise. + $p->reject($e); + } + } + }); + + return $p; + } + + public function otherwise(callable $onRejected): PromiseInterface + { + return $this->then(null, $onRejected); + } + + public function wait(bool $unwrap = true) + { + if ($unwrap) { + throw Create::exceptionFor($this->reason); + } + + return null; + } + + public function getState(): string + { + return self::REJECTED; + } + + public function resolve($value): void + { + throw new \LogicException('Cannot resolve a rejected promise'); + } + + public function reject($reason): void + { + if ($reason !== $this->reason) { + throw new \LogicException('Cannot reject a rejected promise'); + } + } + + public function cancel(): void + { + // pass + } +} diff --git a/vendor/guzzlehttp/promises/src/RejectionException.php b/vendor/guzzlehttp/promises/src/RejectionException.php new file mode 100644 index 000000000..47dca8624 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/RejectionException.php @@ -0,0 +1,49 @@ +reason = $reason; + + $message = 'The promise was rejected'; + + if ($description) { + $message .= ' with reason: '.$description; + } elseif (is_string($reason) + || (is_object($reason) && method_exists($reason, '__toString')) + ) { + $message .= ' with reason: '.$this->reason; + } elseif ($reason instanceof \JsonSerializable) { + $message .= ' with reason: '.json_encode($this->reason, JSON_PRETTY_PRINT); + } + + parent::__construct($message); + } + + /** + * Returns the rejection reason. + * + * @return mixed + */ + public function getReason() + { + return $this->reason; + } +} diff --git a/vendor/guzzlehttp/promises/src/TaskQueue.php b/vendor/guzzlehttp/promises/src/TaskQueue.php new file mode 100644 index 000000000..503e0b2da --- /dev/null +++ b/vendor/guzzlehttp/promises/src/TaskQueue.php @@ -0,0 +1,71 @@ +run(); + * + * @final + */ +class TaskQueue implements TaskQueueInterface +{ + private $enableShutdown = true; + private $queue = []; + + public function __construct(bool $withShutdown = true) + { + if ($withShutdown) { + register_shutdown_function(function (): void { + if ($this->enableShutdown) { + // Only run the tasks if an E_ERROR didn't occur. + $err = error_get_last(); + if (!$err || ($err['type'] ^ E_ERROR)) { + $this->run(); + } + } + }); + } + } + + public function isEmpty(): bool + { + return !$this->queue; + } + + public function add(callable $task): void + { + $this->queue[] = $task; + } + + public function run(): void + { + while ($task = array_shift($this->queue)) { + /** @var callable $task */ + $task(); + } + } + + /** + * The task queue will be run and exhausted by default when the process + * exits IFF the exit is not the result of a PHP E_ERROR error. + * + * You can disable running the automatic shutdown of the queue by calling + * this function. If you disable the task queue shutdown process, then you + * MUST either run the task queue (as a result of running your event loop + * or manually using the run() method) or wait on each outstanding promise. + * + * Note: This shutdown will occur before any destructors are triggered. + */ + public function disableShutdown(): void + { + $this->enableShutdown = false; + } +} diff --git a/vendor/guzzlehttp/promises/src/TaskQueueInterface.php b/vendor/guzzlehttp/promises/src/TaskQueueInterface.php new file mode 100644 index 000000000..34c561a48 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/TaskQueueInterface.php @@ -0,0 +1,24 @@ + + * while ($eventLoop->isRunning()) { + * GuzzleHttp\Promise\Utils::queue()->run(); + * } + * + * + * @param TaskQueueInterface|null $assign Optionally specify a new queue instance. + */ + public static function queue(TaskQueueInterface $assign = null): TaskQueueInterface + { + static $queue; + + if ($assign) { + $queue = $assign; + } elseif (!$queue) { + $queue = new TaskQueue(); + } + + return $queue; + } + + /** + * Adds a function to run in the task queue when it is next `run()` and + * returns a promise that is fulfilled or rejected with the result. + * + * @param callable $task Task function to run. + */ + public static function task(callable $task): PromiseInterface + { + $queue = self::queue(); + $promise = new Promise([$queue, 'run']); + $queue->add(function () use ($task, $promise): void { + try { + if (Is::pending($promise)) { + $promise->resolve($task()); + } + } catch (\Throwable $e) { + $promise->reject($e); + } + }); + + return $promise; + } + + /** + * Synchronously waits on a promise to resolve and returns an inspection + * state array. + * + * Returns a state associative array containing a "state" key mapping to a + * valid promise state. If the state of the promise is "fulfilled", the + * array will contain a "value" key mapping to the fulfilled value of the + * promise. If the promise is rejected, the array will contain a "reason" + * key mapping to the rejection reason of the promise. + * + * @param PromiseInterface $promise Promise or value. + */ + public static function inspect(PromiseInterface $promise): array + { + try { + return [ + 'state' => PromiseInterface::FULFILLED, + 'value' => $promise->wait(), + ]; + } catch (RejectionException $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()]; + } catch (\Throwable $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; + } + } + + /** + * Waits on all of the provided promises, but does not unwrap rejected + * promises as thrown exception. + * + * Returns an array of inspection state arrays. + * + * @see inspect for the inspection state array format. + * + * @param PromiseInterface[] $promises Traversable of promises to wait upon. + */ + public static function inspectAll($promises): array + { + $results = []; + foreach ($promises as $key => $promise) { + $results[$key] = self::inspect($promise); + } + + return $results; + } + + /** + * Waits on all of the provided promises and returns the fulfilled values. + * + * Returns an array that contains the value of each promise (in the same + * order the promises were provided). An exception is thrown if any of the + * promises are rejected. + * + * @param iterable $promises Iterable of PromiseInterface objects to wait on. + * + * @throws \Throwable on error + */ + public static function unwrap($promises): array + { + $results = []; + foreach ($promises as $key => $promise) { + $results[$key] = $promise->wait(); + } + + return $results; + } + + /** + * Given an array of promises, return a promise that is fulfilled when all + * the items in the array are fulfilled. + * + * The promise's fulfillment value is an array with fulfillment values at + * respective positions to the original array. If any promise in the array + * rejects, the returned promise is rejected with the rejection reason. + * + * @param mixed $promises Promises or values. + * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution. + */ + public static function all($promises, bool $recursive = false): PromiseInterface + { + $results = []; + $promise = Each::of( + $promises, + function ($value, $idx) use (&$results): void { + $results[$idx] = $value; + }, + function ($reason, $idx, Promise $aggregate): void { + $aggregate->reject($reason); + } + )->then(function () use (&$results) { + ksort($results); + + return $results; + }); + + if (true === $recursive) { + $promise = $promise->then(function ($results) use ($recursive, &$promises) { + foreach ($promises as $promise) { + if (Is::pending($promise)) { + return self::all($promises, $recursive); + } + } + + return $results; + }); + } + + return $promise; + } + + /** + * Initiate a competitive race between multiple promises or values (values + * will become immediately fulfilled promises). + * + * When count amount of promises have been fulfilled, the returned promise + * is fulfilled with an array that contains the fulfillment values of the + * winners in order of resolution. + * + * This promise is rejected with a {@see AggregateException} if the number + * of fulfilled promises is less than the desired $count. + * + * @param int $count Total number of promises. + * @param mixed $promises Promises or values. + */ + public static function some(int $count, $promises): PromiseInterface + { + $results = []; + $rejections = []; + + return Each::of( + $promises, + function ($value, $idx, PromiseInterface $p) use (&$results, $count): void { + if (Is::settled($p)) { + return; + } + $results[$idx] = $value; + if (count($results) >= $count) { + $p->resolve(null); + } + }, + function ($reason) use (&$rejections): void { + $rejections[] = $reason; + } + )->then( + function () use (&$results, &$rejections, $count) { + if (count($results) !== $count) { + throw new AggregateException( + 'Not enough promises to fulfill count', + $rejections + ); + } + ksort($results); + + return array_values($results); + } + ); + } + + /** + * Like some(), with 1 as count. However, if the promise fulfills, the + * fulfillment value is not an array of 1 but the value directly. + * + * @param mixed $promises Promises or values. + */ + public static function any($promises): PromiseInterface + { + return self::some(1, $promises)->then(function ($values) { + return $values[0]; + }); + } + + /** + * Returns a promise that is fulfilled when all of the provided promises have + * been fulfilled or rejected. + * + * The returned promise is fulfilled with an array of inspection state arrays. + * + * @see inspect for the inspection state array format. + * + * @param mixed $promises Promises or values. + */ + public static function settle($promises): PromiseInterface + { + $results = []; + + return Each::of( + $promises, + function ($value, $idx) use (&$results): void { + $results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value]; + }, + function ($reason, $idx) use (&$results): void { + $results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason]; + } + )->then(function () use (&$results) { + ksort($results); + + return $results; + }); + } +} diff --git a/vendor/guzzlehttp/psr7/CHANGELOG.md b/vendor/guzzlehttp/psr7/CHANGELOG.md new file mode 100644 index 000000000..d897feedd --- /dev/null +++ b/vendor/guzzlehttp/psr7/CHANGELOG.md @@ -0,0 +1,437 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## 2.6.1 - 2023-08-27 + +### Fixed + +- Properly handle the fact that PHP transforms numeric strings in array keys to ints + +## 2.6.0 - 2023-08-03 + +### Changed + +- Updated the mime type map to add some new entries, fix a couple of invalid entries, and remove an invalid entry +- Fallback to `application/octet-stream` if we are unable to guess the content type for a multipart file upload + +## 2.5.1 - 2023-08-03 + +### Fixed + +- Corrected mime type for `.acc` files to `audio/aac` + +### Changed + +- PHP 8.3 support + +## 2.5.0 - 2023-04-17 + +### Changed + +- Adjusted `psr/http-message` version constraint to `^1.1 || ^2.0` + +## 2.4.5 - 2023-04-17 + +### Fixed + +- Prevent possible warnings on unset variables in `ServerRequest::normalizeNestedFileSpec` +- Fixed `Message::bodySummary` when `preg_match` fails +- Fixed header validation issue + +## 2.4.4 - 2023-03-09 + +### Changed + +- Removed the need for `AllowDynamicProperties` in `LazyOpenStream` + +## 2.4.3 - 2022-10-26 + +### Changed + +- Replaced `sha1(uniqid())` by `bin2hex(random_bytes(20))` + +## 2.4.2 - 2022-10-25 + +### Fixed + +- Fixed erroneous behaviour when combining host and relative path + +## 2.4.1 - 2022-08-28 + +### Fixed + +- Rewind body before reading in `Message::bodySummary` + +## 2.4.0 - 2022-06-20 + +### Added + +- Added provisional PHP 8.2 support +- Added `UriComparator::isCrossOrigin` method + +## 2.3.0 - 2022-06-09 + +### Fixed + +- Added `Header::splitList` method +- Added `Utils::tryGetContents` method +- Improved `Stream::getContents` method +- Updated mimetype mappings + +## 2.2.2 - 2022-06-08 + +### Fixed + +- Fix `Message::parseRequestUri` for numeric headers +- Re-wrap exceptions thrown in `fread` into runtime exceptions +- Throw an exception when multipart options is misformatted + +## 2.2.1 - 2022-03-20 + +### Fixed + +- Correct header value validation + +## 2.2.0 - 2022-03-20 + +### Added + +- A more compressive list of mime types +- Add JsonSerializable to Uri +- Missing return types + +### Fixed + +- Bug MultipartStream no `uri` metadata +- Bug MultipartStream with filename for `data://` streams +- Fixed new line handling in MultipartStream +- Reduced RAM usage when copying streams +- Updated parsing in `Header::normalize()` + +## 2.1.1 - 2022-03-20 + +### Fixed + +- Validate header values properly + +## 2.1.0 - 2021-10-06 + +### Changed + +- Attempting to create a `Uri` object from a malformed URI will no longer throw a generic + `InvalidArgumentException`, but rather a `MalformedUriException`, which inherits from the former + for backwards compatibility. Callers relying on the exception being thrown to detect invalid + URIs should catch the new exception. + +### Fixed + +- Return `null` in caching stream size if remote size is `null` + +## 2.0.0 - 2021-06-30 + +Identical to the RC release. + +## 2.0.0@RC-1 - 2021-04-29 + +### Fixed + +- Handle possibly unset `url` in `stream_get_meta_data` + +## 2.0.0@beta-1 - 2021-03-21 + +### Added + +- PSR-17 factories +- Made classes final +- PHP7 type hints + +### Changed + +- When building a query string, booleans are represented as 1 and 0. + +### Removed + +- PHP < 7.2 support +- All functions in the `GuzzleHttp\Psr7` namespace + +## 1.8.1 - 2021-03-21 + +### Fixed + +- Issue parsing IPv6 URLs +- Issue modifying ServerRequest lost all its attributes + +## 1.8.0 - 2021-03-21 + +### Added + +- Locale independent URL parsing +- Most classes got a `@final` annotation to prepare for 2.0 + +### Fixed + +- Issue when creating stream from `php://input` and curl-ext is not installed +- Broken `Utils::tryFopen()` on PHP 8 + +## 1.7.0 - 2020-09-30 + +### Added + +- Replaced functions by static methods + +### Fixed + +- Converting a non-seekable stream to a string +- Handle multiple Set-Cookie correctly +- Ignore array keys in header values when merging +- Allow multibyte characters to be parsed in `Message:bodySummary()` + +### Changed + +- Restored partial HHVM 3 support + + +## [1.6.1] - 2019-07-02 + +### Fixed + +- Accept null and bool header values again + + +## [1.6.0] - 2019-06-30 + +### Added + +- Allowed version `^3.0` of `ralouphie/getallheaders` dependency (#244) +- Added MIME type for WEBP image format (#246) +- Added more validation of values according to PSR-7 and RFC standards, e.g. status code range (#250, #272) + +### Changed + +- Tests don't pass with HHVM 4.0, so HHVM support got dropped. Other libraries like composer have done the same. (#262) +- Accept port number 0 to be valid (#270) + +### Fixed + +- Fixed subsequent reads from `php://input` in ServerRequest (#247) +- Fixed readable/writable detection for certain stream modes (#248) +- Fixed encoding of special characters in the `userInfo` component of an URI (#253) + + +## [1.5.2] - 2018-12-04 + +### Fixed + +- Check body size when getting the message summary + + +## [1.5.1] - 2018-12-04 + +### Fixed + +- Get the summary of a body only if it is readable + + +## [1.5.0] - 2018-12-03 + +### Added + +- Response first-line to response string exception (fixes #145) +- A test for #129 behavior +- `get_message_body_summary` function in order to get the message summary +- `3gp` and `mkv` mime types + +### Changed + +- Clarify exception message when stream is detached + +### Deprecated + +- Deprecated parsing folded header lines as per RFC 7230 + +### Fixed + +- Fix `AppendStream::detach` to not close streams +- `InflateStream` preserves `isSeekable` attribute of the underlying stream +- `ServerRequest::getUriFromGlobals` to support URLs in query parameters + + +Several other fixes and improvements. + + +## [1.4.2] - 2017-03-20 + +### Fixed + +- Reverted BC break to `Uri::resolve` and `Uri::removeDotSegments` by removing + calls to `trigger_error` when deprecated methods are invoked. + + +## [1.4.1] - 2017-02-27 + +### Added + +- Rriggering of silenced deprecation warnings. + +### Fixed + +- Reverted BC break by reintroducing behavior to automagically fix a URI with a + relative path and an authority by adding a leading slash to the path. It's only + deprecated now. + + +## [1.4.0] - 2017-02-21 + +### Added + +- Added common URI utility methods based on RFC 3986 (see documentation in the readme): + - `Uri::isDefaultPort` + - `Uri::isAbsolute` + - `Uri::isNetworkPathReference` + - `Uri::isAbsolutePathReference` + - `Uri::isRelativePathReference` + - `Uri::isSameDocumentReference` + - `Uri::composeComponents` + - `UriNormalizer::normalize` + - `UriNormalizer::isEquivalent` + - `UriResolver::relativize` + +### Changed + +- Ensure `ServerRequest::getUriFromGlobals` returns a URI in absolute form. +- Allow `parse_response` to parse a response without delimiting space and reason. +- Ensure each URI modification results in a valid URI according to PSR-7 discussions. + Invalid modifications will throw an exception instead of returning a wrong URI or + doing some magic. + - `(new Uri)->withPath('foo')->withHost('example.com')` will throw an exception + because the path of a URI with an authority must start with a slash "/" or be empty + - `(new Uri())->withScheme('http')` will return `'http://localhost'` + +### Deprecated + +- `Uri::resolve` in favor of `UriResolver::resolve` +- `Uri::removeDotSegments` in favor of `UriResolver::removeDotSegments` + +### Fixed + +- `Stream::read` when length parameter <= 0. +- `copy_to_stream` reads bytes in chunks instead of `maxLen` into memory. +- `ServerRequest::getUriFromGlobals` when `Host` header contains port. +- Compatibility of URIs with `file` scheme and empty host. + + +## [1.3.1] - 2016-06-25 + +### Fixed + +- `Uri::__toString` for network path references, e.g. `//example.org`. +- Missing lowercase normalization for host. +- Handling of URI components in case they are `'0'` in a lot of places, + e.g. as a user info password. +- `Uri::withAddedHeader` to correctly merge headers with different case. +- Trimming of header values in `Uri::withAddedHeader`. Header values may + be surrounded by whitespace which should be ignored according to RFC 7230 + Section 3.2.4. This does not apply to header names. +- `Uri::withAddedHeader` with an array of header values. +- `Uri::resolve` when base path has no slash and handling of fragment. +- Handling of encoding in `Uri::with(out)QueryValue` so one can pass the + key/value both in encoded as well as decoded form to those methods. This is + consistent with withPath, withQuery etc. +- `ServerRequest::withoutAttribute` when attribute value is null. + + +## [1.3.0] - 2016-04-13 + +### Added + +- Remaining interfaces needed for full PSR7 compatibility + (ServerRequestInterface, UploadedFileInterface, etc.). +- Support for stream_for from scalars. + +### Changed + +- Can now extend Uri. + +### Fixed +- A bug in validating request methods by making it more permissive. + + +## [1.2.3] - 2016-02-18 + +### Fixed + +- Support in `GuzzleHttp\Psr7\CachingStream` for seeking forward on remote + streams, which can sometimes return fewer bytes than requested with `fread`. +- Handling of gzipped responses with FNAME headers. + + +## [1.2.2] - 2016-01-22 + +### Added + +- Support for URIs without any authority. +- Support for HTTP 451 'Unavailable For Legal Reasons.' +- Support for using '0' as a filename. +- Support for including non-standard ports in Host headers. + + +## [1.2.1] - 2015-11-02 + +### Changes + +- Now supporting negative offsets when seeking to SEEK_END. + + +## [1.2.0] - 2015-08-15 + +### Changed + +- Body as `"0"` is now properly added to a response. +- Now allowing forward seeking in CachingStream. +- Now properly parsing HTTP requests that contain proxy targets in + `parse_request`. +- functions.php is now conditionally required. +- user-info is no longer dropped when resolving URIs. + + +## [1.1.0] - 2015-06-24 + +### Changed + +- URIs can now be relative. +- `multipart/form-data` headers are now overridden case-insensitively. +- URI paths no longer encode the following characters because they are allowed + in URIs: "(", ")", "*", "!", "'" +- A port is no longer added to a URI when the scheme is missing and no port is + present. + + +## 1.0.0 - 2015-05-19 + +Initial release. + +Currently unsupported: + +- `Psr\Http\Message\ServerRequestInterface` +- `Psr\Http\Message\UploadedFileInterface` + + + +[1.6.0]: https://github.com/guzzle/psr7/compare/1.5.2...1.6.0 +[1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2 +[1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1 +[1.5.0]: https://github.com/guzzle/psr7/compare/1.4.2...1.5.0 +[1.4.2]: https://github.com/guzzle/psr7/compare/1.4.1...1.4.2 +[1.4.1]: https://github.com/guzzle/psr7/compare/1.4.0...1.4.1 +[1.4.0]: https://github.com/guzzle/psr7/compare/1.3.1...1.4.0 +[1.3.1]: https://github.com/guzzle/psr7/compare/1.3.0...1.3.1 +[1.3.0]: https://github.com/guzzle/psr7/compare/1.2.3...1.3.0 +[1.2.3]: https://github.com/guzzle/psr7/compare/1.2.2...1.2.3 +[1.2.2]: https://github.com/guzzle/psr7/compare/1.2.1...1.2.2 +[1.2.1]: https://github.com/guzzle/psr7/compare/1.2.0...1.2.1 +[1.2.0]: https://github.com/guzzle/psr7/compare/1.1.0...1.2.0 +[1.1.0]: https://github.com/guzzle/psr7/compare/1.0.0...1.1.0 diff --git a/vendor/guzzlehttp/psr7/LICENSE b/vendor/guzzlehttp/psr7/LICENSE new file mode 100644 index 000000000..51c7ec81c --- /dev/null +++ b/vendor/guzzlehttp/psr7/LICENSE @@ -0,0 +1,26 @@ +The MIT License (MIT) + +Copyright (c) 2015 Michael Dowling +Copyright (c) 2015 Márk Sági-Kazár +Copyright (c) 2015 Graham Campbell +Copyright (c) 2016 Tobias Schultze +Copyright (c) 2016 George Mponos +Copyright (c) 2018 Tobias Nyholm + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/guzzlehttp/psr7/README.md b/vendor/guzzlehttp/psr7/README.md new file mode 100644 index 000000000..a64ec9046 --- /dev/null +++ b/vendor/guzzlehttp/psr7/README.md @@ -0,0 +1,880 @@ +# PSR-7 Message Implementation + +This repository contains a full [PSR-7](https://www.php-fig.org/psr/psr-7/) +message implementation, several stream decorators, and some helpful +functionality like query string parsing. + +![CI](https://github.com/guzzle/psr7/workflows/CI/badge.svg) +![Static analysis](https://github.com/guzzle/psr7/workflows/Static%20analysis/badge.svg) + + +## Features + +This package comes with a number of stream implementations and stream +decorators. + + +## Installation + +```shell +composer require guzzlehttp/psr7 +``` + +## Version Guidance + +| Version | Status | PHP Version | +|---------|---------------------|--------------| +| 1.x | Security fixes only | >=5.4,<8.1 | +| 2.x | Latest | >=7.2.5,<8.4 | + + +## AppendStream + +`GuzzleHttp\Psr7\AppendStream` + +Reads from multiple streams, one after the other. + +```php +use GuzzleHttp\Psr7; + +$a = Psr7\Utils::streamFor('abc, '); +$b = Psr7\Utils::streamFor('123.'); +$composed = new Psr7\AppendStream([$a, $b]); + +$composed->addStream(Psr7\Utils::streamFor(' Above all listen to me')); + +echo $composed; // abc, 123. Above all listen to me. +``` + + +## BufferStream + +`GuzzleHttp\Psr7\BufferStream` + +Provides a buffer stream that can be written to fill a buffer, and read +from to remove bytes from the buffer. + +This stream returns a "hwm" metadata value that tells upstream consumers +what the configured high water mark of the stream is, or the maximum +preferred size of the buffer. + +```php +use GuzzleHttp\Psr7; + +// When more than 1024 bytes are in the buffer, it will begin returning +// false to writes. This is an indication that writers should slow down. +$buffer = new Psr7\BufferStream(1024); +``` + + +## CachingStream + +The CachingStream is used to allow seeking over previously read bytes on +non-seekable streams. This can be useful when transferring a non-seekable +entity body fails due to needing to rewind the stream (for example, resulting +from a redirect). Data that is read from the remote stream will be buffered in +a PHP temp stream so that previously read bytes are cached first in memory, +then on disk. + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor(fopen('http://www.google.com', 'r')); +$stream = new Psr7\CachingStream($original); + +$stream->read(1024); +echo $stream->tell(); +// 1024 + +$stream->seek(0); +echo $stream->tell(); +// 0 +``` + + +## DroppingStream + +`GuzzleHttp\Psr7\DroppingStream` + +Stream decorator that begins dropping data once the size of the underlying +stream becomes too full. + +```php +use GuzzleHttp\Psr7; + +// Create an empty stream +$stream = Psr7\Utils::streamFor(); + +// Start dropping data when the stream has more than 10 bytes +$dropping = new Psr7\DroppingStream($stream, 10); + +$dropping->write('01234567890123456789'); +echo $stream; // 0123456789 +``` + + +## FnStream + +`GuzzleHttp\Psr7\FnStream` + +Compose stream implementations based on a hash of functions. + +Allows for easy testing and extension of a provided stream without needing +to create a concrete class for a simple extension point. + +```php + +use GuzzleHttp\Psr7; + +$stream = Psr7\Utils::streamFor('hi'); +$fnStream = Psr7\FnStream::decorate($stream, [ + 'rewind' => function () use ($stream) { + echo 'About to rewind - '; + $stream->rewind(); + echo 'rewound!'; + } +]); + +$fnStream->rewind(); +// Outputs: About to rewind - rewound! +``` + + +## InflateStream + +`GuzzleHttp\Psr7\InflateStream` + +Uses PHP's zlib.inflate filter to inflate zlib (HTTP deflate, RFC1950) or gzipped (RFC1952) content. + +This stream decorator converts the provided stream to a PHP stream resource, +then appends the zlib.inflate filter. The stream is then converted back +to a Guzzle stream resource to be used as a Guzzle stream. + + +## LazyOpenStream + +`GuzzleHttp\Psr7\LazyOpenStream` + +Lazily reads or writes to a file that is opened only after an IO operation +take place on the stream. + +```php +use GuzzleHttp\Psr7; + +$stream = new Psr7\LazyOpenStream('/path/to/file', 'r'); +// The file has not yet been opened... + +echo $stream->read(10); +// The file is opened and read from only when needed. +``` + + +## LimitStream + +`GuzzleHttp\Psr7\LimitStream` + +LimitStream can be used to read a subset or slice of an existing stream object. +This can be useful for breaking a large file into smaller pieces to be sent in +chunks (e.g. Amazon S3's multipart upload API). + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor(fopen('/tmp/test.txt', 'r+')); +echo $original->getSize(); +// >>> 1048576 + +// Limit the size of the body to 1024 bytes and start reading from byte 2048 +$stream = new Psr7\LimitStream($original, 1024, 2048); +echo $stream->getSize(); +// >>> 1024 +echo $stream->tell(); +// >>> 0 +``` + + +## MultipartStream + +`GuzzleHttp\Psr7\MultipartStream` + +Stream that when read returns bytes for a streaming multipart or +multipart/form-data stream. + + +## NoSeekStream + +`GuzzleHttp\Psr7\NoSeekStream` + +NoSeekStream wraps a stream and does not allow seeking. + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor('foo'); +$noSeek = new Psr7\NoSeekStream($original); + +echo $noSeek->read(3); +// foo +var_export($noSeek->isSeekable()); +// false +$noSeek->seek(0); +var_export($noSeek->read(3)); +// NULL +``` + + +## PumpStream + +`GuzzleHttp\Psr7\PumpStream` + +Provides a read only stream that pumps data from a PHP callable. + +When invoking the provided callable, the PumpStream will pass the amount of +data requested to read to the callable. The callable can choose to ignore +this value and return fewer or more bytes than requested. Any extra data +returned by the provided callable is buffered internally until drained using +the read() function of the PumpStream. The provided callable MUST return +false when there is no more data to read. + + +## Implementing stream decorators + +Creating a stream decorator is very easy thanks to the +`GuzzleHttp\Psr7\StreamDecoratorTrait`. This trait provides methods that +implement `Psr\Http\Message\StreamInterface` by proxying to an underlying +stream. Just `use` the `StreamDecoratorTrait` and implement your custom +methods. + +For example, let's say we wanted to call a specific function each time the last +byte is read from a stream. This could be implemented by overriding the +`read()` method. + +```php +use Psr\Http\Message\StreamInterface; +use GuzzleHttp\Psr7\StreamDecoratorTrait; + +class EofCallbackStream implements StreamInterface +{ + use StreamDecoratorTrait; + + private $callback; + + private $stream; + + public function __construct(StreamInterface $stream, callable $cb) + { + $this->stream = $stream; + $this->callback = $cb; + } + + public function read($length) + { + $result = $this->stream->read($length); + + // Invoke the callback when EOF is hit. + if ($this->eof()) { + call_user_func($this->callback); + } + + return $result; + } +} +``` + +This decorator could be added to any existing stream and used like so: + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor('foo'); + +$eofStream = new EofCallbackStream($original, function () { + echo 'EOF!'; +}); + +$eofStream->read(2); +$eofStream->read(1); +// echoes "EOF!" +$eofStream->seek(0); +$eofStream->read(3); +// echoes "EOF!" +``` + + +## PHP StreamWrapper + +You can use the `GuzzleHttp\Psr7\StreamWrapper` class if you need to use a +PSR-7 stream as a PHP stream resource. + +Use the `GuzzleHttp\Psr7\StreamWrapper::getResource()` method to create a PHP +stream from a PSR-7 stream. + +```php +use GuzzleHttp\Psr7\StreamWrapper; + +$stream = GuzzleHttp\Psr7\Utils::streamFor('hello!'); +$resource = StreamWrapper::getResource($stream); +echo fread($resource, 6); // outputs hello! +``` + + +# Static API + +There are various static methods available under the `GuzzleHttp\Psr7` namespace. + + +## `GuzzleHttp\Psr7\Message::toString` + +`public static function toString(MessageInterface $message): string` + +Returns the string representation of an HTTP message. + +```php +$request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com'); +echo GuzzleHttp\Psr7\Message::toString($request); +``` + + +## `GuzzleHttp\Psr7\Message::bodySummary` + +`public static function bodySummary(MessageInterface $message, int $truncateAt = 120): string|null` + +Get a short summary of the message body. + +Will return `null` if the response is not printable. + + +## `GuzzleHttp\Psr7\Message::rewindBody` + +`public static function rewindBody(MessageInterface $message): void` + +Attempts to rewind a message body and throws an exception on failure. + +The body of the message will only be rewound if a call to `tell()` +returns a value other than `0`. + + +## `GuzzleHttp\Psr7\Message::parseMessage` + +`public static function parseMessage(string $message): array` + +Parses an HTTP message into an associative array. + +The array contains the "start-line" key containing the start line of +the message, "headers" key containing an associative array of header +array values, and a "body" key containing the body of the message. + + +## `GuzzleHttp\Psr7\Message::parseRequestUri` + +`public static function parseRequestUri(string $path, array $headers): string` + +Constructs a URI for an HTTP request message. + + +## `GuzzleHttp\Psr7\Message::parseRequest` + +`public static function parseRequest(string $message): Request` + +Parses a request message string into a request object. + + +## `GuzzleHttp\Psr7\Message::parseResponse` + +`public static function parseResponse(string $message): Response` + +Parses a response message string into a response object. + + +## `GuzzleHttp\Psr7\Header::parse` + +`public static function parse(string|array $header): array` + +Parse an array of header values containing ";" separated data into an +array of associative arrays representing the header key value pair data +of the header. When a parameter does not contain a value, but just +contains a key, this function will inject a key with a '' string value. + + +## `GuzzleHttp\Psr7\Header::splitList` + +`public static function splitList(string|string[] $header): string[]` + +Splits a HTTP header defined to contain a comma-separated list into +each individual value: + +``` +$knownEtags = Header::splitList($request->getHeader('if-none-match')); +``` + +Example headers include `accept`, `cache-control` and `if-none-match`. + + +## `GuzzleHttp\Psr7\Header::normalize` (deprecated) + +`public static function normalize(string|array $header): array` + +`Header::normalize()` is deprecated in favor of [`Header::splitList()`](README.md#guzzlehttppsr7headersplitlist) +which performs the same operation with a cleaned up API and improved +documentation. + +Converts an array of header values that may contain comma separated +headers into an array of headers with no comma separated values. + + +## `GuzzleHttp\Psr7\Query::parse` + +`public static function parse(string $str, int|bool $urlEncoding = true): array` + +Parse a query string into an associative array. + +If multiple values are found for the same key, the value of that key +value pair will become an array. This function does not parse nested +PHP style arrays into an associative array (e.g., `foo[a]=1&foo[b]=2` +will be parsed into `['foo[a]' => '1', 'foo[b]' => '2'])`. + + +## `GuzzleHttp\Psr7\Query::build` + +`public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986): string` + +Build a query string from an array of key value pairs. + +This function can use the return value of `parse()` to build a query +string. This function does not modify the provided keys when an array is +encountered (like `http_build_query()` would). + + +## `GuzzleHttp\Psr7\Utils::caselessRemove` + +`public static function caselessRemove(iterable $keys, $keys, array $data): array` + +Remove the items given by the keys, case insensitively from the data. + + +## `GuzzleHttp\Psr7\Utils::copyToStream` + +`public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void` + +Copy the contents of a stream into another stream until the given number +of bytes have been read. + + +## `GuzzleHttp\Psr7\Utils::copyToString` + +`public static function copyToString(StreamInterface $stream, int $maxLen = -1): string` + +Copy the contents of a stream into a string until the given number of +bytes have been read. + + +## `GuzzleHttp\Psr7\Utils::hash` + +`public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string` + +Calculate a hash of a stream. + +This method reads the entire stream to calculate a rolling hash, based on +PHP's `hash_init` functions. + + +## `GuzzleHttp\Psr7\Utils::modifyRequest` + +`public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface` + +Clone and modify a request with the given changes. + +This method is useful for reducing the number of clones needed to mutate +a message. + +- method: (string) Changes the HTTP method. +- set_headers: (array) Sets the given headers. +- remove_headers: (array) Remove the given headers. +- body: (mixed) Sets the given body. +- uri: (UriInterface) Set the URI. +- query: (string) Set the query string value of the URI. +- version: (string) Set the protocol version. + + +## `GuzzleHttp\Psr7\Utils::readLine` + +`public static function readLine(StreamInterface $stream, int $maxLength = null): string` + +Read a line from the stream up to the maximum allowed buffer length. + + +## `GuzzleHttp\Psr7\Utils::streamFor` + +`public static function streamFor(resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource = '', array $options = []): StreamInterface` + +Create a new stream based on the input type. + +Options is an associative array that can contain the following keys: + +- metadata: Array of custom metadata. +- size: Size of the stream. + +This method accepts the following `$resource` types: + +- `Psr\Http\Message\StreamInterface`: Returns the value as-is. +- `string`: Creates a stream object that uses the given string as the contents. +- `resource`: Creates a stream object that wraps the given PHP stream resource. +- `Iterator`: If the provided value implements `Iterator`, then a read-only + stream object will be created that wraps the given iterable. Each time the + stream is read from, data from the iterator will fill a buffer and will be + continuously called until the buffer is equal to the requested read size. + Subsequent read calls will first read from the buffer and then call `next` + on the underlying iterator until it is exhausted. +- `object` with `__toString()`: If the object has the `__toString()` method, + the object will be cast to a string and then a stream will be returned that + uses the string value. +- `NULL`: When `null` is passed, an empty stream object is returned. +- `callable` When a callable is passed, a read-only stream object will be + created that invokes the given callable. The callable is invoked with the + number of suggested bytes to read. The callable can return any number of + bytes, but MUST return `false` when there is no more data to return. The + stream object that wraps the callable will invoke the callable until the + number of requested bytes are available. Any additional bytes will be + buffered and used in subsequent reads. + +```php +$stream = GuzzleHttp\Psr7\Utils::streamFor('foo'); +$stream = GuzzleHttp\Psr7\Utils::streamFor(fopen('/path/to/file', 'r')); + +$generator = function ($bytes) { + for ($i = 0; $i < $bytes; $i++) { + yield ' '; + } +} + +$stream = GuzzleHttp\Psr7\Utils::streamFor($generator(100)); +``` + + +## `GuzzleHttp\Psr7\Utils::tryFopen` + +`public static function tryFopen(string $filename, string $mode): resource` + +Safely opens a PHP stream resource using a filename. + +When fopen fails, PHP normally raises a warning. This function adds an +error handler that checks for errors and throws an exception instead. + + +## `GuzzleHttp\Psr7\Utils::tryGetContents` + +`public static function tryGetContents(resource $stream): string` + +Safely gets the contents of a given stream. + +When stream_get_contents fails, PHP normally raises a warning. This +function adds an error handler that checks for errors and throws an +exception instead. + + +## `GuzzleHttp\Psr7\Utils::uriFor` + +`public static function uriFor(string|UriInterface $uri): UriInterface` + +Returns a UriInterface for the given value. + +This function accepts a string or UriInterface and returns a +UriInterface for the given value. If the value is already a +UriInterface, it is returned as-is. + + +## `GuzzleHttp\Psr7\MimeType::fromFilename` + +`public static function fromFilename(string $filename): string|null` + +Determines the mimetype of a file by looking at its extension. + + +## `GuzzleHttp\Psr7\MimeType::fromExtension` + +`public static function fromExtension(string $extension): string|null` + +Maps a file extensions to a mimetype. + + +## Upgrading from Function API + +The static API was first introduced in 1.7.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API was removed in 2.0.0. A migration table has been provided here for your convenience: + +| Original Function | Replacement Method | +|----------------|----------------| +| `str` | `Message::toString` | +| `uri_for` | `Utils::uriFor` | +| `stream_for` | `Utils::streamFor` | +| `parse_header` | `Header::parse` | +| `normalize_header` | `Header::normalize` | +| `modify_request` | `Utils::modifyRequest` | +| `rewind_body` | `Message::rewindBody` | +| `try_fopen` | `Utils::tryFopen` | +| `copy_to_string` | `Utils::copyToString` | +| `copy_to_stream` | `Utils::copyToStream` | +| `hash` | `Utils::hash` | +| `readline` | `Utils::readLine` | +| `parse_request` | `Message::parseRequest` | +| `parse_response` | `Message::parseResponse` | +| `parse_query` | `Query::parse` | +| `build_query` | `Query::build` | +| `mimetype_from_filename` | `MimeType::fromFilename` | +| `mimetype_from_extension` | `MimeType::fromExtension` | +| `_parse_message` | `Message::parseMessage` | +| `_parse_request_uri` | `Message::parseRequestUri` | +| `get_message_body_summary` | `Message::bodySummary` | +| `_caseless_remove` | `Utils::caselessRemove` | + + +# Additional URI Methods + +Aside from the standard `Psr\Http\Message\UriInterface` implementation in form of the `GuzzleHttp\Psr7\Uri` class, +this library also provides additional functionality when working with URIs as static methods. + +## URI Types + +An instance of `Psr\Http\Message\UriInterface` can either be an absolute URI or a relative reference. +An absolute URI has a scheme. A relative reference is used to express a URI relative to another URI, +the base URI. Relative references can be divided into several forms according to +[RFC 3986 Section 4.2](https://tools.ietf.org/html/rfc3986#section-4.2): + +- network-path references, e.g. `//example.com/path` +- absolute-path references, e.g. `/path` +- relative-path references, e.g. `subpath` + +The following methods can be used to identify the type of the URI. + +### `GuzzleHttp\Psr7\Uri::isAbsolute` + +`public static function isAbsolute(UriInterface $uri): bool` + +Whether the URI is absolute, i.e. it has a scheme. + +### `GuzzleHttp\Psr7\Uri::isNetworkPathReference` + +`public static function isNetworkPathReference(UriInterface $uri): bool` + +Whether the URI is a network-path reference. A relative reference that begins with two slash characters is +termed an network-path reference. + +### `GuzzleHttp\Psr7\Uri::isAbsolutePathReference` + +`public static function isAbsolutePathReference(UriInterface $uri): bool` + +Whether the URI is a absolute-path reference. A relative reference that begins with a single slash character is +termed an absolute-path reference. + +### `GuzzleHttp\Psr7\Uri::isRelativePathReference` + +`public static function isRelativePathReference(UriInterface $uri): bool` + +Whether the URI is a relative-path reference. A relative reference that does not begin with a slash character is +termed a relative-path reference. + +### `GuzzleHttp\Psr7\Uri::isSameDocumentReference` + +`public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool` + +Whether the URI is a same-document reference. A same-document reference refers to a URI that is, aside from its +fragment component, identical to the base URI. When no base URI is given, only an empty URI reference +(apart from its fragment) is considered a same-document reference. + +## URI Components + +Additional methods to work with URI components. + +### `GuzzleHttp\Psr7\Uri::isDefaultPort` + +`public static function isDefaultPort(UriInterface $uri): bool` + +Whether the URI has the default port of the current scheme. `Psr\Http\Message\UriInterface::getPort` may return null +or the standard port. This method can be used independently of the implementation. + +### `GuzzleHttp\Psr7\Uri::composeComponents` + +`public static function composeComponents($scheme, $authority, $path, $query, $fragment): string` + +Composes a URI reference string from its various components according to +[RFC 3986 Section 5.3](https://tools.ietf.org/html/rfc3986#section-5.3). Usually this method does not need to be called +manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__toString`. + +### `GuzzleHttp\Psr7\Uri::fromParts` + +`public static function fromParts(array $parts): UriInterface` + +Creates a URI from a hash of [`parse_url`](https://www.php.net/manual/en/function.parse-url.php) components. + + +### `GuzzleHttp\Psr7\Uri::withQueryValue` + +`public static function withQueryValue(UriInterface $uri, $key, $value): UriInterface` + +Creates a new URI with a specific query string value. Any existing query string values that exactly match the +provided key are removed and replaced with the given key value pair. A value of null will set the query string +key without a value, e.g. "key" instead of "key=value". + +### `GuzzleHttp\Psr7\Uri::withQueryValues` + +`public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface` + +Creates a new URI with multiple query string values. It has the same behavior as `withQueryValue()` but for an +associative array of key => value. + +### `GuzzleHttp\Psr7\Uri::withoutQueryValue` + +`public static function withoutQueryValue(UriInterface $uri, $key): UriInterface` + +Creates a new URI with a specific query string value removed. Any existing query string values that exactly match the +provided key are removed. + +## Cross-Origin Detection + +`GuzzleHttp\Psr7\UriComparator` provides methods to determine if a modified URL should be considered cross-origin. + +### `GuzzleHttp\Psr7\UriComparator::isCrossOrigin` + +`public static function isCrossOrigin(UriInterface $original, UriInterface $modified): bool` + +Determines if a modified URL should be considered cross-origin with respect to an original URL. + +## Reference Resolution + +`GuzzleHttp\Psr7\UriResolver` provides methods to resolve a URI reference in the context of a base URI according +to [RFC 3986 Section 5](https://tools.ietf.org/html/rfc3986#section-5). This is for example also what web browsers +do when resolving a link in a website based on the current request URI. + +### `GuzzleHttp\Psr7\UriResolver::resolve` + +`public static function resolve(UriInterface $base, UriInterface $rel): UriInterface` + +Converts the relative URI into a new URI that is resolved against the base URI. + +### `GuzzleHttp\Psr7\UriResolver::removeDotSegments` + +`public static function removeDotSegments(string $path): string` + +Removes dot segments from a path and returns the new path according to +[RFC 3986 Section 5.2.4](https://tools.ietf.org/html/rfc3986#section-5.2.4). + +### `GuzzleHttp\Psr7\UriResolver::relativize` + +`public static function relativize(UriInterface $base, UriInterface $target): UriInterface` + +Returns the target URI as a relative reference from the base URI. This method is the counterpart to resolve(): + +```php +(string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) +``` + +One use-case is to use the current request URI as base URI and then generate relative links in your documents +to reduce the document size or offer self-contained downloadable document archives. + +```php +$base = new Uri('http://example.com/a/b/'); +echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. +echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. +echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. +echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. +``` + +## Normalization and Comparison + +`GuzzleHttp\Psr7\UriNormalizer` provides methods to normalize and compare URIs according to +[RFC 3986 Section 6](https://tools.ietf.org/html/rfc3986#section-6). + +### `GuzzleHttp\Psr7\UriNormalizer::normalize` + +`public static function normalize(UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS): UriInterface` + +Returns a normalized URI. The scheme and host component are already normalized to lowercase per PSR-7 UriInterface. +This methods adds additional normalizations that can be configured with the `$flags` parameter which is a bitmask +of normalizations to apply. The following normalizations are available: + +- `UriNormalizer::PRESERVING_NORMALIZATIONS` + + Default normalizations which only include the ones that preserve semantics. + +- `UriNormalizer::CAPITALIZE_PERCENT_ENCODING` + + All letters within a percent-encoding triplet (e.g., "%3A") are case-insensitive, and should be capitalized. + + Example: `http://example.org/a%c2%b1b` → `http://example.org/a%C2%B1b` + +- `UriNormalizer::DECODE_UNRESERVED_CHARACTERS` + + Decodes percent-encoded octets of unreserved characters. For consistency, percent-encoded octets in the ranges of + ALPHA (%41–%5A and %61–%7A), DIGIT (%30–%39), hyphen (%2D), period (%2E), underscore (%5F), or tilde (%7E) should + not be created by URI producers and, when found in a URI, should be decoded to their corresponding unreserved + characters by URI normalizers. + + Example: `http://example.org/%7Eusern%61me/` → `http://example.org/~username/` + +- `UriNormalizer::CONVERT_EMPTY_PATH` + + Converts the empty path to "/" for http and https URIs. + + Example: `http://example.org` → `http://example.org/` + +- `UriNormalizer::REMOVE_DEFAULT_HOST` + + Removes the default host of the given URI scheme from the URI. Only the "file" scheme defines the default host + "localhost". All of `file:/myfile`, `file:///myfile`, and `file://localhost/myfile` are equivalent according to + RFC 3986. + + Example: `file://localhost/myfile` → `file:///myfile` + +- `UriNormalizer::REMOVE_DEFAULT_PORT` + + Removes the default port of the given URI scheme from the URI. + + Example: `http://example.org:80/` → `http://example.org/` + +- `UriNormalizer::REMOVE_DOT_SEGMENTS` + + Removes unnecessary dot-segments. Dot-segments in relative-path references are not removed as it would + change the semantics of the URI reference. + + Example: `http://example.org/../a/b/../c/./d.html` → `http://example.org/a/c/d.html` + +- `UriNormalizer::REMOVE_DUPLICATE_SLASHES` + + Paths which include two or more adjacent slashes are converted to one. Webservers usually ignore duplicate slashes + and treat those URIs equivalent. But in theory those URIs do not need to be equivalent. So this normalization + may change the semantics. Encoded slashes (%2F) are not removed. + + Example: `http://example.org//foo///bar.html` → `http://example.org/foo/bar.html` + +- `UriNormalizer::SORT_QUERY_PARAMETERS` + + Sort query parameters with their values in alphabetical order. However, the order of parameters in a URI may be + significant (this is not defined by the standard). So this normalization is not safe and may change the semantics + of the URI. + + Example: `?lang=en&article=fred` → `?article=fred&lang=en` + +### `GuzzleHttp\Psr7\UriNormalizer::isEquivalent` + +`public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS): bool` + +Whether two URIs can be considered equivalent. Both URIs are normalized automatically before comparison with the given +`$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent. +This of course assumes they will be resolved against the same base URI. If this is not the case, determination of +equivalence or difference of relative references does not mean anything. + + +## Security + +If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/psr7/security/policy) for more information. + + +## License + +Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. + + +## For Enterprise + +Available as part of the Tidelift Subscription + +The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-psr7?utm_source=packagist-guzzlehttp-psr7&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/vendor/guzzlehttp/psr7/composer.json b/vendor/guzzlehttp/psr7/composer.json new file mode 100644 index 000000000..d51dd622e --- /dev/null +++ b/vendor/guzzlehttp/psr7/composer.json @@ -0,0 +1,93 @@ +{ + "name": "guzzlehttp/psr7", + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "request", + "response", + "message", + "stream", + "http", + "uri", + "url", + "psr-7" + ], + "license": "MIT", + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Tests\\Psr7\\": "tests/" + } + }, + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "config": { + "allow-plugins": { + "bamarni/composer-bin-plugin": true + }, + "preferred-install": "dist", + "sort-packages": true + } +} diff --git a/vendor/guzzlehttp/psr7/src/AppendStream.php b/vendor/guzzlehttp/psr7/src/AppendStream.php new file mode 100644 index 000000000..ee8f37882 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/AppendStream.php @@ -0,0 +1,248 @@ +addStream($stream); + } + } + + public function __toString(): string + { + try { + $this->rewind(); + + return $this->getContents(); + } catch (\Throwable $e) { + if (\PHP_VERSION_ID >= 70400) { + throw $e; + } + trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + + return ''; + } + } + + /** + * Add a stream to the AppendStream + * + * @param StreamInterface $stream Stream to append. Must be readable. + * + * @throws \InvalidArgumentException if the stream is not readable + */ + public function addStream(StreamInterface $stream): void + { + if (!$stream->isReadable()) { + throw new \InvalidArgumentException('Each stream must be readable'); + } + + // The stream is only seekable if all streams are seekable + if (!$stream->isSeekable()) { + $this->seekable = false; + } + + $this->streams[] = $stream; + } + + public function getContents(): string + { + return Utils::copyToString($this); + } + + /** + * Closes each attached stream. + */ + public function close(): void + { + $this->pos = $this->current = 0; + $this->seekable = true; + + foreach ($this->streams as $stream) { + $stream->close(); + } + + $this->streams = []; + } + + /** + * Detaches each attached stream. + * + * Returns null as it's not clear which underlying stream resource to return. + */ + public function detach() + { + $this->pos = $this->current = 0; + $this->seekable = true; + + foreach ($this->streams as $stream) { + $stream->detach(); + } + + $this->streams = []; + + return null; + } + + public function tell(): int + { + return $this->pos; + } + + /** + * Tries to calculate the size by adding the size of each stream. + * + * If any of the streams do not return a valid number, then the size of the + * append stream cannot be determined and null is returned. + */ + public function getSize(): ?int + { + $size = 0; + + foreach ($this->streams as $stream) { + $s = $stream->getSize(); + if ($s === null) { + return null; + } + $size += $s; + } + + return $size; + } + + public function eof(): bool + { + return !$this->streams + || ($this->current >= count($this->streams) - 1 + && $this->streams[$this->current]->eof()); + } + + public function rewind(): void + { + $this->seek(0); + } + + /** + * Attempts to seek to the given position. Only supports SEEK_SET. + */ + public function seek($offset, $whence = SEEK_SET): void + { + if (!$this->seekable) { + throw new \RuntimeException('This AppendStream is not seekable'); + } elseif ($whence !== SEEK_SET) { + throw new \RuntimeException('The AppendStream can only seek with SEEK_SET'); + } + + $this->pos = $this->current = 0; + + // Rewind each stream + foreach ($this->streams as $i => $stream) { + try { + $stream->rewind(); + } catch (\Exception $e) { + throw new \RuntimeException('Unable to seek stream ' + .$i.' of the AppendStream', 0, $e); + } + } + + // Seek to the actual position by reading from each stream + while ($this->pos < $offset && !$this->eof()) { + $result = $this->read(min(8096, $offset - $this->pos)); + if ($result === '') { + break; + } + } + } + + /** + * Reads from all of the appended streams until the length is met or EOF. + */ + public function read($length): string + { + $buffer = ''; + $total = count($this->streams) - 1; + $remaining = $length; + $progressToNext = false; + + while ($remaining > 0) { + // Progress to the next stream if needed. + if ($progressToNext || $this->streams[$this->current]->eof()) { + $progressToNext = false; + if ($this->current === $total) { + break; + } + ++$this->current; + } + + $result = $this->streams[$this->current]->read($remaining); + + if ($result === '') { + $progressToNext = true; + continue; + } + + $buffer .= $result; + $remaining = $length - strlen($buffer); + } + + $this->pos += strlen($buffer); + + return $buffer; + } + + public function isReadable(): bool + { + return true; + } + + public function isWritable(): bool + { + return false; + } + + public function isSeekable(): bool + { + return $this->seekable; + } + + public function write($string): int + { + throw new \RuntimeException('Cannot write to an AppendStream'); + } + + /** + * @return mixed + */ + public function getMetadata($key = null) + { + return $key ? null : []; + } +} diff --git a/vendor/guzzlehttp/psr7/src/BufferStream.php b/vendor/guzzlehttp/psr7/src/BufferStream.php new file mode 100644 index 000000000..2b0eb77be --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/BufferStream.php @@ -0,0 +1,147 @@ +hwm = $hwm; + } + + public function __toString(): string + { + return $this->getContents(); + } + + public function getContents(): string + { + $buffer = $this->buffer; + $this->buffer = ''; + + return $buffer; + } + + public function close(): void + { + $this->buffer = ''; + } + + public function detach() + { + $this->close(); + + return null; + } + + public function getSize(): ?int + { + return strlen($this->buffer); + } + + public function isReadable(): bool + { + return true; + } + + public function isWritable(): bool + { + return true; + } + + public function isSeekable(): bool + { + return false; + } + + public function rewind(): void + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET): void + { + throw new \RuntimeException('Cannot seek a BufferStream'); + } + + public function eof(): bool + { + return strlen($this->buffer) === 0; + } + + public function tell(): int + { + throw new \RuntimeException('Cannot determine the position of a BufferStream'); + } + + /** + * Reads data from the buffer. + */ + public function read($length): string + { + $currentLength = strlen($this->buffer); + + if ($length >= $currentLength) { + // No need to slice the buffer because we don't have enough data. + $result = $this->buffer; + $this->buffer = ''; + } else { + // Slice up the result to provide a subset of the buffer. + $result = substr($this->buffer, 0, $length); + $this->buffer = substr($this->buffer, $length); + } + + return $result; + } + + /** + * Writes data to the buffer. + */ + public function write($string): int + { + $this->buffer .= $string; + + if (strlen($this->buffer) >= $this->hwm) { + return 0; + } + + return strlen($string); + } + + /** + * @return mixed + */ + public function getMetadata($key = null) + { + if ($key === 'hwm') { + return $this->hwm; + } + + return $key ? null : []; + } +} diff --git a/vendor/guzzlehttp/psr7/src/CachingStream.php b/vendor/guzzlehttp/psr7/src/CachingStream.php new file mode 100644 index 000000000..f34722cff --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/CachingStream.php @@ -0,0 +1,153 @@ +remoteStream = $stream; + $this->stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+')); + } + + public function getSize(): ?int + { + $remoteSize = $this->remoteStream->getSize(); + + if (null === $remoteSize) { + return null; + } + + return max($this->stream->getSize(), $remoteSize); + } + + public function rewind(): void + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET): void + { + if ($whence === SEEK_SET) { + $byte = $offset; + } elseif ($whence === SEEK_CUR) { + $byte = $offset + $this->tell(); + } elseif ($whence === SEEK_END) { + $size = $this->remoteStream->getSize(); + if ($size === null) { + $size = $this->cacheEntireStream(); + } + $byte = $size + $offset; + } else { + throw new \InvalidArgumentException('Invalid whence'); + } + + $diff = $byte - $this->stream->getSize(); + + if ($diff > 0) { + // Read the remoteStream until we have read in at least the amount + // of bytes requested, or we reach the end of the file. + while ($diff > 0 && !$this->remoteStream->eof()) { + $this->read($diff); + $diff = $byte - $this->stream->getSize(); + } + } else { + // We can just do a normal seek since we've already seen this byte. + $this->stream->seek($byte); + } + } + + public function read($length): string + { + // Perform a regular read on any previously read data from the buffer + $data = $this->stream->read($length); + $remaining = $length - strlen($data); + + // More data was requested so read from the remote stream + if ($remaining) { + // If data was written to the buffer in a position that would have + // been filled from the remote stream, then we must skip bytes on + // the remote stream to emulate overwriting bytes from that + // position. This mimics the behavior of other PHP stream wrappers. + $remoteData = $this->remoteStream->read( + $remaining + $this->skipReadBytes + ); + + if ($this->skipReadBytes) { + $len = strlen($remoteData); + $remoteData = substr($remoteData, $this->skipReadBytes); + $this->skipReadBytes = max(0, $this->skipReadBytes - $len); + } + + $data .= $remoteData; + $this->stream->write($remoteData); + } + + return $data; + } + + public function write($string): int + { + // When appending to the end of the currently read stream, you'll want + // to skip bytes from being read from the remote stream to emulate + // other stream wrappers. Basically replacing bytes of data of a fixed + // length. + $overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell(); + if ($overflow > 0) { + $this->skipReadBytes += $overflow; + } + + return $this->stream->write($string); + } + + public function eof(): bool + { + return $this->stream->eof() && $this->remoteStream->eof(); + } + + /** + * Close both the remote stream and buffer stream + */ + public function close(): void + { + $this->remoteStream->close(); + $this->stream->close(); + } + + private function cacheEntireStream(): int + { + $target = new FnStream(['write' => 'strlen']); + Utils::copyToStream($this, $target); + + return $this->tell(); + } +} diff --git a/vendor/guzzlehttp/psr7/src/DroppingStream.php b/vendor/guzzlehttp/psr7/src/DroppingStream.php new file mode 100644 index 000000000..6e3d209d0 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/DroppingStream.php @@ -0,0 +1,49 @@ +stream = $stream; + $this->maxLength = $maxLength; + } + + public function write($string): int + { + $diff = $this->maxLength - $this->stream->getSize(); + + // Begin returning 0 when the underlying stream is too large. + if ($diff <= 0) { + return 0; + } + + // Write the stream or a subset of the stream if needed. + if (strlen($string) < $diff) { + return $this->stream->write($string); + } + + return $this->stream->write(substr($string, 0, $diff)); + } +} diff --git a/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php b/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php new file mode 100644 index 000000000..3a084779a --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php @@ -0,0 +1,14 @@ + */ + private $methods; + + /** + * @param array $methods Hash of method name to a callable. + */ + public function __construct(array $methods) + { + $this->methods = $methods; + + // Create the functions on the class + foreach ($methods as $name => $fn) { + $this->{'_fn_'.$name} = $fn; + } + } + + /** + * Lazily determine which methods are not implemented. + * + * @throws \BadMethodCallException + */ + public function __get(string $name): void + { + throw new \BadMethodCallException(str_replace('_fn_', '', $name) + .'() is not implemented in the FnStream'); + } + + /** + * The close method is called on the underlying stream only if possible. + */ + public function __destruct() + { + if (isset($this->_fn_close)) { + call_user_func($this->_fn_close); + } + } + + /** + * An unserialize would allow the __destruct to run when the unserialized value goes out of scope. + * + * @throws \LogicException + */ + public function __wakeup(): void + { + throw new \LogicException('FnStream should never be unserialized'); + } + + /** + * Adds custom functionality to an underlying stream by intercepting + * specific method calls. + * + * @param StreamInterface $stream Stream to decorate + * @param array $methods Hash of method name to a closure + * + * @return FnStream + */ + public static function decorate(StreamInterface $stream, array $methods) + { + // If any of the required methods were not provided, then simply + // proxy to the decorated stream. + foreach (array_diff(self::SLOTS, array_keys($methods)) as $diff) { + /** @var callable $callable */ + $callable = [$stream, $diff]; + $methods[$diff] = $callable; + } + + return new self($methods); + } + + public function __toString(): string + { + try { + return call_user_func($this->_fn___toString); + } catch (\Throwable $e) { + if (\PHP_VERSION_ID >= 70400) { + throw $e; + } + trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + + return ''; + } + } + + public function close(): void + { + call_user_func($this->_fn_close); + } + + public function detach() + { + return call_user_func($this->_fn_detach); + } + + public function getSize(): ?int + { + return call_user_func($this->_fn_getSize); + } + + public function tell(): int + { + return call_user_func($this->_fn_tell); + } + + public function eof(): bool + { + return call_user_func($this->_fn_eof); + } + + public function isSeekable(): bool + { + return call_user_func($this->_fn_isSeekable); + } + + public function rewind(): void + { + call_user_func($this->_fn_rewind); + } + + public function seek($offset, $whence = SEEK_SET): void + { + call_user_func($this->_fn_seek, $offset, $whence); + } + + public function isWritable(): bool + { + return call_user_func($this->_fn_isWritable); + } + + public function write($string): int + { + return call_user_func($this->_fn_write, $string); + } + + public function isReadable(): bool + { + return call_user_func($this->_fn_isReadable); + } + + public function read($length): string + { + return call_user_func($this->_fn_read, $length); + } + + public function getContents(): string + { + return call_user_func($this->_fn_getContents); + } + + /** + * @return mixed + */ + public function getMetadata($key = null) + { + return call_user_func($this->_fn_getMetadata, $key); + } +} diff --git a/vendor/guzzlehttp/psr7/src/Header.php b/vendor/guzzlehttp/psr7/src/Header.php new file mode 100644 index 000000000..6e38e0031 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Header.php @@ -0,0 +1,134 @@ +]+>|[^=]+/', $kvp, $matches)) { + $m = $matches[0]; + if (isset($m[1])) { + $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed); + } else { + $part[] = trim($m[0], $trimmed); + } + } + } + if ($part) { + $params[] = $part; + } + } + } + + return $params; + } + + /** + * Converts an array of header values that may contain comma separated + * headers into an array of headers with no comma separated values. + * + * @param string|array $header Header to normalize. + * + * @deprecated Use self::splitList() instead. + */ + public static function normalize($header): array + { + $result = []; + foreach ((array) $header as $value) { + foreach (self::splitList($value) as $parsed) { + $result[] = $parsed; + } + } + + return $result; + } + + /** + * Splits a HTTP header defined to contain a comma-separated list into + * each individual value. Empty values will be removed. + * + * Example headers include 'accept', 'cache-control' and 'if-none-match'. + * + * This method must not be used to parse headers that are not defined as + * a list, such as 'user-agent' or 'set-cookie'. + * + * @param string|string[] $values Header value as returned by MessageInterface::getHeader() + * + * @return string[] + */ + public static function splitList($values): array + { + if (!\is_array($values)) { + $values = [$values]; + } + + $result = []; + foreach ($values as $value) { + if (!\is_string($value)) { + throw new \TypeError('$header must either be a string or an array containing strings.'); + } + + $v = ''; + $isQuoted = false; + $isEscaped = false; + for ($i = 0, $max = \strlen($value); $i < $max; ++$i) { + if ($isEscaped) { + $v .= $value[$i]; + $isEscaped = false; + + continue; + } + + if (!$isQuoted && $value[$i] === ',') { + $v = \trim($v); + if ($v !== '') { + $result[] = $v; + } + + $v = ''; + continue; + } + + if ($isQuoted && $value[$i] === '\\') { + $isEscaped = true; + $v .= $value[$i]; + + continue; + } + if ($value[$i] === '"') { + $isQuoted = !$isQuoted; + $v .= $value[$i]; + + continue; + } + + $v .= $value[$i]; + } + + $v = \trim($v); + if ($v !== '') { + $result[] = $v; + } + } + + return $result; + } +} diff --git a/vendor/guzzlehttp/psr7/src/HttpFactory.php b/vendor/guzzlehttp/psr7/src/HttpFactory.php new file mode 100644 index 000000000..73d17e337 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/HttpFactory.php @@ -0,0 +1,94 @@ +getSize(); + } + + return new UploadedFile($stream, $size, $error, $clientFilename, $clientMediaType); + } + + public function createStream(string $content = ''): StreamInterface + { + return Utils::streamFor($content); + } + + public function createStreamFromFile(string $file, string $mode = 'r'): StreamInterface + { + try { + $resource = Utils::tryFopen($file, $mode); + } catch (\RuntimeException $e) { + if ('' === $mode || false === \in_array($mode[0], ['r', 'w', 'a', 'x', 'c'], true)) { + throw new \InvalidArgumentException(sprintf('Invalid file opening mode "%s"', $mode), 0, $e); + } + + throw $e; + } + + return Utils::streamFor($resource); + } + + public function createStreamFromResource($resource): StreamInterface + { + return Utils::streamFor($resource); + } + + public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface + { + if (empty($method)) { + if (!empty($serverParams['REQUEST_METHOD'])) { + $method = $serverParams['REQUEST_METHOD']; + } else { + throw new \InvalidArgumentException('Cannot determine HTTP method'); + } + } + + return new ServerRequest($method, $uri, [], null, '1.1', $serverParams); + } + + public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface + { + return new Response($code, [], null, '1.1', $reasonPhrase); + } + + public function createRequest(string $method, $uri): RequestInterface + { + return new Request($method, $uri); + } + + public function createUri(string $uri = ''): UriInterface + { + return new Uri($uri); + } +} diff --git a/vendor/guzzlehttp/psr7/src/InflateStream.php b/vendor/guzzlehttp/psr7/src/InflateStream.php new file mode 100644 index 000000000..599b55da3 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/InflateStream.php @@ -0,0 +1,37 @@ + 15 + 32]); + $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource)); + } +} diff --git a/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php new file mode 100644 index 000000000..f6c84904e --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php @@ -0,0 +1,49 @@ +filename = $filename; + $this->mode = $mode; + + // unsetting the property forces the first access to go through + // __get(). + unset($this->stream); + } + + /** + * Creates the underlying stream lazily when required. + */ + protected function createStream(): StreamInterface + { + return Utils::streamFor(Utils::tryFopen($this->filename, $this->mode)); + } +} diff --git a/vendor/guzzlehttp/psr7/src/LimitStream.php b/vendor/guzzlehttp/psr7/src/LimitStream.php new file mode 100644 index 000000000..fb2232557 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/LimitStream.php @@ -0,0 +1,157 @@ +stream = $stream; + $this->setLimit($limit); + $this->setOffset($offset); + } + + public function eof(): bool + { + // Always return true if the underlying stream is EOF + if ($this->stream->eof()) { + return true; + } + + // No limit and the underlying stream is not at EOF + if ($this->limit === -1) { + return false; + } + + return $this->stream->tell() >= $this->offset + $this->limit; + } + + /** + * Returns the size of the limited subset of data + */ + public function getSize(): ?int + { + if (null === ($length = $this->stream->getSize())) { + return null; + } elseif ($this->limit === -1) { + return $length - $this->offset; + } else { + return min($this->limit, $length - $this->offset); + } + } + + /** + * Allow for a bounded seek on the read limited stream + */ + public function seek($offset, $whence = SEEK_SET): void + { + if ($whence !== SEEK_SET || $offset < 0) { + throw new \RuntimeException(sprintf( + 'Cannot seek to offset %s with whence %s', + $offset, + $whence + )); + } + + $offset += $this->offset; + + if ($this->limit !== -1) { + if ($offset > $this->offset + $this->limit) { + $offset = $this->offset + $this->limit; + } + } + + $this->stream->seek($offset); + } + + /** + * Give a relative tell() + */ + public function tell(): int + { + return $this->stream->tell() - $this->offset; + } + + /** + * Set the offset to start limiting from + * + * @param int $offset Offset to seek to and begin byte limiting from + * + * @throws \RuntimeException if the stream cannot be seeked. + */ + public function setOffset(int $offset): void + { + $current = $this->stream->tell(); + + if ($current !== $offset) { + // If the stream cannot seek to the offset position, then read to it + if ($this->stream->isSeekable()) { + $this->stream->seek($offset); + } elseif ($current > $offset) { + throw new \RuntimeException("Could not seek to stream offset $offset"); + } else { + $this->stream->read($offset - $current); + } + } + + $this->offset = $offset; + } + + /** + * Set the limit of bytes that the decorator allows to be read from the + * stream. + * + * @param int $limit Number of bytes to allow to be read from the stream. + * Use -1 for no limit. + */ + public function setLimit(int $limit): void + { + $this->limit = $limit; + } + + public function read($length): string + { + if ($this->limit === -1) { + return $this->stream->read($length); + } + + // Check if the current position is less than the total allowed + // bytes + original offset + $remaining = ($this->offset + $this->limit) - $this->stream->tell(); + if ($remaining > 0) { + // Only return the amount of requested data, ensuring that the byte + // limit is not exceeded + return $this->stream->read(min($remaining, $length)); + } + + return ''; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Message.php b/vendor/guzzlehttp/psr7/src/Message.php new file mode 100644 index 000000000..6e6c3e51b --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Message.php @@ -0,0 +1,246 @@ +getMethod().' ' + .$message->getRequestTarget()) + .' HTTP/'.$message->getProtocolVersion(); + if (!$message->hasHeader('host')) { + $msg .= "\r\nHost: ".$message->getUri()->getHost(); + } + } elseif ($message instanceof ResponseInterface) { + $msg = 'HTTP/'.$message->getProtocolVersion().' ' + .$message->getStatusCode().' ' + .$message->getReasonPhrase(); + } else { + throw new \InvalidArgumentException('Unknown message type'); + } + + foreach ($message->getHeaders() as $name => $values) { + if (is_string($name) && strtolower($name) === 'set-cookie') { + foreach ($values as $value) { + $msg .= "\r\n{$name}: ".$value; + } + } else { + $msg .= "\r\n{$name}: ".implode(', ', $values); + } + } + + return "{$msg}\r\n\r\n".$message->getBody(); + } + + /** + * Get a short summary of the message body. + * + * Will return `null` if the response is not printable. + * + * @param MessageInterface $message The message to get the body summary + * @param int $truncateAt The maximum allowed size of the summary + */ + public static function bodySummary(MessageInterface $message, int $truncateAt = 120): ?string + { + $body = $message->getBody(); + + if (!$body->isSeekable() || !$body->isReadable()) { + return null; + } + + $size = $body->getSize(); + + if ($size === 0) { + return null; + } + + $body->rewind(); + $summary = $body->read($truncateAt); + $body->rewind(); + + if ($size > $truncateAt) { + $summary .= ' (truncated...)'; + } + + // Matches any printable character, including unicode characters: + // letters, marks, numbers, punctuation, spacing, and separators. + if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary) !== 0) { + return null; + } + + return $summary; + } + + /** + * Attempts to rewind a message body and throws an exception on failure. + * + * The body of the message will only be rewound if a call to `tell()` + * returns a value other than `0`. + * + * @param MessageInterface $message Message to rewind + * + * @throws \RuntimeException + */ + public static function rewindBody(MessageInterface $message): void + { + $body = $message->getBody(); + + if ($body->tell()) { + $body->rewind(); + } + } + + /** + * Parses an HTTP message into an associative array. + * + * The array contains the "start-line" key containing the start line of + * the message, "headers" key containing an associative array of header + * array values, and a "body" key containing the body of the message. + * + * @param string $message HTTP request or response to parse. + */ + public static function parseMessage(string $message): array + { + if (!$message) { + throw new \InvalidArgumentException('Invalid message'); + } + + $message = ltrim($message, "\r\n"); + + $messageParts = preg_split("/\r?\n\r?\n/", $message, 2); + + if ($messageParts === false || count($messageParts) !== 2) { + throw new \InvalidArgumentException('Invalid message: Missing header delimiter'); + } + + [$rawHeaders, $body] = $messageParts; + $rawHeaders .= "\r\n"; // Put back the delimiter we split previously + $headerParts = preg_split("/\r?\n/", $rawHeaders, 2); + + if ($headerParts === false || count($headerParts) !== 2) { + throw new \InvalidArgumentException('Invalid message: Missing status line'); + } + + [$startLine, $rawHeaders] = $headerParts; + + if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') { + // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0 + $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders); + } + + /** @var array[] $headerLines */ + $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER); + + // If these aren't the same, then one line didn't match and there's an invalid header. + if ($count !== substr_count($rawHeaders, "\n")) { + // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4 + if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) { + throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding'); + } + + throw new \InvalidArgumentException('Invalid header syntax'); + } + + $headers = []; + + foreach ($headerLines as $headerLine) { + $headers[$headerLine[1]][] = $headerLine[2]; + } + + return [ + 'start-line' => $startLine, + 'headers' => $headers, + 'body' => $body, + ]; + } + + /** + * Constructs a URI for an HTTP request message. + * + * @param string $path Path from the start-line + * @param array $headers Array of headers (each value an array). + */ + public static function parseRequestUri(string $path, array $headers): string + { + $hostKey = array_filter(array_keys($headers), function ($k) { + // Numeric array keys are converted to int by PHP. + $k = (string) $k; + + return strtolower($k) === 'host'; + }); + + // If no host is found, then a full URI cannot be constructed. + if (!$hostKey) { + return $path; + } + + $host = $headers[reset($hostKey)][0]; + $scheme = substr($host, -4) === ':443' ? 'https' : 'http'; + + return $scheme.'://'.$host.'/'.ltrim($path, '/'); + } + + /** + * Parses a request message string into a request object. + * + * @param string $message Request message string. + */ + public static function parseRequest(string $message): RequestInterface + { + $data = self::parseMessage($message); + $matches = []; + if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) { + throw new \InvalidArgumentException('Invalid request string'); + } + $parts = explode(' ', $data['start-line'], 3); + $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1'; + + $request = new Request( + $parts[0], + $matches[1] === '/' ? self::parseRequestUri($parts[1], $data['headers']) : $parts[1], + $data['headers'], + $data['body'], + $version + ); + + return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]); + } + + /** + * Parses a response message string into a response object. + * + * @param string $message Response message string. + */ + public static function parseResponse(string $message): ResponseInterface + { + $data = self::parseMessage($message); + // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space + // between status-code and reason-phrase is required. But browsers accept + // responses without space and reason as well. + if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) { + throw new \InvalidArgumentException('Invalid response string: '.$data['start-line']); + } + $parts = explode(' ', $data['start-line'], 3); + + return new Response( + (int) $parts[1], + $data['headers'], + $data['body'], + explode('/', $parts[0])[1], + $parts[2] ?? null + ); + } +} diff --git a/vendor/guzzlehttp/psr7/src/MessageTrait.php b/vendor/guzzlehttp/psr7/src/MessageTrait.php new file mode 100644 index 000000000..e05ebea88 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/MessageTrait.php @@ -0,0 +1,265 @@ + array of values */ + private $headers = []; + + /** @var string[] Map of lowercase header name => original name at registration */ + private $headerNames = []; + + /** @var string */ + private $protocol = '1.1'; + + /** @var StreamInterface|null */ + private $stream; + + public function getProtocolVersion(): string + { + return $this->protocol; + } + + public function withProtocolVersion($version): MessageInterface + { + if ($this->protocol === $version) { + return $this; + } + + $new = clone $this; + $new->protocol = $version; + + return $new; + } + + public function getHeaders(): array + { + return $this->headers; + } + + public function hasHeader($header): bool + { + return isset($this->headerNames[strtolower($header)]); + } + + public function getHeader($header): array + { + $header = strtolower($header); + + if (!isset($this->headerNames[$header])) { + return []; + } + + $header = $this->headerNames[$header]; + + return $this->headers[$header]; + } + + public function getHeaderLine($header): string + { + return implode(', ', $this->getHeader($header)); + } + + public function withHeader($header, $value): MessageInterface + { + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + unset($new->headers[$new->headerNames[$normalized]]); + } + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + + return $new; + } + + public function withAddedHeader($header, $value): MessageInterface + { + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $new->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + } + + return $new; + } + + public function withoutHeader($header): MessageInterface + { + $normalized = strtolower($header); + + if (!isset($this->headerNames[$normalized])) { + return $this; + } + + $header = $this->headerNames[$normalized]; + + $new = clone $this; + unset($new->headers[$header], $new->headerNames[$normalized]); + + return $new; + } + + public function getBody(): StreamInterface + { + if (!$this->stream) { + $this->stream = Utils::streamFor(''); + } + + return $this->stream; + } + + public function withBody(StreamInterface $body): MessageInterface + { + if ($body === $this->stream) { + return $this; + } + + $new = clone $this; + $new->stream = $body; + + return $new; + } + + /** + * @param array $headers + */ + private function setHeaders(array $headers): void + { + $this->headerNames = $this->headers = []; + foreach ($headers as $header => $value) { + // Numeric array keys are converted to int by PHP. + $header = (string) $header; + + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + if (isset($this->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $this->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $this->headerNames[$normalized] = $header; + $this->headers[$header] = $value; + } + } + } + + /** + * @param mixed $value + * + * @return string[] + */ + private function normalizeHeaderValue($value): array + { + if (!is_array($value)) { + return $this->trimAndValidateHeaderValues([$value]); + } + + if (count($value) === 0) { + throw new \InvalidArgumentException('Header value can not be an empty array.'); + } + + return $this->trimAndValidateHeaderValues($value); + } + + /** + * Trims whitespace from the header values. + * + * Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field. + * + * header-field = field-name ":" OWS field-value OWS + * OWS = *( SP / HTAB ) + * + * @param mixed[] $values Header values + * + * @return string[] Trimmed header values + * + * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 + */ + private function trimAndValidateHeaderValues(array $values): array + { + return array_map(function ($value) { + if (!is_scalar($value) && null !== $value) { + throw new \InvalidArgumentException(sprintf( + 'Header value must be scalar or null but %s provided.', + is_object($value) ? get_class($value) : gettype($value) + )); + } + + $trimmed = trim((string) $value, " \t"); + $this->assertValue($trimmed); + + return $trimmed; + }, array_values($values)); + } + + /** + * @see https://tools.ietf.org/html/rfc7230#section-3.2 + * + * @param mixed $header + */ + private function assertHeader($header): void + { + if (!is_string($header)) { + throw new \InvalidArgumentException(sprintf( + 'Header name must be a string but %s provided.', + is_object($header) ? get_class($header) : gettype($header) + )); + } + + if (!preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/D', $header)) { + throw new \InvalidArgumentException( + sprintf('"%s" is not valid header name.', $header) + ); + } + } + + /** + * @see https://tools.ietf.org/html/rfc7230#section-3.2 + * + * field-value = *( field-content / obs-fold ) + * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] + * field-vchar = VCHAR / obs-text + * VCHAR = %x21-7E + * obs-text = %x80-FF + * obs-fold = CRLF 1*( SP / HTAB ) + */ + private function assertValue(string $value): void + { + // The regular expression intentionally does not support the obs-fold production, because as + // per RFC 7230#3.2.4: + // + // A sender MUST NOT generate a message that includes + // line folding (i.e., that has any field-value that contains a match to + // the obs-fold rule) unless the message is intended for packaging + // within the message/http media type. + // + // Clients must not send a request with line folding and a server sending folded headers is + // likely very rare. Line folding is a fairly obscure feature of HTTP/1.1 and thus not accepting + // folding is not likely to break any legitimate use case. + if (!preg_match('/^[\x20\x09\x21-\x7E\x80-\xFF]*$/D', $value)) { + throw new \InvalidArgumentException( + sprintf('"%s" is not valid header value.', $value) + ); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/MimeType.php b/vendor/guzzlehttp/psr7/src/MimeType.php new file mode 100644 index 000000000..b131bdbe7 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/MimeType.php @@ -0,0 +1,1259 @@ + 'application/vnd.1000minds.decision-model+xml', + '3dml' => 'text/vnd.in3d.3dml', + '3ds' => 'image/x-3ds', + '3g2' => 'video/3gpp2', + '3gp' => 'video/3gp', + '3gpp' => 'video/3gpp', + '3mf' => 'model/3mf', + '7z' => 'application/x-7z-compressed', + '7zip' => 'application/x-7z-compressed', + '123' => 'application/vnd.lotus-1-2-3', + 'aab' => 'application/x-authorware-bin', + 'aac' => 'audio/aac', + 'aam' => 'application/x-authorware-map', + 'aas' => 'application/x-authorware-seg', + 'abw' => 'application/x-abiword', + 'ac' => 'application/vnd.nokia.n-gage.ac+xml', + 'ac3' => 'audio/ac3', + 'acc' => 'application/vnd.americandynamics.acc', + 'ace' => 'application/x-ace-compressed', + 'acu' => 'application/vnd.acucobol', + 'acutc' => 'application/vnd.acucorp', + 'adp' => 'audio/adpcm', + 'adts' => 'audio/aac', + 'aep' => 'application/vnd.audiograph', + 'afm' => 'application/x-font-type1', + 'afp' => 'application/vnd.ibm.modcap', + 'age' => 'application/vnd.age', + 'ahead' => 'application/vnd.ahead.space', + 'ai' => 'application/pdf', + 'aif' => 'audio/x-aiff', + 'aifc' => 'audio/x-aiff', + 'aiff' => 'audio/x-aiff', + 'air' => 'application/vnd.adobe.air-application-installer-package+zip', + 'ait' => 'application/vnd.dvb.ait', + 'ami' => 'application/vnd.amiga.ami', + 'aml' => 'application/automationml-aml+xml', + 'amlx' => 'application/automationml-amlx+zip', + 'amr' => 'audio/amr', + 'apk' => 'application/vnd.android.package-archive', + 'apng' => 'image/apng', + 'appcache' => 'text/cache-manifest', + 'appinstaller' => 'application/appinstaller', + 'application' => 'application/x-ms-application', + 'appx' => 'application/appx', + 'appxbundle' => 'application/appxbundle', + 'apr' => 'application/vnd.lotus-approach', + 'arc' => 'application/x-freearc', + 'arj' => 'application/x-arj', + 'asc' => 'application/pgp-signature', + 'asf' => 'video/x-ms-asf', + 'asm' => 'text/x-asm', + 'aso' => 'application/vnd.accpac.simply.aso', + 'asx' => 'video/x-ms-asf', + 'atc' => 'application/vnd.acucorp', + 'atom' => 'application/atom+xml', + 'atomcat' => 'application/atomcat+xml', + 'atomdeleted' => 'application/atomdeleted+xml', + 'atomsvc' => 'application/atomsvc+xml', + 'atx' => 'application/vnd.antix.game-component', + 'au' => 'audio/x-au', + 'avci' => 'image/avci', + 'avcs' => 'image/avcs', + 'avi' => 'video/x-msvideo', + 'avif' => 'image/avif', + 'aw' => 'application/applixware', + 'azf' => 'application/vnd.airzip.filesecure.azf', + 'azs' => 'application/vnd.airzip.filesecure.azs', + 'azv' => 'image/vnd.airzip.accelerator.azv', + 'azw' => 'application/vnd.amazon.ebook', + 'b16' => 'image/vnd.pco.b16', + 'bat' => 'application/x-msdownload', + 'bcpio' => 'application/x-bcpio', + 'bdf' => 'application/x-font-bdf', + 'bdm' => 'application/vnd.syncml.dm+wbxml', + 'bdoc' => 'application/x-bdoc', + 'bed' => 'application/vnd.realvnc.bed', + 'bh2' => 'application/vnd.fujitsu.oasysprs', + 'bin' => 'application/octet-stream', + 'blb' => 'application/x-blorb', + 'blorb' => 'application/x-blorb', + 'bmi' => 'application/vnd.bmi', + 'bmml' => 'application/vnd.balsamiq.bmml+xml', + 'bmp' => 'image/bmp', + 'book' => 'application/vnd.framemaker', + 'box' => 'application/vnd.previewsystems.box', + 'boz' => 'application/x-bzip2', + 'bpk' => 'application/octet-stream', + 'bpmn' => 'application/octet-stream', + 'bsp' => 'model/vnd.valve.source.compiled-map', + 'btf' => 'image/prs.btif', + 'btif' => 'image/prs.btif', + 'buffer' => 'application/octet-stream', + 'bz' => 'application/x-bzip', + 'bz2' => 'application/x-bzip2', + 'c' => 'text/x-c', + 'c4d' => 'application/vnd.clonk.c4group', + 'c4f' => 'application/vnd.clonk.c4group', + 'c4g' => 'application/vnd.clonk.c4group', + 'c4p' => 'application/vnd.clonk.c4group', + 'c4u' => 'application/vnd.clonk.c4group', + 'c11amc' => 'application/vnd.cluetrust.cartomobile-config', + 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg', + 'cab' => 'application/vnd.ms-cab-compressed', + 'caf' => 'audio/x-caf', + 'cap' => 'application/vnd.tcpdump.pcap', + 'car' => 'application/vnd.curl.car', + 'cat' => 'application/vnd.ms-pki.seccat', + 'cb7' => 'application/x-cbr', + 'cba' => 'application/x-cbr', + 'cbr' => 'application/x-cbr', + 'cbt' => 'application/x-cbr', + 'cbz' => 'application/x-cbr', + 'cc' => 'text/x-c', + 'cco' => 'application/x-cocoa', + 'cct' => 'application/x-director', + 'ccxml' => 'application/ccxml+xml', + 'cdbcmsg' => 'application/vnd.contact.cmsg', + 'cdf' => 'application/x-netcdf', + 'cdfx' => 'application/cdfx+xml', + 'cdkey' => 'application/vnd.mediastation.cdkey', + 'cdmia' => 'application/cdmi-capability', + 'cdmic' => 'application/cdmi-container', + 'cdmid' => 'application/cdmi-domain', + 'cdmio' => 'application/cdmi-object', + 'cdmiq' => 'application/cdmi-queue', + 'cdr' => 'application/cdr', + 'cdx' => 'chemical/x-cdx', + 'cdxml' => 'application/vnd.chemdraw+xml', + 'cdy' => 'application/vnd.cinderella', + 'cer' => 'application/pkix-cert', + 'cfs' => 'application/x-cfs-compressed', + 'cgm' => 'image/cgm', + 'chat' => 'application/x-chat', + 'chm' => 'application/vnd.ms-htmlhelp', + 'chrt' => 'application/vnd.kde.kchart', + 'cif' => 'chemical/x-cif', + 'cii' => 'application/vnd.anser-web-certificate-issue-initiation', + 'cil' => 'application/vnd.ms-artgalry', + 'cjs' => 'application/node', + 'cla' => 'application/vnd.claymore', + 'class' => 'application/octet-stream', + 'cld' => 'model/vnd.cld', + 'clkk' => 'application/vnd.crick.clicker.keyboard', + 'clkp' => 'application/vnd.crick.clicker.palette', + 'clkt' => 'application/vnd.crick.clicker.template', + 'clkw' => 'application/vnd.crick.clicker.wordbank', + 'clkx' => 'application/vnd.crick.clicker', + 'clp' => 'application/x-msclip', + 'cmc' => 'application/vnd.cosmocaller', + 'cmdf' => 'chemical/x-cmdf', + 'cml' => 'chemical/x-cml', + 'cmp' => 'application/vnd.yellowriver-custom-menu', + 'cmx' => 'image/x-cmx', + 'cod' => 'application/vnd.rim.cod', + 'coffee' => 'text/coffeescript', + 'com' => 'application/x-msdownload', + 'conf' => 'text/plain', + 'cpio' => 'application/x-cpio', + 'cpl' => 'application/cpl+xml', + 'cpp' => 'text/x-c', + 'cpt' => 'application/mac-compactpro', + 'crd' => 'application/x-mscardfile', + 'crl' => 'application/pkix-crl', + 'crt' => 'application/x-x509-ca-cert', + 'crx' => 'application/x-chrome-extension', + 'cryptonote' => 'application/vnd.rig.cryptonote', + 'csh' => 'application/x-csh', + 'csl' => 'application/vnd.citationstyles.style+xml', + 'csml' => 'chemical/x-csml', + 'csp' => 'application/vnd.commonspace', + 'csr' => 'application/octet-stream', + 'css' => 'text/css', + 'cst' => 'application/x-director', + 'csv' => 'text/csv', + 'cu' => 'application/cu-seeme', + 'curl' => 'text/vnd.curl', + 'cwl' => 'application/cwl', + 'cww' => 'application/prs.cww', + 'cxt' => 'application/x-director', + 'cxx' => 'text/x-c', + 'dae' => 'model/vnd.collada+xml', + 'daf' => 'application/vnd.mobius.daf', + 'dart' => 'application/vnd.dart', + 'dataless' => 'application/vnd.fdsn.seed', + 'davmount' => 'application/davmount+xml', + 'dbf' => 'application/vnd.dbf', + 'dbk' => 'application/docbook+xml', + 'dcr' => 'application/x-director', + 'dcurl' => 'text/vnd.curl.dcurl', + 'dd2' => 'application/vnd.oma.dd2+xml', + 'ddd' => 'application/vnd.fujixerox.ddd', + 'ddf' => 'application/vnd.syncml.dmddf+xml', + 'dds' => 'image/vnd.ms-dds', + 'deb' => 'application/x-debian-package', + 'def' => 'text/plain', + 'deploy' => 'application/octet-stream', + 'der' => 'application/x-x509-ca-cert', + 'dfac' => 'application/vnd.dreamfactory', + 'dgc' => 'application/x-dgc-compressed', + 'dib' => 'image/bmp', + 'dic' => 'text/x-c', + 'dir' => 'application/x-director', + 'dis' => 'application/vnd.mobius.dis', + 'disposition-notification' => 'message/disposition-notification', + 'dist' => 'application/octet-stream', + 'distz' => 'application/octet-stream', + 'djv' => 'image/vnd.djvu', + 'djvu' => 'image/vnd.djvu', + 'dll' => 'application/octet-stream', + 'dmg' => 'application/x-apple-diskimage', + 'dmn' => 'application/octet-stream', + 'dmp' => 'application/vnd.tcpdump.pcap', + 'dms' => 'application/octet-stream', + 'dna' => 'application/vnd.dna', + 'doc' => 'application/msword', + 'docm' => 'application/vnd.ms-word.template.macroEnabled.12', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'dot' => 'application/msword', + 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', + 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', + 'dp' => 'application/vnd.osgi.dp', + 'dpg' => 'application/vnd.dpgraph', + 'dpx' => 'image/dpx', + 'dra' => 'audio/vnd.dra', + 'drle' => 'image/dicom-rle', + 'dsc' => 'text/prs.lines.tag', + 'dssc' => 'application/dssc+der', + 'dtb' => 'application/x-dtbook+xml', + 'dtd' => 'application/xml-dtd', + 'dts' => 'audio/vnd.dts', + 'dtshd' => 'audio/vnd.dts.hd', + 'dump' => 'application/octet-stream', + 'dvb' => 'video/vnd.dvb.file', + 'dvi' => 'application/x-dvi', + 'dwd' => 'application/atsc-dwd+xml', + 'dwf' => 'model/vnd.dwf', + 'dwg' => 'image/vnd.dwg', + 'dxf' => 'image/vnd.dxf', + 'dxp' => 'application/vnd.spotfire.dxp', + 'dxr' => 'application/x-director', + 'ear' => 'application/java-archive', + 'ecelp4800' => 'audio/vnd.nuera.ecelp4800', + 'ecelp7470' => 'audio/vnd.nuera.ecelp7470', + 'ecelp9600' => 'audio/vnd.nuera.ecelp9600', + 'ecma' => 'application/ecmascript', + 'edm' => 'application/vnd.novadigm.edm', + 'edx' => 'application/vnd.novadigm.edx', + 'efif' => 'application/vnd.picsel', + 'ei6' => 'application/vnd.pg.osasli', + 'elc' => 'application/octet-stream', + 'emf' => 'image/emf', + 'eml' => 'message/rfc822', + 'emma' => 'application/emma+xml', + 'emotionml' => 'application/emotionml+xml', + 'emz' => 'application/x-msmetafile', + 'eol' => 'audio/vnd.digital-winds', + 'eot' => 'application/vnd.ms-fontobject', + 'eps' => 'application/postscript', + 'epub' => 'application/epub+zip', + 'es3' => 'application/vnd.eszigno3+xml', + 'esa' => 'application/vnd.osgi.subsystem', + 'esf' => 'application/vnd.epson.esf', + 'et3' => 'application/vnd.eszigno3+xml', + 'etx' => 'text/x-setext', + 'eva' => 'application/x-eva', + 'evy' => 'application/x-envoy', + 'exe' => 'application/octet-stream', + 'exi' => 'application/exi', + 'exp' => 'application/express', + 'exr' => 'image/aces', + 'ext' => 'application/vnd.novadigm.ext', + 'ez' => 'application/andrew-inset', + 'ez2' => 'application/vnd.ezpix-album', + 'ez3' => 'application/vnd.ezpix-package', + 'f' => 'text/x-fortran', + 'f4v' => 'video/mp4', + 'f77' => 'text/x-fortran', + 'f90' => 'text/x-fortran', + 'fbs' => 'image/vnd.fastbidsheet', + 'fcdt' => 'application/vnd.adobe.formscentral.fcdt', + 'fcs' => 'application/vnd.isac.fcs', + 'fdf' => 'application/vnd.fdf', + 'fdt' => 'application/fdt+xml', + 'fe_launch' => 'application/vnd.denovo.fcselayout-link', + 'fg5' => 'application/vnd.fujitsu.oasysgp', + 'fgd' => 'application/x-director', + 'fh' => 'image/x-freehand', + 'fh4' => 'image/x-freehand', + 'fh5' => 'image/x-freehand', + 'fh7' => 'image/x-freehand', + 'fhc' => 'image/x-freehand', + 'fig' => 'application/x-xfig', + 'fits' => 'image/fits', + 'flac' => 'audio/x-flac', + 'fli' => 'video/x-fli', + 'flo' => 'application/vnd.micrografx.flo', + 'flv' => 'video/x-flv', + 'flw' => 'application/vnd.kde.kivio', + 'flx' => 'text/vnd.fmi.flexstor', + 'fly' => 'text/vnd.fly', + 'fm' => 'application/vnd.framemaker', + 'fnc' => 'application/vnd.frogans.fnc', + 'fo' => 'application/vnd.software602.filler.form+xml', + 'for' => 'text/x-fortran', + 'fpx' => 'image/vnd.fpx', + 'frame' => 'application/vnd.framemaker', + 'fsc' => 'application/vnd.fsc.weblaunch', + 'fst' => 'image/vnd.fst', + 'ftc' => 'application/vnd.fluxtime.clip', + 'fti' => 'application/vnd.anser-web-funds-transfer-initiation', + 'fvt' => 'video/vnd.fvt', + 'fxp' => 'application/vnd.adobe.fxp', + 'fxpl' => 'application/vnd.adobe.fxp', + 'fzs' => 'application/vnd.fuzzysheet', + 'g2w' => 'application/vnd.geoplan', + 'g3' => 'image/g3fax', + 'g3w' => 'application/vnd.geospace', + 'gac' => 'application/vnd.groove-account', + 'gam' => 'application/x-tads', + 'gbr' => 'application/rpki-ghostbusters', + 'gca' => 'application/x-gca-compressed', + 'gdl' => 'model/vnd.gdl', + 'gdoc' => 'application/vnd.google-apps.document', + 'ged' => 'text/vnd.familysearch.gedcom', + 'geo' => 'application/vnd.dynageo', + 'geojson' => 'application/geo+json', + 'gex' => 'application/vnd.geometry-explorer', + 'ggb' => 'application/vnd.geogebra.file', + 'ggt' => 'application/vnd.geogebra.tool', + 'ghf' => 'application/vnd.groove-help', + 'gif' => 'image/gif', + 'gim' => 'application/vnd.groove-identity-message', + 'glb' => 'model/gltf-binary', + 'gltf' => 'model/gltf+json', + 'gml' => 'application/gml+xml', + 'gmx' => 'application/vnd.gmx', + 'gnumeric' => 'application/x-gnumeric', + 'gpg' => 'application/gpg-keys', + 'gph' => 'application/vnd.flographit', + 'gpx' => 'application/gpx+xml', + 'gqf' => 'application/vnd.grafeq', + 'gqs' => 'application/vnd.grafeq', + 'gram' => 'application/srgs', + 'gramps' => 'application/x-gramps-xml', + 'gre' => 'application/vnd.geometry-explorer', + 'grv' => 'application/vnd.groove-injector', + 'grxml' => 'application/srgs+xml', + 'gsf' => 'application/x-font-ghostscript', + 'gsheet' => 'application/vnd.google-apps.spreadsheet', + 'gslides' => 'application/vnd.google-apps.presentation', + 'gtar' => 'application/x-gtar', + 'gtm' => 'application/vnd.groove-tool-message', + 'gtw' => 'model/vnd.gtw', + 'gv' => 'text/vnd.graphviz', + 'gxf' => 'application/gxf', + 'gxt' => 'application/vnd.geonext', + 'gz' => 'application/gzip', + 'gzip' => 'application/gzip', + 'h' => 'text/x-c', + 'h261' => 'video/h261', + 'h263' => 'video/h263', + 'h264' => 'video/h264', + 'hal' => 'application/vnd.hal+xml', + 'hbci' => 'application/vnd.hbci', + 'hbs' => 'text/x-handlebars-template', + 'hdd' => 'application/x-virtualbox-hdd', + 'hdf' => 'application/x-hdf', + 'heic' => 'image/heic', + 'heics' => 'image/heic-sequence', + 'heif' => 'image/heif', + 'heifs' => 'image/heif-sequence', + 'hej2' => 'image/hej2k', + 'held' => 'application/atsc-held+xml', + 'hh' => 'text/x-c', + 'hjson' => 'application/hjson', + 'hlp' => 'application/winhlp', + 'hpgl' => 'application/vnd.hp-hpgl', + 'hpid' => 'application/vnd.hp-hpid', + 'hps' => 'application/vnd.hp-hps', + 'hqx' => 'application/mac-binhex40', + 'hsj2' => 'image/hsj2', + 'htc' => 'text/x-component', + 'htke' => 'application/vnd.kenameaapp', + 'htm' => 'text/html', + 'html' => 'text/html', + 'hvd' => 'application/vnd.yamaha.hv-dic', + 'hvp' => 'application/vnd.yamaha.hv-voice', + 'hvs' => 'application/vnd.yamaha.hv-script', + 'i2g' => 'application/vnd.intergeo', + 'icc' => 'application/vnd.iccprofile', + 'ice' => 'x-conference/x-cooltalk', + 'icm' => 'application/vnd.iccprofile', + 'ico' => 'image/x-icon', + 'ics' => 'text/calendar', + 'ief' => 'image/ief', + 'ifb' => 'text/calendar', + 'ifm' => 'application/vnd.shana.informed.formdata', + 'iges' => 'model/iges', + 'igl' => 'application/vnd.igloader', + 'igm' => 'application/vnd.insors.igm', + 'igs' => 'model/iges', + 'igx' => 'application/vnd.micrografx.igx', + 'iif' => 'application/vnd.shana.informed.interchange', + 'img' => 'application/octet-stream', + 'imp' => 'application/vnd.accpac.simply.imp', + 'ims' => 'application/vnd.ms-ims', + 'in' => 'text/plain', + 'ini' => 'text/plain', + 'ink' => 'application/inkml+xml', + 'inkml' => 'application/inkml+xml', + 'install' => 'application/x-install-instructions', + 'iota' => 'application/vnd.astraea-software.iota', + 'ipfix' => 'application/ipfix', + 'ipk' => 'application/vnd.shana.informed.package', + 'irm' => 'application/vnd.ibm.rights-management', + 'irp' => 'application/vnd.irepository.package+xml', + 'iso' => 'application/x-iso9660-image', + 'itp' => 'application/vnd.shana.informed.formtemplate', + 'its' => 'application/its+xml', + 'ivp' => 'application/vnd.immervision-ivp', + 'ivu' => 'application/vnd.immervision-ivu', + 'jad' => 'text/vnd.sun.j2me.app-descriptor', + 'jade' => 'text/jade', + 'jam' => 'application/vnd.jam', + 'jar' => 'application/java-archive', + 'jardiff' => 'application/x-java-archive-diff', + 'java' => 'text/x-java-source', + 'jhc' => 'image/jphc', + 'jisp' => 'application/vnd.jisp', + 'jls' => 'image/jls', + 'jlt' => 'application/vnd.hp-jlyt', + 'jng' => 'image/x-jng', + 'jnlp' => 'application/x-java-jnlp-file', + 'joda' => 'application/vnd.joost.joda-archive', + 'jp2' => 'image/jp2', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpf' => 'image/jpx', + 'jpg' => 'image/jpeg', + 'jpg2' => 'image/jp2', + 'jpgm' => 'video/jpm', + 'jpgv' => 'video/jpeg', + 'jph' => 'image/jph', + 'jpm' => 'video/jpm', + 'jpx' => 'image/jpx', + 'js' => 'application/javascript', + 'json' => 'application/json', + 'json5' => 'application/json5', + 'jsonld' => 'application/ld+json', + 'jsonml' => 'application/jsonml+json', + 'jsx' => 'text/jsx', + 'jt' => 'model/jt', + 'jxr' => 'image/jxr', + 'jxra' => 'image/jxra', + 'jxrs' => 'image/jxrs', + 'jxs' => 'image/jxs', + 'jxsc' => 'image/jxsc', + 'jxsi' => 'image/jxsi', + 'jxss' => 'image/jxss', + 'kar' => 'audio/midi', + 'karbon' => 'application/vnd.kde.karbon', + 'kdb' => 'application/octet-stream', + 'kdbx' => 'application/x-keepass2', + 'key' => 'application/x-iwork-keynote-sffkey', + 'kfo' => 'application/vnd.kde.kformula', + 'kia' => 'application/vnd.kidspiration', + 'kml' => 'application/vnd.google-earth.kml+xml', + 'kmz' => 'application/vnd.google-earth.kmz', + 'kne' => 'application/vnd.kinar', + 'knp' => 'application/vnd.kinar', + 'kon' => 'application/vnd.kde.kontour', + 'kpr' => 'application/vnd.kde.kpresenter', + 'kpt' => 'application/vnd.kde.kpresenter', + 'kpxx' => 'application/vnd.ds-keypoint', + 'ksp' => 'application/vnd.kde.kspread', + 'ktr' => 'application/vnd.kahootz', + 'ktx' => 'image/ktx', + 'ktx2' => 'image/ktx2', + 'ktz' => 'application/vnd.kahootz', + 'kwd' => 'application/vnd.kde.kword', + 'kwt' => 'application/vnd.kde.kword', + 'lasxml' => 'application/vnd.las.las+xml', + 'latex' => 'application/x-latex', + 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop', + 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml', + 'les' => 'application/vnd.hhe.lesson-player', + 'less' => 'text/less', + 'lgr' => 'application/lgr+xml', + 'lha' => 'application/octet-stream', + 'link66' => 'application/vnd.route66.link66+xml', + 'list' => 'text/plain', + 'list3820' => 'application/vnd.ibm.modcap', + 'listafp' => 'application/vnd.ibm.modcap', + 'litcoffee' => 'text/coffeescript', + 'lnk' => 'application/x-ms-shortcut', + 'log' => 'text/plain', + 'lostxml' => 'application/lost+xml', + 'lrf' => 'application/octet-stream', + 'lrm' => 'application/vnd.ms-lrm', + 'ltf' => 'application/vnd.frogans.ltf', + 'lua' => 'text/x-lua', + 'luac' => 'application/x-lua-bytecode', + 'lvp' => 'audio/vnd.lucent.voice', + 'lwp' => 'application/vnd.lotus-wordpro', + 'lzh' => 'application/octet-stream', + 'm1v' => 'video/mpeg', + 'm2a' => 'audio/mpeg', + 'm2v' => 'video/mpeg', + 'm3a' => 'audio/mpeg', + 'm3u' => 'text/plain', + 'm3u8' => 'application/vnd.apple.mpegurl', + 'm4a' => 'audio/x-m4a', + 'm4p' => 'application/mp4', + 'm4s' => 'video/iso.segment', + 'm4u' => 'application/vnd.mpegurl', + 'm4v' => 'video/x-m4v', + 'm13' => 'application/x-msmediaview', + 'm14' => 'application/x-msmediaview', + 'm21' => 'application/mp21', + 'ma' => 'application/mathematica', + 'mads' => 'application/mads+xml', + 'maei' => 'application/mmt-aei+xml', + 'mag' => 'application/vnd.ecowin.chart', + 'maker' => 'application/vnd.framemaker', + 'man' => 'text/troff', + 'manifest' => 'text/cache-manifest', + 'map' => 'application/json', + 'mar' => 'application/octet-stream', + 'markdown' => 'text/markdown', + 'mathml' => 'application/mathml+xml', + 'mb' => 'application/mathematica', + 'mbk' => 'application/vnd.mobius.mbk', + 'mbox' => 'application/mbox', + 'mc1' => 'application/vnd.medcalcdata', + 'mcd' => 'application/vnd.mcd', + 'mcurl' => 'text/vnd.curl.mcurl', + 'md' => 'text/markdown', + 'mdb' => 'application/x-msaccess', + 'mdi' => 'image/vnd.ms-modi', + 'mdx' => 'text/mdx', + 'me' => 'text/troff', + 'mesh' => 'model/mesh', + 'meta4' => 'application/metalink4+xml', + 'metalink' => 'application/metalink+xml', + 'mets' => 'application/mets+xml', + 'mfm' => 'application/vnd.mfmp', + 'mft' => 'application/rpki-manifest', + 'mgp' => 'application/vnd.osgeo.mapguide.package', + 'mgz' => 'application/vnd.proteus.magazine', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mie' => 'application/x-mie', + 'mif' => 'application/vnd.mif', + 'mime' => 'message/rfc822', + 'mj2' => 'video/mj2', + 'mjp2' => 'video/mj2', + 'mjs' => 'text/javascript', + 'mk3d' => 'video/x-matroska', + 'mka' => 'audio/x-matroska', + 'mkd' => 'text/x-markdown', + 'mks' => 'video/x-matroska', + 'mkv' => 'video/x-matroska', + 'mlp' => 'application/vnd.dolby.mlp', + 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', + 'mmf' => 'application/vnd.smaf', + 'mml' => 'text/mathml', + 'mmr' => 'image/vnd.fujixerox.edmics-mmr', + 'mng' => 'video/x-mng', + 'mny' => 'application/x-msmoney', + 'mobi' => 'application/x-mobipocket-ebook', + 'mods' => 'application/mods+xml', + 'mov' => 'video/quicktime', + 'movie' => 'video/x-sgi-movie', + 'mp2' => 'audio/mpeg', + 'mp2a' => 'audio/mpeg', + 'mp3' => 'audio/mpeg', + 'mp4' => 'video/mp4', + 'mp4a' => 'audio/mp4', + 'mp4s' => 'application/mp4', + 'mp4v' => 'video/mp4', + 'mp21' => 'application/mp21', + 'mpc' => 'application/vnd.mophun.certificate', + 'mpd' => 'application/dash+xml', + 'mpe' => 'video/mpeg', + 'mpeg' => 'video/mpeg', + 'mpf' => 'application/media-policy-dataset+xml', + 'mpg' => 'video/mpeg', + 'mpg4' => 'video/mp4', + 'mpga' => 'audio/mpeg', + 'mpkg' => 'application/vnd.apple.installer+xml', + 'mpm' => 'application/vnd.blueice.multipass', + 'mpn' => 'application/vnd.mophun.application', + 'mpp' => 'application/vnd.ms-project', + 'mpt' => 'application/vnd.ms-project', + 'mpy' => 'application/vnd.ibm.minipay', + 'mqy' => 'application/vnd.mobius.mqy', + 'mrc' => 'application/marc', + 'mrcx' => 'application/marcxml+xml', + 'ms' => 'text/troff', + 'mscml' => 'application/mediaservercontrol+xml', + 'mseed' => 'application/vnd.fdsn.mseed', + 'mseq' => 'application/vnd.mseq', + 'msf' => 'application/vnd.epson.msf', + 'msg' => 'application/vnd.ms-outlook', + 'msh' => 'model/mesh', + 'msi' => 'application/x-msdownload', + 'msix' => 'application/msix', + 'msixbundle' => 'application/msixbundle', + 'msl' => 'application/vnd.mobius.msl', + 'msm' => 'application/octet-stream', + 'msp' => 'application/octet-stream', + 'msty' => 'application/vnd.muvee.style', + 'mtl' => 'model/mtl', + 'mts' => 'model/vnd.mts', + 'mus' => 'application/vnd.musician', + 'musd' => 'application/mmt-usd+xml', + 'musicxml' => 'application/vnd.recordare.musicxml+xml', + 'mvb' => 'application/x-msmediaview', + 'mvt' => 'application/vnd.mapbox-vector-tile', + 'mwf' => 'application/vnd.mfer', + 'mxf' => 'application/mxf', + 'mxl' => 'application/vnd.recordare.musicxml', + 'mxmf' => 'audio/mobile-xmf', + 'mxml' => 'application/xv+xml', + 'mxs' => 'application/vnd.triscape.mxs', + 'mxu' => 'video/vnd.mpegurl', + 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install', + 'n3' => 'text/n3', + 'nb' => 'application/mathematica', + 'nbp' => 'application/vnd.wolfram.player', + 'nc' => 'application/x-netcdf', + 'ncx' => 'application/x-dtbncx+xml', + 'nfo' => 'text/x-nfo', + 'ngdat' => 'application/vnd.nokia.n-gage.data', + 'nitf' => 'application/vnd.nitf', + 'nlu' => 'application/vnd.neurolanguage.nlu', + 'nml' => 'application/vnd.enliven', + 'nnd' => 'application/vnd.noblenet-directory', + 'nns' => 'application/vnd.noblenet-sealer', + 'nnw' => 'application/vnd.noblenet-web', + 'npx' => 'image/vnd.net-fpx', + 'nq' => 'application/n-quads', + 'nsc' => 'application/x-conference', + 'nsf' => 'application/vnd.lotus-notes', + 'nt' => 'application/n-triples', + 'ntf' => 'application/vnd.nitf', + 'numbers' => 'application/x-iwork-numbers-sffnumbers', + 'nzb' => 'application/x-nzb', + 'oa2' => 'application/vnd.fujitsu.oasys2', + 'oa3' => 'application/vnd.fujitsu.oasys3', + 'oas' => 'application/vnd.fujitsu.oasys', + 'obd' => 'application/x-msbinder', + 'obgx' => 'application/vnd.openblox.game+xml', + 'obj' => 'model/obj', + 'oda' => 'application/oda', + 'odb' => 'application/vnd.oasis.opendocument.database', + 'odc' => 'application/vnd.oasis.opendocument.chart', + 'odf' => 'application/vnd.oasis.opendocument.formula', + 'odft' => 'application/vnd.oasis.opendocument.formula-template', + 'odg' => 'application/vnd.oasis.opendocument.graphics', + 'odi' => 'application/vnd.oasis.opendocument.image', + 'odm' => 'application/vnd.oasis.opendocument.text-master', + 'odp' => 'application/vnd.oasis.opendocument.presentation', + 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', + 'odt' => 'application/vnd.oasis.opendocument.text', + 'oga' => 'audio/ogg', + 'ogex' => 'model/vnd.opengex', + 'ogg' => 'audio/ogg', + 'ogv' => 'video/ogg', + 'ogx' => 'application/ogg', + 'omdoc' => 'application/omdoc+xml', + 'onepkg' => 'application/onenote', + 'onetmp' => 'application/onenote', + 'onetoc' => 'application/onenote', + 'onetoc2' => 'application/onenote', + 'opf' => 'application/oebps-package+xml', + 'opml' => 'text/x-opml', + 'oprc' => 'application/vnd.palm', + 'opus' => 'audio/ogg', + 'org' => 'text/x-org', + 'osf' => 'application/vnd.yamaha.openscoreformat', + 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', + 'osm' => 'application/vnd.openstreetmap.data+xml', + 'otc' => 'application/vnd.oasis.opendocument.chart-template', + 'otf' => 'font/otf', + 'otg' => 'application/vnd.oasis.opendocument.graphics-template', + 'oth' => 'application/vnd.oasis.opendocument.text-web', + 'oti' => 'application/vnd.oasis.opendocument.image-template', + 'otp' => 'application/vnd.oasis.opendocument.presentation-template', + 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', + 'ott' => 'application/vnd.oasis.opendocument.text-template', + 'ova' => 'application/x-virtualbox-ova', + 'ovf' => 'application/x-virtualbox-ovf', + 'owl' => 'application/rdf+xml', + 'oxps' => 'application/oxps', + 'oxt' => 'application/vnd.openofficeorg.extension', + 'p' => 'text/x-pascal', + 'p7a' => 'application/x-pkcs7-signature', + 'p7b' => 'application/x-pkcs7-certificates', + 'p7c' => 'application/pkcs7-mime', + 'p7m' => 'application/pkcs7-mime', + 'p7r' => 'application/x-pkcs7-certreqresp', + 'p7s' => 'application/pkcs7-signature', + 'p8' => 'application/pkcs8', + 'p10' => 'application/x-pkcs10', + 'p12' => 'application/x-pkcs12', + 'pac' => 'application/x-ns-proxy-autoconfig', + 'pages' => 'application/x-iwork-pages-sffpages', + 'pas' => 'text/x-pascal', + 'paw' => 'application/vnd.pawaafile', + 'pbd' => 'application/vnd.powerbuilder6', + 'pbm' => 'image/x-portable-bitmap', + 'pcap' => 'application/vnd.tcpdump.pcap', + 'pcf' => 'application/x-font-pcf', + 'pcl' => 'application/vnd.hp-pcl', + 'pclxl' => 'application/vnd.hp-pclxl', + 'pct' => 'image/x-pict', + 'pcurl' => 'application/vnd.curl.pcurl', + 'pcx' => 'image/x-pcx', + 'pdb' => 'application/x-pilot', + 'pde' => 'text/x-processing', + 'pdf' => 'application/pdf', + 'pem' => 'application/x-x509-user-cert', + 'pfa' => 'application/x-font-type1', + 'pfb' => 'application/x-font-type1', + 'pfm' => 'application/x-font-type1', + 'pfr' => 'application/font-tdpfr', + 'pfx' => 'application/x-pkcs12', + 'pgm' => 'image/x-portable-graymap', + 'pgn' => 'application/x-chess-pgn', + 'pgp' => 'application/pgp', + 'phar' => 'application/octet-stream', + 'php' => 'application/x-httpd-php', + 'php3' => 'application/x-httpd-php', + 'php4' => 'application/x-httpd-php', + 'phps' => 'application/x-httpd-php-source', + 'phtml' => 'application/x-httpd-php', + 'pic' => 'image/x-pict', + 'pkg' => 'application/octet-stream', + 'pki' => 'application/pkixcmp', + 'pkipath' => 'application/pkix-pkipath', + 'pkpass' => 'application/vnd.apple.pkpass', + 'pl' => 'application/x-perl', + 'plb' => 'application/vnd.3gpp.pic-bw-large', + 'plc' => 'application/vnd.mobius.plc', + 'plf' => 'application/vnd.pocketlearn', + 'pls' => 'application/pls+xml', + 'pm' => 'application/x-perl', + 'pml' => 'application/vnd.ctc-posml', + 'png' => 'image/png', + 'pnm' => 'image/x-portable-anymap', + 'portpkg' => 'application/vnd.macports.portpkg', + 'pot' => 'application/vnd.ms-powerpoint', + 'potm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', + 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', + 'ppa' => 'application/vnd.ms-powerpoint', + 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', + 'ppd' => 'application/vnd.cups-ppd', + 'ppm' => 'image/x-portable-pixmap', + 'pps' => 'application/vnd.ms-powerpoint', + 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', + 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', + 'ppt' => 'application/powerpoint', + 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'pqa' => 'application/vnd.palm', + 'prc' => 'model/prc', + 'pre' => 'application/vnd.lotus-freelance', + 'prf' => 'application/pics-rules', + 'provx' => 'application/provenance+xml', + 'ps' => 'application/postscript', + 'psb' => 'application/vnd.3gpp.pic-bw-small', + 'psd' => 'application/x-photoshop', + 'psf' => 'application/x-font-linux-psf', + 'pskcxml' => 'application/pskc+xml', + 'pti' => 'image/prs.pti', + 'ptid' => 'application/vnd.pvi.ptid1', + 'pub' => 'application/x-mspublisher', + 'pvb' => 'application/vnd.3gpp.pic-bw-var', + 'pwn' => 'application/vnd.3m.post-it-notes', + 'pya' => 'audio/vnd.ms-playready.media.pya', + 'pyo' => 'model/vnd.pytha.pyox', + 'pyox' => 'model/vnd.pytha.pyox', + 'pyv' => 'video/vnd.ms-playready.media.pyv', + 'qam' => 'application/vnd.epson.quickanime', + 'qbo' => 'application/vnd.intu.qbo', + 'qfx' => 'application/vnd.intu.qfx', + 'qps' => 'application/vnd.publishare-delta-tree', + 'qt' => 'video/quicktime', + 'qwd' => 'application/vnd.quark.quarkxpress', + 'qwt' => 'application/vnd.quark.quarkxpress', + 'qxb' => 'application/vnd.quark.quarkxpress', + 'qxd' => 'application/vnd.quark.quarkxpress', + 'qxl' => 'application/vnd.quark.quarkxpress', + 'qxt' => 'application/vnd.quark.quarkxpress', + 'ra' => 'audio/x-realaudio', + 'ram' => 'audio/x-pn-realaudio', + 'raml' => 'application/raml+yaml', + 'rapd' => 'application/route-apd+xml', + 'rar' => 'application/x-rar', + 'ras' => 'image/x-cmu-raster', + 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', + 'rdf' => 'application/rdf+xml', + 'rdz' => 'application/vnd.data-vision.rdz', + 'relo' => 'application/p2p-overlay+xml', + 'rep' => 'application/vnd.businessobjects', + 'res' => 'application/x-dtbresource+xml', + 'rgb' => 'image/x-rgb', + 'rif' => 'application/reginfo+xml', + 'rip' => 'audio/vnd.rip', + 'ris' => 'application/x-research-info-systems', + 'rl' => 'application/resource-lists+xml', + 'rlc' => 'image/vnd.fujixerox.edmics-rlc', + 'rld' => 'application/resource-lists-diff+xml', + 'rm' => 'audio/x-pn-realaudio', + 'rmi' => 'audio/midi', + 'rmp' => 'audio/x-pn-realaudio-plugin', + 'rms' => 'application/vnd.jcp.javame.midlet-rms', + 'rmvb' => 'application/vnd.rn-realmedia-vbr', + 'rnc' => 'application/relax-ng-compact-syntax', + 'rng' => 'application/xml', + 'roa' => 'application/rpki-roa', + 'roff' => 'text/troff', + 'rp9' => 'application/vnd.cloanto.rp9', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'rpss' => 'application/vnd.nokia.radio-presets', + 'rpst' => 'application/vnd.nokia.radio-preset', + 'rq' => 'application/sparql-query', + 'rs' => 'application/rls-services+xml', + 'rsa' => 'application/x-pkcs7', + 'rsat' => 'application/atsc-rsat+xml', + 'rsd' => 'application/rsd+xml', + 'rsheet' => 'application/urc-ressheet+xml', + 'rss' => 'application/rss+xml', + 'rtf' => 'text/rtf', + 'rtx' => 'text/richtext', + 'run' => 'application/x-makeself', + 'rusd' => 'application/route-usd+xml', + 'rv' => 'video/vnd.rn-realvideo', + 's' => 'text/x-asm', + 's3m' => 'audio/s3m', + 'saf' => 'application/vnd.yamaha.smaf-audio', + 'sass' => 'text/x-sass', + 'sbml' => 'application/sbml+xml', + 'sc' => 'application/vnd.ibm.secure-container', + 'scd' => 'application/x-msschedule', + 'scm' => 'application/vnd.lotus-screencam', + 'scq' => 'application/scvp-cv-request', + 'scs' => 'application/scvp-cv-response', + 'scss' => 'text/x-scss', + 'scurl' => 'text/vnd.curl.scurl', + 'sda' => 'application/vnd.stardivision.draw', + 'sdc' => 'application/vnd.stardivision.calc', + 'sdd' => 'application/vnd.stardivision.impress', + 'sdkd' => 'application/vnd.solent.sdkm+xml', + 'sdkm' => 'application/vnd.solent.sdkm+xml', + 'sdp' => 'application/sdp', + 'sdw' => 'application/vnd.stardivision.writer', + 'sea' => 'application/octet-stream', + 'see' => 'application/vnd.seemail', + 'seed' => 'application/vnd.fdsn.seed', + 'sema' => 'application/vnd.sema', + 'semd' => 'application/vnd.semd', + 'semf' => 'application/vnd.semf', + 'senmlx' => 'application/senml+xml', + 'sensmlx' => 'application/sensml+xml', + 'ser' => 'application/java-serialized-object', + 'setpay' => 'application/set-payment-initiation', + 'setreg' => 'application/set-registration-initiation', + 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data', + 'sfs' => 'application/vnd.spotfire.sfs', + 'sfv' => 'text/x-sfv', + 'sgi' => 'image/sgi', + 'sgl' => 'application/vnd.stardivision.writer-global', + 'sgm' => 'text/sgml', + 'sgml' => 'text/sgml', + 'sh' => 'application/x-sh', + 'shar' => 'application/x-shar', + 'shex' => 'text/shex', + 'shf' => 'application/shf+xml', + 'shtml' => 'text/html', + 'sid' => 'image/x-mrsid-image', + 'sieve' => 'application/sieve', + 'sig' => 'application/pgp-signature', + 'sil' => 'audio/silk', + 'silo' => 'model/mesh', + 'sis' => 'application/vnd.symbian.install', + 'sisx' => 'application/vnd.symbian.install', + 'sit' => 'application/x-stuffit', + 'sitx' => 'application/x-stuffitx', + 'siv' => 'application/sieve', + 'skd' => 'application/vnd.koan', + 'skm' => 'application/vnd.koan', + 'skp' => 'application/vnd.koan', + 'skt' => 'application/vnd.koan', + 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12', + 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', + 'slim' => 'text/slim', + 'slm' => 'text/slim', + 'sls' => 'application/route-s-tsid+xml', + 'slt' => 'application/vnd.epson.salt', + 'sm' => 'application/vnd.stepmania.stepchart', + 'smf' => 'application/vnd.stardivision.math', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'smv' => 'video/x-smv', + 'smzip' => 'application/vnd.stepmania.package', + 'snd' => 'audio/basic', + 'snf' => 'application/x-font-snf', + 'so' => 'application/octet-stream', + 'spc' => 'application/x-pkcs7-certificates', + 'spdx' => 'text/spdx', + 'spf' => 'application/vnd.yamaha.smaf-phrase', + 'spl' => 'application/x-futuresplash', + 'spot' => 'text/vnd.in3d.spot', + 'spp' => 'application/scvp-vp-response', + 'spq' => 'application/scvp-vp-request', + 'spx' => 'audio/ogg', + 'sql' => 'application/x-sql', + 'src' => 'application/x-wais-source', + 'srt' => 'application/x-subrip', + 'sru' => 'application/sru+xml', + 'srx' => 'application/sparql-results+xml', + 'ssdl' => 'application/ssdl+xml', + 'sse' => 'application/vnd.kodak-descriptor', + 'ssf' => 'application/vnd.epson.ssf', + 'ssml' => 'application/ssml+xml', + 'sst' => 'application/octet-stream', + 'st' => 'application/vnd.sailingtracker.track', + 'stc' => 'application/vnd.sun.xml.calc.template', + 'std' => 'application/vnd.sun.xml.draw.template', + 'step' => 'application/STEP', + 'stf' => 'application/vnd.wt.stf', + 'sti' => 'application/vnd.sun.xml.impress.template', + 'stk' => 'application/hyperstudio', + 'stl' => 'model/stl', + 'stp' => 'application/STEP', + 'stpx' => 'model/step+xml', + 'stpxz' => 'model/step-xml+zip', + 'stpz' => 'model/step+zip', + 'str' => 'application/vnd.pg.format', + 'stw' => 'application/vnd.sun.xml.writer.template', + 'styl' => 'text/stylus', + 'stylus' => 'text/stylus', + 'sub' => 'text/vnd.dvb.subtitle', + 'sus' => 'application/vnd.sus-calendar', + 'susp' => 'application/vnd.sus-calendar', + 'sv4cpio' => 'application/x-sv4cpio', + 'sv4crc' => 'application/x-sv4crc', + 'svc' => 'application/vnd.dvb.service', + 'svd' => 'application/vnd.svd', + 'svg' => 'image/svg+xml', + 'svgz' => 'image/svg+xml', + 'swa' => 'application/x-director', + 'swf' => 'application/x-shockwave-flash', + 'swi' => 'application/vnd.aristanetworks.swi', + 'swidtag' => 'application/swid+xml', + 'sxc' => 'application/vnd.sun.xml.calc', + 'sxd' => 'application/vnd.sun.xml.draw', + 'sxg' => 'application/vnd.sun.xml.writer.global', + 'sxi' => 'application/vnd.sun.xml.impress', + 'sxm' => 'application/vnd.sun.xml.math', + 'sxw' => 'application/vnd.sun.xml.writer', + 't' => 'text/troff', + 't3' => 'application/x-t3vm-image', + 't38' => 'image/t38', + 'taglet' => 'application/vnd.mynfc', + 'tao' => 'application/vnd.tao.intent-module-archive', + 'tap' => 'image/vnd.tencent.tap', + 'tar' => 'application/x-tar', + 'tcap' => 'application/vnd.3gpp2.tcap', + 'tcl' => 'application/x-tcl', + 'td' => 'application/urc-targetdesc+xml', + 'teacher' => 'application/vnd.smart.teacher', + 'tei' => 'application/tei+xml', + 'teicorpus' => 'application/tei+xml', + 'tex' => 'application/x-tex', + 'texi' => 'application/x-texinfo', + 'texinfo' => 'application/x-texinfo', + 'text' => 'text/plain', + 'tfi' => 'application/thraud+xml', + 'tfm' => 'application/x-tex-tfm', + 'tfx' => 'image/tiff-fx', + 'tga' => 'image/x-tga', + 'tgz' => 'application/x-tar', + 'thmx' => 'application/vnd.ms-officetheme', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'tk' => 'application/x-tcl', + 'tmo' => 'application/vnd.tmobile-livetv', + 'toml' => 'application/toml', + 'torrent' => 'application/x-bittorrent', + 'tpl' => 'application/vnd.groove-tool-template', + 'tpt' => 'application/vnd.trid.tpt', + 'tr' => 'text/troff', + 'tra' => 'application/vnd.trueapp', + 'trig' => 'application/trig', + 'trm' => 'application/x-msterminal', + 'ts' => 'video/mp2t', + 'tsd' => 'application/timestamped-data', + 'tsv' => 'text/tab-separated-values', + 'ttc' => 'font/collection', + 'ttf' => 'font/ttf', + 'ttl' => 'text/turtle', + 'ttml' => 'application/ttml+xml', + 'twd' => 'application/vnd.simtech-mindmapper', + 'twds' => 'application/vnd.simtech-mindmapper', + 'txd' => 'application/vnd.genomatix.tuxedo', + 'txf' => 'application/vnd.mobius.txf', + 'txt' => 'text/plain', + 'u3d' => 'model/u3d', + 'u8dsn' => 'message/global-delivery-status', + 'u8hdr' => 'message/global-headers', + 'u8mdn' => 'message/global-disposition-notification', + 'u8msg' => 'message/global', + 'u32' => 'application/x-authorware-bin', + 'ubj' => 'application/ubjson', + 'udeb' => 'application/x-debian-package', + 'ufd' => 'application/vnd.ufdl', + 'ufdl' => 'application/vnd.ufdl', + 'ulx' => 'application/x-glulx', + 'umj' => 'application/vnd.umajin', + 'unityweb' => 'application/vnd.unity', + 'uo' => 'application/vnd.uoml+xml', + 'uoml' => 'application/vnd.uoml+xml', + 'uri' => 'text/uri-list', + 'uris' => 'text/uri-list', + 'urls' => 'text/uri-list', + 'usda' => 'model/vnd.usda', + 'usdz' => 'model/vnd.usdz+zip', + 'ustar' => 'application/x-ustar', + 'utz' => 'application/vnd.uiq.theme', + 'uu' => 'text/x-uuencode', + 'uva' => 'audio/vnd.dece.audio', + 'uvd' => 'application/vnd.dece.data', + 'uvf' => 'application/vnd.dece.data', + 'uvg' => 'image/vnd.dece.graphic', + 'uvh' => 'video/vnd.dece.hd', + 'uvi' => 'image/vnd.dece.graphic', + 'uvm' => 'video/vnd.dece.mobile', + 'uvp' => 'video/vnd.dece.pd', + 'uvs' => 'video/vnd.dece.sd', + 'uvt' => 'application/vnd.dece.ttml+xml', + 'uvu' => 'video/vnd.uvvu.mp4', + 'uvv' => 'video/vnd.dece.video', + 'uvva' => 'audio/vnd.dece.audio', + 'uvvd' => 'application/vnd.dece.data', + 'uvvf' => 'application/vnd.dece.data', + 'uvvg' => 'image/vnd.dece.graphic', + 'uvvh' => 'video/vnd.dece.hd', + 'uvvi' => 'image/vnd.dece.graphic', + 'uvvm' => 'video/vnd.dece.mobile', + 'uvvp' => 'video/vnd.dece.pd', + 'uvvs' => 'video/vnd.dece.sd', + 'uvvt' => 'application/vnd.dece.ttml+xml', + 'uvvu' => 'video/vnd.uvvu.mp4', + 'uvvv' => 'video/vnd.dece.video', + 'uvvx' => 'application/vnd.dece.unspecified', + 'uvvz' => 'application/vnd.dece.zip', + 'uvx' => 'application/vnd.dece.unspecified', + 'uvz' => 'application/vnd.dece.zip', + 'vbox' => 'application/x-virtualbox-vbox', + 'vbox-extpack' => 'application/x-virtualbox-vbox-extpack', + 'vcard' => 'text/vcard', + 'vcd' => 'application/x-cdlink', + 'vcf' => 'text/x-vcard', + 'vcg' => 'application/vnd.groove-vcard', + 'vcs' => 'text/x-vcalendar', + 'vcx' => 'application/vnd.vcx', + 'vdi' => 'application/x-virtualbox-vdi', + 'vds' => 'model/vnd.sap.vds', + 'vhd' => 'application/x-virtualbox-vhd', + 'vis' => 'application/vnd.visionary', + 'viv' => 'video/vnd.vivo', + 'vlc' => 'application/videolan', + 'vmdk' => 'application/x-virtualbox-vmdk', + 'vob' => 'video/x-ms-vob', + 'vor' => 'application/vnd.stardivision.writer', + 'vox' => 'application/x-authorware-bin', + 'vrml' => 'model/vrml', + 'vsd' => 'application/vnd.visio', + 'vsf' => 'application/vnd.vsf', + 'vss' => 'application/vnd.visio', + 'vst' => 'application/vnd.visio', + 'vsw' => 'application/vnd.visio', + 'vtf' => 'image/vnd.valve.source.texture', + 'vtt' => 'text/vtt', + 'vtu' => 'model/vnd.vtu', + 'vxml' => 'application/voicexml+xml', + 'w3d' => 'application/x-director', + 'wad' => 'application/x-doom', + 'wadl' => 'application/vnd.sun.wadl+xml', + 'war' => 'application/java-archive', + 'wasm' => 'application/wasm', + 'wav' => 'audio/x-wav', + 'wax' => 'audio/x-ms-wax', + 'wbmp' => 'image/vnd.wap.wbmp', + 'wbs' => 'application/vnd.criticaltools.wbs+xml', + 'wbxml' => 'application/wbxml', + 'wcm' => 'application/vnd.ms-works', + 'wdb' => 'application/vnd.ms-works', + 'wdp' => 'image/vnd.ms-photo', + 'weba' => 'audio/webm', + 'webapp' => 'application/x-web-app-manifest+json', + 'webm' => 'video/webm', + 'webmanifest' => 'application/manifest+json', + 'webp' => 'image/webp', + 'wg' => 'application/vnd.pmi.widget', + 'wgsl' => 'text/wgsl', + 'wgt' => 'application/widget', + 'wif' => 'application/watcherinfo+xml', + 'wks' => 'application/vnd.ms-works', + 'wm' => 'video/x-ms-wm', + 'wma' => 'audio/x-ms-wma', + 'wmd' => 'application/x-ms-wmd', + 'wmf' => 'image/wmf', + 'wml' => 'text/vnd.wap.wml', + 'wmlc' => 'application/wmlc', + 'wmls' => 'text/vnd.wap.wmlscript', + 'wmlsc' => 'application/vnd.wap.wmlscriptc', + 'wmv' => 'video/x-ms-wmv', + 'wmx' => 'video/x-ms-wmx', + 'wmz' => 'application/x-msmetafile', + 'woff' => 'font/woff', + 'woff2' => 'font/woff2', + 'word' => 'application/msword', + 'wpd' => 'application/vnd.wordperfect', + 'wpl' => 'application/vnd.ms-wpl', + 'wps' => 'application/vnd.ms-works', + 'wqd' => 'application/vnd.wqd', + 'wri' => 'application/x-mswrite', + 'wrl' => 'model/vrml', + 'wsc' => 'message/vnd.wfa.wsc', + 'wsdl' => 'application/wsdl+xml', + 'wspolicy' => 'application/wspolicy+xml', + 'wtb' => 'application/vnd.webturbo', + 'wvx' => 'video/x-ms-wvx', + 'x3d' => 'model/x3d+xml', + 'x3db' => 'model/x3d+fastinfoset', + 'x3dbz' => 'model/x3d+binary', + 'x3dv' => 'model/x3d-vrml', + 'x3dvz' => 'model/x3d+vrml', + 'x3dz' => 'model/x3d+xml', + 'x32' => 'application/x-authorware-bin', + 'x_b' => 'model/vnd.parasolid.transmit.binary', + 'x_t' => 'model/vnd.parasolid.transmit.text', + 'xaml' => 'application/xaml+xml', + 'xap' => 'application/x-silverlight-app', + 'xar' => 'application/vnd.xara', + 'xav' => 'application/xcap-att+xml', + 'xbap' => 'application/x-ms-xbap', + 'xbd' => 'application/vnd.fujixerox.docuworks.binder', + 'xbm' => 'image/x-xbitmap', + 'xca' => 'application/xcap-caps+xml', + 'xcs' => 'application/calendar+xml', + 'xdf' => 'application/xcap-diff+xml', + 'xdm' => 'application/vnd.syncml.dm+xml', + 'xdp' => 'application/vnd.adobe.xdp+xml', + 'xdssc' => 'application/dssc+xml', + 'xdw' => 'application/vnd.fujixerox.docuworks', + 'xel' => 'application/xcap-el+xml', + 'xenc' => 'application/xenc+xml', + 'xer' => 'application/patch-ops-error+xml', + 'xfdf' => 'application/xfdf', + 'xfdl' => 'application/vnd.xfdl', + 'xht' => 'application/xhtml+xml', + 'xhtm' => 'application/vnd.pwg-xhtml-print+xml', + 'xhtml' => 'application/xhtml+xml', + 'xhvml' => 'application/xv+xml', + 'xif' => 'image/vnd.xiff', + 'xl' => 'application/excel', + 'xla' => 'application/vnd.ms-excel', + 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', + 'xlc' => 'application/vnd.ms-excel', + 'xlf' => 'application/xliff+xml', + 'xlm' => 'application/vnd.ms-excel', + 'xls' => 'application/vnd.ms-excel', + 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', + 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xlt' => 'application/vnd.ms-excel', + 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', + 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', + 'xlw' => 'application/vnd.ms-excel', + 'xm' => 'audio/xm', + 'xml' => 'application/xml', + 'xns' => 'application/xcap-ns+xml', + 'xo' => 'application/vnd.olpc-sugar', + 'xop' => 'application/xop+xml', + 'xpi' => 'application/x-xpinstall', + 'xpl' => 'application/xproc+xml', + 'xpm' => 'image/x-xpixmap', + 'xpr' => 'application/vnd.is-xpr', + 'xps' => 'application/vnd.ms-xpsdocument', + 'xpw' => 'application/vnd.intercon.formnet', + 'xpx' => 'application/vnd.intercon.formnet', + 'xsd' => 'application/xml', + 'xsf' => 'application/prs.xsf+xml', + 'xsl' => 'application/xml', + 'xslt' => 'application/xslt+xml', + 'xsm' => 'application/vnd.syncml+xml', + 'xspf' => 'application/xspf+xml', + 'xul' => 'application/vnd.mozilla.xul+xml', + 'xvm' => 'application/xv+xml', + 'xvml' => 'application/xv+xml', + 'xwd' => 'image/x-xwindowdump', + 'xyz' => 'chemical/x-xyz', + 'xz' => 'application/x-xz', + 'yaml' => 'text/yaml', + 'yang' => 'application/yang', + 'yin' => 'application/yin+xml', + 'yml' => 'text/yaml', + 'ymp' => 'text/x-suse-ymp', + 'z' => 'application/x-compress', + 'z1' => 'application/x-zmachine', + 'z2' => 'application/x-zmachine', + 'z3' => 'application/x-zmachine', + 'z4' => 'application/x-zmachine', + 'z5' => 'application/x-zmachine', + 'z6' => 'application/x-zmachine', + 'z7' => 'application/x-zmachine', + 'z8' => 'application/x-zmachine', + 'zaz' => 'application/vnd.zzazz.deck+xml', + 'zip' => 'application/zip', + 'zir' => 'application/vnd.zul', + 'zirz' => 'application/vnd.zul', + 'zmm' => 'application/vnd.handheld-entertainment+xml', + 'zsh' => 'text/x-scriptzsh', + ]; + + /** + * Determines the mimetype of a file by looking at its extension. + * + * @see https://raw.githubusercontent.com/jshttp/mime-db/master/db.json + */ + public static function fromFilename(string $filename): ?string + { + return self::fromExtension(pathinfo($filename, PATHINFO_EXTENSION)); + } + + /** + * Maps a file extensions to a mimetype. + * + * @see https://raw.githubusercontent.com/jshttp/mime-db/master/db.json + */ + public static function fromExtension(string $extension): ?string + { + return self::MIME_TYPES[strtolower($extension)] ?? null; + } +} diff --git a/vendor/guzzlehttp/psr7/src/MultipartStream.php b/vendor/guzzlehttp/psr7/src/MultipartStream.php new file mode 100644 index 000000000..41c48eef8 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/MultipartStream.php @@ -0,0 +1,157 @@ +boundary = $boundary ?: bin2hex(random_bytes(20)); + $this->stream = $this->createStream($elements); + } + + public function getBoundary(): string + { + return $this->boundary; + } + + public function isWritable(): bool + { + return false; + } + + /** + * Get the headers needed before transferring the content of a POST file + * + * @param array $headers + */ + private function getHeaders(array $headers): string + { + $str = ''; + foreach ($headers as $key => $value) { + $str .= "{$key}: {$value}\r\n"; + } + + return "--{$this->boundary}\r\n".trim($str)."\r\n\r\n"; + } + + /** + * Create the aggregate stream that will be used to upload the POST data + */ + protected function createStream(array $elements = []): StreamInterface + { + $stream = new AppendStream(); + + foreach ($elements as $element) { + if (!is_array($element)) { + throw new \UnexpectedValueException('An array is expected'); + } + $this->addElement($stream, $element); + } + + // Add the trailing boundary with CRLF + $stream->addStream(Utils::streamFor("--{$this->boundary}--\r\n")); + + return $stream; + } + + private function addElement(AppendStream $stream, array $element): void + { + foreach (['contents', 'name'] as $key) { + if (!array_key_exists($key, $element)) { + throw new \InvalidArgumentException("A '{$key}' key is required"); + } + } + + $element['contents'] = Utils::streamFor($element['contents']); + + if (empty($element['filename'])) { + $uri = $element['contents']->getMetadata('uri'); + if ($uri && \is_string($uri) && \substr($uri, 0, 6) !== 'php://' && \substr($uri, 0, 7) !== 'data://') { + $element['filename'] = $uri; + } + } + + [$body, $headers] = $this->createElement( + $element['name'], + $element['contents'], + $element['filename'] ?? null, + $element['headers'] ?? [] + ); + + $stream->addStream(Utils::streamFor($this->getHeaders($headers))); + $stream->addStream($body); + $stream->addStream(Utils::streamFor("\r\n")); + } + + private function createElement(string $name, StreamInterface $stream, ?string $filename, array $headers): array + { + // Set a default content-disposition header if one was no provided + $disposition = $this->getHeader($headers, 'content-disposition'); + if (!$disposition) { + $headers['Content-Disposition'] = ($filename === '0' || $filename) + ? sprintf( + 'form-data; name="%s"; filename="%s"', + $name, + basename($filename) + ) + : "form-data; name=\"{$name}\""; + } + + // Set a default content-length header if one was no provided + $length = $this->getHeader($headers, 'content-length'); + if (!$length) { + if ($length = $stream->getSize()) { + $headers['Content-Length'] = (string) $length; + } + } + + // Set a default Content-Type if one was not supplied + $type = $this->getHeader($headers, 'content-type'); + if (!$type && ($filename === '0' || $filename)) { + $headers['Content-Type'] = MimeType::fromFilename($filename) ?? 'application/octet-stream'; + } + + return [$stream, $headers]; + } + + private function getHeader(array $headers, string $key) + { + $lowercaseHeader = strtolower($key); + foreach ($headers as $k => $v) { + if (strtolower($k) === $lowercaseHeader) { + return $v; + } + } + + return null; + } +} diff --git a/vendor/guzzlehttp/psr7/src/NoSeekStream.php b/vendor/guzzlehttp/psr7/src/NoSeekStream.php new file mode 100644 index 000000000..161a224f0 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/NoSeekStream.php @@ -0,0 +1,28 @@ +source = $source; + $this->size = $options['size'] ?? null; + $this->metadata = $options['metadata'] ?? []; + $this->buffer = new BufferStream(); + } + + public function __toString(): string + { + try { + return Utils::copyToString($this); + } catch (\Throwable $e) { + if (\PHP_VERSION_ID >= 70400) { + throw $e; + } + trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + + return ''; + } + } + + public function close(): void + { + $this->detach(); + } + + public function detach() + { + $this->tellPos = 0; + $this->source = null; + + return null; + } + + public function getSize(): ?int + { + return $this->size; + } + + public function tell(): int + { + return $this->tellPos; + } + + public function eof(): bool + { + return $this->source === null; + } + + public function isSeekable(): bool + { + return false; + } + + public function rewind(): void + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET): void + { + throw new \RuntimeException('Cannot seek a PumpStream'); + } + + public function isWritable(): bool + { + return false; + } + + public function write($string): int + { + throw new \RuntimeException('Cannot write to a PumpStream'); + } + + public function isReadable(): bool + { + return true; + } + + public function read($length): string + { + $data = $this->buffer->read($length); + $readLen = strlen($data); + $this->tellPos += $readLen; + $remaining = $length - $readLen; + + if ($remaining) { + $this->pump($remaining); + $data .= $this->buffer->read($remaining); + $this->tellPos += strlen($data) - $readLen; + } + + return $data; + } + + public function getContents(): string + { + $result = ''; + while (!$this->eof()) { + $result .= $this->read(1000000); + } + + return $result; + } + + /** + * @return mixed + */ + public function getMetadata($key = null) + { + if (!$key) { + return $this->metadata; + } + + return $this->metadata[$key] ?? null; + } + + private function pump(int $length): void + { + if ($this->source) { + do { + $data = call_user_func($this->source, $length); + if ($data === false || $data === null) { + $this->source = null; + + return; + } + $this->buffer->write($data); + $length -= strlen($data); + } while ($length > 0); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/Query.php b/vendor/guzzlehttp/psr7/src/Query.php new file mode 100644 index 000000000..8b9492797 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Query.php @@ -0,0 +1,113 @@ + '1', 'foo[b]' => '2'])`. + * + * @param string $str Query string to parse + * @param int|bool $urlEncoding How the query string is encoded + */ + public static function parse(string $str, $urlEncoding = true): array + { + $result = []; + + if ($str === '') { + return $result; + } + + if ($urlEncoding === true) { + $decoder = function ($value) { + return rawurldecode(str_replace('+', ' ', (string) $value)); + }; + } elseif ($urlEncoding === PHP_QUERY_RFC3986) { + $decoder = 'rawurldecode'; + } elseif ($urlEncoding === PHP_QUERY_RFC1738) { + $decoder = 'urldecode'; + } else { + $decoder = function ($str) { + return $str; + }; + } + + foreach (explode('&', $str) as $kvp) { + $parts = explode('=', $kvp, 2); + $key = $decoder($parts[0]); + $value = isset($parts[1]) ? $decoder($parts[1]) : null; + if (!array_key_exists($key, $result)) { + $result[$key] = $value; + } else { + if (!is_array($result[$key])) { + $result[$key] = [$result[$key]]; + } + $result[$key][] = $value; + } + } + + return $result; + } + + /** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + */ + public static function build(array $params, $encoding = PHP_QUERY_RFC3986): string + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder((string) $k); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? (int) $v : $v; + if ($v !== null) { + $qs .= '='.$encoder((string) $v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? (int) $vv : $vv; + if ($vv !== null) { + $qs .= '='.$encoder((string) $vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Request.php b/vendor/guzzlehttp/psr7/src/Request.php new file mode 100644 index 000000000..db29d95d3 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Request.php @@ -0,0 +1,159 @@ + $headers Request headers + * @param string|resource|StreamInterface|null $body Request body + * @param string $version Protocol version + */ + public function __construct( + string $method, + $uri, + array $headers = [], + $body = null, + string $version = '1.1' + ) { + $this->assertMethod($method); + if (!($uri instanceof UriInterface)) { + $uri = new Uri($uri); + } + + $this->method = strtoupper($method); + $this->uri = $uri; + $this->setHeaders($headers); + $this->protocol = $version; + + if (!isset($this->headerNames['host'])) { + $this->updateHostFromUri(); + } + + if ($body !== '' && $body !== null) { + $this->stream = Utils::streamFor($body); + } + } + + public function getRequestTarget(): string + { + if ($this->requestTarget !== null) { + return $this->requestTarget; + } + + $target = $this->uri->getPath(); + if ($target === '') { + $target = '/'; + } + if ($this->uri->getQuery() != '') { + $target .= '?'.$this->uri->getQuery(); + } + + return $target; + } + + public function withRequestTarget($requestTarget): RequestInterface + { + if (preg_match('#\s#', $requestTarget)) { + throw new InvalidArgumentException( + 'Invalid request target provided; cannot contain whitespace' + ); + } + + $new = clone $this; + $new->requestTarget = $requestTarget; + + return $new; + } + + public function getMethod(): string + { + return $this->method; + } + + public function withMethod($method): RequestInterface + { + $this->assertMethod($method); + $new = clone $this; + $new->method = strtoupper($method); + + return $new; + } + + public function getUri(): UriInterface + { + return $this->uri; + } + + public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface + { + if ($uri === $this->uri) { + return $this; + } + + $new = clone $this; + $new->uri = $uri; + + if (!$preserveHost || !isset($this->headerNames['host'])) { + $new->updateHostFromUri(); + } + + return $new; + } + + private function updateHostFromUri(): void + { + $host = $this->uri->getHost(); + + if ($host == '') { + return; + } + + if (($port = $this->uri->getPort()) !== null) { + $host .= ':'.$port; + } + + if (isset($this->headerNames['host'])) { + $header = $this->headerNames['host']; + } else { + $header = 'Host'; + $this->headerNames['host'] = 'Host'; + } + // Ensure Host is the first header. + // See: http://tools.ietf.org/html/rfc7230#section-5.4 + $this->headers = [$header => [$host]] + $this->headers; + } + + /** + * @param mixed $method + */ + private function assertMethod($method): void + { + if (!is_string($method) || $method === '') { + throw new InvalidArgumentException('Method must be a non-empty string.'); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/Response.php b/vendor/guzzlehttp/psr7/src/Response.php new file mode 100644 index 000000000..8fc11478b --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Response.php @@ -0,0 +1,161 @@ + 'Continue', + 101 => 'Switching Protocols', + 102 => 'Processing', + 200 => 'OK', + 201 => 'Created', + 202 => 'Accepted', + 203 => 'Non-Authoritative Information', + 204 => 'No Content', + 205 => 'Reset Content', + 206 => 'Partial Content', + 207 => 'Multi-status', + 208 => 'Already Reported', + 300 => 'Multiple Choices', + 301 => 'Moved Permanently', + 302 => 'Found', + 303 => 'See Other', + 304 => 'Not Modified', + 305 => 'Use Proxy', + 306 => 'Switch Proxy', + 307 => 'Temporary Redirect', + 308 => 'Permanent Redirect', + 400 => 'Bad Request', + 401 => 'Unauthorized', + 402 => 'Payment Required', + 403 => 'Forbidden', + 404 => 'Not Found', + 405 => 'Method Not Allowed', + 406 => 'Not Acceptable', + 407 => 'Proxy Authentication Required', + 408 => 'Request Time-out', + 409 => 'Conflict', + 410 => 'Gone', + 411 => 'Length Required', + 412 => 'Precondition Failed', + 413 => 'Request Entity Too Large', + 414 => 'Request-URI Too Large', + 415 => 'Unsupported Media Type', + 416 => 'Requested range not satisfiable', + 417 => 'Expectation Failed', + 418 => 'I\'m a teapot', + 422 => 'Unprocessable Entity', + 423 => 'Locked', + 424 => 'Failed Dependency', + 425 => 'Unordered Collection', + 426 => 'Upgrade Required', + 428 => 'Precondition Required', + 429 => 'Too Many Requests', + 431 => 'Request Header Fields Too Large', + 451 => 'Unavailable For Legal Reasons', + 500 => 'Internal Server Error', + 501 => 'Not Implemented', + 502 => 'Bad Gateway', + 503 => 'Service Unavailable', + 504 => 'Gateway Time-out', + 505 => 'HTTP Version not supported', + 506 => 'Variant Also Negotiates', + 507 => 'Insufficient Storage', + 508 => 'Loop Detected', + 510 => 'Not Extended', + 511 => 'Network Authentication Required', + ]; + + /** @var string */ + private $reasonPhrase; + + /** @var int */ + private $statusCode; + + /** + * @param int $status Status code + * @param array $headers Response headers + * @param string|resource|StreamInterface|null $body Response body + * @param string $version Protocol version + * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) + */ + public function __construct( + int $status = 200, + array $headers = [], + $body = null, + string $version = '1.1', + string $reason = null + ) { + $this->assertStatusCodeRange($status); + + $this->statusCode = $status; + + if ($body !== '' && $body !== null) { + $this->stream = Utils::streamFor($body); + } + + $this->setHeaders($headers); + if ($reason == '' && isset(self::PHRASES[$this->statusCode])) { + $this->reasonPhrase = self::PHRASES[$this->statusCode]; + } else { + $this->reasonPhrase = (string) $reason; + } + + $this->protocol = $version; + } + + public function getStatusCode(): int + { + return $this->statusCode; + } + + public function getReasonPhrase(): string + { + return $this->reasonPhrase; + } + + public function withStatus($code, $reasonPhrase = ''): ResponseInterface + { + $this->assertStatusCodeIsInteger($code); + $code = (int) $code; + $this->assertStatusCodeRange($code); + + $new = clone $this; + $new->statusCode = $code; + if ($reasonPhrase == '' && isset(self::PHRASES[$new->statusCode])) { + $reasonPhrase = self::PHRASES[$new->statusCode]; + } + $new->reasonPhrase = (string) $reasonPhrase; + + return $new; + } + + /** + * @param mixed $statusCode + */ + private function assertStatusCodeIsInteger($statusCode): void + { + if (filter_var($statusCode, FILTER_VALIDATE_INT) === false) { + throw new \InvalidArgumentException('Status code must be an integer value.'); + } + } + + private function assertStatusCodeRange(int $statusCode): void + { + if ($statusCode < 100 || $statusCode >= 600) { + throw new \InvalidArgumentException('Status code must be an integer value between 1xx and 5xx.'); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/Rfc7230.php b/vendor/guzzlehttp/psr7/src/Rfc7230.php new file mode 100644 index 000000000..8219dba4d --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Rfc7230.php @@ -0,0 +1,23 @@ +@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m"; + public const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)"; +} diff --git a/vendor/guzzlehttp/psr7/src/ServerRequest.php b/vendor/guzzlehttp/psr7/src/ServerRequest.php new file mode 100644 index 000000000..c852d96f5 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/ServerRequest.php @@ -0,0 +1,340 @@ + $headers Request headers + * @param string|resource|StreamInterface|null $body Request body + * @param string $version Protocol version + * @param array $serverParams Typically the $_SERVER superglobal + */ + public function __construct( + string $method, + $uri, + array $headers = [], + $body = null, + string $version = '1.1', + array $serverParams = [] + ) { + $this->serverParams = $serverParams; + + parent::__construct($method, $uri, $headers, $body, $version); + } + + /** + * Return an UploadedFile instance array. + * + * @param array $files An array which respect $_FILES structure + * + * @throws InvalidArgumentException for unrecognized values + */ + public static function normalizeFiles(array $files): array + { + $normalized = []; + + foreach ($files as $key => $value) { + if ($value instanceof UploadedFileInterface) { + $normalized[$key] = $value; + } elseif (is_array($value) && isset($value['tmp_name'])) { + $normalized[$key] = self::createUploadedFileFromSpec($value); + } elseif (is_array($value)) { + $normalized[$key] = self::normalizeFiles($value); + continue; + } else { + throw new InvalidArgumentException('Invalid value in files specification'); + } + } + + return $normalized; + } + + /** + * Create and return an UploadedFile instance from a $_FILES specification. + * + * If the specification represents an array of values, this method will + * delegate to normalizeNestedFileSpec() and return that return value. + * + * @param array $value $_FILES struct + * + * @return UploadedFileInterface|UploadedFileInterface[] + */ + private static function createUploadedFileFromSpec(array $value) + { + if (is_array($value['tmp_name'])) { + return self::normalizeNestedFileSpec($value); + } + + return new UploadedFile( + $value['tmp_name'], + (int) $value['size'], + (int) $value['error'], + $value['name'], + $value['type'] + ); + } + + /** + * Normalize an array of file specifications. + * + * Loops through all nested files and returns a normalized array of + * UploadedFileInterface instances. + * + * @return UploadedFileInterface[] + */ + private static function normalizeNestedFileSpec(array $files = []): array + { + $normalizedFiles = []; + + foreach (array_keys($files['tmp_name']) as $key) { + $spec = [ + 'tmp_name' => $files['tmp_name'][$key], + 'size' => $files['size'][$key] ?? null, + 'error' => $files['error'][$key] ?? null, + 'name' => $files['name'][$key] ?? null, + 'type' => $files['type'][$key] ?? null, + ]; + $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec); + } + + return $normalizedFiles; + } + + /** + * Return a ServerRequest populated with superglobals: + * $_GET + * $_POST + * $_COOKIE + * $_FILES + * $_SERVER + */ + public static function fromGlobals(): ServerRequestInterface + { + $method = $_SERVER['REQUEST_METHOD'] ?? 'GET'; + $headers = getallheaders(); + $uri = self::getUriFromGlobals(); + $body = new CachingStream(new LazyOpenStream('php://input', 'r+')); + $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1'; + + $serverRequest = new ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER); + + return $serverRequest + ->withCookieParams($_COOKIE) + ->withQueryParams($_GET) + ->withParsedBody($_POST) + ->withUploadedFiles(self::normalizeFiles($_FILES)); + } + + private static function extractHostAndPortFromAuthority(string $authority): array + { + $uri = 'http://'.$authority; + $parts = parse_url($uri); + if (false === $parts) { + return [null, null]; + } + + $host = $parts['host'] ?? null; + $port = $parts['port'] ?? null; + + return [$host, $port]; + } + + /** + * Get a Uri populated with values from $_SERVER. + */ + public static function getUriFromGlobals(): UriInterface + { + $uri = new Uri(''); + + $uri = $uri->withScheme(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http'); + + $hasPort = false; + if (isset($_SERVER['HTTP_HOST'])) { + [$host, $port] = self::extractHostAndPortFromAuthority($_SERVER['HTTP_HOST']); + if ($host !== null) { + $uri = $uri->withHost($host); + } + + if ($port !== null) { + $hasPort = true; + $uri = $uri->withPort($port); + } + } elseif (isset($_SERVER['SERVER_NAME'])) { + $uri = $uri->withHost($_SERVER['SERVER_NAME']); + } elseif (isset($_SERVER['SERVER_ADDR'])) { + $uri = $uri->withHost($_SERVER['SERVER_ADDR']); + } + + if (!$hasPort && isset($_SERVER['SERVER_PORT'])) { + $uri = $uri->withPort($_SERVER['SERVER_PORT']); + } + + $hasQuery = false; + if (isset($_SERVER['REQUEST_URI'])) { + $requestUriParts = explode('?', $_SERVER['REQUEST_URI'], 2); + $uri = $uri->withPath($requestUriParts[0]); + if (isset($requestUriParts[1])) { + $hasQuery = true; + $uri = $uri->withQuery($requestUriParts[1]); + } + } + + if (!$hasQuery && isset($_SERVER['QUERY_STRING'])) { + $uri = $uri->withQuery($_SERVER['QUERY_STRING']); + } + + return $uri; + } + + public function getServerParams(): array + { + return $this->serverParams; + } + + public function getUploadedFiles(): array + { + return $this->uploadedFiles; + } + + public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface + { + $new = clone $this; + $new->uploadedFiles = $uploadedFiles; + + return $new; + } + + public function getCookieParams(): array + { + return $this->cookieParams; + } + + public function withCookieParams(array $cookies): ServerRequestInterface + { + $new = clone $this; + $new->cookieParams = $cookies; + + return $new; + } + + public function getQueryParams(): array + { + return $this->queryParams; + } + + public function withQueryParams(array $query): ServerRequestInterface + { + $new = clone $this; + $new->queryParams = $query; + + return $new; + } + + /** + * @return array|object|null + */ + public function getParsedBody() + { + return $this->parsedBody; + } + + public function withParsedBody($data): ServerRequestInterface + { + $new = clone $this; + $new->parsedBody = $data; + + return $new; + } + + public function getAttributes(): array + { + return $this->attributes; + } + + /** + * @return mixed + */ + public function getAttribute($attribute, $default = null) + { + if (false === array_key_exists($attribute, $this->attributes)) { + return $default; + } + + return $this->attributes[$attribute]; + } + + public function withAttribute($attribute, $value): ServerRequestInterface + { + $new = clone $this; + $new->attributes[$attribute] = $value; + + return $new; + } + + public function withoutAttribute($attribute): ServerRequestInterface + { + if (false === array_key_exists($attribute, $this->attributes)) { + return $this; + } + + $new = clone $this; + unset($new->attributes[$attribute]); + + return $new; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Stream.php b/vendor/guzzlehttp/psr7/src/Stream.php new file mode 100644 index 000000000..f730ddacf --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Stream.php @@ -0,0 +1,283 @@ +size = $options['size']; + } + + $this->customMetadata = $options['metadata'] ?? []; + $this->stream = $stream; + $meta = stream_get_meta_data($this->stream); + $this->seekable = $meta['seekable']; + $this->readable = (bool) preg_match(self::READABLE_MODES, $meta['mode']); + $this->writable = (bool) preg_match(self::WRITABLE_MODES, $meta['mode']); + $this->uri = $this->getMetadata('uri'); + } + + /** + * Closes the stream when the destructed + */ + public function __destruct() + { + $this->close(); + } + + public function __toString(): string + { + try { + if ($this->isSeekable()) { + $this->seek(0); + } + + return $this->getContents(); + } catch (\Throwable $e) { + if (\PHP_VERSION_ID >= 70400) { + throw $e; + } + trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + + return ''; + } + } + + public function getContents(): string + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + if (!$this->readable) { + throw new \RuntimeException('Cannot read from non-readable stream'); + } + + return Utils::tryGetContents($this->stream); + } + + public function close(): void + { + if (isset($this->stream)) { + if (is_resource($this->stream)) { + fclose($this->stream); + } + $this->detach(); + } + } + + public function detach() + { + if (!isset($this->stream)) { + return null; + } + + $result = $this->stream; + unset($this->stream); + $this->size = $this->uri = null; + $this->readable = $this->writable = $this->seekable = false; + + return $result; + } + + public function getSize(): ?int + { + if ($this->size !== null) { + return $this->size; + } + + if (!isset($this->stream)) { + return null; + } + + // Clear the stat cache if the stream has a URI + if ($this->uri) { + clearstatcache(true, $this->uri); + } + + $stats = fstat($this->stream); + if (is_array($stats) && isset($stats['size'])) { + $this->size = $stats['size']; + + return $this->size; + } + + return null; + } + + public function isReadable(): bool + { + return $this->readable; + } + + public function isWritable(): bool + { + return $this->writable; + } + + public function isSeekable(): bool + { + return $this->seekable; + } + + public function eof(): bool + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + return feof($this->stream); + } + + public function tell(): int + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + $result = ftell($this->stream); + + if ($result === false) { + throw new \RuntimeException('Unable to determine stream position'); + } + + return $result; + } + + public function rewind(): void + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET): void + { + $whence = (int) $whence; + + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->seekable) { + throw new \RuntimeException('Stream is not seekable'); + } + if (fseek($this->stream, $offset, $whence) === -1) { + throw new \RuntimeException('Unable to seek to stream position ' + .$offset.' with whence '.var_export($whence, true)); + } + } + + public function read($length): string + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->readable) { + throw new \RuntimeException('Cannot read from non-readable stream'); + } + if ($length < 0) { + throw new \RuntimeException('Length parameter cannot be negative'); + } + + if (0 === $length) { + return ''; + } + + try { + $string = fread($this->stream, $length); + } catch (\Exception $e) { + throw new \RuntimeException('Unable to read from stream', 0, $e); + } + + if (false === $string) { + throw new \RuntimeException('Unable to read from stream'); + } + + return $string; + } + + public function write($string): int + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->writable) { + throw new \RuntimeException('Cannot write to a non-writable stream'); + } + + // We can't know the size after writing anything + $this->size = null; + $result = fwrite($this->stream, $string); + + if ($result === false) { + throw new \RuntimeException('Unable to write to stream'); + } + + return $result; + } + + /** + * @return mixed + */ + public function getMetadata($key = null) + { + if (!isset($this->stream)) { + return $key ? null : []; + } elseif (!$key) { + return $this->customMetadata + stream_get_meta_data($this->stream); + } elseif (isset($this->customMetadata[$key])) { + return $this->customMetadata[$key]; + } + + $meta = stream_get_meta_data($this->stream); + + return $meta[$key] ?? null; + } +} diff --git a/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php new file mode 100644 index 000000000..96196a3ea --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php @@ -0,0 +1,156 @@ +stream = $stream; + } + + /** + * Magic method used to create a new stream if streams are not added in + * the constructor of a decorator (e.g., LazyOpenStream). + * + * @return StreamInterface + */ + public function __get(string $name) + { + if ($name === 'stream') { + $this->stream = $this->createStream(); + + return $this->stream; + } + + throw new \UnexpectedValueException("$name not found on class"); + } + + public function __toString(): string + { + try { + if ($this->isSeekable()) { + $this->seek(0); + } + + return $this->getContents(); + } catch (\Throwable $e) { + if (\PHP_VERSION_ID >= 70400) { + throw $e; + } + trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + + return ''; + } + } + + public function getContents(): string + { + return Utils::copyToString($this); + } + + /** + * Allow decorators to implement custom methods + * + * @return mixed + */ + public function __call(string $method, array $args) + { + /** @var callable $callable */ + $callable = [$this->stream, $method]; + $result = call_user_func_array($callable, $args); + + // Always return the wrapped object if the result is a return $this + return $result === $this->stream ? $this : $result; + } + + public function close(): void + { + $this->stream->close(); + } + + /** + * @return mixed + */ + public function getMetadata($key = null) + { + return $this->stream->getMetadata($key); + } + + public function detach() + { + return $this->stream->detach(); + } + + public function getSize(): ?int + { + return $this->stream->getSize(); + } + + public function eof(): bool + { + return $this->stream->eof(); + } + + public function tell(): int + { + return $this->stream->tell(); + } + + public function isReadable(): bool + { + return $this->stream->isReadable(); + } + + public function isWritable(): bool + { + return $this->stream->isWritable(); + } + + public function isSeekable(): bool + { + return $this->stream->isSeekable(); + } + + public function rewind(): void + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET): void + { + $this->stream->seek($offset, $whence); + } + + public function read($length): string + { + return $this->stream->read($length); + } + + public function write($string): int + { + return $this->stream->write($string); + } + + /** + * Implement in subclasses to dynamically create streams when requested. + * + * @throws \BadMethodCallException + */ + protected function createStream(): StreamInterface + { + throw new \BadMethodCallException('Not implemented'); + } +} diff --git a/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/vendor/guzzlehttp/psr7/src/StreamWrapper.php new file mode 100644 index 000000000..b3655cb3a --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/StreamWrapper.php @@ -0,0 +1,175 @@ +isReadable()) { + $mode = $stream->isWritable() ? 'r+' : 'r'; + } elseif ($stream->isWritable()) { + $mode = 'w'; + } else { + throw new \InvalidArgumentException('The stream must be readable, ' + .'writable, or both.'); + } + + return fopen('guzzle://stream', $mode, false, self::createStreamContext($stream)); + } + + /** + * Creates a stream context that can be used to open a stream as a php stream resource. + * + * @return resource + */ + public static function createStreamContext(StreamInterface $stream) + { + return stream_context_create([ + 'guzzle' => ['stream' => $stream], + ]); + } + + /** + * Registers the stream wrapper if needed + */ + public static function register(): void + { + if (!in_array('guzzle', stream_get_wrappers())) { + stream_wrapper_register('guzzle', __CLASS__); + } + } + + public function stream_open(string $path, string $mode, int $options, string &$opened_path = null): bool + { + $options = stream_context_get_options($this->context); + + if (!isset($options['guzzle']['stream'])) { + return false; + } + + $this->mode = $mode; + $this->stream = $options['guzzle']['stream']; + + return true; + } + + public function stream_read(int $count): string + { + return $this->stream->read($count); + } + + public function stream_write(string $data): int + { + return $this->stream->write($data); + } + + public function stream_tell(): int + { + return $this->stream->tell(); + } + + public function stream_eof(): bool + { + return $this->stream->eof(); + } + + public function stream_seek(int $offset, int $whence): bool + { + $this->stream->seek($offset, $whence); + + return true; + } + + /** + * @return resource|false + */ + public function stream_cast(int $cast_as) + { + $stream = clone $this->stream; + $resource = $stream->detach(); + + return $resource ?? false; + } + + /** + * @return array + */ + public function stream_stat(): array + { + static $modeMap = [ + 'r' => 33060, + 'rb' => 33060, + 'r+' => 33206, + 'w' => 33188, + 'wb' => 33188, + ]; + + return [ + 'dev' => 0, + 'ino' => 0, + 'mode' => $modeMap[$this->mode], + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => $this->stream->getSize() ?: 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, + 'blksize' => 0, + 'blocks' => 0, + ]; + } + + /** + * @return array + */ + public function url_stat(string $path, int $flags): array + { + return [ + 'dev' => 0, + 'ino' => 0, + 'mode' => 0, + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, + 'blksize' => 0, + 'blocks' => 0, + ]; + } +} diff --git a/vendor/guzzlehttp/psr7/src/UploadedFile.php b/vendor/guzzlehttp/psr7/src/UploadedFile.php new file mode 100644 index 000000000..b1521bcf8 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/UploadedFile.php @@ -0,0 +1,211 @@ +setError($errorStatus); + $this->size = $size; + $this->clientFilename = $clientFilename; + $this->clientMediaType = $clientMediaType; + + if ($this->isOk()) { + $this->setStreamOrFile($streamOrFile); + } + } + + /** + * Depending on the value set file or stream variable + * + * @param StreamInterface|string|resource $streamOrFile + * + * @throws InvalidArgumentException + */ + private function setStreamOrFile($streamOrFile): void + { + if (is_string($streamOrFile)) { + $this->file = $streamOrFile; + } elseif (is_resource($streamOrFile)) { + $this->stream = new Stream($streamOrFile); + } elseif ($streamOrFile instanceof StreamInterface) { + $this->stream = $streamOrFile; + } else { + throw new InvalidArgumentException( + 'Invalid stream or file provided for UploadedFile' + ); + } + } + + /** + * @throws InvalidArgumentException + */ + private function setError(int $error): void + { + if (false === in_array($error, UploadedFile::ERRORS, true)) { + throw new InvalidArgumentException( + 'Invalid error status for UploadedFile' + ); + } + + $this->error = $error; + } + + private function isStringNotEmpty($param): bool + { + return is_string($param) && false === empty($param); + } + + /** + * Return true if there is no upload error + */ + private function isOk(): bool + { + return $this->error === UPLOAD_ERR_OK; + } + + public function isMoved(): bool + { + return $this->moved; + } + + /** + * @throws RuntimeException if is moved or not ok + */ + private function validateActive(): void + { + if (false === $this->isOk()) { + throw new RuntimeException('Cannot retrieve stream due to upload error'); + } + + if ($this->isMoved()) { + throw new RuntimeException('Cannot retrieve stream after it has already been moved'); + } + } + + public function getStream(): StreamInterface + { + $this->validateActive(); + + if ($this->stream instanceof StreamInterface) { + return $this->stream; + } + + /** @var string $file */ + $file = $this->file; + + return new LazyOpenStream($file, 'r+'); + } + + public function moveTo($targetPath): void + { + $this->validateActive(); + + if (false === $this->isStringNotEmpty($targetPath)) { + throw new InvalidArgumentException( + 'Invalid path provided for move operation; must be a non-empty string' + ); + } + + if ($this->file) { + $this->moved = PHP_SAPI === 'cli' + ? rename($this->file, $targetPath) + : move_uploaded_file($this->file, $targetPath); + } else { + Utils::copyToStream( + $this->getStream(), + new LazyOpenStream($targetPath, 'w') + ); + + $this->moved = true; + } + + if (false === $this->moved) { + throw new RuntimeException( + sprintf('Uploaded file could not be moved to %s', $targetPath) + ); + } + } + + public function getSize(): ?int + { + return $this->size; + } + + public function getError(): int + { + return $this->error; + } + + public function getClientFilename(): ?string + { + return $this->clientFilename; + } + + public function getClientMediaType(): ?string + { + return $this->clientMediaType; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Uri.php b/vendor/guzzlehttp/psr7/src/Uri.php new file mode 100644 index 000000000..fbba7f123 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Uri.php @@ -0,0 +1,741 @@ + 80, + 'https' => 443, + 'ftp' => 21, + 'gopher' => 70, + 'nntp' => 119, + 'news' => 119, + 'telnet' => 23, + 'tn3270' => 23, + 'imap' => 143, + 'pop' => 110, + 'ldap' => 389, + ]; + + /** + * Unreserved characters for use in a regex. + * + * @see https://tools.ietf.org/html/rfc3986#section-2.3 + */ + private const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~'; + + /** + * Sub-delims for use in a regex. + * + * @see https://tools.ietf.org/html/rfc3986#section-2.2 + */ + private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;='; + private const QUERY_SEPARATORS_REPLACEMENT = ['=' => '%3D', '&' => '%26']; + + /** @var string Uri scheme. */ + private $scheme = ''; + + /** @var string Uri user info. */ + private $userInfo = ''; + + /** @var string Uri host. */ + private $host = ''; + + /** @var int|null Uri port. */ + private $port; + + /** @var string Uri path. */ + private $path = ''; + + /** @var string Uri query string. */ + private $query = ''; + + /** @var string Uri fragment. */ + private $fragment = ''; + + /** @var string|null String representation */ + private $composedComponents; + + public function __construct(string $uri = '') + { + if ($uri !== '') { + $parts = self::parse($uri); + if ($parts === false) { + throw new MalformedUriException("Unable to parse URI: $uri"); + } + $this->applyParts($parts); + } + } + + /** + * UTF-8 aware \parse_url() replacement. + * + * The internal function produces broken output for non ASCII domain names + * (IDN) when used with locales other than "C". + * + * On the other hand, cURL understands IDN correctly only when UTF-8 locale + * is configured ("C.UTF-8", "en_US.UTF-8", etc.). + * + * @see https://bugs.php.net/bug.php?id=52923 + * @see https://www.php.net/manual/en/function.parse-url.php#114817 + * @see https://curl.haxx.se/libcurl/c/CURLOPT_URL.html#ENCODING + * + * @return array|false + */ + private static function parse(string $url) + { + // If IPv6 + $prefix = ''; + if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) { + /** @var array{0:string, 1:string, 2:string} $matches */ + $prefix = $matches[1]; + $url = $matches[2]; + } + + /** @var string */ + $encodedUrl = preg_replace_callback( + '%[^:/@?&=#]+%usD', + static function ($matches) { + return urlencode($matches[0]); + }, + $url + ); + + $result = parse_url($prefix.$encodedUrl); + + if ($result === false) { + return false; + } + + return array_map('urldecode', $result); + } + + public function __toString(): string + { + if ($this->composedComponents === null) { + $this->composedComponents = self::composeComponents( + $this->scheme, + $this->getAuthority(), + $this->path, + $this->query, + $this->fragment + ); + } + + return $this->composedComponents; + } + + /** + * Composes a URI reference string from its various components. + * + * Usually this method does not need to be called manually but instead is used indirectly via + * `Psr\Http\Message\UriInterface::__toString`. + * + * PSR-7 UriInterface treats an empty component the same as a missing component as + * getQuery(), getFragment() etc. always return a string. This explains the slight + * difference to RFC 3986 Section 5.3. + * + * Another adjustment is that the authority separator is added even when the authority is missing/empty + * for the "file" scheme. This is because PHP stream functions like `file_get_contents` only work with + * `file:///myfile` but not with `file:/myfile` although they are equivalent according to RFC 3986. But + * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to + * that format). + * + * @see https://tools.ietf.org/html/rfc3986#section-5.3 + */ + public static function composeComponents(?string $scheme, ?string $authority, string $path, ?string $query, ?string $fragment): string + { + $uri = ''; + + // weak type checks to also accept null until we can add scalar type hints + if ($scheme != '') { + $uri .= $scheme.':'; + } + + if ($authority != '' || $scheme === 'file') { + $uri .= '//'.$authority; + } + + if ($authority != '' && $path != '' && $path[0] != '/') { + $path = '/'.$path; + } + + $uri .= $path; + + if ($query != '') { + $uri .= '?'.$query; + } + + if ($fragment != '') { + $uri .= '#'.$fragment; + } + + return $uri; + } + + /** + * Whether the URI has the default port of the current scheme. + * + * `Psr\Http\Message\UriInterface::getPort` may return null or the standard port. This method can be used + * independently of the implementation. + */ + public static function isDefaultPort(UriInterface $uri): bool + { + return $uri->getPort() === null + || (isset(self::DEFAULT_PORTS[$uri->getScheme()]) && $uri->getPort() === self::DEFAULT_PORTS[$uri->getScheme()]); + } + + /** + * Whether the URI is absolute, i.e. it has a scheme. + * + * An instance of UriInterface can either be an absolute URI or a relative reference. This method returns true + * if it is the former. An absolute URI has a scheme. A relative reference is used to express a URI relative + * to another URI, the base URI. Relative references can be divided into several forms: + * - network-path references, e.g. '//example.com/path' + * - absolute-path references, e.g. '/path' + * - relative-path references, e.g. 'subpath' + * + * @see Uri::isNetworkPathReference + * @see Uri::isAbsolutePathReference + * @see Uri::isRelativePathReference + * @see https://tools.ietf.org/html/rfc3986#section-4 + */ + public static function isAbsolute(UriInterface $uri): bool + { + return $uri->getScheme() !== ''; + } + + /** + * Whether the URI is a network-path reference. + * + * A relative reference that begins with two slash characters is termed an network-path reference. + * + * @see https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isNetworkPathReference(UriInterface $uri): bool + { + return $uri->getScheme() === '' && $uri->getAuthority() !== ''; + } + + /** + * Whether the URI is a absolute-path reference. + * + * A relative reference that begins with a single slash character is termed an absolute-path reference. + * + * @see https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isAbsolutePathReference(UriInterface $uri): bool + { + return $uri->getScheme() === '' + && $uri->getAuthority() === '' + && isset($uri->getPath()[0]) + && $uri->getPath()[0] === '/'; + } + + /** + * Whether the URI is a relative-path reference. + * + * A relative reference that does not begin with a slash character is termed a relative-path reference. + * + * @see https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isRelativePathReference(UriInterface $uri): bool + { + return $uri->getScheme() === '' + && $uri->getAuthority() === '' + && (!isset($uri->getPath()[0]) || $uri->getPath()[0] !== '/'); + } + + /** + * Whether the URI is a same-document reference. + * + * A same-document reference refers to a URI that is, aside from its fragment + * component, identical to the base URI. When no base URI is given, only an empty + * URI reference (apart from its fragment) is considered a same-document reference. + * + * @param UriInterface $uri The URI to check + * @param UriInterface|null $base An optional base URI to compare against + * + * @see https://tools.ietf.org/html/rfc3986#section-4.4 + */ + public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool + { + if ($base !== null) { + $uri = UriResolver::resolve($base, $uri); + + return ($uri->getScheme() === $base->getScheme()) + && ($uri->getAuthority() === $base->getAuthority()) + && ($uri->getPath() === $base->getPath()) + && ($uri->getQuery() === $base->getQuery()); + } + + return $uri->getScheme() === '' && $uri->getAuthority() === '' && $uri->getPath() === '' && $uri->getQuery() === ''; + } + + /** + * Creates a new URI with a specific query string value removed. + * + * Any existing query string values that exactly match the provided key are + * removed. + * + * @param UriInterface $uri URI to use as a base. + * @param string $key Query string key to remove. + */ + public static function withoutQueryValue(UriInterface $uri, string $key): UriInterface + { + $result = self::getFilteredQueryString($uri, [$key]); + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a new URI with a specific query string value. + * + * Any existing query string values that exactly match the provided key are + * removed and replaced with the given key value pair. + * + * A value of null will set the query string key without a value, e.g. "key" + * instead of "key=value". + * + * @param UriInterface $uri URI to use as a base. + * @param string $key Key to set. + * @param string|null $value Value to set + */ + public static function withQueryValue(UriInterface $uri, string $key, ?string $value): UriInterface + { + $result = self::getFilteredQueryString($uri, [$key]); + + $result[] = self::generateQueryString($key, $value); + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a new URI with multiple specific query string values. + * + * It has the same behavior as withQueryValue() but for an associative array of key => value. + * + * @param UriInterface $uri URI to use as a base. + * @param array $keyValueArray Associative array of key and values + */ + public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface + { + $result = self::getFilteredQueryString($uri, array_keys($keyValueArray)); + + foreach ($keyValueArray as $key => $value) { + $result[] = self::generateQueryString((string) $key, $value !== null ? (string) $value : null); + } + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a URI from a hash of `parse_url` components. + * + * @see http://php.net/manual/en/function.parse-url.php + * + * @throws MalformedUriException If the components do not form a valid URI. + */ + public static function fromParts(array $parts): UriInterface + { + $uri = new self(); + $uri->applyParts($parts); + $uri->validateState(); + + return $uri; + } + + public function getScheme(): string + { + return $this->scheme; + } + + public function getAuthority(): string + { + $authority = $this->host; + if ($this->userInfo !== '') { + $authority = $this->userInfo.'@'.$authority; + } + + if ($this->port !== null) { + $authority .= ':'.$this->port; + } + + return $authority; + } + + public function getUserInfo(): string + { + return $this->userInfo; + } + + public function getHost(): string + { + return $this->host; + } + + public function getPort(): ?int + { + return $this->port; + } + + public function getPath(): string + { + return $this->path; + } + + public function getQuery(): string + { + return $this->query; + } + + public function getFragment(): string + { + return $this->fragment; + } + + public function withScheme($scheme): UriInterface + { + $scheme = $this->filterScheme($scheme); + + if ($this->scheme === $scheme) { + return $this; + } + + $new = clone $this; + $new->scheme = $scheme; + $new->composedComponents = null; + $new->removeDefaultPort(); + $new->validateState(); + + return $new; + } + + public function withUserInfo($user, $password = null): UriInterface + { + $info = $this->filterUserInfoComponent($user); + if ($password !== null) { + $info .= ':'.$this->filterUserInfoComponent($password); + } + + if ($this->userInfo === $info) { + return $this; + } + + $new = clone $this; + $new->userInfo = $info; + $new->composedComponents = null; + $new->validateState(); + + return $new; + } + + public function withHost($host): UriInterface + { + $host = $this->filterHost($host); + + if ($this->host === $host) { + return $this; + } + + $new = clone $this; + $new->host = $host; + $new->composedComponents = null; + $new->validateState(); + + return $new; + } + + public function withPort($port): UriInterface + { + $port = $this->filterPort($port); + + if ($this->port === $port) { + return $this; + } + + $new = clone $this; + $new->port = $port; + $new->composedComponents = null; + $new->removeDefaultPort(); + $new->validateState(); + + return $new; + } + + public function withPath($path): UriInterface + { + $path = $this->filterPath($path); + + if ($this->path === $path) { + return $this; + } + + $new = clone $this; + $new->path = $path; + $new->composedComponents = null; + $new->validateState(); + + return $new; + } + + public function withQuery($query): UriInterface + { + $query = $this->filterQueryAndFragment($query); + + if ($this->query === $query) { + return $this; + } + + $new = clone $this; + $new->query = $query; + $new->composedComponents = null; + + return $new; + } + + public function withFragment($fragment): UriInterface + { + $fragment = $this->filterQueryAndFragment($fragment); + + if ($this->fragment === $fragment) { + return $this; + } + + $new = clone $this; + $new->fragment = $fragment; + $new->composedComponents = null; + + return $new; + } + + public function jsonSerialize(): string + { + return $this->__toString(); + } + + /** + * Apply parse_url parts to a URI. + * + * @param array $parts Array of parse_url parts to apply. + */ + private function applyParts(array $parts): void + { + $this->scheme = isset($parts['scheme']) + ? $this->filterScheme($parts['scheme']) + : ''; + $this->userInfo = isset($parts['user']) + ? $this->filterUserInfoComponent($parts['user']) + : ''; + $this->host = isset($parts['host']) + ? $this->filterHost($parts['host']) + : ''; + $this->port = isset($parts['port']) + ? $this->filterPort($parts['port']) + : null; + $this->path = isset($parts['path']) + ? $this->filterPath($parts['path']) + : ''; + $this->query = isset($parts['query']) + ? $this->filterQueryAndFragment($parts['query']) + : ''; + $this->fragment = isset($parts['fragment']) + ? $this->filterQueryAndFragment($parts['fragment']) + : ''; + if (isset($parts['pass'])) { + $this->userInfo .= ':'.$this->filterUserInfoComponent($parts['pass']); + } + + $this->removeDefaultPort(); + } + + /** + * @param mixed $scheme + * + * @throws \InvalidArgumentException If the scheme is invalid. + */ + private function filterScheme($scheme): string + { + if (!is_string($scheme)) { + throw new \InvalidArgumentException('Scheme must be a string'); + } + + return \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); + } + + /** + * @param mixed $component + * + * @throws \InvalidArgumentException If the user info is invalid. + */ + private function filterUserInfoComponent($component): string + { + if (!is_string($component)) { + throw new \InvalidArgumentException('User info must be a string'); + } + + return preg_replace_callback( + '/(?:[^%'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.']+|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $component + ); + } + + /** + * @param mixed $host + * + * @throws \InvalidArgumentException If the host is invalid. + */ + private function filterHost($host): string + { + if (!is_string($host)) { + throw new \InvalidArgumentException('Host must be a string'); + } + + return \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); + } + + /** + * @param mixed $port + * + * @throws \InvalidArgumentException If the port is invalid. + */ + private function filterPort($port): ?int + { + if ($port === null) { + return null; + } + + $port = (int) $port; + if (0 > $port || 0xFFFF < $port) { + throw new \InvalidArgumentException( + sprintf('Invalid port: %d. Must be between 0 and 65535', $port) + ); + } + + return $port; + } + + /** + * @param string[] $keys + * + * @return string[] + */ + private static function getFilteredQueryString(UriInterface $uri, array $keys): array + { + $current = $uri->getQuery(); + + if ($current === '') { + return []; + } + + $decodedKeys = array_map('rawurldecode', $keys); + + return array_filter(explode('&', $current), function ($part) use ($decodedKeys) { + return !in_array(rawurldecode(explode('=', $part)[0]), $decodedKeys, true); + }); + } + + private static function generateQueryString(string $key, ?string $value): string + { + // Query string separators ("=", "&") within the key or value need to be encoded + // (while preventing double-encoding) before setting the query string. All other + // chars that need percent-encoding will be encoded by withQuery(). + $queryString = strtr($key, self::QUERY_SEPARATORS_REPLACEMENT); + + if ($value !== null) { + $queryString .= '='.strtr($value, self::QUERY_SEPARATORS_REPLACEMENT); + } + + return $queryString; + } + + private function removeDefaultPort(): void + { + if ($this->port !== null && self::isDefaultPort($this)) { + $this->port = null; + } + } + + /** + * Filters the path of a URI + * + * @param mixed $path + * + * @throws \InvalidArgumentException If the path is invalid. + */ + private function filterPath($path): string + { + if (!is_string($path)) { + throw new \InvalidArgumentException('Path must be a string'); + } + + return preg_replace_callback( + '/(?:[^'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.'%:@\/]++|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $path + ); + } + + /** + * Filters the query string or fragment of a URI. + * + * @param mixed $str + * + * @throws \InvalidArgumentException If the query or fragment is invalid. + */ + private function filterQueryAndFragment($str): string + { + if (!is_string($str)) { + throw new \InvalidArgumentException('Query and fragment must be a string'); + } + + return preg_replace_callback( + '/(?:[^'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.'%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $str + ); + } + + private function rawurlencodeMatchZero(array $match): string + { + return rawurlencode($match[0]); + } + + private function validateState(): void + { + if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) { + $this->host = self::HTTP_DEFAULT_HOST; + } + + if ($this->getAuthority() === '') { + if (0 === strpos($this->path, '//')) { + throw new MalformedUriException('The path of a URI without an authority must not start with two slashes "//"'); + } + if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) { + throw new MalformedUriException('A relative URI must not have a path beginning with a segment containing a colon'); + } + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/UriComparator.php b/vendor/guzzlehttp/psr7/src/UriComparator.php new file mode 100644 index 000000000..70c582aa0 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/UriComparator.php @@ -0,0 +1,52 @@ +getHost(), $modified->getHost()) !== 0) { + return true; + } + + if ($original->getScheme() !== $modified->getScheme()) { + return true; + } + + if (self::computePort($original) !== self::computePort($modified)) { + return true; + } + + return false; + } + + private static function computePort(UriInterface $uri): int + { + $port = $uri->getPort(); + + if (null !== $port) { + return $port; + } + + return 'https' === $uri->getScheme() ? 443 : 80; + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/vendor/guzzlehttp/psr7/src/UriNormalizer.php new file mode 100644 index 000000000..cd4c383aa --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/UriNormalizer.php @@ -0,0 +1,220 @@ +getPath() === '' + && ($uri->getScheme() === 'http' || $uri->getScheme() === 'https') + ) { + $uri = $uri->withPath('/'); + } + + if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'localhost') { + $uri = $uri->withHost(''); + } + + if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && Uri::isDefaultPort($uri)) { + $uri = $uri->withPort(null); + } + + if ($flags & self::REMOVE_DOT_SEGMENTS && !Uri::isRelativePathReference($uri)) { + $uri = $uri->withPath(UriResolver::removeDotSegments($uri->getPath())); + } + + if ($flags & self::REMOVE_DUPLICATE_SLASHES) { + $uri = $uri->withPath(preg_replace('#//++#', '/', $uri->getPath())); + } + + if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') { + $queryKeyValues = explode('&', $uri->getQuery()); + sort($queryKeyValues); + $uri = $uri->withQuery(implode('&', $queryKeyValues)); + } + + return $uri; + } + + /** + * Whether two URIs can be considered equivalent. + * + * Both URIs are normalized automatically before comparison with the given $normalizations bitmask. The method also + * accepts relative URI references and returns true when they are equivalent. This of course assumes they will be + * resolved against the same base URI. If this is not the case, determination of equivalence or difference of + * relative references does not mean anything. + * + * @param UriInterface $uri1 An URI to compare + * @param UriInterface $uri2 An URI to compare + * @param int $normalizations A bitmask of normalizations to apply, see constants + * + * @see https://tools.ietf.org/html/rfc3986#section-6.1 + */ + public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, int $normalizations = self::PRESERVING_NORMALIZATIONS): bool + { + return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations); + } + + private static function capitalizePercentEncoding(UriInterface $uri): UriInterface + { + $regex = '/(?:%[A-Fa-f0-9]{2})++/'; + + $callback = function (array $match) { + return strtoupper($match[0]); + }; + + return + $uri->withPath( + preg_replace_callback($regex, $callback, $uri->getPath()) + )->withQuery( + preg_replace_callback($regex, $callback, $uri->getQuery()) + ); + } + + private static function decodeUnreservedCharacters(UriInterface $uri): UriInterface + { + $regex = '/%(?:2D|2E|5F|7E|3[0-9]|[46][1-9A-F]|[57][0-9A])/i'; + + $callback = function (array $match) { + return rawurldecode($match[0]); + }; + + return + $uri->withPath( + preg_replace_callback($regex, $callback, $uri->getPath()) + )->withQuery( + preg_replace_callback($regex, $callback, $uri->getQuery()) + ); + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/vendor/guzzlehttp/psr7/src/UriResolver.php b/vendor/guzzlehttp/psr7/src/UriResolver.php new file mode 100644 index 000000000..38d5793c7 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/UriResolver.php @@ -0,0 +1,211 @@ +getScheme() != '') { + return $rel->withPath(self::removeDotSegments($rel->getPath())); + } + + if ($rel->getAuthority() != '') { + $targetAuthority = $rel->getAuthority(); + $targetPath = self::removeDotSegments($rel->getPath()); + $targetQuery = $rel->getQuery(); + } else { + $targetAuthority = $base->getAuthority(); + if ($rel->getPath() === '') { + $targetPath = $base->getPath(); + $targetQuery = $rel->getQuery() != '' ? $rel->getQuery() : $base->getQuery(); + } else { + if ($rel->getPath()[0] === '/') { + $targetPath = $rel->getPath(); + } else { + if ($targetAuthority != '' && $base->getPath() === '') { + $targetPath = '/'.$rel->getPath(); + } else { + $lastSlashPos = strrpos($base->getPath(), '/'); + if ($lastSlashPos === false) { + $targetPath = $rel->getPath(); + } else { + $targetPath = substr($base->getPath(), 0, $lastSlashPos + 1).$rel->getPath(); + } + } + } + $targetPath = self::removeDotSegments($targetPath); + $targetQuery = $rel->getQuery(); + } + } + + return new Uri(Uri::composeComponents( + $base->getScheme(), + $targetAuthority, + $targetPath, + $targetQuery, + $rel->getFragment() + )); + } + + /** + * Returns the target URI as a relative reference from the base URI. + * + * This method is the counterpart to resolve(): + * + * (string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) + * + * One use-case is to use the current request URI as base URI and then generate relative links in your documents + * to reduce the document size or offer self-contained downloadable document archives. + * + * $base = new Uri('http://example.com/a/b/'); + * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. + * echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. + * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. + * echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. + * + * This method also accepts a target that is already relative and will try to relativize it further. Only a + * relative-path reference will be returned as-is. + * + * echo UriResolver::relativize($base, new Uri('/a/b/c')); // prints 'c' as well + */ + public static function relativize(UriInterface $base, UriInterface $target): UriInterface + { + if ($target->getScheme() !== '' + && ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '') + ) { + return $target; + } + + if (Uri::isRelativePathReference($target)) { + // As the target is already highly relative we return it as-is. It would be possible to resolve + // the target with `$target = self::resolve($base, $target);` and then try make it more relative + // by removing a duplicate query. But let's not do that automatically. + return $target; + } + + if ($target->getAuthority() !== '' && $base->getAuthority() !== $target->getAuthority()) { + return $target->withScheme(''); + } + + // We must remove the path before removing the authority because if the path starts with two slashes, the URI + // would turn invalid. And we also cannot set a relative path before removing the authority, as that is also + // invalid. + $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(null)->withHost(''); + + if ($base->getPath() !== $target->getPath()) { + return $emptyPathUri->withPath(self::getRelativePath($base, $target)); + } + + if ($base->getQuery() === $target->getQuery()) { + // Only the target fragment is left. And it must be returned even if base and target fragment are the same. + return $emptyPathUri->withQuery(''); + } + + // If the base URI has a query but the target has none, we cannot return an empty path reference as it would + // inherit the base query component when resolving. + if ($target->getQuery() === '') { + $segments = explode('/', $target->getPath()); + /** @var string $lastSegment */ + $lastSegment = end($segments); + + return $emptyPathUri->withPath($lastSegment === '' ? './' : $lastSegment); + } + + return $emptyPathUri; + } + + private static function getRelativePath(UriInterface $base, UriInterface $target): string + { + $sourceSegments = explode('/', $base->getPath()); + $targetSegments = explode('/', $target->getPath()); + array_pop($sourceSegments); + $targetLastSegment = array_pop($targetSegments); + foreach ($sourceSegments as $i => $segment) { + if (isset($targetSegments[$i]) && $segment === $targetSegments[$i]) { + unset($sourceSegments[$i], $targetSegments[$i]); + } else { + break; + } + } + $targetSegments[] = $targetLastSegment; + $relativePath = str_repeat('../', count($sourceSegments)).implode('/', $targetSegments); + + // A reference to am empty last segment or an empty first sub-segment must be prefixed with "./". + // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used + // as the first segment of a relative-path reference, as it would be mistaken for a scheme name. + if ('' === $relativePath || false !== strpos(explode('/', $relativePath, 2)[0], ':')) { + $relativePath = "./$relativePath"; + } elseif ('/' === $relativePath[0]) { + if ($base->getAuthority() != '' && $base->getPath() === '') { + // In this case an extra slash is added by resolve() automatically. So we must not add one here. + $relativePath = ".$relativePath"; + } else { + $relativePath = "./$relativePath"; + } + } + + return $relativePath; + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/vendor/guzzlehttp/psr7/src/Utils.php b/vendor/guzzlehttp/psr7/src/Utils.php new file mode 100644 index 000000000..917c05e30 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Utils.php @@ -0,0 +1,463 @@ + $v) { + if (!is_string($k) || !in_array(strtolower($k), $keys)) { + $result[$k] = $v; + } + } + + return $result; + } + + /** + * Copy the contents of a stream into another stream until the given number + * of bytes have been read. + * + * @param StreamInterface $source Stream to read from + * @param StreamInterface $dest Stream to write to + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + * + * @throws \RuntimeException on error. + */ + public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void + { + $bufferSize = 8192; + + if ($maxLen === -1) { + while (!$source->eof()) { + if (!$dest->write($source->read($bufferSize))) { + break; + } + } + } else { + $remaining = $maxLen; + while ($remaining > 0 && !$source->eof()) { + $buf = $source->read(min($bufferSize, $remaining)); + $len = strlen($buf); + if (!$len) { + break; + } + $remaining -= $len; + $dest->write($buf); + } + } + } + + /** + * Copy the contents of a stream into a string until the given number of + * bytes have been read. + * + * @param StreamInterface $stream Stream to read + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + * + * @throws \RuntimeException on error. + */ + public static function copyToString(StreamInterface $stream, int $maxLen = -1): string + { + $buffer = ''; + + if ($maxLen === -1) { + while (!$stream->eof()) { + $buf = $stream->read(1048576); + if ($buf === '') { + break; + } + $buffer .= $buf; + } + + return $buffer; + } + + $len = 0; + while (!$stream->eof() && $len < $maxLen) { + $buf = $stream->read($maxLen - $len); + if ($buf === '') { + break; + } + $buffer .= $buf; + $len = strlen($buffer); + } + + return $buffer; + } + + /** + * Calculate a hash of a stream. + * + * This method reads the entire stream to calculate a rolling hash, based + * on PHP's `hash_init` functions. + * + * @param StreamInterface $stream Stream to calculate the hash for + * @param string $algo Hash algorithm (e.g. md5, crc32, etc) + * @param bool $rawOutput Whether or not to use raw output + * + * @throws \RuntimeException on error. + */ + public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string + { + $pos = $stream->tell(); + + if ($pos > 0) { + $stream->rewind(); + } + + $ctx = hash_init($algo); + while (!$stream->eof()) { + hash_update($ctx, $stream->read(1048576)); + } + + $out = hash_final($ctx, $rawOutput); + $stream->seek($pos); + + return $out; + } + + /** + * Clone and modify a request with the given changes. + * + * This method is useful for reducing the number of clones needed to mutate + * a message. + * + * The changes can be one of: + * - method: (string) Changes the HTTP method. + * - set_headers: (array) Sets the given headers. + * - remove_headers: (array) Remove the given headers. + * - body: (mixed) Sets the given body. + * - uri: (UriInterface) Set the URI. + * - query: (string) Set the query string value of the URI. + * - version: (string) Set the protocol version. + * + * @param RequestInterface $request Request to clone and modify. + * @param array $changes Changes to apply. + */ + public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface + { + if (!$changes) { + return $request; + } + + $headers = $request->getHeaders(); + + if (!isset($changes['uri'])) { + $uri = $request->getUri(); + } else { + // Remove the host header if one is on the URI + if ($host = $changes['uri']->getHost()) { + $changes['set_headers']['Host'] = $host; + + if ($port = $changes['uri']->getPort()) { + $standardPorts = ['http' => 80, 'https' => 443]; + $scheme = $changes['uri']->getScheme(); + if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { + $changes['set_headers']['Host'] .= ':'.$port; + } + } + } + $uri = $changes['uri']; + } + + if (!empty($changes['remove_headers'])) { + $headers = self::caselessRemove($changes['remove_headers'], $headers); + } + + if (!empty($changes['set_headers'])) { + $headers = self::caselessRemove(array_keys($changes['set_headers']), $headers); + $headers = $changes['set_headers'] + $headers; + } + + if (isset($changes['query'])) { + $uri = $uri->withQuery($changes['query']); + } + + if ($request instanceof ServerRequestInterface) { + $new = (new ServerRequest( + $changes['method'] ?? $request->getMethod(), + $uri, + $headers, + $changes['body'] ?? $request->getBody(), + $changes['version'] ?? $request->getProtocolVersion(), + $request->getServerParams() + )) + ->withParsedBody($request->getParsedBody()) + ->withQueryParams($request->getQueryParams()) + ->withCookieParams($request->getCookieParams()) + ->withUploadedFiles($request->getUploadedFiles()); + + foreach ($request->getAttributes() as $key => $value) { + $new = $new->withAttribute($key, $value); + } + + return $new; + } + + return new Request( + $changes['method'] ?? $request->getMethod(), + $uri, + $headers, + $changes['body'] ?? $request->getBody(), + $changes['version'] ?? $request->getProtocolVersion() + ); + } + + /** + * Read a line from the stream up to the maximum allowed buffer length. + * + * @param StreamInterface $stream Stream to read from + * @param int|null $maxLength Maximum buffer length + */ + public static function readLine(StreamInterface $stream, int $maxLength = null): string + { + $buffer = ''; + $size = 0; + + while (!$stream->eof()) { + if ('' === ($byte = $stream->read(1))) { + return $buffer; + } + $buffer .= $byte; + // Break when a new line is found or the max length - 1 is reached + if ($byte === "\n" || ++$size === $maxLength - 1) { + break; + } + } + + return $buffer; + } + + /** + * Create a new stream based on the input type. + * + * Options is an associative array that can contain the following keys: + * - metadata: Array of custom metadata. + * - size: Size of the stream. + * + * This method accepts the following `$resource` types: + * - `Psr\Http\Message\StreamInterface`: Returns the value as-is. + * - `string`: Creates a stream object that uses the given string as the contents. + * - `resource`: Creates a stream object that wraps the given PHP stream resource. + * - `Iterator`: If the provided value implements `Iterator`, then a read-only + * stream object will be created that wraps the given iterable. Each time the + * stream is read from, data from the iterator will fill a buffer and will be + * continuously called until the buffer is equal to the requested read size. + * Subsequent read calls will first read from the buffer and then call `next` + * on the underlying iterator until it is exhausted. + * - `object` with `__toString()`: If the object has the `__toString()` method, + * the object will be cast to a string and then a stream will be returned that + * uses the string value. + * - `NULL`: When `null` is passed, an empty stream object is returned. + * - `callable` When a callable is passed, a read-only stream object will be + * created that invokes the given callable. The callable is invoked with the + * number of suggested bytes to read. The callable can return any number of + * bytes, but MUST return `false` when there is no more data to return. The + * stream object that wraps the callable will invoke the callable until the + * number of requested bytes are available. Any additional bytes will be + * buffered and used in subsequent reads. + * + * @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data + * @param array{size?: int, metadata?: array} $options Additional options + * + * @throws \InvalidArgumentException if the $resource arg is not valid. + */ + public static function streamFor($resource = '', array $options = []): StreamInterface + { + if (is_scalar($resource)) { + $stream = self::tryFopen('php://temp', 'r+'); + if ($resource !== '') { + fwrite($stream, (string) $resource); + fseek($stream, 0); + } + + return new Stream($stream, $options); + } + + switch (gettype($resource)) { + case 'resource': + /* + * The 'php://input' is a special stream with quirks and inconsistencies. + * We avoid using that stream by reading it into php://temp + */ + + /** @var resource $resource */ + if ((\stream_get_meta_data($resource)['uri'] ?? '') === 'php://input') { + $stream = self::tryFopen('php://temp', 'w+'); + stream_copy_to_stream($resource, $stream); + fseek($stream, 0); + $resource = $stream; + } + + return new Stream($resource, $options); + case 'object': + /** @var object $resource */ + if ($resource instanceof StreamInterface) { + return $resource; + } elseif ($resource instanceof \Iterator) { + return new PumpStream(function () use ($resource) { + if (!$resource->valid()) { + return false; + } + $result = $resource->current(); + $resource->next(); + + return $result; + }, $options); + } elseif (method_exists($resource, '__toString')) { + return self::streamFor((string) $resource, $options); + } + break; + case 'NULL': + return new Stream(self::tryFopen('php://temp', 'r+'), $options); + } + + if (is_callable($resource)) { + return new PumpStream($resource, $options); + } + + throw new \InvalidArgumentException('Invalid resource type: '.gettype($resource)); + } + + /** + * Safely opens a PHP stream resource using a filename. + * + * When fopen fails, PHP normally raises a warning. This function adds an + * error handler that checks for errors and throws an exception instead. + * + * @param string $filename File to open + * @param string $mode Mode used to open the file + * + * @return resource + * + * @throws \RuntimeException if the file cannot be opened + */ + public static function tryFopen(string $filename, string $mode) + { + $ex = null; + set_error_handler(static function (int $errno, string $errstr) use ($filename, $mode, &$ex): bool { + $ex = new \RuntimeException(sprintf( + 'Unable to open "%s" using mode "%s": %s', + $filename, + $mode, + $errstr + )); + + return true; + }); + + try { + /** @var resource $handle */ + $handle = fopen($filename, $mode); + } catch (\Throwable $e) { + $ex = new \RuntimeException(sprintf( + 'Unable to open "%s" using mode "%s": %s', + $filename, + $mode, + $e->getMessage() + ), 0, $e); + } + + restore_error_handler(); + + if ($ex) { + /** @var $ex \RuntimeException */ + throw $ex; + } + + return $handle; + } + + /** + * Safely gets the contents of a given stream. + * + * When stream_get_contents fails, PHP normally raises a warning. This + * function adds an error handler that checks for errors and throws an + * exception instead. + * + * @param resource $stream + * + * @throws \RuntimeException if the stream cannot be read + */ + public static function tryGetContents($stream): string + { + $ex = null; + set_error_handler(static function (int $errno, string $errstr) use (&$ex): bool { + $ex = new \RuntimeException(sprintf( + 'Unable to read stream contents: %s', + $errstr + )); + + return true; + }); + + try { + /** @var string|false $contents */ + $contents = stream_get_contents($stream); + + if ($contents === false) { + $ex = new \RuntimeException('Unable to read stream contents'); + } + } catch (\Throwable $e) { + $ex = new \RuntimeException(sprintf( + 'Unable to read stream contents: %s', + $e->getMessage() + ), 0, $e); + } + + restore_error_handler(); + + if ($ex) { + /** @var $ex \RuntimeException */ + throw $ex; + } + + return $contents; + } + + /** + * Returns a UriInterface for the given value. + * + * This function accepts a string or UriInterface and returns a + * UriInterface for the given value. If the value is already a + * UriInterface, it is returned as-is. + * + * @param string|UriInterface $uri + * + * @throws \InvalidArgumentException + */ + public static function uriFor($uri): UriInterface + { + if ($uri instanceof UriInterface) { + return $uri; + } + + if (is_string($uri)) { + return new Uri($uri); + } + + throw new \InvalidArgumentException('URI must be a string or UriInterface'); + } +} diff --git a/vendor/jonahgeorge/jaeger-client-php/.editorconfig b/vendor/jonahgeorge/jaeger-client-php/.editorconfig deleted file mode 100644 index 1492202b4..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/.editorconfig +++ /dev/null @@ -1,16 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -indent_style = space -indent_size = 4 -trim_trailing_whitespace = true - -[*.md] -trim_trailing_whitespace = false - -[*.yml] -indent_style = space -indent_size = 2 diff --git a/vendor/jonahgeorge/jaeger-client-php/.github/workflows/main.yaml b/vendor/jonahgeorge/jaeger-client-php/.github/workflows/main.yaml deleted file mode 100644 index d0e5dc1f5..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/.github/workflows/main.yaml +++ /dev/null @@ -1,44 +0,0 @@ -name: Test - -on: [push, pull_request] - -jobs: - run: - runs-on: ubuntu-latest - strategy: - matrix: - php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] - name: PHP ${{ matrix.php-versions }} - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - coverage: xdebug - - - name: Get composer cache directory - id: composercache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.composercache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install dependencies - run: | - composer install \ - --no-interaction \ - --no-ansi \ - --no-progress - - - name: Run lint - run: composer lint - - - name: Run test - run: composer test diff --git a/vendor/jonahgeorge/jaeger-client-php/.gitignore b/vendor/jonahgeorge/jaeger-client-php/.gitignore deleted file mode 100644 index 07dc555db..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -# Please do not use this ignore file to define platform specific files. -# -# For these purposes create a global .gitignore file, which is a list of rules -# for ignoring files in every Git repository on your computer. -# -# https://help.github.com/articles/ignoring-files/#create-a-global-gitignore - -jaeger-idl -vendor - -composer.lock -composer.phar - -jaeger-client-php.iml - -phpunit.xml -phpcs.xml diff --git a/vendor/jonahgeorge/jaeger-client-php/CONTRIBUTING.md b/vendor/jonahgeorge/jaeger-client-php/CONTRIBUTING.md deleted file mode 100644 index e5ec5ed4f..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/CONTRIBUTING.md +++ /dev/null @@ -1,3 +0,0 @@ -# How to Contribute to Jaeger - -We'd love your help! diff --git a/vendor/jonahgeorge/jaeger-client-php/LICENSE b/vendor/jonahgeorge/jaeger-client-php/LICENSE deleted file mode 100644 index 8e37af0cb..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Jonah George, José Carlos Chávez - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/jonahgeorge/jaeger-client-php/README.md b/vendor/jonahgeorge/jaeger-client-php/README.md deleted file mode 100644 index 6396bb70f..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/README.md +++ /dev/null @@ -1,219 +0,0 @@ -![Build Status](https://github.com/jonahgeorge/jaeger-client-php/workflows/Test/badge.svg) [![PHP version][packagist-img]][packagist] - -# Jaeger Bindings for PHP OpenTracing API - -This is a client-side library that can be used to instrument PHP apps for distributed trace collection, -and to send those traces to Jaeger. See the [OpenTracing PHP API](https://github.com/opentracing/opentracing-php) -for additional detail. - -## Contributing and Developing - -Please see [CONTRIBUTING.md](./CONTRIBUTING.md). - -## Installation - -Jaeger client can be installed via Composer: - -```bash -composer require jonahgeorge/jaeger-client-php -``` - -## Getting Started - -```php - [ - 'type' => Jaeger\SAMPLER_TYPE_CONST, - 'param' => true, - ], - 'logging' => true, - ], - 'your-app-name' -); -$config->initializeTracer(); - -$tracer = GlobalTracer::get(); - -$scope = $tracer->startActiveSpan('TestSpan', []); -$scope->close(); - -$tracer->flush(); -``` - -### Samplers - -List of supported samplers, for more info about samplers, please read [Jaeger Sampling](https://www.jaegertracing.io/docs/1.9/sampling/) guide. - -#### Const sampler -This sampler either samples everything, or nothing. - -##### Configuration -``` -'sampler' => [ - 'type' => Jaeger\SAMPLER_TYPE_CONST, - 'param' => true, // boolean wheter to trace or not -], -``` - -#### Probabilistic sampler -This sampler samples request by given rate. - -##### Configuration -``` -'sampler' => [ - 'type' => Jaeger\SAMPLER_TYPE_PROBABILISTIC, - 'param' => 0.5, // float [0.0, 1.0] -], -``` - -#### Rate limiting sampler -Samples maximum specified number of traces (requests) per second. - -##### Requirements -* `psr/cache` PSR-6 cache component to store and retrieve sampler state between requests. -Cache component is passed to `Jaeger\Config` trough its constructor. -* `hrtime()` function, that can retrieve time in nanoseconds. You need either `php 7.3` or [PECL/hrtime](http://pecl.php.net/package/hrtime) extension. - -##### Configuration -``` -'sampler' => [ - 'type' => Jaeger\SAMPLER_TYPE_RATE_LIMITING, - 'param' => 100 // integer maximum number of traces per second, - 'cache' => [ - 'currentBalanceKey' => 'rate.currentBalance' // string - 'lastTickKey' => 'rate.lastTick' // string - ] -], -``` -## Dispatch mode - -The library supports 3 ways of sending data to Jaeger Agent: - -1. `Zipkin.thrift` over Compact protocol (socket - UDP) - default -2. `Jaeger.thrift` over Binary protocol (socket - UDP) -2. `Jaeger.thrift` over Binary protocol (HTTP) - -If you want to enable "`Jaeger.thrift` over Binary protocol" one or other, than -you need to set `dispatch_mode` config option or `JAEGER_DISPATCH_MODE` env -variable. - -Allowed values for `dispatch_mode` are: -- `jaeger_over_binary_udp` -- `jaeger_over_binary_http` -- `zipkin_over_compact_udp` - -There are 3 constants available, so it is better to use them: -```php -class Config -{ - const ZIPKIN_OVER_COMPACT_UDP = "zipkin_over_compact_udp"; - const JAEGER_OVER_BINARY_UDP = "jaeger_over_binary_udp"; - const JAEGER_OVER_BINARY_HTTP = "jaeger_over_binary_http"; - ... -} -``` - -A possible config with custom `dispatch_mode` can look like this: -```php -// config.php - -use Jaeger\Config; - -return [ - 'sampler' => [ - 'type' => Jaeger\SAMPLER_TYPE_CONST, - 'param' => true, - ], - 'logging' => true, - "tags" => [ - // process. prefix works only with JAEGER_OVER_HTTP, JAEGER_OVER_BINARY - // otherwise it will be shown as simple global tag - "process.process-tag-key-1" => "process-value-1", // all tags with `process.` prefix goes to process section - "process.process-tag-key-2" => "process-value-2", // all tags with `process.` prefix goes to process section - "global-tag-key-1" => "global-tag-value-1", // this tag will be appended to all spans - "global-tag-key-2" => "global-tag-value-2", // this tag will be appended to all spans - ], - "local_agent" => [ - "reporting_host" => "localhost", -// You can override port by setting local_agent.reporting_port value - "reporting_port" => 6832 - ], -// Different ways to send data to Jaeger. Config::ZIPKIN_OVER_COMPACT - default): - 'dispatch_mode' => Config::JAEGER_OVER_BINARY_UDP, -]; -``` -The full example you can see at `examples` directory. - -By default, for each `dispatch_mode` there is default `reporting_port` config value. Table with -default values you can see below: - -`dispatch_mode` | default `reporting_port` ------------------------- | ---------------- -ZIPKIN_OVER_COMPACT_UDP | 5775 -JAEGER_OVER_BINARY_UDP | 6832 -JAEGER_OVER_BINARY_HTTP | 14268 - -## IPv6 - -In case you need IPv6 support you need to set `ip_version` Config variable. -By default, IPv4 is used. There is an alias `Config::IP_VERSION` which you can use -as an alternative to raw `ip_version`. - -Example: - -```php -use Jaeger\Config; - -$config = new Config( - [ - "ip_version" => Config::IPV6, // <-- or use Config::IP_VERSION constant - 'logging' => true, - 'dispatch_mode' => Config::JAEGER_OVER_BINARY_UDP, - ], - 'serviceNameExample', -); -$config->initializeTracer(); -``` -or - -```php -use Jaeger\Config; - -$config = new Config( - [ - Config::IP_VERSION => Config::IPV6, // <-- - 'logging' => true, - 'dispatch_mode' => Config::JAEGER_OVER_BINARY_UDP, - ], - 'serviceNameExample', -); -$config->initializeTracer(); -``` - - -## Testing - -Tests are located in the `tests` directory. See [tests/README.md](./tests/README.md). - -## Roadmap - -- [Support Span baggage](https://github.com/jonahgeorge/jaeger-client-php/issues/5) -- [Support Tracer metrics](https://github.com/jonahgeorge/jaeger-client-php/issues/12) -- [Support Tracer error reporting](https://github.com/jonahgeorge/jaeger-client-php/issues/13) - -## License - -[MIT License](./LICENSE). - -[ci-img]: https://travis-ci.org/jonahgeorge/jaeger-client-php.svg?branch=travis -[ci]: https://travis-ci.org/jonahgeorge/jaeger-client-php -[packagist-img]: https://badge.fury.io/ph/jonahgeorge%2Fjaeger-client-php.svg -[packagist]: https://badge.fury.io/ph/jonahgeorge%2Fjaeger-client-php diff --git a/vendor/jonahgeorge/jaeger-client-php/build/.gitignore b/vendor/jonahgeorge/jaeger-client-php/build/.gitignore deleted file mode 100644 index d6b7ef32c..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/build/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/vendor/jonahgeorge/jaeger-client-php/composer.json b/vendor/jonahgeorge/jaeger-client-php/composer.json deleted file mode 100644 index a9bb99a06..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/composer.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "jonahgeorge/jaeger-client-php", - "description": "Jaeger Bindings for PHP OpenTracing API", - "keywords": [ - "jaeger", - "opentracing", - "trace", - "tracing" - ], - "license": "MIT", - "authors": [ - { - "name": "Jonah George", - "homepage": "http://twitter.com/jonahgeorge" - }, - { - "name": "José Carlos Chávez", - "email": "jcchavezs@gmail.com" - }, - { - "name": "Contributors", - "homepage": "https://github.com/jonahgeorge/jaeger-client-php/graphs/contributors" - } - ], - "require": { - "php": "^7.1 || ^8.0 || ^8.1", - "ext-sockets": "*", - "opentracing/opentracing": "^1.0", - "packaged/thrift": "^0.13", - "psr/cache": "^1.0 || ^2.0 || ^3.0", - "psr/log": "^1.0 || ^2.0 || ^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^7 || ^8 || ^9", - "squizlabs/php_codesniffer": "3.*", - "cache/array-adapter": "^1.0", - "symfony/polyfill-php73": "^1.10" - }, - "config": { - "optimize-autoloader": true, - "preferred-install": "dist", - "sort-packages": true - }, - "autoload": { - "psr-4": { - "Jaeger\\": "src/Jaeger/" - }, - "files": [ - "./src/Jaeger/Constants.php" - ] - }, - "autoload-dev": { - "Jaeger\\Tests\\": "tests/Jaeger/" - }, - "minimum-stability": "dev", - "prefer-stable": true, - "scripts": { - "fix-lint": "./vendor/bin/phpcbf", - "lint": "./vendor/bin/phpcs", - "test": "./vendor/bin/phpunit" - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/examples/config.php b/vendor/jonahgeorge/jaeger-client-php/examples/config.php deleted file mode 100644 index 5c4726165..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/examples/config.php +++ /dev/null @@ -1,26 +0,0 @@ - [ - 'type' => Jaeger\SAMPLER_TYPE_CONST, - 'param' => true, - ], - 'logging' => true, - "tags" => [ - // process. prefix works only with JAEGER_OVER_HTTP, JAEGER_OVER_BINARY - // otherwise it will be shown as simple global tag - "process.process-tag-key-1" => "process-value-1", // all tags with `process.` prefix goes to process section - "process.process-tag-key-2" => "process-value-2", // all tags with `process.` prefix goes to process section - "global-tag-key-1" => "global-tag-value-1", // this tag will be appended to all spans - "global-tag-key-2" => "global-tag-value-2", // this tag will be appended to all spans - ], - "local_agent" => [ - "reporting_host" => "localhost", -// You can override port by setting local_agent.reporting_port value -// "reporting_port" => 6832 - ], -// Different ways to send data to Jaeger. Config::ZIPKIN_OVER_COMPACT - default): - 'dispatch_mode' => Config::JAEGER_OVER_BINARY_UDP, -]; diff --git a/vendor/jonahgeorge/jaeger-client-php/examples/jaeger.php b/vendor/jonahgeorge/jaeger-client-php/examples/jaeger.php deleted file mode 100644 index ed9304fe2..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/examples/jaeger.php +++ /dev/null @@ -1,51 +0,0 @@ -initializeTracer(); - -$tracer = GlobalTracer::get(); - -$scope = $tracer->startActiveSpan('JaegerSpan', []); -$scope->getSpan()->setTag("tag1", "value1"); -$scope->getSpan()->setTag("tag2", "value2"); -$scope->getSpan()->setTag("tag3", "value2"); -$scope->getSpan()->log([ - "key1" => "value1", - "key2" => 2, - "key3" => true -]); - -$scope->getSpan()->addBaggageItem("baggage-item1", "baggage-value1"); -$scope->getSpan()->addBaggageItem("baggage-item2", "baggage-value2"); -$scope->getSpan()->addBaggageItem("baggage-item3", "baggage-value3"); - - $nestedSpanScope = $tracer->startActiveSpan("Nested1"); - $nestedSpanScope->getSpan()->setTag("tag1", "value1"); - $nestedSpanScope->getSpan()->setTag("tag2", "value2"); - $nestedSpanScope->getSpan()->setTag("tag3", "value2"); - $nestedSpanScope->getSpan()->log([ - "key1" => "value1", - "key2" => 2, - "key3" => true - ]); - - $nestedSpanScope->getSpan()->addBaggageItem("baggage-item1", "baggage-value1"); - $nestedSpanScope->getSpan()->addBaggageItem("baggage-item2", "baggage-value2"); - $nestedSpanScope->getSpan()->addBaggageItem("baggage-item3", "baggage-value3"); - - sleep(1); - - $nestedSpanScope->close(); - -sleep(1); -$scope->close(); -$tracer->flush(); diff --git a/vendor/jonahgeorge/jaeger-client-php/phpcs.xml.dist b/vendor/jonahgeorge/jaeger-client-php/phpcs.xml.dist deleted file mode 100644 index 7d5db0974..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/phpcs.xml.dist +++ /dev/null @@ -1,37 +0,0 @@ - - - - - The coding standard for Jaeger Client - - - - - - - - - - - - src - - - src/Jaeger/Thrift/* - diff --git a/vendor/jonahgeorge/jaeger-client-php/phpunit.xml.dist b/vendor/jonahgeorge/jaeger-client-php/phpunit.xml.dist deleted file mode 100644 index d6795d99b..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/phpunit.xml.dist +++ /dev/null @@ -1,47 +0,0 @@ - - - - - src/Jaeger - - src/ - src/Jaeger/Constants.php - src/Jaeger/Thrift/Agent/AgentIf.php - src/Jaeger/Thrift/Agent/AggregationValidatorIf.php - src/Jaeger/Thrift/Agent/BaggageRestrictionManagerIf.php - src/Jaeger/Thrift/Agent/DependencyIf.php - src/Jaeger/Thrift/Agent/SamplingManagerIf.php - src/Jaeger/Thrift/CollectorIf.php - src/Jaeger/Thrift/Crossdock/TracedServiceIf.php - - - - - - - tests/Jaeger - - - - - - - - - - - - - - - diff --git a/vendor/jonahgeorge/jaeger-client-php/scripts/thrift-gen.sh b/vendor/jonahgeorge/jaeger-client-php/scripts/thrift-gen.sh deleted file mode 100644 index 7420f915f..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/scripts/thrift-gen.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -set -e - -cd "$(dirname "$0")/.." - -# checkout jaeger thrift files -rm -rf jaeger-idl -git clone https://github.com/jaegertracing/jaeger-idl - -# define thrift cmd -THRIFT="docker run -u $(id -u) -v '${PWD}:/data' thrift:0.11.0 thrift -o /data/jaeger-idl" -THRIFT_CMD="${THRIFT} --gen php:psr4,oop" - -# generate php files -FILES=$(find jaeger-idl/thrift -type f -name \*.thrift) -for f in ${FILES}; do - echo "${THRIFT_CMD} "/data/${f}"" - eval $THRIFT_CMD "/data/${f}" -done - -# move generated files -rm -rf src/Jaeger/Thrift -mv jaeger-idl/gen-php/Jaeger/Thrift src/Jaeger/Thrift - -# remove thrift files -rm -rf jaeger-idl diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/AgentClient/HttpAgentClient.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/AgentClient/HttpAgentClient.php deleted file mode 100644 index e270b76ac..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/AgentClient/HttpAgentClient.php +++ /dev/null @@ -1,27 +0,0 @@ -input_ = $input; - $this->output_ = $output ? $output : $input; - } - - public function emitZipkinBatch(array $spans) - { - } - - public function emitBatch(\Jaeger\Thrift\Batch $batch) - { - $batch->write($this->output_); - $this->output_->getTransport()->flush(); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/BinaryCodec.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/BinaryCodec.php deleted file mode 100644 index 36c2ffe2c..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/BinaryCodec.php +++ /dev/null @@ -1,39 +0,0 @@ -urlEncoding = $urlEncoding; - $this->traceIdHeader = str_replace('_', '-', strtolower($traceIdHeader)); - $this->baggagePrefix = str_replace('_', '-', strtolower($baggageHeaderPrefix)); - $this->debugIdHeader = str_replace('_', '-', strtolower($debugIdHeader)); - $this->prefixLength = strlen($baggageHeaderPrefix); - } - - /** - * {@inheritdoc} - * - * @see \Jaeger\Tracer::inject - * - * @param SpanContext $spanContext - * @param mixed $carrier - * - * @return void - */ - public function inject(SpanContext $spanContext, &$carrier) - { - $carrier[$this->traceIdHeader] = $this->spanContextToString( - $spanContext->getTraceId(), - $spanContext->getSpanId(), - $spanContext->getParentId(), - $spanContext->getFlags() - ); - - $baggage = $spanContext->getBaggage(); - if (empty($baggage)) { - return; - } - - foreach ($baggage as $key => $value) { - $encodedValue = $value; - - if ($this->urlEncoding) { - $encodedValue = urlencode($value); - } - - $carrier[$this->baggagePrefix . $key] = $encodedValue; - } - } - - /** - * {@inheritdoc} - * - * @see \Jaeger\Tracer::extract - * - * @param mixed $carrier - * @return SpanContext|null - * - * @throws Exception - */ - public function extract($carrier) - { - $traceId = null; - $spanId = null; - $parentId = null; - $flags = null; - $baggage = null; - $debugId = null; - - foreach ($carrier as $key => $value) { - $ucKey = strtolower($key); - - if ($ucKey === $this->traceIdHeader) { - if ($this->urlEncoding) { - $value = urldecode($value); - } - list($traceId, $spanId, $parentId, $flags) = - $this->spanContextFromString($value); - } elseif ($this->startsWith($ucKey, $this->baggagePrefix)) { - if ($this->urlEncoding) { - $value = urldecode($value); - } - $attrKey = substr($key, $this->prefixLength); - if ($baggage === null) { - $baggage = [strtolower($attrKey) => $value]; - } else { - $baggage[strtolower($attrKey)] = $value; - } - } elseif ($ucKey === $this->debugIdHeader) { - if ($this->urlEncoding) { - $value = urldecode($value); - } - $debugId = $value; - } - } - - if ($traceId === null && $baggage !== null) { - throw new Exception('baggage without trace ctx'); - } - - if ($traceId === null) { - if ($debugId !== null) { - return new SpanContext(null, null, null, null, [], $debugId); - } - return null; - } - - return new SpanContext($traceId, $spanId, $parentId, $flags, $baggage); - } - - /** - * Store a span context to a string. - * - * @param int $traceId - * @param int $spanId - * @param int $parentId - * @param int $flags - * @return string - */ - private function spanContextToString($traceId, $spanId, $parentId, $flags) - { - $parentId = $parentId ?? 0; - return sprintf('%x:%x:%x:%x', $traceId, $spanId, $parentId, $flags); - } - - /** - * Create a span context from a string. - * - * @param string $value - * @return array - * - * @throws Exception - */ - private function spanContextFromString($value): array - { - $parts = explode(':', $value); - - if (count($parts) != 4) { - throw new Exception('Malformed tracer state string.'); - } - - return [ - CodecUtility::hexToInt64($parts[0]), - CodecUtility::hexToInt64($parts[1]), - CodecUtility::hexToInt64($parts[2]), - $parts[3], - ]; - } - - /** - * Checks that a string ($haystack) starts with a given prefix ($needle). - * - * @param string $haystack - * @param string $needle - * @return bool - */ - private function startsWith(string $haystack, string $needle): bool - { - return substr($haystack, 0, strlen($needle)) == $needle; - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/ZipkinCodec.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/ZipkinCodec.php deleted file mode 100644 index 1ea5d7c0b..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/ZipkinCodec.php +++ /dev/null @@ -1,85 +0,0 @@ -getTraceId()); - $carrier[self::SPAN_ID_NAME] = dechex($spanContext->getSpanId()); - if ($spanContext->getParentId() != null) { - $carrier[self::PARENT_ID_NAME] = dechex($spanContext->getParentId()); - } - $carrier[self::FLAGS_NAME] = (int) $spanContext->getFlags(); - } - - /** - * {@inheritdoc} - * - * @see \Jaeger\Tracer::extract - * - * @param mixed $carrier - * @return SpanContext|null - */ - public function extract($carrier) - { - $traceId = "0"; - $spanId = "0"; - $parentId = "0"; - $flags = 0; - - if (isset($carrier[strtolower(self::SAMPLED_NAME)])) { - if ($carrier[strtolower(self::SAMPLED_NAME)] === "1" || - strtolower($carrier[strtolower(self::SAMPLED_NAME)] === "true") - ) { - $flags = $flags | SAMPLED_FLAG; - } - } - - if (isset($carrier[strtolower(self::TRACE_ID_NAME)])) { - $traceId = CodecUtility::hexToInt64($carrier[strtolower(self::TRACE_ID_NAME)], 16, 10); - } - - if (isset($carrier[strtolower(self::PARENT_ID_NAME)])) { - $parentId = CodecUtility::hexToInt64($carrier[strtolower(self::PARENT_ID_NAME)], 16, 10); - } - - if (isset($carrier[strtolower(self::SPAN_ID_NAME)])) { - $spanId = CodecUtility::hexToInt64($carrier[strtolower(self::SPAN_ID_NAME)], 16, 10); - } - - if (isset($carrier[strtolower(self::FLAGS_NAME)])) { - if ($carrier[strtolower(self::FLAGS_NAME)] === "1") { - $flags = $flags | DEBUG_FLAG; - } - } - - if ($traceId != "0" && $spanId != "0") { - return new SpanContext($traceId, $spanId, $parentId, $flags); - } - - return null; - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Config.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Config.php deleted file mode 100644 index 28fb972da..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Config.php +++ /dev/null @@ -1,390 +0,0 @@ -logger; - } - - /** - * @var CacheItemPoolInterface - */ - private $cache; - - /** - * Config constructor. - * @param array $config - * @param string|null $serviceName - * @param LoggerInterface|null $logger - * @param CacheItemPoolInterface|null $cache - * @throws Exception - */ - public function __construct( - array $config, - string $serviceName = null, - LoggerInterface $logger = null, - CacheItemPoolInterface $cache = null - ) { - $this->config = $config; - - $this->setConfigFromEnv(); - - if (empty($this->config["dispatch_mode"])) { - $this->config["dispatch_mode"] = self::ZIPKIN_OVER_COMPACT_UDP; - } - - if (empty($this->config[Config::IP_VERSION])) { - $this->config[Config::IP_VERSION] = self::IPV4; - } - - $this->serviceName = $this->config['service_name'] ?? $serviceName; - - if ($this->serviceName === null) { - throw new Exception('service_name required in the config or param.'); - } - - $this->logger = $logger ?: new NullLogger(); - $this->cache = $cache; - } - - /** - * @return Tracer|null - * @throws Exception - */ - public function initializeTracer() - { - if ($this->initialized) { - $this->logger->warning('Jaeger tracer already initialized, skipping'); - return null; - } - - $reporter = $this->getReporter(); - $sampler = $this->getSampler(); - - - $tracer = $this->createTracer($reporter, $sampler); - - $this->initializeGlobalTracer($tracer); - - return $tracer; - } - - /** - * @param ReporterInterface $reporter - * @param SamplerInterface $sampler - * @return Tracer - */ - public function createTracer(ReporterInterface $reporter, SamplerInterface $sampler): Tracer - { - return new Tracer( - $this->serviceName, - $reporter, - $sampler, - $this->shouldUseOneSpanPerRpc(), - $this->logger, - null, - $this->getTraceIdHeader(), - $this->getBaggageHeaderPrefix(), - $this->getDebugIdHeaderKey(), - $this->getConfiguredTags() - ); - } - - /** - * @return string - */ - public function getServiceName(): string - { - return $this->serviceName; - } - - /** - * @param Tracer $tracer - */ - private function initializeGlobalTracer(Tracer $tracer) - { - GlobalTracer::set($tracer); - $this->logger->debug('OpenTracing\GlobalTracer initialized to ' . $tracer->getServiceName()); - } - - /** - * @return bool - */ - private function getLogging(): bool - { - return (bool)($this->config['logging'] ?? false); - } - - /** - * @return ReporterInterface - */ - private function getReporter(): ReporterInterface - { - switch ($this->config["dispatch_mode"]) { - case self::JAEGER_OVER_BINARY_UDP: - $reporter = (new JaegerReporterFactory($this))->createReporter(); - break; - case self::ZIPKIN_OVER_COMPACT_UDP: - $reporter = (new ZipkinReporterFactory($this))->createReporter(); - break; - case self::JAEGER_OVER_BINARY_HTTP: - $reporter = (new JaegerHttpReporterFactory($this))->createReporter(); - break; - default: - throw new \RuntimeException( - sprintf( - "Unsupported `dispatch_mode` value: %s. Allowed values are: %s", - $this->config["dispatch_mode"], - implode(", ", Config::getAvailableDispatchModes()) - ) - ); - } - - if ($this->getLogging()) { - $reporter = new CompositeReporter($reporter, new LoggingReporter($this->logger)); - } - - return $reporter; - } - - /** - * @return SamplerInterface - * @throws \Psr\Cache\InvalidArgumentException - * @throws Exception - */ - private function getSampler(): SamplerInterface - { - $samplerConfig = $this->config['sampler'] ?? []; - $samplerType = $samplerConfig['type'] ?? null; - $samplerParam = $samplerConfig['param'] ?? null; - - if ($samplerType === null || $samplerType === SAMPLER_TYPE_REMOTE) { - // todo: implement remote sampling - return new ProbabilisticSampler((float)$samplerParam); - } elseif ($samplerType === SAMPLER_TYPE_CONST) { - return new ConstSampler($samplerParam ?? false); - } elseif ($samplerType === SAMPLER_TYPE_PROBABILISTIC) { - return new ProbabilisticSampler((float)$samplerParam); - } elseif ($samplerType === SAMPLER_TYPE_RATE_LIMITING) { - if (!$this->cache) { - throw new Exception('You cannot use RateLimitingSampler without cache component'); - } - $cacheConfig = $samplerConfig['cache'] ?? []; - return new RateLimitingSampler( - $samplerParam ?? 0, - new RateLimiter( - $this->cache, - $cacheConfig['currentBalanceKey'] ?? 'rate.currentBalance', - $cacheConfig['lastTickKey'] ?? 'rate.lastTick' - ) - ); - } - throw new Exception('Unknown sampler type ' . $samplerType); - } - - /** - * The UDP max buffer length. - * - * @return int - */ - public function getMaxBufferLength(): int - { - return (int)($this->config['max_buffer_length'] ?? 64000); - } - - /** - * @return string - */ - public function getLocalAgentReportingHost(): string - { - return $this->getLocalAgentGroup()['reporting_host'] ?? DEFAULT_REPORTING_HOST; - } - - /** - * @return int - */ - public function getLocalAgentReportingPort(): int - { - $port = $this->getLocalAgentGroup()['reporting_port'] ?? null; - if (empty($this->getLocalAgentGroup()['reporting_port'])) { - switch ($this->config['dispatch_mode']) { - case self::JAEGER_OVER_BINARY_UDP: - $port = DEFAULT_JAEGER_UDP_BINARY_REPORTING_PORT; - break; - case self::JAEGER_OVER_BINARY_HTTP: - $port = DEFAULT_JAEGER_HTTP_BINARY_REPORTING_PORT; - break; - default: - $port = DEFAULT_ZIPKIN_UDP_COMPACT_REPORTING_PORT; - } - } - return (int)$port; - } - - /** - * @return array - */ - private function getLocalAgentGroup(): array - { - return $this->config['local_agent'] ?? []; - } - - /** - * @return string - */ - private function getTraceIdHeader(): string - { - return $this->config['trace_id_header'] ?? TRACE_ID_HEADER; - } - - /** - * @return string - */ - private function getBaggageHeaderPrefix(): string - { - return $this->config['baggage_header_prefix'] ?? BAGGAGE_HEADER_PREFIX; - } - - /** - * @return string - */ - private function getDebugIdHeaderKey(): string - { - return $this->config['debug_id_header_key'] ?? DEBUG_ID_HEADER_KEY; - } - - /** - * Get a list of user-defined tags to be added to each span created by the tracer initialized by this config. - * @return string[] - */ - private function getConfiguredTags(): array - { - return $this->config['tags'] ?? []; - } - - /** - * Whether to follow the Zipkin model of using one span per RPC, - * as opposed to the model of using separate spans on the RPC client and server. - * Defaults to true. - * - * @return bool - */ - private function shouldUseOneSpanPerRpc(): bool - { - return $this->config['one_span_per_rpc'] ?? true; - } - - public function ipProtocolVersion(): string - { - return $this->config[self::IP_VERSION] ?? self::IPV4; - } - - /** - * Sets values from env vars into config props, unless ones has been already set. - */ - private function setConfigFromEnv() - { - // general - if (isset($_ENV['JAEGER_SERVICE_NAME']) && !isset($this->config['service_name'])) { - $this->config['service_name'] = $_ENV['JAEGER_SERVICE_NAME']; - } - - if (isset($_ENV['JAEGER_TAGS']) && !isset($this->config["tags"])) { - $this->config['tags'] = $_ENV['JAEGER_TAGS']; - } - - if (isset($_ENV['JAEGER_DISPATCH_MODE']) && !isset($this->config['dispatch_mode'])) { - $this->config['dispatch_mode'] = $_ENV['JAEGER_DISPATCH_MODE']; - } - - // reporting - if (isset($_ENV['JAEGER_AGENT_HOST']) && !isset($this->config['local_agent']['reporting_host'])) { - $this->config['local_agent']['reporting_host'] = $_ENV['JAEGER_AGENT_HOST']; - } - - if (isset($_ENV['JAEGER_AGENT_PORT']) && !isset($this->config['local_agent']['reporting_port'])) { - $this->config['local_agent']['reporting_port'] = intval($_ENV['JAEGER_AGENT_PORT']); - } - - if (isset($_ENV['JAEGER_REPORTER_LOG_SPANS']) && !isset($this->config['logging'])) { - $this->config['logging'] = filter_var($_ENV['JAEGER_REPORTER_LOG_SPANS'], FILTER_VALIDATE_BOOLEAN); - } - - if (isset($_ENV['JAEGER_REPORTER_MAX_QUEUE_SIZE']) && !isset($this->config['max_buffer_length'])) { - $this->config['max_buffer_length'] = intval($_ENV['JAEGER_REPORTER_MAX_QUEUE_SIZE']); - } - - // sampling - if (isset($_ENV['JAEGER_SAMPLER_TYPE']) && !isset($this->config['sampler']['type'])) { - $this->config['sampler']['type'] = $_ENV['JAEGER_SAMPLER_TYPE']; - } - - if (isset($_ENV['JAEGER_SAMPLER_PARAM']) && !isset($this->config['sampler']['param'])) { - $this->config['sampler']['param'] = $_ENV['JAEGER_SAMPLER_PARAM']; - } - - if (isset($_ENV['IP_VERSION']) && !isset($this->config[Config::IP_VERSION])) { - $this->config[Config::IP_VERSION] = $_ENV['IP_VERSION']; - } - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Constants.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Constants.php deleted file mode 100644 index 1e4be65f5..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Constants.php +++ /dev/null @@ -1,100 +0,0 @@ -specialSpanTags; - } - - /** - * @return string - */ - public function getProcessTagsPrefix(): string - { - return $this->processTagsPrefix; - } - - public function mapSpanToJaeger(Span $span) : JaegerThriftSpan - { - $timestamp = $span->getStartTime(); - $duration = $span->getEndTime() - $span->getStartTime(); - - /** @var Tag[] $tags */ - $tags = []; - - $tags[] = new Tag([ - "key" => COMPONENT, - "vType" => TagType::STRING, - "vStr" => $span->getComponent() ?? $span->getTracer()->getServiceName(), - ]); - - // Handle special tags - $peerService = $span->peer['service_name'] ?? null; - if ($peerService !== null) { - $tags[] = new Tag([ - "key" => PEER_SERVICE, - "vType" => TagType::STRING, - "vStr" => $peerService, - ]); - } - - $peerHostIpv4 = $span->peer['ipv4'] ?? null; - if ($peerHostIpv4 !== null) { - $tags[] = new Tag([ - "key" => PEER_HOST_IPV4, - "vType" => TagType::STRING, - "vStr" => $peerHostIpv4, - ]); - } - - $peerPort = $span->peer['port'] ?? null; - if ($peerPort !== null) { - $tags[] = new Tag([ - "key" => PEER_PORT, - "vType" => TagType::LONG, - "vLong" => $peerPort, - ]); - } - - $spanKind = $span->getKind(); - if ($spanKind !== null) { - $tags[] = new Tag([ - "key" => SPAN_KIND, - "vType" => TagType::STRING, - "vStr" => $spanKind, - ]); - } - - /** @var BinaryAnnotation[] $binaryAnnotationTags */ - $binaryAnnotationTags = $span->getTags(); - foreach ($binaryAnnotationTags as $binaryAnnotationTag) { - if (in_array($binaryAnnotationTag->key, $this->specialSpanTags, true)) { - continue ; - } - - if (strpos($binaryAnnotationTag->key, $this->processTagsPrefix) === 0) { - continue; - } - - $type = ""; - $vkey = ""; - switch ($binaryAnnotationTag->annotation_type) { - case AnnotationType::BOOL: - $type = TagType::BOOL; - $vkey = "vBool"; - break; - case AnnotationType::BYTES: - $type = TagType::BINARY; - $vkey = "vBinary"; - break; - case AnnotationType::DOUBLE: - $type = TagType::DOUBLE; - $vkey = "vDouble"; - break; - case AnnotationType::I16: - case AnnotationType::I32: - case AnnotationType::I64: - $type = TagType::LONG; - $vkey = "vLong"; - break; - default: - $type = TagType::STRING; - $vkey = "vStr"; - } - - $tags[] = new Tag([ - "key" => $binaryAnnotationTag->key, - "vType" => $type, - $vkey => $binaryAnnotationTag->value, - ]); - } - - /** @var Log[] $logs */ - $logs = []; - - $spanLogs = $span->getLogs(); - - foreach ($spanLogs as $spanLog) { - /** @var Tag $fields */ - $fields = []; - - if (!empty($spanLog["fields"])) { - $fields[] = new Tag([ - "key" => "event", - "vType" => TagType::STRING, - "vStr" => json_encode($spanLog["fields"]) - ]); - } - - $logs[] = new Log([ - "timestamp" => $spanLog["timestamp"], - "fields" => $fields - ]); - } - - return new JaegerThriftSpan([ - "traceIdLow" => (int)$span->getContext()->getTraceId(), - "traceIdHigh" => 0, - "spanId" => (int)$span->getContext()->getSpanId(), - "parentSpanId" => (int)$span->getContext()->getParentId(), - "operationName" => $span->getOperationName(), - "startTime" => $timestamp, - "duration" => $duration, - "flags" => (int)$span->isDebug(), - "tags" => $tags, - "logs" => $logs - ]); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/CompositeReporter.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/CompositeReporter.php deleted file mode 100644 index 78533cc76..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/CompositeReporter.php +++ /dev/null @@ -1,51 +0,0 @@ -reporters = $reporters; - } - - /** - * {@inheritdoc} - * - * @param Span $span - * @return void - */ - public function reportSpan(Span $span) - { - foreach ($this->reporters as $reporter) { - $reporter->reportSpan($span); - } - } - - /** - * {@inheritdoc} - * - * @return void - */ - public function close() - { - foreach ($this->reporters as $reporter) { - $reporter->close(); - } - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/InMemoryReporter.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/InMemoryReporter.php deleted file mode 100644 index 8aabe2ee8..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/InMemoryReporter.php +++ /dev/null @@ -1,47 +0,0 @@ -spans[] = $span; - } - - /** - * @return Span[] - */ - public function getSpans(): array - { - return $this->spans; - } - - /** - * {@inheritdoc} - * - * Only implemented to satisfy the sampler interface. - * - * @return void - */ - public function close() - { - // nothing to do - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/JaegerReporter.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/JaegerReporter.php deleted file mode 100644 index 999d69e0a..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/JaegerReporter.php +++ /dev/null @@ -1,35 +0,0 @@ -sender = $sender; - } - - public function reportSpan(Span $span) - { - $this->sender->append($span); - } - - public function close() - { - $this->sender->flush(); - $this->sender->close(); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/LoggingReporter.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/LoggingReporter.php deleted file mode 100644 index 264ea94c5..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/LoggingReporter.php +++ /dev/null @@ -1,51 +0,0 @@ -logger = $logger ?? new NullLogger(); - } - - /** - * {@inheritdoc} - * - * @param Span $span - * @return void - */ - public function reportSpan(Span $span) - { - $this->logger->debug('Reporting span ' . $span->getOperationName()); - } - - /** - * {@inheritdoc} - * - * Only implemented to satisfy the sampler interface. - * - * @return void - */ - public function close() - { - // nothing to do - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/NullReporter.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/NullReporter.php deleted file mode 100644 index 84a953bef..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/NullReporter.php +++ /dev/null @@ -1,32 +0,0 @@ -transport = $transport; - } - - /** - * {@inheritdoc} - * - * @param Span $span - * @return void - */ - public function reportSpan(Span $span) - { - $this->transport->append($span); - } - - /** - * {@inheritdoc} - * - * @return void - */ - public function close() - { - $this->transport->flush(); - $this->transport->close(); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/ReporterInterface.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/ReporterInterface.php deleted file mode 100644 index fea8a8713..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/ReporterInterface.php +++ /dev/null @@ -1,28 +0,0 @@ -config = $config; - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/JaegerHttpReporterFactory.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/JaegerHttpReporterFactory.php deleted file mode 100644 index 038e81161..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/JaegerHttpReporterFactory.php +++ /dev/null @@ -1,35 +0,0 @@ -config->getLocalAgentReportingHost(), - $this->config->getLocalAgentReportingPort(), - "/api/traces" - ); - - try { - $transport->open(); - } catch (TTransportException $e) { - $this->config->getLogger()->warning($e->getMessage()); - } - $protocol = new TBinaryProtocol($transport); - $client = new HttpAgentClient($protocol); - $this->config->getLogger()->debug('Initializing HTTP Jaeger Tracer with Jaeger.Thrift over Binary protocol'); - $sender = new JaegerSender($client, $this->config->getLogger()); - $sender->setMaxBufferLength($this->config->getMaxBufferLength()); - return new JaegerReporter($sender); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/JaegerReporterFactory.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/JaegerReporterFactory.php deleted file mode 100644 index 9865884b5..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/JaegerReporterFactory.php +++ /dev/null @@ -1,44 +0,0 @@ -config->getLocalAgentReportingHost(), - $this->config->getLocalAgentReportingPort(), - $this->config->getLogger(), - $this->config - ); - - $transport = new TBufferedTransport( - $udp, - $this->config->getMaxBufferLength(), - $this->config->getMaxBufferLength() - ); - - try { - $transport->open(); - } catch (TTransportException $e) { - $this->config->getLogger()->warning($e->getMessage()); - } - $protocol = new TBinaryProtocol($transport); - $client = new AgentClient($protocol); - $this->config->getLogger()->debug('Initializing UDP Jaeger Tracer with Jaeger.Thrift over Binary protocol'); - $sender = new JaegerSender($client, $this->config->getLogger()); - $sender->setMaxBufferLength($this->config->getMaxBufferLength()); - return new JaegerReporter($sender); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/ReporterFactoryInterface.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/ReporterFactoryInterface.php deleted file mode 100644 index 4bfd3204f..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/ReporterFactoryInterface.php +++ /dev/null @@ -1,10 +0,0 @@ -config->getLocalAgentReportingHost(), - $this->config->getLocalAgentReportingPort(), - $this->config->getLogger(), - $this->config - ); - - $transport = new TBufferedTransport( - $udp, - $this->config->getMaxBufferLength(), - $this->config->getMaxBufferLength() - ); - - try { - $transport->open(); - } catch (TTransportException $e) { - $this->config->getLogger()->warning($e->getMessage()); - } - $protocol = new TCompactProtocol($transport); - $client = new AgentClient($protocol); - $this->config->getLogger()->debug('Initializing UDP Jaeger Tracer with Zipkin.Thrift over Compact protocol'); - $sender = new UdpSender($client, $this->config->getMaxBufferLength(), $this->config->getLogger()); - return new RemoteReporter($sender); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/ConstSampler.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/ConstSampler.php deleted file mode 100644 index 7c6ba3d62..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/ConstSampler.php +++ /dev/null @@ -1,68 +0,0 @@ -tags = [ - SAMPLER_TYPE_TAG_KEY => SAMPLER_TYPE_CONST, - SAMPLER_PARAM_TAG_KEY => $decision, - ]; - - $this->decision = $decision; - } - - /** - * {@inheritdoc} - * - * @param string $traceId The traceId on the span. - * @param string $operation The operation name set on the span. - * @return array - */ - public function isSampled(string $traceId, string $operation = ''): array - { - return [$this->decision, $this->tags]; - } - - /** - * {@inheritdoc} - * - * Only implemented to satisfy the sampler interface. - * - * @return void - */ - public function close() - { - // nothing to do - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/ProbabilisticSampler.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/ProbabilisticSampler.php deleted file mode 100644 index cb265d01e..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/ProbabilisticSampler.php +++ /dev/null @@ -1,88 +0,0 @@ -tags = [ - SAMPLER_TYPE_TAG_KEY => SAMPLER_TYPE_PROBABILISTIC, - SAMPLER_PARAM_TAG_KEY => $rate, - ]; - - if ($rate < 0.0 || $rate > 1.0) { - throw new OutOfBoundsException('Sampling rate must be between 0.0 and 1.0.'); - } - - $this->rate = $rate; - if ($rate < 0.5) { - $this->boundary = (int)($rate * PHP_INT_MAX); - } else { - // more precise calculation due to int and float having different precision near PHP_INT_MAX - $this->boundary = PHP_INT_MAX - (int)((1 - $rate) * PHP_INT_MAX); - } - } - - /** - * {@inheritdoc} - * - * @param string $traceId The traceId on the span. - * @param string $operation The operation name set on the span. - * @return array - */ - public function isSampled(string $traceId, string $operation = ''): array - { - return [($traceId < $this->boundary), $this->tags]; - } - - /** - * {@inheritdoc} - * - * Only implemented to satisfy the sampler interface. - * - * @return void - */ - public function close() - { - // nothing to do - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/RateLimitingSampler.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/RateLimitingSampler.php deleted file mode 100644 index d0ea0f180..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/RateLimitingSampler.php +++ /dev/null @@ -1,62 +0,0 @@ -tags = [ - SAMPLER_TYPE_TAG_KEY => SAMPLER_TYPE_RATE_LIMITING, - SAMPLER_PARAM_TAG_KEY => $maxTracesPerSecond, - ]; - - $maxTracesPerNanosecond = $maxTracesPerSecond / 1000000000.0; - $this->rateLimiter = $rateLimiter; - $this->rateLimiter->initialize($maxTracesPerNanosecond, $maxTracesPerSecond > 1.0 ? 1.0 : $maxTracesPerSecond); - } - - /** - * Whether or not the new trace should be sampled. - * - * Implementations should return an array in the format [$decision, $tags]. - * - * @param string $traceId The traceId on the span. - * @param string $operation The operation name set on the span. - * @return array - */ - public function isSampled(string $traceId = '', string $operation = '') - { - return [$this->rateLimiter->checkCredit(1.0), $this->tags]; - } - - /** - * {@inheritdoc} - * - * Only implemented to satisfy the sampler interface. - * - * @return void - */ - public function close() - { - // nothing to do - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/SamplerInterface.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/SamplerInterface.php deleted file mode 100644 index b6d44e783..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/SamplerInterface.php +++ /dev/null @@ -1,29 +0,0 @@ -scopeManager = $scopeManager; - $this->wrapped = $wrapped; - $this->finishSpanOnClose = $finishSpanOnClose; - $this->toRestore = $scopeManager->getActive(); - } - - /** - * {@inheritdoc} - */ - public function close(): void - { - if ($this->scopeManager->getActive() !== $this) { - // This shouldn't happen if users call methods in expected order - return; - } - - if ($this->finishSpanOnClose) { - $this->wrapped->finish(); - } - - $this->scopeManager->setActive($this->toRestore); - } - - /** - * {@inheritdoc} - */ - public function getSpan(): OTSpan - { - return $this->wrapped; - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ScopeManager.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ScopeManager.php deleted file mode 100644 index eb5c27676..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ScopeManager.php +++ /dev/null @@ -1,45 +0,0 @@ -active = new Scope($this, $span, $finishSpanOnClose); - - return $this->active; - } - - /** - * {@inheritdoc} - */ - public function getActive(): ?OTScope - { - return $this->active; - } - - /** - * Sets the scope as active. - * @param OTScope|null $scope - */ - public function setActive(OTScope $scope = null) - { - $this->active = $scope; - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sender/JaegerSender.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sender/JaegerSender.php deleted file mode 100644 index dfce510b8..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sender/JaegerSender.php +++ /dev/null @@ -1,236 +0,0 @@ -agentClient = $agentClient; - $this->logger = $logger ?? new NullLogger(); - $this->mapper = $mapper ?? new SpanToJaegerMapper(); - } - - - public function flush(): int - { - $count = count($this->spans); - if ($count === 0) { - return 0; - } - - $jaegerThriftSpans = $this->makeJaegerBatch($this->spans); - - try { - $this->send($jaegerThriftSpans); - } catch (\Exception $e) { - $this->logger->warning($e->getMessage()); - } - - $this->spans = []; - - return $count; - } - - public function setMaxBufferLength($maxBufferLength) - { - $this->maxBufferLength = $maxBufferLength; - } - - /** - * @param JaegerSpan[] $spans - * @return array - */ - private function makeJaegerBatch(array $spans) : array - { - /** @var JaegerThriftSpan[] $jaegerSpans */ - $jaegerSpans = []; - - foreach ($spans as $span) { - if (empty($this->tracer)) { - $this->tracer = $span->getTracer(); - } - - $jaegerSpans[] = $this->mapper->mapSpanToJaeger($span); - } - - return $jaegerSpans; - } - - /** - * @param JaegerThriftSpan[] $spans - */ - private function send(array $spans) - { - if (empty($this->tracer)) { - return ; - } - - $chunks = $this->chunkSplit($spans); - foreach ($chunks as $chunk) { - /** @var JaegerThriftSpan[] $chunk */ - $this->emitJaegerBatch($chunk); - } - } - - /** - * @param JaegerThriftSpan $span - */ - private function getBufferLength($span) - { - $memoryBuffer = new TMemoryBuffer(); - $span->write(new TBinaryProtocol($memoryBuffer)); - return $memoryBuffer->available(); - } - - private function chunkSplit(array $spans): array - { - $actualBufferSize = $this->jaegerBatchOverheadLength; - $chunkId = 0; - $chunks = []; - - foreach ($spans as $span) { - $spanBufferLength = $this->getBufferLength($span); - if (!empty($chunks[$chunkId]) && ($actualBufferSize + $spanBufferLength) > $this->maxBufferLength) { - // point to next chunk - ++$chunkId; - - // reset buffer size - $actualBufferSize = $this->jaegerBatchOverheadLength; - } - - if (!isset($chunks[$chunkId])) { - $chunks[$chunkId] = []; - } - - $chunks[$chunkId][] = $span; - $actualBufferSize += $spanBufferLength; - } - - return $chunks; - } - - protected function emitJaegerBatch(array $spans) - { - /** @var Tag[] $tags */ - $tags = []; - - foreach ($this->tracer->getTags() as $k => $v) { - if (!in_array($k, $this->mapper->getSpecialSpanTags())) { - if (strpos($k, $this->mapper->getProcessTagsPrefix()) !== 0) { - continue ; - } - - $quoted = preg_quote($this->mapper->getProcessTagsPrefix()); - $k = preg_replace(sprintf('/^%s/', $quoted), '', $k); - } - - if ($k === JAEGER_HOSTNAME_TAG_KEY) { - $k = "hostname"; - } - - $tags[] = new Tag([ - "key" => $k, - "vType" => TagType::STRING, - "vStr" => $v - ]); - } - - $tags[] = new Tag([ - "key" => "format", - "vType" => TagType::STRING, - "vStr" => "jaeger.thrift" - ]); - - $tags[] = new Tag([ - "key" => "ip", - "vType" => TagType::STRING, - "vStr" => $this->tracer->getIpAddress() - ]); - - $batch = new Batch([ - "spans" => $spans, - "process" => new Process([ - "serviceName" => $this->tracer->getServiceName(), - "tags" => $tags - ]) - ]); - - $this->agentClient->emitBatch($batch); - } - - /** - * @param JaegerSpan $span - */ - public function append(JaegerSpan $span) - { - $this->spans[] = $span; - } - - public function close() - { - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sender/SenderInterface.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sender/SenderInterface.php deleted file mode 100644 index 24dc4fbfa..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sender/SenderInterface.php +++ /dev/null @@ -1,12 +0,0 @@ -client = $client; - $this->maxBufferLength = $maxBufferLength; - $this->logger = $logger ?? new NullLogger(); - } - - /** - * @param JaegerSpan $span - */ - public function append(JaegerSpan $span) - { - $this->spans[] = $span; - } - - /** - * @return int the number of flushed spans - */ - public function flush(): int - { - $count = count($this->spans); - if ($count === 0) { - return 0; - } - - $zipkinSpans = $this->makeZipkinBatch($this->spans); - - try { - $this->send($zipkinSpans); - } catch (Exception $e) { - $this->logger->warning($e->getMessage()); - } - - $this->spans = []; - - return $count; - } - - public function close() - { - } - - /** - * Emits the thrift-objects. - * - * @param array|ThriftSpan[]|TBase[] $thrifts - */ - private function send(array $thrifts) - { - foreach ($this->chunkSplit($thrifts) as $chunk) { - /* @var $chunk ThriftSpan[] */ - $this->client->emitZipkinBatch($chunk); - } - } - - /** - * @param JaegerSpan[] $spans - * @return ThriftSpan[] - */ - private function makeZipkinBatch(array $spans): array - { - /** @var ThriftSpan[] */ - $zipkinSpans = []; - - foreach ($spans as $span) { - /** @var JaegerSpan $span */ - - $endpoint = $this->makeEndpoint( - $span->getTracer()->getIpAddress(), - 0, // span.port, - $span->getTracer()->getServiceName() - ); - - $timestamp = $span->getStartTime(); - $duration = $span->getEndTime() - $span->getStartTime(); - - $this->addZipkinAnnotations($span, $endpoint); - - $zipkinSpan = new ThriftSpan([ - 'name' => $span->getOperationName(), - 'id' => $span->getContext()->getSpanId(), - 'parent_id' => $span->getContext()->getParentId() ?? null, - 'trace_id' => $span->getContext()->getTraceId(), - 'annotations' => $this->createAnnotations($span, $endpoint), - 'binary_annotations' => $span->getTags(), - 'debug' => $span->isDebug(), - 'timestamp' => $timestamp, - 'duration' => $duration, - ]); - - $zipkinSpans[] = $zipkinSpan; - } - - return $zipkinSpans; - } - - private function addZipkinAnnotations(JaegerSpan $span, Endpoint $endpoint) - { - if ($span->isRpc() && $span->peer) { - $isClient = $span->isRpcClient(); - - $host = $this->makeEndpoint( - $span->peer['ipv4'] ?? 0, - $span->peer['port'] ?? 0, - $span->peer['service_name'] ?? '' - ); - - $key = ($isClient) ? self::SERVER_ADDR : self::CLIENT_ADDR; - - $peer = $this->makePeerAddressTag($key, $host); - $span->tags[$key] = $peer; - } else { - $tag = $this->makeLocalComponentTag( - $span->getComponent() ?? $span->getTracer()->getServiceName(), - $endpoint - ); - - $span->tags[COMPONENT] = $tag; - } - } - - private function makeLocalComponentTag(string $componentName, Endpoint $endpoint): BinaryAnnotation - { - return new BinaryAnnotation([ - 'key' => "lc", - 'value' => $componentName, - 'annotation_type' => AnnotationType::STRING, - 'host' => $endpoint, - ]); - } - - private function makeEndpoint(string $ipv4, int $port, string $serviceName): Endpoint - { - $ipv4 = $this->ipv4ToInt($ipv4); - - return new Endpoint([ - 'ipv4' => $ipv4, - 'port' => $port, - 'service_name' => $serviceName, - ]); - } - - private function ipv4ToInt(string $ipv4): int - { - if ($ipv4 == 'localhost') { - $ipv4 = '127.0.0.1'; - } elseif ($ipv4 == '::1') { - $ipv4 = '127.0.0.1'; - } - - $long = ip2long($ipv4); - if (PHP_INT_SIZE === 8) { - return $long >> 31 ? $long - (1 << 32) : $long; - } - return $long; - } - - // Used for Zipkin binary annotations like CA/SA (client/server address). - // They are modeled as Boolean type with '0x01' as the value. - private function makePeerAddressTag(string $key, Endpoint $host): BinaryAnnotation - { - return new BinaryAnnotation([ - "key" => $key, - "value" => '0x01', - "annotation_type" => AnnotationType::BOOL, - "host" => $host, - ]); - } - - /** - * Splits an array of thrift-objects into several chunks when the buffer limit has been reached. - * - * @param array|ThriftSpan[]|TBase[] $thrifts - * - * @return array - */ - private function chunkSplit(array $thrifts): array - { - $actualBufferSize = $this->zipkinBatchOverheadLength; - $chunkId = 0; - $chunks = []; - - foreach ($thrifts as $thrift) { - $spanBufferLength = $this->getBufferLength($thrift); - - if (!empty($chunks[$chunkId]) && ($actualBufferSize + $spanBufferLength) > $this->maxBufferLength) { - // point to next chunk - ++$chunkId; - - // reset buffer size - $actualBufferSize = $this->zipkinBatchOverheadLength; - } - - if (!isset($chunks[$chunkId])) { - $chunks[$chunkId] = []; - } - - $chunks[$chunkId][] = $thrift; - $actualBufferSize += $spanBufferLength; - } - - return $chunks; - } - - /** - * Returns the length of a thrift-object. - * - * @param ThriftSpan|TBase $thrift - * - * @return int - */ - private function getBufferLength($thrift): int - { - $memoryBuffer = new TMemoryBuffer(); - - $thrift->write(new TCompactProtocol($memoryBuffer)); - - return $memoryBuffer->available(); - } - - /* - * @param JaegerSpan $span - * @param Endpoint $endpoint - * - * @return array|Annotation[] - */ - private function createAnnotations(JaegerSpan $span, Endpoint $endpoint): array - { - $annotations = []; - - foreach ($span->getLogs() as $values) { - $annotations[] = new Annotation([ - 'timestamp' => $values['timestamp'], - 'value' => json_encode($values['fields']), - 'host' => $endpoint, - ]); - } - - return $annotations; - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Span.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Span.php deleted file mode 100644 index abcb07c89..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Span.php +++ /dev/null @@ -1,476 +0,0 @@ -context = $context; - $this->tracer = $tracer; - - $this->operationName = $operationName; - $this->startTime = $this->microTime($startTime); - $this->endTime = null; - $this->kind = null; - $this->peer = null; - $this->component = null; - - foreach ($tags as $key => $value) { - $this->setTag($key, $value); - } - } - - /** - * Converts time to microtime int - * - int represents microseconds - * - float represents seconds - * - * @param int|float|DateTime|null $time - * @return int - */ - protected function microTime($time): int - { - if ($time === null) { - return $this->timestampMicro(); - } - - if ($time instanceof \DateTimeInterface) { - return (int)round($time->format('U.u') * 1000000, 0); - } - - if (is_int($time)) { - return $time; - } - - if (is_float($time)) { - return (int)round($time * 1000000, 0); - } - - throw new \InvalidArgumentException(sprintf( - 'Time should be one of the types int|float|DateTime|null, got %s.', - gettype($time) - )); - } - - /** - * @return Tracer - */ - public function getTracer(): Tracer - { - return $this->tracer; - } - - /** - * @return bool - */ - public function isDebug(): bool - { - return $this->debug; - } - - /** - * @return int - */ - public function getStartTime(): int - { - return $this->startTime; - } - - /** - * @return int|null - */ - public function getEndTime() - { - return $this->endTime; - } - - /** - * @return string - */ - public function getOperationName(): string - { - return $this->operationName; - } - - /** - * @return mixed - */ - public function getComponent() - { - // TODO - return $this->component; - } - - /** - * {@inheritdoc} - * - * @return SpanContext - */ - public function getContext(): OTSpanContext - { - return $this->context; - } - - /** - * {@inheritdoc} - */ - public function finish($finishTime = null, array $logRecords = []): void - { - if (!$this->isSampled()) { - return; - } - - foreach ($logRecords as $logRecord) { - $this->log($logRecord); - } - - $this->endTime = $this->microTime($finishTime); - $this->tracer->reportSpan($this); - } - - /** - * Returns true if the trace should be measured. - * - * @return bool - */ - public function isSampled(): bool - { - $context = $this->getContext(); - - return ($context->getFlags() & SAMPLED_FLAG) == SAMPLED_FLAG; - } - - /** - * {@inheritdoc} - */ - public function overwriteOperationName(string $newOperationName): void - { - // TODO log warning - $this->operationName = $newOperationName; - } - - /** - * {@inheritdoc} - * - * @param array $tags - * @return void - */ - public function setTags($tags) - { - foreach ($tags as $key => $value) { - $this->setTag($key, $value); - } - } - - /** - * {@inheritdoc} - */ - public function setTag(string $key, $value): void - { - if ($this->isSampled()) { - $special = self::SPECIAL_TAGS[$key] ?? null; - $handled = false; - - if ($special !== null && is_callable([$this, $special])) { - $handled = $this->$special($value); - } - - if (!$handled) { - $tag = $this->makeTag($key, $value); - $this->tags[$key] = $tag; - } - } - } - - const SPECIAL_TAGS = [ - PEER_SERVICE => 'setPeerService', - PEER_HOST_IPV4 => 'setPeerHostIpv4', - PEER_PORT => 'setPeerPort', - SPAN_KIND => 'setSpanKind', - COMPONENT => 'setComponent', - ]; - - /** - * Sets a low-cardinality identifier of the module, library, - * or package that is generating a span. - * - * @see Span::setTag() - * - * @param string $value - * @return bool - */ - private function setComponent($value): bool - { - $this->component = $value; - return true; - } - - /** - * @return bool - */ - private function setSpanKind($value): bool - { - $validSpanKinds = [ - SPAN_KIND_RPC_CLIENT, - SPAN_KIND_RPC_SERVER, - SPAN_KIND_MESSAGE_BUS_CONSUMER, - SPAN_KIND_MESSAGE_BUS_PRODUCER, - ]; - - if ($value === null || in_array($value, $validSpanKinds, true)) { - $this->kind = $value; - return true; - } - return false; - } - - /** - * @return string|null - */ - public function getKind(): ?string - { - return $this->kind; - } - - /** - * @return bool - */ - private function setPeerPort($value): bool - { - if ($this->peer === null) { - $this->peer = ['port' => $value]; - } else { - $this->peer['port'] = $value; - } - return true; - } - - /** - * @return bool - */ - private function setPeerHostIpv4($value): bool - { - if ($this->peer === null) { - $this->peer = ['ipv4' => $value]; - } else { - $this->peer['ipv4'] = $value; - } - return true; - } - - /** - * @return bool - */ - private function setPeerService($value): bool - { - if ($this->peer === null) { - $this->peer = ['service_name' => $value]; - } else { - $this->peer['service_name'] = $value; - } - return true; - } - - /** - * @return bool - */ - public function isRpc(): bool - { - return $this->kind == SPAN_KIND_RPC_CLIENT || $this->kind == SPAN_KIND_RPC_SERVER; - } - - /** - * @return bool - */ - public function isRpcClient(): bool - { - return $this->kind == SPAN_KIND_RPC_CLIENT; - } - - /** - * {@inheritdoc} - */ - public function log(array $fields = [], $timestamp = null): void - { - $timestamp = $this->microTime($timestamp); - if ($timestamp < $this->getStartTime()) { - $timestamp = $this->timestampMicro(); - } - - $this->logs[] = [ - 'fields' => $fields, - 'timestamp' => $timestamp, - ]; - } - - /** - * Returns the logs. - * - * [ - * [ - * 'timestamp' => timestamp in microsecond, - * 'fields' => [ - * 'error' => 'message', - * ] - * ] - * ] - * - * @return array - */ - public function getLogs(): array - { - return $this->logs; - } - - /** - * {@inheritdoc} - */ - public function addBaggageItem(string $key, string $value): void - { - $this->context = $this->context->withBaggageItem($key, $value); - } - - /** - * {@inheritdoc} - */ - public function getBaggageItem(string $key): ?string - { - return $this->context->getBaggageItem($key); - } - - /** - * @return array - */ - public function getTags(): array - { - return $this->tags; - } - - /** - * @return int - */ - private function timestampMicro(): int - { - return round(microtime(true) * 1000000); - } - - /** - * @param string $key - * @param mixed $value - * @return BinaryAnnotation - */ - private function makeTag(string $key, $value): BinaryAnnotation - { - $valueType = gettype($value); - $annotationType = null; - switch ($valueType) { - case "boolean": - $annotationType = AnnotationType::BOOL; - break; - case "integer": - $annotationType = AnnotationType::I64; - break; - case "double": - $annotationType = AnnotationType::DOUBLE; - break; - default: - $annotationType = AnnotationType::STRING; - $value = (string)$value; - if (strlen($value) > 1024) { - $value = substr($value, 0, 1024); - } - } - - return new BinaryAnnotation([ - 'key' => $key, - 'value' => $value, - 'annotation_type' => $annotationType, - ]); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/SpanContext.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/SpanContext.php deleted file mode 100644 index 447ffd1a5..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/SpanContext.php +++ /dev/null @@ -1,120 +0,0 @@ -traceId = $traceId; - $this->spanId = $spanId; - $this->parentId = $parentId; - $this->flags = $flags; - $this->baggage = is_array($baggage) ? $baggage : []; - $this->debugId = $debugId; - } - - /** - * {@inheritdoc} - * @return ArrayIterator - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - return new ArrayIterator($this->baggage); - } - - /** - * {@inheritdoc} - */ - public function getBaggageItem(string $key): ?string - { - return array_key_exists($key, $this->baggage) ? $this->baggage[$key] : null; - } - - /** - * {@inheritdoc} - * - * @param string $key - * @param string $value - * @return SpanContext - */ - public function withBaggageItem(string $key, string $value): OTSpanContext - { - return new self( - $this->traceId, - $this->spanId, - $this->parentId, - $this->flags, - [$key => $value] + $this->baggage - ); - } - - public function getTraceId() - { - return $this->traceId; - } - - public function getParentId() - { - return $this->parentId; - } - - public function getSpanId() - { - return $this->spanId; - } - - /** - * Get the span context flags. - * - * @return int|null - */ - public function getFlags() - { - return $this->flags; - } - - public function getBaggage() - { - return $this->baggage; - } - - public function getDebugId() - { - return $this->debugId; - } - - public function isDebugIdContainerOnly(): bool - { - return ($this->traceId === null) && ($this->debugId !== null); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AgentClient.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AgentClient.php deleted file mode 100644 index 640df4598..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AgentClient.php +++ /dev/null @@ -1,76 +0,0 @@ -input_ = $input; - $this->output_ = $output ? $output : $input; - } - - public function emitZipkinBatch(array $spans) - { - $this->send_emitZipkinBatch($spans); - } - - public function send_emitZipkinBatch(array $spans) - { - $args = new \Jaeger\Thrift\Agent\Agent_emitZipkinBatch_args(); - $args->spans = $spans; - $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); - if ($bin_accel) - { - thrift_protocol_write_binary($this->output_, 'emitZipkinBatch', TMessageType::ONEWAY, $args, $this->seqid_, $this->output_->isStrictWrite()); - } - else - { - $this->output_->writeMessageBegin('emitZipkinBatch', TMessageType::ONEWAY, $this->seqid_); - $args->write($this->output_); - $this->output_->writeMessageEnd(); - $this->output_->getTransport()->flush(); - } - } - public function emitBatch(\Jaeger\Thrift\Batch $batch) - { - $this->send_emitBatch($batch); - } - - public function send_emitBatch(\Jaeger\Thrift\Batch $batch) - { - $args = new \Jaeger\Thrift\Agent\Agent_emitBatch_args(); - $args->batch = $batch; - $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); - if ($bin_accel) - { - thrift_protocol_write_binary($this->output_, 'emitBatch', TMessageType::ONEWAY, $args, $this->seqid_, $this->output_->isStrictWrite()); - } - else - { - $this->output_->writeMessageBegin('emitBatch', TMessageType::ONEWAY, $this->seqid_); - $args->write($this->output_); - $this->output_->writeMessageEnd(); - $this->output_->getTransport()->flush(); - } - } -} - - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AgentIf.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AgentIf.php deleted file mode 100644 index 30efc8cf3..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AgentIf.php +++ /dev/null @@ -1,30 +0,0 @@ - array( - 'var' => 'batch', - 'isRequired' => false, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Batch', - ), - ); - - /** - * @var \Jaeger\Thrift\Batch - */ - public $batch = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'Agent_emitBatch_args'; - } - - public function read($input) - { - return $this->_read('Agent_emitBatch_args', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('Agent_emitBatch_args', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Agent_emitZipkinBatch_args.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Agent_emitZipkinBatch_args.php deleted file mode 100644 index cc58527bb..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Agent_emitZipkinBatch_args.php +++ /dev/null @@ -1,60 +0,0 @@ - array( - 'var' => 'spans', - 'isRequired' => false, - 'type' => TType::LST, - 'etype' => TType::STRUCT, - 'elem' => array( - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Agent\Zipkin\Span', - ), - ), - ); - - /** - * @var \Jaeger\Thrift\Agent\Zipkin\Span[] - */ - public $spans = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'Agent_emitZipkinBatch_args'; - } - - public function read($input) - { - return $this->_read('Agent_emitZipkinBatch_args', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('Agent_emitZipkinBatch_args', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidatorClient.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidatorClient.php deleted file mode 100644 index 73825978a..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidatorClient.php +++ /dev/null @@ -1,83 +0,0 @@ -input_ = $input; - $this->output_ = $output ? $output : $input; - } - - public function validateTrace($traceId) - { - $this->send_validateTrace($traceId); - return $this->recv_validateTrace(); - } - - public function send_validateTrace($traceId) - { - $args = new \Jaeger\Thrift\Agent\AggregationValidator_validateTrace_args(); - $args->traceId = $traceId; - $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); - if ($bin_accel) - { - thrift_protocol_write_binary($this->output_, 'validateTrace', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); - } - else - { - $this->output_->writeMessageBegin('validateTrace', TMessageType::CALL, $this->seqid_); - $args->write($this->output_); - $this->output_->writeMessageEnd(); - $this->output_->getTransport()->flush(); - } - } - - public function recv_validateTrace() - { - $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); - if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Jaeger\Thrift\Agent\AggregationValidator_validateTrace_result', $this->input_->isStrictRead()); - else - { - $rseqid = 0; - $fname = null; - $mtype = 0; - - $this->input_->readMessageBegin($fname, $mtype, $rseqid); - if ($mtype == TMessageType::EXCEPTION) { - $x = new TApplicationException(); - $x->read($this->input_); - $this->input_->readMessageEnd(); - throw $x; - } - $result = new \Jaeger\Thrift\Agent\AggregationValidator_validateTrace_result(); - $result->read($this->input_); - $this->input_->readMessageEnd(); - } - if ($result->success !== null) { - return $result->success; - } - throw new \Exception("validateTrace failed: unknown result"); - } - -} - - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidatorIf.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidatorIf.php deleted file mode 100644 index 853cd2a4f..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidatorIf.php +++ /dev/null @@ -1,27 +0,0 @@ - array( - 'var' => 'traceId', - 'isRequired' => true, - 'type' => TType::STRING, - ), - ); - - /** - * @var string - */ - public $traceId = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'AggregationValidator_validateTrace_args'; - } - - public function read($input) - { - return $this->_read('AggregationValidator_validateTrace_args', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('AggregationValidator_validateTrace_args', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidator_validateTrace_result.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidator_validateTrace_result.php deleted file mode 100644 index 6060c5ae3..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidator_validateTrace_result.php +++ /dev/null @@ -1,56 +0,0 @@ - array( - 'var' => 'success', - 'isRequired' => false, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Agent\ValidateTraceResponse', - ), - ); - - /** - * @var \Jaeger\Thrift\Agent\ValidateTraceResponse - */ - public $success = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'AggregationValidator_validateTrace_result'; - } - - public function read($input) - { - return $this->_read('AggregationValidator_validateTrace_result', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('AggregationValidator_validateTrace_result', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestriction.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestriction.php deleted file mode 100644 index 27593c4c1..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestriction.php +++ /dev/null @@ -1,65 +0,0 @@ - array( - 'var' => 'baggageKey', - 'isRequired' => true, - 'type' => TType::STRING, - ), - 2 => array( - 'var' => 'maxValueLength', - 'isRequired' => true, - 'type' => TType::I32, - ), - ); - - /** - * @var string - */ - public $baggageKey = null; - /** - * @var int - */ - public $maxValueLength = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'BaggageRestriction'; - } - - public function read($input) - { - return $this->_read('BaggageRestriction', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('BaggageRestriction', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManagerClient.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManagerClient.php deleted file mode 100644 index 379153534..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManagerClient.php +++ /dev/null @@ -1,83 +0,0 @@ -input_ = $input; - $this->output_ = $output ? $output : $input; - } - - public function getBaggageRestrictions($serviceName) - { - $this->send_getBaggageRestrictions($serviceName); - return $this->recv_getBaggageRestrictions(); - } - - public function send_getBaggageRestrictions($serviceName) - { - $args = new \Jaeger\Thrift\Agent\BaggageRestrictionManager_getBaggageRestrictions_args(); - $args->serviceName = $serviceName; - $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); - if ($bin_accel) - { - thrift_protocol_write_binary($this->output_, 'getBaggageRestrictions', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); - } - else - { - $this->output_->writeMessageBegin('getBaggageRestrictions', TMessageType::CALL, $this->seqid_); - $args->write($this->output_); - $this->output_->writeMessageEnd(); - $this->output_->getTransport()->flush(); - } - } - - public function recv_getBaggageRestrictions() - { - $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); - if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Jaeger\Thrift\Agent\BaggageRestrictionManager_getBaggageRestrictions_result', $this->input_->isStrictRead()); - else - { - $rseqid = 0; - $fname = null; - $mtype = 0; - - $this->input_->readMessageBegin($fname, $mtype, $rseqid); - if ($mtype == TMessageType::EXCEPTION) { - $x = new TApplicationException(); - $x->read($this->input_); - $this->input_->readMessageEnd(); - throw $x; - } - $result = new \Jaeger\Thrift\Agent\BaggageRestrictionManager_getBaggageRestrictions_result(); - $result->read($this->input_); - $this->input_->readMessageEnd(); - } - if ($result->success !== null) { - return $result->success; - } - throw new \Exception("getBaggageRestrictions failed: unknown result"); - } - -} - - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManagerIf.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManagerIf.php deleted file mode 100644 index 010bda741..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManagerIf.php +++ /dev/null @@ -1,31 +0,0 @@ - array( - 'var' => 'serviceName', - 'isRequired' => false, - 'type' => TType::STRING, - ), - ); - - /** - * @var string - */ - public $serviceName = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'BaggageRestrictionManager_getBaggageRestrictions_args'; - } - - public function read($input) - { - return $this->_read('BaggageRestrictionManager_getBaggageRestrictions_args', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('BaggageRestrictionManager_getBaggageRestrictions_args', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManager_getBaggageRestrictions_result.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManager_getBaggageRestrictions_result.php deleted file mode 100644 index a3c52b37c..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManager_getBaggageRestrictions_result.php +++ /dev/null @@ -1,60 +0,0 @@ - array( - 'var' => 'success', - 'isRequired' => false, - 'type' => TType::LST, - 'etype' => TType::STRUCT, - 'elem' => array( - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Agent\BaggageRestriction', - ), - ), - ); - - /** - * @var \Jaeger\Thrift\Agent\BaggageRestriction[] - */ - public $success = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'BaggageRestrictionManager_getBaggageRestrictions_result'; - } - - public function read($input) - { - return $this->_read('BaggageRestrictionManager_getBaggageRestrictions_result', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('BaggageRestrictionManager_getBaggageRestrictions_result', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependencies.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependencies.php deleted file mode 100644 index 4295b9798..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependencies.php +++ /dev/null @@ -1,61 +0,0 @@ - array( - 'var' => 'links', - 'isRequired' => true, - 'type' => TType::LST, - 'etype' => TType::STRUCT, - 'elem' => array( - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Agent\DependencyLink', - ), - ), - ); - - /** - * @var \Jaeger\Thrift\Agent\DependencyLink[] - */ - public $links = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'Dependencies'; - } - - public function read($input) - { - return $this->_read('Dependencies', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('Dependencies', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/DependencyClient.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/DependencyClient.php deleted file mode 100644 index 2c247633d..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/DependencyClient.php +++ /dev/null @@ -1,105 +0,0 @@ -input_ = $input; - $this->output_ = $output ? $output : $input; - } - - public function getDependenciesForTrace($traceId) - { - $this->send_getDependenciesForTrace($traceId); - return $this->recv_getDependenciesForTrace(); - } - - public function send_getDependenciesForTrace($traceId) - { - $args = new \Jaeger\Thrift\Agent\Dependency_getDependenciesForTrace_args(); - $args->traceId = $traceId; - $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); - if ($bin_accel) - { - thrift_protocol_write_binary($this->output_, 'getDependenciesForTrace', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); - } - else - { - $this->output_->writeMessageBegin('getDependenciesForTrace', TMessageType::CALL, $this->seqid_); - $args->write($this->output_); - $this->output_->writeMessageEnd(); - $this->output_->getTransport()->flush(); - } - } - - public function recv_getDependenciesForTrace() - { - $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); - if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Jaeger\Thrift\Agent\Dependency_getDependenciesForTrace_result', $this->input_->isStrictRead()); - else - { - $rseqid = 0; - $fname = null; - $mtype = 0; - - $this->input_->readMessageBegin($fname, $mtype, $rseqid); - if ($mtype == TMessageType::EXCEPTION) { - $x = new TApplicationException(); - $x->read($this->input_); - $this->input_->readMessageEnd(); - throw $x; - } - $result = new \Jaeger\Thrift\Agent\Dependency_getDependenciesForTrace_result(); - $result->read($this->input_); - $this->input_->readMessageEnd(); - } - if ($result->success !== null) { - return $result->success; - } - throw new \Exception("getDependenciesForTrace failed: unknown result"); - } - - public function saveDependencies(\Jaeger\Thrift\Agent\Dependencies $dependencies) - { - $this->send_saveDependencies($dependencies); - } - - public function send_saveDependencies(\Jaeger\Thrift\Agent\Dependencies $dependencies) - { - $args = new \Jaeger\Thrift\Agent\Dependency_saveDependencies_args(); - $args->dependencies = $dependencies; - $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); - if ($bin_accel) - { - thrift_protocol_write_binary($this->output_, 'saveDependencies', TMessageType::ONEWAY, $args, $this->seqid_, $this->output_->isStrictWrite()); - } - else - { - $this->output_->writeMessageBegin('saveDependencies', TMessageType::ONEWAY, $this->seqid_); - $args->write($this->output_); - $this->output_->writeMessageEnd(); - $this->output_->getTransport()->flush(); - } - } -} - - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/DependencyIf.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/DependencyIf.php deleted file mode 100644 index c9432e7d8..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/DependencyIf.php +++ /dev/null @@ -1,31 +0,0 @@ - array( - 'var' => 'parent', - 'isRequired' => true, - 'type' => TType::STRING, - ), - 2 => array( - 'var' => 'child', - 'isRequired' => true, - 'type' => TType::STRING, - ), - 4 => array( - 'var' => 'callCount', - 'isRequired' => true, - 'type' => TType::I64, - ), - ); - - /** - * @var string - */ - public $parent = null; - /** - * @var string - */ - public $child = null; - /** - * @var int - */ - public $callCount = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'DependencyLink'; - } - - public function read($input) - { - return $this->_read('DependencyLink', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('DependencyLink', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependency_getDependenciesForTrace_args.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependency_getDependenciesForTrace_args.php deleted file mode 100644 index 5100ea77b..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependency_getDependenciesForTrace_args.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'var' => 'traceId', - 'isRequired' => true, - 'type' => TType::STRING, - ), - ); - - /** - * @var string - */ - public $traceId = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'Dependency_getDependenciesForTrace_args'; - } - - public function read($input) - { - return $this->_read('Dependency_getDependenciesForTrace_args', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('Dependency_getDependenciesForTrace_args', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependency_getDependenciesForTrace_result.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependency_getDependenciesForTrace_result.php deleted file mode 100644 index ebdd1303e..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependency_getDependenciesForTrace_result.php +++ /dev/null @@ -1,56 +0,0 @@ - array( - 'var' => 'success', - 'isRequired' => false, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Agent\Dependencies', - ), - ); - - /** - * @var \Jaeger\Thrift\Agent\Dependencies - */ - public $success = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'Dependency_getDependenciesForTrace_result'; - } - - public function read($input) - { - return $this->_read('Dependency_getDependenciesForTrace_result', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('Dependency_getDependenciesForTrace_result', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependency_saveDependencies_args.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependency_saveDependencies_args.php deleted file mode 100644 index 0d250c297..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependency_saveDependencies_args.php +++ /dev/null @@ -1,56 +0,0 @@ - array( - 'var' => 'dependencies', - 'isRequired' => false, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Agent\Dependencies', - ), - ); - - /** - * @var \Jaeger\Thrift\Agent\Dependencies - */ - public $dependencies = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'Dependency_saveDependencies_args'; - } - - public function read($input) - { - return $this->_read('Dependency_saveDependencies_args', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('Dependency_saveDependencies_args', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/OperationSamplingStrategy.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/OperationSamplingStrategy.php deleted file mode 100644 index 7532a7b50..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/OperationSamplingStrategy.php +++ /dev/null @@ -1,66 +0,0 @@ - array( - 'var' => 'operation', - 'isRequired' => true, - 'type' => TType::STRING, - ), - 2 => array( - 'var' => 'probabilisticSampling', - 'isRequired' => true, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Agent\ProbabilisticSamplingStrategy', - ), - ); - - /** - * @var string - */ - public $operation = null; - /** - * @var \Jaeger\Thrift\Agent\ProbabilisticSamplingStrategy - */ - public $probabilisticSampling = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'OperationSamplingStrategy'; - } - - public function read($input) - { - return $this->_read('OperationSamplingStrategy', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('OperationSamplingStrategy', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/PerOperationSamplingStrategies.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/PerOperationSamplingStrategies.php deleted file mode 100644 index 2a6ae8a61..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/PerOperationSamplingStrategies.php +++ /dev/null @@ -1,88 +0,0 @@ - array( - 'var' => 'defaultSamplingProbability', - 'isRequired' => true, - 'type' => TType::DOUBLE, - ), - 2 => array( - 'var' => 'defaultLowerBoundTracesPerSecond', - 'isRequired' => true, - 'type' => TType::DOUBLE, - ), - 3 => array( - 'var' => 'perOperationStrategies', - 'isRequired' => true, - 'type' => TType::LST, - 'etype' => TType::STRUCT, - 'elem' => array( - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Agent\OperationSamplingStrategy', - ), - ), - 4 => array( - 'var' => 'defaultUpperBoundTracesPerSecond', - 'isRequired' => false, - 'type' => TType::DOUBLE, - ), - ); - - /** - * @var double - */ - public $defaultSamplingProbability = null; - /** - * @var double - */ - public $defaultLowerBoundTracesPerSecond = null; - /** - * @var \Jaeger\Thrift\Agent\OperationSamplingStrategy[] - */ - public $perOperationStrategies = null; - /** - * @var double - */ - public $defaultUpperBoundTracesPerSecond = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'PerOperationSamplingStrategies'; - } - - public function read($input) - { - return $this->_read('PerOperationSamplingStrategies', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('PerOperationSamplingStrategies', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/ProbabilisticSamplingStrategy.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/ProbabilisticSamplingStrategy.php deleted file mode 100644 index 708ceb9a4..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/ProbabilisticSamplingStrategy.php +++ /dev/null @@ -1,56 +0,0 @@ - array( - 'var' => 'samplingRate', - 'isRequired' => true, - 'type' => TType::DOUBLE, - ), - ); - - /** - * @var double - */ - public $samplingRate = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'ProbabilisticSamplingStrategy'; - } - - public function read($input) - { - return $this->_read('ProbabilisticSamplingStrategy', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('ProbabilisticSamplingStrategy', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/RateLimitingSamplingStrategy.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/RateLimitingSamplingStrategy.php deleted file mode 100644 index d5502e8ee..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/RateLimitingSamplingStrategy.php +++ /dev/null @@ -1,56 +0,0 @@ - array( - 'var' => 'maxTracesPerSecond', - 'isRequired' => true, - 'type' => TType::I16, - ), - ); - - /** - * @var int - */ - public $maxTracesPerSecond = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'RateLimitingSamplingStrategy'; - } - - public function read($input) - { - return $this->_read('RateLimitingSamplingStrategy', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('RateLimitingSamplingStrategy', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManagerClient.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManagerClient.php deleted file mode 100644 index 9f5494a91..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManagerClient.php +++ /dev/null @@ -1,83 +0,0 @@ -input_ = $input; - $this->output_ = $output ? $output : $input; - } - - public function getSamplingStrategy($serviceName) - { - $this->send_getSamplingStrategy($serviceName); - return $this->recv_getSamplingStrategy(); - } - - public function send_getSamplingStrategy($serviceName) - { - $args = new \Jaeger\Thrift\Agent\SamplingManager_getSamplingStrategy_args(); - $args->serviceName = $serviceName; - $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); - if ($bin_accel) - { - thrift_protocol_write_binary($this->output_, 'getSamplingStrategy', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); - } - else - { - $this->output_->writeMessageBegin('getSamplingStrategy', TMessageType::CALL, $this->seqid_); - $args->write($this->output_); - $this->output_->writeMessageEnd(); - $this->output_->getTransport()->flush(); - } - } - - public function recv_getSamplingStrategy() - { - $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); - if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Jaeger\Thrift\Agent\SamplingManager_getSamplingStrategy_result', $this->input_->isStrictRead()); - else - { - $rseqid = 0; - $fname = null; - $mtype = 0; - - $this->input_->readMessageBegin($fname, $mtype, $rseqid); - if ($mtype == TMessageType::EXCEPTION) { - $x = new TApplicationException(); - $x->read($this->input_); - $this->input_->readMessageEnd(); - throw $x; - } - $result = new \Jaeger\Thrift\Agent\SamplingManager_getSamplingStrategy_result(); - $result->read($this->input_); - $this->input_->readMessageEnd(); - } - if ($result->success !== null) { - return $result->success; - } - throw new \Exception("getSamplingStrategy failed: unknown result"); - } - -} - - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManagerIf.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManagerIf.php deleted file mode 100644 index ef17cf308..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManagerIf.php +++ /dev/null @@ -1,27 +0,0 @@ - array( - 'var' => 'serviceName', - 'isRequired' => false, - 'type' => TType::STRING, - ), - ); - - /** - * @var string - */ - public $serviceName = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'SamplingManager_getSamplingStrategy_args'; - } - - public function read($input) - { - return $this->_read('SamplingManager_getSamplingStrategy_args', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('SamplingManager_getSamplingStrategy_args', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManager_getSamplingStrategy_result.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManager_getSamplingStrategy_result.php deleted file mode 100644 index 79e6dce58..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManager_getSamplingStrategy_result.php +++ /dev/null @@ -1,56 +0,0 @@ - array( - 'var' => 'success', - 'isRequired' => false, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Agent\SamplingStrategyResponse', - ), - ); - - /** - * @var \Jaeger\Thrift\Agent\SamplingStrategyResponse - */ - public $success = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'SamplingManager_getSamplingStrategy_result'; - } - - public function read($input) - { - return $this->_read('SamplingManager_getSamplingStrategy_result', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('SamplingManager_getSamplingStrategy_result', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingStrategyResponse.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingStrategyResponse.php deleted file mode 100644 index bc807a57d..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingStrategyResponse.php +++ /dev/null @@ -1,86 +0,0 @@ - array( - 'var' => 'strategyType', - 'isRequired' => true, - 'type' => TType::I32, - ), - 2 => array( - 'var' => 'probabilisticSampling', - 'isRequired' => false, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Agent\ProbabilisticSamplingStrategy', - ), - 3 => array( - 'var' => 'rateLimitingSampling', - 'isRequired' => false, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Agent\RateLimitingSamplingStrategy', - ), - 4 => array( - 'var' => 'operationSampling', - 'isRequired' => false, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Agent\PerOperationSamplingStrategies', - ), - ); - - /** - * @var int - */ - public $strategyType = null; - /** - * @var \Jaeger\Thrift\Agent\ProbabilisticSamplingStrategy - */ - public $probabilisticSampling = null; - /** - * @var \Jaeger\Thrift\Agent\RateLimitingSamplingStrategy - */ - public $rateLimitingSampling = null; - /** - * @var \Jaeger\Thrift\Agent\PerOperationSamplingStrategies - */ - public $operationSampling = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'SamplingStrategyResponse'; - } - - public function read($input) - { - return $this->_read('SamplingStrategyResponse', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('SamplingStrategyResponse', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingStrategyType.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingStrategyType.php deleted file mode 100644 index c8dff918a..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingStrategyType.php +++ /dev/null @@ -1,28 +0,0 @@ - 'PROBABILISTIC', - 1 => 'RATE_LIMITING', - ); -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/ValidateTraceResponse.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/ValidateTraceResponse.php deleted file mode 100644 index 226f61e80..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/ValidateTraceResponse.php +++ /dev/null @@ -1,65 +0,0 @@ - array( - 'var' => 'ok', - 'isRequired' => true, - 'type' => TType::BOOL, - ), - 2 => array( - 'var' => 'traceCount', - 'isRequired' => true, - 'type' => TType::I64, - ), - ); - - /** - * @var bool - */ - public $ok = null; - /** - * @var int - */ - public $traceCount = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'ValidateTraceResponse'; - } - - public function read($input) - { - return $this->_read('ValidateTraceResponse', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('ValidateTraceResponse', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Annotation.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Annotation.php deleted file mode 100644 index e7e48dade..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Annotation.php +++ /dev/null @@ -1,87 +0,0 @@ - array( - 'var' => 'timestamp', - 'isRequired' => false, - 'type' => TType::I64, - ), - 2 => array( - 'var' => 'value', - 'isRequired' => false, - 'type' => TType::STRING, - ), - 3 => array( - 'var' => 'host', - 'isRequired' => false, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Agent\Zipkin\Endpoint', - ), - ); - - /** - * Microseconds from epoch. - * - * This value should use the most precise value possible. For example, - * gettimeofday or syncing nanoTime against a tick of currentTimeMillis. - * - * @var int - */ - public $timestamp = null; - /** - * @var string - */ - public $value = null; - /** - * Always the host that recorded the event. By specifying the host you allow - * rollup of all events (such as client requests to a service) by IP address. - * - * @var \Jaeger\Thrift\Agent\Zipkin\Endpoint - */ - public $host = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'Annotation'; - } - - public function read($input) - { - return $this->_read('Annotation', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('Annotation', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/AnnotationType.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/AnnotationType.php deleted file mode 100644 index e21c0b0d8..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/AnnotationType.php +++ /dev/null @@ -1,38 +0,0 @@ - 'BOOL', - 1 => 'BYTES', - 2 => 'I16', - 3 => 'I32', - 4 => 'I64', - 5 => 'DOUBLE', - 6 => 'STRING', - ); -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/BinaryAnnotation.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/BinaryAnnotation.php deleted file mode 100644 index 806a74831..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/BinaryAnnotation.php +++ /dev/null @@ -1,106 +0,0 @@ - array( - 'var' => 'key', - 'isRequired' => false, - 'type' => TType::STRING, - ), - 2 => array( - 'var' => 'value', - 'isRequired' => false, - 'type' => TType::STRING, - ), - 3 => array( - 'var' => 'annotation_type', - 'isRequired' => false, - 'type' => TType::I32, - ), - 4 => array( - 'var' => 'host', - 'isRequired' => false, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Agent\Zipkin\Endpoint', - ), - ); - - /** - * @var string - */ - public $key = null; - /** - * @var string - */ - public $value = null; - /** - * @var int - */ - public $annotation_type = null; - /** - * The host that recorded tag, which allows you to differentiate between - * multiple tags with the same key. There are two exceptions to this. - * - * When the key is CLIENT_ADDR or SERVER_ADDR, host indicates the source or - * destination of an RPC. This exception allows zipkin to display network - * context of uninstrumented services, or clients such as web browsers. - * - * @var \Jaeger\Thrift\Agent\Zipkin\Endpoint - */ - public $host = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'BinaryAnnotation'; - } - - public function read($input) - { - return $this->_read('BinaryAnnotation', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('BinaryAnnotation', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Constant.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Constant.php deleted file mode 100644 index ebfcebe48..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Constant.php +++ /dev/null @@ -1,246 +0,0 @@ - array( - 'var' => 'ipv4', - 'isRequired' => false, - 'type' => TType::I32, - ), - 2 => array( - 'var' => 'port', - 'isRequired' => false, - 'type' => TType::I16, - ), - 3 => array( - 'var' => 'service_name', - 'isRequired' => false, - 'type' => TType::STRING, - ), - 4 => array( - 'var' => 'ipv6', - 'isRequired' => false, - 'type' => TType::STRING, - ), - ); - - /** - * IPv4 host address packed into 4 bytes. - * - * Ex for the ip 1.2.3.4, it would be (1 << 24) | (2 << 16) | (3 << 8) | 4 - * - * @var int - */ - public $ipv4 = null; - /** - * IPv4 port - * - * Note: this is to be treated as an unsigned integer, so watch for negatives. - * - * Conventionally, when the port isn't known, port = 0. - * - * @var int - */ - public $port = null; - /** - * Service name in lowercase, such as "memcache" or "zipkin-web" - * - * Conventionally, when the service name isn't known, service_name = "unknown". - * - * @var string - */ - public $service_name = null; - /** - * IPv6 host address packed into 16 bytes. Ex Inet6Address.getBytes() - * - * @var string - */ - public $ipv6 = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'Endpoint'; - } - - public function read($input) - { - return $this->_read('Endpoint', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('Endpoint', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Response.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Response.php deleted file mode 100644 index 88c7f5e5d..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Response.php +++ /dev/null @@ -1,56 +0,0 @@ - array( - 'var' => 'ok', - 'isRequired' => true, - 'type' => TType::BOOL, - ), - ); - - /** - * @var bool - */ - public $ok = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'Response'; - } - - public function read($input) - { - return $this->_read('Response', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('Response', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Span.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Span.php deleted file mode 100644 index 32a69b645..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Span.php +++ /dev/null @@ -1,190 +0,0 @@ - array( - 'var' => 'trace_id', - 'isRequired' => false, - 'type' => TType::I64, - ), - 3 => array( - 'var' => 'name', - 'isRequired' => false, - 'type' => TType::STRING, - ), - 4 => array( - 'var' => 'id', - 'isRequired' => false, - 'type' => TType::I64, - ), - 5 => array( - 'var' => 'parent_id', - 'isRequired' => false, - 'type' => TType::I64, - ), - 6 => array( - 'var' => 'annotations', - 'isRequired' => false, - 'type' => TType::LST, - 'etype' => TType::STRUCT, - 'elem' => array( - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Agent\Zipkin\Annotation', - ), - ), - 8 => array( - 'var' => 'binary_annotations', - 'isRequired' => false, - 'type' => TType::LST, - 'etype' => TType::STRUCT, - 'elem' => array( - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Agent\Zipkin\BinaryAnnotation', - ), - ), - 9 => array( - 'var' => 'debug', - 'isRequired' => false, - 'type' => TType::BOOL, - ), - 10 => array( - 'var' => 'timestamp', - 'isRequired' => false, - 'type' => TType::I64, - ), - 11 => array( - 'var' => 'duration', - 'isRequired' => false, - 'type' => TType::I64, - ), - 12 => array( - 'var' => 'trace_id_high', - 'isRequired' => false, - 'type' => TType::I64, - ), - ); - - /** - * @var int - */ - public $trace_id = null; - /** - * Span name in lowercase, rpc method for example - * - * Conventionally, when the span name isn't known, name = "unknown". - * - * @var string - */ - public $name = null; - /** - * @var int - */ - public $id = null; - /** - * @var int - */ - public $parent_id = null; - /** - * @var \Jaeger\Thrift\Agent\Zipkin\Annotation[] - */ - public $annotations = null; - /** - * @var \Jaeger\Thrift\Agent\Zipkin\BinaryAnnotation[] - */ - public $binary_annotations = null; - /** - * @var bool - */ - public $debug = false; - /** - * Microseconds from epoch of the creation of this span. - * - * This value should be set directly by instrumentation, using the most - * precise value possible. For example, gettimeofday or syncing nanoTime - * against a tick of currentTimeMillis. - * - * For compatibilty with instrumentation that precede this field, collectors - * or span stores can derive this via Annotation.timestamp. - * For example, SERVER_RECV.timestamp or CLIENT_SEND.timestamp. - * - * This field is optional for compatibility with old data: first-party span - * stores are expected to support this at time of introduction. - * - * @var int - */ - public $timestamp = null; - /** - * Measurement of duration in microseconds, used to support queries. - * - * This value should be set directly, where possible. Doing so encourages - * precise measurement decoupled from problems of clocks, such as skew or NTP - * updates causing time to move backwards. - * - * For compatibilty with instrumentation that precede this field, collectors - * or span stores can derive this by subtracting Annotation.timestamp. - * For example, SERVER_SEND.timestamp - SERVER_RECV.timestamp. - * - * If this field is persisted as unset, zipkin will continue to work, except - * duration query support will be implementation-specific. Similarly, setting - * this field non-atomically is implementation-specific. - * - * This field is i64 vs i32 to support spans longer than 35 minutes. - * - * @var int - */ - public $duration = null; - /** - * Optional unique 8-byte additional identifier for a trace. If non zero, this - * means the trace uses 128 bit traceIds instead of 64 bit. - * - * @var int - */ - public $trace_id_high = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'Span'; - } - - public function read($input) - { - return $this->_read('Span', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('Span', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollectorClient.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollectorClient.php deleted file mode 100644 index 2978675c4..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollectorClient.php +++ /dev/null @@ -1,83 +0,0 @@ -input_ = $input; - $this->output_ = $output ? $output : $input; - } - - public function submitZipkinBatch(array $spans) - { - $this->send_submitZipkinBatch($spans); - return $this->recv_submitZipkinBatch(); - } - - public function send_submitZipkinBatch(array $spans) - { - $args = new \Jaeger\Thrift\Agent\Zipkin\ZipkinCollector_submitZipkinBatch_args(); - $args->spans = $spans; - $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); - if ($bin_accel) - { - thrift_protocol_write_binary($this->output_, 'submitZipkinBatch', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); - } - else - { - $this->output_->writeMessageBegin('submitZipkinBatch', TMessageType::CALL, $this->seqid_); - $args->write($this->output_); - $this->output_->writeMessageEnd(); - $this->output_->getTransport()->flush(); - } - } - - public function recv_submitZipkinBatch() - { - $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); - if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Jaeger\Thrift\Agent\Zipkin\ZipkinCollector_submitZipkinBatch_result', $this->input_->isStrictRead()); - else - { - $rseqid = 0; - $fname = null; - $mtype = 0; - - $this->input_->readMessageBegin($fname, $mtype, $rseqid); - if ($mtype == TMessageType::EXCEPTION) { - $x = new TApplicationException(); - $x->read($this->input_); - $this->input_->readMessageEnd(); - throw $x; - } - $result = new \Jaeger\Thrift\Agent\Zipkin\ZipkinCollector_submitZipkinBatch_result(); - $result->read($this->input_); - $this->input_->readMessageEnd(); - } - if ($result->success !== null) { - return $result->success; - } - throw new \Exception("submitZipkinBatch failed: unknown result"); - } - -} - - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollectorIf.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollectorIf.php deleted file mode 100644 index 83abf8119..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollectorIf.php +++ /dev/null @@ -1,27 +0,0 @@ - array( - 'var' => 'spans', - 'isRequired' => false, - 'type' => TType::LST, - 'etype' => TType::STRUCT, - 'elem' => array( - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Agent\Zipkin\Span', - ), - ), - ); - - /** - * @var \Jaeger\Thrift\Agent\Zipkin\Span[] - */ - public $spans = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'ZipkinCollector_submitZipkinBatch_args'; - } - - public function read($input) - { - return $this->_read('ZipkinCollector_submitZipkinBatch_args', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('ZipkinCollector_submitZipkinBatch_args', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollector_submitZipkinBatch_result.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollector_submitZipkinBatch_result.php deleted file mode 100644 index faf165446..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollector_submitZipkinBatch_result.php +++ /dev/null @@ -1,60 +0,0 @@ - array( - 'var' => 'success', - 'isRequired' => false, - 'type' => TType::LST, - 'etype' => TType::STRUCT, - 'elem' => array( - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Agent\Zipkin\Response', - ), - ), - ); - - /** - * @var \Jaeger\Thrift\Agent\Zipkin\Response[] - */ - public $success = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'ZipkinCollector_submitZipkinBatch_result'; - } - - public function read($input) - { - return $this->_read('ZipkinCollector_submitZipkinBatch_result', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('ZipkinCollector_submitZipkinBatch_result', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Batch.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Batch.php deleted file mode 100644 index 56e9e5206..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Batch.php +++ /dev/null @@ -1,71 +0,0 @@ - array( - 'var' => 'process', - 'isRequired' => true, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Process', - ), - 2 => array( - 'var' => 'spans', - 'isRequired' => true, - 'type' => TType::LST, - 'etype' => TType::STRUCT, - 'elem' => array( - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Span', - ), - ), - ); - - /** - * @var \Jaeger\Thrift\Process - */ - public $process = null; - /** - * @var \Jaeger\Thrift\Span[] - */ - public $spans = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'Batch'; - } - - public function read($input) - { - return $this->_read('Batch', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('Batch', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/BatchSubmitResponse.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/BatchSubmitResponse.php deleted file mode 100644 index 7ddc25eb5..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/BatchSubmitResponse.php +++ /dev/null @@ -1,56 +0,0 @@ - array( - 'var' => 'ok', - 'isRequired' => true, - 'type' => TType::BOOL, - ), - ); - - /** - * @var bool - */ - public $ok = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'BatchSubmitResponse'; - } - - public function read($input) - { - return $this->_read('BatchSubmitResponse', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('BatchSubmitResponse', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/CollectorClient.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/CollectorClient.php deleted file mode 100644 index e3c6e14c1..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/CollectorClient.php +++ /dev/null @@ -1,83 +0,0 @@ -input_ = $input; - $this->output_ = $output ? $output : $input; - } - - public function submitBatches(array $batches) - { - $this->send_submitBatches($batches); - return $this->recv_submitBatches(); - } - - public function send_submitBatches(array $batches) - { - $args = new \Jaeger\Thrift\Collector_submitBatches_args(); - $args->batches = $batches; - $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); - if ($bin_accel) - { - thrift_protocol_write_binary($this->output_, 'submitBatches', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); - } - else - { - $this->output_->writeMessageBegin('submitBatches', TMessageType::CALL, $this->seqid_); - $args->write($this->output_); - $this->output_->writeMessageEnd(); - $this->output_->getTransport()->flush(); - } - } - - public function recv_submitBatches() - { - $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); - if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Jaeger\Thrift\Collector_submitBatches_result', $this->input_->isStrictRead()); - else - { - $rseqid = 0; - $fname = null; - $mtype = 0; - - $this->input_->readMessageBegin($fname, $mtype, $rseqid); - if ($mtype == TMessageType::EXCEPTION) { - $x = new TApplicationException(); - $x->read($this->input_); - $this->input_->readMessageEnd(); - throw $x; - } - $result = new \Jaeger\Thrift\Collector_submitBatches_result(); - $result->read($this->input_); - $this->input_->readMessageEnd(); - } - if ($result->success !== null) { - return $result->success; - } - throw new \Exception("submitBatches failed: unknown result"); - } - -} - - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/CollectorIf.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/CollectorIf.php deleted file mode 100644 index da4f023ec..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/CollectorIf.php +++ /dev/null @@ -1,27 +0,0 @@ - array( - 'var' => 'batches', - 'isRequired' => false, - 'type' => TType::LST, - 'etype' => TType::STRUCT, - 'elem' => array( - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Batch', - ), - ), - ); - - /** - * @var \Jaeger\Thrift\Batch[] - */ - public $batches = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'Collector_submitBatches_args'; - } - - public function read($input) - { - return $this->_read('Collector_submitBatches_args', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('Collector_submitBatches_args', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Collector_submitBatches_result.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Collector_submitBatches_result.php deleted file mode 100644 index aae083707..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Collector_submitBatches_result.php +++ /dev/null @@ -1,60 +0,0 @@ - array( - 'var' => 'success', - 'isRequired' => false, - 'type' => TType::LST, - 'etype' => TType::STRUCT, - 'elem' => array( - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\BatchSubmitResponse', - ), - ), - ); - - /** - * @var \Jaeger\Thrift\BatchSubmitResponse[] - */ - public $success = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'Collector_submitBatches_result'; - } - - public function read($input) - { - return $this->_read('Collector_submitBatches_result', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('Collector_submitBatches_result', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/Downstream.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/Downstream.php deleted file mode 100644 index 92b269aa6..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/Downstream.php +++ /dev/null @@ -1,102 +0,0 @@ - array( - 'var' => 'serviceName', - 'isRequired' => true, - 'type' => TType::STRING, - ), - 2 => array( - 'var' => 'serverRole', - 'isRequired' => true, - 'type' => TType::STRING, - ), - 3 => array( - 'var' => 'host', - 'isRequired' => true, - 'type' => TType::STRING, - ), - 4 => array( - 'var' => 'port', - 'isRequired' => true, - 'type' => TType::STRING, - ), - 5 => array( - 'var' => 'transport', - 'isRequired' => true, - 'type' => TType::I32, - ), - 6 => array( - 'var' => 'downstream', - 'isRequired' => false, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Crossdock\Downstream', - ), - ); - - /** - * @var string - */ - public $serviceName = null; - /** - * @var string - */ - public $serverRole = null; - /** - * @var string - */ - public $host = null; - /** - * @var string - */ - public $port = null; - /** - * @var int - */ - public $transport = null; - /** - * @var \Jaeger\Thrift\Crossdock\Downstream - */ - public $downstream = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'Downstream'; - } - - public function read($input) - { - return $this->_read('Downstream', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('Downstream', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/JoinTraceRequest.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/JoinTraceRequest.php deleted file mode 100644 index 39e6242b7..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/JoinTraceRequest.php +++ /dev/null @@ -1,66 +0,0 @@ - array( - 'var' => 'serverRole', - 'isRequired' => true, - 'type' => TType::STRING, - ), - 2 => array( - 'var' => 'downstream', - 'isRequired' => false, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Crossdock\Downstream', - ), - ); - - /** - * @var string - */ - public $serverRole = null; - /** - * @var \Jaeger\Thrift\Crossdock\Downstream - */ - public $downstream = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'JoinTraceRequest'; - } - - public function read($input) - { - return $this->_read('JoinTraceRequest', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('JoinTraceRequest', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/ObservedSpan.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/ObservedSpan.php deleted file mode 100644 index d60331851..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/ObservedSpan.php +++ /dev/null @@ -1,74 +0,0 @@ - array( - 'var' => 'traceId', - 'isRequired' => true, - 'type' => TType::STRING, - ), - 2 => array( - 'var' => 'sampled', - 'isRequired' => true, - 'type' => TType::BOOL, - ), - 3 => array( - 'var' => 'baggage', - 'isRequired' => true, - 'type' => TType::STRING, - ), - ); - - /** - * @var string - */ - public $traceId = null; - /** - * @var bool - */ - public $sampled = null; - /** - * @var string - */ - public $baggage = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'ObservedSpan'; - } - - public function read($input) - { - return $this->_read('ObservedSpan', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('ObservedSpan', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/StartTraceRequest.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/StartTraceRequest.php deleted file mode 100644 index 50b9c6668..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/StartTraceRequest.php +++ /dev/null @@ -1,84 +0,0 @@ - array( - 'var' => 'serverRole', - 'isRequired' => true, - 'type' => TType::STRING, - ), - 2 => array( - 'var' => 'sampled', - 'isRequired' => true, - 'type' => TType::BOOL, - ), - 3 => array( - 'var' => 'baggage', - 'isRequired' => true, - 'type' => TType::STRING, - ), - 4 => array( - 'var' => 'downstream', - 'isRequired' => true, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Crossdock\Downstream', - ), - ); - - /** - * @var string - */ - public $serverRole = null; - /** - * @var bool - */ - public $sampled = null; - /** - * @var string - */ - public $baggage = null; - /** - * @var \Jaeger\Thrift\Crossdock\Downstream - */ - public $downstream = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'StartTraceRequest'; - } - - public function read($input) - { - return $this->_read('StartTraceRequest', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('StartTraceRequest', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TraceResponse.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TraceResponse.php deleted file mode 100644 index 107d4e26d..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TraceResponse.php +++ /dev/null @@ -1,82 +0,0 @@ - array( - 'var' => 'span', - 'isRequired' => false, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Crossdock\ObservedSpan', - ), - 2 => array( - 'var' => 'downstream', - 'isRequired' => false, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Crossdock\TraceResponse', - ), - 3 => array( - 'var' => 'notImplementedError', - 'isRequired' => true, - 'type' => TType::STRING, - ), - ); - - /** - * @var \Jaeger\Thrift\Crossdock\ObservedSpan - */ - public $span = null; - /** - * @var \Jaeger\Thrift\Crossdock\TraceResponse - */ - public $downstream = null; - /** - * @var string - */ - public $notImplementedError = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'TraceResponse'; - } - - public function read($input) - { - return $this->_read('TraceResponse', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('TraceResponse', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedServiceClient.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedServiceClient.php deleted file mode 100644 index 2fd8b4fc9..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedServiceClient.php +++ /dev/null @@ -1,134 +0,0 @@ -input_ = $input; - $this->output_ = $output ? $output : $input; - } - - public function startTrace(\Jaeger\Thrift\Crossdock\StartTraceRequest $request) - { - $this->send_startTrace($request); - return $this->recv_startTrace(); - } - - public function send_startTrace(\Jaeger\Thrift\Crossdock\StartTraceRequest $request) - { - $args = new \Jaeger\Thrift\Crossdock\TracedService_startTrace_args(); - $args->request = $request; - $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); - if ($bin_accel) - { - thrift_protocol_write_binary($this->output_, 'startTrace', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); - } - else - { - $this->output_->writeMessageBegin('startTrace', TMessageType::CALL, $this->seqid_); - $args->write($this->output_); - $this->output_->writeMessageEnd(); - $this->output_->getTransport()->flush(); - } - } - - public function recv_startTrace() - { - $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); - if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Jaeger\Thrift\Crossdock\TracedService_startTrace_result', $this->input_->isStrictRead()); - else - { - $rseqid = 0; - $fname = null; - $mtype = 0; - - $this->input_->readMessageBegin($fname, $mtype, $rseqid); - if ($mtype == TMessageType::EXCEPTION) { - $x = new TApplicationException(); - $x->read($this->input_); - $this->input_->readMessageEnd(); - throw $x; - } - $result = new \Jaeger\Thrift\Crossdock\TracedService_startTrace_result(); - $result->read($this->input_); - $this->input_->readMessageEnd(); - } - if ($result->success !== null) { - return $result->success; - } - throw new \Exception("startTrace failed: unknown result"); - } - - public function joinTrace(\Jaeger\Thrift\Crossdock\JoinTraceRequest $request) - { - $this->send_joinTrace($request); - return $this->recv_joinTrace(); - } - - public function send_joinTrace(\Jaeger\Thrift\Crossdock\JoinTraceRequest $request) - { - $args = new \Jaeger\Thrift\Crossdock\TracedService_joinTrace_args(); - $args->request = $request; - $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); - if ($bin_accel) - { - thrift_protocol_write_binary($this->output_, 'joinTrace', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); - } - else - { - $this->output_->writeMessageBegin('joinTrace', TMessageType::CALL, $this->seqid_); - $args->write($this->output_); - $this->output_->writeMessageEnd(); - $this->output_->getTransport()->flush(); - } - } - - public function recv_joinTrace() - { - $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); - if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Jaeger\Thrift\Crossdock\TracedService_joinTrace_result', $this->input_->isStrictRead()); - else - { - $rseqid = 0; - $fname = null; - $mtype = 0; - - $this->input_->readMessageBegin($fname, $mtype, $rseqid); - if ($mtype == TMessageType::EXCEPTION) { - $x = new TApplicationException(); - $x->read($this->input_); - $this->input_->readMessageEnd(); - throw $x; - } - $result = new \Jaeger\Thrift\Crossdock\TracedService_joinTrace_result(); - $result->read($this->input_); - $this->input_->readMessageEnd(); - } - if ($result->success !== null) { - return $result->success; - } - throw new \Exception("joinTrace failed: unknown result"); - } - -} - - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedServiceIf.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedServiceIf.php deleted file mode 100644 index e2dd9a8eb..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedServiceIf.php +++ /dev/null @@ -1,40 +0,0 @@ - array( - 'var' => 'request', - 'isRequired' => false, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Crossdock\JoinTraceRequest', - ), - ); - - /** - * @var \Jaeger\Thrift\Crossdock\JoinTraceRequest - */ - public $request = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'TracedService_joinTrace_args'; - } - - public function read($input) - { - return $this->_read('TracedService_joinTrace_args', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('TracedService_joinTrace_args', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_joinTrace_result.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_joinTrace_result.php deleted file mode 100644 index 26ebd7124..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_joinTrace_result.php +++ /dev/null @@ -1,56 +0,0 @@ - array( - 'var' => 'success', - 'isRequired' => false, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Crossdock\TraceResponse', - ), - ); - - /** - * @var \Jaeger\Thrift\Crossdock\TraceResponse - */ - public $success = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'TracedService_joinTrace_result'; - } - - public function read($input) - { - return $this->_read('TracedService_joinTrace_result', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('TracedService_joinTrace_result', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_startTrace_args.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_startTrace_args.php deleted file mode 100644 index cabc260ea..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_startTrace_args.php +++ /dev/null @@ -1,56 +0,0 @@ - array( - 'var' => 'request', - 'isRequired' => false, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Crossdock\StartTraceRequest', - ), - ); - - /** - * @var \Jaeger\Thrift\Crossdock\StartTraceRequest - */ - public $request = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'TracedService_startTrace_args'; - } - - public function read($input) - { - return $this->_read('TracedService_startTrace_args', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('TracedService_startTrace_args', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_startTrace_result.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_startTrace_result.php deleted file mode 100644 index f4b114e64..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_startTrace_result.php +++ /dev/null @@ -1,56 +0,0 @@ - array( - 'var' => 'success', - 'isRequired' => false, - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Crossdock\TraceResponse', - ), - ); - - /** - * @var \Jaeger\Thrift\Crossdock\TraceResponse - */ - public $success = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'TracedService_startTrace_result'; - } - - public function read($input) - { - return $this->_read('TracedService_startTrace_result', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('TracedService_startTrace_result', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/Transport.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/Transport.php deleted file mode 100644 index 1b71e686b..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/Transport.php +++ /dev/null @@ -1,30 +0,0 @@ - 'HTTP', - 1 => 'TCHANNEL', - 2 => 'DUMMY', - ); -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Log.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Log.php deleted file mode 100644 index 809a92d7c..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Log.php +++ /dev/null @@ -1,70 +0,0 @@ - array( - 'var' => 'timestamp', - 'isRequired' => true, - 'type' => TType::I64, - ), - 2 => array( - 'var' => 'fields', - 'isRequired' => true, - 'type' => TType::LST, - 'etype' => TType::STRUCT, - 'elem' => array( - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Tag', - ), - ), - ); - - /** - * @var int - */ - public $timestamp = null; - /** - * @var \Jaeger\Thrift\Tag[] - */ - public $fields = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'Log'; - } - - public function read($input) - { - return $this->_read('Log', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('Log', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Process.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Process.php deleted file mode 100644 index 3b925220a..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Process.php +++ /dev/null @@ -1,70 +0,0 @@ - array( - 'var' => 'serviceName', - 'isRequired' => true, - 'type' => TType::STRING, - ), - 2 => array( - 'var' => 'tags', - 'isRequired' => false, - 'type' => TType::LST, - 'etype' => TType::STRUCT, - 'elem' => array( - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Tag', - ), - ), - ); - - /** - * @var string - */ - public $serviceName = null; - /** - * @var \Jaeger\Thrift\Tag[] - */ - public $tags = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'Process'; - } - - public function read($input) - { - return $this->_read('Process', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('Process', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Span.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Span.php deleted file mode 100644 index cff0c324d..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Span.php +++ /dev/null @@ -1,161 +0,0 @@ - array( - 'var' => 'traceIdLow', - 'isRequired' => true, - 'type' => TType::I64, - ), - 2 => array( - 'var' => 'traceIdHigh', - 'isRequired' => true, - 'type' => TType::I64, - ), - 3 => array( - 'var' => 'spanId', - 'isRequired' => true, - 'type' => TType::I64, - ), - 4 => array( - 'var' => 'parentSpanId', - 'isRequired' => true, - 'type' => TType::I64, - ), - 5 => array( - 'var' => 'operationName', - 'isRequired' => true, - 'type' => TType::STRING, - ), - 6 => array( - 'var' => 'references', - 'isRequired' => false, - 'type' => TType::LST, - 'etype' => TType::STRUCT, - 'elem' => array( - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\SpanRef', - ), - ), - 7 => array( - 'var' => 'flags', - 'isRequired' => true, - 'type' => TType::I32, - ), - 8 => array( - 'var' => 'startTime', - 'isRequired' => true, - 'type' => TType::I64, - ), - 9 => array( - 'var' => 'duration', - 'isRequired' => true, - 'type' => TType::I64, - ), - 10 => array( - 'var' => 'tags', - 'isRequired' => false, - 'type' => TType::LST, - 'etype' => TType::STRUCT, - 'elem' => array( - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Tag', - ), - ), - 11 => array( - 'var' => 'logs', - 'isRequired' => false, - 'type' => TType::LST, - 'etype' => TType::STRUCT, - 'elem' => array( - 'type' => TType::STRUCT, - 'class' => '\Jaeger\Thrift\Log', - ), - ), - ); - - /** - * @var int - */ - public $traceIdLow = null; - /** - * @var int - */ - public $traceIdHigh = null; - /** - * @var int - */ - public $spanId = null; - /** - * @var int - */ - public $parentSpanId = null; - /** - * @var string - */ - public $operationName = null; - /** - * @var \Jaeger\Thrift\SpanRef[] - */ - public $references = null; - /** - * @var int - */ - public $flags = null; - /** - * @var int - */ - public $startTime = null; - /** - * @var int - */ - public $duration = null; - /** - * @var \Jaeger\Thrift\Tag[] - */ - public $tags = null; - /** - * @var \Jaeger\Thrift\Log[] - */ - public $logs = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'Span'; - } - - public function read($input) - { - return $this->_read('Span', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('Span', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/SpanRef.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/SpanRef.php deleted file mode 100644 index cb5ee78db..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/SpanRef.php +++ /dev/null @@ -1,83 +0,0 @@ - array( - 'var' => 'refType', - 'isRequired' => true, - 'type' => TType::I32, - ), - 2 => array( - 'var' => 'traceIdLow', - 'isRequired' => true, - 'type' => TType::I64, - ), - 3 => array( - 'var' => 'traceIdHigh', - 'isRequired' => true, - 'type' => TType::I64, - ), - 4 => array( - 'var' => 'spanId', - 'isRequired' => true, - 'type' => TType::I64, - ), - ); - - /** - * @var int - */ - public $refType = null; - /** - * @var int - */ - public $traceIdLow = null; - /** - * @var int - */ - public $traceIdHigh = null; - /** - * @var int - */ - public $spanId = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'SpanRef'; - } - - public function read($input) - { - return $this->_read('SpanRef', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('SpanRef', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/SpanRefType.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/SpanRefType.php deleted file mode 100644 index d6d6f20c3..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/SpanRefType.php +++ /dev/null @@ -1,28 +0,0 @@ - 'CHILD_OF', - 1 => 'FOLLOWS_FROM', - ); -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Tag.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Tag.php deleted file mode 100644 index 06af59939..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Tag.php +++ /dev/null @@ -1,110 +0,0 @@ - array( - 'var' => 'key', - 'isRequired' => true, - 'type' => TType::STRING, - ), - 2 => array( - 'var' => 'vType', - 'isRequired' => true, - 'type' => TType::I32, - ), - 3 => array( - 'var' => 'vStr', - 'isRequired' => false, - 'type' => TType::STRING, - ), - 4 => array( - 'var' => 'vDouble', - 'isRequired' => false, - 'type' => TType::DOUBLE, - ), - 5 => array( - 'var' => 'vBool', - 'isRequired' => false, - 'type' => TType::BOOL, - ), - 6 => array( - 'var' => 'vLong', - 'isRequired' => false, - 'type' => TType::I64, - ), - 7 => array( - 'var' => 'vBinary', - 'isRequired' => false, - 'type' => TType::STRING, - ), - ); - - /** - * @var string - */ - public $key = null; - /** - * @var int - */ - public $vType = null; - /** - * @var string - */ - public $vStr = null; - /** - * @var double - */ - public $vDouble = null; - /** - * @var bool - */ - public $vBool = null; - /** - * @var int - */ - public $vLong = null; - /** - * @var string - */ - public $vBinary = null; - - public function __construct($vals=null) { - if (is_array($vals)) { - parent::__construct(self::$_TSPEC, $vals); - } - } - - public function getName() { - return 'Tag'; - } - - public function read($input) - { - return $this->_read('Tag', self::$_TSPEC, $input); - } - - public function write($output) { - return $this->_write('Tag', self::$_TSPEC, $output); - } - -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/TagType.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/TagType.php deleted file mode 100644 index 3b1f69f9f..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/TagType.php +++ /dev/null @@ -1,34 +0,0 @@ - 'STRING', - 1 => 'DOUBLE', - 2 => 'BOOL', - 3 => 'LONG', - 4 => 'BINARY', - ); -} - diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ThriftUdpTransport.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ThriftUdpTransport.php deleted file mode 100644 index babc689dc..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ThriftUdpTransport.php +++ /dev/null @@ -1,151 +0,0 @@ -setLogger($logger); - - $this->config = $config; - - $ipProtocol = $this->ipProtocolVersion(); - $this->socket = $this->createSocket($ipProtocol); - - $this->host = $host; - $this->port = $port; - } - - protected function setLogger($logger) - { - $this->logger = $logger ?? new NullLogger(); - } - - protected function createSocket(string $ipProtocol) - { - $socketDomain = AF_INET; - if ($ipProtocol === Config::IPV6) { - $socketDomain = AF_INET6; - } - - $socket = @socket_create($socketDomain, SOCK_DGRAM, SOL_UDP); - if ($socket === false) { - $this->handleSocketError("socket_create failed"); - } - return $socket; - } - - protected function ipProtocolVersion() - { - if (!empty($this->config)) { - return $this->config->ipProtocolVersion(); - } - return ""; - } - - /** - * Whether this transport is open. - * - * @return boolean true if open - */ - public function isOpen() - { - return $this->socket !== null; - } - - /** - * Open the transport for reading/writing - */ - public function open() - { - $ok = @socket_connect($this->socket, $this->host, $this->port); - if ($ok === false) { - $this->handleSocketError('socket_connect failed'); - } - } - - /** - * Close the transport. - */ - public function close() - { - if (is_null($this->socket)) { - $this->logger->warning("can't close empty socket"); - return ; - } - - @socket_close($this->socket); - $this->socket = null; - } - - /** - * Read some data into the array. - * - * @todo - * - * @param int $len How much to read - * @return string The data that has been read - */ - public function read($len) - { - } - - /** - * Writes the given data out. - * - * @param string $buf The data to write - */ - public function write($buf) - { - if (!$this->isOpen()) { - $this->logger->warning('transport is closed'); - return ; - } - - $ok = @socket_write($this->socket, $buf); - if ($ok === false) { - $this->handleSocketError("socket_write failed"); - } - } - - public function handleSocketError($msg) - { - $errorCode = socket_last_error($this->socket); - $errorMsg = socket_strerror($errorCode); - - $this->logger->warning(sprintf('%s: [code - %d] %s', $msg, $errorCode, $errorMsg)); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Tracer.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Tracer.php deleted file mode 100644 index bb0649a0b..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Tracer.php +++ /dev/null @@ -1,420 +0,0 @@ -serviceName = $serviceName; - $this->reporter = $reporter; - $this->sampler = $sampler; - $this->oneSpanPerRpc = $oneSpanPerRpc; - - $this->logger = $logger ?? new NullLogger(); - $this->scopeManager = $scopeManager ?? new ScopeManager(); - - $this->debugIdHeader = $debugIdHeader; - - $this->codecs = [ - TEXT_MAP => new TextCodec( - false, - $traceIdHeader, - $baggageHeaderPrefix, - $debugIdHeader - ), - HTTP_HEADERS => new TextCodec( - true, - $traceIdHeader, - $baggageHeaderPrefix, - $debugIdHeader - ), - BINARY => new BinaryCodec(), - ZIPKIN_SPAN_FORMAT => new ZipkinCodec(), - ]; - - $this->tags = [ - JAEGER_VERSION_TAG_KEY => JAEGER_CLIENT_VERSION, - ]; - if ($tags !== null) { - $this->tags = array_merge($this->tags, $tags); - } - - $hostname = $this->getHostName(); - $this->ipAddress = $this->getHostByName($hostname); - - if (!empty($hostname)) { - $this->tags[JAEGER_HOSTNAME_TAG_KEY] = $hostname; - } - } - - /** - * @return string[] - */ - public function getTags(): array - { - return $this->tags; - } - - /** - * {@inheritdoc} - */ - public function startSpan(string $operationName, $options = []): OTSpan - { - if (!($options instanceof StartSpanOptions)) { - $options = StartSpanOptions::create($options); - } - - $parent = $this->getParentSpanContext($options); - $tags = $options->getTags(); - - $rpcServer = ($tags[SPAN_KIND] ?? null) == SPAN_KIND_RPC_SERVER; - - if ($parent == null || $parent->isDebugIdContainerOnly()) { - $traceId = $this->randomId(); - $spanId = $traceId; - $parentId = null; - $flags = 0; - $baggage = null; - if ($parent == null) { - list($sampled, $samplerTags) = $this->sampler->isSampled($traceId, $operationName); - if ($sampled) { - $flags = SAMPLED_FLAG; - $tags = $tags ?? []; - foreach ($samplerTags as $key => $value) { - $tags[$key] = $value; - } - } - } else { // have debug id - $flags = SAMPLED_FLAG | DEBUG_FLAG; - $tags = $tags ?? []; - $tags[$this->debugIdHeader] = $parent->getDebugId(); - } - } else { - $traceId = $parent->getTraceId(); - if ($rpcServer && $this->oneSpanPerRpc) { - // Zipkin-style one-span-per-RPC - $spanId = $parent->getSpanId(); - $parentId = $parent->getParentId(); - } else { - $spanId = $this->randomId(); - $parentId = $parent->getSpanId(); - } - - $flags = $parent->getFlags(); - $baggage = $parent->getBaggage(); - } - - $spanContext = new SpanContext( - $traceId, - $spanId, - $parentId, - $flags, - $baggage - ); - - $span = new Span( - $spanContext, - $this, - $operationName, - $tags ?? [], - $options->getStartTime() - ); - - $mergedTags = array_merge($this->tags, $tags); - $span->setTags($mergedTags); - - return $span; - } - - /** - * {@inheritdoc} - * - * @param SpanContext $spanContext - * @param string $format - * @param mixed $carrier - * @return void - * - * @throws UnsupportedFormat - */ - public function inject(OTSpanContext $spanContext, string $format, &$carrier): void - { - if ($spanContext instanceof SpanContext) { - $codec = $this->codecs[$format] ?? null; - - if ($codec == null) { - throw UnsupportedFormatException::forFormat(is_scalar($format) ? $format : gettype($format)); - } - - - $codec->inject($spanContext, $carrier); - return; - } - - $message = sprintf( - 'Invalid span context. Expected Jaeger\SpanContext, got %s.', - is_object($spanContext) ? get_class($spanContext) : gettype($spanContext) - ); - - $this->logger->warning($message); - } - - /** - * {@inheritdoc} - * - * @param mixed $carrier - * @return SpanContext|null - * - * @throws UnsupportedFormat - */ - public function extract(string $format, $carrier): ?OTSpanContext - { - $codec = $this->codecs[$format] ?? null; - - if ($codec == null) { - throw UnsupportedFormatException::forFormat(is_scalar($format) ? $format : gettype($format)); - } - - try { - return $codec->extract($carrier); - } catch (\Throwable $e) { - $this->logger->warning($e->getMessage()); - - return null; - } - } - - /** - * {@inheritdoc} - */ - public function flush(): void - { - $this->sampler->close(); - $this->reporter->close(); - } - - public function reportSpan(Span $span) - { - $this->reporter->reportSpan($span); - } - - /** - * {@inheritdoc} - */ - public function getScopeManager(): OTScopeManager - { - return $this->scopeManager; - } - - /** - * {@inheritdoc} - */ - public function getActiveSpan(): ?OTSpan - { - $activeScope = $this->getScopeManager()->getActive(); - if ($activeScope === null) { - return null; - } - - return $activeScope->getSpan(); - } - - /** - * {@inheritdoc} - */ - public function startActiveSpan(string $operationName, $options = []): OTScope - { - if (!$options instanceof StartSpanOptions) { - $options = StartSpanOptions::create($options); - } - - if (!$this->getParentSpanContext($options) && $this->getActiveSpan() !== null) { - $parent = $this->getActiveSpan()->getContext(); - $options = $options->withParent($parent); - } - - $span = $this->startSpan($operationName, $options); - $scope = $this->scopeManager->activate($span, $options->shouldFinishSpanOnClose()); - - return $scope; - } - - /** - * Gets parent span context (if any). - * - * @param StartSpanOptions $options - * @return null|OTSpanContext|SpanContext - */ - private function getParentSpanContext(StartSpanOptions $options) - { - $references = $options->getReferences(); - foreach ($references as $ref) { - if ($ref->isType(Reference::CHILD_OF)) { - return $ref->getSpanContext(); - } - } - - return null; - } - - /** - * @return string - * @throws Exception - */ - private function randomId(): string - { - return (string) random_int(0, PHP_INT_MAX); - } - - /** - * The facade to get the host name. - * - * @return string - */ - protected function getHostName() - { - return gethostname(); - } - - /** - * The facade to get IPv4 address corresponding to a given Internet host name. - * - * NOTE: DNS Resolution may take too long, and during this time your script is NOT being executed. - * - * @param string|null $hostname - * @return string - */ - protected function getHostByName($hostname) - { - if (empty($hostname)) { - $this->logger->error('Unable to determine host name'); - return '127.0.0.1'; - } - - return gethostbyname($hostname); - } - - /** - * @param SamplerInterface $sampler - * @return $this - */ - public function setSampler(SamplerInterface $sampler) - { - $this->sampler = $sampler; - - return $this; - } - - /** - * @return string - */ - public function getServiceName() - { - return $this->serviceName; - } - - /** - * @return string - */ - public function getIpAddress() - { - return $this->ipAddress; - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Util/RateLimiter.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Util/RateLimiter.php deleted file mode 100644 index d767ad40f..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Util/RateLimiter.php +++ /dev/null @@ -1,128 +0,0 @@ -cache = $cache; - $this->balance = $this->cache->getItem($currentBalanceKey); - $this->lastTick = $this->cache->getItem($lastTickKey); - } - - /** - * @param $itemCost - * @return bool - */ - public function checkCredit($itemCost) - { - if (!$this->creditsPerNanosecond) { - return false; - } - - list($lastTick, $balance) = $this->getState(); - - if (!$lastTick) { - $this->saveState(hrtime(true), 0); - return true; - } - - $currentTick = hrtime(true); - $elapsedTime = $currentTick - $lastTick; - $balance += $elapsedTime * $this->creditsPerNanosecond; - if ($balance > $this->maxBalance) { - $balance = $this->maxBalance; - } - - $result = false; - if ($balance >= $itemCost) { - $balance -= $itemCost; - $result = true; - } - - $this->saveState($currentTick, $balance); - - return $result; - } - - - /** - * Initializes limiter costs and boundaries - * - * @param float $creditsPerNanosecond - * @param float $maxBalance - */ - public function initialize(float $creditsPerNanosecond, float $maxBalance) - { - $this->creditsPerNanosecond = $creditsPerNanosecond; - $this->maxBalance = $maxBalance; - } - - /** - * Method loads last tick and current balance from cache - * - * @return array [$lastTick, $balance] - */ - private function getState() : array - { - return [ - $this->lastTick->get(), - $this->balance->get() - ]; - } - - /** - * Method saves last tick and current balance into cache - * - * @param integer $lastTick - * @param float $balance - */ - private function saveState($lastTick, $balance) - { - $this->lastTick->set($lastTick); - $this->balance->set($balance); - $this->cache->saveDeferred($this->lastTick); - $this->cache->saveDeferred($this->balance); - $this->cache->commit(); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Codec/TextCodecTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Codec/TextCodecTest.php deleted file mode 100644 index 79a1dd96f..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Codec/TextCodecTest.php +++ /dev/null @@ -1,170 +0,0 @@ -textCodec = new TextCodec(); - } - - public function testCanInjectSimpleContextInCarrier(): void - { - $context = new SpanContext('trace-id', 'span-id', null, null); - $carrier = []; - - $this->textCodec->inject($context, $carrier); - - $this->assertCount(1 , $carrier); - $this->assertArrayHasKey(TRACE_ID_HEADER, $carrier); - } - - /** - * @dataProvider contextDataProvider - * @param bool $urlEncode - * @param $baggage - */ - public function testCanInjectContextBaggageInCarrier(bool $urlEncode, $baggage, $injectedBaggage): void - { - $carrier = []; - - $context = new SpanContext('trace-id', 'span-id', null, null, $baggage); - $textCodec = new TextCodec($urlEncode); - $textCodec->inject($context, $carrier); - - $this->assertCount(1 + count($baggage) , $carrier); - $this->assertArrayHasKey(TRACE_ID_HEADER, $carrier); - foreach ($injectedBaggage as $key => $value) { - $this->assertArrayHasKey(BAGGAGE_HEADER_PREFIX . $key, $carrier); - $this->assertEquals($carrier[BAGGAGE_HEADER_PREFIX . $key], $value); - } - } - - public function contextDataProvider() - { - return [ - [false, ['baggage-1' => 'baggage value'], ['baggage-1' => 'baggage value']], - [false, ['baggage-1' => 'https://testdomain.sk'], ['baggage-1' => 'https://testdomain.sk']], - [true, ['baggage-1' => 'https://testdomain.sk'], ['baggage-1' => 'https%3A%2F%2Ftestdomain.sk']], - ]; - } - - /** - * @dataProvider carrierDataProvider - * @param $urlEncode - * @param $carrier - * @param $traceId - * @param $spanId - * @param $parentId - * @param $flags - * @param $baggage - * @throws \Exception - */ - public function testSpanContextParsingFromHeader($urlEncode, $carrier, $traceId, $spanId, $parentId, $flags, $baggage): void - { - $textCodec = new TextCodec($urlEncode); - $spanContext = $textCodec->extract($carrier); - - $this->assertEquals($traceId, $spanContext->getTraceId()); - $this->assertEquals($spanId, $spanContext->getSpanId()); - $this->assertEquals($parentId, $spanContext->getParentId()); - $this->assertEquals($flags, $spanContext->getFlags()); - $this->assertCount(count($baggage), $spanContext->getBaggage() ? $spanContext->getBaggage() : []); - foreach ($baggage as $key => $value) { - $this->assertEquals($value, $spanContext->getBaggageItem($key)); - } - } - - public function carrierDataProvider(): array - { - return [ - [ - false, - [ - TRACE_ID_HEADER => '32834e4115071776:f7802330248418d:f123456789012345:1' - ], - "3639838965278119798", - "1114643325879075213", - "-1070935975401544891", - 1, - [] - ], - [ - false, - [ - TRACE_ID_HEADER => '32834e4115071776:f7802330248418d:f123456789012345:1', - BAGGAGE_HEADER_PREFIX . 'baggage-1' => 'https://testdomain.sk', - ], - "3639838965278119798", - "1114643325879075213", - "-1070935975401544891", - 1, - ['baggage-1' => 'https://testdomain.sk'] - ], - [ - true, - [ - TRACE_ID_HEADER => '32834e4115071776:f7802330248418d:f123456789012345:1', - BAGGAGE_HEADER_PREFIX . 'baggage-1' => 'https%3A%2F%2Ftestdomain.sk', - ], - "3639838965278119798", - "1114643325879075213", - "-1070935975401544891", - 1, - ['baggage-1' => 'https://testdomain.sk'] - ] - ]; - } - - public function testBaggageWithoutTraceContext(): void - { - $carrier = [BAGGAGE_HEADER_PREFIX.'test' => 'some data']; - - $this->expectException(Exception::class); - $this->expectExceptionMessage('baggage without trace ctx'); - - $this->textCodec->extract($carrier); - } - - public function testInvalidSpanContextParsingFromHeader(): void - { - $carrier = [TRACE_ID_HEADER => 'invalid_data']; - - $this->expectException(Exception::class); - $this->expectExceptionMessage('Malformed tracer state string.'); - - $this->textCodec->extract($carrier); - } - - public function testExtractDebugSpanContext(): void - { - $carrier = [DEBUG_ID_HEADER_KEY => 'debugId']; - - $spanContext = $this->textCodec->extract($carrier); - - $this->assertEquals('debugId', $spanContext->getDebugId()); - $this->assertNull($spanContext->getTraceId()); - $this->assertNull($spanContext->getSpanId()); - $this->assertNull($spanContext->getParentId()); - $this->assertNull($spanContext->getFlags()); - } - - - public function testExtractEmptySpanContext(): void - { - $spanContext = $this->textCodec->extract([]); - $this->assertNull($spanContext); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Codec/ZipkinCodecTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Codec/ZipkinCodecTest.php deleted file mode 100644 index 047caac2e..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Codec/ZipkinCodecTest.php +++ /dev/null @@ -1,104 +0,0 @@ -codec = new ZipkinCodec; - } - - function testInject() - { - // Given - $traceId = 123; - $spanId = 456; - $parentId = 789; - - $spanContext = new SpanContext( - $traceId, - $spanId, - $parentId, - SAMPLED_FLAG - ); - $carrier = []; - - // When - $this->codec->inject($spanContext, $carrier); - - // Then - $this->assertEquals('7b', $carrier['X-B3-TraceId']); - $this->assertEquals('1c8', $carrier['X-B3-SpanId']); - $this->assertEquals('315', $carrier['X-B3-ParentSpanId']); - $this->assertSame(1, $carrier['X-B3-Flags']); - } - - function testExtract() - { - // Given - $carrier = [ - 'x-b3-traceid' => 'a53bf337d7e455e1', - 'x-b3-spanid' => '153bf227d1f455a1', - 'x-b3-parentspanid' => 'a53bf337d7e455e1', - 'x-b3-flags' => '1', - ]; - - // When - $spanContext = $this->codec->extract($carrier); - - // Then - $this->assertEquals(new SpanContext( - '-6540366612654696991', - '1530082751262512545', - '-6540366612654696991', - DEBUG_FLAG - ), $spanContext); - } - - function testExtractWithoutParentSpanId() - { - // Given - $carrier = [ - 'x-b3-traceid' => '8d824d69da5f50d9', - 'x-b3-spanid' => '8d824d69da5f50d9', - 'x-b3-flags' => '1', - ]; - - // When - $spanContext = $this->codec->extract($carrier); - - // Then - $this->assertEquals(new SpanContext( - '-8249946450358742823', - '-8249946450358742823', - '0', - DEBUG_FLAG - ), $spanContext); - } - - function testExtractInvalidHeader() - { - // Given - $carrier = [ - 'x-b3-traceid' => 'zzzz', - 'x-b3-spanid' => '463ac35c9f6413ad48485a3953bb6124', - 'x-b3-flags' => '1', - ]; - - // When - $spanContext = $this->codec->extract($carrier); - - // Then - $this->assertEquals(null, $spanContext); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ConfigTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ConfigTest.php deleted file mode 100644 index da1a9781e..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ConfigTest.php +++ /dev/null @@ -1,257 +0,0 @@ -config = new Config([], $this->serviceName); - $this->reporter = $this->createMock(ReporterInterface::class); - $this->sampler = $this->createmock(SamplerInterface::class); - } - - function testCreateTracer() - { - $tracer = $this->config->createTracer($this->reporter, $this->sampler); - - $this->assertEquals(Tracer::class, get_class($tracer)); - $this->assertEquals($this->serviceName, $tracer->getServiceName()); - } - - function testThrowExceptionWhenServiceNameIsNotDefined() - { - $this->expectException(Exception::class); - $this->expectExceptionMessage('service_name required in the config or param.'); - - new Config([]); - } - - function testSetServiceNameFromConfig() - { - $config = new Config(['service_name' => 'test-service-name-from-config']); - - $serviceName = $config->getServiceName(); - - $this->assertEquals('test-service-name-from-config', $serviceName); - } - - /** - * @test - */ - public function shouldSetGlobalTracerAfterInitialize() - { - //given - $config = new Config(['service_name' => 'test-service-name']); - - //when - $config->initializeTracer(); - - //then - $tracer = GlobalTracer::get(); - $this->assertInstanceOf(Tracer::class, $tracer); - } - - /** @test */ - public function shouldThrowExceptionWhenCreatingNotSupportedSampler() - { - $config = new Config(['service_name' => 'test-service-name', 'sampler' => ['type' => 'unsupportedSampler']]); - - $this->expectException(Exception::class); - $this->expectExceptionMessage('Unknown sampler type unsupportedSampler'); - - $config->initializeTracer(); - } - - /** @test */ - public function shouldThrowExceptionWhenCreatingRateLimitingSamplerWithoutCacheComponent() - { - $config = new Config([ - 'service_name' => 'test-service-name', - 'sampler' => ['type' => \Jaeger\SAMPLER_TYPE_RATE_LIMITING] - ]); - - $this->expectException(Exception::class); - $this->expectExceptionMessage('You cannot use RateLimitingSampler without cache component'); - - $config->initializeTracer(); - } - - /** @test */ - public function shouldPassDifferentDispatchMode() { - foreach (Config::getAvailableDispatchModes() as $dispatchMode) { - $config = new Config( - [ - 'sampler' => [ - 'type' => SAMPLER_TYPE_CONST, - 'param' => true, - ], - 'logging' => false, - "local_agent" => [ - "reporting_host" => "localhost", - ], - 'dispatch_mode' => $dispatchMode, - ], - 'your-app-name' - ); - $config->initializeTracer(); - $this->expectNotToPerformAssertions(); - } - } - - /** @test */ - public function shouldPassConfiguredTagsToTracer() - { - $tags = [ - 'bar' => 'a-value', - 'other.tag' => 'foo', - ]; - - $config = new Config([ - 'sampler' => [ - 'type' => SAMPLER_TYPE_CONST, - 'param' => true, - ], - 'service_name' => 'test-service-name', - 'tags' => $tags, - ]); - - $tracer = $config->initializeTracer(); - $span = $tracer->startSpan('test-span'); - $spanTags = $span->getTags(); - - foreach ($tags as $name => $value) { - $this->assertArrayHasKey($name, $spanTags, "Tag '$name' should be set on span"); - $this->assertEquals($value, $spanTags[$name]->value, "Tag '$name' should have configured value"); - } - } - - /** - * @test - * @dataProvider shouldSetConfigPropertiesFromEnvVarsProvider - */ - public function shouldSetConfigPropertiesFromEnvVars($varName, $varVal, $initialConfig, $valueGetter, $expectedVal) - { - $_ENV[$varName] = $varVal; - - $config = new Config([]); - $configProperty = (new \ReflectionObject($config))->getProperty('config'); - $configProperty->setAccessible('true'); - $configArray = $configProperty->getValue($config); - - $this->assertSame($expectedVal, $valueGetter($configArray)); - } - - /** - * @test - * @dataProvider shouldSetConfigPropertiesFromEnvVarsProvider - */ - public function shouldNotSetConfigPropertiesFromEnvVars($varName, $varVal, $initialConfig, $valueGetter, $expectedVal) - { - $_ENV[$varName] = $varVal; - - $config = new Config($initialConfig); - $configProperty = (new \ReflectionObject($config))->getProperty('config'); - $configProperty->setAccessible('true'); - $configArray = $configProperty->getValue($config); - - $this->assertNotEquals($expectedVal, $valueGetter($configArray)); - } - - /** - * 0 -> varName - * 1 -> varVal - * 2 -> initialConfig - * 3 -> valueGetter - * 4 -> expectedVal - */ - public function shouldSetConfigPropertiesFromEnvVarsProvider() { - return [ - [ - 'JAEGER_SERVICE_NAME', - 'some-str', - ['service_name' => 'some-other-str'], - function ($a) { return $a['service_name']; }, - 'some-str', - ], - [ - 'JAEGER_TAGS', - 'some-str', - ['tags' => 'some-other-str'], - function ($a) { return $a['tags']; }, - 'some-str', - ], - [ - 'JAEGER_AGENT_HOST', - 'some-str', - ['local_agent' => ['reporting_host' => 'some-other-str']], - function ($a) { return $a['local_agent']['reporting_host'];}, - 'some-str', - ], - [ - 'JAEGER_AGENT_PORT', - '2222', - ['local_agent' => ['reporting_port' => 1111]], - function ($a) { return $a['local_agent']['reporting_port']; }, - 2222, - ], - [ - 'JAEGER_REPORTER_LOG_SPANS', - 'true', - ['logging' => false], - function ($a) { return $a['logging']; }, - true, - ], - [ - 'JAEGER_REPORTER_MAX_QUEUE_SIZE', - '2222', - ['max_buffer_length' => 1111], - function ($a) { return $a['max_buffer_length']; }, - 2222, - ], - [ - 'JAEGER_SAMPLER_TYPE', - 'some-str', - ['sampler' => ['type' => 'some-other-str']], - function ($a) { return $a['sampler']['type']; }, - 'some-str', - ], - [ - 'JAEGER_SAMPLER_PARAM', - 'some-str', - ['sampler' => ['param' => 'some-other-str']], - function ($a) { return $a['sampler']['param']; }, - 'some-str', - ], - ]; - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Logger/StackLogger.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Logger/StackLogger.php deleted file mode 100644 index fd8789dc3..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Logger/StackLogger.php +++ /dev/null @@ -1,30 +0,0 @@ -messagesStack[] = $message; - } - - public function getLastMessage() { - return array_pop($this->messagesStack); - } - - public function getMessagesCount() { - return count($this->messagesStack); - } - - public function clear() { - $this->messagesStack = []; - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Mapper/SpanToJaegerMapperTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Mapper/SpanToJaegerMapperTest.php deleted file mode 100644 index d536cb63a..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Mapper/SpanToJaegerMapperTest.php +++ /dev/null @@ -1,169 +0,0 @@ -tracer = new Tracer($this->serviceName, new NullReporter, new ConstSampler); - $this->context = new SpanContext(0, 0, 0, SAMPLED_FLAG); - } - - /** - * {@inheritdoc} - */ - protected function tearDown(): void - { - $this->tracer = null; - $this->context = null; - } - - /** @test */ - public function shouldProperlyInitializeAtConstructTime(): void - { - $span = new Span($this->context, $this->tracer, 'test-operation'); - $span->setTags([ - "tag-bool1" => true, - "tag-bool2" => false, - "tag-int" => 1234567, - "tag-float" => 1.23456, - "tag-string" => "hello-world" - ]); - - $mapper = new SpanToJaegerMapper(); - $thriftSpan = $mapper->mapSpanToJaeger($span); - - $index = 0; - $this->assertEquals($thriftSpan->tags[$index]->key, "component"); - $this->assertEquals($thriftSpan->tags[$index]->vType, TagType::STRING); - $this->assertEquals($thriftSpan->tags[$index]->vStr, $this->serviceName); - $index++; - - $this->assertEquals($thriftSpan->tags[$index]->key, "tag-bool1"); - $this->assertEquals($thriftSpan->tags[$index]->vType, TagType::BOOL); - $this->assertEquals($thriftSpan->tags[$index]->vBool, true); - $index++; - - $this->assertEquals($thriftSpan->tags[$index]->key, "tag-bool2"); - $this->assertEquals($thriftSpan->tags[$index]->vType, TagType::BOOL); - $this->assertEquals($thriftSpan->tags[$index]->vBool, false); - $index++; - - $this->assertEquals($thriftSpan->tags[$index]->key, "tag-int"); - $this->assertEquals($thriftSpan->tags[$index]->vType, TagType::LONG); - $this->assertEquals($thriftSpan->tags[$index]->vLong, 1234567); - $index++; - - $this->assertEquals($thriftSpan->tags[$index]->key, "tag-float"); - $this->assertEquals($thriftSpan->tags[$index]->vType, TagType::DOUBLE); - $this->assertEquals($thriftSpan->tags[$index]->vDouble, 1.23456); - $index++; - - $this->assertEquals($thriftSpan->tags[$index]->key, "tag-string"); - $this->assertEquals($thriftSpan->tags[$index]->vType, TagType::STRING); - $this->assertEquals($thriftSpan->tags[$index]->vStr, "hello-world"); - $index++; - } - - /** - * @dataProvider specialTagProvider - * @param array $tags - * @return void - */ - public function testSpecialTagsAreAdded(array $tags): void - { - $span = new Span($this->context, $this->tracer, 'test-operation'); - $span->setTags($tags); - - // The component tag is always added, even if it's not specified in tags - $expectedTagValues = array_merge([COMPONENT => $this->serviceName], $tags); - - $mapper = new SpanToJaegerMapper(); - $thriftSpan = $mapper->mapSpanToJaeger($span); - - $foundTags = []; - - foreach ($thriftSpan->tags as $tag) { - $foundTags[] = $tag->key; - - switch ($tag->key) { - case PEER_SERVICE: - case PEER_HOST_IPV4: - case SPAN_KIND: - case COMPONENT: - $this->assertEquals(TagType::STRING, $tag->vType, 'Incorrect tag value type'); - $this->assertEquals($expectedTagValues[$tag->key], $tag->vStr, 'Incorrect tag value'); - break; - case PEER_PORT: - $this->assertEquals(TagType::LONG, $tag->vType, 'Incorrect tag value type'); - $this->assertEquals($expectedTagValues[$tag->key], $tag->vLong, 'Incorrect tag value'); - break; - } - } - - $this->assertEqualsCanonicalizing(array_keys($expectedTagValues), $foundTags, 'Some of the tags are missing'); - } - - public function specialTagProvider(): array - { - return [ - [ - [ - 'bool_tag' => true, - PEER_SERVICE => 'my_service', - PEER_HOST_IPV4 => '127.0.0.1', - PEER_PORT => 443, - SPAN_KIND => SPAN_KIND_RPC_CLIENT, - COMPONENT => 'grpc', - ], - ], - [ - [ - 'int_tag' => 5, - PEER_HOST_IPV4 => '192.168.0.1', - PEER_PORT => 80, - ], - ], - [ - [ - 'string_tag' => 'testing-tag', - PEER_PORT => 80, - COMPONENT => 'grpc', - ], - ], - [ - [ - 'string_tag' => 'testing-tag', - ], - ], - ]; - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/CompositeReporterTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/CompositeReporterTest.php deleted file mode 100644 index ef95ebfe7..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/CompositeReporterTest.php +++ /dev/null @@ -1,52 +0,0 @@ -childReporter1 = $this->createMock(ReporterInterface::class); - $this->childReporter2 = $this->createMock(ReporterInterface::class); - - $this->reporter = new CompositeReporter($this->childReporter1, $this->childReporter2); - } - - /** @test */ - public function shouldReportSpan() - { - /** @var \Jaeger\Span|\PHPUnit\Framework\MockObject\MockObject $span */ - $span = $this->createMock(Span::class); - - $this->childReporter1->expects($this->once())->method('reportSpan')->with($span); - $this->childReporter2->expects($this->once())->method('reportSpan')->with($span); - - $this->reporter->reportSpan($span); - } - - /** @test */ - public function shouldCloseReporter() - { - $this->childReporter1->expects($this->once())->method('close'); - $this->childReporter2->expects($this->once())->method('close'); - - $this->reporter->close(); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/InMemoryReporterTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/InMemoryReporterTest.php deleted file mode 100644 index 966a62fa4..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/InMemoryReporterTest.php +++ /dev/null @@ -1,24 +0,0 @@ -createMock(Span::class); - $reporter = new InMemoryReporter(); - - $reporter->reportSpan($span); - $reporter->close(); - - $spans = $reporter->getSpans(); - $this->assertEquals([$span], $spans); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/LoggingReporterTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/LoggingReporterTest.php deleted file mode 100644 index dc7c490d2..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/LoggingReporterTest.php +++ /dev/null @@ -1,31 +0,0 @@ -createMock(NullLogger::class); - $span = $this->createMock(Span::class); - - $reporter = new LoggingReporter($logger); - - $logger->expects($this->once()) - ->method('debug') - ->with($this->stringStartsWith('Reporting span')); - - $reporter->reportSpan($span); - $reporter->close(); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/NullReporterTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/NullReporterTest.php deleted file mode 100644 index e6a66cb8a..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/NullReporterTest.php +++ /dev/null @@ -1,29 +0,0 @@ -createMock(Span::class); - - $reporter = new NullReporter(); - - $reporter->reportSpan($span); - $reporter->close(); - - // Only needed to avoid PhpUnit message: "This test did not perform any assertions" - $this->assertTrue(true); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/RemoteReporterTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/RemoteReporterTest.php deleted file mode 100644 index 0b85f06d0..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/RemoteReporterTest.php +++ /dev/null @@ -1,46 +0,0 @@ -transport = $this->createMock(UdpSender::class); - $this->reporter = new RemoteReporter($this->transport); - } - - /** @test */ - public function shouldReportSpan() - { - /** @var Span|\PHPUnit\Framework\MockObject\MockObject $span */ - $span = $this->createMock(Span::class); - - $this->transport->expects($this->once())->method('append')->with($span); - - $this->reporter->reportSpan($span); - } - - /** @test */ - public function shouldCloseReporter() - { - $this->transport->expects($this->once())->method('flush'); - $this->transport->expects($this->once())->method('close'); - - $this->reporter->close(); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sampler/ConstSamplerTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sampler/ConstSamplerTest.php deleted file mode 100644 index 85cb80504..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sampler/ConstSamplerTest.php +++ /dev/null @@ -1,43 +0,0 @@ -isSampled($traceId); - - $this->assertEquals($decision, $sampled); - $this->assertEquals([ - SAMPLER_TYPE_TAG_KEY => SAMPLER_TYPE_CONST, - SAMPLER_PARAM_TAG_KEY => $decision, - ], $tags); - - $sampler->close(); - } - - public function samplerProvider() - { - return [ - [true, 1], - [true, PHP_INT_MAX], - [false, 1], - [false, PHP_INT_MAX], - ]; - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sampler/ProbablisticSamplerTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sampler/ProbablisticSamplerTest.php deleted file mode 100644 index 2840ebf8c..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sampler/ProbablisticSamplerTest.php +++ /dev/null @@ -1,68 +0,0 @@ -isSampled($traceId); - - $this->assertEquals($decision, $sampled); - $this->assertEquals([ - SAMPLER_TYPE_TAG_KEY => SAMPLER_TYPE_PROBABILISTIC, - SAMPLER_PARAM_TAG_KEY => $rate, - ], $tags); - - $sampler->close(); - } - - public function samplerProvider() - { - return [ - [1.0, PHP_INT_MAX-1, true], - [0, 0, false], - [0.5, PHP_INT_MIN + 10, true], - [0.5, PHP_INT_MAX - 10, false], - ]; - } - - /** - * @test - * @dataProvider rateProvider - * @param mixed $rate - */ - public function shouldThrowOutOfBoundsExceptionInCaseOfInvalidRate($rate) - { - $this->expectException(OutOfBoundsException::class); - $this->expectExceptionMessage('Sampling rate must be between 0.0 and 1.0.'); - - new ProbabilisticSampler($rate); - } - - public function rateProvider() - { - return [ - [1.1], - [-0.1], - [PHP_INT_MAX], - [PHP_INT_MIN], - ]; - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sampler/RateLimitSamplerTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sampler/RateLimitSamplerTest.php deleted file mode 100644 index 4f6b8a632..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sampler/RateLimitSamplerTest.php +++ /dev/null @@ -1,48 +0,0 @@ -isSampled(); - list($sampled, $tags) = $sampler->isSampled(); - $this->assertEquals($decision, $sampled); - $this->assertEquals([ - SAMPLER_TYPE_TAG_KEY => SAMPLER_TYPE_RATE_LIMITING, - SAMPLER_PARAM_TAG_KEY => $maxTracesPerSecond, - ], $tags); - - $sampler->close(); - } - - public function maxRateProvider() - { - return [ - [1000000, true], - [1, false], - [0, false], - ]; - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ScopeManagerTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ScopeManagerTest.php deleted file mode 100644 index 43a303642..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ScopeManagerTest.php +++ /dev/null @@ -1,49 +0,0 @@ -scopeManager = new ScopeManager(); - } - - function testActivate() - { - $span = $this->createMock(Span::class); - - $scope = $this->scopeManager->activate($span, true); - - $this->assertEquals($scope->getSpan(), $span); - } - - function testAbleGetActiveScope() - { - $span = $this->createMock(Span::class); - - $this->assertNull($this->scopeManager->getActive()); - $scope = $this->scopeManager->activate($span, false); - - $this->assertEquals($scope, $this->scopeManager->getActive()); - } - - function testScopeClosingDeactivates() - { - $span = $this->createMock(Span::class); - - $scope = $this->scopeManager->activate($span, false); - $scope->close(); - - $this->assertNull($this->scopeManager->getActive()); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ScopeTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ScopeTest.php deleted file mode 100644 index e36a8de3d..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ScopeTest.php +++ /dev/null @@ -1,58 +0,0 @@ -scopeManager = $this->createMock(ScopeManager::class); - $this->span = $this->createMock(Span::class); - } - - function testCloseDoNotFinishSpanOnClose() - { - $scope = new Scope($this->scopeManager, $this->span, false); - - $this->scopeManager->method('getActive')->willReturn($scope); - $this->scopeManager->expects($this->once())->method('getActive'); - $this->span->expects($this->never())->method('finish'); - $this->scopeManager->expects($this->once())->method('setActive'); - - $scope->close(); - } - - function testCloseFinishSpanOnClose() - { - $scope = new Scope($this->scopeManager, $this->span, true); - - $this->scopeManager->method('getActive')->willReturn($scope); - $this->scopeManager->expects($this->once())->method('getActive'); - $this->span->expects($this->once())->method('finish'); - $this->scopeManager->expects($this->once())->method('setActive'); - - $scope->close(); - } - - function testGetSpan() - { - $scope = new Scope($this->scopeManager, $this->span, false); - - $this->assertEquals($this->span, $scope->getSpan()); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sender/JaegerThriftSenderTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sender/JaegerThriftSenderTest.php deleted file mode 100644 index 5bd6d0a7b..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sender/JaegerThriftSenderTest.php +++ /dev/null @@ -1,126 +0,0 @@ -createMock(Tracer::class); - $tracer->method('getIpAddress')->willReturn(''); - $tracer->method('getServiceName')->willReturn(''); - - $this->tracer = $tracer; - - $context = $this->createMock(SpanContext::class); - $this->context = $context; - } - - public function testFlush(): void - { - - $span = $this->createMock(Span::class); - $span->method('getOperationName')->willReturn('dummy-operation'); - $span->method('getTracer')->willReturn($this->tracer); - $span->method('getContext')->willReturn($this->context); - - $client = $this->createMock(AgentClient::class); - $sender = new JaegerSender($client); - $sender->setMaxBufferLength(64000); - - $client - ->expects(self::exactly(1)) - ->method('emitBatch'); - - $sender->append($span); - $sender->append($span); - $sender->append($span); - - self::assertEquals(3, $sender->flush()); - } - - public function testEmitBatch() { - $client = $this->createMock(AgentClient::class); - $sender = new JaegerSender($client); - $sender->setMaxBufferLength(64000); - - $span = $this->createMock(Span::class); - $span->method('getOperationName')->willReturn('dummy-operation'); - $span->method('getTracer')->willReturn($this->tracer); - $span->method('getContext')->willReturn($this->context); - - $client - ->expects($this->once()) - ->method('emitBatch') - ->with($this->callback(function ($batch) { - /** @var Batch $batch */ - $this->assertInstanceOf(Batch::class, $batch); - $this->assertCount(1, $batch->spans); - - /** @var \Jaeger\Thrift\Span $span */ - $span = $batch->spans[0]; - $this->assertInstanceOf(\Jaeger\Thrift\Span::class, $span); - $this->assertSame("dummy-operation", $span->operationName); - - return true; - - })); - - $sender->append($span); - $this->assertEquals(1, $sender->flush()); - } - - public function testMaxBufferLength() { - $tracer = $this->createMock(Tracer::class); - $tracer->method('getIpAddress')->willReturn(''); - $tracer->method('getServiceName')->willReturn(''); - - $context = $this->createMock(SpanContext::class); - - $span = $this->createMock(Span::class); - $span->method('getOperationName')->willReturn('dummy-operation'); - $span->method('getTracer')->willReturn($tracer); - $span->method('getContext')->willReturn($context); - - $client = $this->createMock(AgentClient::class); - - $mockBuilder = $this->getMockBuilder(JaegerSender::class); - $mockMethods = ['emitJaegerBatch']; - if (method_exists($mockBuilder, "onlyMethods")) { - $mockBuilder = $mockBuilder->onlyMethods($mockMethods); - } else { - $mockBuilder = $mockBuilder->setMethods($mockMethods); - } - $sender = $mockBuilder->setConstructorArgs([$client])->getMock(); - $sender->setMaxBufferLength(800); - $sender->expects(self::exactly(2)) - ->method('emitJaegerBatch') - ->withConsecutive( - [self::countOf(2)], - [self::countOf(1)] - ); - - // jaeger batch overhead parameter = 512 - $sender->append($span); // 512 + 143 < 800 - chunk 1 - $sender->append($span); // 512 + 143*2 => 798 < 800 - chunk 1 - $sender->append($span); // 512 + 143*3 > 800 - chunk 2 - - self::assertEquals(3, $sender->flush()); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sender/UdpSenderTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sender/UdpSenderTest.php deleted file mode 100644 index 9011d00e3..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sender/UdpSenderTest.php +++ /dev/null @@ -1,116 +0,0 @@ -client = $this->createMock(AgentClient::class); - $this->sender = new UdpSender($this->client, 64000); - } - - public function testMaxBufferLength(): void - { - $tracer = $this->createMock(Tracer::class); - $tracer->method('getIpAddress')->willReturn(''); - $tracer->method('getServiceName')->willReturn(''); - - $context = $this->createMock(SpanContext::class); - - $span = $this->createMock(Span::class); - $span->method('getOperationName')->willReturn('dummy-operation'); - $span->method('getTracer')->willReturn($tracer); - $span->method('getContext')->willReturn($context); - - $sender = new UdpSender($this->client, 100); - - $this->client - ->expects(self::exactly(2)) - ->method('emitZipkinBatch') - ->withConsecutive( - [self::countOf(2)], - [self::countOf(1)] - ); - - // one span has a length of ~25 - $sender->append($span); // 30 + 25 < 100 - chunk 1 - $sender->append($span); // 30 + 25 * 2 < 100 - chunk 1 - $sender->append($span); // 30 + 25 * 3 > 100 - chunk 2 - - self::assertEquals(3, $sender->flush()); - } - - public function testFlush(): void - { - $this->assertEquals(0, $this->sender->flush()); - - $logTimeStamp = (int) (microtime(true) * 1000000); - - $tracer = $this->createMock(Tracer::class); - $tracer->method('getIpAddress')->willReturn(''); - $tracer->method('getServiceName')->willReturn(''); - $context = $this->createMock(SpanContext::class); - $span = $this->createMock(Span::class); - $span->method('getTracer')->willReturn($tracer); - $span->method('getContext')->willReturn($context); - $span - ->expects($this->atLeastOnce()) - ->method('getLogs') - ->willReturn([ - [ - 'timestamp' => $logTimeStamp, - 'fields' => [ - 'foo' => 'bar', - ], - ], - ]); - - $this->client - ->expects($this->once()) - ->method('emitZipkinBatch') - ->with($this->callback(function ($spans) use ($logTimeStamp) { - $this->assertCount(1, $spans); - - /* @var $annotation ZipkinSpan */ - $span = $spans[0]; - $this->assertInstanceOf(ZipkinSpan::class, $span); - $this->assertCount(1, $span->annotations); - - /* @var $annotation ZipkinAnnotation */ - $annotation = $span->annotations[0]; - $this->assertInstanceOf(ZipkinAnnotation::class, $annotation); - $this->assertSame($logTimeStamp, $annotation->timestamp); - $this->assertSame( - json_encode([ - 'foo' => 'bar', - ]), - $annotation->value - ); - - return true; - })); - - $this->sender->append($span); - $this->assertEquals(1, $this->sender->flush()); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/SpanContextTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/SpanContextTest.php deleted file mode 100644 index 998061088..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/SpanContextTest.php +++ /dev/null @@ -1,37 +0,0 @@ -assertTrue($ctx->isDebugIdContainerOnly()); - $this->assertEquals($ctx->getDebugId(), 'value1'); - - $ctx = new SpanContext(1, 2, 3, 1); - $this->assertFalse($ctx->isDebugIdContainerOnly()); - } - - /** - * @dataProvider contextDataProvider - */ - public function testBaggageInit($traceId, $spanId, $parentId, $flags, $baggage, $expected) - { - $ctx = new SpanContext($traceId, $spanId, $parentId, $flags, $baggage); - $this->assertEquals($expected, $ctx->getBaggage()); - } - - public function contextDataProvider() - { - return [ - [null, null, null, null, [], []], - [null, null, null, null, null, []], - [null, null, null, null, ['key' => 'val'], ['key' => 'val']], - ]; - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/SpanTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/SpanTest.php deleted file mode 100644 index d23879680..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/SpanTest.php +++ /dev/null @@ -1,293 +0,0 @@ -tracer = new Tracer('test-service', new NullReporter, new ConstSampler); - $this->context = new SpanContext(0, 0,0, SAMPLED_FLAG); - } - - /** - * {@inheritdoc} - */ - protected function tearDown(): void - { - $this->tracer = null; - $this->context = null; - } - - /** @test */ - public function shouldProperlyInitializeAtConstructTime(): void - { - $tags = [ - 'foo-1' => 'test-component-1', - 'foo-2' => 'test-component-2', - 'foo-3' => 'test-component-3', - ]; - - $span = new Span($this->context, $this->tracer, 'test-operation', $tags); - - $this->assertEquals( 3, count($span->getTags())); - $this->assertEquals($this->tracer, $span->getTracer()); - $this->assertEquals(false, $span->isDebug()); - $this->assertEquals(null, $span->getEndTime()); - } - - /** @test */ - public function shouldSetComponentThroughTag(): void - { - $span = new Span($this->context, $this->tracer, 'test-operation'); - - $span->setTag('component', 'libredis'); - - $spanReflection = new \ReflectionClass(Span::class); - $component = $spanReflection->getProperty('component'); - $component->setAccessible(true); - - $this->assertEquals( 0, count($span->getTags())); - $this->assertEquals( 'libredis', $component->getValue($span)); - $this->assertEquals( 'libredis', $span->getComponent()); - } - - /** @test */ - public function shouldSetTags(): void - { - $span = new Span($this->context, $this->tracer, 'test-operation'); - - $this->assertEquals( 0, count($span->getTags())); - - $span->setTags([ - 'foo-1' => 'test-component-1', - 'foo-2' => 'test-component-2', - 'foo-3' => 'test-component-3', - ]); - - $this->assertEquals( 3, count($span->getTags())); - } - - /** @test */ - public function shouldSetDifferentTypeOfTags() { - $span = new Span($this->context, $this->tracer, 'test-operation'); - - $this->assertEquals( 0, count($span->getTags())); - - $span->setTags([ - 'tag-bool1' => true, - 'tag-bool2' => false, - 'tag-int' => 1234567, - 'tag-float' => 1.23456, - 'tag-string' => "hello-world" - ]); - - $tags = array_values($span->getTags()); - $this->assertEquals( 5, count($tags)); - - $index = 0; - $this->assertTrue($tags[$index]->annotation_type === AnnotationType::BOOL); - $this->assertTrue($tags[$index]->value === true); - $this->assertTrue($tags[$index]->key === 'tag-bool1'); - $index++; - - $this->assertTrue($tags[$index]->annotation_type === AnnotationType::BOOL); - $this->assertTrue($tags[$index]->value === false); - $this->assertTrue($tags[$index]->key === 'tag-bool2'); - $index++; - - $this->assertTrue($tags[$index]->annotation_type === AnnotationType::I64); - $this->assertTrue($tags[$index]->value === 1234567); - $this->assertTrue($tags[$index]->key === 'tag-int'); - $index++; - - $this->assertTrue($tags[$index]->annotation_type === AnnotationType::DOUBLE); - $this->assertTrue($tags[$index]->value === 1.23456); - $this->assertTrue($tags[$index]->key === 'tag-float'); - $index++; - - $this->assertTrue($tags[$index]->annotation_type === AnnotationType::STRING); - $this->assertTrue($tags[$index]->value === "hello-world"); - $this->assertTrue($tags[$index]->key === 'tag-string'); - } - - /** @test */ - public function shouldOverwriteTheSameTag(): void - { - // Given - $span = new Span($this->context, $this->tracer, 'test-operation'); - - // When - $span->setTag('foo', 'test-component-1'); - $span->setTag('foo', 'test-component-2'); - - // Then - $this->assertEquals( 1, count($span->getTags())); - $this->assertEquals( 'test-component-2', $span->getTags()['foo']->value); - } - /** @test */ - public function shouldAddLogRecordsToTheSpan(): void - { - $span = new Span($this->context, $this->tracer, 'test-operation'); - - $fields01 = [ - 'event' => 'error', - 'message' => 'dummy error message', - ]; - $fields02 = [ - 'foo' => 'bar', - ]; - - $dateTime01 = new \DateTime('+5 seconds'); - $dateTime02 = $dateTime01->getTimestamp(); - $dateTime03 = microtime(true) + 5; - - $span->log($fields01, $dateTime01); - $span->log($fields02, $dateTime01->getTimestamp()*1000000); - $span->log($fields02, $dateTime03); - $span->log($fields02); - - $logs = $span->getLogs(); - - $this->assertCount(4, $logs); - - $this->assertIsInt($logs[0]['timestamp']); - $this->assertEquals((int)($dateTime01->format('U.u')*1000000), $logs[0]['timestamp']); - $this->assertSame($fields01, $logs[0]['fields']); - - $this->assertIsInt($logs[1]['timestamp']); - $this->assertSame($dateTime02*1000000, $logs[1]['timestamp']); - $this->assertSame($fields02, $logs[1]['fields']); - - $this->assertIsInt($logs[2]['timestamp']); - $this->assertSame((int) ($dateTime03 * 1000000), $logs[2]['timestamp']); - $this->assertSame($fields02, $logs[2]['fields']); - - $this->assertIsInt($logs[3]['timestamp']); - $this->assertSame($fields02, $logs[3]['fields']); - } - - /** @test */ - public function timingDefaultTimes(): void - { - $span = new Span($this->context, $this->tracer, 'test-operation'); - $span->finish(); - - $this->assertEquals(0.0, round(($span->getEndTime() - $span->getStartTime()) / 1000000)); - } - - /** @test */ - public function timingSetStartTimeAsDateTime(): void - { - $span = new Span($this->context, $this->tracer, 'test-operation', [], new \DateTime('-2 seconds')); - $span->finish(); - - $this->assertSpanDuration($span); - } - - /** @test */ - public function timingSetEndTimeAsDateTime(): void - { - $span = new Span($this->context, $this->tracer, 'test-operation'); - - $endTime = new \DateTime('+2 seconds'); - // add microseconds because php < 7.1 has a bug - // https://bugs.php.net/bug.php?id=48225 - if (version_compare(phpversion(), '7.1', '<')) { - list($usec) = explode(' ', microtime()); - $endTime = \DateTime::createFromFormat('U.u', $endTime->format('U')+$usec); - } - $span->finish($endTime); - - $this->assertSpanDuration($span); - } - - /** @test */ - public function timingSetStartTimeAsInt(): void - { - $span = new Span($this->context, $this->tracer, 'test-operation', [], (int) round((microtime(true) - 2) * 1000000)); - $span->finish(); - - $this->assertSpanDuration($span); - } - - /** @test */ - public function timingSetEndTimeAsInt(): void - { - $span = new Span($this->context, $this->tracer, 'test-operation'); - $span->finish((int) round((microtime(true) + 2) * 1000000)); - - $this->assertSpanDuration($span); - } - - /** @test */ - public function timingSetStartTimeAsFloat(): void - { - $span = new Span($this->context, $this->tracer, 'test-operation', [], microtime(true) - 2); - $span->finish(); - - $this->assertSpanDuration($span); - } - - /** @test */ - public function timingSetEndTimeAsFloat(): void - { - $span = new Span($this->context, $this->tracer, 'test-operation'); - $span->finish(microtime(true) + 2); - - $this->assertSpanDuration($span); - } - - /** @test */ - public function timingSetMixedTimes(): void - { - $span = new Span($this->context, $this->tracer, 'test-operation', [], new \DateTime()); - $span->finish(microtime(true) + 2); - - $this->assertSpanDuration($span); - } - - protected function assertSpanDuration(Span $span): void - { - $this->assertEquals(2, (int)(($span->getEndTime() - $span->getStartTime()) / 1000000)); - } - - /** @test */ - public function invalidStartTime(): void - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Time should be one of the types int|float|DateTime|null, got string.'); - $span = new Span($this->context, $this->tracer, 'test-operation', [], 'string'); - } - - /** @test */ - public function invalidEndTime(): void - { - $span = new Span($this->context, $this->tracer, 'test-operation'); - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Time should be one of the types int|float|DateTime|null, got array.'); - $span->finish([]); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ThriftUdpTransportTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ThriftUdpTransportTest.php deleted file mode 100644 index abc4e32aa..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ThriftUdpTransportTest.php +++ /dev/null @@ -1,166 +0,0 @@ -logger = new StackLogger(); - $this->transport = new ThriftUdpTransport('127.0.0.1', 12345, $this->logger); - } - - public function testisOpenWhenOpen() - { - $this->assertEquals($this->logger->getMessagesCount(), 0); - $this->assertTrue($this->transport->isOpen()); - $this->assertEquals($this->logger->getMessagesCount(), 0); - } - - public function testisOpenWhenClosed() - { - $this->assertEquals($this->logger->getMessagesCount(), 0); - $this->transport->close(); - $this->assertFalse($this->transport->isOpen()); - $this->assertEquals($this->logger->getMessagesCount(), 0); - } - - public function testClose() - { - $this->assertEquals($this->logger->getMessagesCount(), 0); - $this->transport->close(); - - $this->assertEquals($this->logger->getMessagesCount(), 0); - $this->transport->write('hello'); - $this->assertEquals($this->logger->getMessagesCount(), 1); - $this->assertEquals($this->logger->getLastMessage(), 'transport is closed'); - $this->assertEquals($this->logger->getMessagesCount(), 0); - } - - public function testDoubleClose() - { - $this->assertEquals($this->logger->getMessagesCount(), 0); - $this->transport->close(); - $this->assertEquals($this->logger->getMessagesCount(), 0); - $this->transport->close(); - $this->assertEquals($this->logger->getMessagesCount(), 1); - $this->assertEquals( - $this->logger->getLastMessage(), - "can't close empty socket" - ); - } - - public function testException() - { - $this->assertEquals($this->logger->getMessagesCount(), 0); - $this->transport->open(); - $this->assertEquals($this->logger->getMessagesCount(), 0); - - $this->transport->write(str_repeat("some string", 10000)); - - $this->assertEquals($this->logger->getMessagesCount(), 1); - $msg = $this->logger->getLastMessage(); - $pattern = "/socket_write failed: \[code - \d+\] Message too long/"; - - if (method_exists($this, "assertMatchesRegularExpression")) { - $this->assertMatchesRegularExpression($pattern, $msg); - } else { - $this->assertRegExp($pattern, $msg); - } - } - - public function testProtocolVersionIPv4() - { - $config = new Config([ - Config::IP_VERSION => Config::IPV4 - ], "testServiceName"); - - $transport = new ThriftUdpTransport('127.0.0.1', 12345, $this->logger, $config); - - $reflectionTransport = new \ReflectionClass($transport); - $ipProtocolVersionMethod = $reflectionTransport->getMethod("ipProtocolVersion"); - $ipProtocolVersionMethod->setAccessible(true); - - $this->assertEquals(Config::IPV4, $ipProtocolVersionMethod->invoke($transport)); - } - - public function testProtocolVersionIPv6() - { - $config = new Config([ - Config::IP_VERSION => Config::IPV6 - ], "testServiceName"); - - $transport = new ThriftUdpTransport('127.0.0.1', 12345, $this->logger, $config); -// - $reflectionTransport = new \ReflectionClass($transport); - $ipProtocolVersionMethod = $reflectionTransport->getMethod("ipProtocolVersion"); - $ipProtocolVersionMethod->setAccessible(true); -// - $this->assertEquals(Config::IPV6, $ipProtocolVersionMethod->invoke($transport)); - } - - public function testProtocolVersionDefault() - { - $config = new Config([ - ], "testServiceName"); - - $transport = new ThriftUdpTransport('127.0.0.1', 12345, $this->logger, $config); - - $reflectionTransport = new \ReflectionClass($transport); - $ipProtocolVersionMethod = $reflectionTransport->getMethod("ipProtocolVersion"); - $ipProtocolVersionMethod->setAccessible(true); - - $this->assertEquals(Config::IPV4, $ipProtocolVersionMethod->invoke($transport)); - } - - public function testCreateSocket() - { - $transport = $this->getMockBuilder(ThriftUdpTransport::class) - ->disableOriginalConstructor() - ->getMock(); - - $reflectionClass = new \ReflectionClass($transport); - $method = $reflectionClass->getMethod("setLogger"); - $method->setAccessible(true); - $method->invokeArgs($transport, [$this->logger]); - - $method = $reflectionClass->getMethod("createSocket"); - $method->setAccessible(true); - $res = $method->invokeArgs($transport, [Config::IPV6]); - - $this->assertNotFalse($res); - - - $transport = $this->getMockBuilder(ThriftUdpTransport::class) - ->disableOriginalConstructor() - ->getMock(); - - $reflectionClass = new \ReflectionClass($transport); - $method = $reflectionClass->getMethod("setLogger"); - $method->setAccessible(true); - $method->invokeArgs($transport, [$this->logger]); - - $method = $reflectionClass->getMethod("createSocket"); - $method->setAccessible(true); - $res = $method->invokeArgs($transport, [Config::IPV4]); - - $this->assertNotFalse($res); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/TracerTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/TracerTest.php deleted file mode 100644 index 3e7b4c05f..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/TracerTest.php +++ /dev/null @@ -1,262 +0,0 @@ -scopeManager = $this->createMock(ScopeManager::class); - $this->sampler = $this->createMock(SamplerInterface::class); - $this->reporter = $this->createMock(ReporterInterface::class); - $this->logger = new NullLogger(); - - $this->tracer = new Tracer($this->serviceName, $this->reporter, $this->sampler, true, $this->logger, $this->scopeManager); - } - - public function testStartSpan(): void - { - $span = $this->tracer->startSpan($this->operationName); - - $this->assertEquals($this->operationName, $span->getOperationName()); - } - - public function testStartActiveSpan(): void - { - $tracer = new Tracer($this->serviceName, $this->reporter, $this->sampler); - - $tracer->startActiveSpan('test-operation1'); - $this->assertEquals('test-operation1', $tracer->getActiveSpan()->getOperationName()); - - $scope = $tracer->startActiveSpan('test-operation2'); - $this->assertEquals('test-operation2', $tracer->getActiveSpan()->getOperationName()); - $scope->close(); - - $this->assertEquals('test-operation1', $tracer->getActiveSpan()->getOperationName()); - } - - /** @test */ - public function shouldAddConfiguredTagsToStartedSpanWhenSampled(): void - { - $this->sampler->expects($this->any()) - ->method('isSampled') - ->willReturn([true, []]); - - $tags = [ - 'bar' => 'a-value', - 'other.tag' => 'foo', - ]; - - $tracer = new Tracer( - $this->serviceName, - $this->reporter, - $this->sampler, - true, - $this->logger, - $this->scopeManager, - TRACE_ID_HEADER, - BAGGAGE_HEADER_PREFIX, - DEBUG_ID_HEADER_KEY, - $tags - ); - - $span = $tracer->startSpan('test-span'); - $spanTags = $span->getTags(); - - foreach ($tags as $name => $value) { - $this->assertArrayHasKey($name, $spanTags, "Tag '$name' should be set on span"); - $this->assertEquals($value, $spanTags[$name]->value, "Tag '$name' should have configured value"); - } - } - - /** @test */ - public function shouldAddNoConfiguredTagsToStartedSpanWhenNotSampled(): void - { - $this->sampler->expects($this->any()) - ->method('isSampled') - ->willReturn([false, []]); - - $tags = [ - 'bar' => 'a-value', - 'other.tag' => 'foo', - ]; - - $tracer = new Tracer( - $this->serviceName, - $this->reporter, - $this->sampler, - true, - $this->logger, - $this->scopeManager, - TRACE_ID_HEADER, - BAGGAGE_HEADER_PREFIX, - DEBUG_ID_HEADER_KEY, - $tags - ); - - $span = $tracer->startSpan('test-span'); - - $this->assertEquals([], $span->getTags(), 'No tags should be set when not sampled'); - } - - /** @test */ - public function shouldThrowExceptionOnInvalidFormat(): void - { - $spanContext = new SpanContext(0, 0, 0, 0); - $carrier = []; - - $this->expectException(UnsupportedFormatException::class); - $this->expectExceptionMessage('The format "bad-format" is not supported.'); - - $this->tracer->inject($spanContext, 'bad-format', $carrier); - $this->assertSame([], $carrier); - } - - /** @test */ - public function shouldNotThrowExceptionOnInvalidContext(): void - { - $spanContext = new NoopSpanContext(); - $carrier = []; - - $this->tracer->inject($spanContext, ZIPKIN_SPAN_FORMAT, $carrier); - $this->assertSame([], $carrier); - } - - /** @test */ - public function shouldInjectSpanContextToCarrier(): void - { - $spanContext = new SpanContext(0, 0, 0, 0); - $carrier = []; - - $this->tracer->inject($spanContext, TEXT_MAP, $carrier); - - $this->assertCount(1, $carrier); - $this->assertEquals('0:0:0:0', $carrier[TRACE_ID_HEADER]); - } - - /** @test */ - public function shouldThrowExceptionOnExtractInvalidFormat(): void - { - $this->expectException(UnsupportedFormatException::class); - $this->expectExceptionMessage('The format "bad-format" is not supported.'); - - $this->tracer->extract('bad-format', []); - } - - /** @test */ - public function shouldNotThrowExceptionOnExtractFromMalformedState(): void - { - $this->assertNull($this->tracer->extract(TEXT_MAP, ['uber-trace-id' => ''])); - } - - /** @test */ - public function shouldExtractSpanContextFromCarrier(): void - { - $carrier = ['uber-trace-id' => '32834e4115071776:f7802330248418d:f123456789012345:1']; - - $this->assertInstanceOf(SpanContext::class, $this->tracer->extract(TEXT_MAP, $carrier)); - } - - public function testGetScopeManager() - { - $this->assertEquals($this->scopeManager, $this->tracer->getScopeManager()); - } - - public function testGetActiveSpan(): void - { - $span = $this->createMock(Span::class); - $scope = $this->createMock(Scope::class); - $scope->expects($this->once())->method('getSpan')->willReturn($span); - - $this->scopeManager->expects($this->once())->method('getActive')->willReturn($scope); - - $this->assertEquals($span, $this->tracer->getActiveSpan()); - } - - public function testGetActiveSpanNull(): void - { - $this->scopeManager->expects($this->once())->method('getActive')->willReturn(null); - - $this->assertEquals(null, $this->tracer->getActiveSpan()); - } - - public function testFlush(): void - { - $this->reporter->expects($this->once())->method('close'); - - $this->tracer->flush(); - } - - /** @test */ - public function shouldHandleEmptyHostName(): void - { - $tracer = new \ReflectionClass(Tracer::class); - - $getHostByName = $tracer->getMethod('getHostByName'); - $getHostByName->setAccessible(true); - - $stub = $this->getMockBuilder(Tracer::class) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - - $logger = $tracer->getProperty('logger'); - $logger->setAccessible(true); - $logger->setValue($stub, $this->logger); - - $this->assertEquals('127.0.0.1', $getHostByName->invokeArgs($stub, [null])); - } -} diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/README.md b/vendor/jonahgeorge/jaeger-client-php/tests/README.md deleted file mode 100644 index aa828030f..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# Jaeger Bindings for PHP OpenTracing API: Unit Tests - -Welcome to the Jaeger Testing Suite. - -This folder includes all the unit tests that test Jaeger components, ensuring that you enjoy a bug free library. - -## Current PHP Support - -| version | status | -|---------|--------| -| 7.0 | ✔ | -| 7.1 | ✔ | -| 7.2 | ✔ | - - -## Getting Started - -This testing suite uses [Travis CI](https://travis-ci.org/) for each run. -Every commit pushed to this repository will queue a build into the continuous integration service and will run all tests -to ensure that everything is going well and the project is stable. - -The testing suite can be run on your own machine. The main dependency is [PHPUnit](https://phpunit.de/) -which can be installed using [Composer](https://getcomposer.org/): - -```bash -# run this command from project root -$ composer install -``` - -Then run the tests by calling command from the terminal as follows: - -```bash -$ composer test -``` - -## Run Tests for Supported Versions - -There is also an ability to run tests for different PHP versions. To achieve this we offer use -[docker](https://docs.docker.com/install/)-based approach: - -```bash - -$ docker run --rm -it -v $(pwd):/usr/app php:7.0 ./usr/app/tests/php-test.sh - -$ docker run --rm -it -v $(pwd):/usr/app php:7.1 ./usr/app/tests/php-test.sh - -$ docker run --rm -it -v $(pwd):/usr/app php:7.2 ./usr/app/tests/php-test.sh -``` diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/php-test.sh b/vendor/jonahgeorge/jaeger-client-php/tests/php-test.sh deleted file mode 100644 index 99a522856..000000000 --- a/vendor/jonahgeorge/jaeger-client-php/tests/php-test.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash - -# trace ERR through pipes -set -o pipefail - -# trace ERR through 'time command' and other functions -set -o errtrace - -# set -u : exit the script if you try to use an uninitialised variable -set -o nounset - -# set -e : exit the script if any statement returns a non-true return value -set -o errexit - -# to avoid message: -# "Do not run Composer as root/super user! See https://getcomposer.org/root for details" -export COMPOSER_ALLOW_SUPERUSER=1 - -export TERM=xterm-256color - -echo "[INFO]: Install OS dependencies..." -apt-get update -yq > /dev/null 2>&1 -apt-get install -yq git wget unzip zip > /dev/null 2>&1 - -echo "[INFO]: Install PHP extensions..." -docker-php-ext-install bcmath sockets > /dev/null 2>&1 -pecl install hrtime > /dev/null 2>&1 -docker-php-ext-enable hrtime > /dev/null 2>&1 - -echo "[INFO]: Install Xdebug to enable code coverage..." -pecl install xdebug > /dev/null 2>&1 -docker-php-ext-enable xdebug > /dev/null 2>&1 - -cd /tmp - -echo "[INFO]: Install Composer..." -EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" -php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" -ACTUAL_SIGNATURE="$(php -r "echo hash_file('SHA384', 'composer-setup.php');")" - -if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then - >&2 echo '[ERROR]: Invalid installer signature' - rm composer-setup.php - exit 1 -fi - -php composer-setup.php --quiet -rm composer-setup.php - -# this step is required to be able to overwrite composer.lock -cp -R /usr/app /usr/tests - -cd /usr/tests -rm -f composer.lock - -echo "[INFO]: Install library dependencies..." -php /tmp/composer.phar install \ - --no-interaction \ - --no-ansi \ - --no-progress \ - --no-suggest - -echo -e "[INFO]: Run tests...\n" -/tmp/composer.phar test diff --git a/vendor/open-telemetry/api/Baggage/Baggage.php b/vendor/open-telemetry/api/Baggage/Baggage.php new file mode 100644 index 000000000..06c701605 --- /dev/null +++ b/vendor/open-telemetry/api/Baggage/Baggage.php @@ -0,0 +1,100 @@ +get(ContextKeys::baggage()) ?? self::getEmpty(); + } + + /** @inheritDoc */ + public static function getBuilder(): BaggageBuilderInterface + { + return new BaggageBuilder(); + } + + /** @inheritDoc */ + public static function getCurrent(): BaggageInterface + { + return self::fromContext(Context::getCurrent()); + } + + /** @inheritDoc */ + public static function getEmpty(): BaggageInterface + { + if (null === self::$emptyBaggage) { + self::$emptyBaggage = new self(); + } + + return self::$emptyBaggage; + } + + /** @var array */ + private array $entries; + + /** @param array $entries */ + public function __construct(array $entries = []) + { + $this->entries = $entries; + } + + /** @inheritDoc */ + public function activate(): ScopeInterface + { + return Context::getCurrent()->withContextValue($this)->activate(); + } + + /** @inheritDoc */ + public function getEntry(string $key): ?Entry + { + return $this->entries[$key] ?? null; + } + + /** @inheritDoc */ + public function getValue(string $key) + { + if (($entry = $this->getEntry($key)) !== null) { + return $entry->getValue(); + } + + return null; + } + + /** @inheritDoc */ + public function getAll(): iterable + { + foreach ($this->entries as $key => $entry) { + yield $key => $entry; + } + } + + /** @inheritDoc */ + public function isEmpty(): bool + { + return $this->entries === []; + } + + /** @inheritDoc */ + public function toBuilder(): BaggageBuilderInterface + { + return new BaggageBuilder($this->entries); + } + + /** @inheritDoc */ + public function storeInContext(ContextInterface $context): ContextInterface + { + return $context->with(ContextKeys::baggage(), $this); + } +} diff --git a/vendor/open-telemetry/api/Baggage/BaggageBuilder.php b/vendor/open-telemetry/api/Baggage/BaggageBuilder.php new file mode 100644 index 000000000..d4500eac5 --- /dev/null +++ b/vendor/open-telemetry/api/Baggage/BaggageBuilder.php @@ -0,0 +1,40 @@ + */ + private array $entries; + + /** @param array $entries */ + public function __construct(array $entries = []) + { + $this->entries = $entries; + } + + /** @inheritDoc */ + public function remove(string $key): BaggageBuilderInterface + { + unset($this->entries[$key]); + + return $this; + } + + /** @inheritDoc */ + public function set(string $key, $value, MetadataInterface $metadata = null): BaggageBuilderInterface + { + $metadata ??= Metadata::getEmpty(); + + $this->entries[$key] = new Entry($value, $metadata); + + return $this; + } + + public function build(): BaggageInterface + { + return new Baggage($this->entries); + } +} diff --git a/vendor/open-telemetry/api/Baggage/BaggageBuilderInterface.php b/vendor/open-telemetry/api/Baggage/BaggageBuilderInterface.php new file mode 100644 index 000000000..301cfbc3c --- /dev/null +++ b/vendor/open-telemetry/api/Baggage/BaggageBuilderInterface.php @@ -0,0 +1,23 @@ +value = $value; + $this->metadata = $metadata; + } + + /** + * @return mixed + */ + public function getValue() + { + return $this->value; + } + + public function getMetadata(): MetadataInterface + { + return $this->metadata; + } +} diff --git a/vendor/open-telemetry/api/Baggage/Metadata.php b/vendor/open-telemetry/api/Baggage/Metadata.php new file mode 100644 index 000000000..043c96a8a --- /dev/null +++ b/vendor/open-telemetry/api/Baggage/Metadata.php @@ -0,0 +1,27 @@ +metadata = $metadata; + } + + public function getValue(): string + { + return $this->metadata; + } +} diff --git a/vendor/open-telemetry/api/Baggage/MetadataInterface.php b/vendor/open-telemetry/api/Baggage/MetadataInterface.php new file mode 100644 index 000000000..cd0a6d1ec --- /dev/null +++ b/vendor/open-telemetry/api/Baggage/MetadataInterface.php @@ -0,0 +1,13 @@ +isEmpty()) { + return; + } + + $headerString = ''; + + /** @var Entry $entry */ + foreach ($baggage->getAll() as $key => $entry) { + $value = urlencode($entry->getValue()); + $headerString.= "{$key}={$value}"; + + if (($metadata = $entry->getMetadata()->getValue()) !== '' && ($metadata = $entry->getMetadata()->getValue()) !== '0') { + $headerString .= ";{$metadata}"; + } + + $headerString .= ','; + } + + if ($headerString !== '' && $headerString !== '0') { + $headerString = rtrim($headerString, ','); + $setter->set($carrier, self::BAGGAGE, $headerString); + } + } + + public function extract($carrier, PropagationGetterInterface $getter = null, ContextInterface $context = null): ContextInterface + { + $getter ??= ArrayAccessGetterSetter::getInstance(); + $context ??= Context::getCurrent(); + + if (!$baggageHeader = $getter->get($carrier, self::BAGGAGE)) { + return $context; + } + + $baggageBuilder = Baggage::getBuilder(); + $this->extractValue($baggageHeader, $baggageBuilder); + + return $context->withContextValue($baggageBuilder->build()); + } + + private function extractValue(string $baggageHeader, BaggageBuilderInterface $baggageBuilder): void + { + (new Parser($baggageHeader))->parseInto($baggageBuilder); + } +} diff --git a/vendor/open-telemetry/api/Baggage/Propagation/Parser.php b/vendor/open-telemetry/api/Baggage/Propagation/Parser.php new file mode 100644 index 000000000..3518b858d --- /dev/null +++ b/vendor/open-telemetry/api/Baggage/Propagation/Parser.php @@ -0,0 +1,69 @@ +', '@', ',', ';', ':', '\\', '"', '/', '[', ']', '?', '=', '{', '}']; + private const EXCLUDED_VALUE_CHARS = [' ', '"', ',', ';', '\\']; + private const EQUALS = '='; + + /** @readonly */ + private string $baggageHeader; + + public function __construct(string $baggageHeader) + { + $this->baggageHeader = $baggageHeader; + } + + public function parseInto(BaggageBuilderInterface $baggageBuilder): void + { + foreach (explode(',', $this->baggageHeader) as $baggageString) { + if (empty(trim($baggageString))) { + continue; + } + + $explodedString = explode(';', $baggageString, 2); + + $keyValue = trim($explodedString[0]); + + if (empty($keyValue) || mb_strpos($keyValue, self::EQUALS) === false) { + continue; + } + + $metadataString = $explodedString[1] ?? null; + + if ($metadataString && !empty(trim(($metadataString)))) { + $metadata = new Metadata(trim($metadataString)); + } else { + $metadata = null; + } + + [$key, $value] = explode(self::EQUALS, $keyValue, 2); + + $key = urldecode($key); + $value = urldecode($value); + + $key = str_replace(self::EXCLUDED_KEY_CHARS, '', trim($key), $invalidKeyCharacters); + if (empty($key) || $invalidKeyCharacters > 0) { + continue; + } + + $value = str_replace(self::EXCLUDED_VALUE_CHARS, '', trim($value), $invalidValueCharacters); + if (empty($value) || $invalidValueCharacters > 0) { + continue; + } + + $baggageBuilder->set($key, $value, $metadata); + } + } +} diff --git a/vendor/open-telemetry/api/Behavior/Internal/LogWriter/ErrorLogWriter.php b/vendor/open-telemetry/api/Behavior/Internal/LogWriter/ErrorLogWriter.php new file mode 100644 index 000000000..1b9f785aa --- /dev/null +++ b/vendor/open-telemetry/api/Behavior/Internal/LogWriter/ErrorLogWriter.php @@ -0,0 +1,13 @@ +getMessage(), + PHP_EOL, + $exception->getTraceAsString() + ); + } else { + //get calling location, skipping over trait, formatter etc + $caller = debug_backtrace()[3]; + $message = sprintf( + 'OpenTelemetry: [%s] %s in %s(%s)', + $level, + $message, + $caller['file'], + $caller['line'], + ); + } + + return $message; + } +} diff --git a/vendor/open-telemetry/api/Behavior/Internal/LogWriter/LogWriterInterface.php b/vendor/open-telemetry/api/Behavior/Internal/LogWriter/LogWriterInterface.php new file mode 100644 index 000000000..046d21fc9 --- /dev/null +++ b/vendor/open-telemetry/api/Behavior/Internal/LogWriter/LogWriterInterface.php @@ -0,0 +1,10 @@ +logger = $logger; + } + + public function write($level, string $message, array $context): void + { + $this->logger->log($level, $message, $context); + } +} diff --git a/vendor/open-telemetry/api/Behavior/Internal/LogWriter/StreamLogWriter.php b/vendor/open-telemetry/api/Behavior/Internal/LogWriter/StreamLogWriter.php new file mode 100644 index 000000000..f65f1e856 --- /dev/null +++ b/vendor/open-telemetry/api/Behavior/Internal/LogWriter/StreamLogWriter.php @@ -0,0 +1,25 @@ +stream = $stream; + } else { + throw new \RuntimeException(sprintf('Unable to open %s for writing', $destination)); + } + } + + public function write($level, string $message, array $context): void + { + fwrite($this->stream, Formatter::format($level, $message, $context)); + } +} diff --git a/vendor/open-telemetry/api/Behavior/Internal/LogWriterFactory.php b/vendor/open-telemetry/api/Behavior/Internal/LogWriterFactory.php new file mode 100644 index 000000000..07c48cea5 --- /dev/null +++ b/vendor/open-telemetry/api/Behavior/Internal/LogWriterFactory.php @@ -0,0 +1,48 @@ +getString(self::OTEL_PHP_LOG_DESTINATION); + $logger = LoggerHolder::get(); + + switch ($dest) { + case 'none': + return new NoopLogWriter(); + case 'stderr': + return new StreamLogWriter('php://stderr'); + case 'stdout': + return new StreamLogWriter('php://stdout'); + case 'psr3': + if ($logger) { + return new Psr3LogWriter($logger); + } + error_log('OpenTelemetry: cannot use OTEL_PHP_LOG_DESTINATION=psr3 without providing a PSR-3 logger'); + //default to error log + return new ErrorLogWriter(); + case 'error_log': + return new ErrorLogWriter(); + default: + if ($logger) { + return new Psr3LogWriter($logger); + } + + return new ErrorLogWriter(); + } + } +} diff --git a/vendor/open-telemetry/api/Behavior/Internal/Logging.php b/vendor/open-telemetry/api/Behavior/Internal/Logging.php new file mode 100644 index 000000000..e5bec7ab5 --- /dev/null +++ b/vendor/open-telemetry/api/Behavior/Internal/Logging.php @@ -0,0 +1,90 @@ +create(); + + return self::$writer; + } + + /** + * Get level priority from level name + */ + public static function level(string $level): int + { + $value = array_search($level, self::LEVELS); + + return $value ?: 1; //'info' + } + + /** + * Get defined OTEL_LOG_LEVEL, or default + */ + public static function logLevel(): int + { + self::$logLevel ??= self::getLogLevel(); + + return self::$logLevel; + } + + private static function getLogLevel(): int + { + $level = array_key_exists(self::OTEL_LOG_LEVEL, $_SERVER) + ? $_SERVER[self::OTEL_LOG_LEVEL] + : getenv(self::OTEL_LOG_LEVEL); + if (!$level) { + $level = ini_get(self::OTEL_LOG_LEVEL); + } + if (!$level) { + $level = self::DEFAULT_LEVEL; + } + + return self::level($level); + } + + public static function reset(): void + { + self::$logLevel = null; + self::$writer = null; + } +} diff --git a/vendor/open-telemetry/api/Behavior/LogsMessagesTrait.php b/vendor/open-telemetry/api/Behavior/LogsMessagesTrait.php new file mode 100644 index 000000000..d0207e4b1 --- /dev/null +++ b/vendor/open-telemetry/api/Behavior/LogsMessagesTrait.php @@ -0,0 +1,50 @@ += Logging::logLevel(); + } + + private static function doLog(string $level, string $message, array $context): void + { + $writer = Logging::logWriter(); + if (self::shouldLog($level)) { + $context['source'] = get_called_class(); + $writer->write($level, $message, $context); + } + } + + protected static function logDebug(string $message, array $context = []): void + { + self::doLog(LogLevel::DEBUG, $message, $context); + } + + protected static function logInfo(string $message, array $context = []): void + { + self::doLog(LogLevel::INFO, $message, $context); + } + + protected static function logNotice(string $message, array $context = []): void + { + self::doLog(LogLevel::NOTICE, $message, $context); + } + + protected static function logWarning(string $message, array $context = []): void + { + self::doLog(LogLevel::WARNING, $message, $context); + } + + protected static function logError(string $message, array $context = []): void + { + self::doLog(LogLevel::ERROR, $message, $context); + } +} diff --git a/vendor/open-telemetry/api/Globals.php b/vendor/open-telemetry/api/Globals.php new file mode 100644 index 000000000..8f04b0b42 --- /dev/null +++ b/vendor/open-telemetry/api/Globals.php @@ -0,0 +1,121 @@ +tracerProvider = $tracerProvider; + $this->meterProvider = $meterProvider; + $this->loggerProvider = $loggerProvider; + $this->propagator = $propagator; + } + + public static function tracerProvider(): TracerProviderInterface + { + return Context::getCurrent()->get(ContextKeys::tracerProvider()) ?? self::globals()->tracerProvider; + } + + public static function meterProvider(): MeterProviderInterface + { + return Context::getCurrent()->get(ContextKeys::meterProvider()) ?? self::globals()->meterProvider; + } + + public static function propagator(): TextMapPropagatorInterface + { + return Context::getCurrent()->get(ContextKeys::propagator()) ?? self::globals()->propagator; + } + + public static function loggerProvider(): LoggerProviderInterface + { + return Context::getCurrent()->get(ContextKeys::loggerProvider()) ?? self::globals()->loggerProvider; + } + + /** + * @param Closure(Configurator): Configurator $initializer + * + * @interal + * @psalm-internal OpenTelemetry + */ + public static function registerInitializer(Closure $initializer): void + { + self::$initializers[] = $initializer; + } + + /** + * @phan-suppress PhanTypeMismatchReturnNullable + */ + private static function globals(): self + { + if (self::$globals !== null) { + return self::$globals; + } + + $configurator = Configurator::createNoop(); + $scope = $configurator->activate(); + + try { + foreach (self::$initializers as $initializer) { + try { + $configurator = $initializer($configurator); + } catch (Throwable $e) { + trigger_error(sprintf("Error during opentelemetry initialization: %s\n%s", $e->getMessage(), $e->getTraceAsString()), E_USER_WARNING); + } + } + } finally { + $scope->detach(); + } + + $context = $configurator->storeInContext(); + $tracerProvider = $context->get(ContextKeys::tracerProvider()); + $meterProvider = $context->get(ContextKeys::meterProvider()); + $propagator = $context->get(ContextKeys::propagator()); + $loggerProvider = $context->get(ContextKeys::loggerProvider()); + + assert(isset($tracerProvider, $meterProvider, $loggerProvider, $propagator)); + + return self::$globals = new self($tracerProvider, $meterProvider, $loggerProvider, $propagator); + } + + /** + * @internal + */ + public static function reset(): void + { + self::$globals = null; + self::$initializers = []; + } +} diff --git a/vendor/open-telemetry/api/Instrumentation/CachedInstrumentation.php b/vendor/open-telemetry/api/Instrumentation/CachedInstrumentation.php new file mode 100644 index 000000000..5ffb3950d --- /dev/null +++ b/vendor/open-telemetry/api/Instrumentation/CachedInstrumentation.php @@ -0,0 +1,97 @@ +|null */ + private ?ArrayAccess $tracers; + /** @var ArrayAccess|null */ + private ?ArrayAccess $meters; + /** @var ArrayAccess|null */ + private ?ArrayAccess $loggers; + + public function __construct(string $name, ?string $version = null, ?string $schemaUrl = null, iterable $attributes = []) + { + $this->name = $name; + $this->version = $version; + $this->schemaUrl = $schemaUrl; + $this->attributes = $attributes; + $this->tracers = self::createWeakMap(); + $this->meters = self::createWeakMap(); + $this->loggers = self::createWeakMap(); + } + + private static function createWeakMap(): ?ArrayAccess + { + if (PHP_VERSION_ID < 80000) { + return null; + } + + /** @phan-suppress-next-line PhanUndeclaredClassReference */ + assert(class_exists(\WeakMap::class, false)); + /** @phan-suppress-next-line PhanUndeclaredClassMethod */ + $map = new \WeakMap(); + assert($map instanceof ArrayAccess); + + return $map; + } + + public function tracer(): TracerInterface + { + $tracerProvider = Globals::tracerProvider(); + + if ($this->tracers === null) { + return $tracerProvider->getTracer($this->name, $this->version, $this->schemaUrl, $this->attributes); + } + + return $this->tracers[$tracerProvider] ??= $tracerProvider->getTracer($this->name, $this->version, $this->schemaUrl, $this->attributes); + } + + public function meter(): MeterInterface + { + $meterProvider = Globals::meterProvider(); + + if ($this->meters === null) { + return $meterProvider->getMeter($this->name, $this->version, $this->schemaUrl, $this->attributes); + } + + return $this->meters[$meterProvider] ??= $meterProvider->getMeter($this->name, $this->version, $this->schemaUrl, $this->attributes); + } + public function logger(): LoggerInterface + { + $loggerProvider = Globals::loggerProvider(); + + if ($this->loggers === null) { + return $loggerProvider->getLogger($this->name, $this->version, $this->schemaUrl, $this->attributes); + } + + return $this->loggers[$loggerProvider] ??= $loggerProvider->getLogger($this->name, $this->version, $this->schemaUrl, $this->attributes); + } +} diff --git a/vendor/open-telemetry/api/Instrumentation/ConfigurationResolver.php b/vendor/open-telemetry/api/Instrumentation/ConfigurationResolver.php new file mode 100644 index 000000000..bb5619c30 --- /dev/null +++ b/vendor/open-telemetry/api/Instrumentation/ConfigurationResolver.php @@ -0,0 +1,77 @@ +getVariable($name) !== null; + } + + public function getString(string $name): ?string + { + return $this->getVariable($name); + } + + public function getBoolean(string $name): ?bool + { + $value = $this->getVariable($name); + if ($value === null) { + return null; + } + + return ($value === 'true'); + } + + public function getInt(string $name): ?int + { + $value = $this->getVariable($name); + if ($value === null) { + return null; + } + if (filter_var($value, FILTER_VALIDATE_INT) === false) { + //log warning + return null; + } + + return (int) $value; + } + + public function getList(string $name): array + { + $value = $this->getVariable($name); + if ($value === null) { + return []; + } + + return explode(',', $value); + } + + private function getVariable(string $name): ?string + { + $value = $_SERVER[$name] ?? null; + if ($value !== false && !self::isEmpty($value)) { + assert(is_string($value)); + + return $value; + } + $value = getenv($name); + if ($value !== false && !self::isEmpty($value)) { + return $value; + } + $value = ini_get($name); + if ($value !== false && !self::isEmpty($value)) { + return $value; + } + + return null; + } + + private static function isEmpty($value): bool + { + return $value === false || $value === null || $value === ''; + } +} diff --git a/vendor/open-telemetry/api/Instrumentation/ConfigurationResolverInterface.php b/vendor/open-telemetry/api/Instrumentation/ConfigurationResolverInterface.php new file mode 100644 index 000000000..79bd94047 --- /dev/null +++ b/vendor/open-telemetry/api/Instrumentation/ConfigurationResolverInterface.php @@ -0,0 +1,14 @@ +withTracerProvider(new NoopTracerProvider()) + ->withMeterProvider(new NoopMeterProvider()) + ->withPropagator(new NoopTextMapPropagator()) + ->withLoggerProvider(new NoopLoggerProvider()) + ; + } + + public function activate(): ScopeInterface + { + return $this->storeInContext()->activate(); + } + + public function storeInContext(?ContextInterface $context = null): ContextInterface + { + $context ??= Context::getCurrent(); + + if ($this->tracerProvider !== null) { + $context = $context->with(ContextKeys::tracerProvider(), $this->tracerProvider); + } + if ($this->meterProvider !== null) { + $context = $context->with(ContextKeys::meterProvider(), $this->meterProvider); + } + if ($this->propagator !== null) { + $context = $context->with(ContextKeys::propagator(), $this->propagator); + } + if ($this->loggerProvider !== null) { + $context = $context->with(ContextKeys::loggerProvider(), $this->loggerProvider); + } + + return $context; + } + + public function withTracerProvider(?TracerProviderInterface $tracerProvider): Configurator + { + $self = clone $this; + $self->tracerProvider = $tracerProvider; + + return $self; + } + + public function withMeterProvider(?MeterProviderInterface $meterProvider): Configurator + { + $self = clone $this; + $self->meterProvider = $meterProvider; + + return $self; + } + + public function withPropagator(?TextMapPropagatorInterface $propagator): Configurator + { + $self = clone $this; + $self->propagator = $propagator; + + return $self; + } + + public function withLoggerProvider(?LoggerProviderInterface $loggerProvider): Configurator + { + $self = clone $this; + $self->loggerProvider = $loggerProvider; + + return $self; + } +} diff --git a/vendor/open-telemetry/api/Instrumentation/ContextKeys.php b/vendor/open-telemetry/api/Instrumentation/ContextKeys.php new file mode 100644 index 000000000..ea1a66416 --- /dev/null +++ b/vendor/open-telemetry/api/Instrumentation/ContextKeys.php @@ -0,0 +1,58 @@ + + */ + public static function tracerProvider(): ContextKeyInterface + { + static $instance; + + return $instance ??= Context::createKey(TracerProviderInterface::class); + } + + /** + * @return ContextKeyInterface + */ + public static function meterProvider(): ContextKeyInterface + { + static $instance; + + return $instance ??= Context::createKey(MeterProviderInterface::class); + } + + /** + * @return ContextKeyInterface + */ + public static function propagator(): ContextKeyInterface + { + static $instance; + + return $instance ??= Context::createKey(TextMapPropagatorInterface::class); + } + + /** + * @return ContextKeyInterface + */ + public static function loggerProvider(): ContextKeyInterface + { + static $instance; + + return $instance ??= Context::createKey(LoggerProviderInterface::class); + } +} diff --git a/vendor/open-telemetry/api/Instrumentation/InstrumentationInterface.php b/vendor/open-telemetry/api/Instrumentation/InstrumentationInterface.php new file mode 100644 index 000000000..d67bc8d6d --- /dev/null +++ b/vendor/open-telemetry/api/Instrumentation/InstrumentationInterface.php @@ -0,0 +1,43 @@ +getTracer()->spanBuilder($this->getName())->startSpan(); + // do stuff + $span->end(); + } +} + +An user of the instrumentation and API/SDK would the call: + +$instrumentation = new Instrumentation; +$instrumentation->activate() + +to activate and use the instrumentation with the API/SDK. + **/ + +trait InstrumentationTrait +{ + private TextMapPropagatorInterface $propagator; + private TracerProviderInterface $tracerProvider; + private TracerInterface $tracer; + private MeterInterface $meter; + private LoggerInterface $logger; + + public function __construct() + { + $this->initDefaults(); + } + + /** + * The name of the instrumenting/instrumented library/package/project. + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.12.0/specification/glossary.md#instrumentation-scope + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.12.0/specification/glossary.md#instrumentation-library + */ + abstract public function getName(): string; + + /** + * The version of the instrumenting/instrumented library/package/project. + * If unknown or a lookup is too expensive simply return NULL. + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.12.0/specification/glossary.md#instrumentation-scope + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.12.0/specification/glossary.md#instrumentation-library + */ + abstract public function getVersion(): ?string; + + /** + * The version of the instrumenting/instrumented library/package/project. + * If unknown simply return NULL. + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.12.0/specification/glossary.md#instrumentation-scope + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.12.0/specification/glossary.md#instrumentation-library + */ + abstract public function getSchemaUrl(): ?string; + + /** + * This method will be called from the API when the instrumentation has been activated (via activate()). + * Here you can put any bootstrapping code needed by the instrumentation. + * If not needed simply implement a method which returns TRUE. + */ + abstract public function init(): bool; + + /** + * This method registers and activates the instrumentation with the OpenTelemetry API/SDK and thus + * the instrumentation will be used to generate telemetry data. + */ + public function activate(): bool + { + $this->validateImplementation(); + // activate instrumentation with the API. not implemented yet. + return true; + } + + public function setPropagator(TextMapPropagatorInterface $propagator): void + { + $this->propagator = $propagator; + } + + public function getPropagator(): TextMapPropagatorInterface + { + return $this->propagator; + } + + public function setTracerProvider(TracerProviderInterface $tracerProvider): void + { + $this->tracerProvider = $tracerProvider; + // @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.12.0/specification/trace/api.md#get-a-tracer + $this->tracer = $tracerProvider->getTracer( + $this->getName(), + $this->getVersion(), + $this->getSchemaUrl(), + ); + } + + public function getTracerProvider(): TracerProviderInterface + { + return $this->tracerProvider; + } + + public function getTracer(): TracerInterface + { + return $this->tracer; + } + + public function setMeterProvider(MeterProviderInterface $meterProvider): void + { + // @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.12.0/specification/metrics/api.md#get-a-meter + $this->meter = $meterProvider->getMeter( + $this->getName(), + $this->getVersion(), + ); + } + + public function getMeter(): MeterInterface + { + return $this->meter; + } + + public function setLogger(LoggerInterface $logger): void + { + $this->logger = $logger; + } + + public function getLogger(): LoggerInterface + { + return $this->logger; + } + + private function validateImplementation(): void + { + if (!$this instanceof InstrumentationInterface) { + throw new RuntimeException(sprintf( + '"%s" is meant to implement "%s"', + InstrumentationTrait::class, + InstrumentationInterface::class + )); + } + } + + private function initDefaults(): void + { + $this->propagator = new NoopTextMapPropagator(); + $this->tracer = new NoopTracer(); + $this->tracerProvider = new NoopTracerProvider(); + /** @phan-suppress-next-line PhanAccessMethodInternal */ + $this->meter = new NoopMeter(); + $this->logger = new NullLogger(); + } +} diff --git a/vendor/open-telemetry/api/LoggerHolder.php b/vendor/open-telemetry/api/LoggerHolder.php new file mode 100644 index 000000000..99f916a23 --- /dev/null +++ b/vendor/open-telemetry/api/LoggerHolder.php @@ -0,0 +1,53 @@ +logger = $logger; + $this->domain = $domain; + } + + public function logEvent(string $eventName, LogRecord $logRecord): void + { + $logRecord->setAttributes([ + 'event.name' => $eventName, + 'event.domain' => $this->domain, + ]); + $this->logger->emit($logRecord); + } +} diff --git a/vendor/open-telemetry/api/Logs/EventLoggerInterface.php b/vendor/open-telemetry/api/Logs/EventLoggerInterface.php new file mode 100644 index 000000000..a2096b9b7 --- /dev/null +++ b/vendor/open-telemetry/api/Logs/EventLoggerInterface.php @@ -0,0 +1,13 @@ +body = $body; + } + + /** + * @param int $timestamp Timestamp, in nanoseconds since the unix epoch, when the event occurred. + * @see https://opentelemetry.io/docs/reference/specification/logs/data-model/#field-timestamp + */ + public function setTimestamp(int $timestamp): self + { + $this->timestamp = $timestamp; + + return $this; + } + + public function setContext(?ContextInterface $context = null): self + { + $this->context = $context; + + return $this; + } + + /** + * @param int $severityNumber Severity number + * @see https://opentelemetry.io/docs/reference/specification/logs/data-model/#field-severitynumber + */ + public function setSeverityNumber(int $severityNumber): self + { + $this->severityNumber = $severityNumber; + + return $this; + } + + /** + * @param string $severityText Severity text, also known as log level + * @see https://opentelemetry.io/docs/reference/specification/logs/data-model/#field-severitynumber + */ + public function setSeverityText(string $severityText): self + { + $this->severityText = $severityText; + + return $this; + } + + /** + * @param iterable $attributes Additional information about the specific event occurrence. + * @see https://opentelemetry.io/docs/reference/specification/logs/data-model/#field-attributes + */ + public function setAttributes(iterable $attributes): self + { + foreach ($attributes as $name => $value) { + $this->setAttribute($name, $value); + } + + return $this; + } + + public function setAttribute(string $name, $value): self + { + $this->attributes[$name] = $value; + + return $this; + } + + /** + * @param mixed $body The log record body + */ + public function setBody($body = null): self + { + $this->body = $body; + + return $this; + } + + /** + * @param int|null $observedTimestamp Time, in nanoseconds since the unix epoch, when the event was observed by the collection system. + */ + public function setObservedTimestamp(int $observedTimestamp = null): self + { + $this->observedTimestamp = $observedTimestamp; + + return $this; + } +} diff --git a/vendor/open-telemetry/api/Logs/LoggerInterface.php b/vendor/open-telemetry/api/Logs/LoggerInterface.php new file mode 100644 index 000000000..89477c8d2 --- /dev/null +++ b/vendor/open-telemetry/api/Logs/LoggerInterface.php @@ -0,0 +1,10 @@ + $attributes + * attributes of the data point + * @param ContextInterface|false|null $context execution context + * + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#add + */ + public function add($amount, iterable $attributes = [], $context = null): void; +} diff --git a/vendor/open-telemetry/api/Metrics/HistogramInterface.php b/vendor/open-telemetry/api/Metrics/HistogramInterface.php new file mode 100644 index 000000000..22ddd1f3c --- /dev/null +++ b/vendor/open-telemetry/api/Metrics/HistogramInterface.php @@ -0,0 +1,21 @@ + $attributes + * attributes of the data point + * @param ContextInterface|false|null $context execution context + * + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#record + */ + public function record($amount, iterable $attributes = [], $context = null): void; +} diff --git a/vendor/open-telemetry/api/Metrics/MeterInterface.php b/vendor/open-telemetry/api/Metrics/MeterInterface.php new file mode 100644 index 000000000..6e06d9085 --- /dev/null +++ b/vendor/open-telemetry/api/Metrics/MeterInterface.php @@ -0,0 +1,111 @@ + $attributes + * instrumentation scope attributes + * @return MeterInterface meter instance for the instrumentation scope + * + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#get-a-meter + */ + public function getMeter( + string $name, + ?string $version = null, + ?string $schemaUrl = null, + iterable $attributes = [] + ): MeterInterface; +} diff --git a/vendor/open-telemetry/api/Metrics/Noop/NoopCounter.php b/vendor/open-telemetry/api/Metrics/Noop/NoopCounter.php new file mode 100644 index 000000000..d47fc2166 --- /dev/null +++ b/vendor/open-telemetry/api/Metrics/Noop/NoopCounter.php @@ -0,0 +1,18 @@ +getMeter('example') + * ->createObservableGauge('random') + * ->observe(fn(ObserverInterface $observer) + * => $observer->observe(rand(0, 10))); + * } + * } + * ``` + * Keeping a reference to the `ObservableCallbackInterface` within the bound + * object to gain a more fine-grained control over the life-time of the callback + * does not prevent garbage collection (but might require cycle collection). + * + * Unbound (static) callbacks must be detached manually using + * {@link ObservableCallbackInterface::detach()}. + * ```php + * class Example { + * private ObservableCallbackInterface $gauge; + * function __construct(MeterProviderInterface $meterProvider) { + * $this->gauge = $meterProvider->getMeter('example') + * ->createObservableGauge('random') + * ->observe(static fn(ObserverInterface $observer) + * => $observer->observe(rand(0, 10))); + * } + * function __destruct() { + * $this->gauge->detach(); + * } + * } + * ``` + * + * @see ObservableCounterInterface::observe() + * @see ObservableGaugeInterface::observe() + * @see ObservableUpDownCounterInterface::observe() + */ +interface ObservableCallbackInterface +{ + + /** + * Detaches the associated callback from the instrument. + */ + public function detach(): void; +} diff --git a/vendor/open-telemetry/api/Metrics/ObservableCounterInterface.php b/vendor/open-telemetry/api/Metrics/ObservableCounterInterface.php new file mode 100644 index 000000000..feb1ed439 --- /dev/null +++ b/vendor/open-telemetry/api/Metrics/ObservableCounterInterface.php @@ -0,0 +1,16 @@ + $attributes + * attributes of the data point + */ + public function observe($amount, iterable $attributes = []): void; +} diff --git a/vendor/open-telemetry/api/Metrics/UpDownCounterInterface.php b/vendor/open-telemetry/api/Metrics/UpDownCounterInterface.php new file mode 100644 index 000000000..f1f808fdb --- /dev/null +++ b/vendor/open-telemetry/api/Metrics/UpDownCounterInterface.php @@ -0,0 +1,19 @@ + $attributes + * attributes of the data point + * @param ContextInterface|false|null $context execution context + */ + public function add($amount, iterable $attributes = [], $context = null): void; +} diff --git a/vendor/open-telemetry/api/README.md b/vendor/open-telemetry/api/README.md new file mode 100644 index 000000000..c2cbd1bf1 --- /dev/null +++ b/vendor/open-telemetry/api/README.md @@ -0,0 +1,14 @@ +[![Releases](https://img.shields.io/badge/releases-purple)](https://github.com/opentelemetry-php/api/releases) +[![Source](https://img.shields.io/badge/source-api-green)](https://github.com/open-telemetry/opentelemetry-php/tree/main/src/API) +[![Mirror](https://img.shields.io/badge/mirror-opentelemetry--php:api-blue)](https://github.com/opentelemetry-php/api) +[![Latest Version](http://poser.pugx.org/open-telemetry/api/v/unstable)](https://packagist.org/packages/open-telemetry/api/) +[![Stable](http://poser.pugx.org/open-telemetry/api/v/stable)](https://packagist.org/packages/open-telemetry/api/) + +# OpenTelemetry API + +Documentation: https://opentelemetry.io/docs/instrumentation/php + +## Contributing + +This repository is a read-only git subtree split. +To contribute, please see the main [OpenTelemetry PHP monorepo](https://github.com/open-telemetry/opentelemetry-php). diff --git a/vendor/open-telemetry/api/Signals.php b/vendor/open-telemetry/api/Signals.php new file mode 100644 index 000000000..95582aaa2 --- /dev/null +++ b/vendor/open-telemetry/api/Signals.php @@ -0,0 +1,21 @@ +context = $context; + } + + /** @inheritDoc */ + public function getContext(): SpanContextInterface + { + return $this->context; + } + + /** @inheritDoc */ + public function isRecording(): bool + { + return false; + } + + /** @inheritDoc */ + public function setAttribute(string $key, $value): SpanInterface + { + return $this; + } + + /** @inheritDoc */ + public function setAttributes(iterable $attributes): SpanInterface + { + return $this; + } + + /** @inheritDoc */ + public function addEvent(string $name, iterable $attributes = [], int $timestamp = null): SpanInterface + { + return $this; + } + + /** @inheritDoc */ + public function recordException(Throwable $exception, iterable $attributes = []): SpanInterface + { + return $this; + } + + /** @inheritDoc */ + public function updateName(string $name): SpanInterface + { + return $this; + } + + /** @inheritDoc */ + public function setStatus(string $code, string $description = null): SpanInterface + { + return $this; + } + + /** @inheritDoc */ + public function end(int $endEpochNanos = null): void + { + } +} diff --git a/vendor/open-telemetry/api/Trace/NoopSpanBuilder.php b/vendor/open-telemetry/api/Trace/NoopSpanBuilder.php new file mode 100644 index 000000000..6f971e525 --- /dev/null +++ b/vendor/open-telemetry/api/Trace/NoopSpanBuilder.php @@ -0,0 +1,65 @@ +contextStorage = $contextStorage; + } + + public function setParent($context): SpanBuilderInterface + { + $this->parentContext = $context; + + return $this; + } + + public function addLink(SpanContextInterface $context, iterable $attributes = []): SpanBuilderInterface + { + return $this; + } + + public function setAttribute(string $key, $value): SpanBuilderInterface + { + return $this; + } + + public function setAttributes(iterable $attributes): SpanBuilderInterface + { + return $this; + } + + public function setStartTimestamp(int $timestampNanos): SpanBuilderInterface + { + return $this; + } + + public function setSpanKind(int $spanKind): SpanBuilderInterface + { + return $this; + } + + public function startSpan(): SpanInterface + { + $parentContext = Context::resolve($this->parentContext, $this->contextStorage); + $span = Span::fromContext($parentContext); + if ($span->isRecording()) { + $span = Span::wrap($span->getContext()); + } + + return $span; + } +} diff --git a/vendor/open-telemetry/api/Trace/NoopTracer.php b/vendor/open-telemetry/api/Trace/NoopTracer.php new file mode 100644 index 000000000..bc50248bd --- /dev/null +++ b/vendor/open-telemetry/api/Trace/NoopTracer.php @@ -0,0 +1,26 @@ +getContext(); + + if (!$spanContext->isValid()) { + return; + } + + // Build and inject the traceparent header + $traceparent = self::VERSION . '-' . $spanContext->getTraceId() . '-' . $spanContext->getSpanId() . '-' . ($spanContext->isSampled() ? '01' : '00'); + $setter->set($carrier, self::TRACEPARENT, $traceparent); + + // Build and inject the tracestate header + // Spec says to avoid sending empty tracestate headers + if (($tracestate = (string) $spanContext->getTraceState()) !== '') { + $setter->set($carrier, self::TRACESTATE, $tracestate); + } + } + + /** {@inheritdoc} */ + public function extract($carrier, PropagationGetterInterface $getter = null, ContextInterface $context = null): ContextInterface + { + $getter ??= ArrayAccessGetterSetter::getInstance(); + $context ??= Context::getCurrent(); + + $spanContext = self::extractImpl($carrier, $getter); + if (!$spanContext->isValid()) { + return $context; + } + + return $context->withContextValue(Span::wrap($spanContext)); + } + + private static function extractImpl($carrier, PropagationGetterInterface $getter): SpanContextInterface + { + $traceparent = $getter->get($carrier, self::TRACEPARENT); + if ($traceparent === null) { + return SpanContext::getInvalid(); + } + + // traceParent = {version}-{trace-id}-{parent-id}-{trace-flags} + $pieces = explode('-', $traceparent); + + // If the header does not have at least 4 pieces, it is invalid -- restart the trace. + if (count($pieces) < 4) { + return SpanContext::getInvalid(); + } + + [$version, $traceId, $spanId, $traceFlags] = $pieces; + + /** + * Return invalid if: + * - Version is invalid (not 2 char hex or 'ff') + * - Trace version, trace ID, span ID or trace flag are invalid + */ + if (!TraceContextValidator::isValidTraceVersion($version) + || !SpanContextValidator::isValidTraceId($traceId) + || !SpanContextValidator::isValidSpanId($spanId) + || !TraceContextValidator::isValidTraceFlag($traceFlags) + ) { + return SpanContext::getInvalid(); + } + + // Return invalid if the trace version is not a future version but still has > 4 pieces. + $versionIsFuture = hexdec($version) > hexdec(self::VERSION); + if (count($pieces) > 4 && !$versionIsFuture) { + return SpanContext::getInvalid(); + } + + // Only the sampled flag is extracted from the traceFlags (00000001) + $convertedTraceFlags = hexdec($traceFlags); + $isSampled = ($convertedTraceFlags & TraceFlags::SAMPLED) === TraceFlags::SAMPLED; + + // Tracestate = 'Vendor1=Value1,...,VendorN=ValueN' + $rawTracestate = $getter->get($carrier, self::TRACESTATE); + if ($rawTracestate !== null) { + $tracestate = new TraceState($rawTracestate); + + return SpanContext::createFromRemoteParent( + $traceId, + $spanId, + $isSampled ? TraceFlags::SAMPLED : TraceFlags::DEFAULT, + $tracestate + ); + } + + // Only traceparent header is extracted. No tracestate. + return SpanContext::createFromRemoteParent( + $traceId, + $spanId, + $isSampled ? TraceFlags::SAMPLED : TraceFlags::DEFAULT + ); + } +} diff --git a/vendor/open-telemetry/api/Trace/Propagation/TraceContextValidator.php b/vendor/open-telemetry/api/Trace/Propagation/TraceContextValidator.php new file mode 100644 index 000000000..5fb3f12c7 --- /dev/null +++ b/vendor/open-telemetry/api/Trace/Propagation/TraceContextValidator.php @@ -0,0 +1,31 @@ +get(ContextKeys::span()) ?? self::getInvalid(); + } + + /** @inheritDoc */ + final public static function getCurrent(): SpanInterface + { + return self::fromContext(Context::getCurrent()); + } + + /** @inheritDoc */ + final public static function getInvalid(): SpanInterface + { + if (null === self::$invalidSpan) { + self::$invalidSpan = new NonRecordingSpan(SpanContext::getInvalid()); + } + + return self::$invalidSpan; + } + + /** @inheritDoc */ + final public static function wrap(SpanContextInterface $spanContext): SpanInterface + { + if (!$spanContext->isValid()) { + return self::getInvalid(); + } + + return new NonRecordingSpan($spanContext); + } + + /** @inheritDoc */ + final public function activate(): ScopeInterface + { + return Context::getCurrent()->withContextValue($this)->activate(); + } + + /** @inheritDoc */ + final public function storeInContext(ContextInterface $context): ContextInterface + { + return $context->with(ContextKeys::span(), $this); + } +} diff --git a/vendor/open-telemetry/api/Trace/SpanBuilderInterface.php b/vendor/open-telemetry/api/Trace/SpanBuilderInterface.php new file mode 100644 index 000000000..52070933a --- /dev/null +++ b/vendor/open-telemetry/api/Trace/SpanBuilderInterface.php @@ -0,0 +1,51 @@ +isValid=false; + } + + $this->traceId = $traceId; + $this->spanId = $spanId; + $this->traceState = $traceState; + $this->isRemote = $isRemote; + $this->isSampled = ($traceFlags & TraceFlags::SAMPLED) === TraceFlags::SAMPLED; + $this->traceFlags = $traceFlags; + } + + public function getTraceId(): string + { + return $this->traceId; + } + + public function getTraceIdBinary(): string + { + return hex2bin($this->traceId); + } + + public function getSpanId(): string + { + return $this->spanId; + } + + public function getSpanIdBinary(): string + { + return hex2bin($this->spanId); + } + + public function getTraceState(): ?TraceStateInterface + { + return $this->traceState; + } + + public function isSampled(): bool + { + return $this->isSampled; + } + + public function isValid(): bool + { + return $this->isValid; + } + + public function isRemote(): bool + { + return $this->isRemote; + } + + public function getTraceFlags(): int + { + return $this->traceFlags; + } + + /** @inheritDoc */ + public static function createFromRemoteParent(string $traceId, string $spanId, int $traceFlags = TraceFlags::DEFAULT, ?TraceStateInterface $traceState = null): SpanContextInterface + { + return new self( + $traceId, + $spanId, + $traceFlags, + true, + $traceState, + ); + } + + /** @inheritDoc */ + public static function create(string $traceId, string $spanId, int $traceFlags = TraceFlags::DEFAULT, ?TraceStateInterface $traceState = null): SpanContextInterface + { + return new self( + $traceId, + $spanId, + $traceFlags, + false, + $traceState, + ); + } + + /** @inheritDoc */ + public static function getInvalid(): SpanContextInterface + { + if (null === self::$invalidContext) { + self::$invalidContext = self::create(SpanContextValidator::INVALID_TRACE, SpanContextValidator::INVALID_SPAN, 0); + } + + return self::$invalidContext; + } +} diff --git a/vendor/open-telemetry/api/Trace/SpanContextInterface.php b/vendor/open-telemetry/api/Trace/SpanContextInterface.php new file mode 100644 index 000000000..d15bc5987 --- /dev/null +++ b/vendor/open-telemetry/api/Trace/SpanContextInterface.php @@ -0,0 +1,28 @@ + $attributes + */ + public function setAttributes(iterable $attributes): SpanInterface; + + /** + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/trace/api.md#add-events + */ + public function addEvent(string $name, iterable $attributes = [], int $timestamp = null): SpanInterface; + + /** + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/trace/api.md#record-exception + */ + public function recordException(Throwable $exception, iterable $attributes = []): SpanInterface; + + /** + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/trace/api.md#updatename + * + * @param non-empty-string $name + */ + public function updateName(string $name): SpanInterface; + + /** + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/trace/api.md#set-status + * + * @psalm-param StatusCode::STATUS_* $code + */ + public function setStatus(string $code, string $description = null): SpanInterface; + + /** + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/trace/api.md#end + */ + public function end(int $endEpochNanos = null): void; +} diff --git a/vendor/open-telemetry/api/Trace/SpanKind.php b/vendor/open-telemetry/api/Trace/SpanKind.php new file mode 100644 index 000000000..f44339e00 --- /dev/null +++ b/vendor/open-telemetry/api/Trace/SpanKind.php @@ -0,0 +1,17 @@ +traceState = $this->parse($rawTracestate); + } + + /** + * {@inheritdoc} + */ + public function with(string $key, string $value): TraceStateInterface + { + $clonedTracestate = clone $this; + + if ($this->validateKey($key) && $this->validateValue($value)) { + + /* + * Only one entry per key is allowed. In this case we need to overwrite the vendor entry + * upon reentry to the tracing system and ensure the updated entry is at the beginning of + * the list. This means we place it the back for now and it will be at the beginning once + * we reverse the order back during __toString(). + */ + if (array_key_exists($key, $clonedTracestate->traceState)) { + unset($clonedTracestate->traceState[$key]); + } + + // Add new or updated entry to the back of the list. + $clonedTracestate->traceState[$key] = $value; + } else { + self::logWarning('Invalid tracetrace key/value for: ' . $key); + } + + return $clonedTracestate; + } + + /** + * {@inheritdoc} + */ + public function without(string $key): TraceStateInterface + { + $clonedTracestate = clone $this; + + if ($key !== '') { + unset($clonedTracestate->traceState[$key]); + } + + return $clonedTracestate; + } + + /** + * {@inheritdoc} + */ + public function get(string $key): ?string + { + return $this->traceState[$key] ?? null; + } + + /** + * {@inheritdoc} + */ + public function getListMemberCount(): int + { + return count($this->traceState); + } + + /** + * {@inheritdoc} + */ + public function __toString(): string + { + if ($this->traceState === []) { + return ''; + } + $traceStateString=''; + foreach (array_reverse($this->traceState) as $k => $v) { + $traceStateString .=$k . self::LIST_MEMBER_KEY_VALUE_SPLITTER . $v . self::LIST_MEMBERS_SEPARATOR; + } + + return rtrim($traceStateString, ','); + } + + /** + * Parse the raw tracestate header into the TraceState object. Since new or updated entries must + * be added to the beginning of the list, the key-value pairs in the TraceState object will be + * stored in reverse order. This ensures new entries added to the TraceState object are at the + * beginning when we reverse the order back again while building the final tracestate header. + * + * Ex: + * tracestate = 'vendor1=value1,vendor2=value2' + * + * || + * \/ + * + * $this->tracestate = ['vendor2' => 'value2' ,'vendor1' => 'value1'] + * + */ + private function parse(string $rawTracestate): array + { + if (strlen($rawTracestate) > self::MAX_COMBINED_LENGTH) { + self::logWarning('tracestate discarded, exceeds max combined length: ' . self::MAX_COMBINED_LENGTH); + + return []; + } + $parsedTracestate = []; + $listMembers = explode(self::LIST_MEMBERS_SEPARATOR, $rawTracestate); + + if (count($listMembers) > self::MAX_LIST_MEMBERS) { + self::logWarning('tracestate discarded, too many members'); + + return []; + } + + foreach ($listMembers as $listMember) { + $vendor = explode(self::LIST_MEMBER_KEY_VALUE_SPLITTER, trim($listMember)); + + // There should only be one list-member per vendor separated by '=' + if (count($vendor) !== 2 || !$this->validateKey($vendor[0]) || !$this->validateValue($vendor[1])) { + self::logWarning('tracestate discarded, invalid member: ' . $listMember); + + return []; + } + $parsedTracestate[$vendor[0]] = $vendor[1]; + } + + /* + * Reversing the tracestate ensures the new entries added to the TraceState object are at + * the beginning when we reverse it back during __toString(). + */ + return array_reverse($parsedTracestate); + } + + /** + * The Key is opaque string that is an identifier for a vendor. It can be up + * to 256 characters and MUST begin with a lowercase letter or a digit, and can + * only contain lowercase letters (a-z), digits (0-9), underscores (_), dashes (-), + * asterisks (*), and forward slashes (/). For multi-tenant vendor scenarios, an at + * sign (@) can be used to prefix the vendor name. Vendors SHOULD set the tenant ID + * at the beginning of the key. + * + * @see https://www.w3.org/TR/trace-context/#key + */ + private function validateKey(string $key): bool + { + return preg_match(self::VALID_KEY_REGEX, $key) !== 0; + } + + /** + * The value is an opaque string containing up to 256 printable ASCII [RFC0020] + * characters (i.e., the range 0x20 to 0x7E) except comma (,) and (=). Note that + * this also excludes tabs, newlines, carriage returns, etc. + * + * @see https://www.w3.org/TR/trace-context/#value + */ + private function validateValue(string $key): bool + { + return (preg_match(self::VALID_VALUE_BASE_REGEX, $key) !== 0) + && (preg_match(self::INVALID_VALUE_COMMA_EQUAL_REGEX, $key) === 0); + } +} diff --git a/vendor/open-telemetry/api/Trace/TraceStateInterface.php b/vendor/open-telemetry/api/Trace/TraceStateInterface.php new file mode 100644 index 000000000..79d4e0299 --- /dev/null +++ b/vendor/open-telemetry/api/Trace/TraceStateInterface.php @@ -0,0 +1,61 @@ + $args arguments to provide to the closure + * @return R result of the closure invocation + * + * @phpstan-ignore-next-line + */ +function trace(SpanInterface $span, Closure $closure, iterable $args = []) +{ + $s = $span; + $c = $closure; + $a = $args; + unset($span, $closure, $args); + + $scope = $s->activate(); + + try { + /** @psalm-suppress InvalidArgument */ + return $c(...$a, ...($a = [])); + } catch (Throwable $e) { + $s->setStatus(StatusCode::STATUS_ERROR, $e->getMessage()); + $s->recordException($e, ['exception.escaped' => true]); + + throw $e; + } finally { + $scope->detach(); + $s->end(); + } +} diff --git a/vendor/open-telemetry/api/composer.json b/vendor/open-telemetry/api/composer.json new file mode 100644 index 000000000..39acaec47 --- /dev/null +++ b/vendor/open-telemetry/api/composer.json @@ -0,0 +1,40 @@ +{ + "name": "open-telemetry/api", + "description": "API for OpenTelemetry PHP.", + "keywords": ["opentelemetry", "otel", "metrics", "tracing", "logging", "apm", "api"], + "type": "library", + "support": { + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php", + "docs": "https://opentelemetry.io/docs/php", + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V" + }, + "license": "Apache-2.0", + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "require": { + "php": "^7.4 || ^8.0", + "open-telemetry/context": "^1.0", + "psr/log": "^1.1|^2.0|^3.0", + "symfony/polyfill-php80": "^1.26", + "symfony/polyfill-php81": "^1.26", + "symfony/polyfill-php82": "^1.26" + }, + "autoload": { + "psr-4": { + "OpenTelemetry\\API\\": "." + }, + "files": [ + "Trace/functions.php" + ] + }, + "extra": { + "branch-alias": { + "dev-main": "1.0.x-dev" + } + } +} diff --git a/vendor/open-telemetry/context/Context.php b/vendor/open-telemetry/context/Context.php new file mode 100644 index 000000000..32b0162a3 --- /dev/null +++ b/vendor/open-telemetry/context/Context.php @@ -0,0 +1,131 @@ + */ + private array $context = []; + /** @var array */ + private array $contextKeys = []; + + private function __construct() + { + self::$spanContextKey = ContextKeys::span(); + } + + public static function createKey(string $key): ContextKeyInterface + { + return new ContextKey($key); + } + + /** + * @param ContextStorageInterface&ExecutionContextAwareInterface $storage + */ + public static function setStorage(ContextStorageInterface $storage): void + { + self::$storage = $storage; + } + + /** + * @return ContextStorageInterface&ExecutionContextAwareInterface + */ + public static function storage(): ContextStorageInterface + { + /** @psalm-suppress RedundantPropertyInitializationCheck */ + return self::$storage ??= new ContextStorage(); + } + + /** + * @param ContextInterface|false|null $context + * + * @internal OpenTelemetry + */ + public static function resolve($context, ?ContextStorageInterface $contextStorage = null): ContextInterface + { + return $context + ?? ($contextStorage ?? self::storage())->current() + ?: self::getRoot(); + } + + /** + * @internal + */ + public static function getRoot(): ContextInterface + { + static $empty; + + return $empty ??= new self(); + } + + public static function getCurrent(): ContextInterface + { + return self::storage()->current(); + } + + public function activate(): ScopeInterface + { + $scope = self::storage()->attach($this); + /** @psalm-suppress RedundantCondition */ + assert((bool) $scope = new DebugScope($scope)); + + return $scope; + } + + public function withContextValue(ImplicitContextKeyedInterface $value): ContextInterface + { + return $value->storeInContext($this); + } + + public function with(ContextKeyInterface $key, $value): self + { + if ($this->get($key) === $value) { + return $this; + } + + $self = clone $this; + + if ($key === self::$spanContextKey) { + $self->span = $value; // @phan-suppress-current-line PhanTypeMismatchPropertyReal + + return $self; + } + + $id = spl_object_id($key); + if ($value !== null) { + $self->context[$id] = $value; + $self->contextKeys[$id] ??= $key; + } else { + unset( + $self->context[$id], + $self->contextKeys[$id], + ); + } + + return $self; + } + + public function get(ContextKeyInterface $key) + { + if ($key === self::$spanContextKey) { + /** @psalm-suppress InvalidReturnStatement */ + return $this->span; + } + + return $this->context[spl_object_id($key)] ?? null; + } +} diff --git a/vendor/open-telemetry/context/ContextInterface.php b/vendor/open-telemetry/context/ContextInterface.php new file mode 100644 index 000000000..17a3fb9a2 --- /dev/null +++ b/vendor/open-telemetry/context/ContextInterface.php @@ -0,0 +1,86 @@ +activate(); + * try { + * // ... + * } finally { + * $scope->detach(); + * } + * ``` + * + * @return ScopeInterface scope to detach the context and restore the previous + * context + * + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/context/README.md#attach-context + */ + public function activate(): ScopeInterface; + + /** + * Returns a context with the given key set to the given value. + * + * @template T + * @param ContextKeyInterface $key key to set + * @param T|null $value value to set + * @return ContextInterface a context with the given key set to `$value` + * + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/context/README.md#set-value + */ + public function with(ContextKeyInterface $key, $value): ContextInterface; + + /** + * Returns a context with the given value set. + * + * @param ImplicitContextKeyedInterface $value value to set + * @return ContextInterface a context with the given `$value` + * + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/context/README.md#set-value + */ + public function withContextValue(ImplicitContextKeyedInterface $value): ContextInterface; + + /** + * Returns the value assigned to the given key. + * + * @template T + * @param ContextKeyInterface $key key to get + * @return T|null value assigned to `$key`, or null if no such value exists + * + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/context/README.md#get-value + */ + public function get(ContextKeyInterface $key); +} diff --git a/vendor/open-telemetry/context/ContextKey.php b/vendor/open-telemetry/context/ContextKey.php new file mode 100644 index 000000000..f7450249e --- /dev/null +++ b/vendor/open-telemetry/context/ContextKey.php @@ -0,0 +1,23 @@ +name = $name; + } + + public function name(): ?string + { + return $this->name; + } +} diff --git a/vendor/open-telemetry/context/ContextKeyInterface.php b/vendor/open-telemetry/context/ContextKeyInterface.php new file mode 100644 index 000000000..b3ad00814 --- /dev/null +++ b/vendor/open-telemetry/context/ContextKeyInterface.php @@ -0,0 +1,12 @@ + */ + private array $forks = []; + + public function __construct() + { + $this->current = $this->main = new ContextStorageHead($this); + } + + public function fork($id): void + { + $this->forks[$id] = clone $this->current; + } + + public function switch($id): void + { + $this->current = $this->forks[$id] ?? $this->main; + } + + public function destroy($id): void + { + unset($this->forks[$id]); + } + + public function scope(): ?ContextStorageScopeInterface + { + return ($this->current->node->head ?? null) === $this->current + ? $this->current->node + : null; + } + + public function current(): ContextInterface + { + return $this->current->node->context ?? Context::getRoot(); + } + + public function attach(ContextInterface $context): ContextStorageScopeInterface + { + return $this->current->node = new ContextStorageNode($context, $this->current, $this->current->node); + } + + private function __clone() + { + } +} diff --git a/vendor/open-telemetry/context/ContextStorageHead.php b/vendor/open-telemetry/context/ContextStorageHead.php new file mode 100644 index 000000000..3cc4d7181 --- /dev/null +++ b/vendor/open-telemetry/context/ContextStorageHead.php @@ -0,0 +1,19 @@ +storage = $storage; + } +} diff --git a/vendor/open-telemetry/context/ContextStorageInterface.php b/vendor/open-telemetry/context/ContextStorageInterface.php new file mode 100644 index 000000000..e5a105074 --- /dev/null +++ b/vendor/open-telemetry/context/ContextStorageInterface.php @@ -0,0 +1,32 @@ +context = $context; + $this->head = $head; + $this->previous = $previous; + } + + public function offsetExists($offset): bool + { + return isset($this->localStorage[$offset]); + } + + /** + * @phan-suppress PhanUndeclaredClassAttribute + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->localStorage[$offset]; + } + + public function offsetSet($offset, $value): void + { + $this->localStorage[$offset] = $value; + } + + public function offsetUnset($offset): void + { + unset($this->localStorage[$offset]); + } + + public function context(): ContextInterface + { + return $this->context; + } + + public function detach(): int + { + $flags = 0; + if ($this->head !== $this->head->storage->current) { + $flags |= ScopeInterface::INACTIVE; + } + + if ($this === $this->head->node) { + assert($this->previous !== $this); + $this->head->node = $this->previous; + $this->previous = $this; + + return $flags; + } + + if ($this->previous === $this) { + return $flags | ScopeInterface::DETACHED; + } + + assert($this->head->node !== null); + for ($n = $this->head->node, $depth = 1; + $n->previous !== $this; + $n = $n->previous, $depth++) { + assert($n->previous !== null); + } + $n->previous = $this->previous; + $this->previous = $this; + + return $flags | ScopeInterface::MISMATCH | $depth; + } + + private function __clone() + { + } +} diff --git a/vendor/open-telemetry/context/ContextStorageScopeInterface.php b/vendor/open-telemetry/context/ContextStorageScopeInterface.php new file mode 100644 index 000000000..5fe58d6eb --- /dev/null +++ b/vendor/open-telemetry/context/ContextStorageScopeInterface.php @@ -0,0 +1,22 @@ +scope = $node; + $this->scope[self::DEBUG_TRACE_CREATE] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + } + + public function detach(): int + { + $this->scope[self::DEBUG_TRACE_DETACH] ??= debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + + $flags = $this->scope->detach(); + + if (($flags & ScopeInterface::DETACHED) !== 0) { + trigger_error(sprintf( + 'Scope: unexpected call to Scope::detach() for scope #%d, scope was already detached %s', + spl_object_id($this), + self::formatBacktrace($this->scope[self::DEBUG_TRACE_DETACH]), + )); + } elseif (($flags & ScopeInterface::MISMATCH) !== 0) { + trigger_error(sprintf( + 'Scope: unexpected call to Scope::detach() for scope #%d, scope successfully detached but another scope should have been detached first', + spl_object_id($this), + )); + } elseif (($flags & ScopeInterface::INACTIVE) !== 0) { + trigger_error(sprintf( + 'Scope: unexpected call to Scope::detach() for scope #%d, scope successfully detached from different execution context', + spl_object_id($this), + )); + } + + return $flags; + } + + public function __destruct() + { + if (!isset($this->scope[self::DEBUG_TRACE_DETACH])) { + trigger_error(sprintf( + 'Scope: missing call to Scope::detach() for scope #%d, created %s', + spl_object_id($this->scope), + self::formatBacktrace($this->scope[self::DEBUG_TRACE_CREATE]), + )); + } + } + + private static function formatBacktrace(array $trace): string + { + $s = ''; + for ($i = 0, $n = count($trace) + 1; ++$i < $n;) { + $s .= "\n\t"; + $s .= 'at '; + if (isset($trace[$i]['class'])) { + $s .= strtr($trace[$i]['class'], ['\\' => '.']); + $s .= '.'; + } + $s .= strtr($trace[$i]['function'] ?? '{main}', ['\\' => '.']); + $s .= '('; + if (isset($trace[$i - 1]['file'])) { + $s .= basename($trace[$i - 1]['file']); + if (isset($trace[$i - 1]['line'])) { + $s .= ':'; + $s .= $trace[$i - 1]['line']; + } + } else { + $s .= 'Unknown Source'; + } + $s .= ')'; + } + + return $s . "\n"; + } +} diff --git a/vendor/open-telemetry/context/ExecutionContextAwareInterface.php b/vendor/open-telemetry/context/ExecutionContextAwareInterface.php new file mode 100644 index 000000000..3a955bfae --- /dev/null +++ b/vendor/open-telemetry/context/ExecutionContextAwareInterface.php @@ -0,0 +1,23 @@ +storage = $storage; + } + + public function fork($id): void + { + $this->storage->fork($id); + } + + public function switch($id): void + { + $this->storage->switch($id); + } + + public function destroy($id): void + { + $this->storage->destroy($id); + } + + public function scope(): ?ContextStorageScopeInterface + { + $this->checkFiberMismatch(); + + if (($scope = $this->storage->scope()) === null) { + return null; + } + + return new FiberBoundContextStorageScope($scope); + } + + public function current(): ContextInterface + { + $this->checkFiberMismatch(); + + return $this->storage->current(); + } + + public function attach(ContextInterface $context): ContextStorageScopeInterface + { + $scope = $this->storage->attach($context); + assert(class_exists(Fiber::class, false)); + $scope[Fiber::class] = Fiber::getCurrent(); + + return new FiberBoundContextStorageScope($scope); + } + + private function checkFiberMismatch(): void + { + $scope = $this->storage->scope(); + assert(class_exists(Fiber::class, false)); + if ($scope && $scope[Fiber::class] !== Fiber::getCurrent()) { + trigger_error('Fiber context switching not supported', E_USER_WARNING); + } + } +} diff --git a/vendor/open-telemetry/context/FiberBoundContextStorageScope.php b/vendor/open-telemetry/context/FiberBoundContextStorageScope.php new file mode 100644 index 000000000..647552244 --- /dev/null +++ b/vendor/open-telemetry/context/FiberBoundContextStorageScope.php @@ -0,0 +1,67 @@ +scope = $scope; + } + + public function offsetExists($offset): bool + { + return $this->scope->offsetExists($offset); + } + + /** + * @phan-suppress PhanUndeclaredClassAttribute + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->scope->offsetGet($offset); + } + + public function offsetSet($offset, $value): void + { + $this->scope->offsetSet($offset, $value); + } + + public function offsetUnset($offset): void + { + $this->scope->offsetUnset($offset); + } + + public function context(): ContextInterface + { + return $this->scope->context(); + } + + public function detach(): int + { + $flags = $this->scope->detach(); + assert(class_exists(Fiber::class, false)); + if ($this->scope[Fiber::class] !== Fiber::getCurrent()) { + $flags |= ScopeInterface::INACTIVE; + } + + return $flags; + } +} diff --git a/vendor/open-telemetry/context/ImplicitContextKeyedInterface.php b/vendor/open-telemetry/context/ImplicitContextKeyedInterface.php new file mode 100644 index 000000000..0af93122c --- /dev/null +++ b/vendor/open-telemetry/context/ImplicitContextKeyedInterface.php @@ -0,0 +1,32 @@ +isSupportedCarrier($carrier)) { + $keys = []; + foreach ($carrier as $key => $_) { + $keys[] = (string) $key; + } + + return $keys; + } + + throw new InvalidArgumentException( + sprintf( + 'Unsupported carrier type: %s.', + is_object($carrier) ? get_class($carrier) : gettype($carrier), + ) + ); + } + + /** {@inheritdoc} */ + public function get($carrier, string $key): ?string + { + if ($this->isSupportedCarrier($carrier)) { + $value = $carrier[$this->resolveKey($carrier, $key)] ?? null; + if (is_array($value) && $value) { + $value = $value[array_key_first($value)]; + } + + return is_string($value) + ? $value + : null; + } + + throw new InvalidArgumentException( + sprintf( + 'Unsupported carrier type: %s. Unable to get value associated with key:%s', + is_object($carrier) ? get_class($carrier) : gettype($carrier), + $key + ) + ); + } + + /** {@inheritdoc} */ + public function set(&$carrier, string $key, string $value): void + { + if ($key === '') { + throw new InvalidArgumentException('Unable to set value with an empty key'); + } + if ($this->isSupportedCarrier($carrier)) { + if (($r = $this->resolveKey($carrier, $key)) !== $key) { + unset($carrier[$r]); + } + + $carrier[$key] = $value; + + return; + } + + throw new InvalidArgumentException( + sprintf( + 'Unsupported carrier type: %s. Unable to set value associated with key:%s', + is_object($carrier) ? get_class($carrier) : gettype($carrier), + $key + ) + ); + } + + private function isSupportedCarrier($carrier): bool + { + return is_array($carrier) || $carrier instanceof ArrayAccess && $carrier instanceof Traversable; + } + + private function resolveKey($carrier, string $key): string + { + if (isset($carrier[$key])) { + return $key; + } + + foreach ($carrier as $k => $_) { + $k = (string) $k; + if (strcasecmp($k, $key) === 0) { + return $k; + } + } + + return $key; + } +} diff --git a/vendor/open-telemetry/context/Propagation/MultiTextMapPropagator.php b/vendor/open-telemetry/context/Propagation/MultiTextMapPropagator.php new file mode 100644 index 000000000..075fe98fe --- /dev/null +++ b/vendor/open-telemetry/context/Propagation/MultiTextMapPropagator.php @@ -0,0 +1,83 @@ + + */ + private array $propagators = []; + + /** + * @readonly + * + * @var list + */ + private array $fields; + + /** + * @no-named-arguments + * + * @param list $propagators + */ + public function __construct(array $propagators) + { + $this->propagators = $propagators; + $this->fields = $this->extractFields($propagators); + } + + public function fields(): array + { + return $this->fields; + } + + public function inject(&$carrier, PropagationSetterInterface $setter = null, ContextInterface $context = null): void + { + foreach ($this->propagators as $propagator) { + $propagator->inject($carrier, $setter, $context); + } + } + + public function extract($carrier, PropagationGetterInterface $getter = null, ContextInterface $context = null): ContextInterface + { + $context ??= Context::getCurrent(); + + foreach ($this->propagators as $propagator) { + $context = $propagator->extract($carrier, $getter, $context); + } + + return $context; + } + + /** + * @param list $propagators + * @return list + */ + private function extractFields(array $propagators): array + { + return array_values( + array_unique( + // Phan seems to struggle here with the variadic argument + // @phan-suppress-next-line PhanParamTooFewInternalUnpack + array_merge( + ...array_map( + static fn (TextMapPropagatorInterface $propagator) => $propagator->fields(), + $propagators + ) + ) + ) + ); + } +} diff --git a/vendor/open-telemetry/context/Propagation/NoopTextMapPropagator.php b/vendor/open-telemetry/context/Propagation/NoopTextMapPropagator.php new file mode 100644 index 000000000..c408cfc79 --- /dev/null +++ b/vendor/open-telemetry/context/Propagation/NoopTextMapPropagator.php @@ -0,0 +1,36 @@ + + */ + public function keys($carrier): array; + + /** + * Gets the value of a given key from a carrier. + */ + public function get($carrier, string $key) : ?string; +} diff --git a/vendor/open-telemetry/context/Propagation/PropagationSetterInterface.php b/vendor/open-telemetry/context/Propagation/PropagationSetterInterface.php new file mode 100644 index 000000000..75e205628 --- /dev/null +++ b/vendor/open-telemetry/context/Propagation/PropagationSetterInterface.php @@ -0,0 +1,16 @@ +getter = $getter; + } + + public function keys($carrier): array + { + return $this->getter->keys($carrier); + } + + public function get($carrier, string $key): ?string + { + $value = $this->getter->get($carrier, $key); + if ($value === null) { + return null; + } + + return preg_replace( + [self::SERVER_CONCAT_HEADERS_REGEX, self::TRAILING_LEADING_SEPARATOR_REGEX], + [self::LIST_MEMBERS_SEPARATOR], + $value, + ); + } +} diff --git a/vendor/open-telemetry/context/Propagation/TextMapPropagatorInterface.php b/vendor/open-telemetry/context/Propagation/TextMapPropagatorInterface.php new file mode 100644 index 000000000..fdf2d5141 --- /dev/null +++ b/vendor/open-telemetry/context/Propagation/TextMapPropagatorInterface.php @@ -0,0 +1,40 @@ + + */ + public function fields() : array; + + /** + * Injects specific values from the provided {@see ContextInterface} into the provided carrier + * via an {@see PropagationSetterInterface}. + * + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/context/api-propagators.md#textmap-inject + * + * @param mixed $carrier + */ + public function inject(&$carrier, PropagationSetterInterface $setter = null, ContextInterface $context = null): void; + + /** + * Extracts specific values from the provided carrier into the provided {@see ContextInterface} + * via an {@see PropagationGetterInterface}. + * + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/context/api-propagators.md#textmap-extract + */ + public function extract($carrier, PropagationGetterInterface $getter = null, ContextInterface $context = null): ContextInterface; +} diff --git a/vendor/open-telemetry/context/README.md b/vendor/open-telemetry/context/README.md new file mode 100644 index 000000000..4dfe0e23f --- /dev/null +++ b/vendor/open-telemetry/context/README.md @@ -0,0 +1,63 @@ +[![Releases](https://img.shields.io/badge/releases-purple)](https://github.com/opentelemetry-php/context/releases) +[![Source](https://img.shields.io/badge/source-context-green)](https://github.com/open-telemetry/opentelemetry-php/tree/main/src/Context) +[![Mirror](https://img.shields.io/badge/mirror-opentelemetry--php:context-blue)](https://github.com/opentelemetry-php/context) +[![Latest Version](http://poser.pugx.org/open-telemetry/context/v/unstable)](https://packagist.org/packages/open-telemetry/context/) +[![Stable](http://poser.pugx.org/open-telemetry/context/v/stable)](https://packagist.org/packages/open-telemetry/context/) + +# OpenTelemetry Context + +Immutable execution scoped propagation mechanism, for further details see [opentelemetry-specification][1]. + +## Installation + +```shell +composer require open-telemetry/context +``` + +## Usage + +### Implicit propagation + +```php +$context = Context::getCurrent(); +// modify context +$scope = $context->activate(); +try { + // run within new context +} finally { + $scope->detach(); +} +``` + +It is recommended to use a `try-finally` statement after `::activate()` to ensure that the created scope is properly `::detach()`ed. + +## Async applications + +### Fiber support + +Requires `PHP >= 8.1`, an NTS build, `ext-ffi`, and setting the environment variable `OTEL_PHP_FIBERS_ENABLED` to a truthy value. Additionally `vendor/autoload.php` has to be preloaded for non-CLI SAPIs if [`ffi.enable`](https://www.php.net/manual/en/ffi.configuration.php#ini.ffi.enable) is set to `preload`. + +### Event loops + +Event loops have to restore the original context on callback execution. A basic implementation could look like the following, though implementations should avoid keeping unnecessary references to arguments if possible: + +```php +function bindContext(Closure $closure): Closure { + $context = Context::getCurrent(); + return static function (mixed ...$args) use ($closure, $context): mixed { + $scope = $context->activate(); + try { + return $closure(...$args); + } finally { + $scope->detach(); + } + }; +} +``` + +## Contributing + +This repository is a read-only git subtree split. +To contribute, please see the main [OpenTelemetry PHP monorepo](https://github.com/open-telemetry/opentelemetry-php). + +[1]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/context/README.md#context diff --git a/vendor/open-telemetry/context/ScopeInterface.php b/vendor/open-telemetry/context/ScopeInterface.php new file mode 100644 index 000000000..05319b8fc --- /dev/null +++ b/vendor/open-telemetry/context/ScopeInterface.php @@ -0,0 +1,32 @@ += 8.1, an NTS build, and the FFI extension'); + + return false; + } + + try { + $fibers = FFI::scope('OTEL_ZEND_OBSERVER_FIBER'); + } catch (FFI\Exception $e) { + try { + $fibers = FFI::load(__DIR__ . '/fiber/zend_observer_fiber.h'); + } catch (FFI\Exception $e) { + trigger_error(sprintf('Context: Fiber context switching not supported, %s', $e->getMessage())); + + return false; + } + } + + $fibers->zend_observer_fiber_init_register(static fn (int $initializing) => Context::storage()->fork($initializing)); //@phpstan-ignore-line + $fibers->zend_observer_fiber_switch_register(static fn (int $from, int $to) => Context::storage()->switch($to)); //@phpstan-ignore-line + $fibers->zend_observer_fiber_destroy_register(static fn (int $destroying) => Context::storage()->destroy($destroying)); //@phpstan-ignore-line + + return true; + } +} diff --git a/vendor/open-telemetry/context/composer.json b/vendor/open-telemetry/context/composer.json new file mode 100644 index 000000000..348b57f73 --- /dev/null +++ b/vendor/open-telemetry/context/composer.json @@ -0,0 +1,41 @@ +{ + "name": "open-telemetry/context", + "description": "Context implementation for OpenTelemetry PHP.", + "keywords": ["opentelemetry", "otel", "context"], + "type": "library", + "support": { + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php", + "docs": "https://opentelemetry.io/docs/php", + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V" + }, + "license": "Apache-2.0", + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "require": { + "php": "^7.4 || ^8.0", + "symfony/polyfill-php80": "^1.26", + "symfony/polyfill-php81": "^1.26", + "symfony/polyfill-php82": "^1.26" + }, + "autoload": { + "psr-4": { + "OpenTelemetry\\Context\\": "." + }, + "files": [ + "fiber/initialize_fiber_handler.php" + ] + }, + "suggest": { + "ext-ffi": "To allow context switching in Fibers" + }, + "extra": { + "branch-alias": { + "dev-main": "1.0.x-dev" + } + } +} diff --git a/vendor/open-telemetry/context/fiber/initialize_fiber_handler.php b/vendor/open-telemetry/context/fiber/initialize_fiber_handler.php new file mode 100644 index 000000000..b9c706395 --- /dev/null +++ b/vendor/open-telemetry/context/fiber/initialize_fiber_handler.php @@ -0,0 +1,20 @@ +getValues()[] = self::convertAnyValue($element); + } + $result->setArrayValue($values); + } else { + $values = new KeyValueList(); + foreach ($value as $key => $element) { + /** @psalm-suppress InvalidArgument */ + $values->getValues()[] = new KeyValue(['key' => $key, 'value' => self::convertAnyValue($element)]); + } + $result->setKvlistValue($values); + } + } + if (is_int($value)) { + $result->setIntValue($value); + } + if (is_bool($value)) { + $result->setBoolValue($value); + } + if (is_float($value)) { + $result->setDoubleValue($value); + } + if (is_string($value)) { + $result->setStringValue($value); + } + + return $result; + } + + /** + * Test whether an array is simple (non-KeyValue) + */ + public static function isSimpleArray(array $value): bool + { + return $value === [] || array_key_first($value) === 0; + } +} diff --git a/vendor/open-telemetry/exporter-otlp/ContentTypes.php b/vendor/open-telemetry/exporter-otlp/ContentTypes.php new file mode 100644 index 000000000..8ac70d54a --- /dev/null +++ b/vendor/open-telemetry/exporter-otlp/ContentTypes.php @@ -0,0 +1,12 @@ +httpFactoryResolver = $httpFactoryResolver ?? MessageFactoryResolver::create(); + } + + public static function create(?FactoryResolverInterface $httpFactoryResolver = null): self + { + return new self($httpFactoryResolver); + } + + public function resolve(string $endpoint, string $signal): UriInterface + { + $components = self::parseEndpoint($endpoint); + + return self::addPort( + self::addUserInfo( + $this->createDefaultUri($components, $signal), + $components + ), + $components + ); + } + + public function resolveToString(string $endpoint, string $signal): string + { + return (string) $this->resolve($endpoint, $signal); + } + + private function createUri(): UriInterface + { + return $this->httpFactoryResolver->resolveUriFactory() + ->createUri(); + } + + private function createDefaultUri(array $components, string $signal): UriInterface + { + if (isset($components[self::SCHEME_ATTRIBUTE])) { + self::validateScheme($components[self::SCHEME_ATTRIBUTE]); + } + + return $this->createUri() + ->withScheme($components[self::SCHEME_ATTRIBUTE] ?? self::DEFAULT_SCHEME) + ->withPath(self::resolvePath($components[self::PATH_ATTRIBUTE] ?? self::ROOT_PATH, $signal)) + ->withHost($components[self::HOST_ATTRIBUTE]); + } + + private static function validateScheme(string $protocol): void + { + if (!in_array($protocol, HttpEndpointResolverInterface::VALID_SCHEMES, true)) { + throw new InvalidArgumentException(sprintf( + 'Expected protocol to be http or https, given: "%s"', + $protocol + )); + } + } + + private static function validateSignal(string $signal): void + { + if (!in_array($signal, Signals::SIGNALS)) { + throw new InvalidArgumentException(sprintf( + 'Signal must be one of "%s". Given "%s"', + implode(', ', Signals::SIGNALS), + $signal + )); + } + } + + private static function parseEndpoint(string $endpoint): array + { + $result = parse_url($endpoint); + + if (!is_array($result) || !isset($result[self::HOST_ATTRIBUTE])) { + throw new InvalidArgumentException(sprintf( + 'Failed to parse endpoint "%s"', + $endpoint + )); + } + + return $result; + } + + private static function addUserInfo(UriInterface $uri, array $components): UriInterface + { + if (isset($components[self::USER_ATTRIBUTE])) { + $uri = $uri->withUserInfo( + $components[self::USER_ATTRIBUTE], + $components[self::PASS_ATTRIBUTE] ?? null + ); + } + + return $uri; + } + + private static function addPort(UriInterface $uri, array $components): UriInterface + { + if (isset($components[self::PORT_ATTRIBUTE])) { + $uri = $uri->withPort( + $components[self::PORT_ATTRIBUTE] + ); + } + + return $uri; + } + + private static function resolvePath(string $path, string $signal): string + { + self::validateSignal($signal); + + return str_replace('//', '/', sprintf('%s/%s', $path, self::getDefaultPath($signal))); + } + + private static function getDefaultPath(string $signal): string + { + return HttpEndpointResolverInterface::DEFAULT_PATHS[$signal]; + } +} diff --git a/vendor/open-telemetry/exporter-otlp/HttpEndpointResolverInterface.php b/vendor/open-telemetry/exporter-otlp/HttpEndpointResolverInterface.php new file mode 100644 index 000000000..fe165bd8a --- /dev/null +++ b/vendor/open-telemetry/exporter-otlp/HttpEndpointResolverInterface.php @@ -0,0 +1,28 @@ + self::TRACE_DEFAULT_PATH, + Signals::METRICS => self::METRICS_DEFAULT_PATH, + Signals::LOGS => self::LOGS_DEFAULT_PATH, + ]; + public const VALID_SCHEMES = [ + 'http', + 'https', + ]; + + public function resolve(string $endpoint, string $signal): UriInterface; + + public function resolveToString(string $endpoint, string $signal): string; +} diff --git a/vendor/open-telemetry/exporter-otlp/LogsConverter.php b/vendor/open-telemetry/exporter-otlp/LogsConverter.php new file mode 100644 index 000000000..1da53ad1f --- /dev/null +++ b/vendor/open-telemetry/exporter-otlp/LogsConverter.php @@ -0,0 +1,142 @@ +serializer = $serializer ?? ProtobufSerializer::getDefault(); + } + + /** + * @param iterable $logs + * @psalm-suppress InvalidArgument + */ + public function convert(iterable $logs): ExportLogsServiceRequest + { + $pExportLogsServiceRequest = new ExportLogsServiceRequest(); + $scopeLogs = []; + $resourceLogs = []; + $resourceCache = []; + $scopeCache = []; + + foreach ($logs as $log) { + $resource = $log->getResource(); + $instrumentationScope = $log->getInstrumentationScope(); + + $resourceId = $resourceCache[spl_object_id($resource)] ??= serialize([ + $resource->getSchemaUrl(), + $resource->getAttributes()->toArray(), + $resource->getAttributes()->getDroppedAttributesCount(), + ]); + $instrumentationScopeId = $scopeCache[spl_object_id($instrumentationScope)] ??= serialize([ + $instrumentationScope->getName(), + $instrumentationScope->getVersion(), + $instrumentationScope->getSchemaUrl(), + $instrumentationScope->getAttributes()->toArray(), + $instrumentationScope->getAttributes()->getDroppedAttributesCount(), + ]); + + if (($pResourceLogs = $resourceLogs[$resourceId] ?? null) === null) { + /** @psalm-suppress InvalidArgument */ + $pExportLogsServiceRequest->getResourceLogs()[] + = $resourceLogs[$resourceId] + = $pResourceLogs + = $this->convertResourceLogs($resource); + } + + if (($pScopeLogs = $scopeLogs[$resourceId][$instrumentationScopeId] ?? null) === null) { + $pResourceLogs->getScopeLogs()[] + = $scopeLogs[$resourceId][$instrumentationScopeId] + = $pScopeLogs + = $this->convertInstrumentationScope($instrumentationScope); + } + + $pScopeLogs->getLogRecords()[] = $this->convertLogRecord($log); + } + + return $pExportLogsServiceRequest; + } + + private function convertLogRecord(ReadableLogRecord $record): LogRecord + { + $pLogRecord = new LogRecord(); + $pLogRecord->setBody(AttributesConverter::convertAnyValue($record->getBody())); + $pLogRecord->setTimeUnixNano($record->getTimestamp() ?? 0); + $pLogRecord->setObservedTimeUnixNano($record->getObservedTimestamp() ?? 0); + $spanContext = $record->getSpanContext(); + if ($spanContext !== null && $spanContext->isValid()) { + $pLogRecord->setTraceId($this->serializer->serializeTraceId($spanContext->getTraceIdBinary())); + $pLogRecord->setSpanId($this->serializer->serializeSpanId($spanContext->getSpanIdBinary())); + $pLogRecord->setFlags($spanContext->getTraceFlags()); + } + $severityNumber = $record->getSeverityNumber(); + if ($severityNumber !== null) { + $pLogRecord->setSeverityNumber($severityNumber); + } + $severityText = $record->getSeverityText(); + if ($severityText !== null) { + $pLogRecord->setSeverityText($severityText); + } + $this->setAttributes($pLogRecord, $record->getAttributes()); + $pLogRecord->setDroppedAttributesCount($record->getAttributes()->getDroppedAttributesCount()); + + return $pLogRecord; + } + + private function convertInstrumentationScope(InstrumentationScopeInterface $instrumentationScope): ScopeLogs + { + $pScopeLogs = new ScopeLogs(); + $pInstrumentationScope = new InstrumentationScope(); + $pInstrumentationScope->setName($instrumentationScope->getName()); + $pInstrumentationScope->setVersion((string) $instrumentationScope->getVersion()); + $this->setAttributes($pInstrumentationScope, $instrumentationScope->getAttributes()); + $pInstrumentationScope->setDroppedAttributesCount($instrumentationScope->getAttributes()->getDroppedAttributesCount()); + $pScopeLogs->setScope($pInstrumentationScope); + $pScopeLogs->setSchemaUrl((string) $instrumentationScope->getSchemaUrl()); + + return $pScopeLogs; + } + + private function convertResourceLogs(ResourceInfo $resource): ResourceLogs + { + $pResourceLogs = new ResourceLogs(); + $pResource = new Resource_(); + $this->setAttributes($pResource, $resource->getAttributes()); + $pResource->setDroppedAttributesCount($resource->getAttributes()->getDroppedAttributesCount()); + $pResourceLogs->setResource($pResource); + + return $pResourceLogs; + } + + /** + * @param Resource_|LogRecord|InstrumentationScope $pElement + */ + private function setAttributes($pElement, AttributesInterface $attributes): void + { + foreach ($attributes as $key => $value) { + /** @psalm-suppress InvalidArgument */ + $pElement->getAttributes()[] = (new KeyValue()) + ->setKey($key) + ->setValue(AttributesConverter::convertAnyValue($value)); + } + $pElement->setDroppedAttributesCount($attributes->getDroppedAttributesCount()); + } +} diff --git a/vendor/open-telemetry/exporter-otlp/LogsExporter.php b/vendor/open-telemetry/exporter-otlp/LogsExporter.php new file mode 100644 index 000000000..fb100391f --- /dev/null +++ b/vendor/open-telemetry/exporter-otlp/LogsExporter.php @@ -0,0 +1,85 @@ + $transport + */ + public function __construct(TransportInterface $transport) + { + if (!class_exists('\Google\Protobuf\Api')) { + throw new RuntimeException('No protobuf implementation found (ext-protobuf or google/protobuf)'); + } + $this->transport = $transport; + $this->serializer = ProtobufSerializer::forTransport($transport); + } + + /** + * @param iterable $batch + */ + public function export(iterable $batch, ?CancellationInterface $cancellation = null): FutureInterface + { + return $this->transport + ->send($this->serializer->serialize((new LogsConverter($this->serializer))->convert($batch)), $cancellation) + ->map(function (?string $payload): bool { + if ($payload === null) { + return true; + } + + $serviceResponse = new ExportLogsServiceResponse(); + $this->serializer->hydrate($serviceResponse, $payload); + + $partialSuccess = $serviceResponse->getPartialSuccess(); + if ($partialSuccess !== null && $partialSuccess->getRejectedLogRecords()) { + self::logError('Export partial success', [ + 'rejected_logs' => $partialSuccess->getRejectedLogRecords(), + 'error_message' => $partialSuccess->getErrorMessage(), + ]); + + return false; + } + if ($partialSuccess !== null && $partialSuccess->getErrorMessage()) { + self::logWarning('Export success with warnings/suggestions', ['error_message' => $partialSuccess->getErrorMessage()]); + } + + return true; + }) + ->catch(static function (Throwable $throwable): bool { + self::logError('Export failure', ['exception' => $throwable]); + + return false; + }); + } + + public function forceFlush(?CancellationInterface $cancellation = null): bool + { + return $this->transport->forceFlush($cancellation); + } + + public function shutdown(?CancellationInterface $cancellation = null): bool + { + return $this->transport->shutdown($cancellation); + } +} diff --git a/vendor/open-telemetry/exporter-otlp/LogsExporterFactory.php b/vendor/open-telemetry/exporter-otlp/LogsExporterFactory.php new file mode 100644 index 000000000..17fd68887 --- /dev/null +++ b/vendor/open-telemetry/exporter-otlp/LogsExporterFactory.php @@ -0,0 +1,85 @@ +transportFactory = $transportFactory; + } + + /** + * @psalm-suppress ArgumentTypeCoercion + */ + public function create(): LogRecordExporterInterface + { + $protocol = Configuration::has(Variables::OTEL_EXPORTER_OTLP_LOGS_PROTOCOL) + ? Configuration::getEnum(Variables::OTEL_EXPORTER_OTLP_LOGS_PROTOCOL) + : Configuration::getEnum(Variables::OTEL_EXPORTER_OTLP_PROTOCOL); + + return new LogsExporter($this->buildTransport($protocol)); + } + + /** + * @psalm-suppress UndefinedClass + */ + private function buildTransport(string $protocol): TransportInterface + { + $endpoint = $this->getEndpoint($protocol); + + $headers = Configuration::has(Variables::OTEL_EXPORTER_OTLP_LOGS_HEADERS) + ? Configuration::getMap(Variables::OTEL_EXPORTER_OTLP_LOGS_HEADERS) + : Configuration::getMap(Variables::OTEL_EXPORTER_OTLP_HEADERS); + $headers += OtlpUtil::getUserAgentHeader(); + $compression = $this->getCompression(); + + $factoryClass = Registry::transportFactory($protocol); + $factory = $this->transportFactory ?: new $factoryClass(); + + return $factory->create( + $endpoint, + Protocols::contentType($protocol), + $headers, + $compression, + ); + } + + private function getCompression(): string + { + return Configuration::has(Variables::OTEL_EXPORTER_OTLP_LOGS_COMPRESSION) ? + Configuration::getEnum(Variables::OTEL_EXPORTER_OTLP_LOGS_COMPRESSION) : + Configuration::getEnum(Variables::OTEL_EXPORTER_OTLP_COMPRESSION, self::DEFAULT_COMPRESSION); + } + + private function getEndpoint(string $protocol): string + { + if (Configuration::has(Variables::OTEL_EXPORTER_OTLP_LOGS_ENDPOINT)) { + return Configuration::getString(Variables::OTEL_EXPORTER_OTLP_LOGS_ENDPOINT); + } + $endpoint = Configuration::has(Variables::OTEL_EXPORTER_OTLP_ENDPOINT) + ? Configuration::getString(Variables::OTEL_EXPORTER_OTLP_ENDPOINT) + : Defaults::OTEL_EXPORTER_OTLP_ENDPOINT; + if ($protocol === Protocols::GRPC) { + return $endpoint . OtlpUtil::method(Signals::LOGS); + } + + return HttpEndpointResolver::create()->resolveToString($endpoint, Signals::LOGS); + } +} diff --git a/vendor/open-telemetry/exporter-otlp/MetricConverter.php b/vendor/open-telemetry/exporter-otlp/MetricConverter.php new file mode 100644 index 000000000..584c41365 --- /dev/null +++ b/vendor/open-telemetry/exporter-otlp/MetricConverter.php @@ -0,0 +1,265 @@ +serializer = $serializer ?? ProtobufSerializer::getDefault(); + } + + /** + * @param iterable $batch + */ + public function convert(iterable $batch): ExportMetricsServiceRequest + { + $pExportMetricsServiceRequest = new ExportMetricsServiceRequest(); + + $resourceMetrics = []; + $resourceCache = []; + $scopeMetrics = []; + $scopeCache = []; + foreach ($batch as $metric) { + $resource = $metric->resource; + $instrumentationScope = $metric->instrumentationScope; + + $resourceId = $resourceCache[spl_object_id($resource)] ??= serialize([ + $resource->getSchemaUrl(), + $resource->getAttributes()->toArray(), + $resource->getAttributes()->getDroppedAttributesCount(), + ]); + $instrumentationScopeId = $scopeCache[spl_object_id($instrumentationScope)] ??= serialize([ + $instrumentationScope->getName(), + $instrumentationScope->getVersion(), + $instrumentationScope->getSchemaUrl(), + $instrumentationScope->getAttributes()->toArray(), + $instrumentationScope->getAttributes()->getDroppedAttributesCount(), + ]); + + if (($pResourceMetrics = $resourceMetrics[$resourceId] ?? null) === null) { + /** @psalm-suppress InvalidArgument */ + $pExportMetricsServiceRequest->getResourceMetrics()[] + = $resourceMetrics[$resourceId] + = $pResourceMetrics + = $this->convertResourceMetrics($resource); + } + + if (($pScopeMetrics = $scopeMetrics[$resourceId][$instrumentationScopeId] ?? null) === null) { + /** @psalm-suppress InvalidArgument */ + $pResourceMetrics->getScopeMetrics()[] + = $scopeMetrics[$resourceId][$instrumentationScopeId] + = $pScopeMetrics + = $this->convertScopeMetrics($instrumentationScope); + } + + /** @psalm-suppress InvalidArgument */ + $pScopeMetrics->getMetrics()[] = $this->convertMetric($metric); + } + + return $pExportMetricsServiceRequest; + } + + private function convertResourceMetrics(SDK\Resource\ResourceInfo $resource): ResourceMetrics + { + $pResourceMetrics = new ResourceMetrics(); + $pResource = new Resource_(); + $this->setAttributes($pResource, $resource->getAttributes()); + $pResourceMetrics->setResource($pResource); + $pResourceMetrics->setSchemaUrl((string) $resource->getSchemaUrl()); + + return $pResourceMetrics; + } + + private function convertScopeMetrics(SDK\Common\Instrumentation\InstrumentationScopeInterface $instrumentationScope): ScopeMetrics + { + $pScopeMetrics = new ScopeMetrics(); + $pInstrumentationScope = new InstrumentationScope(); + $pInstrumentationScope->setName($instrumentationScope->getName()); + $pInstrumentationScope->setVersion((string) $instrumentationScope->getVersion()); + $this->setAttributes($pInstrumentationScope, $instrumentationScope->getAttributes()); + $pScopeMetrics->setScope($pInstrumentationScope); + $pScopeMetrics->setSchemaUrl((string) $instrumentationScope->getSchemaUrl()); + + return $pScopeMetrics; + } + + private function convertMetric(SDK\Metrics\Data\Metric $metric): Metric + { + $pMetric = new Metric(); + $pMetric->setName($metric->name); + $pMetric->setDescription((string) $metric->description); + $pMetric->setUnit((string) $metric->unit); + + $data = $metric->data; + if ($data instanceof SDK\Metrics\Data\Gauge) { + $pMetric->setGauge($this->convertGauge($data)); + } + if ($data instanceof SDK\Metrics\Data\Histogram) { + $pMetric->setHistogram($this->convertHistogram($data)); + } + if ($data instanceof SDK\Metrics\Data\Sum) { + $pMetric->setSum($this->convertSum($data)); + } + + return $pMetric; + } + + private function convertTemporality($temporality): int + { + switch ($temporality) { + case SDK\Metrics\Data\Temporality::DELTA: + return AggregationTemporality::AGGREGATION_TEMPORALITY_DELTA; + case SDK\Metrics\Data\Temporality::CUMULATIVE: + return AggregationTemporality::AGGREGATION_TEMPORALITY_CUMULATIVE; + } + + // @codeCoverageIgnoreStart + return AggregationTemporality::AGGREGATION_TEMPORALITY_UNSPECIFIED; + // @codeCoverageIgnoreEnd + } + + private function convertGauge(SDK\Metrics\Data\Gauge $gauge): Gauge + { + $pGauge = new Gauge(); + foreach ($gauge->dataPoints as $dataPoint) { + /** @psalm-suppress InvalidArgument */ + $pGauge->getDataPoints()[] = $this->convertNumberDataPoint($dataPoint); + } + + return $pGauge; + } + + private function convertHistogram(SDK\Metrics\Data\Histogram $histogram): Histogram + { + $pHistogram = new Histogram(); + foreach ($histogram->dataPoints as $dataPoint) { + /** @psalm-suppress InvalidArgument */ + $pHistogram->getDataPoints()[] = $this->convertHistogramDataPoint($dataPoint); + } + $pHistogram->setAggregationTemporality($this->convertTemporality($histogram->temporality)); + + return $pHistogram; + } + + private function convertSum(SDK\Metrics\Data\Sum $sum): Sum + { + $pSum = new Sum(); + foreach ($sum->dataPoints as $dataPoint) { + /** @psalm-suppress InvalidArgument */ + $pSum->getDataPoints()[] = $this->convertNumberDataPoint($dataPoint); + } + $pSum->setAggregationTemporality($this->convertTemporality($sum->temporality)); + $pSum->setIsMonotonic($sum->monotonic); + + return $pSum; + } + + private function convertNumberDataPoint(SDK\Metrics\Data\NumberDataPoint $dataPoint): NumberDataPoint + { + $pNumberDataPoint = new NumberDataPoint(); + $this->setAttributes($pNumberDataPoint, $dataPoint->attributes); + $pNumberDataPoint->setStartTimeUnixNano($dataPoint->startTimestamp); + $pNumberDataPoint->setTimeUnixNano($dataPoint->timestamp); + if (is_int($dataPoint->value)) { + $pNumberDataPoint->setAsInt($dataPoint->value); + } + if (is_float($dataPoint->value)) { + $pNumberDataPoint->setAsDouble($dataPoint->value); + } + foreach ($dataPoint->exemplars as $exemplar) { + /** @psalm-suppress InvalidArgument */ + $pNumberDataPoint->getExemplars()[] = $this->convertExemplar($exemplar); + } + + return $pNumberDataPoint; + } + + private function convertHistogramDataPoint(SDK\Metrics\Data\HistogramDataPoint $dataPoint): HistogramDataPoint + { + $pHistogramDataPoint = new HistogramDataPoint(); + $this->setAttributes($pHistogramDataPoint, $dataPoint->attributes); + $pHistogramDataPoint->setStartTimeUnixNano($dataPoint->startTimestamp); + $pHistogramDataPoint->setTimeUnixNano($dataPoint->timestamp); + $pHistogramDataPoint->setCount($dataPoint->count); + $pHistogramDataPoint->setSum($dataPoint->sum); + /** @phpstan-ignore-next-line */ + $pHistogramDataPoint->setBucketCounts($dataPoint->bucketCounts); + /** @phpstan-ignore-next-line */ + $pHistogramDataPoint->setExplicitBounds($dataPoint->explicitBounds); + foreach ($dataPoint->exemplars as $exemplar) { + /** @psalm-suppress InvalidArgument */ + $pHistogramDataPoint->getExemplars()[] = $this->convertExemplar($exemplar); + } + + return $pHistogramDataPoint; + } + + private function convertExemplar(SDK\Metrics\Data\Exemplar $exemplar): Exemplar + { + $pExemplar = new Exemplar(); + $this->setFilteredAttributes($pExemplar, $exemplar->attributes); + $pExemplar->setTimeUnixNano($exemplar->timestamp); + $pExemplar->setSpanId($this->serializer->serializeSpanId(hex2bin((string) $exemplar->spanId))); + $pExemplar->setTraceId($this->serializer->serializeTraceId(hex2bin((string) $exemplar->traceId))); + if (is_int($exemplar->value)) { + $pExemplar->setAsInt($exemplar->value); + } + if (is_float($exemplar->value)) { + $pExemplar->setAsDouble($exemplar->value); + } + + return $pExemplar; + } + + /** + * @param Resource_|NumberDataPoint|HistogramDataPoint|InstrumentationScope $pElement + */ + private function setAttributes($pElement, SDK\Common\Attribute\AttributesInterface $attributes): void + { + foreach ($attributes as $key => $value) { + /** @psalm-suppress InvalidArgument */ + $pElement->getAttributes()[] = $pAttribute = new KeyValue(); + $pAttribute->setKey($key); + $pAttribute->setValue(AttributesConverter::convertAnyValue($value)); + } + if (method_exists($pElement, 'setDroppedAttributesCount')) { + $pElement->setDroppedAttributesCount($attributes->getDroppedAttributesCount()); + } + } + + private function setFilteredAttributes(Exemplar $pElement, SDK\Common\Attribute\AttributesInterface $attributes): void + { + foreach ($attributes as $key => $value) { + /** @psalm-suppress InvalidArgument */ + $pElement->getFilteredAttributes()[] = $pAttribute = new KeyValue(); + $pAttribute->setKey($key); + $pAttribute->setValue(AttributesConverter::convertAnyValue($value)); + } + } +} diff --git a/vendor/open-telemetry/exporter-otlp/MetricExporter.php b/vendor/open-telemetry/exporter-otlp/MetricExporter.php new file mode 100644 index 000000000..efd149c7f --- /dev/null +++ b/vendor/open-telemetry/exporter-otlp/MetricExporter.php @@ -0,0 +1,97 @@ + $transport + */ + public function __construct(TransportInterface $transport, $temporality = null) + { + if (!class_exists('\Google\Protobuf\Api')) { + throw new RuntimeException('No protobuf implementation found (ext-protobuf or google/protobuf)'); + } + $this->transport = $transport; + $this->serializer = ProtobufSerializer::forTransport($transport); + $this->temporality = $temporality; + } + + public function temporality(MetricMetadataInterface $metric) + { + return $this->temporality ?? $metric->temporality(); + } + + public function export(iterable $batch): bool + { + return $this->transport + ->send($this->serializer->serialize((new MetricConverter($this->serializer))->convert($batch))) + ->map(function (?string $payload): bool { + if ($payload === null) { + return true; + } + + $serviceResponse = new ExportMetricsServiceResponse(); + $this->serializer->hydrate($serviceResponse, $payload); + + $partialSuccess = $serviceResponse->getPartialSuccess(); + if ($partialSuccess !== null && $partialSuccess->getRejectedDataPoints()) { + self::logError('Export partial success', [ + 'rejected_data_points' => $partialSuccess->getRejectedDataPoints(), + 'error_message' => $partialSuccess->getErrorMessage(), + ]); + + return false; + } + if ($partialSuccess !== null && $partialSuccess->getErrorMessage()) { + self::logWarning('Export success with warnings/suggestions', ['error_message' => $partialSuccess->getErrorMessage()]); + } + + return true; + }) + ->catch(static function (Throwable $throwable): bool { + self::logError('Export failure', ['exception' => $throwable]); + + return false; + }) + ->await(); + } + + public function shutdown(): bool + { + return $this->transport->shutdown(); + } + + public function forceFlush(): bool + { + return $this->transport->forceFlush(); + } +} diff --git a/vendor/open-telemetry/exporter-otlp/MetricExporterFactory.php b/vendor/open-telemetry/exporter-otlp/MetricExporterFactory.php new file mode 100644 index 000000000..284428b73 --- /dev/null +++ b/vendor/open-telemetry/exporter-otlp/MetricExporterFactory.php @@ -0,0 +1,110 @@ +transportFactory = $transportFactory; + } + + /** + * @psalm-suppress ArgumentTypeCoercion + */ + public function create(): MetricExporterInterface + { + $protocol = Configuration::has(Variables::OTEL_EXPORTER_OTLP_METRICS_PROTOCOL) + ? Configuration::getEnum(Variables::OTEL_EXPORTER_OTLP_METRICS_PROTOCOL) + : Configuration::getEnum(Variables::OTEL_EXPORTER_OTLP_PROTOCOL); + $temporality = $this->getTemporality(); + + return new MetricExporter($this->buildTransport($protocol), $temporality); + } + + /** + * @psalm-suppress UndefinedClass + */ + private function buildTransport(string $protocol): TransportInterface + { + /** + * @todo (https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#periodic-exporting-metricreader) + * - OTEL_METRIC_EXPORT_INTERVAL + * - OTEL_METRIC_EXPORT_TIMEOUT + */ + $endpoint = $this->getEndpoint($protocol); + + $headers = Configuration::has(Variables::OTEL_EXPORTER_OTLP_METRICS_HEADERS) + ? Configuration::getMap(Variables::OTEL_EXPORTER_OTLP_METRICS_HEADERS) + : Configuration::getMap(Variables::OTEL_EXPORTER_OTLP_HEADERS); + $headers += OtlpUtil::getUserAgentHeader(); + $compression = $this->getCompression(); + + $factoryClass = Registry::transportFactory($protocol); + $factory = $this->transportFactory ?: new $factoryClass(); + + return $factory->create( + $endpoint, + Protocols::contentType($protocol), + $headers, + $compression, + ); + } + + /** + * @todo return string|Temporality|null (php >= 8.0) + */ + private function getTemporality() + { + $value = Configuration::getEnum(Variables::OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE); + switch (strtolower($value)) { + case 'cumulative': + return Temporality::CUMULATIVE; + case 'delta': + return Temporality::DELTA; + case 'lowmemory': + return null; + default: + throw new \UnexpectedValueException('Unknown temporality: ' . $value); + } + } + + private function getCompression(): string + { + return Configuration::has(Variables::OTEL_EXPORTER_OTLP_METRICS_COMPRESSION) ? + Configuration::getEnum(Variables::OTEL_EXPORTER_OTLP_METRICS_COMPRESSION) : + Configuration::getEnum(Variables::OTEL_EXPORTER_OTLP_COMPRESSION, self::DEFAULT_COMPRESSION); + } + + private function getEndpoint(string $protocol): string + { + if (Configuration::has(Variables::OTEL_EXPORTER_OTLP_METRICS_ENDPOINT)) { + return Configuration::getString(Variables::OTEL_EXPORTER_OTLP_METRICS_ENDPOINT); + } + $endpoint = Configuration::has(Variables::OTEL_EXPORTER_OTLP_ENDPOINT) + ? Configuration::getString(Variables::OTEL_EXPORTER_OTLP_ENDPOINT) + : Defaults::OTEL_EXPORTER_OTLP_ENDPOINT; + if ($protocol === Protocols::GRPC) { + return $endpoint . OtlpUtil::method(Signals::METRICS); + } + + return HttpEndpointResolver::create()->resolveToString($endpoint, Signals::METRICS); + } +} diff --git a/vendor/open-telemetry/exporter-otlp/OtlpHttpTransportFactory.php b/vendor/open-telemetry/exporter-otlp/OtlpHttpTransportFactory.php new file mode 100644 index 000000000..5cf3ff9e4 --- /dev/null +++ b/vendor/open-telemetry/exporter-otlp/OtlpHttpTransportFactory.php @@ -0,0 +1,33 @@ +create($endpoint, $contentType, $headers, $compression, $timeout, $retryDelay, $maxRetries, $cacert, $cert, $key); + } +} diff --git a/vendor/open-telemetry/exporter-otlp/OtlpUtil.php b/vendor/open-telemetry/exporter-otlp/OtlpUtil.php new file mode 100644 index 000000000..6901c1324 --- /dev/null +++ b/vendor/open-telemetry/exporter-otlp/OtlpUtil.php @@ -0,0 +1,45 @@ + '/opentelemetry.proto.collector.trace.v1.TraceService/Export', + Signals::METRICS => '/opentelemetry.proto.collector.metrics.v1.MetricsService/Export', + Signals::LOGS => '/opentelemetry.proto.collector.logs.v1.LogsService/Export', + ]; + + public static function method(string $signal): string + { + if (!array_key_exists($signal, self::METHODS)) { + throw new UnexpectedValueException('gRPC method not defined for signal: ' . $signal); + } + + return self::METHODS[$signal]; + } + + /** + * @link https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#user-agent + */ + public static function getUserAgentHeader(): array + { + $resource = (new Sdk())->getResource(); + + return ['User-Agent' => sprintf( + 'OTel OTLP Exporter PHP/%s', + $resource->getAttributes()->get(ResourceAttributes::TELEMETRY_SDK_VERSION) ?: 'unknown' + )]; + } +} diff --git a/vendor/open-telemetry/exporter-otlp/ProtobufSerializer.php b/vendor/open-telemetry/exporter-otlp/ProtobufSerializer.php new file mode 100644 index 000000000..c244d0066 --- /dev/null +++ b/vendor/open-telemetry/exporter-otlp/ProtobufSerializer.php @@ -0,0 +1,115 @@ +contentType = $contentType; + } + + public static function getDefault(): ProtobufSerializer + { + return new self(self::PROTOBUF); + } + + /** + * @psalm-param TransportInterface $transport + */ + public static function forTransport(TransportInterface $transport): ProtobufSerializer + { + switch ($contentType = $transport->contentType()) { + case self::PROTOBUF: + case self::JSON: + case self::NDJSON: + return new self($contentType); + default: + throw new InvalidArgumentException(sprintf('Not supported content type "%s"', $contentType)); + } + } + + public function serializeTraceId(string $traceId): string + { + switch ($this->contentType) { + case self::PROTOBUF: + return $traceId; + case self::JSON: + case self::NDJSON: + return base64_decode(bin2hex($traceId)); + default: + throw new AssertionError(); + } + } + + public function serializeSpanId(string $spanId): string + { + switch ($this->contentType) { + case self::PROTOBUF: + return $spanId; + case self::JSON: + case self::NDJSON: + return base64_decode(bin2hex($spanId)); + default: + throw new AssertionError(); + } + } + + public function serialize(Message $message): string + { + switch ($this->contentType) { + case self::PROTOBUF: + return $message->serializeToString(); + case self::JSON: + //@todo https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/otlp.md#json-protobuf-encoding + return $message->serializeToJsonString(); + case self::NDJSON: + return $message->serializeToJsonString() . "\n"; + default: + throw new AssertionError(); + } + } + + /** + * @throws Exception + */ + public function hydrate(Message $message, string $payload): void + { + switch ($this->contentType) { + case self::PROTOBUF: + $message->mergeFromString($payload); + + break; + case self::JSON: + case self::NDJSON: + // @phan-suppress-next-line PhanParamTooManyInternal + $message->mergeFromJsonString($payload, true); + + break; + default: + throw new AssertionError(); + } + } +} diff --git a/vendor/open-telemetry/exporter-otlp/Protocols.php b/vendor/open-telemetry/exporter-otlp/Protocols.php new file mode 100644 index 000000000..96b04d8bf --- /dev/null +++ b/vendor/open-telemetry/exporter-otlp/Protocols.php @@ -0,0 +1,36 @@ + ContentTypes::PROTOBUF, + self::HTTP_PROTOBUF => ContentTypes::PROTOBUF, + self::HTTP_JSON => ContentTypes::JSON, + self::HTTP_NDJSON => ContentTypes::NDJSON, + ]; + + public static function validate(string $protocol): void + { + if (!array_key_exists($protocol, self::PROTOCOLS)) { + throw new UnexpectedValueException('Unknown protocol: ' . $protocol); + } + } + + public static function contentType(string $protocol): string + { + self::validate($protocol); + + return self::PROTOCOLS[$protocol]; + } +} diff --git a/vendor/open-telemetry/exporter-otlp/README.md b/vendor/open-telemetry/exporter-otlp/README.md new file mode 100644 index 000000000..a41349da0 --- /dev/null +++ b/vendor/open-telemetry/exporter-otlp/README.md @@ -0,0 +1,45 @@ +[![Releases](https://img.shields.io/badge/releases-purple)](https://github.com/opentelemetry-php/exporter-otlp/releases) +[![Source](https://img.shields.io/badge/source-exporter--otlp-green)](https://github.com/open-telemetry/opentelemetry-php/tree/main/src/Contrib/Otlp) +[![Mirror](https://img.shields.io/badge/mirror-opentelemetry--php:exporter--otlp-blue)](https://github.com/opentelemetry-php/exporter-otlp) +[![Latest Version](http://poser.pugx.org/open-telemetry/exporter-otlp/v/unstable)](https://packagist.org/packages/open-telemetry/exporter-otlp/) +[![Stable](http://poser.pugx.org/open-telemetry/exporter-otlp/v/stable)](https://packagist.org/packages/open-telemetry/exporter-otlp/) + +# OpenTelemetry OTLP exporter + +## Documentation + +https://opentelemetry.io/docs/instrumentation/php/exporters/#otlp + +## Usage + +See https://github.com/open-telemetry/opentelemetry-php/blob/main/examples/traces/exporters/otlp_http.php + +## Http transport + +```php +$transport = (new \OpenTelemetry\Contrib\Otlp\OtlpHttpTransportFactory())->create('http://collector:4318'); +$exporter = new \OpenTelemetry\Contrib\Otlp\SpanExporter($transport); +``` + +## gRPC transport + +To export over gRPC, you will need to additionally install the `open-telemetry/transport-grpc` package. + +## Protobuf Runtime library + +OTLP exporting requires a [protobuf implementation](https://github.com/protocolbuffers/protobuf/tree/main/php). + +The `open-telemetry/gen-otlp-protobuf` requires the `google/protobuf` native implementation. It's fine for development, but +not recommended for production usage. + +The recommended option for production is to install the Protobuf C extension for PHP. The extension +makes exporting _significantly_ more performant. This can be easily installed with the following command: + +```shell +pecl install protobuf +``` + +## Contributing + +This repository is a read-only git subtree split. +To contribute, please see the main [OpenTelemetry PHP monorepo](https://github.com/open-telemetry/opentelemetry-php). diff --git a/vendor/open-telemetry/exporter-otlp/SpanConverter.php b/vendor/open-telemetry/exporter-otlp/SpanConverter.php new file mode 100644 index 000000000..1a8b4369e --- /dev/null +++ b/vendor/open-telemetry/exporter-otlp/SpanConverter.php @@ -0,0 +1,187 @@ +serializer = $serializer ?? ProtobufSerializer::getDefault(); + } + + public function convert(iterable $spans): ExportTraceServiceRequest + { + $pExportTraceServiceRequest = new ExportTraceServiceRequest(); + + $resourceSpans = []; + $resourceCache = []; + $scopeSpans = []; + $scopeCache = []; + foreach ($spans as $span) { + $resource = $span->getResource(); + $instrumentationScope = $span->getInstrumentationScope(); + + $resourceId = $resourceCache[spl_object_id($resource)] ??= serialize([ + $resource->getSchemaUrl(), + $resource->getAttributes()->toArray(), + $resource->getAttributes()->getDroppedAttributesCount(), + ]); + $instrumentationScopeId = $scopeCache[spl_object_id($instrumentationScope)] ??= serialize([ + $instrumentationScope->getName(), + $instrumentationScope->getVersion(), + $instrumentationScope->getSchemaUrl(), + $instrumentationScope->getAttributes()->toArray(), + $instrumentationScope->getAttributes()->getDroppedAttributesCount(), + ]); + + if (($pResourceSpans = $resourceSpans[$resourceId] ?? null) === null) { + /** @psalm-suppress InvalidArgument */ + $pExportTraceServiceRequest->getResourceSpans()[] + = $resourceSpans[$resourceId] + = $pResourceSpans + = $this->convertResourceSpans($resource); + } + + if (($pScopeSpans = $scopeSpans[$resourceId][$instrumentationScopeId] ?? null) === null) { + /** @psalm-suppress InvalidArgument */ + $pResourceSpans->getScopeSpans()[] + = $scopeSpans[$resourceId][$instrumentationScopeId] + = $pScopeSpans + = $this->convertScopeSpans($instrumentationScope); + } + + /** @psalm-suppress InvalidArgument */ + $pScopeSpans->getSpans()[] = $this->convertSpan($span); + } + + return $pExportTraceServiceRequest; + } + + private function convertResourceSpans(ResourceInfo $resource): ResourceSpans + { + $pResourceSpans = new ResourceSpans(); + $pResource = new Resource_(); + $this->setAttributes($pResource, $resource->getAttributes()); + $pResourceSpans->setResource($pResource); + $pResourceSpans->setSchemaUrl((string) $resource->getSchemaUrl()); + + return $pResourceSpans; + } + + private function convertScopeSpans(InstrumentationScopeInterface $instrumentationScope): ScopeSpans + { + $pScopeSpans = new ScopeSpans(); + $pInstrumentationScope = new InstrumentationScope(); + $pInstrumentationScope->setName($instrumentationScope->getName()); + $pInstrumentationScope->setVersion((string) $instrumentationScope->getVersion()); + $this->setAttributes($pInstrumentationScope, $instrumentationScope->getAttributes()); + $pScopeSpans->setScope($pInstrumentationScope); + $pScopeSpans->setSchemaUrl((string) $instrumentationScope->getSchemaUrl()); + + return $pScopeSpans; + } + + /** + * @param Resource_|Span|Event|Link|InstrumentationScope $pElement + */ + private function setAttributes($pElement, AttributesInterface $attributes): void + { + foreach ($attributes as $key => $value) { + /** @psalm-suppress InvalidArgument */ + $pElement->getAttributes()[] = (new KeyValue()) + ->setKey($key) + ->setValue(AttributesConverter::convertAnyValue($value)); + } + $pElement->setDroppedAttributesCount($attributes->getDroppedAttributesCount()); + } + + private function convertSpanKind(int $kind): int + { + switch ($kind) { + case API\SpanKind::KIND_INTERNAL: return SpanKind::SPAN_KIND_INTERNAL; + case API\SpanKind::KIND_CLIENT: return SpanKind::SPAN_KIND_CLIENT; + case API\SpanKind::KIND_SERVER: return SpanKind::SPAN_KIND_SERVER; + case API\SpanKind::KIND_PRODUCER: return SpanKind::SPAN_KIND_PRODUCER; + case API\SpanKind::KIND_CONSUMER: return SpanKind::SPAN_KIND_CONSUMER; + } + + return SpanKind::SPAN_KIND_UNSPECIFIED; + } + + private function convertStatusCode(string $status): int + { + switch ($status) { + case API\StatusCode::STATUS_UNSET: return StatusCode::STATUS_CODE_UNSET; + case API\StatusCode::STATUS_OK: return StatusCode::STATUS_CODE_OK; + case API\StatusCode::STATUS_ERROR: return StatusCode::STATUS_CODE_ERROR; + } + + return StatusCode::STATUS_CODE_UNSET; + } + + private function convertSpan(SpanDataInterface $span): Span + { + $pSpan = new Span(); + $pSpan->setTraceId($this->serializer->serializeTraceId($span->getContext()->getTraceIdBinary())); + $pSpan->setSpanId($this->serializer->serializeSpanId($span->getContext()->getSpanIdBinary())); + $pSpan->setTraceState((string) $span->getContext()->getTraceState()); + if ($span->getParentContext()->isValid()) { + $pSpan->setParentSpanId($this->serializer->serializeSpanId($span->getParentContext()->getSpanIdBinary())); + } + $pSpan->setName($span->getName()); + $pSpan->setKind($this->convertSpanKind($span->getKind())); + $pSpan->setStartTimeUnixNano($span->getStartEpochNanos()); + $pSpan->setEndTimeUnixNano($span->getEndEpochNanos()); + $this->setAttributes($pSpan, $span->getAttributes()); + + foreach ($span->getEvents() as $event) { + /** @psalm-suppress InvalidArgument */ + $pSpan->getEvents()[] = $pEvent = new Event(); + $pEvent->setTimeUnixNano($event->getEpochNanos()); + $pEvent->setName($event->getName()); + $this->setAttributes($pEvent, $event->getAttributes()); + } + $pSpan->setDroppedEventsCount($span->getTotalDroppedEvents()); + + foreach ($span->getLinks() as $link) { + /** @psalm-suppress InvalidArgument */ + $pSpan->getLinks()[] = $pLink = new Link(); + $pLink->setTraceId($this->serializer->serializeTraceId($link->getSpanContext()->getTraceIdBinary())); + $pLink->setSpanId($this->serializer->serializeSpanId($link->getSpanContext()->getSpanIdBinary())); + $pLink->setTraceState((string) $link->getSpanContext()->getTraceState()); + $this->setAttributes($pLink, $link->getAttributes()); + } + $pSpan->setDroppedLinksCount($span->getTotalDroppedLinks()); + + $pStatus = new Status(); + $pStatus->setMessage($span->getStatus()->getDescription()); + $pStatus->setCode($this->convertStatusCode($span->getStatus()->getCode())); + $pSpan->setStatus($pStatus); + + return $pSpan; + } +} diff --git a/vendor/open-telemetry/exporter-otlp/SpanExporter.php b/vendor/open-telemetry/exporter-otlp/SpanExporter.php new file mode 100644 index 000000000..a496206f4 --- /dev/null +++ b/vendor/open-telemetry/exporter-otlp/SpanExporter.php @@ -0,0 +1,81 @@ + $transport + */ + public function __construct(TransportInterface $transport) + { + if (!class_exists('\Google\Protobuf\Api')) { + throw new RuntimeException('No protobuf implementation found (ext-protobuf or google/protobuf)'); + } + $this->transport = $transport; + $this->serializer = ProtobufSerializer::forTransport($transport); + } + + public function export(iterable $batch, ?CancellationInterface $cancellation = null): FutureInterface + { + return $this->transport + ->send($this->serializer->serialize((new SpanConverter($this->serializer))->convert($batch)), $cancellation) + ->map(function (?string $payload): bool { + if ($payload === null) { + return true; + } + + $serviceResponse = new ExportTraceServiceResponse(); + $this->serializer->hydrate($serviceResponse, $payload); + + $partialSuccess = $serviceResponse->getPartialSuccess(); + if ($partialSuccess !== null && $partialSuccess->getRejectedSpans()) { + self::logError('Export partial success', [ + 'rejected_spans' => $partialSuccess->getRejectedSpans(), + 'error_message' => $partialSuccess->getErrorMessage(), + ]); + + return false; + } + if ($partialSuccess !== null && $partialSuccess->getErrorMessage()) { + self::logWarning('Export success with warnings/suggestions', ['error_message' => $partialSuccess->getErrorMessage()]); + } + + return true; + }) + ->catch(static function (Throwable $throwable): bool { + self::logError('Export failure', ['exception' => $throwable]); + + return false; + }); + } + + public function shutdown(?CancellationInterface $cancellation = null): bool + { + return $this->transport->shutdown($cancellation); + } + + public function forceFlush(?CancellationInterface $cancellation = null): bool + { + return $this->transport->forceFlush($cancellation); + } +} diff --git a/vendor/open-telemetry/exporter-otlp/SpanExporterFactory.php b/vendor/open-telemetry/exporter-otlp/SpanExporterFactory.php new file mode 100644 index 000000000..ce0550735 --- /dev/null +++ b/vendor/open-telemetry/exporter-otlp/SpanExporterFactory.php @@ -0,0 +1,96 @@ +transportFactory = $transportFactory; + } + + /** + * @psalm-suppress ArgumentTypeCoercion + */ + public function create(): SpanExporterInterface + { + $transport = $this->buildTransport(); + + return new SpanExporter($transport); + } + + /** + * @psalm-suppress ArgumentTypeCoercion + * @psalm-suppress UndefinedClass + */ + private function buildTransport(): TransportInterface + { + $protocol = $this->getProtocol(); + $contentType = Protocols::contentType($protocol); + $endpoint = $this->getEndpoint($protocol); + $headers = $this->getHeaders(); + $compression = $this->getCompression(); + + $factoryClass = Registry::transportFactory($protocol); + $factory = $this->transportFactory ?: new $factoryClass(); + + return $factory->create($endpoint, $contentType, $headers, $compression); + } + + private function getProtocol(): string + { + return Configuration::has(Variables::OTEL_EXPORTER_OTLP_TRACES_PROTOCOL) ? + Configuration::getEnum(Variables::OTEL_EXPORTER_OTLP_TRACES_PROTOCOL) : + Configuration::getEnum(Variables::OTEL_EXPORTER_OTLP_PROTOCOL); + } + + private function getEndpoint(string $protocol): string + { + if (Configuration::has(Variables::OTEL_EXPORTER_OTLP_TRACES_ENDPOINT)) { + return Configuration::getString(Variables::OTEL_EXPORTER_OTLP_TRACES_ENDPOINT); + } + $endpoint = Configuration::has(Variables::OTEL_EXPORTER_OTLP_ENDPOINT) + ? Configuration::getString(Variables::OTEL_EXPORTER_OTLP_ENDPOINT) + : Defaults::OTEL_EXPORTER_OTLP_ENDPOINT; + if ($protocol === Protocols::GRPC) { + return $endpoint . OtlpUtil::method(Signals::TRACE); + } + + return HttpEndpointResolver::create()->resolveToString($endpoint, Signals::TRACE); + } + + private function getHeaders(): array + { + $headers = Configuration::has(Variables::OTEL_EXPORTER_OTLP_TRACES_HEADERS) ? + Configuration::getMap(Variables::OTEL_EXPORTER_OTLP_TRACES_HEADERS) : + Configuration::getMap(Variables::OTEL_EXPORTER_OTLP_HEADERS); + + return $headers + OtlpUtil::getUserAgentHeader(); + } + + private function getCompression(): string + { + return Configuration::has(Variables::OTEL_EXPORTER_OTLP_TRACES_COMPRESSION) ? + Configuration::getEnum(Variables::OTEL_EXPORTER_OTLP_TRACES_COMPRESSION) : + Configuration::getEnum(Variables::OTEL_EXPORTER_OTLP_COMPRESSION, self::DEFAULT_COMPRESSION); + } +} diff --git a/vendor/open-telemetry/exporter-otlp/_register.php b/vendor/open-telemetry/exporter-otlp/_register.php new file mode 100644 index 000000000..b3acdc3af --- /dev/null +++ b/vendor/open-telemetry/exporter-otlp/_register.php @@ -0,0 +1,9 @@ +internalAddGeneratedFile( + ' +Ê +.opentelemetry/proto/resource/v1/resource.protoopentelemetry.proto.resource.v1"i +Resource; + +attributes ( 2\'.opentelemetry.proto.common.v1.KeyValue +dropped_attributes_count ( Bƒ +"io.opentelemetry.proto.resource.v1B ResourceProtoPZ*go.opentelemetry.io/proto/otlp/resource/v1ªOpenTelemetry.Proto.Resource.V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/GPBMetadata/Opentelemetry/Proto/Trace/V1/Trace.php b/vendor/open-telemetry/gen-otlp-protobuf/GPBMetadata/Opentelemetry/Proto/Trace/V1/Trace.php new file mode 100644 index 000000000..35c1ebbf1 Binary files /dev/null and b/vendor/open-telemetry/gen-otlp-protobuf/GPBMetadata/Opentelemetry/Proto/Trace/V1/Trace.php differ diff --git a/vendor/open-telemetry/gen-otlp-protobuf/GPBMetadata/Opentelemetry/Proto/Trace/V1/TraceConfig.php b/vendor/open-telemetry/gen-otlp-protobuf/GPBMetadata/Opentelemetry/Proto/Trace/V1/TraceConfig.php new file mode 100644 index 000000000..cf25a1656 Binary files /dev/null and b/vendor/open-telemetry/gen-otlp-protobuf/GPBMetadata/Opentelemetry/Proto/Trace/V1/TraceConfig.php differ diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Logs/V1/ExportLogsPartialSuccess.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Logs/V1/ExportLogsPartialSuccess.php new file mode 100644 index 000000000..044cdffdd --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Logs/V1/ExportLogsPartialSuccess.php @@ -0,0 +1,127 @@ +opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess + */ +class ExportLogsPartialSuccess extends \Google\Protobuf\Internal\Message +{ + /** + * The number of rejected log records. + * A `rejected_` field holding a `0` value indicates that the + * request was fully accepted. + * + * Generated from protobuf field int64 rejected_log_records = 1; + */ + protected $rejected_log_records = 0; + /** + * A developer-facing human-readable message in English. It should be used + * either to explain why the server rejected parts of the data during a partial + * success or to convey warnings/suggestions during a full success. The message + * should offer guidance on how users can address such issues. + * error_message is an optional field. An error_message with an empty value + * is equivalent to it not being set. + * + * Generated from protobuf field string error_message = 2; + */ + protected $error_message = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $rejected_log_records + * The number of rejected log records. + * A `rejected_` field holding a `0` value indicates that the + * request was fully accepted. + * @type string $error_message + * A developer-facing human-readable message in English. It should be used + * either to explain why the server rejected parts of the data during a partial + * success or to convey warnings/suggestions during a full success. The message + * should offer guidance on how users can address such issues. + * error_message is an optional field. An error_message with an empty value + * is equivalent to it not being set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Collector\Logs\V1\LogsService::initOnce(); + parent::__construct($data); + } + + /** + * The number of rejected log records. + * A `rejected_` field holding a `0` value indicates that the + * request was fully accepted. + * + * Generated from protobuf field int64 rejected_log_records = 1; + * @return int|string + */ + public function getRejectedLogRecords() + { + return $this->rejected_log_records; + } + + /** + * The number of rejected log records. + * A `rejected_` field holding a `0` value indicates that the + * request was fully accepted. + * + * Generated from protobuf field int64 rejected_log_records = 1; + * @param int|string $var + * @return $this + */ + public function setRejectedLogRecords($var) + { + GPBUtil::checkInt64($var); + $this->rejected_log_records = $var; + + return $this; + } + + /** + * A developer-facing human-readable message in English. It should be used + * either to explain why the server rejected parts of the data during a partial + * success or to convey warnings/suggestions during a full success. The message + * should offer guidance on how users can address such issues. + * error_message is an optional field. An error_message with an empty value + * is equivalent to it not being set. + * + * Generated from protobuf field string error_message = 2; + * @return string + */ + public function getErrorMessage() + { + return $this->error_message; + } + + /** + * A developer-facing human-readable message in English. It should be used + * either to explain why the server rejected parts of the data during a partial + * success or to convey warnings/suggestions during a full success. The message + * should offer guidance on how users can address such issues. + * error_message is an optional field. An error_message with an empty value + * is equivalent to it not being set. + * + * Generated from protobuf field string error_message = 2; + * @param string $var + * @return $this + */ + public function setErrorMessage($var) + { + GPBUtil::checkString($var, True); + $this->error_message = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Logs/V1/ExportLogsServiceRequest.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Logs/V1/ExportLogsServiceRequest.php new file mode 100644 index 000000000..e6f4147c4 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Logs/V1/ExportLogsServiceRequest.php @@ -0,0 +1,81 @@ +opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest + */ +class ExportLogsServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * An array of ResourceLogs. + * For data coming from a single resource this array will typically contain one + * element. Intermediary nodes (such as OpenTelemetry Collector) that receive + * data from multiple origins typically batch the data before forwarding further and + * in that case this array will contain multiple elements. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.ResourceLogs resource_logs = 1; + */ + private $resource_logs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Logs\V1\ResourceLogs[]|\Google\Protobuf\Internal\RepeatedField $resource_logs + * An array of ResourceLogs. + * For data coming from a single resource this array will typically contain one + * element. Intermediary nodes (such as OpenTelemetry Collector) that receive + * data from multiple origins typically batch the data before forwarding further and + * in that case this array will contain multiple elements. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Collector\Logs\V1\LogsService::initOnce(); + parent::__construct($data); + } + + /** + * An array of ResourceLogs. + * For data coming from a single resource this array will typically contain one + * element. Intermediary nodes (such as OpenTelemetry Collector) that receive + * data from multiple origins typically batch the data before forwarding further and + * in that case this array will contain multiple elements. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.ResourceLogs resource_logs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceLogs() + { + return $this->resource_logs; + } + + /** + * An array of ResourceLogs. + * For data coming from a single resource this array will typically contain one + * element. Intermediary nodes (such as OpenTelemetry Collector) that receive + * data from multiple origins typically batch the data before forwarding further and + * in that case this array will contain multiple elements. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.ResourceLogs resource_logs = 1; + * @param \Opentelemetry\Proto\Logs\V1\ResourceLogs[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceLogs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Logs\V1\ResourceLogs::class); + $this->resource_logs = $arr; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Logs/V1/ExportLogsServiceResponse.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Logs/V1/ExportLogsServiceResponse.php new file mode 100644 index 000000000..34e76a836 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Logs/V1/ExportLogsServiceResponse.php @@ -0,0 +1,119 @@ +opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse + */ +class ExportLogsServiceResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The details of a partially successful export request. + * If the request is only partially accepted + * (i.e. when the server accepts only parts of the data and rejects the rest) + * the server MUST initialize the `partial_success` field and MUST + * set the `rejected_` with the number of items it rejected. + * Servers MAY also make use of the `partial_success` field to convey + * warnings/suggestions to senders even when the request was fully accepted. + * In such cases, the `rejected_` MUST have a value of `0` and + * the `error_message` MUST be non-empty. + * A `partial_success` message with an empty value (rejected_ = 0 and + * `error_message` = "") is equivalent to it not being set/present. Senders + * SHOULD interpret it the same way as in the full success case. + * + * Generated from protobuf field .opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess partial_success = 1; + */ + protected $partial_success = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Collector\Logs\V1\ExportLogsPartialSuccess $partial_success + * The details of a partially successful export request. + * If the request is only partially accepted + * (i.e. when the server accepts only parts of the data and rejects the rest) + * the server MUST initialize the `partial_success` field and MUST + * set the `rejected_` with the number of items it rejected. + * Servers MAY also make use of the `partial_success` field to convey + * warnings/suggestions to senders even when the request was fully accepted. + * In such cases, the `rejected_` MUST have a value of `0` and + * the `error_message` MUST be non-empty. + * A `partial_success` message with an empty value (rejected_ = 0 and + * `error_message` = "") is equivalent to it not being set/present. Senders + * SHOULD interpret it the same way as in the full success case. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Collector\Logs\V1\LogsService::initOnce(); + parent::__construct($data); + } + + /** + * The details of a partially successful export request. + * If the request is only partially accepted + * (i.e. when the server accepts only parts of the data and rejects the rest) + * the server MUST initialize the `partial_success` field and MUST + * set the `rejected_` with the number of items it rejected. + * Servers MAY also make use of the `partial_success` field to convey + * warnings/suggestions to senders even when the request was fully accepted. + * In such cases, the `rejected_` MUST have a value of `0` and + * the `error_message` MUST be non-empty. + * A `partial_success` message with an empty value (rejected_ = 0 and + * `error_message` = "") is equivalent to it not being set/present. Senders + * SHOULD interpret it the same way as in the full success case. + * + * Generated from protobuf field .opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess partial_success = 1; + * @return \Opentelemetry\Proto\Collector\Logs\V1\ExportLogsPartialSuccess|null + */ + public function getPartialSuccess() + { + return $this->partial_success; + } + + public function hasPartialSuccess() + { + return isset($this->partial_success); + } + + public function clearPartialSuccess() + { + unset($this->partial_success); + } + + /** + * The details of a partially successful export request. + * If the request is only partially accepted + * (i.e. when the server accepts only parts of the data and rejects the rest) + * the server MUST initialize the `partial_success` field and MUST + * set the `rejected_` with the number of items it rejected. + * Servers MAY also make use of the `partial_success` field to convey + * warnings/suggestions to senders even when the request was fully accepted. + * In such cases, the `rejected_` MUST have a value of `0` and + * the `error_message` MUST be non-empty. + * A `partial_success` message with an empty value (rejected_ = 0 and + * `error_message` = "") is equivalent to it not being set/present. Senders + * SHOULD interpret it the same way as in the full success case. + * + * Generated from protobuf field .opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess partial_success = 1; + * @param \Opentelemetry\Proto\Collector\Logs\V1\ExportLogsPartialSuccess $var + * @return $this + */ + public function setPartialSuccess($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Collector\Logs\V1\ExportLogsPartialSuccess::class); + $this->partial_success = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Logs/V1/LogsServiceClient.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Logs/V1/LogsServiceClient.php new file mode 100644 index 000000000..e3249d73e --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Logs/V1/LogsServiceClient.php @@ -0,0 +1,53 @@ +_simpleRequest('/opentelemetry.proto.collector.logs.v1.LogsService/Export', + $argument, + ['\Opentelemetry\Proto\Collector\Logs\V1\ExportLogsServiceResponse', 'decode'], + $metadata, $options); + } + +} diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Metrics/V1/ExportMetricsPartialSuccess.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Metrics/V1/ExportMetricsPartialSuccess.php new file mode 100644 index 000000000..872d3b5e0 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Metrics/V1/ExportMetricsPartialSuccess.php @@ -0,0 +1,127 @@ +opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess + */ +class ExportMetricsPartialSuccess extends \Google\Protobuf\Internal\Message +{ + /** + * The number of rejected data points. + * A `rejected_` field holding a `0` value indicates that the + * request was fully accepted. + * + * Generated from protobuf field int64 rejected_data_points = 1; + */ + protected $rejected_data_points = 0; + /** + * A developer-facing human-readable message in English. It should be used + * either to explain why the server rejected parts of the data during a partial + * success or to convey warnings/suggestions during a full success. The message + * should offer guidance on how users can address such issues. + * error_message is an optional field. An error_message with an empty value + * is equivalent to it not being set. + * + * Generated from protobuf field string error_message = 2; + */ + protected $error_message = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $rejected_data_points + * The number of rejected data points. + * A `rejected_` field holding a `0` value indicates that the + * request was fully accepted. + * @type string $error_message + * A developer-facing human-readable message in English. It should be used + * either to explain why the server rejected parts of the data during a partial + * success or to convey warnings/suggestions during a full success. The message + * should offer guidance on how users can address such issues. + * error_message is an optional field. An error_message with an empty value + * is equivalent to it not being set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Collector\Metrics\V1\MetricsService::initOnce(); + parent::__construct($data); + } + + /** + * The number of rejected data points. + * A `rejected_` field holding a `0` value indicates that the + * request was fully accepted. + * + * Generated from protobuf field int64 rejected_data_points = 1; + * @return int|string + */ + public function getRejectedDataPoints() + { + return $this->rejected_data_points; + } + + /** + * The number of rejected data points. + * A `rejected_` field holding a `0` value indicates that the + * request was fully accepted. + * + * Generated from protobuf field int64 rejected_data_points = 1; + * @param int|string $var + * @return $this + */ + public function setRejectedDataPoints($var) + { + GPBUtil::checkInt64($var); + $this->rejected_data_points = $var; + + return $this; + } + + /** + * A developer-facing human-readable message in English. It should be used + * either to explain why the server rejected parts of the data during a partial + * success or to convey warnings/suggestions during a full success. The message + * should offer guidance on how users can address such issues. + * error_message is an optional field. An error_message with an empty value + * is equivalent to it not being set. + * + * Generated from protobuf field string error_message = 2; + * @return string + */ + public function getErrorMessage() + { + return $this->error_message; + } + + /** + * A developer-facing human-readable message in English. It should be used + * either to explain why the server rejected parts of the data during a partial + * success or to convey warnings/suggestions during a full success. The message + * should offer guidance on how users can address such issues. + * error_message is an optional field. An error_message with an empty value + * is equivalent to it not being set. + * + * Generated from protobuf field string error_message = 2; + * @param string $var + * @return $this + */ + public function setErrorMessage($var) + { + GPBUtil::checkString($var, True); + $this->error_message = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Metrics/V1/ExportMetricsServiceRequest.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Metrics/V1/ExportMetricsServiceRequest.php new file mode 100644 index 000000000..1fa5ac3bf --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Metrics/V1/ExportMetricsServiceRequest.php @@ -0,0 +1,81 @@ +opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest + */ +class ExportMetricsServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * An array of ResourceMetrics. + * For data coming from a single resource this array will typically contain one + * element. Intermediary nodes (such as OpenTelemetry Collector) that receive + * data from multiple origins typically batch the data before forwarding further and + * in that case this array will contain multiple elements. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1; + */ + private $resource_metrics; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Metrics\V1\ResourceMetrics[]|\Google\Protobuf\Internal\RepeatedField $resource_metrics + * An array of ResourceMetrics. + * For data coming from a single resource this array will typically contain one + * element. Intermediary nodes (such as OpenTelemetry Collector) that receive + * data from multiple origins typically batch the data before forwarding further and + * in that case this array will contain multiple elements. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Collector\Metrics\V1\MetricsService::initOnce(); + parent::__construct($data); + } + + /** + * An array of ResourceMetrics. + * For data coming from a single resource this array will typically contain one + * element. Intermediary nodes (such as OpenTelemetry Collector) that receive + * data from multiple origins typically batch the data before forwarding further and + * in that case this array will contain multiple elements. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceMetrics() + { + return $this->resource_metrics; + } + + /** + * An array of ResourceMetrics. + * For data coming from a single resource this array will typically contain one + * element. Intermediary nodes (such as OpenTelemetry Collector) that receive + * data from multiple origins typically batch the data before forwarding further and + * in that case this array will contain multiple elements. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1; + * @param \Opentelemetry\Proto\Metrics\V1\ResourceMetrics[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\ResourceMetrics::class); + $this->resource_metrics = $arr; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Metrics/V1/ExportMetricsServiceResponse.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Metrics/V1/ExportMetricsServiceResponse.php new file mode 100644 index 000000000..1f3bff5aa --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Metrics/V1/ExportMetricsServiceResponse.php @@ -0,0 +1,119 @@ +opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse + */ +class ExportMetricsServiceResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The details of a partially successful export request. + * If the request is only partially accepted + * (i.e. when the server accepts only parts of the data and rejects the rest) + * the server MUST initialize the `partial_success` field and MUST + * set the `rejected_` with the number of items it rejected. + * Servers MAY also make use of the `partial_success` field to convey + * warnings/suggestions to senders even when the request was fully accepted. + * In such cases, the `rejected_` MUST have a value of `0` and + * the `error_message` MUST be non-empty. + * A `partial_success` message with an empty value (rejected_ = 0 and + * `error_message` = "") is equivalent to it not being set/present. Senders + * SHOULD interpret it the same way as in the full success case. + * + * Generated from protobuf field .opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess partial_success = 1; + */ + protected $partial_success = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Collector\Metrics\V1\ExportMetricsPartialSuccess $partial_success + * The details of a partially successful export request. + * If the request is only partially accepted + * (i.e. when the server accepts only parts of the data and rejects the rest) + * the server MUST initialize the `partial_success` field and MUST + * set the `rejected_` with the number of items it rejected. + * Servers MAY also make use of the `partial_success` field to convey + * warnings/suggestions to senders even when the request was fully accepted. + * In such cases, the `rejected_` MUST have a value of `0` and + * the `error_message` MUST be non-empty. + * A `partial_success` message with an empty value (rejected_ = 0 and + * `error_message` = "") is equivalent to it not being set/present. Senders + * SHOULD interpret it the same way as in the full success case. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Collector\Metrics\V1\MetricsService::initOnce(); + parent::__construct($data); + } + + /** + * The details of a partially successful export request. + * If the request is only partially accepted + * (i.e. when the server accepts only parts of the data and rejects the rest) + * the server MUST initialize the `partial_success` field and MUST + * set the `rejected_` with the number of items it rejected. + * Servers MAY also make use of the `partial_success` field to convey + * warnings/suggestions to senders even when the request was fully accepted. + * In such cases, the `rejected_` MUST have a value of `0` and + * the `error_message` MUST be non-empty. + * A `partial_success` message with an empty value (rejected_ = 0 and + * `error_message` = "") is equivalent to it not being set/present. Senders + * SHOULD interpret it the same way as in the full success case. + * + * Generated from protobuf field .opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess partial_success = 1; + * @return \Opentelemetry\Proto\Collector\Metrics\V1\ExportMetricsPartialSuccess|null + */ + public function getPartialSuccess() + { + return $this->partial_success; + } + + public function hasPartialSuccess() + { + return isset($this->partial_success); + } + + public function clearPartialSuccess() + { + unset($this->partial_success); + } + + /** + * The details of a partially successful export request. + * If the request is only partially accepted + * (i.e. when the server accepts only parts of the data and rejects the rest) + * the server MUST initialize the `partial_success` field and MUST + * set the `rejected_` with the number of items it rejected. + * Servers MAY also make use of the `partial_success` field to convey + * warnings/suggestions to senders even when the request was fully accepted. + * In such cases, the `rejected_` MUST have a value of `0` and + * the `error_message` MUST be non-empty. + * A `partial_success` message with an empty value (rejected_ = 0 and + * `error_message` = "") is equivalent to it not being set/present. Senders + * SHOULD interpret it the same way as in the full success case. + * + * Generated from protobuf field .opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess partial_success = 1; + * @param \Opentelemetry\Proto\Collector\Metrics\V1\ExportMetricsPartialSuccess $var + * @return $this + */ + public function setPartialSuccess($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Collector\Metrics\V1\ExportMetricsPartialSuccess::class); + $this->partial_success = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Metrics/V1/MetricsServiceClient.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Metrics/V1/MetricsServiceClient.php new file mode 100644 index 000000000..b5cddb55a --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Metrics/V1/MetricsServiceClient.php @@ -0,0 +1,53 @@ +_simpleRequest('/opentelemetry.proto.collector.metrics.v1.MetricsService/Export', + $argument, + ['\Opentelemetry\Proto\Collector\Metrics\V1\ExportMetricsServiceResponse', 'decode'], + $metadata, $options); + } + +} diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Trace/V1/ExportTracePartialSuccess.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Trace/V1/ExportTracePartialSuccess.php new file mode 100644 index 000000000..56bf54dda --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Trace/V1/ExportTracePartialSuccess.php @@ -0,0 +1,127 @@ +opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess + */ +class ExportTracePartialSuccess extends \Google\Protobuf\Internal\Message +{ + /** + * The number of rejected spans. + * A `rejected_` field holding a `0` value indicates that the + * request was fully accepted. + * + * Generated from protobuf field int64 rejected_spans = 1; + */ + protected $rejected_spans = 0; + /** + * A developer-facing human-readable message in English. It should be used + * either to explain why the server rejected parts of the data during a partial + * success or to convey warnings/suggestions during a full success. The message + * should offer guidance on how users can address such issues. + * error_message is an optional field. An error_message with an empty value + * is equivalent to it not being set. + * + * Generated from protobuf field string error_message = 2; + */ + protected $error_message = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $rejected_spans + * The number of rejected spans. + * A `rejected_` field holding a `0` value indicates that the + * request was fully accepted. + * @type string $error_message + * A developer-facing human-readable message in English. It should be used + * either to explain why the server rejected parts of the data during a partial + * success or to convey warnings/suggestions during a full success. The message + * should offer guidance on how users can address such issues. + * error_message is an optional field. An error_message with an empty value + * is equivalent to it not being set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Collector\Trace\V1\TraceService::initOnce(); + parent::__construct($data); + } + + /** + * The number of rejected spans. + * A `rejected_` field holding a `0` value indicates that the + * request was fully accepted. + * + * Generated from protobuf field int64 rejected_spans = 1; + * @return int|string + */ + public function getRejectedSpans() + { + return $this->rejected_spans; + } + + /** + * The number of rejected spans. + * A `rejected_` field holding a `0` value indicates that the + * request was fully accepted. + * + * Generated from protobuf field int64 rejected_spans = 1; + * @param int|string $var + * @return $this + */ + public function setRejectedSpans($var) + { + GPBUtil::checkInt64($var); + $this->rejected_spans = $var; + + return $this; + } + + /** + * A developer-facing human-readable message in English. It should be used + * either to explain why the server rejected parts of the data during a partial + * success or to convey warnings/suggestions during a full success. The message + * should offer guidance on how users can address such issues. + * error_message is an optional field. An error_message with an empty value + * is equivalent to it not being set. + * + * Generated from protobuf field string error_message = 2; + * @return string + */ + public function getErrorMessage() + { + return $this->error_message; + } + + /** + * A developer-facing human-readable message in English. It should be used + * either to explain why the server rejected parts of the data during a partial + * success or to convey warnings/suggestions during a full success. The message + * should offer guidance on how users can address such issues. + * error_message is an optional field. An error_message with an empty value + * is equivalent to it not being set. + * + * Generated from protobuf field string error_message = 2; + * @param string $var + * @return $this + */ + public function setErrorMessage($var) + { + GPBUtil::checkString($var, True); + $this->error_message = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Trace/V1/ExportTraceServiceRequest.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Trace/V1/ExportTraceServiceRequest.php new file mode 100644 index 000000000..dc8bced18 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Trace/V1/ExportTraceServiceRequest.php @@ -0,0 +1,81 @@ +opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest + */ +class ExportTraceServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * An array of ResourceSpans. + * For data coming from a single resource this array will typically contain one + * element. Intermediary nodes (such as OpenTelemetry Collector) that receive + * data from multiple origins typically batch the data before forwarding further and + * in that case this array will contain multiple elements. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.ResourceSpans resource_spans = 1; + */ + private $resource_spans; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Trace\V1\ResourceSpans[]|\Google\Protobuf\Internal\RepeatedField $resource_spans + * An array of ResourceSpans. + * For data coming from a single resource this array will typically contain one + * element. Intermediary nodes (such as OpenTelemetry Collector) that receive + * data from multiple origins typically batch the data before forwarding further and + * in that case this array will contain multiple elements. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Collector\Trace\V1\TraceService::initOnce(); + parent::__construct($data); + } + + /** + * An array of ResourceSpans. + * For data coming from a single resource this array will typically contain one + * element. Intermediary nodes (such as OpenTelemetry Collector) that receive + * data from multiple origins typically batch the data before forwarding further and + * in that case this array will contain multiple elements. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.ResourceSpans resource_spans = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceSpans() + { + return $this->resource_spans; + } + + /** + * An array of ResourceSpans. + * For data coming from a single resource this array will typically contain one + * element. Intermediary nodes (such as OpenTelemetry Collector) that receive + * data from multiple origins typically batch the data before forwarding further and + * in that case this array will contain multiple elements. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.ResourceSpans resource_spans = 1; + * @param \Opentelemetry\Proto\Trace\V1\ResourceSpans[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceSpans($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\ResourceSpans::class); + $this->resource_spans = $arr; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Trace/V1/ExportTraceServiceResponse.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Trace/V1/ExportTraceServiceResponse.php new file mode 100644 index 000000000..27b03030a --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Trace/V1/ExportTraceServiceResponse.php @@ -0,0 +1,119 @@ +opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse + */ +class ExportTraceServiceResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The details of a partially successful export request. + * If the request is only partially accepted + * (i.e. when the server accepts only parts of the data and rejects the rest) + * the server MUST initialize the `partial_success` field and MUST + * set the `rejected_` with the number of items it rejected. + * Servers MAY also make use of the `partial_success` field to convey + * warnings/suggestions to senders even when the request was fully accepted. + * In such cases, the `rejected_` MUST have a value of `0` and + * the `error_message` MUST be non-empty. + * A `partial_success` message with an empty value (rejected_ = 0 and + * `error_message` = "") is equivalent to it not being set/present. Senders + * SHOULD interpret it the same way as in the full success case. + * + * Generated from protobuf field .opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess partial_success = 1; + */ + protected $partial_success = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Collector\Trace\V1\ExportTracePartialSuccess $partial_success + * The details of a partially successful export request. + * If the request is only partially accepted + * (i.e. when the server accepts only parts of the data and rejects the rest) + * the server MUST initialize the `partial_success` field and MUST + * set the `rejected_` with the number of items it rejected. + * Servers MAY also make use of the `partial_success` field to convey + * warnings/suggestions to senders even when the request was fully accepted. + * In such cases, the `rejected_` MUST have a value of `0` and + * the `error_message` MUST be non-empty. + * A `partial_success` message with an empty value (rejected_ = 0 and + * `error_message` = "") is equivalent to it not being set/present. Senders + * SHOULD interpret it the same way as in the full success case. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Collector\Trace\V1\TraceService::initOnce(); + parent::__construct($data); + } + + /** + * The details of a partially successful export request. + * If the request is only partially accepted + * (i.e. when the server accepts only parts of the data and rejects the rest) + * the server MUST initialize the `partial_success` field and MUST + * set the `rejected_` with the number of items it rejected. + * Servers MAY also make use of the `partial_success` field to convey + * warnings/suggestions to senders even when the request was fully accepted. + * In such cases, the `rejected_` MUST have a value of `0` and + * the `error_message` MUST be non-empty. + * A `partial_success` message with an empty value (rejected_ = 0 and + * `error_message` = "") is equivalent to it not being set/present. Senders + * SHOULD interpret it the same way as in the full success case. + * + * Generated from protobuf field .opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess partial_success = 1; + * @return \Opentelemetry\Proto\Collector\Trace\V1\ExportTracePartialSuccess|null + */ + public function getPartialSuccess() + { + return $this->partial_success; + } + + public function hasPartialSuccess() + { + return isset($this->partial_success); + } + + public function clearPartialSuccess() + { + unset($this->partial_success); + } + + /** + * The details of a partially successful export request. + * If the request is only partially accepted + * (i.e. when the server accepts only parts of the data and rejects the rest) + * the server MUST initialize the `partial_success` field and MUST + * set the `rejected_` with the number of items it rejected. + * Servers MAY also make use of the `partial_success` field to convey + * warnings/suggestions to senders even when the request was fully accepted. + * In such cases, the `rejected_` MUST have a value of `0` and + * the `error_message` MUST be non-empty. + * A `partial_success` message with an empty value (rejected_ = 0 and + * `error_message` = "") is equivalent to it not being set/present. Senders + * SHOULD interpret it the same way as in the full success case. + * + * Generated from protobuf field .opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess partial_success = 1; + * @param \Opentelemetry\Proto\Collector\Trace\V1\ExportTracePartialSuccess $var + * @return $this + */ + public function setPartialSuccess($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Collector\Trace\V1\ExportTracePartialSuccess::class); + $this->partial_success = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Trace/V1/TraceServiceClient.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Trace/V1/TraceServiceClient.php new file mode 100644 index 000000000..7a676b3e1 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Collector/Trace/V1/TraceServiceClient.php @@ -0,0 +1,53 @@ +_simpleRequest('/opentelemetry.proto.collector.trace.v1.TraceService/Export', + $argument, + ['\Opentelemetry\Proto\Collector\Trace\V1\ExportTraceServiceResponse', 'decode'], + $metadata, $options); + } + +} diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/AnyValue.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/AnyValue.php new file mode 100644 index 000000000..89079de89 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/AnyValue.php @@ -0,0 +1,240 @@ +opentelemetry.proto.common.v1.AnyValue + */ +class AnyValue extends \Google\Protobuf\Internal\Message +{ + protected $value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $string_value + * @type bool $bool_value + * @type int|string $int_value + * @type float $double_value + * @type \Opentelemetry\Proto\Common\V1\ArrayValue $array_value + * @type \Opentelemetry\Proto\Common\V1\KeyValueList $kvlist_value + * @type string $bytes_value + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string string_value = 1; + * @return string + */ + public function getStringValue() + { + return $this->readOneof(1); + } + + public function hasStringValue() + { + return $this->hasOneof(1); + } + + /** + * Generated from protobuf field string string_value = 1; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Generated from protobuf field bool bool_value = 2; + * @return bool + */ + public function getBoolValue() + { + return $this->readOneof(2); + } + + public function hasBoolValue() + { + return $this->hasOneof(2); + } + + /** + * Generated from protobuf field bool bool_value = 2; + * @param bool $var + * @return $this + */ + public function setBoolValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Generated from protobuf field int64 int_value = 3; + * @return int|string + */ + public function getIntValue() + { + return $this->readOneof(3); + } + + public function hasIntValue() + { + return $this->hasOneof(3); + } + + /** + * Generated from protobuf field int64 int_value = 3; + * @param int|string $var + * @return $this + */ + public function setIntValue($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Generated from protobuf field double double_value = 4; + * @return float + */ + public function getDoubleValue() + { + return $this->readOneof(4); + } + + public function hasDoubleValue() + { + return $this->hasOneof(4); + } + + /** + * Generated from protobuf field double double_value = 4; + * @param float $var + * @return $this + */ + public function setDoubleValue($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Generated from protobuf field .opentelemetry.proto.common.v1.ArrayValue array_value = 5; + * @return \Opentelemetry\Proto\Common\V1\ArrayValue|null + */ + public function getArrayValue() + { + return $this->readOneof(5); + } + + public function hasArrayValue() + { + return $this->hasOneof(5); + } + + /** + * Generated from protobuf field .opentelemetry.proto.common.v1.ArrayValue array_value = 5; + * @param \Opentelemetry\Proto\Common\V1\ArrayValue $var + * @return $this + */ + public function setArrayValue($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\ArrayValue::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Generated from protobuf field .opentelemetry.proto.common.v1.KeyValueList kvlist_value = 6; + * @return \Opentelemetry\Proto\Common\V1\KeyValueList|null + */ + public function getKvlistValue() + { + return $this->readOneof(6); + } + + public function hasKvlistValue() + { + return $this->hasOneof(6); + } + + /** + * Generated from protobuf field .opentelemetry.proto.common.v1.KeyValueList kvlist_value = 6; + * @param \Opentelemetry\Proto\Common\V1\KeyValueList $var + * @return $this + */ + public function setKvlistValue($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\KeyValueList::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Generated from protobuf field bytes bytes_value = 7; + * @return string + */ + public function getBytesValue() + { + return $this->readOneof(7); + } + + public function hasBytesValue() + { + return $this->hasOneof(7); + } + + /** + * Generated from protobuf field bytes bytes_value = 7; + * @param string $var + * @return $this + */ + public function setBytesValue($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * @return string + */ + public function getValue() + { + return $this->whichOneof("value"); + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/ArrayValue.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/ArrayValue.php new file mode 100644 index 000000000..eccbba997 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/ArrayValue.php @@ -0,0 +1,68 @@ +opentelemetry.proto.common.v1.ArrayValue + */ +class ArrayValue extends \Google\Protobuf\Internal\Message +{ + /** + * Array of values. The array may be empty (contain 0 elements). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.AnyValue values = 1; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\AnyValue[]|\Google\Protobuf\Internal\RepeatedField $values + * Array of values. The array may be empty (contain 0 elements). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * Array of values. The array may be empty (contain 0 elements). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.AnyValue values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * Array of values. The array may be empty (contain 0 elements). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.AnyValue values = 1; + * @param \Opentelemetry\Proto\Common\V1\AnyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\AnyValue::class); + $this->values = $arr; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/InstrumentationLibrary.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/InstrumentationLibrary.php new file mode 100644 index 000000000..7d012ad19 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/InstrumentationLibrary.php @@ -0,0 +1,98 @@ +opentelemetry.proto.common.v1.InstrumentationLibrary + */ +class InstrumentationLibrary extends \Google\Protobuf\Internal\Message +{ + /** + * An empty instrumentation library name means the name is unknown. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Generated from protobuf field string version = 2; + */ + protected $version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * An empty instrumentation library name means the name is unknown. + * @type string $version + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * An empty instrumentation library name means the name is unknown. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * An empty instrumentation library name means the name is unknown. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field string version = 2; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Generated from protobuf field string version = 2; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/InstrumentationScope.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/InstrumentationScope.php new file mode 100644 index 000000000..d2b4b6f05 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/InstrumentationScope.php @@ -0,0 +1,164 @@ +opentelemetry.proto.common.v1.InstrumentationScope + */ +class InstrumentationScope extends \Google\Protobuf\Internal\Message +{ + /** + * An empty instrumentation scope name means the name is unknown. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Generated from protobuf field string version = 2; + */ + protected $version = ''; + /** + * Additional attributes that describe the scope. [Optional]. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 3; + */ + private $attributes; + /** + * Generated from protobuf field uint32 dropped_attributes_count = 4; + */ + protected $dropped_attributes_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * An empty instrumentation scope name means the name is unknown. + * @type string $version + * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes + * Additional attributes that describe the scope. [Optional]. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * @type int $dropped_attributes_count + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * An empty instrumentation scope name means the name is unknown. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * An empty instrumentation scope name means the name is unknown. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field string version = 2; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Generated from protobuf field string version = 2; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * Additional attributes that describe the scope. [Optional]. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Additional attributes that describe the scope. [Optional]. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 3; + * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class); + $this->attributes = $arr; + + return $this; + } + + /** + * Generated from protobuf field uint32 dropped_attributes_count = 4; + * @return int + */ + public function getDroppedAttributesCount() + { + return $this->dropped_attributes_count; + } + + /** + * Generated from protobuf field uint32 dropped_attributes_count = 4; + * @param int $var + * @return $this + */ + public function setDroppedAttributesCount($var) + { + GPBUtil::checkUint32($var); + $this->dropped_attributes_count = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/KeyValue.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/KeyValue.php new file mode 100644 index 000000000..6dfbdeb40 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/KeyValue.php @@ -0,0 +1,98 @@ +opentelemetry.proto.common.v1.KeyValue + */ +class KeyValue extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string key = 1; + */ + protected $key = ''; + /** + * Generated from protobuf field .opentelemetry.proto.common.v1.AnyValue value = 2; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * @type \Opentelemetry\Proto\Common\V1\AnyValue $value + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string key = 1; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Generated from protobuf field string key = 1; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Generated from protobuf field .opentelemetry.proto.common.v1.AnyValue value = 2; + * @return \Opentelemetry\Proto\Common\V1\AnyValue|null + */ + public function getValue() + { + return $this->value; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * Generated from protobuf field .opentelemetry.proto.common.v1.AnyValue value = 2; + * @param \Opentelemetry\Proto\Common\V1\AnyValue $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\AnyValue::class); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/KeyValueList.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/KeyValueList.php new file mode 100644 index 000000000..51fb628ae --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/KeyValueList.php @@ -0,0 +1,83 @@ +opentelemetry.proto.common.v1.KeyValueList + */ +class KeyValueList extends \Google\Protobuf\Internal\Message +{ + /** + * A collection of key/value pairs of key-value pairs. The list may be empty (may + * contain 0 elements). + * The keys MUST be unique (it is not allowed to have more than one + * value with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue values = 1; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $values + * A collection of key/value pairs of key-value pairs. The list may be empty (may + * contain 0 elements). + * The keys MUST be unique (it is not allowed to have more than one + * value with the same key). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * A collection of key/value pairs of key-value pairs. The list may be empty (may + * contain 0 elements). + * The keys MUST be unique (it is not allowed to have more than one + * value with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * A collection of key/value pairs of key-value pairs. The list may be empty (may + * contain 0 elements). + * The keys MUST be unique (it is not allowed to have more than one + * value with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue values = 1; + * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class); + $this->values = $arr; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/StringKeyValue.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/StringKeyValue.php new file mode 100644 index 000000000..c508dd1aa --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/StringKeyValue.php @@ -0,0 +1,88 @@ +opentelemetry.proto.common.v1.StringKeyValue + */ +class StringKeyValue extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string key = 1; + */ + protected $key = ''; + /** + * Generated from protobuf field string value = 2; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * @type string $value + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string key = 1; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Generated from protobuf field string key = 1; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Generated from protobuf field string value = 2; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Generated from protobuf field string value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/InstrumentationLibraryLogs.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/InstrumentationLibraryLogs.php new file mode 100644 index 000000000..e43654641 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/InstrumentationLibraryLogs.php @@ -0,0 +1,156 @@ +opentelemetry.proto.logs.v1.InstrumentationLibraryLogs + */ +class InstrumentationLibraryLogs extends \Google\Protobuf\Internal\Message +{ + /** + * The instrumentation library information for the logs in this message. + * Semantically when InstrumentationLibrary isn't set, it is equivalent with + * an empty instrumentation library name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1; + */ + protected $instrumentation_library = null; + /** + * A list of logs that originate from an instrumentation library. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord log_records = 2; + */ + private $log_records; + /** + * This schema_url applies to all logs in the "logs" field. + * + * Generated from protobuf field string schema_url = 3; + */ + protected $schema_url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\InstrumentationLibrary $instrumentation_library + * The instrumentation library information for the logs in this message. + * Semantically when InstrumentationLibrary isn't set, it is equivalent with + * an empty instrumentation library name (unknown). + * @type \Opentelemetry\Proto\Logs\V1\LogRecord[]|\Google\Protobuf\Internal\RepeatedField $log_records + * A list of logs that originate from an instrumentation library. + * @type string $schema_url + * This schema_url applies to all logs in the "logs" field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Logs\V1\Logs::initOnce(); + parent::__construct($data); + } + + /** + * The instrumentation library information for the logs in this message. + * Semantically when InstrumentationLibrary isn't set, it is equivalent with + * an empty instrumentation library name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1; + * @return \Opentelemetry\Proto\Common\V1\InstrumentationLibrary|null + */ + public function getInstrumentationLibrary() + { + return $this->instrumentation_library; + } + + public function hasInstrumentationLibrary() + { + return isset($this->instrumentation_library); + } + + public function clearInstrumentationLibrary() + { + unset($this->instrumentation_library); + } + + /** + * The instrumentation library information for the logs in this message. + * Semantically when InstrumentationLibrary isn't set, it is equivalent with + * an empty instrumentation library name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1; + * @param \Opentelemetry\Proto\Common\V1\InstrumentationLibrary $var + * @return $this + */ + public function setInstrumentationLibrary($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\InstrumentationLibrary::class); + $this->instrumentation_library = $var; + + return $this; + } + + /** + * A list of logs that originate from an instrumentation library. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord log_records = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLogRecords() + { + return $this->log_records; + } + + /** + * A list of logs that originate from an instrumentation library. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord log_records = 2; + * @param \Opentelemetry\Proto\Logs\V1\LogRecord[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLogRecords($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Logs\V1\LogRecord::class); + $this->log_records = $arr; + + return $this; + } + + /** + * This schema_url applies to all logs in the "logs" field. + * + * Generated from protobuf field string schema_url = 3; + * @return string + */ + public function getSchemaUrl() + { + return $this->schema_url; + } + + /** + * This schema_url applies to all logs in the "logs" field. + * + * Generated from protobuf field string schema_url = 3; + * @param string $var + * @return $this + */ + public function setSchemaUrl($var) + { + GPBUtil::checkString($var, True); + $this->schema_url = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/LogRecord.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/LogRecord.php new file mode 100644 index 000000000..caca11f87 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/LogRecord.php @@ -0,0 +1,541 @@ +opentelemetry.proto.logs.v1.LogRecord + */ +class LogRecord extends \Google\Protobuf\Internal\Message +{ + /** + * time_unix_nano is the time when the event occurred. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * Value of 0 indicates unknown or missing timestamp. + * + * Generated from protobuf field fixed64 time_unix_nano = 1; + */ + protected $time_unix_nano = 0; + /** + * Time when the event was observed by the collection system. + * For events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK) + * this timestamp is typically set at the generation time and is equal to Timestamp. + * For events originating externally and collected by OpenTelemetry (e.g. using + * Collector) this is the time when OpenTelemetry's code observed the event measured + * by the clock of the OpenTelemetry code. This field MUST be set once the event is + * observed by OpenTelemetry. + * For converting OpenTelemetry log data to formats that support only one timestamp or + * when receiving OpenTelemetry log data by recipients that support only one timestamp + * internally the following logic is recommended: + * - Use time_unix_nano if it is present, otherwise use observed_time_unix_nano. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * Value of 0 indicates unknown or missing timestamp. + * + * Generated from protobuf field fixed64 observed_time_unix_nano = 11; + */ + protected $observed_time_unix_nano = 0; + /** + * Numerical value of the severity, normalized to values described in Log Data Model. + * [Optional]. + * + * Generated from protobuf field .opentelemetry.proto.logs.v1.SeverityNumber severity_number = 2; + */ + protected $severity_number = 0; + /** + * The severity text (also known as log level). The original string representation as + * it is known at the source. [Optional]. + * + * Generated from protobuf field string severity_text = 3; + */ + protected $severity_text = ''; + /** + * A value containing the body of the log record. Can be for example a human-readable + * string message (including multi-line) describing the event in a free form or it can + * be a structured data composed of arrays and maps of other values. [Optional]. + * + * Generated from protobuf field .opentelemetry.proto.common.v1.AnyValue body = 5; + */ + protected $body = null; + /** + * Additional attributes that describe the specific event occurrence. [Optional]. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6; + */ + private $attributes; + /** + * Generated from protobuf field uint32 dropped_attributes_count = 7; + */ + protected $dropped_attributes_count = 0; + /** + * Flags, a bit field. 8 least significant bits are the trace flags as + * defined in W3C Trace Context specification. 24 most significant bits are reserved + * and must be set to 0. Readers must not assume that 24 most significant bits + * will be zero and must correctly mask the bits when reading 8-bit trace flag (use + * flags & LOG_RECORD_FLAGS_TRACE_FLAGS_MASK). [Optional]. + * + * Generated from protobuf field fixed32 flags = 8; + */ + protected $flags = 0; + /** + * A unique identifier for a trace. All logs from the same trace share + * the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes OR + * of length other than 16 bytes is considered invalid (empty string in OTLP/JSON + * is zero-length and thus is also invalid). + * This field is optional. + * The receivers SHOULD assume that the log record is not associated with a + * trace if any of the following is true: + * - the field is not present, + * - the field contains an invalid value. + * + * Generated from protobuf field bytes trace_id = 9; + */ + protected $trace_id = ''; + /** + * A unique identifier for a span within a trace, assigned when the span + * is created. The ID is an 8-byte array. An ID with all zeroes OR of length + * other than 8 bytes is considered invalid (empty string in OTLP/JSON + * is zero-length and thus is also invalid). + * This field is optional. If the sender specifies a valid span_id then it SHOULD also + * specify a valid trace_id. + * The receivers SHOULD assume that the log record is not associated with a + * span if any of the following is true: + * - the field is not present, + * - the field contains an invalid value. + * + * Generated from protobuf field bytes span_id = 10; + */ + protected $span_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $time_unix_nano + * time_unix_nano is the time when the event occurred. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * Value of 0 indicates unknown or missing timestamp. + * @type int|string $observed_time_unix_nano + * Time when the event was observed by the collection system. + * For events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK) + * this timestamp is typically set at the generation time and is equal to Timestamp. + * For events originating externally and collected by OpenTelemetry (e.g. using + * Collector) this is the time when OpenTelemetry's code observed the event measured + * by the clock of the OpenTelemetry code. This field MUST be set once the event is + * observed by OpenTelemetry. + * For converting OpenTelemetry log data to formats that support only one timestamp or + * when receiving OpenTelemetry log data by recipients that support only one timestamp + * internally the following logic is recommended: + * - Use time_unix_nano if it is present, otherwise use observed_time_unix_nano. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * Value of 0 indicates unknown or missing timestamp. + * @type int $severity_number + * Numerical value of the severity, normalized to values described in Log Data Model. + * [Optional]. + * @type string $severity_text + * The severity text (also known as log level). The original string representation as + * it is known at the source. [Optional]. + * @type \Opentelemetry\Proto\Common\V1\AnyValue $body + * A value containing the body of the log record. Can be for example a human-readable + * string message (including multi-line) describing the event in a free form or it can + * be a structured data composed of arrays and maps of other values. [Optional]. + * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes + * Additional attributes that describe the specific event occurrence. [Optional]. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * @type int $dropped_attributes_count + * @type int $flags + * Flags, a bit field. 8 least significant bits are the trace flags as + * defined in W3C Trace Context specification. 24 most significant bits are reserved + * and must be set to 0. Readers must not assume that 24 most significant bits + * will be zero and must correctly mask the bits when reading 8-bit trace flag (use + * flags & LOG_RECORD_FLAGS_TRACE_FLAGS_MASK). [Optional]. + * @type string $trace_id + * A unique identifier for a trace. All logs from the same trace share + * the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes OR + * of length other than 16 bytes is considered invalid (empty string in OTLP/JSON + * is zero-length and thus is also invalid). + * This field is optional. + * The receivers SHOULD assume that the log record is not associated with a + * trace if any of the following is true: + * - the field is not present, + * - the field contains an invalid value. + * @type string $span_id + * A unique identifier for a span within a trace, assigned when the span + * is created. The ID is an 8-byte array. An ID with all zeroes OR of length + * other than 8 bytes is considered invalid (empty string in OTLP/JSON + * is zero-length and thus is also invalid). + * This field is optional. If the sender specifies a valid span_id then it SHOULD also + * specify a valid trace_id. + * The receivers SHOULD assume that the log record is not associated with a + * span if any of the following is true: + * - the field is not present, + * - the field contains an invalid value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Logs\V1\Logs::initOnce(); + parent::__construct($data); + } + + /** + * time_unix_nano is the time when the event occurred. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * Value of 0 indicates unknown or missing timestamp. + * + * Generated from protobuf field fixed64 time_unix_nano = 1; + * @return int|string + */ + public function getTimeUnixNano() + { + return $this->time_unix_nano; + } + + /** + * time_unix_nano is the time when the event occurred. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * Value of 0 indicates unknown or missing timestamp. + * + * Generated from protobuf field fixed64 time_unix_nano = 1; + * @param int|string $var + * @return $this + */ + public function setTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->time_unix_nano = $var; + + return $this; + } + + /** + * Time when the event was observed by the collection system. + * For events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK) + * this timestamp is typically set at the generation time and is equal to Timestamp. + * For events originating externally and collected by OpenTelemetry (e.g. using + * Collector) this is the time when OpenTelemetry's code observed the event measured + * by the clock of the OpenTelemetry code. This field MUST be set once the event is + * observed by OpenTelemetry. + * For converting OpenTelemetry log data to formats that support only one timestamp or + * when receiving OpenTelemetry log data by recipients that support only one timestamp + * internally the following logic is recommended: + * - Use time_unix_nano if it is present, otherwise use observed_time_unix_nano. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * Value of 0 indicates unknown or missing timestamp. + * + * Generated from protobuf field fixed64 observed_time_unix_nano = 11; + * @return int|string + */ + public function getObservedTimeUnixNano() + { + return $this->observed_time_unix_nano; + } + + /** + * Time when the event was observed by the collection system. + * For events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK) + * this timestamp is typically set at the generation time and is equal to Timestamp. + * For events originating externally and collected by OpenTelemetry (e.g. using + * Collector) this is the time when OpenTelemetry's code observed the event measured + * by the clock of the OpenTelemetry code. This field MUST be set once the event is + * observed by OpenTelemetry. + * For converting OpenTelemetry log data to formats that support only one timestamp or + * when receiving OpenTelemetry log data by recipients that support only one timestamp + * internally the following logic is recommended: + * - Use time_unix_nano if it is present, otherwise use observed_time_unix_nano. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * Value of 0 indicates unknown or missing timestamp. + * + * Generated from protobuf field fixed64 observed_time_unix_nano = 11; + * @param int|string $var + * @return $this + */ + public function setObservedTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->observed_time_unix_nano = $var; + + return $this; + } + + /** + * Numerical value of the severity, normalized to values described in Log Data Model. + * [Optional]. + * + * Generated from protobuf field .opentelemetry.proto.logs.v1.SeverityNumber severity_number = 2; + * @return int + */ + public function getSeverityNumber() + { + return $this->severity_number; + } + + /** + * Numerical value of the severity, normalized to values described in Log Data Model. + * [Optional]. + * + * Generated from protobuf field .opentelemetry.proto.logs.v1.SeverityNumber severity_number = 2; + * @param int $var + * @return $this + */ + public function setSeverityNumber($var) + { + GPBUtil::checkEnum($var, \Opentelemetry\Proto\Logs\V1\SeverityNumber::class); + $this->severity_number = $var; + + return $this; + } + + /** + * The severity text (also known as log level). The original string representation as + * it is known at the source. [Optional]. + * + * Generated from protobuf field string severity_text = 3; + * @return string + */ + public function getSeverityText() + { + return $this->severity_text; + } + + /** + * The severity text (also known as log level). The original string representation as + * it is known at the source. [Optional]. + * + * Generated from protobuf field string severity_text = 3; + * @param string $var + * @return $this + */ + public function setSeverityText($var) + { + GPBUtil::checkString($var, True); + $this->severity_text = $var; + + return $this; + } + + /** + * A value containing the body of the log record. Can be for example a human-readable + * string message (including multi-line) describing the event in a free form or it can + * be a structured data composed of arrays and maps of other values. [Optional]. + * + * Generated from protobuf field .opentelemetry.proto.common.v1.AnyValue body = 5; + * @return \Opentelemetry\Proto\Common\V1\AnyValue|null + */ + public function getBody() + { + return $this->body; + } + + public function hasBody() + { + return isset($this->body); + } + + public function clearBody() + { + unset($this->body); + } + + /** + * A value containing the body of the log record. Can be for example a human-readable + * string message (including multi-line) describing the event in a free form or it can + * be a structured data composed of arrays and maps of other values. [Optional]. + * + * Generated from protobuf field .opentelemetry.proto.common.v1.AnyValue body = 5; + * @param \Opentelemetry\Proto\Common\V1\AnyValue $var + * @return $this + */ + public function setBody($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\AnyValue::class); + $this->body = $var; + + return $this; + } + + /** + * Additional attributes that describe the specific event occurrence. [Optional]. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Additional attributes that describe the specific event occurrence. [Optional]. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6; + * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class); + $this->attributes = $arr; + + return $this; + } + + /** + * Generated from protobuf field uint32 dropped_attributes_count = 7; + * @return int + */ + public function getDroppedAttributesCount() + { + return $this->dropped_attributes_count; + } + + /** + * Generated from protobuf field uint32 dropped_attributes_count = 7; + * @param int $var + * @return $this + */ + public function setDroppedAttributesCount($var) + { + GPBUtil::checkUint32($var); + $this->dropped_attributes_count = $var; + + return $this; + } + + /** + * Flags, a bit field. 8 least significant bits are the trace flags as + * defined in W3C Trace Context specification. 24 most significant bits are reserved + * and must be set to 0. Readers must not assume that 24 most significant bits + * will be zero and must correctly mask the bits when reading 8-bit trace flag (use + * flags & LOG_RECORD_FLAGS_TRACE_FLAGS_MASK). [Optional]. + * + * Generated from protobuf field fixed32 flags = 8; + * @return int + */ + public function getFlags() + { + return $this->flags; + } + + /** + * Flags, a bit field. 8 least significant bits are the trace flags as + * defined in W3C Trace Context specification. 24 most significant bits are reserved + * and must be set to 0. Readers must not assume that 24 most significant bits + * will be zero and must correctly mask the bits when reading 8-bit trace flag (use + * flags & LOG_RECORD_FLAGS_TRACE_FLAGS_MASK). [Optional]. + * + * Generated from protobuf field fixed32 flags = 8; + * @param int $var + * @return $this + */ + public function setFlags($var) + { + GPBUtil::checkUint32($var); + $this->flags = $var; + + return $this; + } + + /** + * A unique identifier for a trace. All logs from the same trace share + * the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes OR + * of length other than 16 bytes is considered invalid (empty string in OTLP/JSON + * is zero-length and thus is also invalid). + * This field is optional. + * The receivers SHOULD assume that the log record is not associated with a + * trace if any of the following is true: + * - the field is not present, + * - the field contains an invalid value. + * + * Generated from protobuf field bytes trace_id = 9; + * @return string + */ + public function getTraceId() + { + return $this->trace_id; + } + + /** + * A unique identifier for a trace. All logs from the same trace share + * the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes OR + * of length other than 16 bytes is considered invalid (empty string in OTLP/JSON + * is zero-length and thus is also invalid). + * This field is optional. + * The receivers SHOULD assume that the log record is not associated with a + * trace if any of the following is true: + * - the field is not present, + * - the field contains an invalid value. + * + * Generated from protobuf field bytes trace_id = 9; + * @param string $var + * @return $this + */ + public function setTraceId($var) + { + GPBUtil::checkString($var, False); + $this->trace_id = $var; + + return $this; + } + + /** + * A unique identifier for a span within a trace, assigned when the span + * is created. The ID is an 8-byte array. An ID with all zeroes OR of length + * other than 8 bytes is considered invalid (empty string in OTLP/JSON + * is zero-length and thus is also invalid). + * This field is optional. If the sender specifies a valid span_id then it SHOULD also + * specify a valid trace_id. + * The receivers SHOULD assume that the log record is not associated with a + * span if any of the following is true: + * - the field is not present, + * - the field contains an invalid value. + * + * Generated from protobuf field bytes span_id = 10; + * @return string + */ + public function getSpanId() + { + return $this->span_id; + } + + /** + * A unique identifier for a span within a trace, assigned when the span + * is created. The ID is an 8-byte array. An ID with all zeroes OR of length + * other than 8 bytes is considered invalid (empty string in OTLP/JSON + * is zero-length and thus is also invalid). + * This field is optional. If the sender specifies a valid span_id then it SHOULD also + * specify a valid trace_id. + * The receivers SHOULD assume that the log record is not associated with a + * span if any of the following is true: + * - the field is not present, + * - the field contains an invalid value. + * + * Generated from protobuf field bytes span_id = 10; + * @param string $var + * @return $this + */ + public function setSpanId($var) + { + GPBUtil::checkString($var, False); + $this->span_id = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/LogRecordFlags.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/LogRecordFlags.php new file mode 100644 index 000000000..de6f38899 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/LogRecordFlags.php @@ -0,0 +1,58 @@ +opentelemetry.proto.logs.v1.LogRecordFlags + */ +class LogRecordFlags +{ + /** + * The zero value for the enum. Should not be used for comparisons. + * Instead use bitwise "and" with the appropriate mask as shown above. + * + * Generated from protobuf enum LOG_RECORD_FLAGS_DO_NOT_USE = 0; + */ + const LOG_RECORD_FLAGS_DO_NOT_USE = 0; + /** + * Bits 0-7 are used for trace flags. + * + * Generated from protobuf enum LOG_RECORD_FLAGS_TRACE_FLAGS_MASK = 255; + */ + const LOG_RECORD_FLAGS_TRACE_FLAGS_MASK = 255; + + private static $valueToName = [ + self::LOG_RECORD_FLAGS_DO_NOT_USE => 'LOG_RECORD_FLAGS_DO_NOT_USE', + self::LOG_RECORD_FLAGS_TRACE_FLAGS_MASK => 'LOG_RECORD_FLAGS_TRACE_FLAGS_MASK', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/LogsData.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/LogsData.php new file mode 100644 index 000000000..90db06035 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/LogsData.php @@ -0,0 +1,90 @@ +opentelemetry.proto.logs.v1.LogsData + */ +class LogsData extends \Google\Protobuf\Internal\Message +{ + /** + * An array of ResourceLogs. + * For data coming from a single resource this array will typically contain + * one element. Intermediary nodes that receive data from multiple origins + * typically batch the data before forwarding further and in that case this + * array will contain multiple elements. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.ResourceLogs resource_logs = 1; + */ + private $resource_logs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Logs\V1\ResourceLogs[]|\Google\Protobuf\Internal\RepeatedField $resource_logs + * An array of ResourceLogs. + * For data coming from a single resource this array will typically contain + * one element. Intermediary nodes that receive data from multiple origins + * typically batch the data before forwarding further and in that case this + * array will contain multiple elements. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Logs\V1\Logs::initOnce(); + parent::__construct($data); + } + + /** + * An array of ResourceLogs. + * For data coming from a single resource this array will typically contain + * one element. Intermediary nodes that receive data from multiple origins + * typically batch the data before forwarding further and in that case this + * array will contain multiple elements. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.ResourceLogs resource_logs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceLogs() + { + return $this->resource_logs; + } + + /** + * An array of ResourceLogs. + * For data coming from a single resource this array will typically contain + * one element. Intermediary nodes that receive data from multiple origins + * typically batch the data before forwarding further and in that case this + * array will contain multiple elements. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.ResourceLogs resource_logs = 1; + * @param \Opentelemetry\Proto\Logs\V1\ResourceLogs[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceLogs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Logs\V1\ResourceLogs::class); + $this->resource_logs = $arr; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/ResourceLogs.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/ResourceLogs.php new file mode 100644 index 000000000..2049339d4 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/ResourceLogs.php @@ -0,0 +1,153 @@ +opentelemetry.proto.logs.v1.ResourceLogs + */ +class ResourceLogs extends \Google\Protobuf\Internal\Message +{ + /** + * The resource for the logs in this message. + * If this field is not set then resource info is unknown. + * + * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; + */ + protected $resource = null; + /** + * A list of ScopeLogs that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.ScopeLogs scope_logs = 2; + */ + private $scope_logs; + /** + * This schema_url applies to the data in the "resource" field. It does not apply + * to the data in the "scope_logs" field which have their own schema_url field. + * + * Generated from protobuf field string schema_url = 3; + */ + protected $schema_url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Resource\V1\Resource $resource + * The resource for the logs in this message. + * If this field is not set then resource info is unknown. + * @type \Opentelemetry\Proto\Logs\V1\ScopeLogs[]|\Google\Protobuf\Internal\RepeatedField $scope_logs + * A list of ScopeLogs that originate from a resource. + * @type string $schema_url + * This schema_url applies to the data in the "resource" field. It does not apply + * to the data in the "scope_logs" field which have their own schema_url field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Logs\V1\Logs::initOnce(); + parent::__construct($data); + } + + /** + * The resource for the logs in this message. + * If this field is not set then resource info is unknown. + * + * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; + * @return \Opentelemetry\Proto\Resource\V1\Resource|null + */ + public function getResource() + { + return $this->resource; + } + + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + + /** + * The resource for the logs in this message. + * If this field is not set then resource info is unknown. + * + * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; + * @param \Opentelemetry\Proto\Resource\V1\Resource $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Resource\V1\Resource::class); + $this->resource = $var; + + return $this; + } + + /** + * A list of ScopeLogs that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.ScopeLogs scope_logs = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScopeLogs() + { + return $this->scope_logs; + } + + /** + * A list of ScopeLogs that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.ScopeLogs scope_logs = 2; + * @param \Opentelemetry\Proto\Logs\V1\ScopeLogs[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopeLogs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Logs\V1\ScopeLogs::class); + $this->scope_logs = $arr; + + return $this; + } + + /** + * This schema_url applies to the data in the "resource" field. It does not apply + * to the data in the "scope_logs" field which have their own schema_url field. + * + * Generated from protobuf field string schema_url = 3; + * @return string + */ + public function getSchemaUrl() + { + return $this->schema_url; + } + + /** + * This schema_url applies to the data in the "resource" field. It does not apply + * to the data in the "scope_logs" field which have their own schema_url field. + * + * Generated from protobuf field string schema_url = 3; + * @param string $var + * @return $this + */ + public function setSchemaUrl($var) + { + GPBUtil::checkString($var, True); + $this->schema_url = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/ScopeLogs.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/ScopeLogs.php new file mode 100644 index 000000000..8c5a94821 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/ScopeLogs.php @@ -0,0 +1,153 @@ +opentelemetry.proto.logs.v1.ScopeLogs + */ +class ScopeLogs extends \Google\Protobuf\Internal\Message +{ + /** + * The instrumentation scope information for the logs in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationScope scope = 1; + */ + protected $scope = null; + /** + * A list of log records. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord log_records = 2; + */ + private $log_records; + /** + * This schema_url applies to all logs in the "logs" field. + * + * Generated from protobuf field string schema_url = 3; + */ + protected $schema_url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\InstrumentationScope $scope + * The instrumentation scope information for the logs in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * @type \Opentelemetry\Proto\Logs\V1\LogRecord[]|\Google\Protobuf\Internal\RepeatedField $log_records + * A list of log records. + * @type string $schema_url + * This schema_url applies to all logs in the "logs" field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Logs\V1\Logs::initOnce(); + parent::__construct($data); + } + + /** + * The instrumentation scope information for the logs in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationScope scope = 1; + * @return \Opentelemetry\Proto\Common\V1\InstrumentationScope|null + */ + public function getScope() + { + return $this->scope; + } + + public function hasScope() + { + return isset($this->scope); + } + + public function clearScope() + { + unset($this->scope); + } + + /** + * The instrumentation scope information for the logs in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationScope scope = 1; + * @param \Opentelemetry\Proto\Common\V1\InstrumentationScope $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\InstrumentationScope::class); + $this->scope = $var; + + return $this; + } + + /** + * A list of log records. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord log_records = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLogRecords() + { + return $this->log_records; + } + + /** + * A list of log records. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord log_records = 2; + * @param \Opentelemetry\Proto\Logs\V1\LogRecord[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLogRecords($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Logs\V1\LogRecord::class); + $this->log_records = $arr; + + return $this; + } + + /** + * This schema_url applies to all logs in the "logs" field. + * + * Generated from protobuf field string schema_url = 3; + * @return string + */ + public function getSchemaUrl() + { + return $this->schema_url; + } + + /** + * This schema_url applies to all logs in the "logs" field. + * + * Generated from protobuf field string schema_url = 3; + * @param string $var + * @return $this + */ + public function setSchemaUrl($var) + { + GPBUtil::checkString($var, True); + $this->schema_url = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/SeverityNumber.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/SeverityNumber.php new file mode 100644 index 000000000..ad89442b0 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Logs/V1/SeverityNumber.php @@ -0,0 +1,167 @@ +opentelemetry.proto.logs.v1.SeverityNumber + */ +class SeverityNumber +{ + /** + * UNSPECIFIED is the default SeverityNumber, it MUST NOT be used. + * + * Generated from protobuf enum SEVERITY_NUMBER_UNSPECIFIED = 0; + */ + const SEVERITY_NUMBER_UNSPECIFIED = 0; + /** + * Generated from protobuf enum SEVERITY_NUMBER_TRACE = 1; + */ + const SEVERITY_NUMBER_TRACE = 1; + /** + * Generated from protobuf enum SEVERITY_NUMBER_TRACE2 = 2; + */ + const SEVERITY_NUMBER_TRACE2 = 2; + /** + * Generated from protobuf enum SEVERITY_NUMBER_TRACE3 = 3; + */ + const SEVERITY_NUMBER_TRACE3 = 3; + /** + * Generated from protobuf enum SEVERITY_NUMBER_TRACE4 = 4; + */ + const SEVERITY_NUMBER_TRACE4 = 4; + /** + * Generated from protobuf enum SEVERITY_NUMBER_DEBUG = 5; + */ + const SEVERITY_NUMBER_DEBUG = 5; + /** + * Generated from protobuf enum SEVERITY_NUMBER_DEBUG2 = 6; + */ + const SEVERITY_NUMBER_DEBUG2 = 6; + /** + * Generated from protobuf enum SEVERITY_NUMBER_DEBUG3 = 7; + */ + const SEVERITY_NUMBER_DEBUG3 = 7; + /** + * Generated from protobuf enum SEVERITY_NUMBER_DEBUG4 = 8; + */ + const SEVERITY_NUMBER_DEBUG4 = 8; + /** + * Generated from protobuf enum SEVERITY_NUMBER_INFO = 9; + */ + const SEVERITY_NUMBER_INFO = 9; + /** + * Generated from protobuf enum SEVERITY_NUMBER_INFO2 = 10; + */ + const SEVERITY_NUMBER_INFO2 = 10; + /** + * Generated from protobuf enum SEVERITY_NUMBER_INFO3 = 11; + */ + const SEVERITY_NUMBER_INFO3 = 11; + /** + * Generated from protobuf enum SEVERITY_NUMBER_INFO4 = 12; + */ + const SEVERITY_NUMBER_INFO4 = 12; + /** + * Generated from protobuf enum SEVERITY_NUMBER_WARN = 13; + */ + const SEVERITY_NUMBER_WARN = 13; + /** + * Generated from protobuf enum SEVERITY_NUMBER_WARN2 = 14; + */ + const SEVERITY_NUMBER_WARN2 = 14; + /** + * Generated from protobuf enum SEVERITY_NUMBER_WARN3 = 15; + */ + const SEVERITY_NUMBER_WARN3 = 15; + /** + * Generated from protobuf enum SEVERITY_NUMBER_WARN4 = 16; + */ + const SEVERITY_NUMBER_WARN4 = 16; + /** + * Generated from protobuf enum SEVERITY_NUMBER_ERROR = 17; + */ + const SEVERITY_NUMBER_ERROR = 17; + /** + * Generated from protobuf enum SEVERITY_NUMBER_ERROR2 = 18; + */ + const SEVERITY_NUMBER_ERROR2 = 18; + /** + * Generated from protobuf enum SEVERITY_NUMBER_ERROR3 = 19; + */ + const SEVERITY_NUMBER_ERROR3 = 19; + /** + * Generated from protobuf enum SEVERITY_NUMBER_ERROR4 = 20; + */ + const SEVERITY_NUMBER_ERROR4 = 20; + /** + * Generated from protobuf enum SEVERITY_NUMBER_FATAL = 21; + */ + const SEVERITY_NUMBER_FATAL = 21; + /** + * Generated from protobuf enum SEVERITY_NUMBER_FATAL2 = 22; + */ + const SEVERITY_NUMBER_FATAL2 = 22; + /** + * Generated from protobuf enum SEVERITY_NUMBER_FATAL3 = 23; + */ + const SEVERITY_NUMBER_FATAL3 = 23; + /** + * Generated from protobuf enum SEVERITY_NUMBER_FATAL4 = 24; + */ + const SEVERITY_NUMBER_FATAL4 = 24; + + private static $valueToName = [ + self::SEVERITY_NUMBER_UNSPECIFIED => 'SEVERITY_NUMBER_UNSPECIFIED', + self::SEVERITY_NUMBER_TRACE => 'SEVERITY_NUMBER_TRACE', + self::SEVERITY_NUMBER_TRACE2 => 'SEVERITY_NUMBER_TRACE2', + self::SEVERITY_NUMBER_TRACE3 => 'SEVERITY_NUMBER_TRACE3', + self::SEVERITY_NUMBER_TRACE4 => 'SEVERITY_NUMBER_TRACE4', + self::SEVERITY_NUMBER_DEBUG => 'SEVERITY_NUMBER_DEBUG', + self::SEVERITY_NUMBER_DEBUG2 => 'SEVERITY_NUMBER_DEBUG2', + self::SEVERITY_NUMBER_DEBUG3 => 'SEVERITY_NUMBER_DEBUG3', + self::SEVERITY_NUMBER_DEBUG4 => 'SEVERITY_NUMBER_DEBUG4', + self::SEVERITY_NUMBER_INFO => 'SEVERITY_NUMBER_INFO', + self::SEVERITY_NUMBER_INFO2 => 'SEVERITY_NUMBER_INFO2', + self::SEVERITY_NUMBER_INFO3 => 'SEVERITY_NUMBER_INFO3', + self::SEVERITY_NUMBER_INFO4 => 'SEVERITY_NUMBER_INFO4', + self::SEVERITY_NUMBER_WARN => 'SEVERITY_NUMBER_WARN', + self::SEVERITY_NUMBER_WARN2 => 'SEVERITY_NUMBER_WARN2', + self::SEVERITY_NUMBER_WARN3 => 'SEVERITY_NUMBER_WARN3', + self::SEVERITY_NUMBER_WARN4 => 'SEVERITY_NUMBER_WARN4', + self::SEVERITY_NUMBER_ERROR => 'SEVERITY_NUMBER_ERROR', + self::SEVERITY_NUMBER_ERROR2 => 'SEVERITY_NUMBER_ERROR2', + self::SEVERITY_NUMBER_ERROR3 => 'SEVERITY_NUMBER_ERROR3', + self::SEVERITY_NUMBER_ERROR4 => 'SEVERITY_NUMBER_ERROR4', + self::SEVERITY_NUMBER_FATAL => 'SEVERITY_NUMBER_FATAL', + self::SEVERITY_NUMBER_FATAL2 => 'SEVERITY_NUMBER_FATAL2', + self::SEVERITY_NUMBER_FATAL3 => 'SEVERITY_NUMBER_FATAL3', + self::SEVERITY_NUMBER_FATAL4 => 'SEVERITY_NUMBER_FATAL4', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigRequest.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigRequest.php new file mode 100644 index 000000000..bdf9ea2fa --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigRequest.php @@ -0,0 +1,113 @@ +opentelemetry.proto.metrics.experimental.MetricConfigRequest + */ +class MetricConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource for which configuration should be returned. + * + * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; + */ + protected $resource = null; + /** + * Optional. The value of MetricConfigResponse.fingerprint for the last + * configuration that the caller received and successfully applied. + * + * Generated from protobuf field bytes last_known_fingerprint = 2; + */ + protected $last_known_fingerprint = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Resource\V1\Resource $resource + * Required. The resource for which configuration should be returned. + * @type string $last_known_fingerprint + * Optional. The value of MetricConfigResponse.fingerprint for the last + * configuration that the caller received and successfully applied. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\Experimental\MetricsConfigService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource for which configuration should be returned. + * + * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; + * @return \Opentelemetry\Proto\Resource\V1\Resource + */ + public function getResource() + { + return isset($this->resource) ? $this->resource : null; + } + + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + + /** + * Required. The resource for which configuration should be returned. + * + * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; + * @param \Opentelemetry\Proto\Resource\V1\Resource $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Resource\V1\Resource::class); + $this->resource = $var; + + return $this; + } + + /** + * Optional. The value of MetricConfigResponse.fingerprint for the last + * configuration that the caller received and successfully applied. + * + * Generated from protobuf field bytes last_known_fingerprint = 2; + * @return string + */ + public function getLastKnownFingerprint() + { + return $this->last_known_fingerprint; + } + + /** + * Optional. The value of MetricConfigResponse.fingerprint for the last + * configuration that the caller received and successfully applied. + * + * Generated from protobuf field bytes last_known_fingerprint = 2; + * @param string $var + * @return $this + */ + public function setLastKnownFingerprint($var) + { + GPBUtil::checkString($var, False); + $this->last_known_fingerprint = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse.php new file mode 100644 index 000000000..0993a59ea --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse.php @@ -0,0 +1,201 @@ +opentelemetry.proto.metrics.experimental.MetricConfigResponse + */ +class MetricConfigResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The fingerprint associated with this MetricConfigResponse. Each + * change in configs yields a different fingerprint. The resource SHOULD copy + * this value to MetricConfigRequest.last_known_fingerprint for the next + * configuration request. If there are no changes between fingerprint and + * MetricConfigRequest.last_known_fingerprint, then all other fields besides + * fingerprint in the response are optional, or the same as the last update if + * present. + * The exact mechanics of generating the fingerprint is up to the + * implementation. However, a fingerprint must be deterministically determined + * by the configurations -- the same configuration will generate the same + * fingerprint on any instance of an implementation. Hence using a timestamp is + * unacceptable, but a deterministic hash is fine. + * + * Generated from protobuf field bytes fingerprint = 1; + */ + protected $fingerprint = ''; + /** + * A single metric may match multiple schedules. In such cases, the schedule + * that specifies the smallest period is applied. + * Note, for optimization purposes, it is recommended to use as few schedules + * as possible to capture all required metric updates. Where you can be + * conservative, do take full advantage of the inclusion/exclusion patterns to + * capture as much of your targeted metrics. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule schedules = 2; + */ + private $schedules; + /** + * Optional. The client is suggested to wait this long (in seconds) before + * pinging the configuration service again. + * + * Generated from protobuf field int32 suggested_wait_time_sec = 3; + */ + protected $suggested_wait_time_sec = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $fingerprint + * Optional. The fingerprint associated with this MetricConfigResponse. Each + * change in configs yields a different fingerprint. The resource SHOULD copy + * this value to MetricConfigRequest.last_known_fingerprint for the next + * configuration request. If there are no changes between fingerprint and + * MetricConfigRequest.last_known_fingerprint, then all other fields besides + * fingerprint in the response are optional, or the same as the last update if + * present. + * The exact mechanics of generating the fingerprint is up to the + * implementation. However, a fingerprint must be deterministically determined + * by the configurations -- the same configuration will generate the same + * fingerprint on any instance of an implementation. Hence using a timestamp is + * unacceptable, but a deterministic hash is fine. + * @type \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule[]|\Google\Protobuf\Internal\RepeatedField $schedules + * A single metric may match multiple schedules. In such cases, the schedule + * that specifies the smallest period is applied. + * Note, for optimization purposes, it is recommended to use as few schedules + * as possible to capture all required metric updates. Where you can be + * conservative, do take full advantage of the inclusion/exclusion patterns to + * capture as much of your targeted metrics. + * @type int $suggested_wait_time_sec + * Optional. The client is suggested to wait this long (in seconds) before + * pinging the configuration service again. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\Experimental\MetricsConfigService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The fingerprint associated with this MetricConfigResponse. Each + * change in configs yields a different fingerprint. The resource SHOULD copy + * this value to MetricConfigRequest.last_known_fingerprint for the next + * configuration request. If there are no changes between fingerprint and + * MetricConfigRequest.last_known_fingerprint, then all other fields besides + * fingerprint in the response are optional, or the same as the last update if + * present. + * The exact mechanics of generating the fingerprint is up to the + * implementation. However, a fingerprint must be deterministically determined + * by the configurations -- the same configuration will generate the same + * fingerprint on any instance of an implementation. Hence using a timestamp is + * unacceptable, but a deterministic hash is fine. + * + * Generated from protobuf field bytes fingerprint = 1; + * @return string + */ + public function getFingerprint() + { + return $this->fingerprint; + } + + /** + * Optional. The fingerprint associated with this MetricConfigResponse. Each + * change in configs yields a different fingerprint. The resource SHOULD copy + * this value to MetricConfigRequest.last_known_fingerprint for the next + * configuration request. If there are no changes between fingerprint and + * MetricConfigRequest.last_known_fingerprint, then all other fields besides + * fingerprint in the response are optional, or the same as the last update if + * present. + * The exact mechanics of generating the fingerprint is up to the + * implementation. However, a fingerprint must be deterministically determined + * by the configurations -- the same configuration will generate the same + * fingerprint on any instance of an implementation. Hence using a timestamp is + * unacceptable, but a deterministic hash is fine. + * + * Generated from protobuf field bytes fingerprint = 1; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, False); + $this->fingerprint = $var; + + return $this; + } + + /** + * A single metric may match multiple schedules. In such cases, the schedule + * that specifies the smallest period is applied. + * Note, for optimization purposes, it is recommended to use as few schedules + * as possible to capture all required metric updates. Where you can be + * conservative, do take full advantage of the inclusion/exclusion patterns to + * capture as much of your targeted metrics. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule schedules = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSchedules() + { + return $this->schedules; + } + + /** + * A single metric may match multiple schedules. In such cases, the schedule + * that specifies the smallest period is applied. + * Note, for optimization purposes, it is recommended to use as few schedules + * as possible to capture all required metric updates. Where you can be + * conservative, do take full advantage of the inclusion/exclusion patterns to + * capture as much of your targeted metrics. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule schedules = 2; + * @param \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSchedules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule::class); + $this->schedules = $arr; + + return $this; + } + + /** + * Optional. The client is suggested to wait this long (in seconds) before + * pinging the configuration service again. + * + * Generated from protobuf field int32 suggested_wait_time_sec = 3; + * @return int + */ + public function getSuggestedWaitTimeSec() + { + return $this->suggested_wait_time_sec; + } + + /** + * Optional. The client is suggested to wait this long (in seconds) before + * pinging the configuration service again. + * + * Generated from protobuf field int32 suggested_wait_time_sec = 3; + * @param int $var + * @return $this + */ + public function setSuggestedWaitTimeSec($var) + { + GPBUtil::checkInt32($var); + $this->suggested_wait_time_sec = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule.php new file mode 100644 index 000000000..07091928d --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule.php @@ -0,0 +1,149 @@ +opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule + */ +class Schedule extends \Google\Protobuf\Internal\Message +{ + /** + * Metrics with names that match a rule in the inclusion_patterns are + * targeted by this schedule. Metrics that match the exclusion_patterns + * are not targeted for this schedule, even if they match an inclusion + * pattern. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern exclusion_patterns = 1; + */ + private $exclusion_patterns; + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern inclusion_patterns = 2; + */ + private $inclusion_patterns; + /** + * Describes the collection period for each metric in seconds. + * A period of 0 means to not export. + * + * Generated from protobuf field int32 period_sec = 3; + */ + protected $period_sec = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern[]|\Google\Protobuf\Internal\RepeatedField $exclusion_patterns + * Metrics with names that match a rule in the inclusion_patterns are + * targeted by this schedule. Metrics that match the exclusion_patterns + * are not targeted for this schedule, even if they match an inclusion + * pattern. + * @type \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern[]|\Google\Protobuf\Internal\RepeatedField $inclusion_patterns + * @type int $period_sec + * Describes the collection period for each metric in seconds. + * A period of 0 means to not export. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\Experimental\MetricsConfigService::initOnce(); + parent::__construct($data); + } + + /** + * Metrics with names that match a rule in the inclusion_patterns are + * targeted by this schedule. Metrics that match the exclusion_patterns + * are not targeted for this schedule, even if they match an inclusion + * pattern. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern exclusion_patterns = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExclusionPatterns() + { + return $this->exclusion_patterns; + } + + /** + * Metrics with names that match a rule in the inclusion_patterns are + * targeted by this schedule. Metrics that match the exclusion_patterns + * are not targeted for this schedule, even if they match an inclusion + * pattern. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern exclusion_patterns = 1; + * @param \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExclusionPatterns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern::class); + $this->exclusion_patterns = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern inclusion_patterns = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInclusionPatterns() + { + return $this->inclusion_patterns; + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern inclusion_patterns = 2; + * @param \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInclusionPatterns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern::class); + $this->inclusion_patterns = $arr; + + return $this; + } + + /** + * Describes the collection period for each metric in seconds. + * A period of 0 means to not export. + * + * Generated from protobuf field int32 period_sec = 3; + * @return int + */ + public function getPeriodSec() + { + return $this->period_sec; + } + + /** + * Describes the collection period for each metric in seconds. + * A period of 0 means to not export. + * + * Generated from protobuf field int32 period_sec = 3; + * @param int $var + * @return $this + */ + public function setPeriodSec($var) + { + GPBUtil::checkInt32($var); + $this->period_sec = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Schedule::class, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse_Schedule::class); + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule/Pattern.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule/Pattern.php new file mode 100644 index 000000000..839c097fb --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule/Pattern.php @@ -0,0 +1,113 @@ +opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern + */ +class Pattern extends \Google\Protobuf\Internal\Message +{ + protected $match; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $equals + * matches the metric name exactly + * @type string $starts_with + * prefix-matches the metric name + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\Experimental\MetricsConfigService::initOnce(); + parent::__construct($data); + } + + /** + * matches the metric name exactly + * + * Generated from protobuf field string equals = 1; + * @return string + */ + public function getEquals() + { + return $this->readOneof(1); + } + + public function hasEquals() + { + return $this->hasOneof(1); + } + + /** + * matches the metric name exactly + * + * Generated from protobuf field string equals = 1; + * @param string $var + * @return $this + */ + public function setEquals($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * prefix-matches the metric name + * + * Generated from protobuf field string starts_with = 2; + * @return string + */ + public function getStartsWith() + { + return $this->readOneof(2); + } + + public function hasStartsWith() + { + return $this->hasOneof(2); + } + + /** + * prefix-matches the metric name + * + * Generated from protobuf field string starts_with = 2; + * @param string $var + * @return $this + */ + public function setStartsWith($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getMatch() + { + return $this->whichOneof("match"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Pattern::class, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse_Schedule_Pattern::class); + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse_Schedule.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse_Schedule.php new file mode 100644 index 000000000..5486976fc --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse_Schedule.php @@ -0,0 +1,16 @@ +opentelemetry.proto.metrics.v1.AggregationTemporality + */ +class AggregationTemporality +{ + /** + * UNSPECIFIED is the default AggregationTemporality, it MUST not be used. + * + * Generated from protobuf enum AGGREGATION_TEMPORALITY_UNSPECIFIED = 0; + */ + const AGGREGATION_TEMPORALITY_UNSPECIFIED = 0; + /** + * DELTA is an AggregationTemporality for a metric aggregator which reports + * changes since last report time. Successive metrics contain aggregation of + * values from continuous and non-overlapping intervals. + * The values for a DELTA metric are based only on the time interval + * associated with one measurement cycle. There is no dependency on + * previous measurements like is the case for CUMULATIVE metrics. + * For example, consider a system measuring the number of requests that + * it receives and reports the sum of these requests every second as a + * DELTA metric: + * 1. The system starts receiving at time=t_0. + * 2. A request is received, the system measures 1 request. + * 3. A request is received, the system measures 1 request. + * 4. A request is received, the system measures 1 request. + * 5. The 1 second collection cycle ends. A metric is exported for the + * number of requests received over the interval of time t_0 to + * t_0+1 with a value of 3. + * 6. A request is received, the system measures 1 request. + * 7. A request is received, the system measures 1 request. + * 8. The 1 second collection cycle ends. A metric is exported for the + * number of requests received over the interval of time t_0+1 to + * t_0+2 with a value of 2. + * + * Generated from protobuf enum AGGREGATION_TEMPORALITY_DELTA = 1; + */ + const AGGREGATION_TEMPORALITY_DELTA = 1; + /** + * CUMULATIVE is an AggregationTemporality for a metric aggregator which + * reports changes since a fixed start time. This means that current values + * of a CUMULATIVE metric depend on all previous measurements since the + * start time. Because of this, the sender is required to retain this state + * in some form. If this state is lost or invalidated, the CUMULATIVE metric + * values MUST be reset and a new fixed start time following the last + * reported measurement time sent MUST be used. + * For example, consider a system measuring the number of requests that + * it receives and reports the sum of these requests every second as a + * CUMULATIVE metric: + * 1. The system starts receiving at time=t_0. + * 2. A request is received, the system measures 1 request. + * 3. A request is received, the system measures 1 request. + * 4. A request is received, the system measures 1 request. + * 5. The 1 second collection cycle ends. A metric is exported for the + * number of requests received over the interval of time t_0 to + * t_0+1 with a value of 3. + * 6. A request is received, the system measures 1 request. + * 7. A request is received, the system measures 1 request. + * 8. The 1 second collection cycle ends. A metric is exported for the + * number of requests received over the interval of time t_0 to + * t_0+2 with a value of 5. + * 9. The system experiences a fault and loses state. + * 10. The system recovers and resumes receiving at time=t_1. + * 11. A request is received, the system measures 1 request. + * 12. The 1 second collection cycle ends. A metric is exported for the + * number of requests received over the interval of time t_1 to + * t_0+1 with a value of 1. + * Note: Even though, when reporting changes since last report time, using + * CUMULATIVE is valid, it is not recommended. This may cause problems for + * systems that do not use start_time to determine when the aggregation + * value was reset (e.g. Prometheus). + * + * Generated from protobuf enum AGGREGATION_TEMPORALITY_CUMULATIVE = 2; + */ + const AGGREGATION_TEMPORALITY_CUMULATIVE = 2; + + private static $valueToName = [ + self::AGGREGATION_TEMPORALITY_UNSPECIFIED => 'AGGREGATION_TEMPORALITY_UNSPECIFIED', + self::AGGREGATION_TEMPORALITY_DELTA => 'AGGREGATION_TEMPORALITY_DELTA', + self::AGGREGATION_TEMPORALITY_CUMULATIVE => 'AGGREGATION_TEMPORALITY_CUMULATIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/DataPointFlags.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/DataPointFlags.php new file mode 100644 index 000000000..f11029d02 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/DataPointFlags.php @@ -0,0 +1,61 @@ +opentelemetry.proto.metrics.v1.DataPointFlags + */ +class DataPointFlags +{ + /** + * The zero value for the enum. Should not be used for comparisons. + * Instead use bitwise "and" with the appropriate mask as shown above. + * + * Generated from protobuf enum DATA_POINT_FLAGS_DO_NOT_USE = 0; + */ + const DATA_POINT_FLAGS_DO_NOT_USE = 0; + /** + * This DataPoint is valid but has no recorded value. This value + * SHOULD be used to reflect explicitly missing data in a series, as + * for an equivalent to the Prometheus "staleness marker". + * + * Generated from protobuf enum DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK = 1; + */ + const DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK = 1; + + private static $valueToName = [ + self::DATA_POINT_FLAGS_DO_NOT_USE => 'DATA_POINT_FLAGS_DO_NOT_USE', + self::DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK => 'DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Exemplar.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Exemplar.php new file mode 100644 index 000000000..a0387ede1 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Exemplar.php @@ -0,0 +1,269 @@ +opentelemetry.proto.metrics.v1.Exemplar + */ +class Exemplar extends \Google\Protobuf\Internal\Message +{ + /** + * The set of key/value pairs that were filtered out by the aggregator, but + * recorded alongside the original measurement. Only key/value pairs that were + * filtered out by the aggregator should be included + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue filtered_attributes = 7; + */ + private $filtered_attributes; + /** + * time_unix_nano is the exact time when this exemplar was recorded + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 2; + */ + protected $time_unix_nano = 0; + /** + * (Optional) Span ID of the exemplar trace. + * span_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * + * Generated from protobuf field bytes span_id = 4; + */ + protected $span_id = ''; + /** + * (Optional) Trace ID of the exemplar trace. + * trace_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * + * Generated from protobuf field bytes trace_id = 5; + */ + protected $trace_id = ''; + protected $value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $filtered_attributes + * The set of key/value pairs that were filtered out by the aggregator, but + * recorded alongside the original measurement. Only key/value pairs that were + * filtered out by the aggregator should be included + * @type int|string $time_unix_nano + * time_unix_nano is the exact time when this exemplar was recorded + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type float $as_double + * @type int|string $as_int + * @type string $span_id + * (Optional) Span ID of the exemplar trace. + * span_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * @type string $trace_id + * (Optional) Trace ID of the exemplar trace. + * trace_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * The set of key/value pairs that were filtered out by the aggregator, but + * recorded alongside the original measurement. Only key/value pairs that were + * filtered out by the aggregator should be included + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue filtered_attributes = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFilteredAttributes() + { + return $this->filtered_attributes; + } + + /** + * The set of key/value pairs that were filtered out by the aggregator, but + * recorded alongside the original measurement. Only key/value pairs that were + * filtered out by the aggregator should be included + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue filtered_attributes = 7; + * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFilteredAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class); + $this->filtered_attributes = $arr; + + return $this; + } + + /** + * time_unix_nano is the exact time when this exemplar was recorded + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 2; + * @return int|string + */ + public function getTimeUnixNano() + { + return $this->time_unix_nano; + } + + /** + * time_unix_nano is the exact time when this exemplar was recorded + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 2; + * @param int|string $var + * @return $this + */ + public function setTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->time_unix_nano = $var; + + return $this; + } + + /** + * Generated from protobuf field double as_double = 3; + * @return float + */ + public function getAsDouble() + { + return $this->readOneof(3); + } + + public function hasAsDouble() + { + return $this->hasOneof(3); + } + + /** + * Generated from protobuf field double as_double = 3; + * @param float $var + * @return $this + */ + public function setAsDouble($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Generated from protobuf field sfixed64 as_int = 6; + * @return int|string + */ + public function getAsInt() + { + return $this->readOneof(6); + } + + public function hasAsInt() + { + return $this->hasOneof(6); + } + + /** + * Generated from protobuf field sfixed64 as_int = 6; + * @param int|string $var + * @return $this + */ + public function setAsInt($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * (Optional) Span ID of the exemplar trace. + * span_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * + * Generated from protobuf field bytes span_id = 4; + * @return string + */ + public function getSpanId() + { + return $this->span_id; + } + + /** + * (Optional) Span ID of the exemplar trace. + * span_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * + * Generated from protobuf field bytes span_id = 4; + * @param string $var + * @return $this + */ + public function setSpanId($var) + { + GPBUtil::checkString($var, False); + $this->span_id = $var; + + return $this; + } + + /** + * (Optional) Trace ID of the exemplar trace. + * trace_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * + * Generated from protobuf field bytes trace_id = 5; + * @return string + */ + public function getTraceId() + { + return $this->trace_id; + } + + /** + * (Optional) Trace ID of the exemplar trace. + * trace_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * + * Generated from protobuf field bytes trace_id = 5; + * @param string $var + * @return $this + */ + public function setTraceId($var) + { + GPBUtil::checkString($var, False); + $this->trace_id = $var; + + return $this; + } + + /** + * @return string + */ + public function getValue() + { + return $this->whichOneof("value"); + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ExponentialHistogram.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ExponentialHistogram.php new file mode 100644 index 000000000..2a5c4cc90 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ExponentialHistogram.php @@ -0,0 +1,99 @@ +opentelemetry.proto.metrics.v1.ExponentialHistogram + */ +class ExponentialHistogram extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint data_points = 1; + */ + private $data_points; + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + */ + protected $aggregation_temporality = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points + * @type int $aggregation_temporality + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint data_points = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataPoints() + { + return $this->data_points; + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint data_points = 1; + * @param \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint::class); + $this->data_points = $arr; + + return $this; + } + + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + * @return int + */ + public function getAggregationTemporality() + { + return $this->aggregation_temporality; + } + + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + * @param int $var + * @return $this + */ + public function setAggregationTemporality($var) + { + GPBUtil::checkEnum($var, \Opentelemetry\Proto\Metrics\V1\AggregationTemporality::class); + $this->aggregation_temporality = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint.php new file mode 100644 index 000000000..62cb6f5d6 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint.php @@ -0,0 +1,718 @@ +opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + */ +class ExponentialHistogramDataPoint extends \Google\Protobuf\Internal\Message +{ + /** + * The set of key/value pairs that uniquely identify the timeseries from + * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 1; + */ + private $attributes; + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + */ + protected $start_time_unix_nano = 0; + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + */ + protected $time_unix_nano = 0; + /** + * count is the number of values in the population. Must be + * non-negative. This value must be equal to the sum of the "bucket_counts" + * values in the positive and negative Buckets plus the "zero_count" field. + * + * Generated from protobuf field fixed64 count = 4; + */ + protected $count = 0; + /** + * sum of the values in the population. If count is zero then this field + * must be zero. + * Note: Sum should only be filled out when measuring non-negative discrete + * events, and is assumed to be monotonic over the values of these events. + * Negative events *can* be recorded, but sum should not be filled out when + * doing so. This is specifically to enforce compatibility w/ OpenMetrics, + * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram + * + * Generated from protobuf field optional double sum = 5; + */ + protected $sum = null; + /** + * scale describes the resolution of the histogram. Boundaries are + * located at powers of the base, where: + * base = (2^(2^-scale)) + * The histogram bucket identified by `index`, a signed integer, + * contains values that are greater than (base^index) and + * less than or equal to (base^(index+1)). + * The positive and negative ranges of the histogram are expressed + * separately. Negative values are mapped by their absolute value + * into the negative range using the same scale as the positive range. + * scale is not restricted by the protocol, as the permissible + * values depend on the range of the data. + * + * Generated from protobuf field sint32 scale = 6; + */ + protected $scale = 0; + /** + * zero_count is the count of values that are either exactly zero or + * within the region considered zero by the instrumentation at the + * tolerated degree of precision. This bucket stores values that + * cannot be expressed using the standard exponential formula as + * well as values that have been rounded to zero. + * Implementations MAY consider the zero bucket to have probability + * mass equal to (zero_count / count). + * + * Generated from protobuf field fixed64 zero_count = 7; + */ + protected $zero_count = 0; + /** + * positive carries the positive range of exponential bucket counts. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets positive = 8; + */ + protected $positive = null; + /** + * negative carries the negative range of exponential bucket counts. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets negative = 9; + */ + protected $negative = null; + /** + * Flags that apply to this specific data point. See DataPointFlags + * for the available flags and their meaning. + * + * Generated from protobuf field uint32 flags = 10; + */ + protected $flags = 0; + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.Exemplar exemplars = 11; + */ + private $exemplars; + /** + * min is the minimum value over (start_time, end_time]. + * + * Generated from protobuf field optional double min = 12; + */ + protected $min = null; + /** + * max is the maximum value over (start_time, end_time]. + * + * Generated from protobuf field optional double max = 13; + */ + protected $max = null; + /** + * ZeroThreshold may be optionally set to convey the width of the zero + * region. Where the zero region is defined as the closed interval + * [-ZeroThreshold, ZeroThreshold]. + * When ZeroThreshold is 0, zero count bucket stores values that cannot be + * expressed using the standard exponential formula as well as values that + * have been rounded to zero. + * + * Generated from protobuf field double zero_threshold = 14; + */ + protected $zero_threshold = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes + * The set of key/value pairs that uniquely identify the timeseries from + * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * @type int|string $start_time_unix_nano + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type int|string $time_unix_nano + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type int|string $count + * count is the number of values in the population. Must be + * non-negative. This value must be equal to the sum of the "bucket_counts" + * values in the positive and negative Buckets plus the "zero_count" field. + * @type float $sum + * sum of the values in the population. If count is zero then this field + * must be zero. + * Note: Sum should only be filled out when measuring non-negative discrete + * events, and is assumed to be monotonic over the values of these events. + * Negative events *can* be recorded, but sum should not be filled out when + * doing so. This is specifically to enforce compatibility w/ OpenMetrics, + * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram + * @type int $scale + * scale describes the resolution of the histogram. Boundaries are + * located at powers of the base, where: + * base = (2^(2^-scale)) + * The histogram bucket identified by `index`, a signed integer, + * contains values that are greater than (base^index) and + * less than or equal to (base^(index+1)). + * The positive and negative ranges of the histogram are expressed + * separately. Negative values are mapped by their absolute value + * into the negative range using the same scale as the positive range. + * scale is not restricted by the protocol, as the permissible + * values depend on the range of the data. + * @type int|string $zero_count + * zero_count is the count of values that are either exactly zero or + * within the region considered zero by the instrumentation at the + * tolerated degree of precision. This bucket stores values that + * cannot be expressed using the standard exponential formula as + * well as values that have been rounded to zero. + * Implementations MAY consider the zero bucket to have probability + * mass equal to (zero_count / count). + * @type \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint\Buckets $positive + * positive carries the positive range of exponential bucket counts. + * @type \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint\Buckets $negative + * negative carries the negative range of exponential bucket counts. + * @type int $flags + * Flags that apply to this specific data point. See DataPointFlags + * for the available flags and their meaning. + * @type \Opentelemetry\Proto\Metrics\V1\Exemplar[]|\Google\Protobuf\Internal\RepeatedField $exemplars + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * @type float $min + * min is the minimum value over (start_time, end_time]. + * @type float $max + * max is the maximum value over (start_time, end_time]. + * @type float $zero_threshold + * ZeroThreshold may be optionally set to convey the width of the zero + * region. Where the zero region is defined as the closed interval + * [-ZeroThreshold, ZeroThreshold]. + * When ZeroThreshold is 0, zero count bucket stores values that cannot be + * expressed using the standard exponential formula as well as values that + * have been rounded to zero. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * The set of key/value pairs that uniquely identify the timeseries from + * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * The set of key/value pairs that uniquely identify the timeseries from + * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 1; + * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class); + $this->attributes = $arr; + + return $this; + } + + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + * @return int|string + */ + public function getStartTimeUnixNano() + { + return $this->start_time_unix_nano; + } + + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + * @param int|string $var + * @return $this + */ + public function setStartTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->start_time_unix_nano = $var; + + return $this; + } + + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + * @return int|string + */ + public function getTimeUnixNano() + { + return $this->time_unix_nano; + } + + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + * @param int|string $var + * @return $this + */ + public function setTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->time_unix_nano = $var; + + return $this; + } + + /** + * count is the number of values in the population. Must be + * non-negative. This value must be equal to the sum of the "bucket_counts" + * values in the positive and negative Buckets plus the "zero_count" field. + * + * Generated from protobuf field fixed64 count = 4; + * @return int|string + */ + public function getCount() + { + return $this->count; + } + + /** + * count is the number of values in the population. Must be + * non-negative. This value must be equal to the sum of the "bucket_counts" + * values in the positive and negative Buckets plus the "zero_count" field. + * + * Generated from protobuf field fixed64 count = 4; + * @param int|string $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkUint64($var); + $this->count = $var; + + return $this; + } + + /** + * sum of the values in the population. If count is zero then this field + * must be zero. + * Note: Sum should only be filled out when measuring non-negative discrete + * events, and is assumed to be monotonic over the values of these events. + * Negative events *can* be recorded, but sum should not be filled out when + * doing so. This is specifically to enforce compatibility w/ OpenMetrics, + * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram + * + * Generated from protobuf field optional double sum = 5; + * @return float + */ + public function getSum() + { + return isset($this->sum) ? $this->sum : 0.0; + } + + public function hasSum() + { + return isset($this->sum); + } + + public function clearSum() + { + unset($this->sum); + } + + /** + * sum of the values in the population. If count is zero then this field + * must be zero. + * Note: Sum should only be filled out when measuring non-negative discrete + * events, and is assumed to be monotonic over the values of these events. + * Negative events *can* be recorded, but sum should not be filled out when + * doing so. This is specifically to enforce compatibility w/ OpenMetrics, + * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram + * + * Generated from protobuf field optional double sum = 5; + * @param float $var + * @return $this + */ + public function setSum($var) + { + GPBUtil::checkDouble($var); + $this->sum = $var; + + return $this; + } + + /** + * scale describes the resolution of the histogram. Boundaries are + * located at powers of the base, where: + * base = (2^(2^-scale)) + * The histogram bucket identified by `index`, a signed integer, + * contains values that are greater than (base^index) and + * less than or equal to (base^(index+1)). + * The positive and negative ranges of the histogram are expressed + * separately. Negative values are mapped by their absolute value + * into the negative range using the same scale as the positive range. + * scale is not restricted by the protocol, as the permissible + * values depend on the range of the data. + * + * Generated from protobuf field sint32 scale = 6; + * @return int + */ + public function getScale() + { + return $this->scale; + } + + /** + * scale describes the resolution of the histogram. Boundaries are + * located at powers of the base, where: + * base = (2^(2^-scale)) + * The histogram bucket identified by `index`, a signed integer, + * contains values that are greater than (base^index) and + * less than or equal to (base^(index+1)). + * The positive and negative ranges of the histogram are expressed + * separately. Negative values are mapped by their absolute value + * into the negative range using the same scale as the positive range. + * scale is not restricted by the protocol, as the permissible + * values depend on the range of the data. + * + * Generated from protobuf field sint32 scale = 6; + * @param int $var + * @return $this + */ + public function setScale($var) + { + GPBUtil::checkInt32($var); + $this->scale = $var; + + return $this; + } + + /** + * zero_count is the count of values that are either exactly zero or + * within the region considered zero by the instrumentation at the + * tolerated degree of precision. This bucket stores values that + * cannot be expressed using the standard exponential formula as + * well as values that have been rounded to zero. + * Implementations MAY consider the zero bucket to have probability + * mass equal to (zero_count / count). + * + * Generated from protobuf field fixed64 zero_count = 7; + * @return int|string + */ + public function getZeroCount() + { + return $this->zero_count; + } + + /** + * zero_count is the count of values that are either exactly zero or + * within the region considered zero by the instrumentation at the + * tolerated degree of precision. This bucket stores values that + * cannot be expressed using the standard exponential formula as + * well as values that have been rounded to zero. + * Implementations MAY consider the zero bucket to have probability + * mass equal to (zero_count / count). + * + * Generated from protobuf field fixed64 zero_count = 7; + * @param int|string $var + * @return $this + */ + public function setZeroCount($var) + { + GPBUtil::checkUint64($var); + $this->zero_count = $var; + + return $this; + } + + /** + * positive carries the positive range of exponential bucket counts. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets positive = 8; + * @return \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint\Buckets|null + */ + public function getPositive() + { + return $this->positive; + } + + public function hasPositive() + { + return isset($this->positive); + } + + public function clearPositive() + { + unset($this->positive); + } + + /** + * positive carries the positive range of exponential bucket counts. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets positive = 8; + * @param \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint\Buckets $var + * @return $this + */ + public function setPositive($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint\Buckets::class); + $this->positive = $var; + + return $this; + } + + /** + * negative carries the negative range of exponential bucket counts. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets negative = 9; + * @return \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint\Buckets|null + */ + public function getNegative() + { + return $this->negative; + } + + public function hasNegative() + { + return isset($this->negative); + } + + public function clearNegative() + { + unset($this->negative); + } + + /** + * negative carries the negative range of exponential bucket counts. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets negative = 9; + * @param \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint\Buckets $var + * @return $this + */ + public function setNegative($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint\Buckets::class); + $this->negative = $var; + + return $this; + } + + /** + * Flags that apply to this specific data point. See DataPointFlags + * for the available flags and their meaning. + * + * Generated from protobuf field uint32 flags = 10; + * @return int + */ + public function getFlags() + { + return $this->flags; + } + + /** + * Flags that apply to this specific data point. See DataPointFlags + * for the available flags and their meaning. + * + * Generated from protobuf field uint32 flags = 10; + * @param int $var + * @return $this + */ + public function setFlags($var) + { + GPBUtil::checkUint32($var); + $this->flags = $var; + + return $this; + } + + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.Exemplar exemplars = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExemplars() + { + return $this->exemplars; + } + + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.Exemplar exemplars = 11; + * @param \Opentelemetry\Proto\Metrics\V1\Exemplar[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExemplars($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\Exemplar::class); + $this->exemplars = $arr; + + return $this; + } + + /** + * min is the minimum value over (start_time, end_time]. + * + * Generated from protobuf field optional double min = 12; + * @return float + */ + public function getMin() + { + return isset($this->min) ? $this->min : 0.0; + } + + public function hasMin() + { + return isset($this->min); + } + + public function clearMin() + { + unset($this->min); + } + + /** + * min is the minimum value over (start_time, end_time]. + * + * Generated from protobuf field optional double min = 12; + * @param float $var + * @return $this + */ + public function setMin($var) + { + GPBUtil::checkDouble($var); + $this->min = $var; + + return $this; + } + + /** + * max is the maximum value over (start_time, end_time]. + * + * Generated from protobuf field optional double max = 13; + * @return float + */ + public function getMax() + { + return isset($this->max) ? $this->max : 0.0; + } + + public function hasMax() + { + return isset($this->max); + } + + public function clearMax() + { + unset($this->max); + } + + /** + * max is the maximum value over (start_time, end_time]. + * + * Generated from protobuf field optional double max = 13; + * @param float $var + * @return $this + */ + public function setMax($var) + { + GPBUtil::checkDouble($var); + $this->max = $var; + + return $this; + } + + /** + * ZeroThreshold may be optionally set to convey the width of the zero + * region. Where the zero region is defined as the closed interval + * [-ZeroThreshold, ZeroThreshold]. + * When ZeroThreshold is 0, zero count bucket stores values that cannot be + * expressed using the standard exponential formula as well as values that + * have been rounded to zero. + * + * Generated from protobuf field double zero_threshold = 14; + * @return float + */ + public function getZeroThreshold() + { + return $this->zero_threshold; + } + + /** + * ZeroThreshold may be optionally set to convey the width of the zero + * region. Where the zero region is defined as the closed interval + * [-ZeroThreshold, ZeroThreshold]. + * When ZeroThreshold is 0, zero count bucket stores values that cannot be + * expressed using the standard exponential formula as well as values that + * have been rounded to zero. + * + * Generated from protobuf field double zero_threshold = 14; + * @param float $var + * @return $this + */ + public function setZeroThreshold($var) + { + GPBUtil::checkDouble($var); + $this->zero_threshold = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint/Buckets.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint/Buckets.php new file mode 100644 index 000000000..e1a90a34a --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint/Buckets.php @@ -0,0 +1,141 @@ +opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets + */ +class Buckets extends \Google\Protobuf\Internal\Message +{ + /** + * Offset is the bucket index of the first entry in the bucket_counts array. + * + * Note: This uses a varint encoding as a simple form of compression. + * + * Generated from protobuf field sint32 offset = 1; + */ + protected $offset = 0; + /** + * bucket_counts is an array of count values, where bucket_counts[i] carries + * the count of the bucket at index (offset+i). bucket_counts[i] is the count + * of values greater than base^(offset+i) and less than or equal to + * base^(offset+i+1). + * Note: By contrast, the explicit HistogramDataPoint uses + * fixed64. This field is expected to have many buckets, + * especially zeros, so uint64 has been selected to ensure + * varint encoding. + * + * Generated from protobuf field repeated uint64 bucket_counts = 2; + */ + private $bucket_counts; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $offset + * Offset is the bucket index of the first entry in the bucket_counts array. + * + * Note: This uses a varint encoding as a simple form of compression. + * @type int[]|string[]|\Google\Protobuf\Internal\RepeatedField $bucket_counts + * bucket_counts is an array of count values, where bucket_counts[i] carries + * the count of the bucket at index (offset+i). bucket_counts[i] is the count + * of values greater than base^(offset+i) and less than or equal to + * base^(offset+i+1). + * Note: By contrast, the explicit HistogramDataPoint uses + * fixed64. This field is expected to have many buckets, + * especially zeros, so uint64 has been selected to ensure + * varint encoding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * Offset is the bucket index of the first entry in the bucket_counts array. + * + * Note: This uses a varint encoding as a simple form of compression. + * + * Generated from protobuf field sint32 offset = 1; + * @return int + */ + public function getOffset() + { + return $this->offset; + } + + /** + * Offset is the bucket index of the first entry in the bucket_counts array. + * + * Note: This uses a varint encoding as a simple form of compression. + * + * Generated from protobuf field sint32 offset = 1; + * @param int $var + * @return $this + */ + public function setOffset($var) + { + GPBUtil::checkInt32($var); + $this->offset = $var; + + return $this; + } + + /** + * bucket_counts is an array of count values, where bucket_counts[i] carries + * the count of the bucket at index (offset+i). bucket_counts[i] is the count + * of values greater than base^(offset+i) and less than or equal to + * base^(offset+i+1). + * Note: By contrast, the explicit HistogramDataPoint uses + * fixed64. This field is expected to have many buckets, + * especially zeros, so uint64 has been selected to ensure + * varint encoding. + * + * Generated from protobuf field repeated uint64 bucket_counts = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBucketCounts() + { + return $this->bucket_counts; + } + + /** + * bucket_counts is an array of count values, where bucket_counts[i] carries + * the count of the bucket at index (offset+i). bucket_counts[i] is the count + * of values greater than base^(offset+i) and less than or equal to + * base^(offset+i+1). + * Note: By contrast, the explicit HistogramDataPoint uses + * fixed64. This field is expected to have many buckets, + * especially zeros, so uint64 has been selected to ensure + * varint encoding. + * + * Generated from protobuf field repeated uint64 bucket_counts = 2; + * @param int[]|string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBucketCounts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::UINT64); + $this->bucket_counts = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Buckets::class, \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint_Buckets::class); + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint_Buckets.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint_Buckets.php new file mode 100644 index 000000000..a002399a8 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint_Buckets.php @@ -0,0 +1,16 @@ +opentelemetry.proto.metrics.v1.Gauge + */ +class Gauge extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.NumberDataPoint data_points = 1; + */ + private $data_points; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Metrics\V1\NumberDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.NumberDataPoint data_points = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataPoints() + { + return $this->data_points; + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.NumberDataPoint data_points = 1; + * @param \Opentelemetry\Proto\Metrics\V1\NumberDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\NumberDataPoint::class); + $this->data_points = $arr; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Histogram.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Histogram.php new file mode 100644 index 000000000..e6643b89e --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Histogram.php @@ -0,0 +1,99 @@ +opentelemetry.proto.metrics.v1.Histogram + */ +class Histogram extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.HistogramDataPoint data_points = 1; + */ + private $data_points; + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + */ + protected $aggregation_temporality = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Metrics\V1\HistogramDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points + * @type int $aggregation_temporality + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.HistogramDataPoint data_points = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataPoints() + { + return $this->data_points; + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.HistogramDataPoint data_points = 1; + * @param \Opentelemetry\Proto\Metrics\V1\HistogramDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\HistogramDataPoint::class); + $this->data_points = $arr; + + return $this; + } + + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + * @return int + */ + public function getAggregationTemporality() + { + return $this->aggregation_temporality; + } + + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + * @param int $var + * @return $this + */ + public function setAggregationTemporality($var) + { + GPBUtil::checkEnum($var, \Opentelemetry\Proto\Metrics\V1\AggregationTemporality::class); + $this->aggregation_temporality = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/HistogramDataPoint.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/HistogramDataPoint.php new file mode 100644 index 000000000..2b19dd856 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/HistogramDataPoint.php @@ -0,0 +1,565 @@ +opentelemetry.proto.metrics.v1.HistogramDataPoint + */ +class HistogramDataPoint extends \Google\Protobuf\Internal\Message +{ + /** + * The set of key/value pairs that uniquely identify the timeseries from + * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 9; + */ + private $attributes; + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + */ + protected $start_time_unix_nano = 0; + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + */ + protected $time_unix_nano = 0; + /** + * count is the number of values in the population. Must be non-negative. This + * value must be equal to the sum of the "count" fields in buckets if a + * histogram is provided. + * + * Generated from protobuf field fixed64 count = 4; + */ + protected $count = 0; + /** + * sum of the values in the population. If count is zero then this field + * must be zero. + * Note: Sum should only be filled out when measuring non-negative discrete + * events, and is assumed to be monotonic over the values of these events. + * Negative events *can* be recorded, but sum should not be filled out when + * doing so. This is specifically to enforce compatibility w/ OpenMetrics, + * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram + * + * Generated from protobuf field optional double sum = 5; + */ + protected $sum = null; + /** + * bucket_counts is an optional field contains the count values of histogram + * for each bucket. + * The sum of the bucket_counts must equal the value in the count field. + * The number of elements in bucket_counts array must be by one greater than + * the number of elements in explicit_bounds array. + * + * Generated from protobuf field repeated fixed64 bucket_counts = 6; + */ + private $bucket_counts; + /** + * explicit_bounds specifies buckets with explicitly defined bounds for values. + * The boundaries for bucket at index i are: + * (-infinity, explicit_bounds[i]] for i == 0 + * (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < size(explicit_bounds) + * (explicit_bounds[i-1], +infinity) for i == size(explicit_bounds) + * The values in the explicit_bounds array must be strictly increasing. + * Histogram buckets are inclusive of their upper boundary, except the last + * bucket where the boundary is at infinity. This format is intentionally + * compatible with the OpenMetrics histogram definition. + * + * Generated from protobuf field repeated double explicit_bounds = 7; + */ + private $explicit_bounds; + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.Exemplar exemplars = 8; + */ + private $exemplars; + /** + * Flags that apply to this specific data point. See DataPointFlags + * for the available flags and their meaning. + * + * Generated from protobuf field uint32 flags = 10; + */ + protected $flags = 0; + /** + * min is the minimum value over (start_time, end_time]. + * + * Generated from protobuf field optional double min = 11; + */ + protected $min = null; + /** + * max is the maximum value over (start_time, end_time]. + * + * Generated from protobuf field optional double max = 12; + */ + protected $max = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes + * The set of key/value pairs that uniquely identify the timeseries from + * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * @type int|string $start_time_unix_nano + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type int|string $time_unix_nano + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type int|string $count + * count is the number of values in the population. Must be non-negative. This + * value must be equal to the sum of the "count" fields in buckets if a + * histogram is provided. + * @type float $sum + * sum of the values in the population. If count is zero then this field + * must be zero. + * Note: Sum should only be filled out when measuring non-negative discrete + * events, and is assumed to be monotonic over the values of these events. + * Negative events *can* be recorded, but sum should not be filled out when + * doing so. This is specifically to enforce compatibility w/ OpenMetrics, + * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram + * @type int[]|string[]|\Google\Protobuf\Internal\RepeatedField $bucket_counts + * bucket_counts is an optional field contains the count values of histogram + * for each bucket. + * The sum of the bucket_counts must equal the value in the count field. + * The number of elements in bucket_counts array must be by one greater than + * the number of elements in explicit_bounds array. + * @type float[]|\Google\Protobuf\Internal\RepeatedField $explicit_bounds + * explicit_bounds specifies buckets with explicitly defined bounds for values. + * The boundaries for bucket at index i are: + * (-infinity, explicit_bounds[i]] for i == 0 + * (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < size(explicit_bounds) + * (explicit_bounds[i-1], +infinity) for i == size(explicit_bounds) + * The values in the explicit_bounds array must be strictly increasing. + * Histogram buckets are inclusive of their upper boundary, except the last + * bucket where the boundary is at infinity. This format is intentionally + * compatible with the OpenMetrics histogram definition. + * @type \Opentelemetry\Proto\Metrics\V1\Exemplar[]|\Google\Protobuf\Internal\RepeatedField $exemplars + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * @type int $flags + * Flags that apply to this specific data point. See DataPointFlags + * for the available flags and their meaning. + * @type float $min + * min is the minimum value over (start_time, end_time]. + * @type float $max + * max is the maximum value over (start_time, end_time]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * The set of key/value pairs that uniquely identify the timeseries from + * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * The set of key/value pairs that uniquely identify the timeseries from + * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 9; + * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class); + $this->attributes = $arr; + + return $this; + } + + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + * @return int|string + */ + public function getStartTimeUnixNano() + { + return $this->start_time_unix_nano; + } + + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + * @param int|string $var + * @return $this + */ + public function setStartTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->start_time_unix_nano = $var; + + return $this; + } + + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + * @return int|string + */ + public function getTimeUnixNano() + { + return $this->time_unix_nano; + } + + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + * @param int|string $var + * @return $this + */ + public function setTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->time_unix_nano = $var; + + return $this; + } + + /** + * count is the number of values in the population. Must be non-negative. This + * value must be equal to the sum of the "count" fields in buckets if a + * histogram is provided. + * + * Generated from protobuf field fixed64 count = 4; + * @return int|string + */ + public function getCount() + { + return $this->count; + } + + /** + * count is the number of values in the population. Must be non-negative. This + * value must be equal to the sum of the "count" fields in buckets if a + * histogram is provided. + * + * Generated from protobuf field fixed64 count = 4; + * @param int|string $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkUint64($var); + $this->count = $var; + + return $this; + } + + /** + * sum of the values in the population. If count is zero then this field + * must be zero. + * Note: Sum should only be filled out when measuring non-negative discrete + * events, and is assumed to be monotonic over the values of these events. + * Negative events *can* be recorded, but sum should not be filled out when + * doing so. This is specifically to enforce compatibility w/ OpenMetrics, + * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram + * + * Generated from protobuf field optional double sum = 5; + * @return float + */ + public function getSum() + { + return isset($this->sum) ? $this->sum : 0.0; + } + + public function hasSum() + { + return isset($this->sum); + } + + public function clearSum() + { + unset($this->sum); + } + + /** + * sum of the values in the population. If count is zero then this field + * must be zero. + * Note: Sum should only be filled out when measuring non-negative discrete + * events, and is assumed to be monotonic over the values of these events. + * Negative events *can* be recorded, but sum should not be filled out when + * doing so. This is specifically to enforce compatibility w/ OpenMetrics, + * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram + * + * Generated from protobuf field optional double sum = 5; + * @param float $var + * @return $this + */ + public function setSum($var) + { + GPBUtil::checkDouble($var); + $this->sum = $var; + + return $this; + } + + /** + * bucket_counts is an optional field contains the count values of histogram + * for each bucket. + * The sum of the bucket_counts must equal the value in the count field. + * The number of elements in bucket_counts array must be by one greater than + * the number of elements in explicit_bounds array. + * + * Generated from protobuf field repeated fixed64 bucket_counts = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBucketCounts() + { + return $this->bucket_counts; + } + + /** + * bucket_counts is an optional field contains the count values of histogram + * for each bucket. + * The sum of the bucket_counts must equal the value in the count field. + * The number of elements in bucket_counts array must be by one greater than + * the number of elements in explicit_bounds array. + * + * Generated from protobuf field repeated fixed64 bucket_counts = 6; + * @param int[]|string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBucketCounts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::FIXED64); + $this->bucket_counts = $arr; + + return $this; + } + + /** + * explicit_bounds specifies buckets with explicitly defined bounds for values. + * The boundaries for bucket at index i are: + * (-infinity, explicit_bounds[i]] for i == 0 + * (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < size(explicit_bounds) + * (explicit_bounds[i-1], +infinity) for i == size(explicit_bounds) + * The values in the explicit_bounds array must be strictly increasing. + * Histogram buckets are inclusive of their upper boundary, except the last + * bucket where the boundary is at infinity. This format is intentionally + * compatible with the OpenMetrics histogram definition. + * + * Generated from protobuf field repeated double explicit_bounds = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExplicitBounds() + { + return $this->explicit_bounds; + } + + /** + * explicit_bounds specifies buckets with explicitly defined bounds for values. + * The boundaries for bucket at index i are: + * (-infinity, explicit_bounds[i]] for i == 0 + * (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < size(explicit_bounds) + * (explicit_bounds[i-1], +infinity) for i == size(explicit_bounds) + * The values in the explicit_bounds array must be strictly increasing. + * Histogram buckets are inclusive of their upper boundary, except the last + * bucket where the boundary is at infinity. This format is intentionally + * compatible with the OpenMetrics histogram definition. + * + * Generated from protobuf field repeated double explicit_bounds = 7; + * @param float[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExplicitBounds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::DOUBLE); + $this->explicit_bounds = $arr; + + return $this; + } + + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.Exemplar exemplars = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExemplars() + { + return $this->exemplars; + } + + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.Exemplar exemplars = 8; + * @param \Opentelemetry\Proto\Metrics\V1\Exemplar[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExemplars($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\Exemplar::class); + $this->exemplars = $arr; + + return $this; + } + + /** + * Flags that apply to this specific data point. See DataPointFlags + * for the available flags and their meaning. + * + * Generated from protobuf field uint32 flags = 10; + * @return int + */ + public function getFlags() + { + return $this->flags; + } + + /** + * Flags that apply to this specific data point. See DataPointFlags + * for the available flags and their meaning. + * + * Generated from protobuf field uint32 flags = 10; + * @param int $var + * @return $this + */ + public function setFlags($var) + { + GPBUtil::checkUint32($var); + $this->flags = $var; + + return $this; + } + + /** + * min is the minimum value over (start_time, end_time]. + * + * Generated from protobuf field optional double min = 11; + * @return float + */ + public function getMin() + { + return isset($this->min) ? $this->min : 0.0; + } + + public function hasMin() + { + return isset($this->min); + } + + public function clearMin() + { + unset($this->min); + } + + /** + * min is the minimum value over (start_time, end_time]. + * + * Generated from protobuf field optional double min = 11; + * @param float $var + * @return $this + */ + public function setMin($var) + { + GPBUtil::checkDouble($var); + $this->min = $var; + + return $this; + } + + /** + * max is the maximum value over (start_time, end_time]. + * + * Generated from protobuf field optional double max = 12; + * @return float + */ + public function getMax() + { + return isset($this->max) ? $this->max : 0.0; + } + + public function hasMax() + { + return isset($this->max); + } + + public function clearMax() + { + unset($this->max); + } + + /** + * max is the maximum value over (start_time, end_time]. + * + * Generated from protobuf field optional double max = 12; + * @param float $var + * @return $this + */ + public function setMax($var) + { + GPBUtil::checkDouble($var); + $this->max = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/InstrumentationLibraryMetrics.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/InstrumentationLibraryMetrics.php new file mode 100644 index 000000000..807aa1054 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/InstrumentationLibraryMetrics.php @@ -0,0 +1,156 @@ +opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics + */ +class InstrumentationLibraryMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * The instrumentation library information for the metrics in this message. + * Semantically when InstrumentationLibrary isn't set, it is equivalent with + * an empty instrumentation library name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1; + */ + protected $instrumentation_library = null; + /** + * A list of metrics that originate from an instrumentation library. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.Metric metrics = 2; + */ + private $metrics; + /** + * This schema_url applies to all metrics in the "metrics" field. + * + * Generated from protobuf field string schema_url = 3; + */ + protected $schema_url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\InstrumentationLibrary $instrumentation_library + * The instrumentation library information for the metrics in this message. + * Semantically when InstrumentationLibrary isn't set, it is equivalent with + * an empty instrumentation library name (unknown). + * @type \Opentelemetry\Proto\Metrics\V1\Metric[]|\Google\Protobuf\Internal\RepeatedField $metrics + * A list of metrics that originate from an instrumentation library. + * @type string $schema_url + * This schema_url applies to all metrics in the "metrics" field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * The instrumentation library information for the metrics in this message. + * Semantically when InstrumentationLibrary isn't set, it is equivalent with + * an empty instrumentation library name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1; + * @return \Opentelemetry\Proto\Common\V1\InstrumentationLibrary|null + */ + public function getInstrumentationLibrary() + { + return $this->instrumentation_library; + } + + public function hasInstrumentationLibrary() + { + return isset($this->instrumentation_library); + } + + public function clearInstrumentationLibrary() + { + unset($this->instrumentation_library); + } + + /** + * The instrumentation library information for the metrics in this message. + * Semantically when InstrumentationLibrary isn't set, it is equivalent with + * an empty instrumentation library name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1; + * @param \Opentelemetry\Proto\Common\V1\InstrumentationLibrary $var + * @return $this + */ + public function setInstrumentationLibrary($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\InstrumentationLibrary::class); + $this->instrumentation_library = $var; + + return $this; + } + + /** + * A list of metrics that originate from an instrumentation library. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.Metric metrics = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetrics() + { + return $this->metrics; + } + + /** + * A list of metrics that originate from an instrumentation library. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.Metric metrics = 2; + * @param \Opentelemetry\Proto\Metrics\V1\Metric[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\Metric::class); + $this->metrics = $arr; + + return $this; + } + + /** + * This schema_url applies to all metrics in the "metrics" field. + * + * Generated from protobuf field string schema_url = 3; + * @return string + */ + public function getSchemaUrl() + { + return $this->schema_url; + } + + /** + * This schema_url applies to all metrics in the "metrics" field. + * + * Generated from protobuf field string schema_url = 3; + * @param string $var + * @return $this + */ + public function setSchemaUrl($var) + { + GPBUtil::checkString($var, True); + $this->schema_url = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntDataPoint.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntDataPoint.php new file mode 100644 index 000000000..2eac03fcb --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntDataPoint.php @@ -0,0 +1,227 @@ +opentelemetry.proto.metrics.v1.IntDataPoint + */ +class IntDataPoint extends \Google\Protobuf\Internal\Message +{ + /** + * The set of labels that uniquely identify this timeseries. + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1; + */ + private $labels; + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + */ + protected $start_time_unix_nano = 0; + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + */ + protected $time_unix_nano = 0; + /** + * value itself. + * + * Generated from protobuf field sfixed64 value = 4; + */ + protected $value = 0; + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 5; + */ + private $exemplars; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $labels + * The set of labels that uniquely identify this timeseries. + * @type int|string $start_time_unix_nano + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type int|string $time_unix_nano + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type int|string $value + * value itself. + * @type \Opentelemetry\Proto\Metrics\V1\IntExemplar[]|\Google\Protobuf\Internal\RepeatedField $exemplars + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * The set of labels that uniquely identify this timeseries. + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * The set of labels that uniquely identify this timeseries. + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1; + * @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class); + $this->labels = $arr; + + return $this; + } + + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + * @return int|string + */ + public function getStartTimeUnixNano() + { + return $this->start_time_unix_nano; + } + + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + * @param int|string $var + * @return $this + */ + public function setStartTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->start_time_unix_nano = $var; + + return $this; + } + + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + * @return int|string + */ + public function getTimeUnixNano() + { + return $this->time_unix_nano; + } + + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + * @param int|string $var + * @return $this + */ + public function setTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->time_unix_nano = $var; + + return $this; + } + + /** + * value itself. + * + * Generated from protobuf field sfixed64 value = 4; + * @return int|string + */ + public function getValue() + { + return $this->value; + } + + /** + * value itself. + * + * Generated from protobuf field sfixed64 value = 4; + * @param int|string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkInt64($var); + $this->value = $var; + + return $this; + } + + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExemplars() + { + return $this->exemplars; + } + + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 5; + * @param \Opentelemetry\Proto\Metrics\V1\IntExemplar[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExemplars($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntExemplar::class); + $this->exemplars = $arr; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntExemplar.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntExemplar.php new file mode 100644 index 000000000..319c0ff27 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntExemplar.php @@ -0,0 +1,235 @@ +opentelemetry.proto.metrics.v1.IntExemplar + */ +class IntExemplar extends \Google\Protobuf\Internal\Message +{ + /** + * The set of labels that were filtered out by the aggregator, but recorded + * alongside the original measurement. Only labels that were filtered out + * by the aggregator should be included + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1; + */ + private $filtered_labels; + /** + * time_unix_nano is the exact time when this exemplar was recorded + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 2; + */ + protected $time_unix_nano = 0; + /** + * Numerical int value of the measurement that was recorded. + * + * Generated from protobuf field sfixed64 value = 3; + */ + protected $value = 0; + /** + * (Optional) Span ID of the exemplar trace. + * span_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * + * Generated from protobuf field bytes span_id = 4; + */ + protected $span_id = ''; + /** + * (Optional) Trace ID of the exemplar trace. + * trace_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * + * Generated from protobuf field bytes trace_id = 5; + */ + protected $trace_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $filtered_labels + * The set of labels that were filtered out by the aggregator, but recorded + * alongside the original measurement. Only labels that were filtered out + * by the aggregator should be included + * @type int|string $time_unix_nano + * time_unix_nano is the exact time when this exemplar was recorded + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type int|string $value + * Numerical int value of the measurement that was recorded. + * @type string $span_id + * (Optional) Span ID of the exemplar trace. + * span_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * @type string $trace_id + * (Optional) Trace ID of the exemplar trace. + * trace_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * The set of labels that were filtered out by the aggregator, but recorded + * alongside the original measurement. Only labels that were filtered out + * by the aggregator should be included + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFilteredLabels() + { + return $this->filtered_labels; + } + + /** + * The set of labels that were filtered out by the aggregator, but recorded + * alongside the original measurement. Only labels that were filtered out + * by the aggregator should be included + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1; + * @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFilteredLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class); + $this->filtered_labels = $arr; + + return $this; + } + + /** + * time_unix_nano is the exact time when this exemplar was recorded + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 2; + * @return int|string + */ + public function getTimeUnixNano() + { + return $this->time_unix_nano; + } + + /** + * time_unix_nano is the exact time when this exemplar was recorded + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 2; + * @param int|string $var + * @return $this + */ + public function setTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->time_unix_nano = $var; + + return $this; + } + + /** + * Numerical int value of the measurement that was recorded. + * + * Generated from protobuf field sfixed64 value = 3; + * @return int|string + */ + public function getValue() + { + return $this->value; + } + + /** + * Numerical int value of the measurement that was recorded. + * + * Generated from protobuf field sfixed64 value = 3; + * @param int|string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkInt64($var); + $this->value = $var; + + return $this; + } + + /** + * (Optional) Span ID of the exemplar trace. + * span_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * + * Generated from protobuf field bytes span_id = 4; + * @return string + */ + public function getSpanId() + { + return $this->span_id; + } + + /** + * (Optional) Span ID of the exemplar trace. + * span_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * + * Generated from protobuf field bytes span_id = 4; + * @param string $var + * @return $this + */ + public function setSpanId($var) + { + GPBUtil::checkString($var, False); + $this->span_id = $var; + + return $this; + } + + /** + * (Optional) Trace ID of the exemplar trace. + * trace_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * + * Generated from protobuf field bytes trace_id = 5; + * @return string + */ + public function getTraceId() + { + return $this->trace_id; + } + + /** + * (Optional) Trace ID of the exemplar trace. + * trace_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * + * Generated from protobuf field bytes trace_id = 5; + * @param string $var + * @return $this + */ + public function setTraceId($var) + { + GPBUtil::checkString($var, False); + $this->trace_id = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntGauge.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntGauge.php new file mode 100644 index 000000000..37fece6dd --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntGauge.php @@ -0,0 +1,60 @@ +opentelemetry.proto.metrics.v1.IntGauge + */ +class IntGauge extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1; + */ + private $data_points; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Metrics\V1\IntDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataPoints() + { + return $this->data_points; + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1; + * @param \Opentelemetry\Proto\Metrics\V1\IntDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntDataPoint::class); + $this->data_points = $arr; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntHistogram.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntHistogram.php new file mode 100644 index 000000000..934649310 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntHistogram.php @@ -0,0 +1,99 @@ +opentelemetry.proto.metrics.v1.IntHistogram + */ +class IntHistogram extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntHistogramDataPoint data_points = 1; + */ + private $data_points; + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + */ + protected $aggregation_temporality = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Metrics\V1\IntHistogramDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points + * @type int $aggregation_temporality + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntHistogramDataPoint data_points = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataPoints() + { + return $this->data_points; + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntHistogramDataPoint data_points = 1; + * @param \Opentelemetry\Proto\Metrics\V1\IntHistogramDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntHistogramDataPoint::class); + $this->data_points = $arr; + + return $this; + } + + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + * @return int + */ + public function getAggregationTemporality() + { + return $this->aggregation_temporality; + } + + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + * @param int $var + * @return $this + */ + public function setAggregationTemporality($var) + { + GPBUtil::checkEnum($var, \Opentelemetry\Proto\Metrics\V1\AggregationTemporality::class); + $this->aggregation_temporality = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntHistogramDataPoint.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntHistogramDataPoint.php new file mode 100644 index 000000000..cf0e4898b --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntHistogramDataPoint.php @@ -0,0 +1,393 @@ +opentelemetry.proto.metrics.v1.IntHistogramDataPoint + */ +class IntHistogramDataPoint extends \Google\Protobuf\Internal\Message +{ + /** + * The set of labels that uniquely identify this timeseries. + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1; + */ + private $labels; + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + */ + protected $start_time_unix_nano = 0; + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + */ + protected $time_unix_nano = 0; + /** + * count is the number of values in the population. Must be non-negative. This + * value must be equal to the sum of the "count" fields in buckets if a + * histogram is provided. + * + * Generated from protobuf field fixed64 count = 4; + */ + protected $count = 0; + /** + * sum of the values in the population. If count is zero then this field + * must be zero. This value must be equal to the sum of the "sum" fields in + * buckets if a histogram is provided. + * + * Generated from protobuf field sfixed64 sum = 5; + */ + protected $sum = 0; + /** + * bucket_counts is an optional field contains the count values of histogram + * for each bucket. + * The sum of the bucket_counts must equal the value in the count field. + * The number of elements in bucket_counts array must be by one greater than + * the number of elements in explicit_bounds array. + * + * Generated from protobuf field repeated fixed64 bucket_counts = 6; + */ + private $bucket_counts; + /** + * explicit_bounds specifies buckets with explicitly defined bounds for values. + * The boundaries for bucket at index i are: + * (-infinity, explicit_bounds[i]] for i == 0 + * (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < size(explicit_bounds) + * (explicit_bounds[i-1], +infinity) for i == size(explicit_bounds) + * The values in the explicit_bounds array must be strictly increasing. + * Histogram buckets are inclusive of their upper boundary, except the last + * bucket where the boundary is at infinity. This format is intentionally + * compatible with the OpenMetrics histogram definition. + * + * Generated from protobuf field repeated double explicit_bounds = 7; + */ + private $explicit_bounds; + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 8; + */ + private $exemplars; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $labels + * The set of labels that uniquely identify this timeseries. + * @type int|string $start_time_unix_nano + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type int|string $time_unix_nano + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type int|string $count + * count is the number of values in the population. Must be non-negative. This + * value must be equal to the sum of the "count" fields in buckets if a + * histogram is provided. + * @type int|string $sum + * sum of the values in the population. If count is zero then this field + * must be zero. This value must be equal to the sum of the "sum" fields in + * buckets if a histogram is provided. + * @type int[]|string[]|\Google\Protobuf\Internal\RepeatedField $bucket_counts + * bucket_counts is an optional field contains the count values of histogram + * for each bucket. + * The sum of the bucket_counts must equal the value in the count field. + * The number of elements in bucket_counts array must be by one greater than + * the number of elements in explicit_bounds array. + * @type float[]|\Google\Protobuf\Internal\RepeatedField $explicit_bounds + * explicit_bounds specifies buckets with explicitly defined bounds for values. + * The boundaries for bucket at index i are: + * (-infinity, explicit_bounds[i]] for i == 0 + * (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < size(explicit_bounds) + * (explicit_bounds[i-1], +infinity) for i == size(explicit_bounds) + * The values in the explicit_bounds array must be strictly increasing. + * Histogram buckets are inclusive of their upper boundary, except the last + * bucket where the boundary is at infinity. This format is intentionally + * compatible with the OpenMetrics histogram definition. + * @type \Opentelemetry\Proto\Metrics\V1\IntExemplar[]|\Google\Protobuf\Internal\RepeatedField $exemplars + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * The set of labels that uniquely identify this timeseries. + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * The set of labels that uniquely identify this timeseries. + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1; + * @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class); + $this->labels = $arr; + + return $this; + } + + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + * @return int|string + */ + public function getStartTimeUnixNano() + { + return $this->start_time_unix_nano; + } + + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + * @param int|string $var + * @return $this + */ + public function setStartTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->start_time_unix_nano = $var; + + return $this; + } + + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + * @return int|string + */ + public function getTimeUnixNano() + { + return $this->time_unix_nano; + } + + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + * @param int|string $var + * @return $this + */ + public function setTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->time_unix_nano = $var; + + return $this; + } + + /** + * count is the number of values in the population. Must be non-negative. This + * value must be equal to the sum of the "count" fields in buckets if a + * histogram is provided. + * + * Generated from protobuf field fixed64 count = 4; + * @return int|string + */ + public function getCount() + { + return $this->count; + } + + /** + * count is the number of values in the population. Must be non-negative. This + * value must be equal to the sum of the "count" fields in buckets if a + * histogram is provided. + * + * Generated from protobuf field fixed64 count = 4; + * @param int|string $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkUint64($var); + $this->count = $var; + + return $this; + } + + /** + * sum of the values in the population. If count is zero then this field + * must be zero. This value must be equal to the sum of the "sum" fields in + * buckets if a histogram is provided. + * + * Generated from protobuf field sfixed64 sum = 5; + * @return int|string + */ + public function getSum() + { + return $this->sum; + } + + /** + * sum of the values in the population. If count is zero then this field + * must be zero. This value must be equal to the sum of the "sum" fields in + * buckets if a histogram is provided. + * + * Generated from protobuf field sfixed64 sum = 5; + * @param int|string $var + * @return $this + */ + public function setSum($var) + { + GPBUtil::checkInt64($var); + $this->sum = $var; + + return $this; + } + + /** + * bucket_counts is an optional field contains the count values of histogram + * for each bucket. + * The sum of the bucket_counts must equal the value in the count field. + * The number of elements in bucket_counts array must be by one greater than + * the number of elements in explicit_bounds array. + * + * Generated from protobuf field repeated fixed64 bucket_counts = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBucketCounts() + { + return $this->bucket_counts; + } + + /** + * bucket_counts is an optional field contains the count values of histogram + * for each bucket. + * The sum of the bucket_counts must equal the value in the count field. + * The number of elements in bucket_counts array must be by one greater than + * the number of elements in explicit_bounds array. + * + * Generated from protobuf field repeated fixed64 bucket_counts = 6; + * @param int[]|string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBucketCounts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::FIXED64); + $this->bucket_counts = $arr; + + return $this; + } + + /** + * explicit_bounds specifies buckets with explicitly defined bounds for values. + * The boundaries for bucket at index i are: + * (-infinity, explicit_bounds[i]] for i == 0 + * (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < size(explicit_bounds) + * (explicit_bounds[i-1], +infinity) for i == size(explicit_bounds) + * The values in the explicit_bounds array must be strictly increasing. + * Histogram buckets are inclusive of their upper boundary, except the last + * bucket where the boundary is at infinity. This format is intentionally + * compatible with the OpenMetrics histogram definition. + * + * Generated from protobuf field repeated double explicit_bounds = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExplicitBounds() + { + return $this->explicit_bounds; + } + + /** + * explicit_bounds specifies buckets with explicitly defined bounds for values. + * The boundaries for bucket at index i are: + * (-infinity, explicit_bounds[i]] for i == 0 + * (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < size(explicit_bounds) + * (explicit_bounds[i-1], +infinity) for i == size(explicit_bounds) + * The values in the explicit_bounds array must be strictly increasing. + * Histogram buckets are inclusive of their upper boundary, except the last + * bucket where the boundary is at infinity. This format is intentionally + * compatible with the OpenMetrics histogram definition. + * + * Generated from protobuf field repeated double explicit_bounds = 7; + * @param float[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExplicitBounds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::DOUBLE); + $this->explicit_bounds = $arr; + + return $this; + } + + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExemplars() + { + return $this->exemplars; + } + + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 8; + * @param \Opentelemetry\Proto\Metrics\V1\IntExemplar[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExemplars($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntExemplar::class); + $this->exemplars = $arr; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntSum.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntSum.php new file mode 100644 index 000000000..aaa313d7d --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/IntSum.php @@ -0,0 +1,132 @@ +opentelemetry.proto.metrics.v1.IntSum + */ +class IntSum extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1; + */ + private $data_points; + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + */ + protected $aggregation_temporality = 0; + /** + * If "true" means that the sum is monotonic. + * + * Generated from protobuf field bool is_monotonic = 3; + */ + protected $is_monotonic = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Metrics\V1\IntDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points + * @type int $aggregation_temporality + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * @type bool $is_monotonic + * If "true" means that the sum is monotonic. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataPoints() + { + return $this->data_points; + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1; + * @param \Opentelemetry\Proto\Metrics\V1\IntDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntDataPoint::class); + $this->data_points = $arr; + + return $this; + } + + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + * @return int + */ + public function getAggregationTemporality() + { + return $this->aggregation_temporality; + } + + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + * @param int $var + * @return $this + */ + public function setAggregationTemporality($var) + { + GPBUtil::checkEnum($var, \Opentelemetry\Proto\Metrics\V1\AggregationTemporality::class); + $this->aggregation_temporality = $var; + + return $this; + } + + /** + * If "true" means that the sum is monotonic. + * + * Generated from protobuf field bool is_monotonic = 3; + * @return bool + */ + public function getIsMonotonic() + { + return $this->is_monotonic; + } + + /** + * If "true" means that the sum is monotonic. + * + * Generated from protobuf field bool is_monotonic = 3; + * @param bool $var + * @return $this + */ + public function setIsMonotonic($var) + { + GPBUtil::checkBool($var); + $this->is_monotonic = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Metric.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Metric.php new file mode 100644 index 000000000..3d2538314 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Metric.php @@ -0,0 +1,358 @@ + |Gauge, Sum, Histogram, Summary, ... | + * +------------+ +------------------------------------+ + * Data [One of Gauge, Sum, Histogram, Summary, ...] + * +-----------+ + * |... | // Metadata about the Data. + * |points |--+ + * +-----------+ | + * | +---------------------------+ + * | |DataPoint 1 | + * v |+------+------+ +------+ | + * +-----+ ||label |label |...|label | | + * | 1 |-->||value1|value2|...|valueN| | + * +-----+ |+------+------+ +------+ | + * | . | |+-----+ | + * | . | ||value| | + * | . | |+-----+ | + * | . | +---------------------------+ + * | . | . + * | . | . + * | . | . + * | . | +---------------------------+ + * | . | |DataPoint M | + * +-----+ |+------+------+ +------+ | + * | M |-->||label |label |...|label | | + * +-----+ ||value1|value2|...|valueN| | + * |+------+------+ +------+ | + * |+-----+ | + * ||value| | + * |+-----+ | + * +---------------------------+ + * Each distinct type of DataPoint represents the output of a specific + * aggregation function, the result of applying the DataPoint's + * associated function of to one or more measurements. + * All DataPoint types have three common fields: + * - Attributes includes key-value pairs associated with the data point + * - TimeUnixNano is required, set to the end time of the aggregation + * - StartTimeUnixNano is optional, but strongly encouraged for DataPoints + * having an AggregationTemporality field, as discussed below. + * Both TimeUnixNano and StartTimeUnixNano values are expressed as + * UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * # TimeUnixNano + * This field is required, having consistent interpretation across + * DataPoint types. TimeUnixNano is the moment corresponding to when + * the data point's aggregate value was captured. + * Data points with the 0 value for TimeUnixNano SHOULD be rejected + * by consumers. + * # StartTimeUnixNano + * StartTimeUnixNano in general allows detecting when a sequence of + * observations is unbroken. This field indicates to consumers the + * start time for points with cumulative and delta + * AggregationTemporality, and it should be included whenever possible + * to support correct rate calculation. Although it may be omitted + * when the start time is truly unknown, setting StartTimeUnixNano is + * strongly encouraged. + * + * Generated from protobuf message opentelemetry.proto.metrics.v1.Metric + */ +class Metric extends \Google\Protobuf\Internal\Message +{ + /** + * name of the metric, including its DNS name prefix. It must be unique. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * description of the metric, which can be used in documentation. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * unit in which the metric value is reported. Follows the format + * described by http://unitsofmeasure.org/ucum.html. + * + * Generated from protobuf field string unit = 3; + */ + protected $unit = ''; + protected $data; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * name of the metric, including its DNS name prefix. It must be unique. + * @type string $description + * description of the metric, which can be used in documentation. + * @type string $unit + * unit in which the metric value is reported. Follows the format + * described by http://unitsofmeasure.org/ucum.html. + * @type \Opentelemetry\Proto\Metrics\V1\Gauge $gauge + * @type \Opentelemetry\Proto\Metrics\V1\Sum $sum + * @type \Opentelemetry\Proto\Metrics\V1\Histogram $histogram + * @type \Opentelemetry\Proto\Metrics\V1\ExponentialHistogram $exponential_histogram + * @type \Opentelemetry\Proto\Metrics\V1\Summary $summary + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * name of the metric, including its DNS name prefix. It must be unique. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * name of the metric, including its DNS name prefix. It must be unique. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * description of the metric, which can be used in documentation. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * description of the metric, which can be used in documentation. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * unit in which the metric value is reported. Follows the format + * described by http://unitsofmeasure.org/ucum.html. + * + * Generated from protobuf field string unit = 3; + * @return string + */ + public function getUnit() + { + return $this->unit; + } + + /** + * unit in which the metric value is reported. Follows the format + * described by http://unitsofmeasure.org/ucum.html. + * + * Generated from protobuf field string unit = 3; + * @param string $var + * @return $this + */ + public function setUnit($var) + { + GPBUtil::checkString($var, True); + $this->unit = $var; + + return $this; + } + + /** + * Generated from protobuf field .opentelemetry.proto.metrics.v1.Gauge gauge = 5; + * @return \Opentelemetry\Proto\Metrics\V1\Gauge|null + */ + public function getGauge() + { + return $this->readOneof(5); + } + + public function hasGauge() + { + return $this->hasOneof(5); + } + + /** + * Generated from protobuf field .opentelemetry.proto.metrics.v1.Gauge gauge = 5; + * @param \Opentelemetry\Proto\Metrics\V1\Gauge $var + * @return $this + */ + public function setGauge($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\Gauge::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Generated from protobuf field .opentelemetry.proto.metrics.v1.Sum sum = 7; + * @return \Opentelemetry\Proto\Metrics\V1\Sum|null + */ + public function getSum() + { + return $this->readOneof(7); + } + + public function hasSum() + { + return $this->hasOneof(7); + } + + /** + * Generated from protobuf field .opentelemetry.proto.metrics.v1.Sum sum = 7; + * @param \Opentelemetry\Proto\Metrics\V1\Sum $var + * @return $this + */ + public function setSum($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\Sum::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Generated from protobuf field .opentelemetry.proto.metrics.v1.Histogram histogram = 9; + * @return \Opentelemetry\Proto\Metrics\V1\Histogram|null + */ + public function getHistogram() + { + return $this->readOneof(9); + } + + public function hasHistogram() + { + return $this->hasOneof(9); + } + + /** + * Generated from protobuf field .opentelemetry.proto.metrics.v1.Histogram histogram = 9; + * @param \Opentelemetry\Proto\Metrics\V1\Histogram $var + * @return $this + */ + public function setHistogram($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\Histogram::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Generated from protobuf field .opentelemetry.proto.metrics.v1.ExponentialHistogram exponential_histogram = 10; + * @return \Opentelemetry\Proto\Metrics\V1\ExponentialHistogram|null + */ + public function getExponentialHistogram() + { + return $this->readOneof(10); + } + + public function hasExponentialHistogram() + { + return $this->hasOneof(10); + } + + /** + * Generated from protobuf field .opentelemetry.proto.metrics.v1.ExponentialHistogram exponential_histogram = 10; + * @param \Opentelemetry\Proto\Metrics\V1\ExponentialHistogram $var + * @return $this + */ + public function setExponentialHistogram($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\ExponentialHistogram::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Generated from protobuf field .opentelemetry.proto.metrics.v1.Summary summary = 11; + * @return \Opentelemetry\Proto\Metrics\V1\Summary|null + */ + public function getSummary() + { + return $this->readOneof(11); + } + + public function hasSummary() + { + return $this->hasOneof(11); + } + + /** + * Generated from protobuf field .opentelemetry.proto.metrics.v1.Summary summary = 11; + * @param \Opentelemetry\Proto\Metrics\V1\Summary $var + * @return $this + */ + public function setSummary($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\Summary::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * @return string + */ + public function getData() + { + return $this->whichOneof("data"); + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/MetricsData.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/MetricsData.php new file mode 100644 index 000000000..ce144d8f3 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/MetricsData.php @@ -0,0 +1,90 @@ +opentelemetry.proto.metrics.v1.MetricsData + */ +class MetricsData extends \Google\Protobuf\Internal\Message +{ + /** + * An array of ResourceMetrics. + * For data coming from a single resource this array will typically contain + * one element. Intermediary nodes that receive data from multiple origins + * typically batch the data before forwarding further and in that case this + * array will contain multiple elements. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1; + */ + private $resource_metrics; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Metrics\V1\ResourceMetrics[]|\Google\Protobuf\Internal\RepeatedField $resource_metrics + * An array of ResourceMetrics. + * For data coming from a single resource this array will typically contain + * one element. Intermediary nodes that receive data from multiple origins + * typically batch the data before forwarding further and in that case this + * array will contain multiple elements. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * An array of ResourceMetrics. + * For data coming from a single resource this array will typically contain + * one element. Intermediary nodes that receive data from multiple origins + * typically batch the data before forwarding further and in that case this + * array will contain multiple elements. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceMetrics() + { + return $this->resource_metrics; + } + + /** + * An array of ResourceMetrics. + * For data coming from a single resource this array will typically contain + * one element. Intermediary nodes that receive data from multiple origins + * typically batch the data before forwarding further and in that case this + * array will contain multiple elements. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1; + * @param \Opentelemetry\Proto\Metrics\V1\ResourceMetrics[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\ResourceMetrics::class); + $this->resource_metrics = $arr; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/NumberDataPoint.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/NumberDataPoint.php new file mode 100644 index 000000000..d9fa829e0 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/NumberDataPoint.php @@ -0,0 +1,309 @@ +opentelemetry.proto.metrics.v1.NumberDataPoint + */ +class NumberDataPoint extends \Google\Protobuf\Internal\Message +{ + /** + * The set of key/value pairs that uniquely identify the timeseries from + * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 7; + */ + private $attributes; + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + */ + protected $start_time_unix_nano = 0; + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + */ + protected $time_unix_nano = 0; + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.Exemplar exemplars = 5; + */ + private $exemplars; + /** + * Flags that apply to this specific data point. See DataPointFlags + * for the available flags and their meaning. + * + * Generated from protobuf field uint32 flags = 8; + */ + protected $flags = 0; + protected $value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes + * The set of key/value pairs that uniquely identify the timeseries from + * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * @type int|string $start_time_unix_nano + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type int|string $time_unix_nano + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type float $as_double + * @type int|string $as_int + * @type \Opentelemetry\Proto\Metrics\V1\Exemplar[]|\Google\Protobuf\Internal\RepeatedField $exemplars + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * @type int $flags + * Flags that apply to this specific data point. See DataPointFlags + * for the available flags and their meaning. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * The set of key/value pairs that uniquely identify the timeseries from + * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * The set of key/value pairs that uniquely identify the timeseries from + * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 7; + * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class); + $this->attributes = $arr; + + return $this; + } + + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + * @return int|string + */ + public function getStartTimeUnixNano() + { + return $this->start_time_unix_nano; + } + + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + * @param int|string $var + * @return $this + */ + public function setStartTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->start_time_unix_nano = $var; + + return $this; + } + + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + * @return int|string + */ + public function getTimeUnixNano() + { + return $this->time_unix_nano; + } + + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + * @param int|string $var + * @return $this + */ + public function setTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->time_unix_nano = $var; + + return $this; + } + + /** + * Generated from protobuf field double as_double = 4; + * @return float + */ + public function getAsDouble() + { + return $this->readOneof(4); + } + + public function hasAsDouble() + { + return $this->hasOneof(4); + } + + /** + * Generated from protobuf field double as_double = 4; + * @param float $var + * @return $this + */ + public function setAsDouble($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Generated from protobuf field sfixed64 as_int = 6; + * @return int|string + */ + public function getAsInt() + { + return $this->readOneof(6); + } + + public function hasAsInt() + { + return $this->hasOneof(6); + } + + /** + * Generated from protobuf field sfixed64 as_int = 6; + * @param int|string $var + * @return $this + */ + public function setAsInt($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.Exemplar exemplars = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExemplars() + { + return $this->exemplars; + } + + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.Exemplar exemplars = 5; + * @param \Opentelemetry\Proto\Metrics\V1\Exemplar[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExemplars($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\Exemplar::class); + $this->exemplars = $arr; + + return $this; + } + + /** + * Flags that apply to this specific data point. See DataPointFlags + * for the available flags and their meaning. + * + * Generated from protobuf field uint32 flags = 8; + * @return int + */ + public function getFlags() + { + return $this->flags; + } + + /** + * Flags that apply to this specific data point. See DataPointFlags + * for the available flags and their meaning. + * + * Generated from protobuf field uint32 flags = 8; + * @param int $var + * @return $this + */ + public function setFlags($var) + { + GPBUtil::checkUint32($var); + $this->flags = $var; + + return $this; + } + + /** + * @return string + */ + public function getValue() + { + return $this->whichOneof("value"); + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ResourceMetrics.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ResourceMetrics.php new file mode 100644 index 000000000..a5e2a7b0d --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ResourceMetrics.php @@ -0,0 +1,153 @@ +opentelemetry.proto.metrics.v1.ResourceMetrics + */ +class ResourceMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * The resource for the metrics in this message. + * If this field is not set then no resource info is known. + * + * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; + */ + protected $resource = null; + /** + * A list of metrics that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ScopeMetrics scope_metrics = 2; + */ + private $scope_metrics; + /** + * This schema_url applies to the data in the "resource" field. It does not apply + * to the data in the "scope_metrics" field which have their own schema_url field. + * + * Generated from protobuf field string schema_url = 3; + */ + protected $schema_url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Resource\V1\Resource $resource + * The resource for the metrics in this message. + * If this field is not set then no resource info is known. + * @type \Opentelemetry\Proto\Metrics\V1\ScopeMetrics[]|\Google\Protobuf\Internal\RepeatedField $scope_metrics + * A list of metrics that originate from a resource. + * @type string $schema_url + * This schema_url applies to the data in the "resource" field. It does not apply + * to the data in the "scope_metrics" field which have their own schema_url field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * The resource for the metrics in this message. + * If this field is not set then no resource info is known. + * + * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; + * @return \Opentelemetry\Proto\Resource\V1\Resource|null + */ + public function getResource() + { + return $this->resource; + } + + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + + /** + * The resource for the metrics in this message. + * If this field is not set then no resource info is known. + * + * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; + * @param \Opentelemetry\Proto\Resource\V1\Resource $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Resource\V1\Resource::class); + $this->resource = $var; + + return $this; + } + + /** + * A list of metrics that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ScopeMetrics scope_metrics = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScopeMetrics() + { + return $this->scope_metrics; + } + + /** + * A list of metrics that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ScopeMetrics scope_metrics = 2; + * @param \Opentelemetry\Proto\Metrics\V1\ScopeMetrics[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopeMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\ScopeMetrics::class); + $this->scope_metrics = $arr; + + return $this; + } + + /** + * This schema_url applies to the data in the "resource" field. It does not apply + * to the data in the "scope_metrics" field which have their own schema_url field. + * + * Generated from protobuf field string schema_url = 3; + * @return string + */ + public function getSchemaUrl() + { + return $this->schema_url; + } + + /** + * This schema_url applies to the data in the "resource" field. It does not apply + * to the data in the "scope_metrics" field which have their own schema_url field. + * + * Generated from protobuf field string schema_url = 3; + * @param string $var + * @return $this + */ + public function setSchemaUrl($var) + { + GPBUtil::checkString($var, True); + $this->schema_url = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ScopeMetrics.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ScopeMetrics.php new file mode 100644 index 000000000..71f5cdb86 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/ScopeMetrics.php @@ -0,0 +1,153 @@ +opentelemetry.proto.metrics.v1.ScopeMetrics + */ +class ScopeMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * The instrumentation scope information for the metrics in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationScope scope = 1; + */ + protected $scope = null; + /** + * A list of metrics that originate from an instrumentation library. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.Metric metrics = 2; + */ + private $metrics; + /** + * This schema_url applies to all metrics in the "metrics" field. + * + * Generated from protobuf field string schema_url = 3; + */ + protected $schema_url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\InstrumentationScope $scope + * The instrumentation scope information for the metrics in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * @type \Opentelemetry\Proto\Metrics\V1\Metric[]|\Google\Protobuf\Internal\RepeatedField $metrics + * A list of metrics that originate from an instrumentation library. + * @type string $schema_url + * This schema_url applies to all metrics in the "metrics" field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * The instrumentation scope information for the metrics in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationScope scope = 1; + * @return \Opentelemetry\Proto\Common\V1\InstrumentationScope|null + */ + public function getScope() + { + return $this->scope; + } + + public function hasScope() + { + return isset($this->scope); + } + + public function clearScope() + { + unset($this->scope); + } + + /** + * The instrumentation scope information for the metrics in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationScope scope = 1; + * @param \Opentelemetry\Proto\Common\V1\InstrumentationScope $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\InstrumentationScope::class); + $this->scope = $var; + + return $this; + } + + /** + * A list of metrics that originate from an instrumentation library. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.Metric metrics = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetrics() + { + return $this->metrics; + } + + /** + * A list of metrics that originate from an instrumentation library. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.Metric metrics = 2; + * @param \Opentelemetry\Proto\Metrics\V1\Metric[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\Metric::class); + $this->metrics = $arr; + + return $this; + } + + /** + * This schema_url applies to all metrics in the "metrics" field. + * + * Generated from protobuf field string schema_url = 3; + * @return string + */ + public function getSchemaUrl() + { + return $this->schema_url; + } + + /** + * This schema_url applies to all metrics in the "metrics" field. + * + * Generated from protobuf field string schema_url = 3; + * @param string $var + * @return $this + */ + public function setSchemaUrl($var) + { + GPBUtil::checkString($var, True); + $this->schema_url = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Sum.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Sum.php new file mode 100644 index 000000000..0251ecd9f --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Sum.php @@ -0,0 +1,133 @@ +opentelemetry.proto.metrics.v1.Sum + */ +class Sum extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.NumberDataPoint data_points = 1; + */ + private $data_points; + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + */ + protected $aggregation_temporality = 0; + /** + * If "true" means that the sum is monotonic. + * + * Generated from protobuf field bool is_monotonic = 3; + */ + protected $is_monotonic = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Metrics\V1\NumberDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points + * @type int $aggregation_temporality + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * @type bool $is_monotonic + * If "true" means that the sum is monotonic. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.NumberDataPoint data_points = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataPoints() + { + return $this->data_points; + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.NumberDataPoint data_points = 1; + * @param \Opentelemetry\Proto\Metrics\V1\NumberDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\NumberDataPoint::class); + $this->data_points = $arr; + + return $this; + } + + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + * @return int + */ + public function getAggregationTemporality() + { + return $this->aggregation_temporality; + } + + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + * @param int $var + * @return $this + */ + public function setAggregationTemporality($var) + { + GPBUtil::checkEnum($var, \Opentelemetry\Proto\Metrics\V1\AggregationTemporality::class); + $this->aggregation_temporality = $var; + + return $this; + } + + /** + * If "true" means that the sum is monotonic. + * + * Generated from protobuf field bool is_monotonic = 3; + * @return bool + */ + public function getIsMonotonic() + { + return $this->is_monotonic; + } + + /** + * If "true" means that the sum is monotonic. + * + * Generated from protobuf field bool is_monotonic = 3; + * @param bool $var + * @return $this + */ + public function setIsMonotonic($var) + { + GPBUtil::checkBool($var); + $this->is_monotonic = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Summary.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Summary.php new file mode 100644 index 000000000..adb5eceb9 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Summary.php @@ -0,0 +1,65 @@ +opentelemetry.proto.metrics.v1.Summary + */ +class Summary extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.SummaryDataPoint data_points = 1; + */ + private $data_points; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Metrics\V1\SummaryDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.SummaryDataPoint data_points = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataPoints() + { + return $this->data_points; + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.SummaryDataPoint data_points = 1; + * @param \Opentelemetry\Proto\Metrics\V1\SummaryDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\SummaryDataPoint::class); + $this->data_points = $arr; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint.php new file mode 100644 index 000000000..30cf4ade4 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint.php @@ -0,0 +1,336 @@ +opentelemetry.proto.metrics.v1.SummaryDataPoint + */ +class SummaryDataPoint extends \Google\Protobuf\Internal\Message +{ + /** + * The set of key/value pairs that uniquely identify the timeseries from + * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 7; + */ + private $attributes; + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + */ + protected $start_time_unix_nano = 0; + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + */ + protected $time_unix_nano = 0; + /** + * count is the number of values in the population. Must be non-negative. + * + * Generated from protobuf field fixed64 count = 4; + */ + protected $count = 0; + /** + * sum of the values in the population. If count is zero then this field + * must be zero. + * Note: Sum should only be filled out when measuring non-negative discrete + * events, and is assumed to be monotonic over the values of these events. + * Negative events *can* be recorded, but sum should not be filled out when + * doing so. This is specifically to enforce compatibility w/ OpenMetrics, + * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#summary + * + * Generated from protobuf field double sum = 5; + */ + protected $sum = 0.0; + /** + * (Optional) list of values at different quantiles of the distribution calculated + * from the current snapshot. The quantiles must be strictly increasing. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile quantile_values = 6; + */ + private $quantile_values; + /** + * Flags that apply to this specific data point. See DataPointFlags + * for the available flags and their meaning. + * + * Generated from protobuf field uint32 flags = 8; + */ + protected $flags = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes + * The set of key/value pairs that uniquely identify the timeseries from + * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * @type int|string $start_time_unix_nano + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type int|string $time_unix_nano + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type int|string $count + * count is the number of values in the population. Must be non-negative. + * @type float $sum + * sum of the values in the population. If count is zero then this field + * must be zero. + * Note: Sum should only be filled out when measuring non-negative discrete + * events, and is assumed to be monotonic over the values of these events. + * Negative events *can* be recorded, but sum should not be filled out when + * doing so. This is specifically to enforce compatibility w/ OpenMetrics, + * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#summary + * @type \Opentelemetry\Proto\Metrics\V1\SummaryDataPoint\ValueAtQuantile[]|\Google\Protobuf\Internal\RepeatedField $quantile_values + * (Optional) list of values at different quantiles of the distribution calculated + * from the current snapshot. The quantiles must be strictly increasing. + * @type int $flags + * Flags that apply to this specific data point. See DataPointFlags + * for the available flags and their meaning. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * The set of key/value pairs that uniquely identify the timeseries from + * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * The set of key/value pairs that uniquely identify the timeseries from + * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 7; + * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class); + $this->attributes = $arr; + + return $this; + } + + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + * @return int|string + */ + public function getStartTimeUnixNano() + { + return $this->start_time_unix_nano; + } + + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + * @param int|string $var + * @return $this + */ + public function setStartTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->start_time_unix_nano = $var; + + return $this; + } + + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + * @return int|string + */ + public function getTimeUnixNano() + { + return $this->time_unix_nano; + } + + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + * @param int|string $var + * @return $this + */ + public function setTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->time_unix_nano = $var; + + return $this; + } + + /** + * count is the number of values in the population. Must be non-negative. + * + * Generated from protobuf field fixed64 count = 4; + * @return int|string + */ + public function getCount() + { + return $this->count; + } + + /** + * count is the number of values in the population. Must be non-negative. + * + * Generated from protobuf field fixed64 count = 4; + * @param int|string $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkUint64($var); + $this->count = $var; + + return $this; + } + + /** + * sum of the values in the population. If count is zero then this field + * must be zero. + * Note: Sum should only be filled out when measuring non-negative discrete + * events, and is assumed to be monotonic over the values of these events. + * Negative events *can* be recorded, but sum should not be filled out when + * doing so. This is specifically to enforce compatibility w/ OpenMetrics, + * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#summary + * + * Generated from protobuf field double sum = 5; + * @return float + */ + public function getSum() + { + return $this->sum; + } + + /** + * sum of the values in the population. If count is zero then this field + * must be zero. + * Note: Sum should only be filled out when measuring non-negative discrete + * events, and is assumed to be monotonic over the values of these events. + * Negative events *can* be recorded, but sum should not be filled out when + * doing so. This is specifically to enforce compatibility w/ OpenMetrics, + * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#summary + * + * Generated from protobuf field double sum = 5; + * @param float $var + * @return $this + */ + public function setSum($var) + { + GPBUtil::checkDouble($var); + $this->sum = $var; + + return $this; + } + + /** + * (Optional) list of values at different quantiles of the distribution calculated + * from the current snapshot. The quantiles must be strictly increasing. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile quantile_values = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQuantileValues() + { + return $this->quantile_values; + } + + /** + * (Optional) list of values at different quantiles of the distribution calculated + * from the current snapshot. The quantiles must be strictly increasing. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile quantile_values = 6; + * @param \Opentelemetry\Proto\Metrics\V1\SummaryDataPoint\ValueAtQuantile[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQuantileValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\SummaryDataPoint\ValueAtQuantile::class); + $this->quantile_values = $arr; + + return $this; + } + + /** + * Flags that apply to this specific data point. See DataPointFlags + * for the available flags and their meaning. + * + * Generated from protobuf field uint32 flags = 8; + * @return int + */ + public function getFlags() + { + return $this->flags; + } + + /** + * Flags that apply to this specific data point. See DataPointFlags + * for the available flags and their meaning. + * + * Generated from protobuf field uint32 flags = 8; + * @param int $var + * @return $this + */ + public function setFlags($var) + { + GPBUtil::checkUint32($var); + $this->flags = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint/ValueAtQuantile.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint/ValueAtQuantile.php new file mode 100644 index 000000000..8200b6d26 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint/ValueAtQuantile.php @@ -0,0 +1,117 @@ +opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile + */ +class ValueAtQuantile extends \Google\Protobuf\Internal\Message +{ + /** + * The quantile of a distribution. Must be in the interval + * [0.0, 1.0]. + * + * Generated from protobuf field double quantile = 1; + */ + protected $quantile = 0.0; + /** + * The value at the given quantile of a distribution. + * Quantile values must NOT be negative. + * + * Generated from protobuf field double value = 2; + */ + protected $value = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $quantile + * The quantile of a distribution. Must be in the interval + * [0.0, 1.0]. + * @type float $value + * The value at the given quantile of a distribution. + * Quantile values must NOT be negative. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * The quantile of a distribution. Must be in the interval + * [0.0, 1.0]. + * + * Generated from protobuf field double quantile = 1; + * @return float + */ + public function getQuantile() + { + return $this->quantile; + } + + /** + * The quantile of a distribution. Must be in the interval + * [0.0, 1.0]. + * + * Generated from protobuf field double quantile = 1; + * @param float $var + * @return $this + */ + public function setQuantile($var) + { + GPBUtil::checkDouble($var); + $this->quantile = $var; + + return $this; + } + + /** + * The value at the given quantile of a distribution. + * Quantile values must NOT be negative. + * + * Generated from protobuf field double value = 2; + * @return float + */ + public function getValue() + { + return $this->value; + } + + /** + * The value at the given quantile of a distribution. + * Quantile values must NOT be negative. + * + * Generated from protobuf field double value = 2; + * @param float $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkDouble($var); + $this->value = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ValueAtQuantile::class, \Opentelemetry\Proto\Metrics\V1\SummaryDataPoint_ValueAtQuantile::class); + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint_ValueAtQuantile.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint_ValueAtQuantile.php new file mode 100644 index 000000000..c1f41e749 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint_ValueAtQuantile.php @@ -0,0 +1,16 @@ +opentelemetry.proto.resource.v1.Resource + */ +class Resource extends \Google\Protobuf\Internal\Message +{ + /** + * Set of attributes that describe the resource. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 1; + */ + private $attributes; + /** + * dropped_attributes_count is the number of dropped attributes. If the value is 0, then + * no attributes were dropped. + * + * Generated from protobuf field uint32 dropped_attributes_count = 2; + */ + protected $dropped_attributes_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes + * Set of attributes that describe the resource. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * @type int $dropped_attributes_count + * dropped_attributes_count is the number of dropped attributes. If the value is 0, then + * no attributes were dropped. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Resource\V1\Resource::initOnce(); + parent::__construct($data); + } + + /** + * Set of attributes that describe the resource. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Set of attributes that describe the resource. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 1; + * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class); + $this->attributes = $arr; + + return $this; + } + + /** + * dropped_attributes_count is the number of dropped attributes. If the value is 0, then + * no attributes were dropped. + * + * Generated from protobuf field uint32 dropped_attributes_count = 2; + * @return int + */ + public function getDroppedAttributesCount() + { + return $this->dropped_attributes_count; + } + + /** + * dropped_attributes_count is the number of dropped attributes. If the value is 0, then + * no attributes were dropped. + * + * Generated from protobuf field uint32 dropped_attributes_count = 2; + * @param int $var + * @return $this + */ + public function setDroppedAttributesCount($var) + { + GPBUtil::checkUint32($var); + $this->dropped_attributes_count = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ConstantSampler.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ConstantSampler.php new file mode 100644 index 000000000..c21482623 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ConstantSampler.php @@ -0,0 +1,60 @@ +opentelemetry.proto.trace.v1.ConstantSampler + */ +class ConstantSampler extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field .opentelemetry.proto.trace.v1.ConstantSampler.ConstantDecision decision = 1; + */ + protected $decision = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $decision + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Trace\V1\TraceConfig::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .opentelemetry.proto.trace.v1.ConstantSampler.ConstantDecision decision = 1; + * @return int + */ + public function getDecision() + { + return $this->decision; + } + + /** + * Generated from protobuf field .opentelemetry.proto.trace.v1.ConstantSampler.ConstantDecision decision = 1; + * @param int $var + * @return $this + */ + public function setDecision($var) + { + GPBUtil::checkEnum($var, \Opentelemetry\Proto\Trace\V1\ConstantSampler\ConstantDecision::class); + $this->decision = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ConstantSampler/ConstantDecision.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ConstantSampler/ConstantDecision.php new file mode 100644 index 000000000..04c1950ca --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ConstantSampler/ConstantDecision.php @@ -0,0 +1,61 @@ +opentelemetry.proto.trace.v1.ConstantSampler.ConstantDecision + */ +class ConstantDecision +{ + /** + * Generated from protobuf enum ALWAYS_OFF = 0; + */ + const ALWAYS_OFF = 0; + /** + * Generated from protobuf enum ALWAYS_ON = 1; + */ + const ALWAYS_ON = 1; + /** + * Generated from protobuf enum ALWAYS_PARENT = 2; + */ + const ALWAYS_PARENT = 2; + + private static $valueToName = [ + self::ALWAYS_OFF => 'ALWAYS_OFF', + self::ALWAYS_ON => 'ALWAYS_ON', + self::ALWAYS_PARENT => 'ALWAYS_PARENT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConstantDecision::class, \Opentelemetry\Proto\Trace\V1\ConstantSampler_ConstantDecision::class); + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ConstantSampler_ConstantDecision.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ConstantSampler_ConstantDecision.php new file mode 100644 index 000000000..e252f5f4b --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ConstantSampler_ConstantDecision.php @@ -0,0 +1,16 @@ +opentelemetry.proto.trace.v1.InstrumentationLibrarySpans + */ +class InstrumentationLibrarySpans extends \Google\Protobuf\Internal\Message +{ + /** + * The instrumentation library information for the spans in this message. + * Semantically when InstrumentationLibrary isn't set, it is equivalent with + * an empty instrumentation library name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1; + */ + protected $instrumentation_library = null; + /** + * A list of Spans that originate from an instrumentation library. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.Span spans = 2; + */ + private $spans; + /** + * This schema_url applies to all spans and span events in the "spans" field. + * + * Generated from protobuf field string schema_url = 3; + */ + protected $schema_url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\InstrumentationLibrary $instrumentation_library + * The instrumentation library information for the spans in this message. + * Semantically when InstrumentationLibrary isn't set, it is equivalent with + * an empty instrumentation library name (unknown). + * @type \Opentelemetry\Proto\Trace\V1\Span[]|\Google\Protobuf\Internal\RepeatedField $spans + * A list of Spans that originate from an instrumentation library. + * @type string $schema_url + * This schema_url applies to all spans and span events in the "spans" field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Trace\V1\Trace::initOnce(); + parent::__construct($data); + } + + /** + * The instrumentation library information for the spans in this message. + * Semantically when InstrumentationLibrary isn't set, it is equivalent with + * an empty instrumentation library name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1; + * @return \Opentelemetry\Proto\Common\V1\InstrumentationLibrary|null + */ + public function getInstrumentationLibrary() + { + return $this->instrumentation_library; + } + + public function hasInstrumentationLibrary() + { + return isset($this->instrumentation_library); + } + + public function clearInstrumentationLibrary() + { + unset($this->instrumentation_library); + } + + /** + * The instrumentation library information for the spans in this message. + * Semantically when InstrumentationLibrary isn't set, it is equivalent with + * an empty instrumentation library name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1; + * @param \Opentelemetry\Proto\Common\V1\InstrumentationLibrary $var + * @return $this + */ + public function setInstrumentationLibrary($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\InstrumentationLibrary::class); + $this->instrumentation_library = $var; + + return $this; + } + + /** + * A list of Spans that originate from an instrumentation library. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.Span spans = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSpans() + { + return $this->spans; + } + + /** + * A list of Spans that originate from an instrumentation library. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.Span spans = 2; + * @param \Opentelemetry\Proto\Trace\V1\Span[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSpans($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\Span::class); + $this->spans = $arr; + + return $this; + } + + /** + * This schema_url applies to all spans and span events in the "spans" field. + * + * Generated from protobuf field string schema_url = 3; + * @return string + */ + public function getSchemaUrl() + { + return $this->schema_url; + } + + /** + * This schema_url applies to all spans and span events in the "spans" field. + * + * Generated from protobuf field string schema_url = 3; + * @param string $var + * @return $this + */ + public function setSchemaUrl($var) + { + GPBUtil::checkString($var, True); + $this->schema_url = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/RateLimitingSampler.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/RateLimitingSampler.php new file mode 100644 index 000000000..3fd17fb01 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/RateLimitingSampler.php @@ -0,0 +1,67 @@ +opentelemetry.proto.trace.v1.RateLimitingSampler + */ +class RateLimitingSampler extends \Google\Protobuf\Internal\Message +{ + /** + * Rate per second. + * + * Generated from protobuf field int64 qps = 1; + */ + protected $qps = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $qps + * Rate per second. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Trace\V1\TraceConfig::initOnce(); + parent::__construct($data); + } + + /** + * Rate per second. + * + * Generated from protobuf field int64 qps = 1; + * @return int|string + */ + public function getQps() + { + return $this->qps; + } + + /** + * Rate per second. + * + * Generated from protobuf field int64 qps = 1; + * @param int|string $var + * @return $this + */ + public function setQps($var) + { + GPBUtil::checkInt64($var); + $this->qps = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ResourceSpans.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ResourceSpans.php new file mode 100644 index 000000000..521250920 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ResourceSpans.php @@ -0,0 +1,153 @@ +opentelemetry.proto.trace.v1.ResourceSpans + */ +class ResourceSpans extends \Google\Protobuf\Internal\Message +{ + /** + * The resource for the spans in this message. + * If this field is not set then no resource info is known. + * + * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; + */ + protected $resource = null; + /** + * A list of ScopeSpans that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.ScopeSpans scope_spans = 2; + */ + private $scope_spans; + /** + * This schema_url applies to the data in the "resource" field. It does not apply + * to the data in the "scope_spans" field which have their own schema_url field. + * + * Generated from protobuf field string schema_url = 3; + */ + protected $schema_url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Resource\V1\Resource $resource + * The resource for the spans in this message. + * If this field is not set then no resource info is known. + * @type \Opentelemetry\Proto\Trace\V1\ScopeSpans[]|\Google\Protobuf\Internal\RepeatedField $scope_spans + * A list of ScopeSpans that originate from a resource. + * @type string $schema_url + * This schema_url applies to the data in the "resource" field. It does not apply + * to the data in the "scope_spans" field which have their own schema_url field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Trace\V1\Trace::initOnce(); + parent::__construct($data); + } + + /** + * The resource for the spans in this message. + * If this field is not set then no resource info is known. + * + * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; + * @return \Opentelemetry\Proto\Resource\V1\Resource|null + */ + public function getResource() + { + return $this->resource; + } + + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + + /** + * The resource for the spans in this message. + * If this field is not set then no resource info is known. + * + * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; + * @param \Opentelemetry\Proto\Resource\V1\Resource $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Resource\V1\Resource::class); + $this->resource = $var; + + return $this; + } + + /** + * A list of ScopeSpans that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.ScopeSpans scope_spans = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScopeSpans() + { + return $this->scope_spans; + } + + /** + * A list of ScopeSpans that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.ScopeSpans scope_spans = 2; + * @param \Opentelemetry\Proto\Trace\V1\ScopeSpans[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopeSpans($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\ScopeSpans::class); + $this->scope_spans = $arr; + + return $this; + } + + /** + * This schema_url applies to the data in the "resource" field. It does not apply + * to the data in the "scope_spans" field which have their own schema_url field. + * + * Generated from protobuf field string schema_url = 3; + * @return string + */ + public function getSchemaUrl() + { + return $this->schema_url; + } + + /** + * This schema_url applies to the data in the "resource" field. It does not apply + * to the data in the "scope_spans" field which have their own schema_url field. + * + * Generated from protobuf field string schema_url = 3; + * @param string $var + * @return $this + */ + public function setSchemaUrl($var) + { + GPBUtil::checkString($var, True); + $this->schema_url = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ScopeSpans.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ScopeSpans.php new file mode 100644 index 000000000..098376f7d --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/ScopeSpans.php @@ -0,0 +1,153 @@ +opentelemetry.proto.trace.v1.ScopeSpans + */ +class ScopeSpans extends \Google\Protobuf\Internal\Message +{ + /** + * The instrumentation scope information for the spans in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationScope scope = 1; + */ + protected $scope = null; + /** + * A list of Spans that originate from an instrumentation scope. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.Span spans = 2; + */ + private $spans; + /** + * This schema_url applies to all spans and span events in the "spans" field. + * + * Generated from protobuf field string schema_url = 3; + */ + protected $schema_url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\InstrumentationScope $scope + * The instrumentation scope information for the spans in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * @type \Opentelemetry\Proto\Trace\V1\Span[]|\Google\Protobuf\Internal\RepeatedField $spans + * A list of Spans that originate from an instrumentation scope. + * @type string $schema_url + * This schema_url applies to all spans and span events in the "spans" field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Trace\V1\Trace::initOnce(); + parent::__construct($data); + } + + /** + * The instrumentation scope information for the spans in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationScope scope = 1; + * @return \Opentelemetry\Proto\Common\V1\InstrumentationScope|null + */ + public function getScope() + { + return $this->scope; + } + + public function hasScope() + { + return isset($this->scope); + } + + public function clearScope() + { + unset($this->scope); + } + + /** + * The instrumentation scope information for the spans in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationScope scope = 1; + * @param \Opentelemetry\Proto\Common\V1\InstrumentationScope $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\InstrumentationScope::class); + $this->scope = $var; + + return $this; + } + + /** + * A list of Spans that originate from an instrumentation scope. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.Span spans = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSpans() + { + return $this->spans; + } + + /** + * A list of Spans that originate from an instrumentation scope. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.Span spans = 2; + * @param \Opentelemetry\Proto\Trace\V1\Span[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSpans($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\Span::class); + $this->spans = $arr; + + return $this; + } + + /** + * This schema_url applies to all spans and span events in the "spans" field. + * + * Generated from protobuf field string schema_url = 3; + * @return string + */ + public function getSchemaUrl() + { + return $this->schema_url; + } + + /** + * This schema_url applies to all spans and span events in the "spans" field. + * + * Generated from protobuf field string schema_url = 3; + * @param string $var + * @return $this + */ + public function setSchemaUrl($var) + { + GPBUtil::checkString($var, True); + $this->schema_url = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span.php new file mode 100644 index 000000000..4b1dc138c --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span.php @@ -0,0 +1,726 @@ +opentelemetry.proto.trace.v1.Span + */ +class Span extends \Google\Protobuf\Internal\Message +{ + /** + * A unique identifier for a trace. All spans from the same trace share + * the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes OR + * of length other than 16 bytes is considered invalid (empty string in OTLP/JSON + * is zero-length and thus is also invalid). + * This field is required. + * + * Generated from protobuf field bytes trace_id = 1; + */ + protected $trace_id = ''; + /** + * A unique identifier for a span within a trace, assigned when the span + * is created. The ID is an 8-byte array. An ID with all zeroes OR of length + * other than 8 bytes is considered invalid (empty string in OTLP/JSON + * is zero-length and thus is also invalid). + * This field is required. + * + * Generated from protobuf field bytes span_id = 2; + */ + protected $span_id = ''; + /** + * trace_state conveys information about request position in multiple distributed tracing graphs. + * It is a trace_state in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header + * See also https://github.com/w3c/distributed-tracing for more details about this field. + * + * Generated from protobuf field string trace_state = 3; + */ + protected $trace_state = ''; + /** + * The `span_id` of this span's parent span. If this is a root span, then this + * field must be empty. The ID is an 8-byte array. + * + * Generated from protobuf field bytes parent_span_id = 4; + */ + protected $parent_span_id = ''; + /** + * A description of the span's operation. + * For example, the name can be a qualified method name or a file name + * and a line number where the operation is called. A best practice is to use + * the same display name at the same call point in an application. + * This makes it easier to correlate spans in different traces. + * This field is semantically required to be set to non-empty string. + * Empty value is equivalent to an unknown span name. + * This field is required. + * + * Generated from protobuf field string name = 5; + */ + protected $name = ''; + /** + * Distinguishes between spans generated in a particular context. For example, + * two spans with the same name may be distinguished using `CLIENT` (caller) + * and `SERVER` (callee) to identify queueing latency associated with the span. + * + * Generated from protobuf field .opentelemetry.proto.trace.v1.Span.SpanKind kind = 6; + */ + protected $kind = 0; + /** + * start_time_unix_nano is the start time of the span. On the client side, this is the time + * kept by the local machine where the span execution starts. On the server side, this + * is the time when the server's application handler starts running. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * This field is semantically required and it is expected that end_time >= start_time. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 7; + */ + protected $start_time_unix_nano = 0; + /** + * end_time_unix_nano is the end time of the span. On the client side, this is the time + * kept by the local machine where the span execution ends. On the server side, this + * is the time when the server application handler stops running. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * This field is semantically required and it is expected that end_time >= start_time. + * + * Generated from protobuf field fixed64 end_time_unix_nano = 8; + */ + protected $end_time_unix_nano = 0; + /** + * attributes is a collection of key/value pairs. Note, global attributes + * like server name can be set using the resource API. Examples of attributes: + * "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" + * "/http/server_latency": 300 + * "example.com/myattribute": true + * "example.com/score": 10.239 + * The OpenTelemetry API specification further restricts the allowed value types: + * https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 9; + */ + private $attributes; + /** + * dropped_attributes_count is the number of attributes that were discarded. Attributes + * can be discarded because their keys are too long or because there are too many + * attributes. If this value is 0, then no attributes were dropped. + * + * Generated from protobuf field uint32 dropped_attributes_count = 10; + */ + protected $dropped_attributes_count = 0; + /** + * events is a collection of Event items. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.Span.Event events = 11; + */ + private $events; + /** + * dropped_events_count is the number of dropped events. If the value is 0, then no + * events were dropped. + * + * Generated from protobuf field uint32 dropped_events_count = 12; + */ + protected $dropped_events_count = 0; + /** + * links is a collection of Links, which are references from this span to a span + * in the same or different trace. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.Span.Link links = 13; + */ + private $links; + /** + * dropped_links_count is the number of dropped links after the maximum size was + * enforced. If this value is 0, then no links were dropped. + * + * Generated from protobuf field uint32 dropped_links_count = 14; + */ + protected $dropped_links_count = 0; + /** + * An optional final status for this span. Semantically when Status isn't set, it means + * span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0). + * + * Generated from protobuf field .opentelemetry.proto.trace.v1.Status status = 15; + */ + protected $status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $trace_id + * A unique identifier for a trace. All spans from the same trace share + * the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes OR + * of length other than 16 bytes is considered invalid (empty string in OTLP/JSON + * is zero-length and thus is also invalid). + * This field is required. + * @type string $span_id + * A unique identifier for a span within a trace, assigned when the span + * is created. The ID is an 8-byte array. An ID with all zeroes OR of length + * other than 8 bytes is considered invalid (empty string in OTLP/JSON + * is zero-length and thus is also invalid). + * This field is required. + * @type string $trace_state + * trace_state conveys information about request position in multiple distributed tracing graphs. + * It is a trace_state in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header + * See also https://github.com/w3c/distributed-tracing for more details about this field. + * @type string $parent_span_id + * The `span_id` of this span's parent span. If this is a root span, then this + * field must be empty. The ID is an 8-byte array. + * @type string $name + * A description of the span's operation. + * For example, the name can be a qualified method name or a file name + * and a line number where the operation is called. A best practice is to use + * the same display name at the same call point in an application. + * This makes it easier to correlate spans in different traces. + * This field is semantically required to be set to non-empty string. + * Empty value is equivalent to an unknown span name. + * This field is required. + * @type int $kind + * Distinguishes between spans generated in a particular context. For example, + * two spans with the same name may be distinguished using `CLIENT` (caller) + * and `SERVER` (callee) to identify queueing latency associated with the span. + * @type int|string $start_time_unix_nano + * start_time_unix_nano is the start time of the span. On the client side, this is the time + * kept by the local machine where the span execution starts. On the server side, this + * is the time when the server's application handler starts running. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * This field is semantically required and it is expected that end_time >= start_time. + * @type int|string $end_time_unix_nano + * end_time_unix_nano is the end time of the span. On the client side, this is the time + * kept by the local machine where the span execution ends. On the server side, this + * is the time when the server application handler stops running. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * This field is semantically required and it is expected that end_time >= start_time. + * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes + * attributes is a collection of key/value pairs. Note, global attributes + * like server name can be set using the resource API. Examples of attributes: + * "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" + * "/http/server_latency": 300 + * "example.com/myattribute": true + * "example.com/score": 10.239 + * The OpenTelemetry API specification further restricts the allowed value types: + * https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * @type int $dropped_attributes_count + * dropped_attributes_count is the number of attributes that were discarded. Attributes + * can be discarded because their keys are too long or because there are too many + * attributes. If this value is 0, then no attributes were dropped. + * @type \Opentelemetry\Proto\Trace\V1\Span\Event[]|\Google\Protobuf\Internal\RepeatedField $events + * events is a collection of Event items. + * @type int $dropped_events_count + * dropped_events_count is the number of dropped events. If the value is 0, then no + * events were dropped. + * @type \Opentelemetry\Proto\Trace\V1\Span\Link[]|\Google\Protobuf\Internal\RepeatedField $links + * links is a collection of Links, which are references from this span to a span + * in the same or different trace. + * @type int $dropped_links_count + * dropped_links_count is the number of dropped links after the maximum size was + * enforced. If this value is 0, then no links were dropped. + * @type \Opentelemetry\Proto\Trace\V1\Status $status + * An optional final status for this span. Semantically when Status isn't set, it means + * span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Trace\V1\Trace::initOnce(); + parent::__construct($data); + } + + /** + * A unique identifier for a trace. All spans from the same trace share + * the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes OR + * of length other than 16 bytes is considered invalid (empty string in OTLP/JSON + * is zero-length and thus is also invalid). + * This field is required. + * + * Generated from protobuf field bytes trace_id = 1; + * @return string + */ + public function getTraceId() + { + return $this->trace_id; + } + + /** + * A unique identifier for a trace. All spans from the same trace share + * the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes OR + * of length other than 16 bytes is considered invalid (empty string in OTLP/JSON + * is zero-length and thus is also invalid). + * This field is required. + * + * Generated from protobuf field bytes trace_id = 1; + * @param string $var + * @return $this + */ + public function setTraceId($var) + { + GPBUtil::checkString($var, False); + $this->trace_id = $var; + + return $this; + } + + /** + * A unique identifier for a span within a trace, assigned when the span + * is created. The ID is an 8-byte array. An ID with all zeroes OR of length + * other than 8 bytes is considered invalid (empty string in OTLP/JSON + * is zero-length and thus is also invalid). + * This field is required. + * + * Generated from protobuf field bytes span_id = 2; + * @return string + */ + public function getSpanId() + { + return $this->span_id; + } + + /** + * A unique identifier for a span within a trace, assigned when the span + * is created. The ID is an 8-byte array. An ID with all zeroes OR of length + * other than 8 bytes is considered invalid (empty string in OTLP/JSON + * is zero-length and thus is also invalid). + * This field is required. + * + * Generated from protobuf field bytes span_id = 2; + * @param string $var + * @return $this + */ + public function setSpanId($var) + { + GPBUtil::checkString($var, False); + $this->span_id = $var; + + return $this; + } + + /** + * trace_state conveys information about request position in multiple distributed tracing graphs. + * It is a trace_state in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header + * See also https://github.com/w3c/distributed-tracing for more details about this field. + * + * Generated from protobuf field string trace_state = 3; + * @return string + */ + public function getTraceState() + { + return $this->trace_state; + } + + /** + * trace_state conveys information about request position in multiple distributed tracing graphs. + * It is a trace_state in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header + * See also https://github.com/w3c/distributed-tracing for more details about this field. + * + * Generated from protobuf field string trace_state = 3; + * @param string $var + * @return $this + */ + public function setTraceState($var) + { + GPBUtil::checkString($var, True); + $this->trace_state = $var; + + return $this; + } + + /** + * The `span_id` of this span's parent span. If this is a root span, then this + * field must be empty. The ID is an 8-byte array. + * + * Generated from protobuf field bytes parent_span_id = 4; + * @return string + */ + public function getParentSpanId() + { + return $this->parent_span_id; + } + + /** + * The `span_id` of this span's parent span. If this is a root span, then this + * field must be empty. The ID is an 8-byte array. + * + * Generated from protobuf field bytes parent_span_id = 4; + * @param string $var + * @return $this + */ + public function setParentSpanId($var) + { + GPBUtil::checkString($var, False); + $this->parent_span_id = $var; + + return $this; + } + + /** + * A description of the span's operation. + * For example, the name can be a qualified method name or a file name + * and a line number where the operation is called. A best practice is to use + * the same display name at the same call point in an application. + * This makes it easier to correlate spans in different traces. + * This field is semantically required to be set to non-empty string. + * Empty value is equivalent to an unknown span name. + * This field is required. + * + * Generated from protobuf field string name = 5; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * A description of the span's operation. + * For example, the name can be a qualified method name or a file name + * and a line number where the operation is called. A best practice is to use + * the same display name at the same call point in an application. + * This makes it easier to correlate spans in different traces. + * This field is semantically required to be set to non-empty string. + * Empty value is equivalent to an unknown span name. + * This field is required. + * + * Generated from protobuf field string name = 5; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Distinguishes between spans generated in a particular context. For example, + * two spans with the same name may be distinguished using `CLIENT` (caller) + * and `SERVER` (callee) to identify queueing latency associated with the span. + * + * Generated from protobuf field .opentelemetry.proto.trace.v1.Span.SpanKind kind = 6; + * @return int + */ + public function getKind() + { + return $this->kind; + } + + /** + * Distinguishes between spans generated in a particular context. For example, + * two spans with the same name may be distinguished using `CLIENT` (caller) + * and `SERVER` (callee) to identify queueing latency associated with the span. + * + * Generated from protobuf field .opentelemetry.proto.trace.v1.Span.SpanKind kind = 6; + * @param int $var + * @return $this + */ + public function setKind($var) + { + GPBUtil::checkEnum($var, \Opentelemetry\Proto\Trace\V1\Span\SpanKind::class); + $this->kind = $var; + + return $this; + } + + /** + * start_time_unix_nano is the start time of the span. On the client side, this is the time + * kept by the local machine where the span execution starts. On the server side, this + * is the time when the server's application handler starts running. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * This field is semantically required and it is expected that end_time >= start_time. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 7; + * @return int|string + */ + public function getStartTimeUnixNano() + { + return $this->start_time_unix_nano; + } + + /** + * start_time_unix_nano is the start time of the span. On the client side, this is the time + * kept by the local machine where the span execution starts. On the server side, this + * is the time when the server's application handler starts running. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * This field is semantically required and it is expected that end_time >= start_time. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 7; + * @param int|string $var + * @return $this + */ + public function setStartTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->start_time_unix_nano = $var; + + return $this; + } + + /** + * end_time_unix_nano is the end time of the span. On the client side, this is the time + * kept by the local machine where the span execution ends. On the server side, this + * is the time when the server application handler stops running. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * This field is semantically required and it is expected that end_time >= start_time. + * + * Generated from protobuf field fixed64 end_time_unix_nano = 8; + * @return int|string + */ + public function getEndTimeUnixNano() + { + return $this->end_time_unix_nano; + } + + /** + * end_time_unix_nano is the end time of the span. On the client side, this is the time + * kept by the local machine where the span execution ends. On the server side, this + * is the time when the server application handler stops running. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * This field is semantically required and it is expected that end_time >= start_time. + * + * Generated from protobuf field fixed64 end_time_unix_nano = 8; + * @param int|string $var + * @return $this + */ + public function setEndTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->end_time_unix_nano = $var; + + return $this; + } + + /** + * attributes is a collection of key/value pairs. Note, global attributes + * like server name can be set using the resource API. Examples of attributes: + * "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" + * "/http/server_latency": 300 + * "example.com/myattribute": true + * "example.com/score": 10.239 + * The OpenTelemetry API specification further restricts the allowed value types: + * https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * attributes is a collection of key/value pairs. Note, global attributes + * like server name can be set using the resource API. Examples of attributes: + * "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" + * "/http/server_latency": 300 + * "example.com/myattribute": true + * "example.com/score": 10.239 + * The OpenTelemetry API specification further restricts the allowed value types: + * https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 9; + * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class); + $this->attributes = $arr; + + return $this; + } + + /** + * dropped_attributes_count is the number of attributes that were discarded. Attributes + * can be discarded because their keys are too long or because there are too many + * attributes. If this value is 0, then no attributes were dropped. + * + * Generated from protobuf field uint32 dropped_attributes_count = 10; + * @return int + */ + public function getDroppedAttributesCount() + { + return $this->dropped_attributes_count; + } + + /** + * dropped_attributes_count is the number of attributes that were discarded. Attributes + * can be discarded because their keys are too long or because there are too many + * attributes. If this value is 0, then no attributes were dropped. + * + * Generated from protobuf field uint32 dropped_attributes_count = 10; + * @param int $var + * @return $this + */ + public function setDroppedAttributesCount($var) + { + GPBUtil::checkUint32($var); + $this->dropped_attributes_count = $var; + + return $this; + } + + /** + * events is a collection of Event items. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.Span.Event events = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEvents() + { + return $this->events; + } + + /** + * events is a collection of Event items. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.Span.Event events = 11; + * @param \Opentelemetry\Proto\Trace\V1\Span\Event[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\Span\Event::class); + $this->events = $arr; + + return $this; + } + + /** + * dropped_events_count is the number of dropped events. If the value is 0, then no + * events were dropped. + * + * Generated from protobuf field uint32 dropped_events_count = 12; + * @return int + */ + public function getDroppedEventsCount() + { + return $this->dropped_events_count; + } + + /** + * dropped_events_count is the number of dropped events. If the value is 0, then no + * events were dropped. + * + * Generated from protobuf field uint32 dropped_events_count = 12; + * @param int $var + * @return $this + */ + public function setDroppedEventsCount($var) + { + GPBUtil::checkUint32($var); + $this->dropped_events_count = $var; + + return $this; + } + + /** + * links is a collection of Links, which are references from this span to a span + * in the same or different trace. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.Span.Link links = 13; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLinks() + { + return $this->links; + } + + /** + * links is a collection of Links, which are references from this span to a span + * in the same or different trace. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.Span.Link links = 13; + * @param \Opentelemetry\Proto\Trace\V1\Span\Link[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\Span\Link::class); + $this->links = $arr; + + return $this; + } + + /** + * dropped_links_count is the number of dropped links after the maximum size was + * enforced. If this value is 0, then no links were dropped. + * + * Generated from protobuf field uint32 dropped_links_count = 14; + * @return int + */ + public function getDroppedLinksCount() + { + return $this->dropped_links_count; + } + + /** + * dropped_links_count is the number of dropped links after the maximum size was + * enforced. If this value is 0, then no links were dropped. + * + * Generated from protobuf field uint32 dropped_links_count = 14; + * @param int $var + * @return $this + */ + public function setDroppedLinksCount($var) + { + GPBUtil::checkUint32($var); + $this->dropped_links_count = $var; + + return $this; + } + + /** + * An optional final status for this span. Semantically when Status isn't set, it means + * span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0). + * + * Generated from protobuf field .opentelemetry.proto.trace.v1.Status status = 15; + * @return \Opentelemetry\Proto\Trace\V1\Status|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * An optional final status for this span. Semantically when Status isn't set, it means + * span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0). + * + * Generated from protobuf field .opentelemetry.proto.trace.v1.Status status = 15; + * @param \Opentelemetry\Proto\Trace\V1\Status $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Trace\V1\Status::class); + $this->status = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span/Event.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span/Event.php new file mode 100644 index 000000000..c6b7a1807 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span/Event.php @@ -0,0 +1,189 @@ +opentelemetry.proto.trace.v1.Span.Event + */ +class Event extends \Google\Protobuf\Internal\Message +{ + /** + * time_unix_nano is the time the event occurred. + * + * Generated from protobuf field fixed64 time_unix_nano = 1; + */ + protected $time_unix_nano = 0; + /** + * name of the event. + * This field is semantically required to be set to non-empty string. + * + * Generated from protobuf field string name = 2; + */ + protected $name = ''; + /** + * attributes is a collection of attribute key/value pairs on the event. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 3; + */ + private $attributes; + /** + * dropped_attributes_count is the number of dropped attributes. If the value is 0, + * then no attributes were dropped. + * + * Generated from protobuf field uint32 dropped_attributes_count = 4; + */ + protected $dropped_attributes_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $time_unix_nano + * time_unix_nano is the time the event occurred. + * @type string $name + * name of the event. + * This field is semantically required to be set to non-empty string. + * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes + * attributes is a collection of attribute key/value pairs on the event. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * @type int $dropped_attributes_count + * dropped_attributes_count is the number of dropped attributes. If the value is 0, + * then no attributes were dropped. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Trace\V1\Trace::initOnce(); + parent::__construct($data); + } + + /** + * time_unix_nano is the time the event occurred. + * + * Generated from protobuf field fixed64 time_unix_nano = 1; + * @return int|string + */ + public function getTimeUnixNano() + { + return $this->time_unix_nano; + } + + /** + * time_unix_nano is the time the event occurred. + * + * Generated from protobuf field fixed64 time_unix_nano = 1; + * @param int|string $var + * @return $this + */ + public function setTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->time_unix_nano = $var; + + return $this; + } + + /** + * name of the event. + * This field is semantically required to be set to non-empty string. + * + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * name of the event. + * This field is semantically required to be set to non-empty string. + * + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * attributes is a collection of attribute key/value pairs on the event. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * attributes is a collection of attribute key/value pairs on the event. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 3; + * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class); + $this->attributes = $arr; + + return $this; + } + + /** + * dropped_attributes_count is the number of dropped attributes. If the value is 0, + * then no attributes were dropped. + * + * Generated from protobuf field uint32 dropped_attributes_count = 4; + * @return int + */ + public function getDroppedAttributesCount() + { + return $this->dropped_attributes_count; + } + + /** + * dropped_attributes_count is the number of dropped attributes. If the value is 0, + * then no attributes were dropped. + * + * Generated from protobuf field uint32 dropped_attributes_count = 4; + * @param int $var + * @return $this + */ + public function setDroppedAttributesCount($var) + { + GPBUtil::checkUint32($var); + $this->dropped_attributes_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Event::class, \Opentelemetry\Proto\Trace\V1\Span_Event::class); + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span/Link.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span/Link.php new file mode 100644 index 000000000..3096739de --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span/Link.php @@ -0,0 +1,225 @@ +opentelemetry.proto.trace.v1.Span.Link + */ +class Link extends \Google\Protobuf\Internal\Message +{ + /** + * A unique identifier of a trace that this linked span is part of. The ID is a + * 16-byte array. + * + * Generated from protobuf field bytes trace_id = 1; + */ + protected $trace_id = ''; + /** + * A unique identifier for the linked span. The ID is an 8-byte array. + * + * Generated from protobuf field bytes span_id = 2; + */ + protected $span_id = ''; + /** + * The trace_state associated with the link. + * + * Generated from protobuf field string trace_state = 3; + */ + protected $trace_state = ''; + /** + * attributes is a collection of attribute key/value pairs on the link. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 4; + */ + private $attributes; + /** + * dropped_attributes_count is the number of dropped attributes. If the value is 0, + * then no attributes were dropped. + * + * Generated from protobuf field uint32 dropped_attributes_count = 5; + */ + protected $dropped_attributes_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $trace_id + * A unique identifier of a trace that this linked span is part of. The ID is a + * 16-byte array. + * @type string $span_id + * A unique identifier for the linked span. The ID is an 8-byte array. + * @type string $trace_state + * The trace_state associated with the link. + * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes + * attributes is a collection of attribute key/value pairs on the link. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * @type int $dropped_attributes_count + * dropped_attributes_count is the number of dropped attributes. If the value is 0, + * then no attributes were dropped. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Trace\V1\Trace::initOnce(); + parent::__construct($data); + } + + /** + * A unique identifier of a trace that this linked span is part of. The ID is a + * 16-byte array. + * + * Generated from protobuf field bytes trace_id = 1; + * @return string + */ + public function getTraceId() + { + return $this->trace_id; + } + + /** + * A unique identifier of a trace that this linked span is part of. The ID is a + * 16-byte array. + * + * Generated from protobuf field bytes trace_id = 1; + * @param string $var + * @return $this + */ + public function setTraceId($var) + { + GPBUtil::checkString($var, False); + $this->trace_id = $var; + + return $this; + } + + /** + * A unique identifier for the linked span. The ID is an 8-byte array. + * + * Generated from protobuf field bytes span_id = 2; + * @return string + */ + public function getSpanId() + { + return $this->span_id; + } + + /** + * A unique identifier for the linked span. The ID is an 8-byte array. + * + * Generated from protobuf field bytes span_id = 2; + * @param string $var + * @return $this + */ + public function setSpanId($var) + { + GPBUtil::checkString($var, False); + $this->span_id = $var; + + return $this; + } + + /** + * The trace_state associated with the link. + * + * Generated from protobuf field string trace_state = 3; + * @return string + */ + public function getTraceState() + { + return $this->trace_state; + } + + /** + * The trace_state associated with the link. + * + * Generated from protobuf field string trace_state = 3; + * @param string $var + * @return $this + */ + public function setTraceState($var) + { + GPBUtil::checkString($var, True); + $this->trace_state = $var; + + return $this; + } + + /** + * attributes is a collection of attribute key/value pairs on the link. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * attributes is a collection of attribute key/value pairs on the link. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 4; + * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class); + $this->attributes = $arr; + + return $this; + } + + /** + * dropped_attributes_count is the number of dropped attributes. If the value is 0, + * then no attributes were dropped. + * + * Generated from protobuf field uint32 dropped_attributes_count = 5; + * @return int + */ + public function getDroppedAttributesCount() + { + return $this->dropped_attributes_count; + } + + /** + * dropped_attributes_count is the number of dropped attributes. If the value is 0, + * then no attributes were dropped. + * + * Generated from protobuf field uint32 dropped_attributes_count = 5; + * @param int $var + * @return $this + */ + public function setDroppedAttributesCount($var) + { + GPBUtil::checkUint32($var); + $this->dropped_attributes_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Link::class, \Opentelemetry\Proto\Trace\V1\Span_Link::class); + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span/SpanKind.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span/SpanKind.php new file mode 100644 index 000000000..9ffa93719 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span/SpanKind.php @@ -0,0 +1,94 @@ +opentelemetry.proto.trace.v1.Span.SpanKind + */ +class SpanKind +{ + /** + * Unspecified. Do NOT use as default. + * Implementations MAY assume SpanKind to be INTERNAL when receiving UNSPECIFIED. + * + * Generated from protobuf enum SPAN_KIND_UNSPECIFIED = 0; + */ + const SPAN_KIND_UNSPECIFIED = 0; + /** + * Indicates that the span represents an internal operation within an application, + * as opposed to an operation happening at the boundaries. Default value. + * + * Generated from protobuf enum SPAN_KIND_INTERNAL = 1; + */ + const SPAN_KIND_INTERNAL = 1; + /** + * Indicates that the span covers server-side handling of an RPC or other + * remote network request. + * + * Generated from protobuf enum SPAN_KIND_SERVER = 2; + */ + const SPAN_KIND_SERVER = 2; + /** + * Indicates that the span describes a request to some remote service. + * + * Generated from protobuf enum SPAN_KIND_CLIENT = 3; + */ + const SPAN_KIND_CLIENT = 3; + /** + * Indicates that the span describes a producer sending a message to a broker. + * Unlike CLIENT and SERVER, there is often no direct critical path latency relationship + * between producer and consumer spans. A PRODUCER span ends when the message was accepted + * by the broker while the logical processing of the message might span a much longer time. + * + * Generated from protobuf enum SPAN_KIND_PRODUCER = 4; + */ + const SPAN_KIND_PRODUCER = 4; + /** + * Indicates that the span describes consumer receiving a message from a broker. + * Like the PRODUCER kind, there is often no direct critical path latency relationship + * between producer and consumer spans. + * + * Generated from protobuf enum SPAN_KIND_CONSUMER = 5; + */ + const SPAN_KIND_CONSUMER = 5; + + private static $valueToName = [ + self::SPAN_KIND_UNSPECIFIED => 'SPAN_KIND_UNSPECIFIED', + self::SPAN_KIND_INTERNAL => 'SPAN_KIND_INTERNAL', + self::SPAN_KIND_SERVER => 'SPAN_KIND_SERVER', + self::SPAN_KIND_CLIENT => 'SPAN_KIND_CLIENT', + self::SPAN_KIND_PRODUCER => 'SPAN_KIND_PRODUCER', + self::SPAN_KIND_CONSUMER => 'SPAN_KIND_CONSUMER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SpanKind::class, \Opentelemetry\Proto\Trace\V1\Span_SpanKind::class); + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span_Event.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span_Event.php new file mode 100644 index 000000000..168b7b129 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span_Event.php @@ -0,0 +1,16 @@ +opentelemetry.proto.trace.v1.Status + */ +class Status extends \Google\Protobuf\Internal\Message +{ + /** + * A developer-facing human readable error message. + * + * Generated from protobuf field string message = 2; + */ + protected $message = ''; + /** + * The status code. + * + * Generated from protobuf field .opentelemetry.proto.trace.v1.Status.StatusCode code = 3; + */ + protected $code = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $message + * A developer-facing human readable error message. + * @type int $code + * The status code. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Trace\V1\Trace::initOnce(); + parent::__construct($data); + } + + /** + * A developer-facing human readable error message. + * + * Generated from protobuf field string message = 2; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * A developer-facing human readable error message. + * + * Generated from protobuf field string message = 2; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + + /** + * The status code. + * + * Generated from protobuf field .opentelemetry.proto.trace.v1.Status.StatusCode code = 3; + * @return int + */ + public function getCode() + { + return $this->code; + } + + /** + * The status code. + * + * Generated from protobuf field .opentelemetry.proto.trace.v1.Status.StatusCode code = 3; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkEnum($var, \Opentelemetry\Proto\Trace\V1\Status\StatusCode::class); + $this->code = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Status/DeprecatedStatusCode.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Status/DeprecatedStatusCode.php new file mode 100644 index 000000000..9a078e2ef --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Status/DeprecatedStatusCode.php @@ -0,0 +1,126 @@ +opentelemetry.proto.trace.v1.Status.DeprecatedStatusCode + */ +class DeprecatedStatusCode +{ + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_OK = 0; + */ + const DEPRECATED_STATUS_CODE_OK = 0; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_CANCELLED = 1; + */ + const DEPRECATED_STATUS_CODE_CANCELLED = 1; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_UNKNOWN_ERROR = 2; + */ + const DEPRECATED_STATUS_CODE_UNKNOWN_ERROR = 2; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_INVALID_ARGUMENT = 3; + */ + const DEPRECATED_STATUS_CODE_INVALID_ARGUMENT = 3; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED = 4; + */ + const DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED = 4; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_NOT_FOUND = 5; + */ + const DEPRECATED_STATUS_CODE_NOT_FOUND = 5; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_ALREADY_EXISTS = 6; + */ + const DEPRECATED_STATUS_CODE_ALREADY_EXISTS = 6; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_PERMISSION_DENIED = 7; + */ + const DEPRECATED_STATUS_CODE_PERMISSION_DENIED = 7; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED = 8; + */ + const DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED = 8; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_FAILED_PRECONDITION = 9; + */ + const DEPRECATED_STATUS_CODE_FAILED_PRECONDITION = 9; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_ABORTED = 10; + */ + const DEPRECATED_STATUS_CODE_ABORTED = 10; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_OUT_OF_RANGE = 11; + */ + const DEPRECATED_STATUS_CODE_OUT_OF_RANGE = 11; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_UNIMPLEMENTED = 12; + */ + const DEPRECATED_STATUS_CODE_UNIMPLEMENTED = 12; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_INTERNAL_ERROR = 13; + */ + const DEPRECATED_STATUS_CODE_INTERNAL_ERROR = 13; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_UNAVAILABLE = 14; + */ + const DEPRECATED_STATUS_CODE_UNAVAILABLE = 14; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_DATA_LOSS = 15; + */ + const DEPRECATED_STATUS_CODE_DATA_LOSS = 15; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_UNAUTHENTICATED = 16; + */ + const DEPRECATED_STATUS_CODE_UNAUTHENTICATED = 16; + + private static $valueToName = [ + self::DEPRECATED_STATUS_CODE_OK => 'DEPRECATED_STATUS_CODE_OK', + self::DEPRECATED_STATUS_CODE_CANCELLED => 'DEPRECATED_STATUS_CODE_CANCELLED', + self::DEPRECATED_STATUS_CODE_UNKNOWN_ERROR => 'DEPRECATED_STATUS_CODE_UNKNOWN_ERROR', + self::DEPRECATED_STATUS_CODE_INVALID_ARGUMENT => 'DEPRECATED_STATUS_CODE_INVALID_ARGUMENT', + self::DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED => 'DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED', + self::DEPRECATED_STATUS_CODE_NOT_FOUND => 'DEPRECATED_STATUS_CODE_NOT_FOUND', + self::DEPRECATED_STATUS_CODE_ALREADY_EXISTS => 'DEPRECATED_STATUS_CODE_ALREADY_EXISTS', + self::DEPRECATED_STATUS_CODE_PERMISSION_DENIED => 'DEPRECATED_STATUS_CODE_PERMISSION_DENIED', + self::DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED => 'DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED', + self::DEPRECATED_STATUS_CODE_FAILED_PRECONDITION => 'DEPRECATED_STATUS_CODE_FAILED_PRECONDITION', + self::DEPRECATED_STATUS_CODE_ABORTED => 'DEPRECATED_STATUS_CODE_ABORTED', + self::DEPRECATED_STATUS_CODE_OUT_OF_RANGE => 'DEPRECATED_STATUS_CODE_OUT_OF_RANGE', + self::DEPRECATED_STATUS_CODE_UNIMPLEMENTED => 'DEPRECATED_STATUS_CODE_UNIMPLEMENTED', + self::DEPRECATED_STATUS_CODE_INTERNAL_ERROR => 'DEPRECATED_STATUS_CODE_INTERNAL_ERROR', + self::DEPRECATED_STATUS_CODE_UNAVAILABLE => 'DEPRECATED_STATUS_CODE_UNAVAILABLE', + self::DEPRECATED_STATUS_CODE_DATA_LOSS => 'DEPRECATED_STATUS_CODE_DATA_LOSS', + self::DEPRECATED_STATUS_CODE_UNAUTHENTICATED => 'DEPRECATED_STATUS_CODE_UNAUTHENTICATED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DeprecatedStatusCode::class, \Opentelemetry\Proto\Trace\V1\Status_DeprecatedStatusCode::class); + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Status/StatusCode.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Status/StatusCode.php new file mode 100644 index 000000000..954cf1fd2 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Status/StatusCode.php @@ -0,0 +1,66 @@ +opentelemetry.proto.trace.v1.Status.StatusCode + */ +class StatusCode +{ + /** + * The default status. + * + * Generated from protobuf enum STATUS_CODE_UNSET = 0; + */ + const STATUS_CODE_UNSET = 0; + /** + * The Span has been validated by an Application developer or Operator to + * have completed successfully. + * + * Generated from protobuf enum STATUS_CODE_OK = 1; + */ + const STATUS_CODE_OK = 1; + /** + * The Span contains an error. + * + * Generated from protobuf enum STATUS_CODE_ERROR = 2; + */ + const STATUS_CODE_ERROR = 2; + + private static $valueToName = [ + self::STATUS_CODE_UNSET => 'STATUS_CODE_UNSET', + self::STATUS_CODE_OK => 'STATUS_CODE_OK', + self::STATUS_CODE_ERROR => 'STATUS_CODE_ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StatusCode::class, \Opentelemetry\Proto\Trace\V1\Status_StatusCode::class); + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Status_DeprecatedStatusCode.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Status_DeprecatedStatusCode.php new file mode 100644 index 000000000..2235d5b7d --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Status_DeprecatedStatusCode.php @@ -0,0 +1,16 @@ +opentelemetry.proto.trace.v1.TraceConfig + */ +class TraceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The global default max number of attributes per span. + * + * Generated from protobuf field int64 max_number_of_attributes = 4; + */ + protected $max_number_of_attributes = 0; + /** + * The global default max number of annotation events per span. + * + * Generated from protobuf field int64 max_number_of_timed_events = 5; + */ + protected $max_number_of_timed_events = 0; + /** + * The global default max number of attributes per timed event. + * + * Generated from protobuf field int64 max_number_of_attributes_per_timed_event = 6; + */ + protected $max_number_of_attributes_per_timed_event = 0; + /** + * The global default max number of link entries per span. + * + * Generated from protobuf field int64 max_number_of_links = 7; + */ + protected $max_number_of_links = 0; + /** + * The global default max number of attributes per span. + * + * Generated from protobuf field int64 max_number_of_attributes_per_link = 8; + */ + protected $max_number_of_attributes_per_link = 0; + protected $sampler; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Trace\V1\ConstantSampler $constant_sampler + * @type \Opentelemetry\Proto\Trace\V1\TraceIdRatioBased $trace_id_ratio_based + * @type \Opentelemetry\Proto\Trace\V1\RateLimitingSampler $rate_limiting_sampler + * @type int|string $max_number_of_attributes + * The global default max number of attributes per span. + * @type int|string $max_number_of_timed_events + * The global default max number of annotation events per span. + * @type int|string $max_number_of_attributes_per_timed_event + * The global default max number of attributes per timed event. + * @type int|string $max_number_of_links + * The global default max number of link entries per span. + * @type int|string $max_number_of_attributes_per_link + * The global default max number of attributes per span. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Trace\V1\TraceConfig::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .opentelemetry.proto.trace.v1.ConstantSampler constant_sampler = 1; + * @return \Opentelemetry\Proto\Trace\V1\ConstantSampler|null + */ + public function getConstantSampler() + { + return $this->readOneof(1); + } + + public function hasConstantSampler() + { + return $this->hasOneof(1); + } + + /** + * Generated from protobuf field .opentelemetry.proto.trace.v1.ConstantSampler constant_sampler = 1; + * @param \Opentelemetry\Proto\Trace\V1\ConstantSampler $var + * @return $this + */ + public function setConstantSampler($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Trace\V1\ConstantSampler::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Generated from protobuf field .opentelemetry.proto.trace.v1.TraceIdRatioBased trace_id_ratio_based = 2; + * @return \Opentelemetry\Proto\Trace\V1\TraceIdRatioBased|null + */ + public function getTraceIdRatioBased() + { + return $this->readOneof(2); + } + + public function hasTraceIdRatioBased() + { + return $this->hasOneof(2); + } + + /** + * Generated from protobuf field .opentelemetry.proto.trace.v1.TraceIdRatioBased trace_id_ratio_based = 2; + * @param \Opentelemetry\Proto\Trace\V1\TraceIdRatioBased $var + * @return $this + */ + public function setTraceIdRatioBased($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Trace\V1\TraceIdRatioBased::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Generated from protobuf field .opentelemetry.proto.trace.v1.RateLimitingSampler rate_limiting_sampler = 3; + * @return \Opentelemetry\Proto\Trace\V1\RateLimitingSampler|null + */ + public function getRateLimitingSampler() + { + return $this->readOneof(3); + } + + public function hasRateLimitingSampler() + { + return $this->hasOneof(3); + } + + /** + * Generated from protobuf field .opentelemetry.proto.trace.v1.RateLimitingSampler rate_limiting_sampler = 3; + * @param \Opentelemetry\Proto\Trace\V1\RateLimitingSampler $var + * @return $this + */ + public function setRateLimitingSampler($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Trace\V1\RateLimitingSampler::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The global default max number of attributes per span. + * + * Generated from protobuf field int64 max_number_of_attributes = 4; + * @return int|string + */ + public function getMaxNumberOfAttributes() + { + return $this->max_number_of_attributes; + } + + /** + * The global default max number of attributes per span. + * + * Generated from protobuf field int64 max_number_of_attributes = 4; + * @param int|string $var + * @return $this + */ + public function setMaxNumberOfAttributes($var) + { + GPBUtil::checkInt64($var); + $this->max_number_of_attributes = $var; + + return $this; + } + + /** + * The global default max number of annotation events per span. + * + * Generated from protobuf field int64 max_number_of_timed_events = 5; + * @return int|string + */ + public function getMaxNumberOfTimedEvents() + { + return $this->max_number_of_timed_events; + } + + /** + * The global default max number of annotation events per span. + * + * Generated from protobuf field int64 max_number_of_timed_events = 5; + * @param int|string $var + * @return $this + */ + public function setMaxNumberOfTimedEvents($var) + { + GPBUtil::checkInt64($var); + $this->max_number_of_timed_events = $var; + + return $this; + } + + /** + * The global default max number of attributes per timed event. + * + * Generated from protobuf field int64 max_number_of_attributes_per_timed_event = 6; + * @return int|string + */ + public function getMaxNumberOfAttributesPerTimedEvent() + { + return $this->max_number_of_attributes_per_timed_event; + } + + /** + * The global default max number of attributes per timed event. + * + * Generated from protobuf field int64 max_number_of_attributes_per_timed_event = 6; + * @param int|string $var + * @return $this + */ + public function setMaxNumberOfAttributesPerTimedEvent($var) + { + GPBUtil::checkInt64($var); + $this->max_number_of_attributes_per_timed_event = $var; + + return $this; + } + + /** + * The global default max number of link entries per span. + * + * Generated from protobuf field int64 max_number_of_links = 7; + * @return int|string + */ + public function getMaxNumberOfLinks() + { + return $this->max_number_of_links; + } + + /** + * The global default max number of link entries per span. + * + * Generated from protobuf field int64 max_number_of_links = 7; + * @param int|string $var + * @return $this + */ + public function setMaxNumberOfLinks($var) + { + GPBUtil::checkInt64($var); + $this->max_number_of_links = $var; + + return $this; + } + + /** + * The global default max number of attributes per span. + * + * Generated from protobuf field int64 max_number_of_attributes_per_link = 8; + * @return int|string + */ + public function getMaxNumberOfAttributesPerLink() + { + return $this->max_number_of_attributes_per_link; + } + + /** + * The global default max number of attributes per span. + * + * Generated from protobuf field int64 max_number_of_attributes_per_link = 8; + * @param int|string $var + * @return $this + */ + public function setMaxNumberOfAttributesPerLink($var) + { + GPBUtil::checkInt64($var); + $this->max_number_of_attributes_per_link = $var; + + return $this; + } + + /** + * @return string + */ + public function getSampler() + { + return $this->whichOneof("sampler"); + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/TraceIdRatioBased.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/TraceIdRatioBased.php new file mode 100644 index 000000000..a04435c36 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/TraceIdRatioBased.php @@ -0,0 +1,68 @@ +opentelemetry.proto.trace.v1.TraceIdRatioBased + */ +class TraceIdRatioBased extends \Google\Protobuf\Internal\Message +{ + /** + * The desired ratio of sampling. Must be within [0.0, 1.0]. + * + * Generated from protobuf field double samplingRatio = 1; + */ + protected $samplingRatio = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $samplingRatio + * The desired ratio of sampling. Must be within [0.0, 1.0]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Trace\V1\TraceConfig::initOnce(); + parent::__construct($data); + } + + /** + * The desired ratio of sampling. Must be within [0.0, 1.0]. + * + * Generated from protobuf field double samplingRatio = 1; + * @return float + */ + public function getSamplingRatio() + { + return $this->samplingRatio; + } + + /** + * The desired ratio of sampling. Must be within [0.0, 1.0]. + * + * Generated from protobuf field double samplingRatio = 1; + * @param float $var + * @return $this + */ + public function setSamplingRatio($var) + { + GPBUtil::checkDouble($var); + $this->samplingRatio = $var; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/TracesData.php b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/TracesData.php new file mode 100644 index 000000000..cbaf79448 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/TracesData.php @@ -0,0 +1,90 @@ +opentelemetry.proto.trace.v1.TracesData + */ +class TracesData extends \Google\Protobuf\Internal\Message +{ + /** + * An array of ResourceSpans. + * For data coming from a single resource this array will typically contain + * one element. Intermediary nodes that receive data from multiple origins + * typically batch the data before forwarding further and in that case this + * array will contain multiple elements. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.ResourceSpans resource_spans = 1; + */ + private $resource_spans; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Trace\V1\ResourceSpans[]|\Google\Protobuf\Internal\RepeatedField $resource_spans + * An array of ResourceSpans. + * For data coming from a single resource this array will typically contain + * one element. Intermediary nodes that receive data from multiple origins + * typically batch the data before forwarding further and in that case this + * array will contain multiple elements. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Trace\V1\Trace::initOnce(); + parent::__construct($data); + } + + /** + * An array of ResourceSpans. + * For data coming from a single resource this array will typically contain + * one element. Intermediary nodes that receive data from multiple origins + * typically batch the data before forwarding further and in that case this + * array will contain multiple elements. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.ResourceSpans resource_spans = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceSpans() + { + return $this->resource_spans; + } + + /** + * An array of ResourceSpans. + * For data coming from a single resource this array will typically contain + * one element. Intermediary nodes that receive data from multiple origins + * typically batch the data before forwarding further and in that case this + * array will contain multiple elements. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.ResourceSpans resource_spans = 1; + * @param \Opentelemetry\Proto\Trace\V1\ResourceSpans[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceSpans($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\ResourceSpans::class); + $this->resource_spans = $arr; + + return $this; + } + +} + diff --git a/vendor/open-telemetry/gen-otlp-protobuf/README.md b/vendor/open-telemetry/gen-otlp-protobuf/README.md new file mode 100644 index 000000000..f1ea7a63a --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/README.md @@ -0,0 +1,31 @@ +[![Releases](https://img.shields.io/badge/releases-purple)](https://github.com/opentelemetry-php/gen-otlp-protobuf/releases) +[![Source](https://img.shields.io/badge/source-gen--otlp--protobuf-green)](https://github.com/open-telemetry/opentelemetry-php/tree/main/proto/otel) +[![Mirror](https://img.shields.io/badge/mirror-opentelemetry--php:gen--otlp--protobuf-blue)](https://github.com/opentelemetry-php/gen-otlp-protobuf) +[![Latest Version](http://poser.pugx.org/open-telemetry/gen-otlp-protobuf/v/unstable)](https://packagist.org/packages/open-telemetry/gen-otlp-protobuf/) +[![Stable](http://poser.pugx.org/open-telemetry/gen-otlp-protobuf/v/stable)](https://packagist.org/packages/open-telemetry/gen-otlp-protobuf/) + +# OpenTelemetry protobuf files + +## Protobuf Runtime library + +OTLP exporting requires a [protobuf runtime library](https://github.com/protocolbuffers/protobuf/tree/main/php). + +There exist two protobuf runtime libraries that offer the same set of APIs, allowing developers to choose the one that +best suits their needs. + +This package requires `google/protobuf`, which is the native implementation. It is easy to install and a good way to get +started quickly. + +Alternatively, and the recommended option for production is to install the Protobuf C extension for PHP. The extension +makes OTLP exporting _significantly_ more performant. The extension can be installed with the following command: + +```shell +pecl install protobuf +``` + +The extension can be installed alongside the native library, and it will be used instead if available. + +## Contributing + +This repository is a read-only git subtree split. +To contribute, please see the main [OpenTelemetry PHP monorepo](https://github.com/open-telemetry/opentelemetry-php). diff --git a/vendor/open-telemetry/gen-otlp-protobuf/VERSION b/vendor/open-telemetry/gen-otlp-protobuf/VERSION new file mode 100644 index 000000000..0ec25f750 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/VERSION @@ -0,0 +1 @@ +v1.0.0 diff --git a/vendor/open-telemetry/gen-otlp-protobuf/composer.json b/vendor/open-telemetry/gen-otlp-protobuf/composer.json new file mode 100644 index 000000000..dc8d24585 --- /dev/null +++ b/vendor/open-telemetry/gen-otlp-protobuf/composer.json @@ -0,0 +1,37 @@ +{ + "name": "open-telemetry/gen-otlp-protobuf", + "description": "PHP protobuf files for communication with OpenTelemetry OTLP collectors/servers.", + "keywords": ["opentelemetry", "otel", "metrics", "tracing", "logging", "apm", "gRPC", "protobuf", "otlp"], + "type": "library", + "support": { + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php", + "docs": "https://opentelemetry.io/docs/php", + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V" + }, + "license": "Apache-2.0", + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "require": { + "php": "^7.4 || ^8.0", + "google/protobuf": "^3.3.0" + }, + "autoload": { + "psr-4": { + "Opentelemetry\\Proto\\": "Opentelemetry/Proto/", + "GPBMetadata\\Opentelemetry\\": "GPBMetadata/Opentelemetry/" + } + }, + "suggest": { + "ext-protobuf": "For better performance, when dealing with the protobuf format" + }, + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + } +} diff --git a/vendor/open-telemetry/sdk/Common/Adapter/HttpDiscovery/DependencyResolver.php b/vendor/open-telemetry/sdk/Common/Adapter/HttpDiscovery/DependencyResolver.php new file mode 100644 index 000000000..8ba992f9a --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Adapter/HttpDiscovery/DependencyResolver.php @@ -0,0 +1,83 @@ +messageFactoryResolver = $messageFactoryResolver ?? MessageFactoryResolver::create(); + $this->psrClientResolver = $psrClientResolver ?? PsrClientResolver::create(); + $this->httpPlugClientResolver = $httpPlugClientResolver ?? HttpPlugClientResolver::create(); + } + + public static function create( + ?MessageFactoryResolverInterface $messageFactoryResolver = null, + ?PsrClientResolverInterface $psrClientResolver = null, + ?HttpPlugClientResolverInterface $httpPlugClientResolver = null + ): self { + return new self($messageFactoryResolver, $psrClientResolver, $httpPlugClientResolver); + } + + public function resolveRequestFactory(): RequestFactoryInterface + { + return $this->messageFactoryResolver->resolveRequestFactory(); + } + + public function resolveResponseFactory(): ResponseFactoryInterface + { + return $this->messageFactoryResolver->resolveResponseFactory(); + } + + public function resolveServerRequestFactory(): ServerRequestFactoryInterface + { + return $this->messageFactoryResolver->resolveServerRequestFactory(); + } + + public function resolveStreamFactory(): StreamFactoryInterface + { + return $this->messageFactoryResolver->resolveStreamFactory(); + } + + public function resolveUploadedFileFactory(): UploadedFileFactoryInterface + { + return $this->messageFactoryResolver->resolveUploadedFileFactory(); + } + + public function resolveUriFactory(): UriFactoryInterface + { + return $this->messageFactoryResolver->resolveUriFactory(); + } + + public function resolveHttpPlugAsyncClient(): HttpAsyncClient + { + return $this->httpPlugClientResolver->resolveHttpPlugAsyncClient(); + } + + public function resolvePsrClient(): ClientInterface + { + return $this->psrClientResolver->resolvePsrClient(); + } +} diff --git a/vendor/open-telemetry/sdk/Common/Adapter/HttpDiscovery/HttpPlugClientResolver.php b/vendor/open-telemetry/sdk/Common/Adapter/HttpDiscovery/HttpPlugClientResolver.php new file mode 100644 index 000000000..9751984ee --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Adapter/HttpDiscovery/HttpPlugClientResolver.php @@ -0,0 +1,29 @@ +httpAsyncClient = $httpAsyncClient; + } + + public static function create(?HttpAsyncClient $httpAsyncClient = null): self + { + return new self($httpAsyncClient); + } + + public function resolveHttpPlugAsyncClient(): HttpAsyncClient + { + return $this->httpAsyncClient ??= HttpAsyncClientDiscovery::find(); + } +} diff --git a/vendor/open-telemetry/sdk/Common/Adapter/HttpDiscovery/MessageFactoryResolver.php b/vendor/open-telemetry/sdk/Common/Adapter/HttpDiscovery/MessageFactoryResolver.php new file mode 100644 index 000000000..6ed0895ff --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Adapter/HttpDiscovery/MessageFactoryResolver.php @@ -0,0 +1,88 @@ +requestFactory = $requestFactory; + $this->responseFactory = $responseFactory; + $this->serverRequestFactory = $serverRequestFactory; + $this->streamFactory = $streamFactory; + $this->uploadedFileFactory = $uploadedFileFactory; + $this->uriFactory = $uriFactory; + } + + public static function create( + ?RequestFactoryInterface $requestFactory = null, + ?ResponseFactoryInterface $responseFactory = null, + ?ServerRequestFactoryInterface $serverRequestFactory = null, + ?StreamFactoryInterface $streamFactory = null, + ?UploadedFileFactoryInterface $uploadedFileFactory = null, + ?UriFactoryInterface $uriFactory = null + ): self { + return new self( + $requestFactory, + $responseFactory, + $serverRequestFactory, + $streamFactory, + $uploadedFileFactory, + $uriFactory + ); + } + + public function resolveRequestFactory(): RequestFactoryInterface + { + return $this->requestFactory ??= Psr17FactoryDiscovery::findRequestFactory(); + } + + public function resolveResponseFactory(): ResponseFactoryInterface + { + return $this->responseFactory ??= Psr17FactoryDiscovery::findResponseFactory(); + } + + public function resolveServerRequestFactory(): ServerRequestFactoryInterface + { + return $this->serverRequestFactory ??= Psr17FactoryDiscovery::findServerRequestFactory(); + } + + public function resolveStreamFactory(): StreamFactoryInterface + { + return $this->streamFactory ??= Psr17FactoryDiscovery::findStreamFactory(); + } + + public function resolveUploadedFileFactory(): UploadedFileFactoryInterface + { + return $this->uploadedFileFactory ??= Psr17FactoryDiscovery::findUploadedFileFactory(); + } + + public function resolveUriFactory(): UriFactoryInterface + { + return $this->uriFactory ??= Psr17FactoryDiscovery::findUriFactory(); + } +} diff --git a/vendor/open-telemetry/sdk/Common/Adapter/HttpDiscovery/PsrClientResolver.php b/vendor/open-telemetry/sdk/Common/Adapter/HttpDiscovery/PsrClientResolver.php new file mode 100644 index 000000000..46fb36312 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Adapter/HttpDiscovery/PsrClientResolver.php @@ -0,0 +1,29 @@ +client = $client; + } + + public static function create(?ClientInterface $client = null): self + { + return new self($client); + } + + public function resolvePsrClient(): ClientInterface + { + return $this->client ??= Psr18ClientDiscovery::find(); + } +} diff --git a/vendor/open-telemetry/sdk/Common/Attribute/AttributeValidator.php b/vendor/open-telemetry/sdk/Common/Attribute/AttributeValidator.php new file mode 100644 index 000000000..e9a1f7334 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Attribute/AttributeValidator.php @@ -0,0 +1,58 @@ +validateArray($value); + } + + return in_array(gettype($value), self::PRIMITIVES); + } + + private function validateArray(array $value): bool + { + if ($value === []) { + return true; + } + $type = gettype(reset($value)); + if (!in_array($type, self::PRIMITIVES)) { + return false; + } + foreach ($value as $v) { + if (in_array(gettype($v), self::NUMERICS) && in_array($type, self::NUMERICS)) { + continue; + } + if (gettype($v) !== $type) { + return false; + } + } + + return true; + } + + public function getInvalidMessage(): string + { + return 'attribute with non-primitive or non-homogeneous array of primitives dropped'; + } +} diff --git a/vendor/open-telemetry/sdk/Common/Attribute/AttributeValidatorInterface.php b/vendor/open-telemetry/sdk/Common/Attribute/AttributeValidatorInterface.php new file mode 100644 index 000000000..afbfba6e7 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Attribute/AttributeValidatorInterface.php @@ -0,0 +1,11 @@ +attributes = $attributes; + $this->droppedAttributesCount = $droppedAttributesCount; + } + + public static function create(iterable $attributes): AttributesInterface + { + return self::factory()->builder($attributes)->build(); + } + + public static function factory(?int $attributeCountLimit = null, ?int $attributeValueLengthLimit = null): AttributesFactoryInterface + { + return new AttributesFactory($attributeCountLimit, $attributeValueLengthLimit); + } + + public function has(string $name): bool + { + return array_key_exists($name, $this->attributes); + } + + public function get(string $name) + { + return $this->attributes[$name] ?? null; + } + + /** @psalm-mutation-free */ + public function count(): int + { + return \count($this->attributes); + } + + public function getIterator(): Traversable + { + foreach ($this->attributes as $key => $value) { + yield (string) $key => $value; + } + } + + public function toArray(): array + { + return $this->attributes; + } + + public function getDroppedAttributesCount(): int + { + return $this->droppedAttributesCount; + } +} diff --git a/vendor/open-telemetry/sdk/Common/Attribute/AttributesBuilder.php b/vendor/open-telemetry/sdk/Common/Attribute/AttributesBuilder.php new file mode 100644 index 000000000..5c1150638 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Attribute/AttributesBuilder.php @@ -0,0 +1,120 @@ +attributes = $attributes; + $this->attributeCountLimit = $attributeCountLimit; + $this->attributeValueLengthLimit = $attributeValueLengthLimit; + $this->droppedAttributesCount = $droppedAttributesCount; + $this->attributeValidator = $attributeValidator ?? new AttributeValidator(); + } + + public function build(): AttributesInterface + { + return new Attributes($this->attributes, $this->droppedAttributesCount); + } + + public function offsetExists($offset): bool + { + return array_key_exists($offset, $this->attributes); + } + + /** + * @phan-suppress PhanUndeclaredClassAttribute + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->attributes[$offset] ?? null; + } + + /** + * @phan-suppress PhanUndeclaredClassAttribute + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if ($offset === null) { + return; + } + if ($value === null) { + unset($this->attributes[$offset]); + + return; + } + if (!$this->attributeValidator->validate($value)) { + self::logWarning($this->attributeValidator->getInvalidMessage() . ': ' . $offset); + $this->droppedAttributesCount++; + + return; + } + if (count($this->attributes) === $this->attributeCountLimit && !array_key_exists($offset, $this->attributes)) { + $this->droppedAttributesCount++; + + return; + } + + $this->attributes[$offset] = $this->normalizeValue($value); + //@todo "There SHOULD be a message printed in the SDK's log to indicate to the user that an attribute was + // discarded due to such a limit. To prevent excessive logging, the message MUST be printed at most + // once per (i.e., not per discarded attribute)." + } + + /** + * @phan-suppress PhanUndeclaredClassAttribute + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->attributes[$offset]); + } + + private function normalizeValue($value) + { + if (is_string($value) && $this->attributeValueLengthLimit !== null) { + return mb_substr($value, 0, $this->attributeValueLengthLimit); + } + + if (is_array($value)) { + foreach ($value as $k => $v) { + $processed = $this->normalizeValue($v); + if ($processed !== $v) { + $value[$k] = $processed; + } + } + + return $value; + } + + return $value; + } +} diff --git a/vendor/open-telemetry/sdk/Common/Attribute/AttributesBuilderInterface.php b/vendor/open-telemetry/sdk/Common/Attribute/AttributesBuilderInterface.php new file mode 100644 index 000000000..7e3d64062 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Attribute/AttributesBuilderInterface.php @@ -0,0 +1,12 @@ +attributeCountLimit = $attributeCountLimit; + $this->attributeValueLengthLimit = $attributeValueLengthLimit; + } + + public function builder(iterable $attributes = [], ?AttributeValidatorInterface $attributeValidator = null): AttributesBuilderInterface + { + $builder = new AttributesBuilder( + [], + $this->attributeCountLimit, + $this->attributeValueLengthLimit, + 0, + $attributeValidator, + ); + foreach ($attributes as $key => $value) { + $builder[$key] = $value; + } + + return $builder; + } +} diff --git a/vendor/open-telemetry/sdk/Common/Attribute/AttributesFactoryInterface.php b/vendor/open-telemetry/sdk/Common/Attribute/AttributesFactoryInterface.php new file mode 100644 index 000000000..1b74461d4 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Attribute/AttributesFactoryInterface.php @@ -0,0 +1,10 @@ + $rejectedKeys + */ + public function __construct(AttributesBuilderInterface $builder, array $rejectedKeys) + { + $this->builder = $builder; + $this->rejectedKeys = $rejectedKeys; + } + + public function __clone() + { + $this->builder = clone $this->builder; + } + + public function build(): AttributesInterface + { + $attributes = $this->builder->build(); + $dropped = $attributes->getDroppedAttributesCount() + $this->rejected; + + return new Attributes($attributes->toArray(), $dropped); + } + + public function offsetExists($offset): bool + { + return $this->builder->offsetExists($offset); + } + + /** + * @phan-suppress PhanUndeclaredClassAttribute + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->builder->offsetGet($offset); + } + + /** + * @phan-suppress PhanUndeclaredClassAttribute + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if ($value !== null && in_array($offset, $this->rejectedKeys, true)) { + $this->rejected++; + + return; + } + + $this->builder->offsetSet($offset, $value); + } + + /** + * @phan-suppress PhanUndeclaredClassAttribute + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + $this->builder->offsetUnset($offset); + } +} diff --git a/vendor/open-telemetry/sdk/Common/Attribute/FilteredAttributesFactory.php b/vendor/open-telemetry/sdk/Common/Attribute/FilteredAttributesFactory.php new file mode 100644 index 000000000..1d9c4ae1c --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Attribute/FilteredAttributesFactory.php @@ -0,0 +1,33 @@ + $rejectedKeys + */ + public function __construct(AttributesFactoryInterface $factory, array $rejectedKeys) + { + $this->factory = $factory; + $this->rejectedKeys = $rejectedKeys; + } + + public function builder(iterable $attributes = [], ?AttributeValidatorInterface $attributeValidator = null): AttributesBuilderInterface + { + $builder = new FilteredAttributesBuilder($this->factory->builder([], $attributeValidator), $this->rejectedKeys); + foreach ($attributes as $attribute => $value) { + $builder[$attribute] = $value; + } + + return $builder; + } +} diff --git a/vendor/open-telemetry/sdk/Common/Attribute/LogRecordAttributeValidator.php b/vendor/open-telemetry/sdk/Common/Attribute/LogRecordAttributeValidator.php new file mode 100644 index 000000000..a09d26372 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Attribute/LogRecordAttributeValidator.php @@ -0,0 +1,19 @@ +hasVariable($name); + } + + public static function getInt(string $key, int $default = null): int + { + return (int) self::validateVariableValue( + CompositeResolver::instance()->resolve( + self::validateVariableType($key, VariableTypes::INTEGER), + $default + ), + FILTER_VALIDATE_INT + ); + } + + public static function getString(string $key, string $default = null): string + { + return (string) self::validateVariableValue( + CompositeResolver::instance()->resolve( + self::validateVariableType($key, VariableTypes::STRING), + $default + ) + ); + } + + public static function getBoolean(string $key, bool $default = null): bool + { + $resolved = self::validateVariableValue( + CompositeResolver::instance()->resolve( + self::validateVariableType($key, VariableTypes::BOOL), + null === $default ? $default : ($default ? 'true' : 'false') + ) + ); + + try { + return BooleanParser::parse($resolved); + } catch (InvalidArgumentException $e) { + self::logWarning(sprintf('Invalid boolean value "%s" interpreted as "false" for %s', $resolved, $key)); + + return false; + } + } + + public static function getMixed(string $key, $default = null) + { + return self::validateVariableValue( + CompositeResolver::instance()->resolve( + $key, + $default + ) + ); + } + + public static function getMap(string $key, array $default = null): array + { + return MapParser::parse( + CompositeResolver::instance()->resolve( + self::validateVariableType($key, VariableTypes::MAP), + $default + ) + ); + } + + public static function getList(string $key, array $default = null): array + { + return ListParser::parse( + CompositeResolver::instance()->resolve( + self::validateVariableType($key, VariableTypes::LIST), + $default + ) + ); + } + + public static function getEnum(string $key, string $default = null): string + { + return (string) self::validateVariableValue( + CompositeResolver::instance()->resolve( + self::validateVariableType($key, VariableTypes::ENUM), + $default + ) + ); + } + + public static function getFloat(string $key, float $default = null): float + { + return (float) self::validateVariableValue( + CompositeResolver::instance()->resolve( + self::validateVariableType($key, VariableTypes::FLOAT), + $default + ), + FILTER_VALIDATE_FLOAT + ); + } + + public static function getRatio(string $key, float $default = null): float + { + return RatioParser::parse( + self::validateVariableValue( + CompositeResolver::instance()->resolve( + self::validateVariableType($key, VariableTypes::RATIO), + $default + ) + ) + ); + } + + public static function getKnownValues(string $variableName): ?array + { + return ClassConstantAccessor::getValue(KnownValues::class, $variableName); + } + + public static function getDefault(string $variableName) + { + return ClassConstantAccessor::getValue(Defaults::class, $variableName); + } + + public static function getType(string $variableName): ?string + { + return ClassConstantAccessor::getValue(ValueTypes::class, $variableName); + } + + public static function isEmpty($value): bool + { + // don't use 'empty()', since '0' is not considered to be empty + return $value === null || $value === ''; + } + + private static function validateVariableType(string $variableName, string $type): string + { + $variableType = self::getType($variableName); + + if ($variableType !== null && $variableType !== $type && $variableType !== VariableTypes::MIXED) { + throw new UnexpectedValueException( + sprintf('Variable "%s" is not supposed to be of type "%s" but type "%s"', $variableName, $type, $variableType) + ); + } + + return $variableName; + } + + private static function validateVariableValue($value, ?int $filterType = null) + { + if ($filterType !== null && filter_var($value, $filterType) === false) { + throw new UnexpectedValueException(sprintf('Value has invalid type "%s"', gettype($value))); + } + + if ($value === null || $value === '') { + throw new UnexpectedValueException( + 'Variable must not be null or empty' + ); + } + + return $value; + } +} diff --git a/vendor/open-telemetry/sdk/Common/Configuration/Defaults.php b/vendor/open-telemetry/sdk/Common/Configuration/Defaults.php new file mode 100644 index 000000000..7228270a6 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Configuration/Defaults.php @@ -0,0 +1,122 @@ + trim($value), + explode(self::DEFAULT_SEPARATOR, $value) + ); + } +} diff --git a/vendor/open-telemetry/sdk/Common/Configuration/Parser/MapParser.php b/vendor/open-telemetry/sdk/Common/Configuration/Parser/MapParser.php new file mode 100644 index 000000000..273d57c87 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Configuration/Parser/MapParser.php @@ -0,0 +1,45 @@ + self::MAX_VALUE || $result < self::MIN_VALUE) { + throw new RangeException( + sprintf( + 'Value must not be lower than %s or higher than %s. Given: %s', + self::MIN_VALUE, + self::MAX_VALUE, + $value + ) + ); + } + + return $result; + } +} diff --git a/vendor/open-telemetry/sdk/Common/Configuration/Resolver/CompositeResolver.php b/vendor/open-telemetry/sdk/Common/Configuration/Resolver/CompositeResolver.php new file mode 100644 index 000000000..b72400b01 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Configuration/Resolver/CompositeResolver.php @@ -0,0 +1,68 @@ + + private array $resolvers = []; + + public static function instance(): self + { + static $instance; + $instance ??= new self([ + new PhpIniResolver(), + new EnvironmentResolver(), + ]); + + return $instance; + } + + public function __construct($resolvers) + { + foreach ($resolvers as $resolver) { + $this->addResolver($resolver); + } + } + + public function addResolver(ResolverInterface $resolver): void + { + $this->resolvers[] = $resolver; + } + + public function getResolvers(): array + { + return $this->resolvers; + } + + public function resolve(string $variableName, $default = '') + { + foreach ($this->resolvers as $resolver) { + if ($resolver->hasVariable($variableName)) { + return $resolver->retrieveValue($variableName); + } + } + + return Configuration::isEmpty($default) + ? Configuration::getDefault($variableName) + : $default; + } + + public function hasVariable(string $variableName): bool + { + foreach ($this->resolvers as $resolver) { + if ($resolver->hasVariable($variableName)) { + return true; + } + } + + return false; + } +} diff --git a/vendor/open-telemetry/sdk/Common/Configuration/Resolver/EnvironmentResolver.php b/vendor/open-telemetry/sdk/Common/Configuration/Resolver/EnvironmentResolver.php new file mode 100644 index 000000000..453f98e39 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Configuration/Resolver/EnvironmentResolver.php @@ -0,0 +1,40 @@ +accessor = $accessor ?? new PhpIniAccessor(); + } + + public function retrieveValue(string $variableName) + { + $value = $this->accessor->get($variableName) ?: ''; + if (is_array($value)) { + return implode(',', $value); + } + + return $value; + } + + public function hasVariable(string $variableName): bool + { + $value = $this->accessor->get($variableName); + if ($value === []) { + return false; + } + + return $value !== false && !Configuration::isEmpty($value); + } +} diff --git a/vendor/open-telemetry/sdk/Common/Configuration/Resolver/ResolverInterface.php b/vendor/open-telemetry/sdk/Common/Configuration/Resolver/ResolverInterface.php new file mode 100644 index 000000000..4e88f3ff6 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Configuration/Resolver/ResolverInterface.php @@ -0,0 +1,15 @@ + + */ +final class StackTraceFormatter +{ + private function __construct() + { + } + + /** + * Formats an exception in a java-like format. + * + * @param Throwable $e exception to format + * @return string formatted exception + * + * @see https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Throwable.html#printStackTrace() + */ + public static function format(Throwable $e): string + { + $s = ''; + $seen = []; + + /** @var Frames|null $enclosing */ + $enclosing = null; + do { + if ($enclosing) { + self::writeNewline($s); + $s .= 'Caused by: '; + } + if (isset($seen[spl_object_id($e)])) { + $s .= '[CIRCULAR REFERENCE: '; + self::writeInlineHeader($s, $e); + $s .= ']'; + + break; + } + $seen[spl_object_id($e)] = $e; + + $frames = self::frames($e); + self::writeInlineHeader($s, $e); + self::writeFrames($s, $frames, $enclosing); + + $enclosing = $frames; + } while ($e = $e->getPrevious()); + + return $s; + } + + /** + * @phan-suppress-next-line PhanTypeMismatchDeclaredParam + * @param Frames $frames + * @phan-suppress-next-line PhanTypeMismatchDeclaredParam + * @param Frames|null $enclosing + */ + private static function writeFrames(string &$s, array $frames, ?array $enclosing): void + { + $n = count($frames); + if ($enclosing) { + for ($m = count($enclosing); + $n && $m && $frames[$n - 1] === $enclosing[$m - 1]; + $n--, $m--) { + } + } + for ($i = 0; $i < $n; $i++) { + $frame = $frames[$i]; + self::writeNewline($s, 1); + $s .= 'at '; + if ($frame['class'] !== null) { + $s .= self::formatName($frame['class']); + $s .= '.'; + } + $s .= self::formatName($frame['function']); + $s .= '('; + if ($frame['file'] !== null) { + $s .= basename($frame['file']); + if ($frame['line']) { + $s .= ':'; + $s .= $frame['line']; + } + } else { + $s .= 'Unknown Source'; + } + $s .= ')'; + } + if ($n !== count($frames)) { + self::writeNewline($s, 1); + $s .= sprintf('... %d more', count($frames) - $n); + } + } + + private static function writeInlineHeader(string &$s, Throwable $e): void + { + $s .= self::formatName(get_class($e)); + if ($e->getMessage() !== '') { + $s .= ': '; + $s .= $e->getMessage(); + } + } + + private static function writeNewline(string &$s, int $indent = 0): void + { + $s .= "\n"; + $s .= str_repeat("\t", $indent); + } + + /** + * @return Frames + * + * @psalm-suppress PossiblyUndefinedArrayOffset + */ + private static function frames(Throwable $e): array + { + $frames = []; + $trace = $e->getTrace(); + $traceCount = count($trace); + for ($i = 0; $i < $traceCount + 1; $i++) { + $frames[] = [ + 'function' => $trace[$i]['function'] ?? '{main}', + 'class' => $trace[$i]['class'] ?? null, + 'file' => $trace[$i - 1]['file'] ?? null, + 'line' => $trace[$i - 1]['line'] ?? null, + ]; + } + $frames[0]['file'] = $e->getFile(); + $frames[0]['line'] = $e->getLine(); + + /** @var Frames $frames */ + return $frames; + } + + private static function formatName(string $name): string + { + return strtr($name, ['\\' => '.']); + } +} diff --git a/vendor/open-telemetry/sdk/Common/Export/Http/PsrTransport.php b/vendor/open-telemetry/sdk/Common/Export/Http/PsrTransport.php new file mode 100644 index 000000000..a53e5b80a --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Export/Http/PsrTransport.php @@ -0,0 +1,168 @@ + + */ +final class PsrTransport implements TransportInterface +{ + private ClientInterface $client; + private RequestFactoryInterface $requestFactory; + private StreamFactoryInterface $streamFactory; + + private string $endpoint; + private string $contentType; + private array $headers; + private array $compression; + private int $retryDelay; + private int $maxRetries; + + private bool $closed = false; + + /** + * @psalm-param CONTENT_TYPE $contentType + */ + public function __construct( + ClientInterface $client, + RequestFactoryInterface $requestFactory, + StreamFactoryInterface $streamFactory, + string $endpoint, + string $contentType, + array $headers, + array $compression, + int $retryDelay, + int $maxRetries + ) { + $this->client = $client; + $this->requestFactory = $requestFactory; + $this->streamFactory = $streamFactory; + $this->endpoint = $endpoint; + $this->contentType = $contentType; + $this->headers = $headers; + $this->compression = $compression; + $this->retryDelay = $retryDelay; + $this->maxRetries = $maxRetries; + } + + public function contentType(): string + { + return $this->contentType; + } + + public function send(string $payload, ?CancellationInterface $cancellation = null): FutureInterface + { + if ($this->closed) { + return new ErrorFuture(new BadMethodCallException('Transport closed')); + } + + $body = PsrUtils::encode($payload, $this->compression, $appliedEncodings); + $request = $this->requestFactory + ->createRequest('POST', $this->endpoint) + ->withBody($this->streamFactory->createStream($body)) + ->withHeader('Content-Type', $this->contentType) + ; + if ($appliedEncodings) { + $request = $request->withHeader('Content-Encoding', $appliedEncodings); + } + foreach ($this->headers as $header => $value) { + $request = $request->withAddedHeader($header, $value); + } + + for ($retries = 0;; $retries++) { + $response = null; + $e = null; + + try { + $response = $this->client->sendRequest($request); + if ($response->getStatusCode() >= 200 && $response->getStatusCode() < 300) { + break; + } + + if ($response->getStatusCode() >= 400 && $response->getStatusCode() < 500 && !in_array($response->getStatusCode(), [408, 429], true)) { + throw new RuntimeException($response->getReasonPhrase(), $response->getStatusCode()); + } + } catch (NetworkExceptionInterface $e) { + } catch (Throwable $e) { + return new ErrorFuture($e); + } + + if ($retries >= $this->maxRetries) { + return new ErrorFuture(new RuntimeException('Export retry limit exceeded', 0, $e)); + } + + $delay = PsrUtils::retryDelay($retries, $this->retryDelay, $response); + $sec = (int) $delay; + $nsec = (int) (($delay - $sec) * 1e9); + + /** @psalm-suppress ArgumentTypeCoercion */ + if (time_nanosleep($sec, $nsec) !== true) { + return new ErrorFuture(new RuntimeException('Export cancelled', 0, $e)); + } + } + + assert(isset($response)); + + try { + $body = PsrUtils::decode( + $response->getBody()->__toString(), + self::parseContentEncoding($response), + ); + } catch (Throwable $e) { + return new ErrorFuture($e); + } + + return new CompletedFuture($body); + } + + private static function parseContentEncoding(ResponseInterface $response): array + { + $encodings = []; + foreach (explode(',', $response->getHeaderLine('Content-Encoding')) as $encoding) { + if (($encoding = trim($encoding, " \t")) !== '') { + $encodings[] = strtolower($encoding); + } + } + + return $encodings; + } + + public function shutdown(?CancellationInterface $cancellation = null): bool + { + if ($this->closed) { + return false; + } + + $this->closed = true; + + return true; + } + + public function forceFlush(?CancellationInterface $cancellation = null): bool + { + return !$this->closed; + } +} diff --git a/vendor/open-telemetry/sdk/Common/Export/Http/PsrTransportFactory.php b/vendor/open-telemetry/sdk/Common/Export/Http/PsrTransportFactory.php new file mode 100644 index 000000000..5ef78d82c --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Export/Http/PsrTransportFactory.php @@ -0,0 +1,74 @@ +client = $client; + $this->requestFactory = $requestFactory; + $this->streamFactory = $streamFactory; + } + + /** + * @phan-suppress PhanTypeMismatchArgumentNullable + */ + public function create( + string $endpoint, + string $contentType, + array $headers = [], + $compression = null, + float $timeout = 10., + int $retryDelay = 100, + int $maxRetries = 3, + ?string $cacert = null, + ?string $cert = null, + ?string $key = null + ): PsrTransport { + if (!filter_var($endpoint, FILTER_VALIDATE_URL)) { + throw new InvalidArgumentException(sprintf('Invalid endpoint url "%s"', $endpoint)); + } + assert(!empty($endpoint)); + + return new PsrTransport( + $this->client, + $this->requestFactory, + $this->streamFactory, + $endpoint, + $contentType, + $headers, + PsrUtils::compression($compression), + $retryDelay, + $maxRetries, + ); + } + + public static function discover(): self + { + return new self( + Psr18ClientDiscovery::find(), + Psr17FactoryDiscovery::findRequestFactory(), + Psr17FactoryDiscovery::findStreamFactory(), + ); + } +} diff --git a/vendor/open-telemetry/sdk/Common/Export/Http/PsrUtils.php b/vendor/open-telemetry/sdk/Common/Export/Http/PsrUtils.php new file mode 100644 index 000000000..eaf2f3b47 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Export/Http/PsrUtils.php @@ -0,0 +1,175 @@ +> 1, $delay) / 1000; + + return max($delay, self::parseRetryAfter($response)); + } + + private static function parseRetryAfter(?ResponseInterface $response): int + { + if (!$response || !$retryAfter = $response->getHeaderLine('Retry-After')) { + return 0; + } + + $retryAfter = trim($retryAfter, " \t"); + if ($retryAfter === (string) (int) $retryAfter) { + return (int) $retryAfter; + } + + if (($time = strtotime($retryAfter)) !== false) { + return $time - time(); + } + + return 0; + } + + /** + * @param list $encodings + * @param array|null $appliedEncodings + */ + public static function encode(string $value, array $encodings, ?array &$appliedEncodings = null): string + { + for ($i = 0, $n = count($encodings); $i < $n; $i++) { + if (!$encoder = self::encoder($encodings[$i])) { + unset($encodings[$i]); + + continue; + } + + try { + $value = $encoder($value); + } catch (Throwable $e) { + unset($encodings[$i]); + } + } + + $appliedEncodings = $encodings; + + return $value; + } + + /** + * @param list $encodings + */ + public static function decode(string $value, array $encodings): string + { + for ($i = count($encodings); --$i >= 0;) { + if (strcasecmp($encodings[$i], 'identity') === 0) { + continue; + } + if (!$decoder = self::decoder($encodings[$i])) { + throw new UnexpectedValueException(sprintf('Not supported decompression encoding "%s"', $encodings[$i])); + } + + $value = $decoder($value); + } + + return $value; + } + + /** + * Resolve an array or CSV of compression types to a list + */ + public static function compression($compression): array + { + if (is_array($compression)) { + return $compression; + } + if (!$compression) { + return []; + } + if (strpos($compression, ',') === false) { + return [$compression]; + } + + return array_map('trim', explode(',', $compression)); + } + + private static function encoder(string $encoding): ?callable + { + static $encoders; + + /** @noinspection SpellCheckingInspection */ + $encoders ??= array_map(fn (callable $callable): callable => self::throwOnErrorOrFalse($callable), array_filter([ + TransportFactoryInterface::COMPRESSION_GZIP => 'gzencode', + TransportFactoryInterface::COMPRESSION_DEFLATE => 'gzcompress', + TransportFactoryInterface::COMPRESSION_BROTLI => 'brotli_compress', + ], 'function_exists')); + + return $encoders[$encoding] ?? null; + } + + private static function decoder(string $encoding): ?callable + { + static $decoders; + + /** @noinspection SpellCheckingInspection */ + $decoders ??= array_map(fn (callable $callable): callable => self::throwOnErrorOrFalse($callable), array_filter([ + TransportFactoryInterface::COMPRESSION_GZIP => 'gzdecode', + TransportFactoryInterface::COMPRESSION_DEFLATE => 'gzuncompress', + TransportFactoryInterface::COMPRESSION_BROTLI => 'brotli_uncompress', + ], 'function_exists')); + + return $decoders[$encoding] ?? null; + } + + private static function throwOnErrorOrFalse(callable $callable): callable + { + return static function (...$args) use ($callable) { + set_error_handler(static function (int $errno, string $errstr, string $errfile, int $errline): bool { + throw new ErrorException($errstr, 0, $errno, $errfile, $errline); + }); + + try { + $result = $callable(...$args); + } finally { + restore_error_handler(); + } + + /** @phan-suppress-next-line PhanPossiblyUndeclaredVariable */ + if ($result === false) { + throw new LogicException(); + } + + /** @phan-suppress-next-line PhanPossiblyUndeclaredVariable */ + return $result; + }; + } +} diff --git a/vendor/open-telemetry/sdk/Common/Export/Stream/StreamTransport.php b/vendor/open-telemetry/sdk/Common/Export/Stream/StreamTransport.php new file mode 100644 index 000000000..4b99cf756 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Export/Stream/StreamTransport.php @@ -0,0 +1,97 @@ + + */ +final class StreamTransport implements TransportInterface +{ + /** + * @var resource|null + */ + private $stream; + private string $contentType; + + /** + * @param resource $stream + * + * @psalm-param CONTENT_TYPE $contentType + */ + public function __construct($stream, string $contentType) + { + $this->stream = $stream; + $this->contentType = $contentType; + } + + public function contentType(): string + { + return $this->contentType; + } + + public function send(string $payload, ?CancellationInterface $cancellation = null): FutureInterface + { + if (!$this->stream) { + return new ErrorFuture(new BadMethodCallException('Transport closed')); + } + + set_error_handler(static function (int $errno, string $errstr, string $errfile, int $errline): bool { + throw new ErrorException($errstr, 0, $errno, $errfile, $errline); + }); + + try { + $bytesWritten = fwrite($this->stream, $payload); + } catch (Throwable $e) { + return new ErrorFuture($e); + } finally { + restore_error_handler(); + } + + if ($bytesWritten !== strlen($payload)) { + return new ErrorFuture(new RuntimeException(sprintf('Write failure, wrote %d of %d bytes', $bytesWritten, strlen($payload)))); + } + + return new CompletedFuture(null); + } + + public function shutdown(?CancellationInterface $cancellation = null): bool + { + if (!$this->stream) { + return false; + } + + $flush = @fflush($this->stream); + $this->stream = null; + + return $flush; + } + + public function forceFlush(?CancellationInterface $cancellation = null): bool + { + if (!$this->stream) { + return false; + } + + return @fflush($this->stream); + } +} diff --git a/vendor/open-telemetry/sdk/Common/Export/Stream/StreamTransportFactory.php b/vendor/open-telemetry/sdk/Common/Export/Stream/StreamTransportFactory.php new file mode 100644 index 000000000..59e411318 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Export/Stream/StreamTransportFactory.php @@ -0,0 +1,118 @@ + $headers + * @param string|string[]|null $compression + * + * @psalm-template CONTENT_TYPE of string + * @psalm-param CONTENT_TYPE $contentType + * @psalm-return TransportInterface + */ + public function create( + $endpoint, + string $contentType, + array $headers = [], + $compression = null, + float $timeout = 10., + int $retryDelay = 100, + int $maxRetries = 3, + ?string $cacert = null, + ?string $cert = null, + ?string $key = null + ): TransportInterface { + assert(!empty($endpoint)); + $stream = is_resource($endpoint) + ? $endpoint + : self::createStream( + $endpoint, + $contentType, + $headers, + $timeout, + $cacert, + $cert, + $key, + ); + + return new StreamTransport($stream, $contentType); + } + + /** + * @throws ErrorException + * @return resource + */ + private static function createStream( + string $endpoint, + string $contentType, + array $headers = [], + float $timeout = 10., + ?string $cacert = null, + ?string $cert = null, + ?string $key = null + ) { + $context = stream_context_create([ + 'http' => [ + 'method' => 'POST', + 'header' => self::createHeaderArray($contentType, $headers), + 'timeout' => $timeout, + ], + 'ssl' => [ + 'cafile' => $cacert, + 'local_cert' => $cert, + 'local_pk' => $key, + ], + ]); + + set_error_handler(static function (int $errno, string $errstr, string $errfile, int $errline): bool { + throw new ErrorException($errstr, 0, $errno, $errfile, $errline); + }); + + /** + * @psalm-suppress PossiblyNullArgument + */ + try { + $stream = fopen($endpoint, 'ab', false, $context); + } finally { + restore_error_handler(); + } + + /** @phan-suppress-next-line PhanPossiblyUndeclaredVariable */ + if (!$stream) { + throw new LogicException(sprintf('Failed opening stream "%s"', $endpoint)); + } + + return $stream; + } + + private static function createHeaderArray(string $contentType, array $headers): array + { + $header = []; + $header[] = sprintf('Content-Type: %s', $contentType); + foreach ($headers as $name => $value) { + $header[] = sprintf('%s: %s', $name, implode(', ', (array) $value)); + } + + return $header; + } +} diff --git a/vendor/open-telemetry/sdk/Common/Export/TransportFactoryInterface.php b/vendor/open-telemetry/sdk/Common/Export/TransportFactoryInterface.php new file mode 100644 index 000000000..48e538443 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Export/TransportFactoryInterface.php @@ -0,0 +1,32 @@ + $headers + * @psalm-param string|string[]|null $compression + * @psalm-return TransportInterface + */ + public function create( + string $endpoint, + string $contentType, + array $headers = [], + $compression = null, + float $timeout = 10., + int $retryDelay = 100, + int $maxRetries = 3, + ?string $cacert = null, + ?string $cert = null, + ?string $key = null + ): TransportInterface; +} diff --git a/vendor/open-telemetry/sdk/Common/Export/TransportInterface.php b/vendor/open-telemetry/sdk/Common/Export/TransportInterface.php new file mode 100644 index 000000000..5fb26eff8 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Export/TransportInterface.php @@ -0,0 +1,22 @@ + + */ +final class CompletedFuture implements FutureInterface +{ + /** @var T */ + private $value; + + /** + * @param T $value + */ + public function __construct($value) + { + $this->value = $value; + } + + public function await() + { + return $this->value; + } + + public function map(Closure $closure): FutureInterface + { + $c = $closure; + unset($closure); + + try { + return new CompletedFuture($c($this->value)); + } catch (Throwable $e) { + return new ErrorFuture($e); + } + } + + public function catch(Closure $closure): FutureInterface + { + return $this; + } +} diff --git a/vendor/open-telemetry/sdk/Common/Future/ErrorFuture.php b/vendor/open-telemetry/sdk/Common/Future/ErrorFuture.php new file mode 100644 index 000000000..32cf3d995 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Future/ErrorFuture.php @@ -0,0 +1,40 @@ +throwable = $throwable; + } + + public function await() + { + throw $this->throwable; + } + + public function map(Closure $closure): FutureInterface + { + return $this; + } + + public function catch(Closure $closure): FutureInterface + { + $c = $closure; + unset($closure); + + try { + return new CompletedFuture($c($this->throwable)); + } catch (Throwable $e) { + return new ErrorFuture($e); + } + } +} diff --git a/vendor/open-telemetry/sdk/Common/Future/FutureInterface.php b/vendor/open-telemetry/sdk/Common/Future/FutureInterface.php new file mode 100644 index 000000000..850699bf6 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Future/FutureInterface.php @@ -0,0 +1,34 @@ + + * + * @psalm-suppress InvalidTemplateParam + */ + public function map(Closure $closure): FutureInterface; + + /** + * @psalm-template U + * @psalm-param Closure(\Throwable): U $closure + * @psalm-return FutureInterface + */ + public function catch(Closure $closure): FutureInterface; +} diff --git a/vendor/open-telemetry/sdk/Common/Future/NullCancellation.php b/vendor/open-telemetry/sdk/Common/Future/NullCancellation.php new file mode 100644 index 000000000..5e5b642f9 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Future/NullCancellation.php @@ -0,0 +1,20 @@ +requestFactory = $requestFactory; + $this->responseFactory = $responseFactory; + $this->serverRequestFactory = $serverRequestFactory; + } + + public static function create( + RequestFactoryInterface $requestFactory, + ResponseFactoryInterface $responseFactory, + ServerRequestFactoryInterface $serverRequestFactory + ): self { + return new self($requestFactory, $responseFactory, $serverRequestFactory); + } + + public function createRequest(string $method, $uri): RequestInterface + { + return $this->requestFactory->createRequest($method, $uri); + } + + public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface + { + return $this->responseFactory->createResponse($code, $reasonPhrase); + } + + public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface + { + return $this->serverRequestFactory->createServerRequest($method, $uri, $serverParams); + } +} diff --git a/vendor/open-telemetry/sdk/Common/Http/Psr/Message/MessageFactoryInterface.php b/vendor/open-telemetry/sdk/Common/Http/Psr/Message/MessageFactoryInterface.php new file mode 100644 index 000000000..97258491f --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Http/Psr/Message/MessageFactoryInterface.php @@ -0,0 +1,13 @@ +name = $name; + $this->version = $version; + $this->schemaUrl = $schemaUrl; + $this->attributes = $attributes; + } + + public function getName(): string + { + return $this->name; + } + + public function getVersion(): ?string + { + return $this->version; + } + + public function getSchemaUrl(): ?string + { + return $this->schemaUrl; + } + + public function getAttributes(): AttributesInterface + { + return $this->attributes; + } +} diff --git a/vendor/open-telemetry/sdk/Common/Instrumentation/InstrumentationScopeFactory.php b/vendor/open-telemetry/sdk/Common/Instrumentation/InstrumentationScopeFactory.php new file mode 100644 index 000000000..f1ae7c072 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Instrumentation/InstrumentationScopeFactory.php @@ -0,0 +1,31 @@ +attributesFactory = $attributesFactory; + } + + public function create( + string $name, + ?string $version = null, + ?string $schemaUrl = null, + iterable $attributes = [] + ): InstrumentationScopeInterface { + return new InstrumentationScope( + $name, + $version, + $schemaUrl, + $this->attributesFactory->builder($attributes)->build(), + ); + } +} diff --git a/vendor/open-telemetry/sdk/Common/Instrumentation/InstrumentationScopeFactoryInterface.php b/vendor/open-telemetry/sdk/Common/Instrumentation/InstrumentationScopeFactoryInterface.php new file mode 100644 index 000000000..78292de58 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Instrumentation/InstrumentationScopeFactoryInterface.php @@ -0,0 +1,15 @@ +build(); + } + + public static function setDefault(?ClockInterface $clock): void + { + self::$default = $clock; + } +} diff --git a/vendor/open-telemetry/sdk/Common/Time/ClockFactoryInterface.php b/vendor/open-telemetry/sdk/Common/Time/ClockFactoryInterface.php new file mode 100644 index 000000000..6d9afde91 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Time/ClockFactoryInterface.php @@ -0,0 +1,16 @@ +clock = $clock; + $this->initialStartTime = $initialStartTime; + } + + public function isRunning(): bool + { + return $this->running; + } + + public function start(): void + { + // resolve start time as early as possible + $startTime = $this->time(); + + if ($this->isRunning()) { + return; + } + + $this->startTime = $startTime; + if (!$this->hasBeenStarted()) { + $this->initialStartTime = $startTime; + } + $this->running = true; + } + + public function stop(): void + { + if (!$this->isRunning()) { + return; + } + + $this->stopTime = $this->time(); + $this->running = false; + } + + public function reset(): void + { + $this->startTime = $this->initialStartTime = $this->isRunning() ? $this->time() : null; + } + + public function getElapsedTime(): int + { + if (!$this->hasBeenStarted()) { + return self::INITIAL_ELAPSED_TIME; + } + + return $this->calculateElapsedTime(); + } + + public function getLastElapsedTime(): int + { + if (!$this->hasBeenStarted()) { + return self::INITIAL_ELAPSED_TIME; + } + + return $this->calculateLastElapsedTime(); + } + + private function time(): int + { + return $this->clock->now(); + } + + private function hasBeenStarted(): bool + { + return $this->initialStartTime !== null; + } + + private function calculateElapsedTime(): int + { + $referenceTime = $this->isRunning() + ? $this->time() + : $this->getStopTime(); + + return $referenceTime - $this->getInitialStartTime(); + } + + private function calculateLastElapsedTime(): int + { + $referenceTime = $this->isRunning() + ? $this->time() + : $this->getStopTime(); + + return $referenceTime - $this->getStartTime(); + } + + private function getInitialStartTime(): ?int + { + return $this->initialStartTime; + } + + private function getStartTime(): ?int + { + return $this->startTime; + } + + private function getStopTime(): ?int + { + return $this->stopTime; + } +} diff --git a/vendor/open-telemetry/sdk/Common/Time/StopWatchFactory.php b/vendor/open-telemetry/sdk/Common/Time/StopWatchFactory.php new file mode 100644 index 000000000..f60c377fc --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Time/StopWatchFactory.php @@ -0,0 +1,44 @@ +clock = $clock ?? ClockFactory::getDefault(); + $this->initialStartTime = $initialStartTime; + } + + public static function create(?ClockInterface $clock = null, ?int $initialStartTime = null): self + { + return new self($clock, $initialStartTime); + } + + public static function fromClockFactory(ClockFactoryInterface $factory, ?int $initialStartTime = null): self + { + return self::create($factory->build(), $initialStartTime); + } + + public function build(): StopWatch + { + return new StopWatch($this->clock, $this->initialStartTime); + } + + public static function getDefault(): StopWatchInterface + { + return self::$default ?? self::$default = self::create()->build(); + } + + public static function setDefault(?StopWatchInterface $default): void + { + self::$default = $default; + } +} diff --git a/vendor/open-telemetry/sdk/Common/Time/StopWatchFactoryInterface.php b/vendor/open-telemetry/sdk/Common/Time/StopWatchFactoryInterface.php new file mode 100644 index 000000000..9750f5769 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Time/StopWatchFactoryInterface.php @@ -0,0 +1,18 @@ + 0) { + return; + } + + self::$referenceTime = self::calculateReferenceTime( + microtime(true), + hrtime(true) + ); + } + + /** + * Calculates the reference time which is later used to calculate the current wall clock time in nanoseconds by adding the current uptime. + */ + private static function calculateReferenceTime(float $wallClockMicroTime, int $upTime): int + { + return ((int) ($wallClockMicroTime * ClockInterface::NANOS_PER_SECOND)) - $upTime; + } +} diff --git a/vendor/open-telemetry/sdk/Common/Time/Util.php b/vendor/open-telemetry/sdk/Common/Time/Util.php new file mode 100644 index 000000000..e1be1f750 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Time/Util.php @@ -0,0 +1,32 @@ +|null */ + private static ?array $handlers = null; + /** @var ArrayAccess|null */ + private static ?ArrayAccess $weakMap = null; + + private array $ids = []; + + private function __construct() + { + } + + public function __destruct() + { + if (!self::$handlers) { + return; + } + foreach ($this->ids as $id) { + unset(self::$handlers[$id]); + } + } + + /** + * Registers a function that will be executed on shutdown. + * + * If the given function is bound to an object, then the function will only + * be executed if the bound object is still referenced on shutdown handler + * invocation. + * + * ```php + * ShutdownHandler::register([$tracerProvider, 'shutdown']); + * ``` + * + * @param callable $shutdownFunction function to register + * + * @see register_shutdown_function + */ + public static function register(callable $shutdownFunction): void + { + self::registerShutdownFunction(); + self::$handlers[] = weaken(closure($shutdownFunction), $target); + + if (!$object = $target) { + return; + } + + self::$weakMap ??= WeakMap::create(); + $handler = self::$weakMap[$object] ??= new self(); + $handler->ids[] = array_key_last(self::$handlers); + } + + private static function registerShutdownFunction(): void + { + if (self::$handlers === null) { + register_shutdown_function(static function (): void { + $handlers = self::$handlers; + self::$handlers = null; + self::$weakMap = null; + + // Push shutdown to end of queue + // @phan-suppress-next-line PhanTypeMismatchArgumentInternal + register_shutdown_function(static function (array $handlers): void { + foreach ($handlers as $handler) { + $handler(); + } + }, $handlers); + }); + } + } +} diff --git a/vendor/open-telemetry/sdk/Common/Util/WeakMap.php b/vendor/open-telemetry/sdk/Common/Util/WeakMap.php new file mode 100644 index 000000000..3b62d6d64 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Util/WeakMap.php @@ -0,0 +1,175 @@ + + */ + private array $objects = []; + + private function __construct() + { + } + + /** + * @return ArrayAccess&Countable&IteratorAggregate + */ + public static function create(): ArrayAccess + { + if (PHP_VERSION_ID >= 80000) { + /** @phan-suppress-next-line PhanUndeclaredClassReference */ + assert(class_exists(\WeakMap::class, false)); + /** @phan-suppress-next-line PhanUndeclaredClassMethod */ + $map = new \WeakMap(); + assert($map instanceof ArrayAccess); + assert($map instanceof Countable); + assert($map instanceof IteratorAggregate); + + return $map; + } + + return new self(); + } + + public function offsetExists($offset): bool + { + if (!is_object($offset)) { + throw new TypeError('WeakMap key must be an object'); + } + + return isset($offset->{self::KEY}[spl_object_id($this)]); + } + + /** + * @phan-suppress PhanUndeclaredClassAttribute + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + if (!is_object($offset)) { + throw new TypeError('WeakMap key must be an object'); + } + if (!$this->contains($offset)) { + throw new Error(sprintf('Object %s#%d not contained in WeakMap', get_class($offset), spl_object_id($offset))); + } + + return $offset->{self::KEY}[spl_object_id($this)]; + } + + public function offsetSet($offset, $value): void + { + if ($offset === null) { + throw new Error('Cannot append to WeakMap'); + } + if (!is_object($offset)) { + throw new TypeError('WeakMap key must be an object'); + } + if (!$this->contains($offset)) { + $this->expunge(); + } + + $offset->{self::KEY}[spl_object_id($this)] = $value; + $this->objects[spl_object_id($offset)] = WeakReference::create($offset); + } + + public function offsetUnset($offset): void + { + if (!is_object($offset)) { + throw new TypeError('WeakMap key must be an object'); + } + if (!$this->contains($offset)) { + return; + } + + unset( + $offset->{self::KEY}[spl_object_id($this)], + $this->objects[spl_object_id($offset)], + ); + if (!$offset->{self::KEY}) { + unset($offset->{self::KEY}); + } + } + + public function count(): int + { + $this->expunge(); + + return count($this->objects); + } + + public function getIterator(): Traversable + { + $this->expunge(); + + foreach ($this->objects as $reference) { + if (($object = $reference->get()) && $this->contains($object)) { + yield $object => $this[$object]; + } + } + } + + public function __debugInfo(): array + { + $debugInfo = []; + foreach ($this as $key => $value) { + $debugInfo[] = ['key' => $key, 'value' => $value]; + } + + return $debugInfo; + } + + public function __destruct() + { + foreach ($this->objects as $reference) { + if ($object = $reference->get()) { + unset($this[$object]); + } + } + } + + private function contains(object $offset): bool + { + $reference = $this->objects[spl_object_id($offset)] ?? null; + if ($reference && $reference->get() === $offset) { + return true; + } + + unset($this->objects[spl_object_id($offset)]); + + return false; + } + + private function expunge(): void + { + foreach ($this->objects as $id => $reference) { + if (!$reference->get()) { + unset($this->objects[$id]); + } + } + } +} diff --git a/vendor/open-telemetry/sdk/Common/Util/functions.php b/vendor/open-telemetry/sdk/Common/Util/functions.php new file mode 100644 index 000000000..f4fb13b80 --- /dev/null +++ b/vendor/open-telemetry/sdk/Common/Util/functions.php @@ -0,0 +1,52 @@ +getClosureThis()) { + return $closure; + } + + $scope = $reflection->getClosureScopeClass(); + $name = $reflection->getShortName(); + if ($name !== '{closure}') { + /** @psalm-suppress InvalidScope @phpstan-ignore-next-line @phan-suppress-next-line PhanUndeclaredThis */ + $closure = fn (...$args) => $this->$name(...$args); + if ($scope !== null) { + $closure = $closure->bindTo(null, $scope->name); + } + } + + static $placeholder; + $placeholder ??= new stdClass(); + $closure = $closure->bindTo($placeholder); + + $ref = WeakReference::create($target); + + /** @psalm-suppress PossiblyInvalidFunctionCall */ + return $scope && get_class($target) === $scope->name && !$scope->isInternal() + ? static fn (...$args) => ($obj = $ref->get()) ? $closure->call($obj, ...$args) : null + : static fn (...$args) => ($obj = $ref->get()) ? $closure->bindTo($obj)(...$args) : null; +} diff --git a/vendor/open-telemetry/sdk/Logs/Exporter/ConsoleExporter.php b/vendor/open-telemetry/sdk/Logs/Exporter/ConsoleExporter.php new file mode 100644 index 000000000..e34fa308c --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/Exporter/ConsoleExporter.php @@ -0,0 +1,106 @@ +transport = $transport; + } + + /** + * @param iterable $batch + */ + public function export(iterable $batch, ?CancellationInterface $cancellation = null): FutureInterface + { + $resource = null; + $scopes = []; + foreach ($batch as $record) { + if (!$resource) { + $resource = $this->convertResource($record->getResource()); + } + $key = $this->scopeKey($record->getInstrumentationScope()); + if (!array_key_exists($key, $scopes)) { + $scopes[$key] = $this->convertInstrumentationScope($record->getInstrumentationScope()); + } + $scopes[$key]['logs'][] = $this->convertLogRecord($record); + } + $output = [ + 'resource' => $resource, + 'scopes' => array_values($scopes), + ]; + $this->transport->send(json_encode($output, JSON_PRETTY_PRINT)); + + return new CompletedFuture(true); + } + + public function forceFlush(?CancellationInterface $cancellation = null): bool + { + return true; + } + + public function shutdown(?CancellationInterface $cancellation = null): bool + { + return true; + } + private function convertLogRecord(ReadableLogRecord $record): array + { + $spanContext = $record->getSpanContext(); + + return [ + 'timestamp' => $record->getTimestamp(), + 'observed_timestamp' => $record->getObservedTimestamp(), + 'severity_number' => $record->getSeverityNumber(), + 'severity_text' => $record->getSeverityText(), + 'body' => $record->getBody(), + 'trace_id' => $spanContext !== null ? $spanContext->getTraceId() : '', + 'span_id' => $spanContext !== null ? $spanContext->getSpanId() : '', + 'trace_flags' => $spanContext !== null ? $spanContext->getTraceFlags() : null, + 'attributes' => $record->getAttributes()->toArray(), + 'dropped_attributes_count' => $record->getAttributes()->getDroppedAttributesCount(), + ]; + } + + private function convertResource(ResourceInfo $resource): array + { + return [ + 'attributes' => $resource->getAttributes()->toArray(), + 'dropped_attributes_count' => $resource->getAttributes()->getDroppedAttributesCount(), + ]; + } + + private function scopeKey(InstrumentationScopeInterface $scope): string + { + return serialize([$scope->getName(), $scope->getVersion(), $scope->getSchemaUrl(), $scope->getAttributes()]); + } + + private function convertInstrumentationScope(InstrumentationScopeInterface $scope): array + { + return [ + 'name' => $scope->getName(), + 'version' => $scope->getVersion(), + 'attributes' => $scope->getAttributes()->toArray(), + 'dropped_attributes_count' => $scope->getAttributes()->getDroppedAttributesCount(), + 'schema_url' => $scope->getSchemaUrl(), + 'logs' => [], + ]; + } +} diff --git a/vendor/open-telemetry/sdk/Logs/Exporter/ConsoleExporterFactory.php b/vendor/open-telemetry/sdk/Logs/Exporter/ConsoleExporterFactory.php new file mode 100644 index 000000000..a959540a0 --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/Exporter/ConsoleExporterFactory.php @@ -0,0 +1,19 @@ +create('php://stdout', 'application/json'); + + return new ConsoleExporter($transport); + } +} diff --git a/vendor/open-telemetry/sdk/Logs/Exporter/InMemoryExporter.php b/vendor/open-telemetry/sdk/Logs/Exporter/InMemoryExporter.php new file mode 100644 index 000000000..dca0531f3 --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/Exporter/InMemoryExporter.php @@ -0,0 +1,48 @@ +storage = $storage ?? new ArrayObject(); + } + + /** + * @inheritDoc + */ + public function export(iterable $batch, ?CancellationInterface $cancellation = null): FutureInterface + { + foreach ($batch as $record) { + $this->storage[] = $record; + } + + return new CompletedFuture(true); + } + + public function forceFlush(?CancellationInterface $cancellation = null): bool + { + return true; + } + + public function shutdown(?CancellationInterface $cancellation = null): bool + { + return true; + } + + public function getStorage(): ArrayObject + { + return $this->storage; + } +} diff --git a/vendor/open-telemetry/sdk/Logs/Exporter/InMemoryExporterFactory.php b/vendor/open-telemetry/sdk/Logs/Exporter/InMemoryExporterFactory.php new file mode 100644 index 000000000..6f24defe0 --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/Exporter/InMemoryExporterFactory.php @@ -0,0 +1,16 @@ +create(); + } +} diff --git a/vendor/open-telemetry/sdk/Logs/LogRecordExporterFactoryInterface.php b/vendor/open-telemetry/sdk/Logs/LogRecordExporterFactoryInterface.php new file mode 100644 index 000000000..523bec1ba --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/LogRecordExporterFactoryInterface.php @@ -0,0 +1,10 @@ + $batch + */ + public function export(iterable $batch, ?CancellationInterface $cancellation = null): FutureInterface; + public function forceFlush(?CancellationInterface $cancellation = null): bool; + public function shutdown(?CancellationInterface $cancellation = null): bool; +} diff --git a/vendor/open-telemetry/sdk/Logs/LogRecordLimits.php b/vendor/open-telemetry/sdk/Logs/LogRecordLimits.php new file mode 100644 index 000000000..9f71e62ee --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/LogRecordLimits.php @@ -0,0 +1,29 @@ +attributesFactory = $attributesFactory; + } + + public function getAttributeFactory(): AttributesFactoryInterface + { + return $this->attributesFactory; + } +} diff --git a/vendor/open-telemetry/sdk/Logs/LogRecordLimitsBuilder.php b/vendor/open-telemetry/sdk/Logs/LogRecordLimitsBuilder.php new file mode 100644 index 000000000..3aa5217ef --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/LogRecordLimitsBuilder.php @@ -0,0 +1,58 @@ +attributeCountLimit = $attributeCountLimit; + + return $this; + } + + /** + * @param int $attributeValueLengthLimit Maximum allowed attribute value length + */ + public function setAttributeValueLengthLimit(int $attributeValueLengthLimit): LogRecordLimitsBuilder + { + $this->attributeValueLengthLimit = $attributeValueLengthLimit; + + return $this; + } + + /** + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#attribute-limits + */ + public function build(): LogRecordLimits + { + $attributeCountLimit = $this->attributeCountLimit + ?: Configuration::getInt(Variables::OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT); + $attributeValueLengthLimit = $this->attributeValueLengthLimit + ?: Configuration::getInt(Variables::OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT); + + if ($attributeValueLengthLimit === PHP_INT_MAX) { + $attributeValueLengthLimit = null; + } + + $attributesFactory = Attributes::factory($attributeCountLimit, $attributeValueLengthLimit); + + return new LogRecordLimits($attributesFactory); + } +} diff --git a/vendor/open-telemetry/sdk/Logs/LogRecordProcessorFactory.php b/vendor/open-telemetry/sdk/Logs/LogRecordProcessorFactory.php new file mode 100644 index 000000000..dec463735 --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/LogRecordProcessorFactory.php @@ -0,0 +1,62 @@ +createProcessor($name, $exporter, $meterProvider); + } + + switch (count($processors)) { + case 0: + return NoopLogRecordProcessor::getInstance(); + case 1: + return $processors[0]; + default: + return new MultiLogRecordProcessor($processors); + } + } + + private function createProcessor(string $name, LogRecordExporterInterface $exporter, ?MeterProviderInterface $meterProvider = null): LogRecordProcessorInterface + { + switch ($name) { + case KnownValues::VALUE_BATCH: + return new BatchLogRecordProcessor( + $exporter, + ClockFactory::getDefault(), + Configuration::getInt(Variables::OTEL_BLRP_MAX_QUEUE_SIZE), + Configuration::getInt(Variables::OTEL_BLRP_SCHEDULE_DELAY), + Configuration::getInt(Variables::OTEL_BLRP_EXPORT_TIMEOUT), + Configuration::getInt(Variables::OTEL_BLRP_MAX_EXPORT_BATCH_SIZE), + true, + $meterProvider, + ); + case KnownValues::VALUE_SIMPLE: + return new SimpleLogRecordProcessor($exporter); + case Values::VALUE_NOOP: + case Values::VALUE_NONE: + return NoopLogRecordProcessor::getInstance(); + default: + throw new InvalidArgumentException('Unknown processor: ' . $name); + } + } +} diff --git a/vendor/open-telemetry/sdk/Logs/LogRecordProcessorInterface.php b/vendor/open-telemetry/sdk/Logs/LogRecordProcessorInterface.php new file mode 100644 index 000000000..1977d48fd --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/LogRecordProcessorInterface.php @@ -0,0 +1,15 @@ +loggerSharedState = $loggerSharedState; + $this->scope = $scope; + } + + public function emit(LogRecord $logRecord): void + { + $readWriteLogRecord = new ReadWriteLogRecord($this->scope, $this->loggerSharedState, $logRecord); + // @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/sdk.md#onemit + $this->loggerSharedState->getProcessor()->onEmit( + $readWriteLogRecord, + $readWriteLogRecord->getContext(), + ); + } +} diff --git a/vendor/open-telemetry/sdk/Logs/LoggerProvider.php b/vendor/open-telemetry/sdk/Logs/LoggerProvider.php new file mode 100644 index 000000000..f0a8266c1 --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/LoggerProvider.php @@ -0,0 +1,56 @@ +loggerSharedState = new LoggerSharedState( + $resource ?? ResourceInfoFactory::defaultResource(), + (new LogRecordLimitsBuilder())->build(), + $processor + ); + $this->instrumentationScopeFactory = $instrumentationScopeFactory; + } + + /** + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/sdk.md#logger-creation + */ + public function getLogger(string $name, ?string $version = null, ?string $schemaUrl = null, iterable $attributes = []): LoggerInterface + { + if ($this->loggerSharedState->hasShutdown()) { + return NoopLogger::getInstance(); + } + $scope = $this->instrumentationScopeFactory->create($name, $version, $schemaUrl, $attributes); + + return new Logger($this->loggerSharedState, $scope); + } + + public function shutdown(CancellationInterface $cancellation = null): bool + { + return $this->loggerSharedState->shutdown($cancellation); + } + + public function forceFlush(CancellationInterface $cancellation = null): bool + { + return $this->loggerSharedState->forceFlush($cancellation); + } + + public static function builder(): LoggerProviderBuilder + { + return new LoggerProviderBuilder(); + } +} diff --git a/vendor/open-telemetry/sdk/Logs/LoggerProviderBuilder.php b/vendor/open-telemetry/sdk/Logs/LoggerProviderBuilder.php new file mode 100644 index 000000000..37c56245c --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/LoggerProviderBuilder.php @@ -0,0 +1,55 @@ + + */ + private array $processors = []; + private ?ResourceInfo $resource = null; + + public function addLogRecordProcessor(LogRecordProcessorInterface $processor): self + { + $this->processors[] = $processor; + + return $this; + } + + public function setResource(ResourceInfo $resource): self + { + $this->resource = $resource; + + return $this; + } + + public function build(): LoggerProviderInterface + { + return new LoggerProvider( + $this->buildProcessor(), + new InstrumentationScopeFactory(Attributes::factory()), + $this->resource + ); + } + + private function buildProcessor(): LogRecordProcessorInterface + { + switch (count($this->processors)) { + case 0: + return NoopLogRecordProcessor::getInstance(); + case 1: + return $this->processors[0]; + default: + return new MultiLogRecordProcessor($this->processors); + } + } +} diff --git a/vendor/open-telemetry/sdk/Logs/LoggerProviderFactory.php b/vendor/open-telemetry/sdk/Logs/LoggerProviderFactory.php new file mode 100644 index 000000000..3d0e965fd --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/LoggerProviderFactory.php @@ -0,0 +1,24 @@ +create(); + $processor = (new LogRecordProcessorFactory())->create($exporter, $meterProvider); + $instrumentationScopeFactory = new InstrumentationScopeFactory((new LogRecordLimitsBuilder())->build()->getAttributeFactory()); + + return new LoggerProvider($processor, $instrumentationScopeFactory); + } +} diff --git a/vendor/open-telemetry/sdk/Logs/LoggerProviderInterface.php b/vendor/open-telemetry/sdk/Logs/LoggerProviderInterface.php new file mode 100644 index 000000000..5debb13cc --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/LoggerProviderInterface.php @@ -0,0 +1,13 @@ +resource = $resource; + $this->limits = $limits; + $this->processor = $processor; + } + public function hasShutdown(): bool + { + return null !== $this->shutdownResult; + } + + public function getResource(): ResourceInfo + { + return $this->resource; + } + + public function getProcessor(): LogRecordProcessorInterface + { + return $this->processor; + } + + public function getLogRecordLimits(): LogRecordLimits + { + return $this->limits; + } + + public function shutdown(?CancellationInterface $cancellation = null): bool + { + if ($this->shutdownResult !== null) { + return $this->shutdownResult; + } + $this->shutdownResult = $this->processor->shutdown($cancellation); + + return $this->shutdownResult; + } + + public function forceFlush(?CancellationInterface $cancellation = null): bool + { + return $this->processor->forceFlush($cancellation); + } +} diff --git a/vendor/open-telemetry/sdk/Logs/NoopLoggerProvider.php b/vendor/open-telemetry/sdk/Logs/NoopLoggerProvider.php new file mode 100644 index 000000000..819e02ee5 --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/NoopLoggerProvider.php @@ -0,0 +1,33 @@ + 'batching']; + private const ATTRIBUTES_QUEUED = self::ATTRIBUTES_PROCESSOR + ['state' => 'queued']; + private const ATTRIBUTES_PENDING = self::ATTRIBUTES_PROCESSOR + ['state' => 'pending']; + private const ATTRIBUTES_PROCESSED = self::ATTRIBUTES_PROCESSOR + ['state' => 'processed']; + private const ATTRIBUTES_DROPPED = self::ATTRIBUTES_PROCESSOR + ['state' => 'dropped']; + private const ATTRIBUTES_FREE = self::ATTRIBUTES_PROCESSOR + ['state' => 'free']; + + private LogRecordExporterInterface $exporter; + private ClockInterface $clock; + private int $maxQueueSize; + private int $scheduledDelayNanos; + private int $maxExportBatchSize; + private bool $autoFlush; + private ContextInterface $exportContext; + + private ?int $nextScheduledRun = null; + private bool $running = false; + private int $dropped = 0; + private int $processed = 0; + private int $batchId = 0; + private int $queueSize = 0; + /** @var list */ + private array $batch = []; + /** @var SplQueue> */ + private SplQueue $queue; + /** @var SplQueue */ + private SplQueue $flush; + + private bool $closed = false; + + public function __construct( + LogRecordExporterInterface $exporter, + ClockInterface $clock, + int $maxQueueSize = self::DEFAULT_MAX_QUEUE_SIZE, + int $scheduledDelayMillis = self::DEFAULT_SCHEDULE_DELAY, + int $exportTimeoutMillis = self::DEFAULT_EXPORT_TIMEOUT, + int $maxExportBatchSize = self::DEFAULT_MAX_EXPORT_BATCH_SIZE, + bool $autoFlush = true, + ?MeterProviderInterface $meterProvider = null + ) { + if ($maxQueueSize <= 0) { + throw new InvalidArgumentException(sprintf('Maximum queue size (%d) must be greater than zero', $maxQueueSize)); + } + if ($scheduledDelayMillis <= 0) { + throw new InvalidArgumentException(sprintf('Scheduled delay (%d) must be greater than zero', $scheduledDelayMillis)); + } + if ($exportTimeoutMillis <= 0) { + throw new InvalidArgumentException(sprintf('Export timeout (%d) must be greater than zero', $exportTimeoutMillis)); + } + if ($maxExportBatchSize <= 0) { + throw new InvalidArgumentException(sprintf('Maximum export batch size (%d) must be greater than zero', $maxExportBatchSize)); + } + if ($maxExportBatchSize > $maxQueueSize) { + throw new InvalidArgumentException(sprintf('Maximum export batch size (%d) must be less than or equal to maximum queue size (%d)', $maxExportBatchSize, $maxQueueSize)); + } + + $this->exporter = $exporter; + $this->clock = $clock; + $this->maxQueueSize = $maxQueueSize; + $this->scheduledDelayNanos = $scheduledDelayMillis * 1_000_000; + $this->maxExportBatchSize = $maxExportBatchSize; + $this->autoFlush = $autoFlush; + + $this->exportContext = Context::getCurrent(); + $this->queue = new SplQueue(); + $this->flush = new SplQueue(); + + if ($meterProvider === null) { + return; + } + + $meter = $meterProvider->getMeter('io.opentelemetry.sdk'); + $meter + ->createObservableUpDownCounter( + 'otel.logs.log_processor.logs', + '{logs}', + 'The number of log records received by the processor', + ) + ->observe(function (ObserverInterface $observer): void { + $queued = $this->queue->count() * $this->maxExportBatchSize + count($this->batch); + $pending = $this->queueSize - $queued; + $processed = $this->processed; + $dropped = $this->dropped; + + $observer->observe($queued, self::ATTRIBUTES_QUEUED); + $observer->observe($pending, self::ATTRIBUTES_PENDING); + $observer->observe($processed, self::ATTRIBUTES_PROCESSED); + $observer->observe($dropped, self::ATTRIBUTES_DROPPED); + }); + $meter + ->createObservableUpDownCounter( + 'otel.logs.log_processor.queue.limit', + '{logs}', + 'The queue size limit', + ) + ->observe(function (ObserverInterface $observer): void { + $observer->observe($this->maxQueueSize, self::ATTRIBUTES_PROCESSOR); + }); + $meter + ->createObservableUpDownCounter( + 'otel.logs.log_processor.queue.usage', + '{logs}', + 'The current queue usage', + ) + ->observe(function (ObserverInterface $observer): void { + $queued = $this->queue->count() * $this->maxExportBatchSize + count($this->batch); + $pending = $this->queueSize - $queued; + $free = $this->maxQueueSize - $this->queueSize; + + $observer->observe($queued, self::ATTRIBUTES_QUEUED); + $observer->observe($pending, self::ATTRIBUTES_PENDING); + $observer->observe($free, self::ATTRIBUTES_FREE); + }); + } + + public function onEmit(ReadWriteLogRecord $record, ?ContextInterface $context = null): void + { + if ($this->closed) { + return; + } + + if ($this->queueSize === $this->maxQueueSize) { + $this->dropped++; + + return; + } + + $this->queueSize++; + $this->batch[] = $record; + $this->nextScheduledRun ??= $this->clock->now() + $this->scheduledDelayNanos; + + if (count($this->batch) === $this->maxExportBatchSize) { + $this->enqueueBatch(); + } + if ($this->autoFlush) { + $this->flush(); + } + } + + public function forceFlush(?CancellationInterface $cancellation = null): bool + { + if ($this->closed) { + return false; + } + + return $this->flush(__FUNCTION__, $cancellation); + } + + public function shutdown(?CancellationInterface $cancellation = null): bool + { + if ($this->closed) { + return false; + } + + $this->closed = true; + + return $this->flush(__FUNCTION__, $cancellation); + } + + private function flush(?string $flushMethod = null, ?CancellationInterface $cancellation = null): bool + { + if ($flushMethod !== null) { + $flushId = $this->batchId + $this->queue->count() + (int) (bool) $this->batch; + $this->flush->enqueue([$flushId, $flushMethod, $cancellation, !$this->running, Context::getCurrent()]); + } + + if ($this->running) { + return false; + } + + $success = true; + $exception = null; + $this->running = true; + + try { + for (;;) { + while (!$this->flush->isEmpty() && $this->flush->bottom()[0] <= $this->batchId) { + [, $flushMethod, $cancellation, $propagateResult, $context] = $this->flush->dequeue(); + $scope = $context->activate(); + + try { + $result = $this->exporter->$flushMethod($cancellation); + if ($propagateResult) { + $success = $result; + } + } catch (Throwable $e) { + if ($propagateResult) { + $exception = $e; + } else { + self::logError(sprintf('Unhandled %s error', $flushMethod), ['exception' => $e]); + } + } finally { + $scope->detach(); + } + } + + if (!$this->shouldFlush()) { + break; + } + + if ($this->queue->isEmpty()) { + $this->enqueueBatch(); + } + $batchSize = count($this->queue->bottom()); + $this->batchId++; + $scope = $this->exportContext->activate(); + + try { + $this->exporter->export($this->queue->dequeue())->await(); + } catch (Throwable $e) { + self::logError('Unhandled export error', ['exception' => $e]); + } finally { + $this->processed += $batchSize; + $this->queueSize -= $batchSize; + $scope->detach(); + } + } + } finally { + $this->running = false; + } + + if ($exception !== null) { + throw $exception; + } + + return $success; + } + + private function shouldFlush(): bool + { + return !$this->flush->isEmpty() + || $this->autoFlush && !$this->queue->isEmpty() + || $this->autoFlush && $this->nextScheduledRun !== null && $this->clock->now() > $this->nextScheduledRun; + } + + private function enqueueBatch(): void + { + assert($this->batch !== []); + + $this->queue->enqueue($this->batch); + $this->batch = []; + $this->nextScheduledRun = null; + } +} diff --git a/vendor/open-telemetry/sdk/Logs/Processor/MultiLogRecordProcessor.php b/vendor/open-telemetry/sdk/Logs/Processor/MultiLogRecordProcessor.php new file mode 100644 index 000000000..753a75df8 --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/Processor/MultiLogRecordProcessor.php @@ -0,0 +1,62 @@ +processors[] = $processor; + } + } + + public function onEmit(ReadWriteLogRecord $record, ?ContextInterface $context = null): void + { + foreach ($this->processors as $processor) { + $processor->onEmit($record, $context); + } + } + + /** + * Returns `true` if all processors shut down successfully, else `false` + * Subsequent calls to `shutdown` are a no-op. + */ + public function shutdown(?CancellationInterface $cancellation = null): bool + { + $result = true; + foreach ($this->processors as $processor) { + if (!$processor->shutdown($cancellation)) { + $result = false; + } + } + + return $result; + } + + /** + * Returns `true` if all processors flush successfully, else `false`. + */ + public function forceFlush(?CancellationInterface $cancellation = null): bool + { + $result = true; + foreach ($this->processors as $processor) { + if (!$processor->forceFlush($cancellation)) { + $result = false; + } + } + + return $result; + } +} diff --git a/vendor/open-telemetry/sdk/Logs/Processor/NoopLogRecordProcessor.php b/vendor/open-telemetry/sdk/Logs/Processor/NoopLogRecordProcessor.php new file mode 100644 index 000000000..7028052e1 --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/Processor/NoopLogRecordProcessor.php @@ -0,0 +1,37 @@ +exporter = $exporter; + } + + /** + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/sdk.md#onemit + */ + public function onEmit(ReadWriteLogRecord $record, ?ContextInterface $context = null): void + { + $this->exporter->export([$record]); + } + + public function shutdown(?CancellationInterface $cancellation = null): bool + { + return $this->exporter->shutdown($cancellation); + } + + public function forceFlush(?CancellationInterface $cancellation = null): bool + { + return $this->exporter->forceFlush($cancellation); + } +} diff --git a/vendor/open-telemetry/sdk/Logs/PsrSeverityMapperInterface.php b/vendor/open-telemetry/sdk/Logs/PsrSeverityMapperInterface.php new file mode 100644 index 000000000..3bb288c56 --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/PsrSeverityMapperInterface.php @@ -0,0 +1,50 @@ + 7, + // Interesting events. Examples: User logs in, SQL logs. + PsrLogLevel::INFO => 6, + // Normal but significant events. + PsrLogLevel::NOTICE => 5, + // Exceptional occurrences that are not errors. Examples: Use of deprecated APIs, poor use of an API, + // undesirable things that are not necessarily wrong. + PsrLogLevel::WARNING => 4, + // Runtime errors that do not require immediate action but should typically be logged and monitored. + PsrLogLevel::ERROR => 3, + // Critical conditions. Example: Application component unavailable, unexpected exception. + PsrLogLevel::CRITICAL => 2, + // Action must be taken immediately. Example: Entire website down, database unavailable, etc. + // This should trigger the alerts and wake you up. + PsrLogLevel::ALERT => 1, + // Emergency: system is unusable. + PsrLogLevel::EMERGENCY => 0, + ]; + + /** + * Mappig of OpenTelemetry SeverityNumber to PsrLogLevel. + * @see: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/specification/logs/data-model.md#field-severitynumber + */ + public const SEVERITY_NUMBER = [ + PsrLogLevel::DEBUG => 5, + PsrLogLevel::INFO => 9, + PsrLogLevel::NOTICE => 10, + PsrLogLevel::WARNING => 13, + PsrLogLevel::ERROR => 17, + PsrLogLevel::CRITICAL => 18, + PsrLogLevel::ALERT => 21, + PsrLogLevel::EMERGENCY => 22, + ]; +} diff --git a/vendor/open-telemetry/sdk/Logs/ReadWriteLogRecord.php b/vendor/open-telemetry/sdk/Logs/ReadWriteLogRecord.php new file mode 100644 index 000000000..9bb4b1564 --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/ReadWriteLogRecord.php @@ -0,0 +1,9 @@ +scope = $scope; + $this->loggerSharedState = $loggerSharedState; + + parent::__construct($logRecord->body); + $this->timestamp = $logRecord->timestamp; + $this->observedTimestamp = $logRecord->observedTimestamp + ?? (int) (microtime(true) * LogRecord::NANOS_PER_SECOND); + $this->context = $logRecord->context; + $context = $this->context ?? Context::getCurrent(); + $this->spanContext = Span::fromContext($context)->getContext(); + $this->severityNumber = $logRecord->severityNumber; + $this->severityText = $logRecord->severityText; + + //convert attributes now so that excess data is not sent to processors + $this->convertedAttributes = $this->loggerSharedState + ->getLogRecordLimits() + ->getAttributeFactory() + ->builder($logRecord->attributes, new LogRecordAttributeValidator()) + ->build(); + } + + public function getInstrumentationScope(): InstrumentationScopeInterface + { + return $this->scope; + } + + public function getResource(): ResourceInfo + { + return $this->loggerSharedState->getResource(); + } + + public function getTimestamp(): ?int + { + return $this->timestamp; + } + + public function getObservedTimestamp(): ?int + { + return $this->observedTimestamp; + } + + public function getContext(): ?ContextInterface + { + return $this->context; + } + + public function getSpanContext(): ?SpanContextInterface + { + return $this->spanContext; + } + + public function getSeverityNumber(): ?int + { + return $this->severityNumber; + } + + public function getSeverityText(): ?string + { + return $this->severityText; + } + + /** + * @return mixed|null + */ + public function getBody() + { + return $this->body; + } + + public function getAttributes(): AttributesInterface + { + return $this->convertedAttributes; + } +} diff --git a/vendor/open-telemetry/sdk/Logs/SimplePsrFileLogger.php b/vendor/open-telemetry/sdk/Logs/SimplePsrFileLogger.php new file mode 100644 index 000000000..9d9d55de6 --- /dev/null +++ b/vendor/open-telemetry/sdk/Logs/SimplePsrFileLogger.php @@ -0,0 +1,83 @@ +filename = $filename; + $this->loggerName = $loggerName; + } + + /** + * @psalm-suppress MoreSpecificImplementedParamType + */ + public function log($level, $message, array $context = []): void + { + $level = strtolower($level); + + if (!in_array($level, self::getLogLevels(), true)) { + throw new InvalidArgumentException( + sprintf('Invalid Log level: "%s"', $level) + ); + } + + file_put_contents($this->filename, $this->formatLog((string) $level, (string) $message, $context), FILE_APPEND); + } + + /** + * @param string $level + * @param string $message + * @param array $context + * @return string + */ + private function formatLog(string $level, string $message, array $context = []): string + { + try { + $encodedContext = json_encode($context, JSON_THROW_ON_ERROR); + } catch (Throwable $t) { + $encodedContext = sprintf('(Could not encode context: %s)', $t->getMessage()); + } + + return sprintf( + '[%s] %s %s: %s %s%s', + date(DATE_RFC3339_EXTENDED), + $this->loggerName, + $level, + $message, + $encodedContext, + PHP_EOL + ); + } + + /** + * @return array + */ + private static function getLogLevels(): array + { + return self::$logLevels ?? self::$logLevels = (new ReflectionClass(LogLevel::class))->getConstants(); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Aggregation/ExplicitBucketHistogramAggregation.php b/vendor/open-telemetry/sdk/Metrics/Aggregation/ExplicitBucketHistogramAggregation.php new file mode 100644 index 000000000..d68ecd830 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Aggregation/ExplicitBucketHistogramAggregation.php @@ -0,0 +1,167 @@ + + */ +final class ExplicitBucketHistogramAggregation implements AggregationInterface +{ + /** + * @var list + * @readonly + */ + public array $boundaries; + + /** + * @param list $boundaries strictly ascending histogram bucket boundaries + */ + public function __construct(array $boundaries) + { + $this->boundaries = $boundaries; + } + + public function initialize(): ExplicitBucketHistogramSummary + { + return new ExplicitBucketHistogramSummary( + 0, + 0, + +INF, + -INF, + array_fill(0, count($this->boundaries) + 1, 0), + ); + } + + /** + * @param ExplicitBucketHistogramSummary $summary + */ + public function record($summary, $value, AttributesInterface $attributes, ContextInterface $context, int $timestamp): void + { + $boundariesCount = count($this->boundaries); + for ($i = 0; $i < $boundariesCount && $this->boundaries[$i] < $value; $i++) { + } + $summary->count++; + $summary->sum += $value; + $summary->min = self::min($value, $summary->min); + $summary->max = self::max($value, $summary->max); + $summary->buckets[$i]++; + } + + /** + * @param ExplicitBucketHistogramSummary $left + * @param ExplicitBucketHistogramSummary $right + */ + public function merge($left, $right): ExplicitBucketHistogramSummary + { + $count = $left->count + $right->count; + $sum = $left->sum + $right->sum; + $min = self::min($left->min, $right->min); + $max = self::max($left->max, $right->max); + $buckets = $right->buckets; + foreach ($left->buckets as $i => $bucketCount) { + $buckets[$i] += $bucketCount; + } + + return new ExplicitBucketHistogramSummary( + $count, + $sum, + $min, + $max, + $buckets, + ); + } + + /** + * @param ExplicitBucketHistogramSummary $left + * @param ExplicitBucketHistogramSummary $right + */ + public function diff($left, $right): ExplicitBucketHistogramSummary + { + $count = -$left->count + $right->count; + $sum = -$left->sum + $right->sum; + $min = $left->min > $right->min ? $right->min : NAN; + $max = $left->max < $right->max ? $right->max : NAN; + $buckets = $right->buckets; + foreach ($left->buckets as $i => $bucketCount) { + $buckets[$i] -= $bucketCount; + } + + return new ExplicitBucketHistogramSummary( + $count, + $sum, + $min, + $max, + $buckets, + ); + } + + /** + * @param array $summaries + */ + public function toData( + array $attributes, + array $summaries, + array $exemplars, + int $startTimestamp, + int $timestamp, + $temporality + ): Data\Histogram { + $dataPoints = []; + foreach ($attributes as $key => $dataPointAttributes) { + if ($summaries[$key]->count === 0) { + continue; + } + + $dataPoints[] = new Data\HistogramDataPoint( + $summaries[$key]->count, + $summaries[$key]->sum, + $summaries[$key]->min, + $summaries[$key]->max, + $summaries[$key]->buckets, + $this->boundaries, + $dataPointAttributes, + $startTimestamp, + $timestamp, + $exemplars[$key] ?? [], + ); + } + + return new Data\Histogram( + $dataPoints, + $temporality, + ); + } + + /** + * @param float|int $left + * @param float|int $right + * @return float|int + */ + private static function min($left, $right) + { + /** @noinspection PhpConditionAlreadyCheckedInspection */ + return $left <= $right ? $left : ($right <= $left ? $right : NAN); + } + + /** + * @param float|int $left + * @param float|int $right + * @return float|int + */ + private static function max($left, $right) + { + /** @noinspection PhpConditionAlreadyCheckedInspection */ + return $left >= $right ? $left : ($right >= $left ? $right : NAN); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Aggregation/ExplicitBucketHistogramSummary.php b/vendor/open-telemetry/sdk/Metrics/Aggregation/ExplicitBucketHistogramSummary.php new file mode 100644 index 000000000..1878a34a0 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Aggregation/ExplicitBucketHistogramSummary.php @@ -0,0 +1,40 @@ +count = $count; + $this->sum = $sum; + $this->min = $min; + $this->max = $max; + $this->buckets = $buckets; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Aggregation/LastValueAggregation.php b/vendor/open-telemetry/sdk/Metrics/Aggregation/LastValueAggregation.php new file mode 100644 index 000000000..aff04e315 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Aggregation/LastValueAggregation.php @@ -0,0 +1,81 @@ + + */ +final class LastValueAggregation implements AggregationInterface +{ + public function initialize(): LastValueSummary + { + return new LastValueSummary(null, 0); + } + + /** + * @param LastValueSummary $summary + */ + public function record($summary, $value, AttributesInterface $attributes, ContextInterface $context, int $timestamp): void + { + if ($summary->value === null || $timestamp >= $summary->timestamp) { + $summary->value = $value; + $summary->timestamp = $timestamp; + } + } + + /** + * @param LastValueSummary $left + * @param LastValueSummary $right + */ + public function merge($left, $right): LastValueSummary + { + return $right->timestamp >= $left->timestamp ? $right : $left; + } + + /** + * @param LastValueSummary $left + * @param LastValueSummary $right + */ + public function diff($left, $right): LastValueSummary + { + return $right->timestamp >= $left->timestamp ? $right : $left; + } + + /** + * @param array $summaries + */ + public function toData( + array $attributes, + array $summaries, + array $exemplars, + int $startTimestamp, + int $timestamp, + $temporality + ): Data\Gauge { + $dataPoints = []; + foreach ($attributes as $key => $dataPointAttributes) { + if ($summaries[$key]->value === null) { + continue; + } + + $dataPoints[] = new Data\NumberDataPoint( + $summaries[$key]->value, + $dataPointAttributes, + $startTimestamp, + $timestamp, + $exemplars[$key] ?? [], + ); + } + + return new Data\Gauge( + $dataPoints, + ); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Aggregation/LastValueSummary.php b/vendor/open-telemetry/sdk/Metrics/Aggregation/LastValueSummary.php new file mode 100644 index 000000000..6cdb5ac9f --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Aggregation/LastValueSummary.php @@ -0,0 +1,22 @@ +value = $value; + $this->timestamp = $timestamp; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Aggregation/SumAggregation.php b/vendor/open-telemetry/sdk/Metrics/Aggregation/SumAggregation.php new file mode 100644 index 000000000..dc317ce73 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Aggregation/SumAggregation.php @@ -0,0 +1,91 @@ + + */ +final class SumAggregation implements AggregationInterface +{ + private bool $monotonic; + + public function __construct(bool $monotonic = false) + { + $this->monotonic = $monotonic; + } + + public function initialize(): SumSummary + { + return new SumSummary(0); + } + + /** + * @param SumSummary $summary + */ + public function record($summary, $value, AttributesInterface $attributes, ContextInterface $context, int $timestamp): void + { + $summary->value += $value; + } + + /** + * @param SumSummary $left + * @param SumSummary $right + */ + public function merge($left, $right): SumSummary + { + $sum = $left->value + $right->value; + + return new SumSummary( + $sum, + ); + } + + /** + * @param SumSummary $left + * @param SumSummary $right + */ + public function diff($left, $right): SumSummary + { + $sum = -$left->value + $right->value; + + return new SumSummary( + $sum, + ); + } + + /** + * @param array $summaries + */ + public function toData( + array $attributes, + array $summaries, + array $exemplars, + int $startTimestamp, + int $timestamp, + $temporality + ): Data\Sum { + $dataPoints = []; + foreach ($attributes as $key => $dataPointAttributes) { + $dataPoints[] = new Data\NumberDataPoint( + $summaries[$key]->value, + $dataPointAttributes, + $startTimestamp, + $timestamp, + $exemplars[$key] ?? [], + ); + } + + return new Data\Sum( + $dataPoints, + $temporality, + $this->monotonic, + ); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Aggregation/SumSummary.php b/vendor/open-telemetry/sdk/Metrics/Aggregation/SumSummary.php new file mode 100644 index 000000000..9b257193c --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Aggregation/SumSummary.php @@ -0,0 +1,20 @@ +value = $value; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/AggregationInterface.php b/vendor/open-telemetry/sdk/Metrics/AggregationInterface.php new file mode 100644 index 000000000..0a85207e0 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/AggregationInterface.php @@ -0,0 +1,57 @@ + $attributes + * @psalm-param array $summaries + * @param array> $exemplars + * @param string|Temporality $temporality + */ + public function toData( + array $attributes, + array $summaries, + array $exemplars, + int $startTimestamp, + int $timestamp, + $temporality + ): DataInterface; +} diff --git a/vendor/open-telemetry/sdk/Metrics/AggregationTemporalitySelectorInterface.php b/vendor/open-telemetry/sdk/Metrics/AggregationTemporalitySelectorInterface.php new file mode 100644 index 000000000..f046d033d --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/AggregationTemporalitySelectorInterface.php @@ -0,0 +1,21 @@ +attributeKeys = $attributeKeys; + } + + public function process(AttributesInterface $attributes, ContextInterface $context): AttributesInterface + { + $filtered = []; + foreach ($this->attributeKeys as $key) { + $filtered[$key] = $attributes->get($key); + } + + return new Attributes($filtered, 0); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/AttributeProcessor/IdentityAttributeProcessor.php b/vendor/open-telemetry/sdk/Metrics/AttributeProcessor/IdentityAttributeProcessor.php new file mode 100644 index 000000000..f261563ea --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/AttributeProcessor/IdentityAttributeProcessor.php @@ -0,0 +1,20 @@ +writer = $writer; + $this->instrument = $instrument; + $this->referenceCounter = $referenceCounter; + + $this->referenceCounter->acquire(); + } + + public function __destruct() + { + $this->referenceCounter->release(); + } + + public function add($amount, iterable $attributes = [], $context = null): void + { + $this->writer->record($this->instrument, $amount, $attributes, $context); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Data/DataInterface.php b/vendor/open-telemetry/sdk/Metrics/Data/DataInterface.php new file mode 100644 index 000000000..7aa0c0e20 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Data/DataInterface.php @@ -0,0 +1,9 @@ +index = $index; + $this->value = $value; + $this->timestamp = $timestamp; + $this->attributes = $attributes; + $this->traceId = $traceId; + $this->spanId = $spanId; + } + + /** + * @param iterable $exemplars + * @return array> + */ + public static function groupByIndex(iterable $exemplars): array + { + $grouped = []; + foreach ($exemplars as $exemplar) { + $grouped[$exemplar->index][] = $exemplar; + } + + return $grouped; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Data/Gauge.php b/vendor/open-telemetry/sdk/Metrics/Data/Gauge.php new file mode 100644 index 000000000..00eb50939 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Data/Gauge.php @@ -0,0 +1,22 @@ + + * @readonly + */ + public iterable $dataPoints; + /** + * @param iterable $dataPoints + */ + public function __construct(iterable $dataPoints) + { + $this->dataPoints = $dataPoints; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Data/Histogram.php b/vendor/open-telemetry/sdk/Metrics/Data/Histogram.php new file mode 100644 index 000000000..782698026 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Data/Histogram.php @@ -0,0 +1,29 @@ + + * @readonly + */ + public iterable $dataPoints; + /** + * @var string|Temporality + * @readonly + */ + public $temporality; + /** + * @param iterable $dataPoints + * @param string|Temporality $temporality + */ + public function __construct(iterable $dataPoints, $temporality) + { + $this->dataPoints = $dataPoints; + $this->temporality = $temporality; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Data/HistogramDataPoint.php b/vendor/open-telemetry/sdk/Metrics/Data/HistogramDataPoint.php new file mode 100644 index 000000000..4c9df07b4 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Data/HistogramDataPoint.php @@ -0,0 +1,76 @@ + + * @readonly + */ + public array $explicitBounds; + /** + * @readonly + */ + public AttributesInterface $attributes; + /** + * @readonly + */ + public int $startTimestamp; + /** + * @readonly + */ + public int $timestamp; + /** + * @readonly + */ + public iterable $exemplars = []; + /** + * @param float|int $sum + * @param float|int $min + * @param float|int $max + * @param int[] $bucketCounts + * @param list $explicitBounds + */ + public function __construct(int $count, $sum, $min, $max, array $bucketCounts, array $explicitBounds, AttributesInterface $attributes, int $startTimestamp, int $timestamp, iterable $exemplars = []) + { + $this->count = $count; + $this->sum = $sum; + $this->min = $min; + $this->max = $max; + $this->bucketCounts = $bucketCounts; + $this->explicitBounds = $explicitBounds; + $this->attributes = $attributes; + $this->startTimestamp = $startTimestamp; + $this->timestamp = $timestamp; + $this->exemplars = $exemplars; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Data/Metric.php b/vendor/open-telemetry/sdk/Metrics/Data/Metric.php new file mode 100644 index 000000000..41fcb52dd --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Data/Metric.php @@ -0,0 +1,46 @@ +instrumentationScope = $instrumentationScope; + $this->resource = $resource; + $this->name = $name; + $this->description = $description; + $this->unit = $unit; + $this->data = $data; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Data/NumberDataPoint.php b/vendor/open-telemetry/sdk/Metrics/Data/NumberDataPoint.php new file mode 100644 index 000000000..1d00e783a --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Data/NumberDataPoint.php @@ -0,0 +1,43 @@ +value = $value; + $this->attributes = $attributes; + $this->startTimestamp = $startTimestamp; + $this->timestamp = $timestamp; + $this->exemplars = $exemplars; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Data/Sum.php b/vendor/open-telemetry/sdk/Metrics/Data/Sum.php new file mode 100644 index 000000000..77c4c1021 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Data/Sum.php @@ -0,0 +1,34 @@ + + * @readonly + */ + public iterable $dataPoints; + /** + * @var string|Temporality + * @readonly + */ + public $temporality; + /** + * @readonly + */ + public bool $monotonic; + /** + * @param iterable $dataPoints + * @param string|Temporality $temporality + */ + public function __construct(iterable $dataPoints, $temporality, bool $monotonic) + { + $this->dataPoints = $dataPoints; + $this->temporality = $temporality; + $this->monotonic = $monotonic; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Data/Temporality.php b/vendor/open-telemetry/sdk/Metrics/Data/Temporality.php new file mode 100644 index 000000000..b6642ebd0 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Data/Temporality.php @@ -0,0 +1,20 @@ + */ + private array $buckets; + + public function __construct(int $size = 0) + { + $this->buckets = array_fill(0, $size, null); + } + + /** + * @param int|string $index + * @param float|int $value + */ + public function store(int $bucket, $index, $value, AttributesInterface $attributes, ContextInterface $context, int $timestamp): void + { + assert($bucket <= count($this->buckets)); + + $exemplar = $this->buckets[$bucket] ??= new BucketEntry(); + $exemplar->index = $index; + $exemplar->value = $value; + $exemplar->timestamp = $timestamp; + $exemplar->attributes = $attributes; + + if (($spanContext = Span::fromContext($context)->getContext())->isValid()) { + $exemplar->traceId = $spanContext->getTraceId(); + $exemplar->spanId = $spanContext->getSpanId(); + } else { + $exemplar->traceId = null; + $exemplar->spanId = null; + } + } + + /** + * @param array $dataPointAttributes + * @return array + */ + public function collect(array $dataPointAttributes): array + { + $exemplars = []; + foreach ($this->buckets as $index => &$exemplar) { + if (!$exemplar) { + continue; + } + + $exemplars[$index] = new Exemplar( + $exemplar->index, + $exemplar->value, + $exemplar->timestamp, + $this->filterExemplarAttributes( + $dataPointAttributes[$exemplar->index], + $exemplar->attributes, + ), + $exemplar->traceId, + $exemplar->spanId, + ); + $exemplar = null; + } + + return $exemplars; + } + + private function filterExemplarAttributes(AttributesInterface $dataPointAttributes, AttributesInterface $exemplarAttributes): AttributesInterface + { + $attributes = []; + foreach ($exemplarAttributes as $key => $value) { + if ($dataPointAttributes->get($key) === null) { + $attributes[$key] = $value; + } + } + + return new Attributes($attributes, $exemplarAttributes->getDroppedAttributesCount()); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilter/AllExemplarFilter.php b/vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilter/AllExemplarFilter.php new file mode 100644 index 000000000..b74e738aa --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilter/AllExemplarFilter.php @@ -0,0 +1,21 @@ +getContext()->isSampled(); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilterInterface.php b/vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilterInterface.php new file mode 100644 index 000000000..1d5dec7b8 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilterInterface.php @@ -0,0 +1,20 @@ + $dataPointAttributes + * @return array + */ + public function collect(array $dataPointAttributes): array; +} diff --git a/vendor/open-telemetry/sdk/Metrics/Exemplar/FilteredReservoir.php b/vendor/open-telemetry/sdk/Metrics/Exemplar/FilteredReservoir.php new file mode 100644 index 000000000..0e4f24357 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Exemplar/FilteredReservoir.php @@ -0,0 +1,36 @@ +reservoir = $reservoir; + $this->filter = $filter; + } + + public function offer($index, $value, AttributesInterface $attributes, ContextInterface $context, int $timestamp): void + { + if ($this->filter->accepts($value, $attributes, $context, $timestamp)) { + $this->reservoir->offer($index, $value, $attributes, $context, $timestamp); + } + } + + public function collect(array $dataPointAttributes): array + { + return $this->reservoir->collect($dataPointAttributes); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Exemplar/FixedSizeReservoir.php b/vendor/open-telemetry/sdk/Metrics/Exemplar/FixedSizeReservoir.php new file mode 100644 index 000000000..479292a4c --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Exemplar/FixedSizeReservoir.php @@ -0,0 +1,38 @@ +storage = new BucketStorage($size); + $this->size = $size; + } + + public function offer($index, $value, AttributesInterface $attributes, ContextInterface $context, int $timestamp): void + { + $bucket = random_int(0, $this->measurements); + $this->measurements++; + if ($bucket < $this->size) { + $this->storage->store($bucket, $index, $value, $attributes, $context, $timestamp); + } + } + + public function collect(array $dataPointAttributes): array + { + $this->measurements = 0; + + return $this->storage->collect($dataPointAttributes); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Exemplar/HistogramBucketReservoir.php b/vendor/open-telemetry/sdk/Metrics/Exemplar/HistogramBucketReservoir.php new file mode 100644 index 000000000..b56a1b2be --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Exemplar/HistogramBucketReservoir.php @@ -0,0 +1,40 @@ + + */ + private array $boundaries; + + /** + * @param list $boundaries + */ + public function __construct(array $boundaries) + { + $this->storage = new BucketStorage(count($boundaries) + 1); + $this->boundaries = $boundaries; + } + + public function offer($index, $value, AttributesInterface $attributes, ContextInterface $context, int $timestamp): void + { + $boundariesCount = count($this->boundaries); + for ($i = 0; $i < $boundariesCount && $this->boundaries[$i] < $value; $i++) { + } + $this->storage->store($i, $index, $value, $attributes, $context, $timestamp); + } + + public function collect(array $dataPointAttributes): array + { + return $this->storage->collect($dataPointAttributes); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Exemplar/NoopReservoir.php b/vendor/open-telemetry/sdk/Metrics/Exemplar/NoopReservoir.php new file mode 100644 index 000000000..010aeff20 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Exemplar/NoopReservoir.php @@ -0,0 +1,21 @@ +writer = $writer; + $this->instrument = $instrument; + $this->referenceCounter = $referenceCounter; + + $this->referenceCounter->acquire(); + } + + public function __destruct() + { + $this->referenceCounter->release(); + } + + public function record($amount, iterable $attributes = [], $context = null): void + { + $this->writer->record($this->instrument, $amount, $attributes, $context); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Instrument.php b/vendor/open-telemetry/sdk/Metrics/Instrument.php new file mode 100644 index 000000000..3543604c0 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Instrument.php @@ -0,0 +1,36 @@ +type = $type; + $this->name = $name; + $this->unit = $unit; + $this->description = $description; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/InstrumentType.php b/vendor/open-telemetry/sdk/Metrics/InstrumentType.php new file mode 100644 index 000000000..ae603b2fe --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/InstrumentType.php @@ -0,0 +1,25 @@ + */ + private iterable $metricRegistries; + private ViewRegistryInterface $viewRegistry; + private ?ExemplarFilterInterface $exemplarFilter; + private MeterInstruments $instruments; + private InstrumentationScopeInterface $instrumentationScope; + + private MetricRegistryInterface $registry; + private MetricWriterInterface $writer; + + private ?string $instrumentationScopeId = null; + + /** + * @param iterable $metricRegistries + */ + public function __construct( + MetricFactoryInterface $metricFactory, + ResourceInfo $resource, + ClockInterface $clock, + StalenessHandlerFactoryInterface $stalenessHandlerFactory, + iterable $metricRegistries, + ViewRegistryInterface $viewRegistry, + ?ExemplarFilterInterface $exemplarFilter, + MeterInstruments $instruments, + InstrumentationScopeInterface $instrumentationScope, + MetricRegistryInterface $registry, + MetricWriterInterface $writer + ) { + $this->metricFactory = $metricFactory; + $this->resource = $resource; + $this->clock = $clock; + $this->stalenessHandlerFactory = $stalenessHandlerFactory; + $this->metricRegistries = $metricRegistries; + $this->viewRegistry = $viewRegistry; + $this->exemplarFilter = $exemplarFilter; + $this->instruments = $instruments; + $this->instrumentationScope = $instrumentationScope; + $this->registry = $registry; + $this->writer = $writer; + } + + public function createCounter(string $name, ?string $unit = null, ?string $description = null): CounterInterface + { + [$instrument, $referenceCounter] = $this->createSynchronousWriter( + InstrumentType::COUNTER, + $name, + $unit, + $description, + ); + + return new Counter($this->writer, $instrument, $referenceCounter); + } + + public function createObservableCounter(string $name, ?string $unit = null, ?string $description = null, callable ...$callbacks): ObservableCounterInterface + { + [$instrument, $referenceCounter, $destructors] = $this->createAsynchronousObserver( + InstrumentType::ASYNCHRONOUS_COUNTER, + $name, + $unit, + $description, + ); + + foreach ($callbacks as $callback) { + $this->writer->registerCallback(closure($callback), $instrument); + $referenceCounter->acquire(true); + } + + return new ObservableCounter($this->writer, $instrument, $referenceCounter, $destructors); + } + + public function createHistogram(string $name, ?string $unit = null, ?string $description = null): HistogramInterface + { + [$instrument, $referenceCounter] = $this->createSynchronousWriter( + InstrumentType::HISTOGRAM, + $name, + $unit, + $description, + ); + + return new Histogram($this->writer, $instrument, $referenceCounter); + } + + public function createObservableGauge(string $name, ?string $unit = null, ?string $description = null, callable ...$callbacks): ObservableGaugeInterface + { + [$instrument, $referenceCounter, $destructors] = $this->createAsynchronousObserver( + InstrumentType::ASYNCHRONOUS_GAUGE, + $name, + $unit, + $description, + ); + + foreach ($callbacks as $callback) { + $this->writer->registerCallback(closure($callback), $instrument); + $referenceCounter->acquire(true); + } + + return new ObservableGauge($this->writer, $instrument, $referenceCounter, $destructors); + } + + public function createUpDownCounter(string $name, ?string $unit = null, ?string $description = null): UpDownCounterInterface + { + [$instrument, $referenceCounter] = $this->createSynchronousWriter( + InstrumentType::UP_DOWN_COUNTER, + $name, + $unit, + $description, + ); + + return new UpDownCounter($this->writer, $instrument, $referenceCounter); + } + + public function createObservableUpDownCounter(string $name, ?string $unit = null, ?string $description = null, callable ...$callbacks): ObservableUpDownCounterInterface + { + [$instrument, $referenceCounter, $destructors] = $this->createAsynchronousObserver( + InstrumentType::ASYNCHRONOUS_UP_DOWN_COUNTER, + $name, + $unit, + $description, + ); + + foreach ($callbacks as $callback) { + $this->writer->registerCallback(closure($callback), $instrument); + $referenceCounter->acquire(true); + } + + return new ObservableUpDownCounter($this->writer, $instrument, $referenceCounter, $destructors); + } + + /** + * @param string|InstrumentType $instrumentType + * @return array{Instrument, ReferenceCounterInterface} + */ + private function createSynchronousWriter($instrumentType, string $name, ?string $unit, ?string $description): array + { + $instrument = new Instrument($instrumentType, $name, $unit, $description); + + $instrumentationScopeId = $this->instrumentationScopeId($this->instrumentationScope); + $instrumentId = $this->instrumentId($instrument); + + $instruments = $this->instruments; + if ($writer = $instruments->writers[$instrumentationScopeId][$instrumentId] ?? null) { + return $writer; + } + + $stalenessHandler = $this->stalenessHandlerFactory->create(); + $instruments->startTimestamp ??= $this->clock->now(); + $streamIds = $this->metricFactory->createSynchronousWriter( + $this->registry, + $this->resource, + $this->instrumentationScope, + $instrument, + $instruments->startTimestamp, + $this->viewRegistrationRequests($instrument, $stalenessHandler), + $this->exemplarFilter, + ); + + $registry = $this->registry; + $stalenessHandler->onStale(static function () use ($instruments, $instrumentationScopeId, $instrumentId, $registry, $streamIds): void { + unset($instruments->writers[$instrumentationScopeId][$instrumentId]); + if (!$instruments->writers[$instrumentationScopeId]) { + unset($instruments->writers[$instrumentationScopeId]); + } + foreach ($streamIds as $streamId) { + $registry->unregisterStream($streamId); + } + + $instruments->startTimestamp = null; + }); + + return $instruments->writers[$instrumentationScopeId][$instrumentId] = [ + $instrument, + $stalenessHandler, + ]; + } + + /** + * @param string|InstrumentType $instrumentType + * @return array{Instrument, ReferenceCounterInterface, ArrayAccess} + */ + private function createAsynchronousObserver($instrumentType, string $name, ?string $unit, ?string $description): array + { + $instrument = new Instrument($instrumentType, $name, $unit, $description); + + $instrumentationScopeId = $this->instrumentationScopeId($this->instrumentationScope); + $instrumentId = $this->instrumentId($instrument); + + $instruments = $this->instruments; + /** @phan-suppress-next-line PhanDeprecatedProperty */ + $instruments->staleObservers = []; + if ($observer = $instruments->observers[$instrumentationScopeId][$instrumentId] ?? null) { + return $observer; + } + + $stalenessHandler = $this->stalenessHandlerFactory->create(); + $instruments->startTimestamp ??= $this->clock->now(); + $streamIds = $this->metricFactory->createAsynchronousObserver( + $this->registry, + $this->resource, + $this->instrumentationScope, + $instrument, + $instruments->startTimestamp, + $this->viewRegistrationRequests($instrument, $stalenessHandler), + ); + + $registry = $this->registry; + $stalenessHandler->onStale(static function () use ($instruments, $instrumentationScopeId, $instrumentId, $registry, $streamIds): void { + if (PHP_VERSION_ID < 80000) { + /** @phan-suppress-next-line PhanDeprecatedProperty */ + $instruments->staleObservers[] = $instruments->observers[$instrumentationScopeId][$instrumentId][2]; + } + + unset($instruments->observers[$instrumentationScopeId][$instrumentId]); + if (!$instruments->observers[$instrumentationScopeId]) { + unset($instruments->observers[$instrumentationScopeId]); + } + foreach ($streamIds as $streamId) { + $registry->unregisterStream($streamId); + } + + $instruments->startTimestamp = null; + }); + + /** @var ArrayAccess $destructors */ + $destructors = WeakMap::create(); + + return $instruments->observers[$instrumentationScopeId][$instrumentId] = [ + $instrument, + $stalenessHandler, + $destructors, + ]; + } + + /** + * @return iterable + */ + private function viewRegistrationRequests(Instrument $instrument, StalenessHandlerInterface $stalenessHandler): iterable + { + $views = $this->viewRegistry->find($instrument, $this->instrumentationScope) ?? [ + new ViewProjection( + $instrument->name, + $instrument->unit, + $instrument->description, + null, + null, + ), + ]; + + $compositeRegistration = new MultiRegistryRegistration($this->metricRegistries, $stalenessHandler); + foreach ($views as $view) { + if ($view->aggregation !== null) { + yield [$view, $compositeRegistration]; + } else { + foreach ($this->metricRegistries as $metricRegistry) { + yield [ + new ViewProjection( + $view->name, + $view->unit, + $view->description, + $view->attributeKeys, + $metricRegistry->defaultAggregation($instrument->type), + ), + new RegistryRegistration($metricRegistry, $stalenessHandler), + ]; + } + } + } + } + + private function instrumentationScopeId(InstrumentationScopeInterface $instrumentationScope): string + { + return $this->instrumentationScopeId ??= serialize($instrumentationScope); + } + + private function instrumentId(Instrument $instrument): string + { + return serialize($instrument); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/MeterInstruments.php b/vendor/open-telemetry/sdk/Metrics/MeterInstruments.php new file mode 100644 index 000000000..c331cb608 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/MeterInstruments.php @@ -0,0 +1,29 @@ +}>> + */ + public array $observers = []; + /** + * @var array> + */ + public array $writers = []; + + /** + * @var list> + * @deprecated + */ + public array $staleObservers = []; +} diff --git a/vendor/open-telemetry/sdk/Metrics/MeterProvider.php b/vendor/open-telemetry/sdk/Metrics/MeterProvider.php new file mode 100644 index 000000000..36c17cf81 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/MeterProvider.php @@ -0,0 +1,130 @@ + $metricReaders + */ + public function __construct( + ?ContextStorageInterface $contextStorage, + ResourceInfo $resource, + ClockInterface $clock, + AttributesFactoryInterface $attributesFactory, + InstrumentationScopeFactoryInterface $instrumentationScopeFactory, + iterable $metricReaders, + ViewRegistryInterface $viewRegistry, + ?ExemplarFilterInterface $exemplarFilter, + StalenessHandlerFactoryInterface $stalenessHandlerFactory, + MetricFactoryInterface $metricFactory = null + ) { + $this->metricFactory = $metricFactory ?? new StreamFactory(); + $this->resource = $resource; + $this->clock = $clock; + $this->instrumentationScopeFactory = $instrumentationScopeFactory; + $this->metricReaders = $metricReaders; + $this->viewRegistry = $viewRegistry; + $this->exemplarFilter = $exemplarFilter; + $this->stalenessHandlerFactory = $stalenessHandlerFactory; + $this->instruments = new MeterInstruments(); + + $registry = new MetricRegistry($contextStorage, $attributesFactory, $clock); + $this->registry = $registry; + $this->writer = $registry; + } + + public function getMeter( + string $name, + ?string $version = null, + ?string $schemaUrl = null, + iterable $attributes = [] + ): MeterInterface { + if ($this->closed || Sdk::isDisabled()) { //@todo create meter provider from factory, and move Sdk::isDisabled() there + return new NoopMeter(); + } + + return new Meter( + $this->metricFactory, + $this->resource, + $this->clock, + $this->stalenessHandlerFactory, + $this->metricReaders, + $this->viewRegistry, + $this->exemplarFilter, + $this->instruments, + $this->instrumentationScopeFactory->create($name, $version, $schemaUrl, $attributes), + $this->registry, + $this->writer, + ); + } + + public function shutdown(): bool + { + if ($this->closed) { + return false; + } + + $this->closed = true; + + $success = true; + foreach ($this->metricReaders as $metricReader) { + if (!$metricReader->shutdown()) { + $success = false; + } + } + + return $success; + } + + public function forceFlush(): bool + { + if ($this->closed) { + return false; + } + + $success = true; + foreach ($this->metricReaders as $metricReader) { + if (!$metricReader->forceFlush()) { + $success = false; + } + } + + return $success; + } + + public static function builder(): MeterProviderBuilder + { + return new MeterProviderBuilder(); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/MeterProviderBuilder.php b/vendor/open-telemetry/sdk/Metrics/MeterProviderBuilder.php new file mode 100644 index 000000000..17f0be895 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/MeterProviderBuilder.php @@ -0,0 +1,62 @@ + + private array $metricReaders = []; + private ?ResourceInfo $resource = null; + private ?ExemplarFilterInterface $exemplarFilter = null; + + public function setResource(ResourceInfo $resource): self + { + $this->resource = $resource; + + return $this; + } + + public function setExemplarFilter(ExemplarFilterInterface $exemplarFilter): self + { + $this->exemplarFilter = $exemplarFilter; + + return $this; + } + + public function addReader(MetricReaderInterface $reader): self + { + $this->metricReaders[] = $reader; + + return $this; + } + + /** + * @psalm-suppress PossiblyInvalidArgument + */ + public function build(): MeterProviderInterface + { + return new MeterProvider( + null, + $this->resource ?? ResourceInfoFactory::emptyResource(), + ClockFactory::getDefault(), + Attributes::factory(), + new InstrumentationScopeFactory(Attributes::factory()), + $this->metricReaders, + new CriteriaViewRegistry(), + $this->exemplarFilter ?? new WithSampledTraceExemplarFilter(), + new NoopStalenessHandlerFactory(), + ); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/MeterProviderFactory.php b/vendor/open-telemetry/sdk/Metrics/MeterProviderFactory.php new file mode 100644 index 000000000..5f7f9988d --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/MeterProviderFactory.php @@ -0,0 +1,78 @@ +create(); + } catch (\Throwable $t) { + self::logWarning(sprintf('Unable to create %s meter provider: %s', $exporterName, $t->getMessage())); + $exporter = new NoopMetricExporter(); + } + + // @todo "The exporter MUST be paired with a periodic exporting MetricReader" + $reader = new ExportingReader($exporter); + $resource = ResourceInfoFactory::defaultResource(); + $exemplarFilter = $this->createExemplarFilter(Configuration::getEnum(Variables::OTEL_METRICS_EXEMPLAR_FILTER)); + + return MeterProvider::builder() + ->setResource($resource) + ->addReader($reader) + ->setExemplarFilter($exemplarFilter) + ->build(); + } + + private function createExemplarFilter(string $name): ExemplarFilterInterface + { + switch ($name) { + case KnownValues::VALUE_WITH_SAMPLED_TRACE: + return new WithSampledTraceExemplarFilter(); + case KnownValues::VALUE_ALL: + return new AllExemplarFilter(); + case KnownValues::VALUE_NONE: + return new NoneExemplarFilter(); + default: + self::logWarning('Unknown exemplar filter: ' . $name); + + return new NoneExemplarFilter(); + } + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/MeterProviderInterface.php b/vendor/open-telemetry/sdk/Metrics/MeterProviderInterface.php new file mode 100644 index 000000000..fcb951106 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/MeterProviderInterface.php @@ -0,0 +1,12 @@ +temporality = $temporality; + } + /** + * @inheritDoc + */ + public function temporality(MetricMetadataInterface $metric) + { + return $this->temporality ?? $metric->temporality(); + } + + /** + * @inheritDoc + */ + public function export(iterable $batch): bool + { + $resource = null; + $scope = null; + foreach ($batch as $metric) { + /** @var Metric $metric */ + if (!$resource) { + $resource = $this->convertResource($metric->resource); + } + if (!$scope) { + $scope = $this->convertInstrumentationScope($metric->instrumentationScope); + $scope['metrics'] = []; + } + $scope['metrics'][] = $this->convertMetric($metric); + } + $output = [ + 'resource' => $resource, + 'scope' => $scope, + ]; + echo json_encode($output, JSON_PRETTY_PRINT) . PHP_EOL; + + return true; + } + + public function shutdown(): bool + { + return true; + } + + public function forceFlush(): bool + { + return true; + } + + private function convertMetric(Metric $metric): array + { + return [ + 'name' => $metric->name, + 'description' => $metric->description, + 'unit' => $metric->unit, + 'data' => $metric->data, + ]; + } + + private function convertResource(ResourceInfo $resource): array + { + return [ + 'attributes' => $resource->getAttributes()->toArray(), + 'dropped_attributes_count' => $resource->getAttributes()->getDroppedAttributesCount(), + ]; + } + private function convertInstrumentationScope(InstrumentationScopeInterface $scope): array + { + return [ + 'name' => $scope->getName(), + 'version' => $scope->getVersion(), + 'attributes' => $scope->getAttributes()->toArray(), + 'dropped_attributes_count' => $scope->getAttributes()->getDroppedAttributesCount(), + 'schema_url' => $scope->getSchemaUrl(), + ]; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricExporter/ConsoleMetricExporterFactory.php b/vendor/open-telemetry/sdk/Metrics/MetricExporter/ConsoleMetricExporterFactory.php new file mode 100644 index 000000000..19088738d --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/MetricExporter/ConsoleMetricExporterFactory.php @@ -0,0 +1,16 @@ + + */ + private array $metrics = []; + /** + * @var string|Temporality|null + */ + private $temporality; + + private bool $closed = false; + + /** + * @param string|Temporality|null $temporality + */ + public function __construct($temporality = null) + { + $this->temporality = $temporality; + } + + public function temporality(MetricMetadataInterface $metric) + { + return $this->temporality ?? $metric->temporality(); + } + + /** + * @return list + */ + public function collect(bool $reset = false): array + { + $metrics = $this->metrics; + if ($reset) { + $this->metrics = []; + } + + return $metrics; + } + + public function export(iterable $batch): bool + { + if ($this->closed) { + return false; + } + + /** @psalm-suppress InvalidPropertyAssignmentValue */ + array_push($this->metrics, ...$batch); + + return true; + } + + public function shutdown(): bool + { + if ($this->closed) { + return false; + } + + $this->closed = true; + + return true; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricExporter/InMemoryExporterFactory.php b/vendor/open-telemetry/sdk/Metrics/MetricExporter/InMemoryExporterFactory.php new file mode 100644 index 000000000..c72c7b169 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/MetricExporter/InMemoryExporterFactory.php @@ -0,0 +1,16 @@ + $batch + */ + public function export(iterable $batch): bool; + + public function shutdown(): bool; +} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamFactory.php b/vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamFactory.php new file mode 100644 index 000000000..2c3af4c06 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamFactory.php @@ -0,0 +1,187 @@ +aggregation === null) { + continue; + } + + $dedupId = $this->streamId($view->aggregation, $view->attributeKeys); + if (($streamId = $dedup[$dedupId] ?? null) === null) { + $stream = new AsynchronousMetricStream($view->aggregation, $timestamp); + $streamId = $registry->registerAsynchronousStream($instrument, $stream, new MetricAggregatorFactory( + $this->attributeProcessor($view->attributeKeys), + $view->aggregation, + )); + + $streams[$streamId] = $stream; + $dedup[$dedupId] = $streamId; + } + + $this->registerSource( + $view, + $instrument, + $instrumentationScope, + $resource, + $streams[$streamId], + $registry, + $registration, + $streamId, + ); + } + + return array_keys($streams); + } + + public function createSynchronousWriter( + MetricRegistryInterface $registry, + ResourceInfo $resource, + InstrumentationScopeInterface $instrumentationScope, + Instrument $instrument, + int $timestamp, + iterable $views, + ?ExemplarFilterInterface $exemplarFilter = null + ): array { + $streams = []; + $dedup = []; + foreach ($views as [$view, $registration]) { + if ($view->aggregation === null) { + continue; + } + + $dedupId = $this->streamId($view->aggregation, $view->attributeKeys); + if (($streamId = $dedup[$dedupId] ?? null) === null) { + $stream = new SynchronousMetricStream($view->aggregation, $timestamp); + $streamId = $registry->registerSynchronousStream($instrument, $stream, new MetricAggregator( + $this->attributeProcessor($view->attributeKeys), + $view->aggregation, + $this->createExemplarReservoir($view->aggregation, $exemplarFilter), + )); + + $streams[$streamId] = $stream; + $dedup[$dedupId] = $streamId; + } + + $this->registerSource( + $view, + $instrument, + $instrumentationScope, + $resource, + $streams[$streamId], + $registry, + $registration, + $streamId, + ); + } + + return array_keys($streams); + } + + private function attributeProcessor( + ?array $attributeKeys + ): ?AttributeProcessorInterface { + return $attributeKeys !== null + ? new FilteredAttributeProcessor($attributeKeys) + : null; + } + + private function createExemplarReservoir( + AggregationInterface $aggregation, + ?ExemplarFilterInterface $exemplarFilter + ): ?ExemplarReservoirInterface { + if (!$exemplarFilter) { + return null; + } + + if ($aggregation instanceof ExplicitBucketHistogramAggregation && $aggregation->boundaries) { + $exemplarReservoir = new HistogramBucketReservoir($aggregation->boundaries); + } else { + $exemplarReservoir = new FixedSizeReservoir(); + } + + return new FilteredReservoir($exemplarReservoir, $exemplarFilter); + } + + private function registerSource( + ViewProjection $view, + Instrument $instrument, + InstrumentationScopeInterface $instrumentationScope, + ResourceInfo $resource, + MetricStreamInterface $stream, + MetricCollectorInterface $metricCollector, + MetricRegistrationInterface $metricRegistration, + int $streamId + ): void { + $provider = new StreamMetricSourceProvider( + $view, + $instrument, + $instrumentationScope, + $resource, + $stream, + $metricCollector, + $streamId, + ); + + $metricRegistration->register($provider, $provider); + } + + private function streamId(AggregationInterface $aggregation, ?array $attributeKeys): string + { + return $this->trySerialize($aggregation) . serialize($attributeKeys); + } + + private function trySerialize(object $object) + { + try { + return serialize($object); + } catch (Throwable $e) { + } + + return spl_object_id($object); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamMetricSource.php b/vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamMetricSource.php new file mode 100644 index 000000000..4939a5341 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamMetricSource.php @@ -0,0 +1,44 @@ +provider = $provider; + $this->reader = $reader; + } + + public function collectionTimestamp(): int + { + return $this->provider->stream->timestamp(); + } + + public function collect(): Metric + { + return new Metric( + $this->provider->instrumentationLibrary, + $this->provider->resource, + $this->provider->view->name, + $this->provider->view->unit, + $this->provider->view->description, + $this->provider->stream->collect($this->reader), + ); + } + + public function __destruct() + { + $this->provider->stream->unregister($this->reader); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamMetricSourceProvider.php b/vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamMetricSourceProvider.php new file mode 100644 index 000000000..657c3ce62 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/MetricFactory/StreamMetricSourceProvider.php @@ -0,0 +1,98 @@ +view = $view; + $this->instrument = $instrument; + $this->instrumentationLibrary = $instrumentationLibrary; + $this->resource = $resource; + $this->stream = $stream; + $this->metricCollector = $metricCollector; + $this->streamId = $streamId; + } + + public function create($temporality): MetricSourceInterface + { + return new StreamMetricSource($this, $this->stream->register($temporality)); + } + + public function instrumentType() + { + return $this->instrument->type; + } + + public function name(): string + { + return $this->view->name; + } + + public function unit(): ?string + { + return $this->view->unit; + } + + public function description(): ?string + { + return $this->view->description; + } + + public function temporality() + { + return $this->stream->temporality(); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricFactoryInterface.php b/vendor/open-telemetry/sdk/Metrics/MetricFactoryInterface.php new file mode 100644 index 000000000..a1e228eef --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/MetricFactoryInterface.php @@ -0,0 +1,41 @@ + $views + */ + public function createAsynchronousObserver( + MetricRegistryInterface $registry, + ResourceInfo $resource, + InstrumentationScopeInterface $instrumentationScope, + Instrument $instrument, + int $timestamp, + iterable $views + ): array; + + /** + * @param iterable $views + */ + public function createSynchronousWriter( + MetricRegistryInterface $registry, + ResourceInfo $resource, + InstrumentationScopeInterface $instrumentationScope, + Instrument $instrument, + int $timestamp, + iterable $views, + ?ExemplarFilterInterface $exemplarFilter = null + ): array; +} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricMetadataInterface.php b/vendor/open-telemetry/sdk/Metrics/MetricMetadataInterface.php new file mode 100644 index 000000000..aa1a02d60 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/MetricMetadataInterface.php @@ -0,0 +1,28 @@ + */ + private array $sources = []; + + /** @var array */ + private array $registries = []; + /** @var array> */ + private array $streamIds = []; + + private bool $closed = false; + + public function __construct(MetricExporterInterface $exporter) + { + $this->exporter = $exporter; + } + + public function defaultAggregation($instrumentType): ?AggregationInterface + { + if ($this->exporter instanceof DefaultAggregationProviderInterface) { + return $this->exporter->defaultAggregation($instrumentType); + } + + return $this->_defaultAggregation($instrumentType); + } + + public function add(MetricSourceProviderInterface $provider, MetricMetadataInterface $metadata, StalenessHandlerInterface $stalenessHandler): void + { + if ($this->closed) { + return; + } + if (!$this->exporter instanceof AggregationTemporalitySelectorInterface) { + return; + } + if (!$temporality = $this->exporter->temporality($metadata)) { + return; + } + + $source = $provider->create($temporality); + $sourceId = spl_object_id($source); + + $this->sources[$sourceId] = $source; + $stalenessHandler->onStale(function () use ($sourceId): void { + unset($this->sources[$sourceId]); + }); + + if (!$provider instanceof StreamMetricSourceProvider) { + return; + } + + $streamId = $provider->streamId; + $registry = $provider->metricCollector; + $registryId = spl_object_id($registry); + + $this->registries[$registryId] = $registry; + $this->streamIds[$registryId][$streamId] ??= 0; + $this->streamIds[$registryId][$streamId]++; + + $stalenessHandler->onStale(function () use ($streamId, $registryId): void { + if (!--$this->streamIds[$registryId][$streamId]) { + unset($this->streamIds[$registryId][$streamId]); + if (!$this->streamIds[$registryId]) { + unset( + $this->registries[$registryId], + $this->streamIds[$registryId], + ); + } + } + }); + } + + private function doCollect(): bool + { + foreach ($this->registries as $registryId => $registry) { + $streamIds = $this->streamIds[$registryId] ?? []; + $registry->collectAndPush(array_keys($streamIds)); + } + + $metrics = []; + foreach ($this->sources as $source) { + $metrics[] = $source->collect(); + } + + if ($metrics === []) { + return true; + } + + return $this->exporter->export($metrics); + } + + public function collect(): bool + { + if ($this->closed) { + return false; + } + + return $this->doCollect(); + } + + public function shutdown(): bool + { + if ($this->closed) { + return false; + } + + $this->closed = true; + + $collect = $this->doCollect(); + $shutdown = $this->exporter->shutdown(); + + $this->sources = []; + + return $collect && $shutdown; + } + + public function forceFlush(): bool + { + if ($this->closed) { + return false; + } + if ($this->exporter instanceof PushMetricExporterInterface) { + $collect = $this->doCollect(); + $forceFlush = $this->exporter->forceFlush(); + + return $collect && $forceFlush; + } + + return true; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricReaderInterface.php b/vendor/open-telemetry/sdk/Metrics/MetricReaderInterface.php new file mode 100644 index 000000000..f5900eef5 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/MetricReaderInterface.php @@ -0,0 +1,14 @@ + $registries + */ + public function __construct(iterable $registries, StalenessHandlerInterface $stalenessHandler) + { + $this->registries = $registries; + $this->stalenessHandler = $stalenessHandler; + } + + public function register(MetricSourceProviderInterface $provider, MetricMetadataInterface $metadata): void + { + foreach ($this->registries as $registry) { + $registry->add($provider, $metadata, $this->stalenessHandler); + } + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricRegistration/RegistryRegistration.php b/vendor/open-telemetry/sdk/Metrics/MetricRegistration/RegistryRegistration.php new file mode 100644 index 000000000..3c1108902 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/MetricRegistration/RegistryRegistration.php @@ -0,0 +1,31 @@ +registry = $registry; + $this->stalenessHandler = $stalenessHandler; + } + + public function register(MetricSourceProviderInterface $provider, MetricMetadataInterface $metadata): void + { + $this->registry->add($provider, $metadata, $this->stalenessHandler); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricRegistrationInterface.php b/vendor/open-telemetry/sdk/Metrics/MetricRegistrationInterface.php new file mode 100644 index 000000000..b0cc2484e --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/MetricRegistrationInterface.php @@ -0,0 +1,13 @@ + */ + private array $streams = []; + /** @var array */ + private array $synchronousAggregators = []; + /** @var array */ + private array $asynchronousAggregatorFactories = []; + + /** @var array> */ + private array $instrumentToStreams = []; + /** @var array */ + private array $streamToInstrument = []; + /** @var array> */ + private array $instrumentToCallbacks = []; + /** @var array */ + private array $asynchronousCallbacks = []; + /** @var array> */ + private array $asynchronousCallbackArguments = []; + + public function __construct( + ?ContextStorageInterface $contextStorage, + AttributesFactoryInterface $attributesFactory, + ClockInterface $clock + ) { + $this->contextStorage = $contextStorage; + $this->attributesFactory = $attributesFactory; + $this->clock = $clock; + } + + public function registerSynchronousStream(Instrument $instrument, MetricStreamInterface $stream, MetricAggregatorInterface $aggregator): int + { + $this->streams[] = $stream; + $streamId = array_key_last($this->streams); + $instrumentId = spl_object_id($instrument); + + $this->synchronousAggregators[$streamId] = $aggregator; + $this->instrumentToStreams[$instrumentId][$streamId] = $streamId; + $this->streamToInstrument[$streamId] = $instrumentId; + + return $streamId; + } + + public function registerAsynchronousStream(Instrument $instrument, MetricStreamInterface $stream, MetricAggregatorFactoryInterface $aggregatorFactory): int + { + $this->streams[] = $stream; + $streamId = array_key_last($this->streams); + $instrumentId = spl_object_id($instrument); + + $this->asynchronousAggregatorFactories[$streamId] = $aggregatorFactory; + $this->instrumentToStreams[$instrumentId][$streamId] = $streamId; + $this->streamToInstrument[$streamId] = $instrumentId; + + return $streamId; + } + + public function unregisterStream(int $streamId): void + { + $instrumentId = $this->streamToInstrument[$streamId]; + unset( + $this->streams[$streamId], + $this->synchronousAggregators[$streamId], + $this->asynchronousAggregatorFactories[$streamId], + $this->instrumentToStreams[$instrumentId][$streamId], + $this->streamToInstrument[$streamId], + ); + if (!$this->instrumentToStreams[$instrumentId]) { + unset($this->instrumentToStreams[$instrumentId]); + } + } + + public function record(Instrument $instrument, $value, iterable $attributes = [], $context = null): void + { + $context = Context::resolve($context, $this->contextStorage); + $attributes = $this->attributesFactory->builder($attributes)->build(); + $timestamp = $this->clock->now(); + $instrumentId = spl_object_id($instrument); + foreach ($this->instrumentToStreams[$instrumentId] ?? [] as $streamId) { + if ($aggregator = $this->synchronousAggregators[$streamId] ?? null) { + $aggregator->record($value, $attributes, $context, $timestamp); + } + } + } + + public function registerCallback(Closure $callback, Instrument $instrument, Instrument ...$instruments): int + { + $callbackId = array_key_last($this->asynchronousCallbacks) + 1; + $this->asynchronousCallbacks[$callbackId] = $callback; + + $instrumentId = spl_object_id($instrument); + $this->asynchronousCallbackArguments[$callbackId] = [$instrumentId]; + $this->instrumentToCallbacks[$instrumentId][$callbackId] = $callbackId; + foreach ($instruments as $instrument) { + $instrumentId = spl_object_id($instrument); + $this->asynchronousCallbackArguments[$callbackId][] = $instrumentId; + $this->instrumentToCallbacks[$instrumentId][$callbackId] = $callbackId; + } + + return $callbackId; + } + + public function unregisterCallback(int $callbackId): void + { + $instrumentIds = $this->asynchronousCallbackArguments[$callbackId]; + unset( + $this->asynchronousCallbacks[$callbackId], + $this->asynchronousCallbackArguments[$callbackId], + ); + foreach ($instrumentIds as $instrumentId) { + unset($this->instrumentToCallbacks[$instrumentId][$callbackId]); + if (!$this->instrumentToCallbacks[$instrumentId]) { + unset($this->instrumentToCallbacks[$instrumentId]); + } + } + } + + public function collectAndPush(iterable $streamIds): void + { + $timestamp = $this->clock->now(); + $aggregators = []; + $observers = []; + $callbackIds = []; + foreach ($streamIds as $streamId) { + if (!$aggregator = $this->synchronousAggregators[$streamId] ?? null) { + $aggregator = $this->asynchronousAggregatorFactories[$streamId]->create(); + + $instrumentId = $this->streamToInstrument[$streamId]; + $observers[$instrumentId] ??= new MultiObserver($this->attributesFactory, $timestamp); + $observers[$instrumentId]->writers[] = $aggregator; + foreach ($this->instrumentToCallbacks[$instrumentId] ?? [] as $callbackId) { + $callbackIds[$callbackId] = $callbackId; + } + } + + $aggregators[$streamId] = $aggregator; + } + + $noopObserver = new NoopObserver(); + $callbacks = []; + foreach ($callbackIds as $callbackId) { + $args = []; + foreach ($this->asynchronousCallbackArguments[$callbackId] as $instrumentId) { + $args[] = $observers[$instrumentId] ?? $noopObserver; + } + $callback = $this->asynchronousCallbacks[$callbackId]; + $callbacks[] = static fn () => $callback(...$args); + } + foreach ($callbacks as $callback) { + $callback(); + } + + $timestamp = $this->clock->now(); + foreach ($aggregators as $streamId => $aggregator) { + if ($stream = $this->streams[$streamId] ?? null) { + $stream->push($aggregator->collect($timestamp)); + } + } + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricRegistry/MetricRegistryInterface.php b/vendor/open-telemetry/sdk/Metrics/MetricRegistry/MetricRegistryInterface.php new file mode 100644 index 000000000..e86731138 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/MetricRegistry/MetricRegistryInterface.php @@ -0,0 +1,22 @@ + */ + public array $writers = []; + + public function __construct(AttributesFactoryInterface $attributesFactory, int $timestamp) + { + $this->attributesFactory = $attributesFactory; + $this->timestamp = $timestamp; + } + + public function observe($amount, iterable $attributes = []): void + { + $context = Context::getRoot(); + $attributes = $this->attributesFactory->builder($attributes)->build(); + foreach ($this->writers as $writer) { + $writer->record($amount, $attributes, $context, $this->timestamp); + } + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/MetricRegistry/NoopObserver.php b/vendor/open-telemetry/sdk/Metrics/MetricRegistry/NoopObserver.php new file mode 100644 index 000000000..efbd94dac --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/MetricRegistry/NoopObserver.php @@ -0,0 +1,18 @@ +writer = $writer; + $this->referenceCounter = $referenceCounter; + $this->callbackId = $callbackId; + $this->callbackDestructor = $callbackDestructor; + $this->target = $target; + } + + public function detach(): void + { + if ($this->callbackId === null) { + return; + } + + $this->writer->unregisterCallback($this->callbackId); + $this->referenceCounter->release(); + if ($this->callbackDestructor !== null) { + unset($this->callbackDestructor->callbackIds[$this->callbackId]); + } + + $this->callbackId = null; + } + + public function __destruct() + { + if ($this->callbackDestructor !== null) { + return; + } + if ($this->callbackId === null) { + return; + } + + $this->referenceCounter->acquire(true); + $this->referenceCounter->release(); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/ObservableCallbackDestructor.php b/vendor/open-telemetry/sdk/Metrics/ObservableCallbackDestructor.php new file mode 100644 index 000000000..0dfea3907 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/ObservableCallbackDestructor.php @@ -0,0 +1,32 @@ + */ + public array $callbackIds = []; + private MetricWriterInterface $writer; + private ReferenceCounterInterface $referenceCounter; + + public function __construct(MetricWriterInterface $writer, ReferenceCounterInterface $referenceCounter) + { + $this->writer = $writer; + $this->referenceCounter = $referenceCounter; + } + + public function __destruct() + { + foreach ($this->callbackIds as $callbackId) { + $this->writer->unregisterCallback($callbackId); + $this->referenceCounter->release(); + } + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/ObservableCounter.php b/vendor/open-telemetry/sdk/Metrics/ObservableCounter.php new file mode 100644 index 000000000..99ae43eee --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/ObservableCounter.php @@ -0,0 +1,15 @@ +writer = $writer; + $this->instrument = $instrument; + $this->referenceCounter = $referenceCounter; + $this->destructors = $destructors; + + $this->referenceCounter->acquire(); + } + + public function __destruct() + { + $this->referenceCounter->release(); + } + + /** + * @param callable(ObserverInterface): void $callback + */ + public function observe(callable $callback): ObservableCallbackInterface + { + $callback = weaken(closure($callback), $target); + + $callbackId = $this->writer->registerCallback($callback, $this->instrument); + $this->referenceCounter->acquire(); + + $destructor = null; + if ($target) { + $destructor = $this->destructors[$target] ??= new ObservableCallbackDestructor($this->writer, $this->referenceCounter); + $destructor->callbackIds[$callbackId] = $callbackId; + } + + return new ObservableCallback($this->writer, $this->referenceCounter, $callbackId, $destructor, $target); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/ObservableUpDownCounter.php b/vendor/open-telemetry/sdk/Metrics/ObservableUpDownCounter.php new file mode 100644 index 000000000..8d21be734 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/ObservableUpDownCounter.php @@ -0,0 +1,15 @@ +stale = $stale; + $this->freshen = $freshen; + } + + public function acquire(bool $persistent = false): void + { + if ($this->count === 0) { + ($this->freshen)($this); + } + + $this->count++; + + if ($persistent) { + $this->onStale = null; + } + } + + public function release(): void + { + if (--$this->count || $this->onStale === null) { + return; + } + + ($this->stale)($this); + } + + public function onStale(Closure $callback): void + { + if ($this->onStale === null) { + return; + } + + $this->onStale[] = $callback; + } + + public function triggerStale(): void + { + assert($this->onStale !== null); + + $callbacks = $this->onStale; + $this->onStale = []; + foreach ($callbacks as $callback) { + $callback(); + } + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/StalenessHandler/DelayedStalenessHandlerFactory.php b/vendor/open-telemetry/sdk/Metrics/StalenessHandler/DelayedStalenessHandlerFactory.php new file mode 100644 index 000000000..0d719c74f --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/StalenessHandler/DelayedStalenessHandlerFactory.php @@ -0,0 +1,64 @@ +&Traversable */ + private $staleHandlers; + + /** + * @param float $delay delay in seconds + */ + public function __construct(ClockInterface $clock, float $delay) + { + $this->clock = $clock; + $this->nanoDelay = (int) ($delay * 1e9); + + $this->stale = function (DelayedStalenessHandler $handler): void { + $this->staleHandlers[$handler] = $this->clock->now(); + }; + $this->freshen = function (DelayedStalenessHandler $handler): void { + unset($this->staleHandlers[$handler]); + }; + + $this->staleHandlers = WeakMap::create(); + } + + public function create(): StalenessHandlerInterface + { + $this->triggerStaleHandlers(); + + return new DelayedStalenessHandler($this->stale, $this->freshen); + } + + private function triggerStaleHandlers(): void + { + $expired = $this->clock->now() - $this->nanoDelay; + foreach ($this->staleHandlers as $handler => $timestamp) { + if ($timestamp > $expired) { + break; + } + + /** @var DelayedStalenessHandler $handler */ + unset($this->staleHandlers[$handler]); + $handler->triggerStale(); + } + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/StalenessHandler/ImmediateStalenessHandler.php b/vendor/open-telemetry/sdk/Metrics/StalenessHandler/ImmediateStalenessHandler.php new file mode 100644 index 000000000..a5b32d5c4 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/StalenessHandler/ImmediateStalenessHandler.php @@ -0,0 +1,50 @@ +count++; + + if ($persistent) { + $this->onStale = null; + } + } + + public function release(): void + { + if (--$this->count !== 0 || !$this->onStale) { + return; + } + + $callbacks = $this->onStale; + $this->onStale = []; + foreach ($callbacks as $callback) { + $callback(); + } + } + + public function onStale(Closure $callback): void + { + if ($this->onStale === null) { + return; + } + + $this->onStale[] = $callback; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/StalenessHandler/ImmediateStalenessHandlerFactory.php b/vendor/open-telemetry/sdk/Metrics/StalenessHandler/ImmediateStalenessHandlerFactory.php new file mode 100644 index 000000000..899615dea --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/StalenessHandler/ImmediateStalenessHandlerFactory.php @@ -0,0 +1,16 @@ + */ + private array $lastReads = []; + + public function __construct(AggregationInterface $aggregation, int $startTimestamp) + { + $this->aggregation = $aggregation; + $this->startTimestamp = $startTimestamp; + $this->metric = new Metric([], [], $startTimestamp); + } + + public function temporality() + { + return Temporality::CUMULATIVE; + } + + public function timestamp(): int + { + return $this->metric->timestamp; + } + + public function push(Metric $metric): void + { + $this->metric = $metric; + } + + public function register($temporality): int + { + if ($temporality === Temporality::CUMULATIVE) { + return -1; + } + + if (($reader = array_search(null, $this->lastReads, true)) === false) { + $reader = count($this->lastReads); + } + + $this->lastReads[$reader] = $this->metric; + + return $reader; + } + + public function unregister(int $reader): void + { + if (!isset($this->lastReads[$reader])) { + return; + } + + $this->lastReads[$reader] = null; + } + + public function collect(int $reader): DataInterface + { + $metric = $this->metric; + + if (($lastRead = $this->lastReads[$reader] ?? null) === null) { + $temporality = Temporality::CUMULATIVE; + $startTimestamp = $this->startTimestamp; + } else { + $temporality = Temporality::DELTA; + $startTimestamp = $lastRead->timestamp; + + $this->lastReads[$reader] = $metric; + $metric = $this->diff($lastRead, $metric); + } + + return $this->aggregation->toData( + $metric->attributes, + $metric->summaries, + Exemplar::groupByIndex($metric->exemplars), + $startTimestamp, + $metric->timestamp, + $temporality, + ); + } + + private function diff(Metric $lastRead, Metric $metric): Metric + { + $diff = clone $metric; + foreach ($metric->summaries as $k => $summary) { + if (!isset($lastRead->summaries[$k])) { + continue; + } + + $diff->summaries[$k] = $this->aggregation->diff($lastRead->summaries[$k], $summary); + } + + return $diff; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Stream/Delta.php b/vendor/open-telemetry/sdk/Metrics/Stream/Delta.php new file mode 100644 index 000000000..a4ff56d71 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Stream/Delta.php @@ -0,0 +1,33 @@ +metric = $metric; + $this->readers = $readers; + $this->prev = $prev; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Stream/DeltaStorage.php b/vendor/open-telemetry/sdk/Metrics/Stream/DeltaStorage.php new file mode 100644 index 000000000..b46a28d65 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Stream/DeltaStorage.php @@ -0,0 +1,110 @@ +aggregation = $aggregation; + $this->head = new Delta(new Metric([], [], 0), 0); + + /** @phan-suppress-next-line PhanTypeObjectUnsetDeclaredProperty */ + unset($this->head->metric); + } + + /** + * @psalm-suppress UndefinedDocblockClass + * @phan-suppress PhanUndeclaredTypeParameter + * @param int|GMP $readers + */ + public function add(Metric $metric, $readers): void + { + /** @phpstan-ignore-next-line */ + if ($readers == 0) { + return; + } + + if (($this->head->prev->readers ?? null) != $readers) { + $this->head->prev = new Delta($metric, $readers, $this->head->prev); + } else { + assert($this->head->prev !== null); + $this->mergeInto($this->head->prev->metric, $metric); + } + } + + public function collect(int $reader, bool $retain = false): ?Metric + { + $n = null; + for ($d = $this->head; $d->prev; $d = $d->prev) { + if (($d->prev->readers >> $reader & 1) != 0) { + if ($n !== null) { + assert($n->prev !== null); + $n->prev->readers ^= $d->prev->readers; + $this->mergeInto($d->prev->metric, $n->prev->metric); + $this->tryUnlink($n); + + if ($n->prev === $d->prev) { + continue; + } + } + + $n = $d; + } + } + + $metric = $n->prev->metric ?? null; + + if (!$retain && $n) { + assert($n->prev !== null); + $n->prev->readers ^= ($n->prev->readers & 1 | 1) << $reader; + $this->tryUnlink($n); + } + + return $metric; + } + + private function tryUnlink(Delta $n): void + { + assert($n->prev !== null); + /** @phpstan-ignore-next-line */ + if ($n->prev->readers == 0) { + $n->prev = $n->prev->prev; + + return; + } + + for ($c = $n->prev->prev; + $c && ($n->prev->readers & $c->readers) == 0; + $c = $c->prev) { + } + + if ($c && $n->prev->readers === $c->readers) { + $this->mergeInto($c->metric, $n->prev->metric); + $n->prev = $n->prev->prev; + } + } + + private function mergeInto(Metric $into, Metric $metric): void + { + foreach ($metric->summaries as $k => $summary) { + $into->attributes[$k] ??= $metric->attributes[$k]; + $into->summaries[$k] = isset($into->summaries[$k]) + ? $this->aggregation->merge($into->summaries[$k], $summary) + : $summary; + } + $into->exemplars += $metric->exemplars; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Stream/Metric.php b/vendor/open-telemetry/sdk/Metrics/Stream/Metric.php new file mode 100644 index 000000000..6b1db9eef --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Stream/Metric.php @@ -0,0 +1,44 @@ + + */ + public array $attributes; + /** + * @var array + */ + public array $summaries; + public int $timestamp; + /** + * @var array + */ + public array $exemplars; + + /** + * @param array $attributes + * @param array $summaries + * @param array $exemplars + */ + public function __construct(array $attributes, array $summaries, int $timestamp, array $exemplars = []) + { + $this->attributes = $attributes; + $this->summaries = $summaries; + $this->timestamp = $timestamp; + $this->exemplars = $exemplars; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregator.php b/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregator.php new file mode 100644 index 000000000..b1328eb07 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregator.php @@ -0,0 +1,73 @@ + */ + private array $attributes = []; + private array $summaries = []; + + public function __construct( + ?AttributeProcessorInterface $attributeProcessor, + AggregationInterface $aggregation, + ?ExemplarReservoirInterface $exemplarReservoir = null + ) { + $this->attributeProcessor = $attributeProcessor; + $this->aggregation = $aggregation; + $this->exemplarReservoir = $exemplarReservoir; + } + + /** + * @param float|int $value + */ + public function record($value, AttributesInterface $attributes, ContextInterface $context, int $timestamp): void + { + $filteredAttributes = $this->attributeProcessor !== null + ? $this->attributeProcessor->process($attributes, $context) + : $attributes; + $raw = $filteredAttributes->toArray(); + $index = $raw !== [] ? serialize($raw) : 0; + $this->attributes[$index] ??= $filteredAttributes; + $this->aggregation->record( + $this->summaries[$index] ??= $this->aggregation->initialize(), + $value, + $attributes, + $context, + $timestamp, + ); + + if ($this->exemplarReservoir !== null) { + $this->exemplarReservoir->offer($index, $value, $attributes, $context, $timestamp); + } + } + + public function collect(int $timestamp): Metric + { + $exemplars = $this->exemplarReservoir + ? $this->exemplarReservoir->collect($this->attributes) + : []; + $metric = new Metric($this->attributes, $this->summaries, $timestamp, $exemplars); + + $this->attributes = []; + $this->summaries = []; + + return $metric; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactory.php b/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactory.php new file mode 100644 index 000000000..5866a72b7 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactory.php @@ -0,0 +1,28 @@ +attributeProcessor = $attributeProcessor; + $this->aggregation = $aggregation; + } + + public function create(): MetricAggregatorInterface + { + return new MetricAggregator($this->attributeProcessor, $this->aggregation); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactoryInterface.php b/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactoryInterface.php new file mode 100644 index 000000000..356f682f2 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Stream/MetricAggregatorFactoryInterface.php @@ -0,0 +1,13 @@ +aggregation = $aggregation; + $this->timestamp = $startTimestamp; + $this->delta = new DeltaStorage($aggregation); + } + + public function temporality() + { + return Temporality::DELTA; + } + + public function timestamp(): int + { + return $this->timestamp; + } + + public function push(Metric $metric): void + { + [$this->timestamp, $metric->timestamp] = [$metric->timestamp, $this->timestamp]; + $this->delta->add($metric, $this->readers); + } + + public function register($temporality): int + { + $reader = 0; + for ($r = $this->readers; ($r & 1) != 0; $r >>= 1, $reader++) { + } + + if ($reader === (PHP_INT_SIZE << 3) - 1 && is_int($this->readers)) { + if (!extension_loaded('gmp')) { + trigger_error(sprintf('GMP extension required to register over %d readers', (PHP_INT_SIZE << 3) - 1), E_USER_WARNING); + $reader = PHP_INT_SIZE << 3; + } else { + assert(is_int($this->cumulative)); + $this->readers = gmp_init($this->readers); + $this->cumulative = gmp_init($this->cumulative); + } + } + + $readerMask = ($this->readers & 1 | 1) << $reader; + $this->readers ^= $readerMask; + if ($temporality === Temporality::CUMULATIVE) { + $this->cumulative ^= $readerMask; + } + + return $reader; + } + + public function unregister(int $reader): void + { + $readerMask = ($this->readers & 1 | 1) << $reader; + if (($this->readers & $readerMask) == 0) { + return; + } + + $this->delta->collect($reader); + + $this->readers ^= $readerMask; + if (($this->cumulative & $readerMask) != 0) { + $this->cumulative ^= $readerMask; + } + } + + public function collect(int $reader): DataInterface + { + $cumulative = ($this->cumulative >> $reader & 1) != 0; + $metric = $this->delta->collect($reader, $cumulative) ?? new Metric([], [], $this->timestamp); + + $temporality = $cumulative + ? Temporality::CUMULATIVE + : Temporality::DELTA; + + return $this->aggregation->toData( + $metric->attributes, + $metric->summaries, + Exemplar::groupByIndex($metric->exemplars), + $metric->timestamp, + $this->timestamp, + $temporality, + ); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/Stream/WritableMetricStreamInterface.php b/vendor/open-telemetry/sdk/Metrics/Stream/WritableMetricStreamInterface.php new file mode 100644 index 000000000..9fd425a44 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/Stream/WritableMetricStreamInterface.php @@ -0,0 +1,19 @@ +writer = $writer; + $this->instrument = $instrument; + $this->referenceCounter = $referenceCounter; + + $this->referenceCounter->acquire(); + } + + public function __destruct() + { + $this->referenceCounter->release(); + } + + public function add($amount, iterable $attributes = [], $context = null): void + { + $this->writer->record($this->instrument, $amount, $attributes, $context); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/View/CriteriaViewRegistry.php b/vendor/open-telemetry/sdk/Metrics/View/CriteriaViewRegistry.php new file mode 100644 index 000000000..f387abf9c --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/View/CriteriaViewRegistry.php @@ -0,0 +1,40 @@ + */ + private array $criteria = []; + /** @var list */ + private array $views = []; + + public function register(SelectionCriteriaInterface $criteria, ViewTemplate $view): void + { + $this->criteria[] = $criteria; + $this->views[] = $view; + } + + public function find(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): ?iterable + { + $views = $this->generateViews($instrument, $instrumentationScope); + + return $views->valid() ? $views : null; + } + + private function generateViews(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): Generator + { + foreach ($this->criteria as $i => $criteria) { + if ($criteria->accepts($instrument, $instrumentationScope)) { + yield $this->views[$i]->project($instrument); + } + } + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/AllCriteria.php b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/AllCriteria.php new file mode 100644 index 000000000..438297324 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/AllCriteria.php @@ -0,0 +1,33 @@ + $criteria + */ + public function __construct(iterable $criteria) + { + $this->criteria = $criteria; + } + + public function accepts(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): bool + { + foreach ($this->criteria as $criterion) { + if (!$criterion->accepts($instrument, $instrumentationScope)) { + return false; + } + } + + return true; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentNameCriteria.php b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentNameCriteria.php new file mode 100644 index 000000000..ed6034755 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentNameCriteria.php @@ -0,0 +1,28 @@ +pattern = sprintf('/^%s$/', strtr(preg_quote($name, '/'), ['\\?' => '.', '\\*' => '.*'])); + } + + public function accepts(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): bool + { + return (bool) preg_match($this->pattern, $instrument->name); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentTypeCriteria.php b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentTypeCriteria.php new file mode 100644 index 000000000..46a88def0 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentTypeCriteria.php @@ -0,0 +1,29 @@ +instrumentTypes = (array) $instrumentType; + } + + public function accepts(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): bool + { + return in_array($instrument->type, $this->instrumentTypes, true); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeNameCriteria.php b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeNameCriteria.php new file mode 100644 index 000000000..201d1a7b2 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeNameCriteria.php @@ -0,0 +1,24 @@ +name = $name; + } + + public function accepts(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): bool + { + return $this->name === $instrumentationScope->getName(); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeSchemaUrlCriteria.php b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeSchemaUrlCriteria.php new file mode 100644 index 000000000..a11a1d589 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeSchemaUrlCriteria.php @@ -0,0 +1,24 @@ +schemaUrl = $schemaUrl; + } + + public function accepts(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): bool + { + return $this->schemaUrl === $instrumentationScope->getSchemaUrl(); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeVersionCriteria.php b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeVersionCriteria.php new file mode 100644 index 000000000..37d180f99 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteria/InstrumentationScopeVersionCriteria.php @@ -0,0 +1,24 @@ +version = $version; + } + + public function accepts(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): bool + { + return $this->version === $instrumentationScope->getVersion(); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteriaInterface.php b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteriaInterface.php new file mode 100644 index 000000000..8abd6fa69 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/View/SelectionCriteriaInterface.php @@ -0,0 +1,13 @@ + + */ + private ?array $attributeKeys = null; + private ?AggregationInterface $aggregation = null; + + private function __construct() + { + } + + public static function create(): self + { + static $instance; + + return $instance ??= new self(); + } + + public function withName(string $name): self + { + $self = clone $this; + $self->name = $name; + + return $self; + } + + public function withDescription(string $description): self + { + $self = clone $this; + $self->description = $description; + + return $self; + } + + /** + * @param list $attributeKeys + */ + public function withAttributeKeys(array $attributeKeys): self + { + $self = clone $this; + $self->attributeKeys = $attributeKeys; + + return $self; + } + + public function withAggregation(?AggregationInterface $aggregation): self + { + $self = clone $this; + $self->aggregation = $aggregation; + + return $self; + } + + public function project(Instrument $instrument): ViewProjection + { + return new ViewProjection( + $this->name ?? $instrument->name, + $instrument->unit, + $this->description ?? $instrument->description, + $this->attributeKeys, + $this->aggregation, + ); + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/ViewProjection.php b/vendor/open-telemetry/sdk/Metrics/ViewProjection.php new file mode 100644 index 000000000..046bd6bb1 --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/ViewProjection.php @@ -0,0 +1,47 @@ +|null + */ + public ?array $attributeKeys; + /** + * @readonly + */ + public ?AggregationInterface $aggregation; + + /** + * @param list|null $attributeKeys + */ + public function __construct( + string $name, + ?string $unit, + ?string $description, + ?array $attributeKeys, + ?AggregationInterface $aggregation + ) { + $this->name = $name; + $this->unit = $unit; + $this->description = $description; + $this->attributeKeys = $attributeKeys; + $this->aggregation = $aggregation; + } +} diff --git a/vendor/open-telemetry/sdk/Metrics/ViewRegistryInterface.php b/vendor/open-telemetry/sdk/Metrics/ViewRegistryInterface.php new file mode 100644 index 000000000..19d8f9ffd --- /dev/null +++ b/vendor/open-telemetry/sdk/Metrics/ViewRegistryInterface.php @@ -0,0 +1,15 @@ +|null + */ + public function find(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): ?iterable; +} diff --git a/vendor/open-telemetry/sdk/Propagation/PropagatorFactory.php b/vendor/open-telemetry/sdk/Propagation/PropagatorFactory.php new file mode 100644 index 000000000..2dc349dfb --- /dev/null +++ b/vendor/open-telemetry/sdk/Propagation/PropagatorFactory.php @@ -0,0 +1,55 @@ +buildPropagator($propagators[0]); + default: + return new MultiTextMapPropagator($this->buildPropagators($propagators)); + } + } + + /** + * @return array + */ + private function buildPropagators(array $names): array + { + $propagators = []; + foreach ($names as $name) { + $propagators[] = $this->buildPropagator($name); + } + + return $propagators; + } + + private function buildPropagator(string $name): TextMapPropagatorInterface + { + try { + return Registry::textMapPropagator($name); + } catch (\RuntimeException $e) { + self::logWarning($e->getMessage()); + } + + return NoopTextMapPropagator::getInstance(); + } +} diff --git a/vendor/open-telemetry/sdk/Propagation/_register.php b/vendor/open-telemetry/sdk/Propagation/_register.php new file mode 100644 index 000000000..fd90da184 --- /dev/null +++ b/vendor/open-telemetry/sdk/Propagation/_register.php @@ -0,0 +1,16 @@ +getTracer('example'); +$meter = \OpenTelemetry\API\Globals::meterProvider()->getMeter('example'); +``` + +If autoloading was not successful (or partially successful), no-op implementations of the above may be returned. + +See https://github.com/open-telemetry/opentelemetry-php/blob/main/examples/autoload_sdk.php for a more detailed example. + +## Contributing + +This repository is a read-only git subtree split. +To contribute, please see the main [OpenTelemetry PHP monorepo](https://github.com/open-telemetry/opentelemetry-php). diff --git a/vendor/open-telemetry/sdk/Registry.php b/vendor/open-telemetry/sdk/Registry.php new file mode 100644 index 000000000..2f0a20263 --- /dev/null +++ b/vendor/open-telemetry/sdk/Registry.php @@ -0,0 +1,208 @@ + $factory + */ + public static function registerTransportFactory(string $protocol, $factory, bool $clobber = false): void + { + if (!$clobber && array_key_exists($protocol, self::$transportFactories)) { + return; + } + if (!is_subclass_of($factory, TransportFactoryInterface::class)) { + trigger_error( + sprintf( + 'Cannot register transport factory: %s must exist and implement %s', + is_string($factory) ? $factory : get_class($factory), + TransportFactoryInterface::class + ), + E_USER_WARNING + ); + + return; + } + self::$transportFactories[$protocol] = $factory; + } + + /** + * @param SpanExporterFactoryInterface|class-string $factory + */ + public static function registerSpanExporterFactory(string $exporter, $factory, bool $clobber = false): void + { + if (!$clobber && array_key_exists($exporter, self::$spanExporterFactories)) { + return; + } + if (!is_subclass_of($factory, SpanExporterFactoryInterface::class)) { + trigger_error( + sprintf( + 'Cannot register span exporter factory: %s must exist and implement %s', + is_string($factory) ? $factory : get_class($factory), + SpanExporterFactoryInterface::class + ), + E_USER_WARNING + ); + + return; + } + self::$spanExporterFactories[$exporter] = $factory; + } + + /** + * @param MetricExporterFactoryInterface|class-string $factory + */ + public static function registerMetricExporterFactory(string $exporter, $factory, bool $clobber = false): void + { + if (!$clobber && array_key_exists($exporter, self::$metricExporterFactories)) { + return; + } + if (!is_subclass_of($factory, MetricExporterFactoryInterface::class)) { + trigger_error( + sprintf( + 'Cannot register metric factory: %s must exist and implement %s', + is_string($factory) ? $factory : get_class($factory), + MetricExporterFactoryInterface::class + ), + E_USER_WARNING + ); + + return; + } + self::$metricExporterFactories[$exporter] = $factory; + } + + public static function registerLogRecordExporterFactory(string $exporter, $factory, bool $clobber = false): void + { + if (!$clobber && array_key_exists($exporter, self::$logRecordExporterFactories)) { + return; + } + if (!is_subclass_of($factory, LogRecordExporterFactoryInterface::class)) { + trigger_error( + sprintf( + 'Cannot register LogRecord exporter factory: %s must exist and implement %s', + is_string($factory) ? $factory : get_class($factory), + LogRecordExporterFactoryInterface::class + ), + E_USER_WARNING + ); + + return; + } + self::$logRecordExporterFactories[$exporter] = $factory; + } + + public static function registerTextMapPropagator(string $name, TextMapPropagatorInterface $propagator, bool $clobber = false): void + { + if (!$clobber && array_key_exists($name, self::$textMapPropagators)) { + return; + } + self::$textMapPropagators[$name] = $propagator; + } + + public static function registerResourceDetector(string $name, ResourceDetectorInterface $detector): void + { + self::$resourceDetectors[$name] = $detector; + } + + public static function spanExporterFactory(string $exporter): SpanExporterFactoryInterface + { + if (!array_key_exists($exporter, self::$spanExporterFactories)) { + throw new RuntimeException('Span exporter factory not defined for: ' . $exporter); + } + $class = self::$spanExporterFactories[$exporter]; + $factory = (is_callable($class)) ? $class : new $class(); + assert($factory instanceof SpanExporterFactoryInterface); + + return $factory; + } + + public static function logRecordExporterFactory(string $exporter): LogRecordExporterFactoryInterface + { + if (!array_key_exists($exporter, self::$logRecordExporterFactories)) { + throw new RuntimeException('LogRecord exporter factory not defined for: ' . $exporter); + } + $class = self::$logRecordExporterFactories[$exporter]; + $factory = (is_callable($class)) ? $class : new $class(); + assert($factory instanceof LogRecordExporterFactoryInterface); + + return $factory; + } + + /** + * Get transport factory registered for protocol. If $protocol contains a content-type eg `http/xyz` then + * only the first part, `http`, is used. + */ + 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; + } + + public static function metricExporterFactory(string $exporter): MetricExporterFactoryInterface + { + if (!array_key_exists($exporter, self::$metricExporterFactories)) { + throw new RuntimeException('Metric exporter factory not registered for protocol: ' . $exporter); + } + $class = self::$metricExporterFactories[$exporter]; + $factory = (is_callable($class)) ? $class : new $class(); + assert($factory instanceof MetricExporterFactoryInterface); + + return $factory; + } + + public static function textMapPropagator(string $name): TextMapPropagatorInterface + { + if (!array_key_exists($name, self::$textMapPropagators)) { + throw new RuntimeException('Text map propagator not registered for: ' . $name); + } + + return self::$textMapPropagators[$name]; + } + + public static function resourceDetector(string $name): ResourceDetectorInterface + { + if (!array_key_exists($name, self::$resourceDetectors)) { + throw new RuntimeException('Resource detector not registered for: ' . $name); + } + + return self::$resourceDetectors[$name]; + } + + /** + * @return array + */ + public static function resourceDetectors(): array + { + return array_values(self::$resourceDetectors); + } +} diff --git a/vendor/open-telemetry/sdk/Resource/Detectors/Composer.php b/vendor/open-telemetry/sdk/Resource/Detectors/Composer.php new file mode 100644 index 000000000..56b136ef1 --- /dev/null +++ b/vendor/open-telemetry/sdk/Resource/Detectors/Composer.php @@ -0,0 +1,30 @@ + InstalledVersions::getRootPackage()['name'], + ResourceAttributes::SERVICE_VERSION => InstalledVersions::getRootPackage()['pretty_version'], + ]; + + return ResourceInfo::create(Attributes::create($attributes), ResourceAttributes::SCHEMA_URL); + } +} diff --git a/vendor/open-telemetry/sdk/Resource/Detectors/Composite.php b/vendor/open-telemetry/sdk/Resource/Detectors/Composite.php new file mode 100644 index 000000000..9da267743 --- /dev/null +++ b/vendor/open-telemetry/sdk/Resource/Detectors/Composite.php @@ -0,0 +1,32 @@ + $resourceDetectors + */ + public function __construct(iterable $resourceDetectors) + { + $this->resourceDetectors = $resourceDetectors; + } + + public function getResource(): ResourceInfo + { + $resource = ResourceInfoFactory::emptyResource(); + foreach ($this->resourceDetectors as $resourceDetector) { + $resource = $resource->merge($resourceDetector->getResource()); + } + + return $resource; + } +} diff --git a/vendor/open-telemetry/sdk/Resource/Detectors/Constant.php b/vendor/open-telemetry/sdk/Resource/Detectors/Constant.php new file mode 100644 index 000000000..7ff9d19eb --- /dev/null +++ b/vendor/open-telemetry/sdk/Resource/Detectors/Constant.php @@ -0,0 +1,23 @@ +resourceInfo = $resourceInfo; + } + + public function getResource(): ResourceInfo + { + return $this->resourceInfo; + } +} diff --git a/vendor/open-telemetry/sdk/Resource/Detectors/Environment.php b/vendor/open-telemetry/sdk/Resource/Detectors/Environment.php new file mode 100644 index 000000000..ceee8fcf7 --- /dev/null +++ b/vendor/open-telemetry/sdk/Resource/Detectors/Environment.php @@ -0,0 +1,40 @@ + php_uname('n'), + ResourceAttributes::HOST_ARCH => php_uname('m'), + ]; + + return ResourceInfo::create(Attributes::create($attributes), ResourceAttributes::SCHEMA_URL); + } +} diff --git a/vendor/open-telemetry/sdk/Resource/Detectors/OperatingSystem.php b/vendor/open-telemetry/sdk/Resource/Detectors/OperatingSystem.php new file mode 100644 index 000000000..2cb350dc2 --- /dev/null +++ b/vendor/open-telemetry/sdk/Resource/Detectors/OperatingSystem.php @@ -0,0 +1,32 @@ + strtolower(PHP_OS_FAMILY), + ResourceAttributes::OS_DESCRIPTION => php_uname('r'), + ResourceAttributes::OS_NAME => PHP_OS, + ResourceAttributes::OS_VERSION => php_uname('v'), + ]; + + return ResourceInfo::create(Attributes::create($attributes), ResourceAttributes::SCHEMA_URL); + } +} diff --git a/vendor/open-telemetry/sdk/Resource/Detectors/Process.php b/vendor/open-telemetry/sdk/Resource/Detectors/Process.php new file mode 100644 index 000000000..7f1d99386 --- /dev/null +++ b/vendor/open-telemetry/sdk/Resource/Detectors/Process.php @@ -0,0 +1,43 @@ + php_sapi_name(), + ResourceAttributes::PROCESS_RUNTIME_VERSION => PHP_VERSION, + ]; + + return ResourceInfo::create(Attributes::create($attributes), ResourceAttributes::SCHEMA_URL); + } +} diff --git a/vendor/open-telemetry/sdk/Resource/Detectors/Sdk.php b/vendor/open-telemetry/sdk/Resource/Detectors/Sdk.php new file mode 100644 index 000000000..dba3eb8aa --- /dev/null +++ b/vendor/open-telemetry/sdk/Resource/Detectors/Sdk.php @@ -0,0 +1,53 @@ + 'opentelemetry', + ResourceAttributes::TELEMETRY_SDK_LANGUAGE => 'php', + ]; + + if (class_exists(InstalledVersions::class)) { + foreach (self::PACKAGES as $package) { + if (!InstalledVersions::isInstalled($package)) { + continue; + } + if (($version = InstalledVersions::getPrettyVersion($package)) === null) { + continue; + } + + $attributes[ResourceAttributes::TELEMETRY_SDK_VERSION] = $version; + + break; + } + } + + if (extension_loaded('opentelemetry')) { + $attributes[ResourceAttributes::TELEMETRY_DISTRO_NAME] = 'opentelemetry-php-instrumentation'; + $attributes[ResourceAttributes::TELEMETRY_DISTRO_VERSION] = phpversion('opentelemetry'); + } + + return ResourceInfo::create(Attributes::create($attributes), ResourceAttributes::SCHEMA_URL); + } +} diff --git a/vendor/open-telemetry/sdk/Resource/Detectors/SdkProvided.php b/vendor/open-telemetry/sdk/Resource/Detectors/SdkProvided.php new file mode 100644 index 000000000..ec4ec7def --- /dev/null +++ b/vendor/open-telemetry/sdk/Resource/Detectors/SdkProvided.php @@ -0,0 +1,25 @@ + 'unknown_service:php', + ]; + + return ResourceInfo::create(Attributes::create($attributes), ResourceAttributes::SCHEMA_URL); + } +} diff --git a/vendor/open-telemetry/sdk/Resource/ResourceDetectorInterface.php b/vendor/open-telemetry/sdk/Resource/ResourceDetectorInterface.php new file mode 100644 index 000000000..f2cd5256b --- /dev/null +++ b/vendor/open-telemetry/sdk/Resource/ResourceDetectorInterface.php @@ -0,0 +1,10 @@ +attributes = $attributes; + $this->schemaUrl = $schemaUrl; + } + + public static function create(AttributesInterface $attributes, ?string $schemaUrl = null): self + { + return new ResourceInfo($attributes, $schemaUrl); + } + + public function getAttributes(): AttributesInterface + { + return $this->attributes; + } + + public function getSchemaUrl(): ?string + { + return $this->schemaUrl; + } + + public function serialize(): string + { + $copyOfAttributesAsArray = array_slice($this->attributes->toArray(), 0); //This may be overly cautious (in trying to avoid mutating the source array) + ksort($copyOfAttributesAsArray); //sort the associative array by keys since the serializer will consider equal arrays different otherwise + + //The exact return value doesn't matter, as long as it can distingusih between instances that represent the same/different resources + return serialize([ + 'schemaUrl' => $this->schemaUrl, + 'attributes' => $copyOfAttributesAsArray, + ]); + } + + /** + * Merge current resource with an updating resource, combining all attributes. If a key exists on both the old and updating + * resource, the value of the updating resource MUST be picked (even if the updated value is empty) + * + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/resource/sdk.md#merge + */ + public function merge(ResourceInfo $updating): ResourceInfo + { + $schemaUrl = self::mergeSchemaUrl($this->getSchemaUrl(), $updating->getSchemaUrl()); + $attributes = $updating->getAttributes()->toArray() + $this->getAttributes()->toArray(); + + return ResourceInfo::create(Attributes::create($attributes), $schemaUrl); + } + + /** + * Merge the schema URLs from the old and updating resource. + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/resource/sdk.md#merge + */ + private static function mergeSchemaUrl(?string $old, ?string $updating): ?string + { + if (empty($old)) { + return $updating; + } + if (empty($updating)) { + return $old; + } + if ($old === $updating) { + return $old; + } + + self::logWarning('Merging resources with different schema URLs', [ + 'old' => $old, + 'updating' => $updating, + ]); + + return null; + } + + /** + * @codeCoverageIgnore + */ + public static function defaultResource(): ResourceInfo + { + BcUtil::triggerMethodDeprecationNotice( + __METHOD__, + 'defaultResource', + ResourceInfoFactory::class + ); + + return ResourceInfoFactory::defaultResource(); + } + + /** + * @codeCoverageIgnore + */ + public static function emptyResource(): ResourceInfo + { + BcUtil::triggerMethodDeprecationNotice( + __METHOD__, + 'emptyResource', + ResourceInfoFactory::class + ); + + return ResourceInfoFactory::emptyResource(); + } +} diff --git a/vendor/open-telemetry/sdk/Resource/ResourceInfoFactory.php b/vendor/open-telemetry/sdk/Resource/ResourceInfoFactory.php new file mode 100644 index 000000000..7fc80bcd9 --- /dev/null +++ b/vendor/open-telemetry/sdk/Resource/ResourceInfoFactory.php @@ -0,0 +1,95 @@ +getResource(); + } + + $resourceDetectors = []; + + foreach ($detectors as $detector) { + switch ($detector) { + case Values::VALUE_DETECTORS_ENVIRONMENT: + $resourceDetectors[] = new Detectors\Environment(); + + break; + case Values::VALUE_DETECTORS_HOST: + $resourceDetectors[] = new Detectors\Host(); + + break; + case Values::VALUE_DETECTORS_OS: + $resourceDetectors[] = new Detectors\OperatingSystem(); + + break; + case Values::VALUE_DETECTORS_PROCESS: + $resourceDetectors[] = new Detectors\Process(); + + break; + case Values::VALUE_DETECTORS_PROCESS_RUNTIME: + $resourceDetectors[] = new Detectors\ProcessRuntime(); + + break; + case Values::VALUE_DETECTORS_SDK: + $resourceDetectors[] = new Detectors\Sdk(); + + break; + case Values::VALUE_DETECTORS_SDK_PROVIDED: + $resourceDetectors[] = new Detectors\SdkProvided(); + + break; + + case Values::VALUE_DETECTORS_COMPOSER: + $resourceDetectors[] = new Detectors\Composer(); + + break; + case Values::VALUE_NONE: + + break; + default: + try { + $resourceDetectors[] = Registry::resourceDetector($detector); + } catch (RuntimeException $e) { + self::logWarning($e->getMessage()); + } + } + } + + return (new Detectors\Composite($resourceDetectors))->getResource(); + } + + public static function emptyResource(): ResourceInfo + { + return ResourceInfo::create(Attributes::create([])); + } +} diff --git a/vendor/open-telemetry/sdk/Sdk.php b/vendor/open-telemetry/sdk/Sdk.php new file mode 100644 index 000000000..3b63eb93a --- /dev/null +++ b/vendor/open-telemetry/sdk/Sdk.php @@ -0,0 +1,70 @@ +tracerProvider = $tracerProvider; + $this->meterProvider = $meterProvider; + $this->loggerProvider = $loggerProvider; + $this->propagator = $propagator; + } + + public static function isDisabled(): bool + { + return Configuration::getBoolean(Variables::OTEL_SDK_DISABLED); + } + + /** + * Tests whether an auto-instrumentation package has been disabled by config + */ + public static function isInstrumentationDisabled(string $name): bool + { + return in_array($name, Configuration::getList(Variables::OTEL_PHP_DISABLED_INSTRUMENTATIONS)); + } + + public static function builder(): SdkBuilder + { + return new SdkBuilder(); + } + + public function getTracerProvider(): TracerProviderInterface + { + return $this->tracerProvider; + } + + public function getMeterProvider(): MeterProviderInterface + { + return $this->meterProvider; + } + + public function getLoggerProvider(): LoggerProviderInterface + { + return $this->loggerProvider; + } + + public function getPropagator(): TextMapPropagatorInterface + { + return $this->propagator; + } +} diff --git a/vendor/open-telemetry/sdk/SdkAutoloader.php b/vendor/open-telemetry/sdk/SdkAutoloader.php new file mode 100644 index 000000000..c08195e19 --- /dev/null +++ b/vendor/open-telemetry/sdk/SdkAutoloader.php @@ -0,0 +1,76 @@ +create(); + if (Sdk::isDisabled()) { + //@see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration + return $configurator->withPropagator($propagator); + } + $emitMetrics = Configuration::getBoolean(Variables::OTEL_PHP_INTERNAL_METRICS_ENABLED); + + $exporter = (new ExporterFactory())->create(); + $meterProvider = (new MeterProviderFactory())->create(); + $spanProcessor = (new SpanProcessorFactory())->create($exporter, $emitMetrics ? $meterProvider : null); + $tracerProvider = (new TracerProviderBuilder()) + ->addSpanProcessor($spanProcessor) + ->setSampler((new SamplerFactory())->create()) + ->build(); + + $loggerProvider = (new LoggerProviderFactory())->create($emitMetrics ? $meterProvider : null); + + ShutdownHandler::register([$tracerProvider, 'shutdown']); + ShutdownHandler::register([$meterProvider, 'shutdown']); + ShutdownHandler::register([$loggerProvider, 'shutdown']); + + return $configurator + ->withTracerProvider($tracerProvider) + ->withMeterProvider($meterProvider) + ->withLoggerProvider($loggerProvider) + ->withPropagator($propagator) + ; + }); + + return true; + } + + /** + * @internal + */ + public static function reset(): void + { + self::$enabled = null; + } +} diff --git a/vendor/open-telemetry/sdk/SdkBuilder.php b/vendor/open-telemetry/sdk/SdkBuilder.php new file mode 100644 index 000000000..2090c4731 --- /dev/null +++ b/vendor/open-telemetry/sdk/SdkBuilder.php @@ -0,0 +1,98 @@ +autoShutdown = $shutdown; + + return $this; + } + + public function setTracerProvider(TracerProviderInterface $provider): self + { + $this->tracerProvider = $provider; + + return $this; + } + + public function setMeterProvider(MeterProviderInterface $meterProvider): self + { + $this->meterProvider = $meterProvider; + + return $this; + } + + public function setLoggerProvider(LoggerProviderInterface $loggerProvider): self + { + $this->loggerProvider = $loggerProvider; + + return $this; + } + + public function setPropagator(TextMapPropagatorInterface $propagator): self + { + $this->propagator = $propagator; + + return $this; + } + + public function build(): Sdk + { + $tracerProvider = $this->tracerProvider ?? new NoopTracerProvider(); + $meterProvider = $this->meterProvider ?? new NoopMeterProvider(); + $loggerProvider = $this->loggerProvider ?? new NoopLoggerProvider(); + if ($this->autoShutdown) { + // rector rule disabled in config, because ShutdownHandler::register() does not keep a strong reference to $this + ShutdownHandler::register([$tracerProvider, 'shutdown']); + ShutdownHandler::register([$meterProvider, 'shutdown']); + ShutdownHandler::register([$loggerProvider, 'shutdown']); + } + + return new Sdk( + $tracerProvider, + $meterProvider, + $loggerProvider, + $this->propagator ?? NoopTextMapPropagator::getInstance(), + ); + } + + public function buildAndRegisterGlobal(): ScopeInterface + { + $sdk = $this->build(); + $context = Configurator::create() + ->withPropagator($sdk->getPropagator()) + ->withTracerProvider($sdk->getTracerProvider()) + ->withMeterProvider($sdk->getMeterProvider()) + ->withLoggerProvider($sdk->getLoggerProvider()) + ->storeInContext(); + + return Context::storage()->attach($context); + } +} diff --git a/vendor/open-telemetry/sdk/Trace/Behavior/LoggerAwareTrait.php b/vendor/open-telemetry/sdk/Trace/Behavior/LoggerAwareTrait.php new file mode 100644 index 000000000..24f5e56a8 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/Behavior/LoggerAwareTrait.php @@ -0,0 +1,48 @@ +defaultLogLevel = $logLevel; + } + + /** + * @param string $message + * @param array $context + * @param string|null $level + */ + protected function log(string $message, array $context = [], ?string $level = null): void + { + $this->getLogger()->log( + $level ?? $this->defaultLogLevel, + $message, + $context + ); + } + + protected function getLogger(): LoggerInterface + { + if ($this->logger !== null) { + return $this->logger; + } + + return new NullLogger(); + } +} diff --git a/vendor/open-telemetry/sdk/Trace/Behavior/SpanExporterDecoratorTrait.php b/vendor/open-telemetry/sdk/Trace/Behavior/SpanExporterDecoratorTrait.php new file mode 100644 index 000000000..97839ec5b --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/Behavior/SpanExporterDecoratorTrait.php @@ -0,0 +1,47 @@ + $batch + * @return FutureInterface + */ + public function export(iterable $batch, ?CancellationInterface $cancellation = null): FutureInterface + { + $batch = $this->beforeExport($batch); + $response = $this->decorated->export($batch, $cancellation); + $response->map(fn (bool $result) => $this->afterExport($batch, $result)); + + return $response; + } + + abstract protected function beforeExport(iterable $spans): iterable; + + abstract protected function afterExport(iterable $spans, bool $exportSuccess): void; + + public function shutdown(?CancellationInterface $cancellation = null): bool + { + return $this->decorated->shutdown($cancellation); + } + + public function forceFlush(?CancellationInterface $cancellation = null): bool + { + return $this->decorated->forceFlush($cancellation); + } + + public function setDecorated(SpanExporterInterface $decorated): void + { + $this->decorated = $decorated; + } +} diff --git a/vendor/open-telemetry/sdk/Trace/Behavior/SpanExporterTrait.php b/vendor/open-telemetry/sdk/Trace/Behavior/SpanExporterTrait.php new file mode 100644 index 000000000..339fecc1d --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/Behavior/SpanExporterTrait.php @@ -0,0 +1,47 @@ +running = false; + + return true; + } + + /** @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/specification/trace/sdk.md#forceflush-2 */ + public function forceFlush(?CancellationInterface $cancellation = null): bool + { + return true; + } + + /** + * @param iterable $batch + * @return FutureInterface + */ + public function export(iterable $batch, ?CancellationInterface $cancellation = null): FutureInterface + { + if (!$this->running) { + return new CompletedFuture(false); + } + + return new CompletedFuture($this->doExport($batch)); /** @phpstan-ignore-line */ + } + + /** + * @param iterable $spans Batch of spans to export + */ + abstract protected function doExport(iterable $spans): bool; /** @phpstan-ignore-line */ +} diff --git a/vendor/open-telemetry/sdk/Trace/Behavior/UsesSpanConverterTrait.php b/vendor/open-telemetry/sdk/Trace/Behavior/UsesSpanConverterTrait.php new file mode 100644 index 000000000..4802cd15b --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/Behavior/UsesSpanConverterTrait.php @@ -0,0 +1,41 @@ +converter = $converter; + } + + public function getSpanConverter(): SpanConverterInterface + { + if (null === $this->converter) { + $this->converter = new NullSpanConverter(); + } + + return $this->converter; + } + + /** + * @param SpanDataInterface $span + * @return array + * @psalm-suppress PossiblyNullReference + */ + protected function convertSpan(SpanDataInterface $span): array + { + return $this->getSpanConverter()->convert([$span]); + } +} diff --git a/vendor/open-telemetry/sdk/Trace/Event.php b/vendor/open-telemetry/sdk/Trace/Event.php new file mode 100644 index 000000000..28cb39bb1 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/Event.php @@ -0,0 +1,47 @@ +name = $name; + $this->timestamp = $timestamp; + $this->attributes = $attributes; + } + + public function getAttributes(): AttributesInterface + { + return $this->attributes; + } + + public function getName(): string + { + return $this->name; + } + + public function getEpochNanos(): int + { + return $this->timestamp; + } + + public function getTotalAttributeCount(): int + { + return count($this->attributes); + } + + public function getDroppedAttributesCount(): int + { + return $this->attributes->getDroppedAttributesCount(); + } +} diff --git a/vendor/open-telemetry/sdk/Trace/EventInterface.php b/vendor/open-telemetry/sdk/Trace/EventInterface.php new file mode 100644 index 000000000..8b5ee2af6 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/EventInterface.php @@ -0,0 +1,15 @@ +create(); + } +} diff --git a/vendor/open-telemetry/sdk/Trace/IdGeneratorInterface.php b/vendor/open-telemetry/sdk/Trace/IdGeneratorInterface.php new file mode 100644 index 000000000..ad622dccc --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/IdGeneratorInterface.php @@ -0,0 +1,12 @@ + */ + private array $events; + + /** @var list */ + private array $links; + + private AttributesInterface $attributes; + private int $totalRecordedEvents; + private StatusDataInterface $status; + private int $endEpochNanos; + private bool $hasEnded; + + /** + * @param non-empty-string $name + * @param list $links + * @param list $events + */ + public function __construct( + Span $span, + string $name, + array $links, + array $events, + AttributesInterface $attributes, + int $totalRecordedEvents, + StatusDataInterface $status, + int $endEpochNanos, + bool $hasEnded + ) { + $this->span = $span; + $this->name = $name; + $this->links = $links; + $this->events = $events; + $this->attributes = $attributes; + $this->totalRecordedEvents = $totalRecordedEvents; + $this->status = $status; + $this->endEpochNanos = $endEpochNanos; + $this->hasEnded = $hasEnded; + } + + public function getKind(): int + { + return $this->span->getKind(); + } + + public function getContext(): API\SpanContextInterface + { + return $this->span->getContext(); + } + + public function getParentContext(): API\SpanContextInterface + { + return $this->span->getParentContext(); + } + + public function getTraceId(): string + { + return $this->getContext()->getTraceId(); + } + + public function getSpanId(): string + { + return $this->getContext()->getSpanId(); + } + + public function getParentSpanId(): string + { + return $this->getParentContext()->getSpanId(); + } + + public function getStartEpochNanos(): int + { + return $this->span->getStartEpochNanos(); + } + + public function getEndEpochNanos(): int + { + return $this->endEpochNanos; + } + + public function getInstrumentationScope(): InstrumentationScopeInterface + { + return $this->span->getInstrumentationScope(); + } + + public function getResource(): ResourceInfo + { + return $this->span->getResource(); + } + + public function getName(): string + { + return $this->name; + } + + /** @inheritDoc */ + public function getLinks(): array + { + return $this->links; + } + + /** @inheritDoc */ + public function getEvents(): array + { + return $this->events; + } + + public function getAttributes(): AttributesInterface + { + return $this->attributes; + } + + public function getTotalDroppedEvents(): int + { + return max(0, $this->totalRecordedEvents - count($this->events)); + } + + public function getTotalDroppedLinks(): int + { + return max(0, $this->span->getTotalRecordedLinks() - count($this->links)); + } + + public function getStatus(): StatusDataInterface + { + return $this->status; + } + + public function hasEnded(): bool + { + return $this->hasEnded; + } +} diff --git a/vendor/open-telemetry/sdk/Trace/Link.php b/vendor/open-telemetry/sdk/Trace/Link.php new file mode 100644 index 000000000..9927839e7 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/Link.php @@ -0,0 +1,30 @@ +context = $context; + $this->attributes = $attributes; + } + + public function getSpanContext(): API\SpanContextInterface + { + return $this->context; + } + + public function getAttributes(): AttributesInterface + { + return $this->attributes; + } +} diff --git a/vendor/open-telemetry/sdk/Trace/LinkInterface.php b/vendor/open-telemetry/sdk/Trace/LinkInterface.php new file mode 100644 index 000000000..8090fa1a5 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/LinkInterface.php @@ -0,0 +1,14 @@ +randomHex(self::TRACE_ID_HEX_LENGTH); + } while (!SpanContextValidator::isValidTraceId($traceId)); + + return $traceId; + } + + public function generateSpanId(): string + { + do { + $spanId = $this->randomHex(self::SPAN_ID_HEX_LENGTH); + } while (!SpanContextValidator::isValidSpanId($spanId)); + + return $spanId; + } + + /** + * @psalm-suppress ArgumentTypeCoercion $hexLength is always a positive integer + */ + private function randomHex(int $hexLength): string + { + try { + return bin2hex(random_bytes(intdiv($hexLength, 2))); + } catch (Throwable $e) { + return $this->fallbackAlgorithm($hexLength); + } + } + + private function fallbackAlgorithm(int $hexLength): string + { + return substr(str_shuffle(str_repeat('0123456789abcdef', $hexLength)), 1, $hexLength); + } +} diff --git a/vendor/open-telemetry/sdk/Trace/ReadWriteSpanInterface.php b/vendor/open-telemetry/sdk/Trace/ReadWriteSpanInterface.php new file mode 100644 index 000000000..60940ac01 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/ReadWriteSpanInterface.php @@ -0,0 +1,11 @@ +getContext(); + $traceState = $parentSpanContext->getTraceState(); + + return new SamplingResult( + SamplingResult::DROP, + [], + $traceState + ); + } + + public function getDescription(): string + { + return 'AlwaysOffSampler'; + } +} diff --git a/vendor/open-telemetry/sdk/Trace/Sampler/AlwaysOnSampler.php b/vendor/open-telemetry/sdk/Trace/Sampler/AlwaysOnSampler.php new file mode 100644 index 000000000..df61d1aee --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/Sampler/AlwaysOnSampler.php @@ -0,0 +1,50 @@ +getContext(); + $traceState = $parentSpanContext->getTraceState(); + + return new SamplingResult( + SamplingResult::RECORD_AND_SAMPLE, + [], + $traceState + ); + } + + public function getDescription(): string + { + return 'AlwaysOnSampler'; + } +} diff --git a/vendor/open-telemetry/sdk/Trace/Sampler/ParentBased.php b/vendor/open-telemetry/sdk/Trace/Sampler/ParentBased.php new file mode 100644 index 000000000..db801d3d8 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/Sampler/ParentBased.php @@ -0,0 +1,100 @@ +root = $root; + $this->remoteParentSampler = $remoteParentSampler ?? new AlwaysOnSampler(); + $this->remoteParentNotSampler = $remoteParentNotSampler ?? new AlwaysOffSampler(); + $this->localParentSampler = $localParentSampler ?? new AlwaysOnSampler(); + $this->localParentNotSampler = $localParentNotSampler ?? new AlwaysOffSampler(); + } + + /** + * Invokes the respective delegate sampler when parent is set or uses root sampler for the root span. + * {@inheritdoc} + */ + public function shouldSample( + ContextInterface $parentContext, + string $traceId, + string $spanName, + int $spanKind, + AttributesInterface $attributes, + array $links + ): SamplingResult { + $parentSpan = Span::fromContext($parentContext); + $parentSpanContext = $parentSpan->getContext(); + + // Invalid parent SpanContext indicates root span is being created + if (!$parentSpanContext->isValid()) { + return $this->root->shouldSample(...func_get_args()); + } + + if ($parentSpanContext->isRemote()) { + return $parentSpanContext->isSampled() + ? $this->remoteParentSampler->shouldSample(...func_get_args()) + : $this->remoteParentNotSampler->shouldSample(...func_get_args()); + } + + return $parentSpanContext->isSampled() + ? $this->localParentSampler->shouldSample(...func_get_args()) + : $this->localParentNotSampler->shouldSample(...func_get_args()); + } + + public function getDescription(): string + { + return 'ParentBased+' . $this->root->getDescription(); + } +} diff --git a/vendor/open-telemetry/sdk/Trace/Sampler/TraceIdRatioBasedSampler.php b/vendor/open-telemetry/sdk/Trace/Sampler/TraceIdRatioBasedSampler.php new file mode 100644 index 000000000..c11a90d5d --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/Sampler/TraceIdRatioBasedSampler.php @@ -0,0 +1,70 @@ + 1.0) { + throw new InvalidArgumentException('probability should be be between 0.0 and 1.0.'); + } + $this->probability = $probability; + } + + /** + * Returns `SamplingResult` based on probability. Respects the parent `SampleFlag` + * {@inheritdoc} + */ + public function shouldSample( + ContextInterface $parentContext, + string $traceId, + string $spanName, + int $spanKind, + AttributesInterface $attributes, + array $links + ): SamplingResult { + // TODO: Add config to adjust which spans get sampled (only default from specification is implemented) + $parentSpan = Span::fromContext($parentContext); + $parentSpanContext = $parentSpan->getContext(); + $traceState = $parentSpanContext->getTraceState(); + + /** + * Since php can only store up to 63 bit positive integers + */ + $traceIdLimit = (1 << 60) - 1; + $lowerOrderBytes = hexdec(substr($traceId, strlen($traceId) - 15, 15)); + $traceIdCondition = $lowerOrderBytes < round($this->probability * $traceIdLimit); + $decision = $traceIdCondition ? SamplingResult::RECORD_AND_SAMPLE : SamplingResult::DROP; + + return new SamplingResult($decision, [], $traceState); + } + + public function getDescription(): string + { + return sprintf('%s{%.6F}', 'TraceIdRatioBasedSampler', $this->probability); + } +} diff --git a/vendor/open-telemetry/sdk/Trace/SamplerFactory.php b/vendor/open-telemetry/sdk/Trace/SamplerFactory.php new file mode 100644 index 000000000..f99674d79 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SamplerFactory.php @@ -0,0 +1,48 @@ + $links Collection of links that will be associated with the Span to be created. + * Typically, useful for batch operations. + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/overview.md#links-between-spans + * @return SamplingResult + */ + public function shouldSample( + ContextInterface $parentContext, + string $traceId, + string $spanName, + int $spanKind, + AttributesInterface $attributes, + array $links + ): SamplingResult; + + /** + * Returns the sampler name or short description with the configuration. + * This may be displayed on debug pages or in the logs. + * Example: "TraceIdRatioBasedSampler{0.000100}" + */ + public function getDescription(): string; +} diff --git a/vendor/open-telemetry/sdk/Trace/SamplingResult.php b/vendor/open-telemetry/sdk/Trace/SamplingResult.php new file mode 100644 index 000000000..5701b7bc6 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SamplingResult.php @@ -0,0 +1,71 @@ +decision = $decision; + $this->attributes = $attributes; + $this->traceState = $traceState; + } + + /** + * Return sampling decision whether span should be recorded or not. + */ + public function getDecision(): int + { + return $this->decision; + } + + /** + * Return attributes which will be attached to the span. + */ + public function getAttributes(): iterable + { + return $this->attributes; + } + + /** + * Return a collection of links that will be associated with the Span to be created. + */ + public function getTraceState(): ?API\TraceStateInterface + { + return $this->traceState; + } +} diff --git a/vendor/open-telemetry/sdk/Trace/Span.php b/vendor/open-telemetry/sdk/Trace/Span.php new file mode 100644 index 000000000..f72ec1bd7 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/Span.php @@ -0,0 +1,359 @@ + + */ + private array $links; + + /** @readonly */ + private int $totalRecordedLinks; + + /** @readonly */ + private int $kind; + + /** @readonly */ + private ResourceInfo $resource; + + /** @readonly */ + private InstrumentationScopeInterface $instrumentationScope; + + /** @readonly */ + private int $startEpochNanos; + + /** @var non-empty-string */ + private string $name; + + /** @var list */ + private array $events = []; + + private AttributesBuilderInterface $attributesBuilder; + private int $totalRecordedEvents = 0; + private StatusDataInterface $status; + private int $endEpochNanos = 0; + private bool $hasEnded = false; + + /** + * @param non-empty-string $name + * @param list $links + */ + private function __construct( + string $name, + API\SpanContextInterface $context, + InstrumentationScopeInterface $instrumentationScope, + int $kind, + API\SpanContextInterface $parentSpanContext, + SpanLimits $spanLimits, + SpanProcessorInterface $spanProcessor, + ResourceInfo $resource, + AttributesBuilderInterface $attributesBuilder, + array $links, + int $totalRecordedLinks, + int $startEpochNanos + ) { + $this->context = $context; + $this->instrumentationScope = $instrumentationScope; + $this->parentSpanContext = $parentSpanContext; + $this->links = $links; + $this->totalRecordedLinks = $totalRecordedLinks; + $this->name = $name; + $this->kind = $kind; + $this->spanProcessor = $spanProcessor; + $this->resource = $resource; + $this->startEpochNanos = $startEpochNanos; + $this->attributesBuilder = $attributesBuilder; + $this->status = StatusData::unset(); + $this->spanLimits = $spanLimits; + } + + /** + * This method _MUST_ not be used directly. + * End users should use a {@see API\TracerInterface} in order to create spans. + * + * @param non-empty-string $name + * @psalm-param API\SpanKind::KIND_* $kind + * @param list $links + * + * @internal + * @psalm-internal OpenTelemetry + */ + public static function startSpan( + string $name, + API\SpanContextInterface $context, + InstrumentationScopeInterface $instrumentationScope, + int $kind, + API\SpanInterface $parentSpan, + ContextInterface $parentContext, + SpanLimits $spanLimits, + SpanProcessorInterface $spanProcessor, + ResourceInfo $resource, + AttributesBuilderInterface $attributesBuilder, + array $links, + int $totalRecordedLinks, + int $startEpochNanos + ): self { + $span = new self( + $name, + $context, + $instrumentationScope, + $kind, + $parentSpan->getContext(), + $spanLimits, + $spanProcessor, + $resource, + $attributesBuilder, + $links, + $totalRecordedLinks, + $startEpochNanos !== 0 ? $startEpochNanos : ClockFactory::getDefault()->now() + ); + + // Call onStart here to ensure the span is fully initialized. + $spanProcessor->onStart($span, $parentContext); + + return $span; + } + + /** + * Backward compatibility methods + * + * @codeCoverageIgnore + */ + public static function formatStackTrace(Throwable $e, array &$seen = null): string + { + BcUtil::triggerMethodDeprecationNotice( + __METHOD__, + 'format', + StackTraceFormatter::class + ); + + return StackTraceFormatter::format($e); + } + + /** @inheritDoc */ + public function getContext(): API\SpanContextInterface + { + return $this->context; + } + + /** @inheritDoc */ + public function isRecording(): bool + { + return !$this->hasEnded; + } + + /** @inheritDoc */ + public function setAttribute(string $key, $value): self + { + if ($this->hasEnded) { + return $this; + } + + $this->attributesBuilder[$key] = $value; + + return $this; + } + + /** @inheritDoc */ + public function setAttributes(iterable $attributes): self + { + foreach ($attributes as $key => $value) { + $this->attributesBuilder[$key] = $value; + } + + return $this; + } + + /** @inheritDoc */ + public function addEvent(string $name, iterable $attributes = [], ?int $timestamp = null): self + { + if ($this->hasEnded) { + return $this; + } + if (++$this->totalRecordedEvents > $this->spanLimits->getEventCountLimit()) { + return $this; + } + + $timestamp ??= ClockFactory::getDefault()->now(); + $eventAttributesBuilder = $this->spanLimits->getEventAttributesFactory()->builder($attributes); + + $this->events[] = new Event($name, $timestamp, $eventAttributesBuilder->build()); + + return $this; + } + + /** @inheritDoc */ + public function recordException(Throwable $exception, iterable $attributes = [], ?int $timestamp = null): self + { + if ($this->hasEnded) { + return $this; + } + if (++$this->totalRecordedEvents > $this->spanLimits->getEventCountLimit()) { + return $this; + } + + $timestamp ??= ClockFactory::getDefault()->now(); + $eventAttributesBuilder = $this->spanLimits->getEventAttributesFactory()->builder([ + 'exception.type' => get_class($exception), + 'exception.message' => $exception->getMessage(), + 'exception.stacktrace' => StackTraceFormatter::format($exception), + ]); + + foreach ($attributes as $key => $value) { + $eventAttributesBuilder[$key] = $value; + } + + $this->events[] = new Event('exception', $timestamp, $eventAttributesBuilder->build()); + + return $this; + } + + /** @inheritDoc */ + public function updateName(string $name): self + { + if ($this->hasEnded) { + return $this; + } + $this->name = $name; + + return $this; + } + + /** @inheritDoc */ + public function setStatus(string $code, string $description = null): self + { + if ($this->hasEnded) { + return $this; + } + + // An attempt to set value Unset SHOULD be ignored. + if ($code === API\StatusCode::STATUS_UNSET) { + return $this; + } + + // When span status is set to Ok it SHOULD be considered final and any further attempts to change it SHOULD be ignored. + if ($this->status->getCode() === API\StatusCode::STATUS_OK) { + return $this; + } + $this->status = StatusData::create($code, $description); + + return $this; + } + + /** @inheritDoc */ + public function end(int $endEpochNanos = null): void + { + if ($this->hasEnded) { + return; + } + + $this->endEpochNanos = $endEpochNanos ?? ClockFactory::getDefault()->now(); + $this->hasEnded = true; + + $this->spanProcessor->onEnd($this); + } + + /** @inheritDoc */ + public function getName(): string + { + return $this->name; + } + + public function getParentContext(): API\SpanContextInterface + { + return $this->parentSpanContext; + } + + public function getInstrumentationScope(): InstrumentationScopeInterface + { + return $this->instrumentationScope; + } + + public function hasEnded(): bool + { + return $this->hasEnded; + } + + public function toSpanData(): SpanDataInterface + { + return new ImmutableSpan( + $this, + $this->name, + $this->links, + $this->events, + $this->attributesBuilder->build(), + $this->totalRecordedEvents, + $this->status, + $this->endEpochNanos, + $this->hasEnded + ); + } + + /** @inheritDoc */ + public function getDuration(): int + { + return ($this->hasEnded ? $this->endEpochNanos : ClockFactory::getDefault()->now()) - $this->startEpochNanos; + } + + /** @inheritDoc */ + public function getKind(): int + { + return $this->kind; + } + + /** @inheritDoc */ + public function getAttribute(string $key) + { + return $this->attributesBuilder[$key]; + } + + public function getStartEpochNanos(): int + { + return $this->startEpochNanos; + } + + public function getTotalRecordedLinks(): int + { + return $this->totalRecordedLinks; + } + + public function getTotalRecordedEvents(): int + { + return $this->totalRecordedEvents; + } + + public function getResource(): ResourceInfo + { + return $this->resource; + } +} diff --git a/vendor/open-telemetry/sdk/Trace/SpanBuilder.php b/vendor/open-telemetry/sdk/Trace/SpanBuilder.php new file mode 100644 index 000000000..2867c01c8 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SpanBuilder.php @@ -0,0 +1,191 @@ + */ + private array $links = []; + + private AttributesBuilderInterface $attributesBuilder; + private int $totalNumberOfLinksAdded = 0; + private int $startEpochNanos = 0; + + /** @param non-empty-string $spanName */ + public function __construct( + string $spanName, + InstrumentationScopeInterface $instrumentationScope, + TracerSharedState $tracerSharedState + ) { + $this->spanName = $spanName; + $this->instrumentationScope = $instrumentationScope; + $this->tracerSharedState = $tracerSharedState; + $this->attributesBuilder = $tracerSharedState->getSpanLimits()->getAttributesFactory()->builder(); + } + + /** @inheritDoc */ + public function setParent($context): API\SpanBuilderInterface + { + $this->parentContext = $context; + + return $this; + } + + /** @inheritDoc */ + public function addLink(API\SpanContextInterface $context, iterable $attributes = []): API\SpanBuilderInterface + { + if (!$context->isValid()) { + return $this; + } + + $this->totalNumberOfLinksAdded++; + + if (count($this->links) === $this->tracerSharedState->getSpanLimits()->getLinkCountLimit()) { + return $this; + } + + $this->links[] = new Link( + $context, + $this->tracerSharedState + ->getSpanLimits() + ->getLinkAttributesFactory() + ->builder($attributes) + ->build(), + ); + + return $this; + } + + /** @inheritDoc */ + public function setAttribute(string $key, $value): API\SpanBuilderInterface + { + $this->attributesBuilder[$key] = $value; + + return $this; + } + + /** @inheritDoc */ + public function setAttributes(iterable $attributes): API\SpanBuilderInterface + { + foreach ($attributes as $key => $value) { + $this->attributesBuilder[$key] = $value; + } + + return $this; + } + + /** + * @inheritDoc + * + * @psalm-param API\SpanKind::KIND_* $spanKind + */ + public function setSpanKind(int $spanKind): API\SpanBuilderInterface + { + $this->spanKind = $spanKind; + + return $this; + } + + /** @inheritDoc */ + public function setStartTimestamp(int $timestampNanos): API\SpanBuilderInterface + { + if (0 > $timestampNanos) { + return $this; + } + + $this->startEpochNanos = $timestampNanos; + + return $this; + } + + /** @inheritDoc */ + public function startSpan(): API\SpanInterface + { + $parentContext = Context::resolve($this->parentContext); + $parentSpan = Span::fromContext($parentContext); + $parentSpanContext = $parentSpan->getContext(); + + $spanId = $this->tracerSharedState->getIdGenerator()->generateSpanId(); + + if (!$parentSpanContext->isValid()) { + $traceId = $this->tracerSharedState->getIdGenerator()->generateTraceId(); + } else { + $traceId = $parentSpanContext->getTraceId(); + } + + $samplingResult = $this + ->tracerSharedState + ->getSampler() + ->shouldSample( + $parentContext, + $traceId, + $this->spanName, + $this->spanKind, + $this->attributesBuilder->build(), + $this->links, + ); + $samplingDecision = $samplingResult->getDecision(); + $samplingResultTraceState = $samplingResult->getTraceState(); + + $spanContext = API\SpanContext::create( + $traceId, + $spanId, + SamplingResult::RECORD_AND_SAMPLE === $samplingDecision ? API\TraceFlags::SAMPLED : API\TraceFlags::DEFAULT, + $samplingResultTraceState, + ); + + if (!in_array($samplingDecision, [SamplingResult::RECORD_AND_SAMPLE, SamplingResult::RECORD_ONLY], true)) { + return Span::wrap($spanContext); + } + + $attributesBuilder = clone $this->attributesBuilder; + foreach ($samplingResult->getAttributes() as $key => $value) { + $attributesBuilder[$key] = $value; + } + + return Span::startSpan( + $this->spanName, + $spanContext, + $this->instrumentationScope, + $this->spanKind, + $parentSpan, + $parentContext, + $this->tracerSharedState->getSpanLimits(), + $this->tracerSharedState->getSpanProcessor(), + $this->tracerSharedState->getResource(), + $attributesBuilder, + $this->links, + $this->totalNumberOfLinksAdded, + $this->startEpochNanos + ); + } +} diff --git a/vendor/open-telemetry/sdk/Trace/SpanConverterInterface.php b/vendor/open-telemetry/sdk/Trace/SpanConverterInterface.php new file mode 100644 index 000000000..40552e440 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SpanConverterInterface.php @@ -0,0 +1,10 @@ + */ + public function getEvents(): array; + + /** @return list */ + public function getLinks(): array; + + public function getEndEpochNanos(): int; + public function hasEnded(): bool; + public function getInstrumentationScope(): InstrumentationScopeInterface; + public function getResource(): ResourceInfo; + + /** @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/trace/sdk_exporters/non-otlp.md#dropped-events-count */ + public function getTotalDroppedEvents(): int; + + /** @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/trace/sdk_exporters/non-otlp.md#dropped-links-count */ + public function getTotalDroppedLinks(): int; +} diff --git a/vendor/open-telemetry/sdk/Trace/SpanExporter/AbstractDecorator.php b/vendor/open-telemetry/sdk/Trace/SpanExporter/AbstractDecorator.php new file mode 100644 index 000000000..42f49e815 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SpanExporter/AbstractDecorator.php @@ -0,0 +1,12 @@ +transport = $transport; + $this->setSpanConverter($converter ?? new FriendlySpanConverter()); + } + + public function export(iterable $batch, ?CancellationInterface $cancellation = null): FutureInterface + { + $payload = ''; + foreach ($batch as $span) { + try { + $payload .= json_encode( + $this->getSpanConverter()->convert([$span]), + JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT + ) . PHP_EOL; + } catch (JsonException $e) { + self::logWarning('Error converting span: ' . $e->getMessage()); + } + } + + return $this->transport->send($payload) + ->map(fn () => true) + ->catch(fn () => false); + } + + public function shutdown(?CancellationInterface $cancellation = null): bool + { + return $this->transport->shutdown(); + } + + public function forceFlush(?CancellationInterface $cancellation = null): bool + { + return $this->transport->forceFlush(); + } +} diff --git a/vendor/open-telemetry/sdk/Trace/SpanExporter/ConsoleSpanExporterFactory.php b/vendor/open-telemetry/sdk/Trace/SpanExporter/ConsoleSpanExporterFactory.php new file mode 100644 index 000000000..7e45fb549 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SpanExporter/ConsoleSpanExporterFactory.php @@ -0,0 +1,18 @@ +create('php://stdout', 'application/json'); + + return new ConsoleSpanExporter($transport); + } +} diff --git a/vendor/open-telemetry/sdk/Trace/SpanExporter/FriendlySpanConverter.php b/vendor/open-telemetry/sdk/Trace/SpanExporter/FriendlySpanConverter.php new file mode 100644 index 000000000..1f8178e10 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SpanExporter/FriendlySpanConverter.php @@ -0,0 +1,173 @@ +convertSpan($span); + } + + return $aggregate; + } + + /** + * friendlySpan does the heavy lifting converting a span into an array + * + * @param SpanDataInterface $span + * @return array + */ + private function convertSpan(SpanDataInterface $span): array + { + return [ + self::NAME_ATTR => $span->getName(), + self::CONTEXT_ATTR => $this->convertContext($span->getContext()), + self::RESOURCE_ATTR => $this->convertResource($span->getResource()), + self::PARENT_SPAN_ATTR => $this->covertParentContext($span->getParentContext()), + self::KIND_ATTR => $this->convertKind($span->getKind()), + self::START_ATTR => $span->getStartEpochNanos(), + self::END_ATTR => $span->getEndEpochNanos(), + self::ATTRIBUTES_ATTR => $this->convertAttributes($span->getAttributes()), + self::STATUS_ATTR => $this->covertStatus($span->getStatus()), + self::EVENTS_ATTR => $this->convertEvents($span->getEvents()), + self::LINKS_ATTR => $this->convertLinks($span->getLinks()), + ]; + } + + /** + * @param SpanContextInterface $context + * @return array + */ + private function convertContext(SpanContextInterface $context): array + { + return [ + self::TRACE_ID_ATTR => $context->getTraceId(), + self::SPAN_ID_ATTR => $context->getSpanId(), + self::TRACE_STATE_ATTR => (string) $context->getTraceState(), + ]; + } + + /** + * @param ResourceInfo $resource + * @return array + */ + private function convertResource(ResourceInfo $resource): array + { + return $resource->getAttributes()->toArray(); + } + + /** + * @param SpanContextInterface $context + * @return string + */ + private function covertParentContext(SpanContextInterface $context): string + { + return $context->isValid() ? $context->getSpanId() : ''; + } + + /** + * Translates SpanKind from its integer representation to a more human friendly string. + * + * @param int $kind + * @return string + */ + private function convertKind(int $kind): string + { + return array_flip( + (new ReflectionClass(SpanKind::class)) + ->getConstants() + )[$kind]; + } + + /** + * @param \OpenTelemetry\SDK\Common\Attribute\AttributesInterface $attributes + * @return array + */ + private function convertAttributes(AttributesInterface $attributes): array + { + return $attributes->toArray(); + } + + /** + * @param StatusDataInterface $status + * @return array + */ + private function covertStatus(StatusDataInterface $status): array + { + return [ + self::CODE_ATTR => $status->getCode(), + self::DESCRIPTION_ATTR => $status->getDescription(), + ]; + } + + /** + * @param array $events + * @return array + */ + private function convertEvents(array $events): array + { + $result = []; + + foreach ($events as $event) { + $result[] = [ + self::NAME_ATTR => $event->getName(), + self::TIMESTAMP_ATTR => $event->getEpochNanos(), + self::ATTRIBUTES_ATTR => $this->convertAttributes($event->getAttributes()), + ]; + } + + return $result; + } + + /** + * @param array $links + * @return array + */ + private function convertLinks(array $links): array + { + $result = []; + + foreach ($links as $link) { + $result[] = [ + self::CONTEXT_ATTR => $this->convertContext($link->getSpanContext()), + self::ATTRIBUTES_ATTR => $this->convertAttributes($link->getAttributes()), + ]; + } + + return $result; + } +} diff --git a/vendor/open-telemetry/sdk/Trace/SpanExporter/InMemoryExporter.php b/vendor/open-telemetry/sdk/Trace/SpanExporter/InMemoryExporter.php new file mode 100644 index 000000000..ebb022595 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SpanExporter/InMemoryExporter.php @@ -0,0 +1,40 @@ +storage = $storage ?? new ArrayObject(); + } + + protected function doExport(iterable $spans): bool + { + foreach ($spans as $span) { + $this->storage[] = $span; + } + + return true; + } + + public function getSpans(): array + { + return (array) $this->storage; + } + + public function getStorage(): ArrayObject + { + return $this->storage; + } +} diff --git a/vendor/open-telemetry/sdk/Trace/SpanExporter/InMemorySpanExporterFactory.php b/vendor/open-telemetry/sdk/Trace/SpanExporter/InMemorySpanExporterFactory.php new file mode 100644 index 000000000..c19686fac --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SpanExporter/InMemorySpanExporterFactory.php @@ -0,0 +1,15 @@ +setDecorated($decorated); + $this->setLogger($logger ?? new NullLogger()); + $this->setSpanConverter($converter ?? new FriendlySpanConverter()); + } + + protected function beforeExport(iterable $spans): iterable + { + return $spans; + } + + /** + * @param iterable $spans + * @param bool $exportSuccess + */ + protected function afterExport(iterable $spans, bool $exportSuccess): void + { + if ($exportSuccess) { + $this->log( + 'Status Success', + $this->getSpanConverter()->convert($spans), + LogLevel::INFO, + ); + } else { + $this->log( + 'Status Failed Retryable', + $this->getSpanConverter()->convert($spans), + LogLevel::ERROR, + ); + } + } +} diff --git a/vendor/open-telemetry/sdk/Trace/SpanExporter/LoggerExporter.php b/vendor/open-telemetry/sdk/Trace/SpanExporter/LoggerExporter.php new file mode 100644 index 000000000..1969a5426 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SpanExporter/LoggerExporter.php @@ -0,0 +1,96 @@ +setServiceName($serviceName); + $this->setLogger($logger ?? new NullLogger()); + $this->setDefaultLogLevel($defaultLogLevel ?? LogLevel::DEBUG); + $this->setSpanConverter($converter ?? new FriendlySpanConverter()); + $this->setGranularity($granularity); + } + + /** @inheritDoc */ + public function doExport(iterable $spans): bool + { + try { + $this->doLog($spans); + } catch (Throwable $t) { + return false; + } + + return true; + } + + /** + * @param string $serviceName + */ + private function setServiceName(string $serviceName): void + { + $this->serviceName = $serviceName; + } + + /** + * @param int $granularity + */ + public function setGranularity(int $granularity): void + { + $this->granularity = $granularity === self::GRANULARITY_SPAN + ? self::GRANULARITY_SPAN + : self::GRANULARITY_AGGREGATE; + } + + /** + * @param iterable $spans + */ + private function doLog(iterable $spans): void + { + if ($this->granularity === self::GRANULARITY_AGGREGATE) { + $this->log($this->serviceName, $this->getSpanConverter()->convert($spans)); + + return; + } + + foreach ($spans as $span) { + $this->log($this->serviceName, $this->getSpanConverter()->convert([$span])); + } + } +} diff --git a/vendor/open-telemetry/sdk/Trace/SpanExporter/NullSpanConverter.php b/vendor/open-telemetry/sdk/Trace/SpanExporter/NullSpanConverter.php new file mode 100644 index 000000000..1e55431a8 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SpanExporter/NullSpanConverter.php @@ -0,0 +1,15 @@ + $batch Batch of spans to export + * + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/specification/trace/sdk.md#exportbatch + * + * @psalm-return FutureInterface + */ + public function export(iterable $batch, ?CancellationInterface $cancellation = null): FutureInterface; + + /** @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/specification/trace/sdk.md#shutdown-2 */ + public function shutdown(?CancellationInterface $cancellation = null): bool; + + /** @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/specification/trace/sdk.md#forceflush-2 */ + public function forceFlush(?CancellationInterface $cancellation = null): bool; +} diff --git a/vendor/open-telemetry/sdk/Trace/SpanLimits.php b/vendor/open-telemetry/sdk/Trace/SpanLimits.php new file mode 100644 index 000000000..4b07649fc --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SpanLimits.php @@ -0,0 +1,67 @@ +attributesFactory; + } + + public function getEventAttributesFactory(): AttributesFactoryInterface + { + return $this->eventAttributesFactory; + } + + public function getLinkAttributesFactory(): AttributesFactoryInterface + { + return $this->linkAttributesFactory; + } + + /** @return int Maximum allowed span event count */ + public function getEventCountLimit(): int + { + return $this->eventCountLimit; + } + + /** @return int Maximum allowed span link count */ + public function getLinkCountLimit(): int + { + return $this->linkCountLimit; + } + + /** + * @internal Use {@see SpanLimitsBuilder} to create {@see SpanLimits} instance. + */ + public function __construct( + AttributesFactoryInterface $attributesFactory, + AttributesFactoryInterface $eventAttributesFactory, + AttributesFactoryInterface $linkAttributesFactory, + int $eventCountLimit, + int $linkCountLimit + ) { + $this->attributesFactory = $attributesFactory; + $this->eventAttributesFactory = $eventAttributesFactory; + $this->linkAttributesFactory = $linkAttributesFactory; + $this->eventCountLimit = $eventCountLimit; + $this->linkCountLimit = $linkCountLimit; + } +} diff --git a/vendor/open-telemetry/sdk/Trace/SpanLimitsBuilder.php b/vendor/open-telemetry/sdk/Trace/SpanLimitsBuilder.php new file mode 100644 index 000000000..11ed5a82b --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SpanLimitsBuilder.php @@ -0,0 +1,148 @@ +attributeCountLimit = $attributeCountLimit; + + return $this; + } + + /** + * @param int $attributeValueLengthLimit Maximum allowed attribute value length + */ + public function setAttributeValueLengthLimit(int $attributeValueLengthLimit): SpanLimitsBuilder + { + $this->attributeValueLengthLimit = $attributeValueLengthLimit; + + return $this; + } + + /** + * @param int $eventCountLimit Maximum allowed span event count + */ + public function setEventCountLimit(int $eventCountLimit): SpanLimitsBuilder + { + $this->eventCountLimit = $eventCountLimit; + + return $this; + } + + /** + * @param int $linkCountLimit Maximum allowed span link count + */ + public function setLinkCountLimit(int $linkCountLimit): SpanLimitsBuilder + { + $this->linkCountLimit = $linkCountLimit; + + return $this; + } + + /** + * @param int $attributePerEventCountLimit Maximum allowed attribute per span event count + */ + public function setAttributePerEventCountLimit(int $attributePerEventCountLimit): SpanLimitsBuilder + { + $this->attributePerEventCountLimit = $attributePerEventCountLimit; + + return $this; + } + + /** + * @param int $attributePerLinkCountLimit Maximum allowed attribute per span link count + */ + public function setAttributePerLinkCountLimit(int $attributePerLinkCountLimit): SpanLimitsBuilder + { + $this->attributePerLinkCountLimit = $attributePerLinkCountLimit; + + return $this; + } + + /** + * @param bool $retain whether general identity attributes should be retained + * + * @see https://github.com/open-telemetry/semantic-conventions/blob/main/docs/general/attributes.md#general-identity-attributes + */ + public function retainGeneralIdentityAttributes(bool $retain = true): SpanLimitsBuilder + { + $this->retainGeneralIdentityAttributes = $retain; + + return $this; + } + + /** + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#span-limits + */ + public function build(): SpanLimits + { + $attributeCountLimit = $this->attributeCountLimit + ?: Configuration::getInt(Env::OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, SpanLimits::DEFAULT_SPAN_ATTRIBUTE_COUNT_LIMIT); + $attributeValueLengthLimit = $this->attributeValueLengthLimit + ?: Configuration::getInt(Env::OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, SpanLimits::DEFAULT_SPAN_ATTRIBUTE_LENGTH_LIMIT); + $eventCountLimit = $this->eventCountLimit + ?: Configuration::getInt(Env::OTEL_SPAN_EVENT_COUNT_LIMIT, SpanLimits::DEFAULT_SPAN_EVENT_COUNT_LIMIT); + $linkCountLimit = $this->linkCountLimit + ?: Configuration::getInt(Env::OTEL_SPAN_LINK_COUNT_LIMIT, SpanLimits::DEFAULT_SPAN_LINK_COUNT_LIMIT); + $attributePerEventCountLimit = $this->attributePerEventCountLimit + ?: Configuration::getInt(Env::OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT, SpanLimits::DEFAULT_EVENT_ATTRIBUTE_COUNT_LIMIT); + $attributePerLinkCountLimit = $this->attributePerLinkCountLimit + ?: Configuration::getInt(Env::OTEL_LINK_ATTRIBUTE_COUNT_LIMIT, SpanLimits::DEFAULT_LINK_ATTRIBUTE_COUNT_LIMIT); + + if ($attributeValueLengthLimit === PHP_INT_MAX) { + $attributeValueLengthLimit = null; + } + + $spanAttributesFactory = Attributes::factory($attributeCountLimit, $attributeValueLengthLimit); + + if (!$this->retainGeneralIdentityAttributes) { + $spanAttributesFactory = new FilteredAttributesFactory($spanAttributesFactory, [ + TraceAttributes::ENDUSER_ID, + TraceAttributes::ENDUSER_ROLE, + TraceAttributes::ENDUSER_SCOPE, + ]); + } + + return new SpanLimits( + $spanAttributesFactory, + Attributes::factory($attributePerEventCountLimit, $attributeValueLengthLimit), + Attributes::factory($attributePerLinkCountLimit, $attributeValueLengthLimit), + $eventCountLimit, + $linkCountLimit, + ); + } +} diff --git a/vendor/open-telemetry/sdk/Trace/SpanProcessor/BatchSpanProcessor.php b/vendor/open-telemetry/sdk/Trace/SpanProcessor/BatchSpanProcessor.php new file mode 100644 index 000000000..58032749e --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SpanProcessor/BatchSpanProcessor.php @@ -0,0 +1,290 @@ + 'batching']; + private const ATTRIBUTES_QUEUED = self::ATTRIBUTES_PROCESSOR + ['state' => 'queued']; + private const ATTRIBUTES_PENDING = self::ATTRIBUTES_PROCESSOR + ['state' => 'pending']; + private const ATTRIBUTES_PROCESSED = self::ATTRIBUTES_PROCESSOR + ['state' => 'processed']; + private const ATTRIBUTES_DROPPED = self::ATTRIBUTES_PROCESSOR + ['state' => 'dropped']; + private const ATTRIBUTES_FREE = self::ATTRIBUTES_PROCESSOR + ['state' => 'free']; + + private SpanExporterInterface $exporter; + private ClockInterface $clock; + private int $maxQueueSize; + private int $scheduledDelayNanos; + private int $maxExportBatchSize; + private bool $autoFlush; + private ContextInterface $exportContext; + + private ?int $nextScheduledRun = null; + private bool $running = false; + private int $dropped = 0; + private int $processed = 0; + private int $batchId = 0; + private int $queueSize = 0; + /** @var list */ + private array $batch = []; + /** @var SplQueue> */ + private SplQueue $queue; + /** @var SplQueue */ + private SplQueue $flush; + + private bool $closed = false; + + public function __construct( + SpanExporterInterface $exporter, + ClockInterface $clock, + int $maxQueueSize = self::DEFAULT_MAX_QUEUE_SIZE, + int $scheduledDelayMillis = self::DEFAULT_SCHEDULE_DELAY, + int $exportTimeoutMillis = self::DEFAULT_EXPORT_TIMEOUT, + int $maxExportBatchSize = self::DEFAULT_MAX_EXPORT_BATCH_SIZE, + bool $autoFlush = true, + ?MeterProviderInterface $meterProvider = null + ) { + if ($maxQueueSize <= 0) { + throw new InvalidArgumentException(sprintf('Maximum queue size (%d) must be greater than zero', $maxQueueSize)); + } + if ($scheduledDelayMillis <= 0) { + throw new InvalidArgumentException(sprintf('Scheduled delay (%d) must be greater than zero', $scheduledDelayMillis)); + } + if ($exportTimeoutMillis <= 0) { + throw new InvalidArgumentException(sprintf('Export timeout (%d) must be greater than zero', $exportTimeoutMillis)); + } + if ($maxExportBatchSize <= 0) { + throw new InvalidArgumentException(sprintf('Maximum export batch size (%d) must be greater than zero', $maxExportBatchSize)); + } + if ($maxExportBatchSize > $maxQueueSize) { + throw new InvalidArgumentException(sprintf('Maximum export batch size (%d) must be less than or equal to maximum queue size (%d)', $maxExportBatchSize, $maxQueueSize)); + } + + $this->exporter = $exporter; + $this->clock = $clock; + $this->maxQueueSize = $maxQueueSize; + $this->scheduledDelayNanos = $scheduledDelayMillis * 1_000_000; + $this->maxExportBatchSize = $maxExportBatchSize; + $this->autoFlush = $autoFlush; + + $this->exportContext = Context::getCurrent(); + $this->queue = new SplQueue(); + $this->flush = new SplQueue(); + + if ($meterProvider === null) { + return; + } + + $meter = $meterProvider->getMeter('io.opentelemetry.sdk'); + $meter + ->createObservableUpDownCounter( + 'otel.trace.span_processor.spans', + '{spans}', + 'The number of sampled spans received by the span processor', + ) + ->observe(function (ObserverInterface $observer): void { + $queued = $this->queue->count() * $this->maxExportBatchSize + count($this->batch); + $pending = $this->queueSize - $queued; + $processed = $this->processed; + $dropped = $this->dropped; + + $observer->observe($queued, self::ATTRIBUTES_QUEUED); + $observer->observe($pending, self::ATTRIBUTES_PENDING); + $observer->observe($processed, self::ATTRIBUTES_PROCESSED); + $observer->observe($dropped, self::ATTRIBUTES_DROPPED); + }); + $meter + ->createObservableUpDownCounter( + 'otel.trace.span_processor.queue.limit', + '{spans}', + 'The queue size limit', + ) + ->observe(function (ObserverInterface $observer): void { + $observer->observe($this->maxQueueSize, self::ATTRIBUTES_PROCESSOR); + }); + $meter + ->createObservableUpDownCounter( + 'otel.trace.span_processor.queue.usage', + '{spans}', + 'The current queue usage', + ) + ->observe(function (ObserverInterface $observer): void { + $queued = $this->queue->count() * $this->maxExportBatchSize + count($this->batch); + $pending = $this->queueSize - $queued; + $free = $this->maxQueueSize - $this->queueSize; + + $observer->observe($queued, self::ATTRIBUTES_QUEUED); + $observer->observe($pending, self::ATTRIBUTES_PENDING); + $observer->observe($free, self::ATTRIBUTES_FREE); + }); + } + + public function onStart(ReadWriteSpanInterface $span, ContextInterface $parentContext): void + { + } + + public function onEnd(ReadableSpanInterface $span): void + { + if ($this->closed) { + return; + } + if (!$span->getContext()->isSampled()) { + return; + } + + if ($this->queueSize === $this->maxQueueSize) { + $this->dropped++; + + return; + } + + $this->queueSize++; + $this->batch[] = $span->toSpanData(); + $this->nextScheduledRun ??= $this->clock->now() + $this->scheduledDelayNanos; + + if (count($this->batch) === $this->maxExportBatchSize) { + $this->enqueueBatch(); + } + if ($this->autoFlush) { + $this->flush(); + } + } + + public function forceFlush(?CancellationInterface $cancellation = null): bool + { + if ($this->closed) { + return false; + } + + return $this->flush(__FUNCTION__, $cancellation); + } + + public function shutdown(?CancellationInterface $cancellation = null): bool + { + if ($this->closed) { + return false; + } + + $this->closed = true; + + return $this->flush(__FUNCTION__, $cancellation); + } + + public static function builder(SpanExporterInterface $exporter): BatchSpanProcessorBuilder + { + return new BatchSpanProcessorBuilder($exporter); + } + + private function flush(?string $flushMethod = null, ?CancellationInterface $cancellation = null): bool + { + if ($flushMethod !== null) { + $flushId = $this->batchId + $this->queue->count() + (int) (bool) $this->batch; + $this->flush->enqueue([$flushId, $flushMethod, $cancellation, !$this->running, Context::getCurrent()]); + } + + if ($this->running) { + return false; + } + + $success = true; + $exception = null; + $this->running = true; + + try { + for (;;) { + while (!$this->flush->isEmpty() && $this->flush->bottom()[0] <= $this->batchId) { + [, $flushMethod, $cancellation, $propagateResult, $context] = $this->flush->dequeue(); + $scope = $context->activate(); + + try { + $result = $this->exporter->$flushMethod($cancellation); + if ($propagateResult) { + $success = $result; + } + } catch (Throwable $e) { + if ($propagateResult) { + $exception = $e; + } else { + self::logError(sprintf('Unhandled %s error', $flushMethod), ['exception' => $e]); + } + } finally { + $scope->detach(); + } + } + + if (!$this->shouldFlush()) { + break; + } + + if ($this->queue->isEmpty()) { + $this->enqueueBatch(); + } + $batchSize = count($this->queue->bottom()); + $this->batchId++; + $scope = $this->exportContext->activate(); + + try { + $this->exporter->export($this->queue->dequeue())->await(); + } catch (Throwable $e) { + self::logError('Unhandled export error', ['exception' => $e]); + } finally { + $this->processed += $batchSize; + $this->queueSize -= $batchSize; + $scope->detach(); + } + } + } finally { + $this->running = false; + } + + if ($exception !== null) { + throw $exception; + } + + return $success; + } + + private function shouldFlush(): bool + { + return !$this->flush->isEmpty() + || $this->autoFlush && !$this->queue->isEmpty() + || $this->autoFlush && $this->nextScheduledRun !== null && $this->clock->now() > $this->nextScheduledRun; + } + + private function enqueueBatch(): void + { + assert($this->batch !== []); + + $this->queue->enqueue($this->batch); + $this->batch = []; + $this->nextScheduledRun = null; + } +} diff --git a/vendor/open-telemetry/sdk/Trace/SpanProcessor/BatchSpanProcessorBuilder.php b/vendor/open-telemetry/sdk/Trace/SpanProcessor/BatchSpanProcessorBuilder.php new file mode 100644 index 000000000..8e81e7dd6 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SpanProcessor/BatchSpanProcessorBuilder.php @@ -0,0 +1,41 @@ +exporter = $exporter; + } + + public function setMeterProvider(MeterProviderInterface $meterProvider): self + { + $this->meterProvider = $meterProvider; + + return $this; + } + + public function build(): BatchSpanProcessor + { + return new BatchSpanProcessor( + $this->exporter, + ClockFactory::getDefault(), + BatchSpanProcessor::DEFAULT_MAX_QUEUE_SIZE, + BatchSpanProcessor::DEFAULT_SCHEDULE_DELAY, + BatchSpanProcessor::DEFAULT_EXPORT_TIMEOUT, + BatchSpanProcessor::DEFAULT_MAX_EXPORT_BATCH_SIZE, + true, + $this->meterProvider + ); + } +} diff --git a/vendor/open-telemetry/sdk/Trace/SpanProcessor/MultiSpanProcessor.php b/vendor/open-telemetry/sdk/Trace/SpanProcessor/MultiSpanProcessor.php new file mode 100644 index 000000000..e690791f2 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SpanProcessor/MultiSpanProcessor.php @@ -0,0 +1,79 @@ + */ + private array $processors = []; + + public function __construct(SpanProcessorInterface ...$spanProcessors) + { + foreach ($spanProcessors as $processor) { + $this->addSpanProcessor($processor); + } + } + + public function addSpanProcessor(SpanProcessorInterface $processor): void + { + $this->processors[] = $processor; + } + + /** @return list */ + public function getSpanProcessors(): array + { + return $this->processors; + } + + /** @inheritDoc */ + public function onStart(ReadWriteSpanInterface $span, ContextInterface $parentContext): void + { + foreach ($this->processors as $processor) { + $processor->onStart($span, $parentContext); + } + } + + /** @inheritDoc */ + public function onEnd(ReadableSpanInterface $span): void + { + foreach ($this->processors as $processor) { + $processor->onEnd($span); + } + } + + /** @inheritDoc */ + public function shutdown(?CancellationInterface $cancellation = null): bool + { + $result = true; + + foreach ($this->processors as $processor) { + $result = $result && $processor->shutdown(); + } + + return $result; + } + + /** @inheritDoc */ + public function forceFlush(?CancellationInterface $cancellation = null): bool + { + $result = true; + + foreach ($this->processors as $processor) { + $result = $result && $processor->forceFlush(); + } + + return $result; + } +} diff --git a/vendor/open-telemetry/sdk/Trace/SpanProcessor/NoopSpanProcessor.php b/vendor/open-telemetry/sdk/Trace/SpanProcessor/NoopSpanProcessor.php new file mode 100644 index 000000000..9c4d1eabe --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SpanProcessor/NoopSpanProcessor.php @@ -0,0 +1,47 @@ +forceFlush(); + } +} diff --git a/vendor/open-telemetry/sdk/Trace/SpanProcessor/SimpleSpanProcessor.php b/vendor/open-telemetry/sdk/Trace/SpanProcessor/SimpleSpanProcessor.php new file mode 100644 index 000000000..4e86e79ab --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SpanProcessor/SimpleSpanProcessor.php @@ -0,0 +1,120 @@ + */ + private SplQueue $queue; + + private bool $closed = false; + + public function __construct(SpanExporterInterface $exporter) + { + $this->exporter = $exporter; + + $this->exportContext = Context::getCurrent(); + $this->queue = new SplQueue(); + } + + public function onStart(ReadWriteSpanInterface $span, ContextInterface $parentContext): void + { + } + + public function onEnd(ReadableSpanInterface $span): void + { + if ($this->closed) { + return; + } + if (!$span->getContext()->isSampled()) { + return; + } + + $spanData = $span->toSpanData(); + $this->flush(fn () => $this->exporter->export([$spanData])->await(), 'export', false, $this->exportContext); + } + + public function forceFlush(?CancellationInterface $cancellation = null): bool + { + if ($this->closed) { + return false; + } + + return $this->flush(fn (): bool => $this->exporter->forceFlush($cancellation), __FUNCTION__, true, Context::getCurrent()); + } + + public function shutdown(?CancellationInterface $cancellation = null): bool + { + if ($this->closed) { + return false; + } + + $this->closed = true; + + return $this->flush(fn (): bool => $this->exporter->shutdown($cancellation), __FUNCTION__, true, Context::getCurrent()); + } + + private function flush(Closure $task, string $taskName, bool $propagateResult, ContextInterface $context): bool + { + $this->queue->enqueue([$task, $taskName, $propagateResult && !$this->running, $context]); + + if ($this->running) { + return false; + } + + $success = true; + $exception = null; + $this->running = true; + + try { + while (!$this->queue->isEmpty()) { + [$task, $taskName, $propagateResult, $context] = $this->queue->dequeue(); + $scope = $context->activate(); + + try { + $result = $task(); + if ($propagateResult) { + $success = $result; + } + } catch (Throwable $e) { + if ($propagateResult) { + $exception = $e; + } else { + self::logError(sprintf('Unhandled %s error', $taskName), ['exception' => $e]); + } + } finally { + $scope->detach(); + } + } + } finally { + $this->running = false; + } + + if ($exception !== null) { + throw $exception; + } + + return $success; + } +} diff --git a/vendor/open-telemetry/sdk/Trace/SpanProcessorFactory.php b/vendor/open-telemetry/sdk/Trace/SpanProcessorFactory.php new file mode 100644 index 000000000..39144cdf6 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SpanProcessorFactory.php @@ -0,0 +1,48 @@ +code = $code; + $this->description = $description; + } + + /** @psalm-param API\StatusCode::STATUS_* $code */ + public static function create(string $code, ?string $description = null): self + { + if (empty($description)) { + switch ($code) { + case API\StatusCode::STATUS_UNSET: + return self::unset(); + case API\StatusCode::STATUS_ERROR: + return self::error(); + case API\StatusCode::STATUS_OK: + return self::ok(); + } + } + + // Ignore description for non Error statuses. + if (API\StatusCode::STATUS_ERROR !== $code) { + $description = ''; + } + + return new self($code, $description); /** @phan-suppress-current-line PhanTypeMismatchArgumentNullable */ + } + + public static function ok(): self + { + if (null === self::$ok) { + self::$ok = new self(API\StatusCode::STATUS_OK, ''); + } + + return self::$ok; + } + + public static function error(): self + { + if (null === self::$error) { + self::$error = new self(API\StatusCode::STATUS_ERROR, ''); + } + + return self::$error; + } + + public static function unset(): self + { + if (null === self::$unset) { + self::$unset = new self(API\StatusCode::STATUS_UNSET, ''); + } + + return self::$unset; + } + + public function getCode(): string + { + return $this->code; + } + + public function getDescription(): string + { + return $this->description; + } +} diff --git a/vendor/open-telemetry/sdk/Trace/StatusDataInterface.php b/vendor/open-telemetry/sdk/Trace/StatusDataInterface.php new file mode 100644 index 000000000..973d2b519 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/StatusDataInterface.php @@ -0,0 +1,18 @@ +tracerSharedState = $tracerSharedState; + $this->instrumentationScope = $instrumentationScope; + } + + /** @inheritDoc */ + public function spanBuilder(string $spanName): API\SpanBuilderInterface + { + if (ctype_space($spanName)) { + $spanName = self::FALLBACK_SPAN_NAME; + } + + if ($this->tracerSharedState->hasShutdown()) { + return new API\NoopSpanBuilder(Context::storage()); + } + + return new SpanBuilder( + $spanName, + $this->instrumentationScope, + $this->tracerSharedState, + ); + } + + public function getInstrumentationScope(): InstrumentationScopeInterface + { + return $this->instrumentationScope; + } +} diff --git a/vendor/open-telemetry/sdk/Trace/TracerProvider.php b/vendor/open-telemetry/sdk/Trace/TracerProvider.php new file mode 100644 index 000000000..fdae4aea2 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/TracerProvider.php @@ -0,0 +1,99 @@ +|SpanProcessorInterface|null $spanProcessors */ + public function __construct( + $spanProcessors = [], + SamplerInterface $sampler = null, + ResourceInfo $resource = null, + SpanLimits $spanLimits = null, + IdGeneratorInterface $idGenerator = null, + ?InstrumentationScopeFactoryInterface $instrumentationScopeFactory = null + ) { + if (null === $spanProcessors) { + $spanProcessors = []; + } + + $spanProcessors = is_array($spanProcessors) ? $spanProcessors : [$spanProcessors]; + $resource ??= ResourceInfoFactory::defaultResource(); + $sampler ??= new ParentBased(new AlwaysOnSampler()); + $idGenerator ??= new RandomIdGenerator(); + $spanLimits ??= (new SpanLimitsBuilder())->build(); + + $this->tracerSharedState = new TracerSharedState( + $idGenerator, + $resource, + $spanLimits, + $sampler, + $spanProcessors + ); + $this->instrumentationScopeFactory = $instrumentationScopeFactory ?? new InstrumentationScopeFactory(Attributes::factory()); + } + + public function forceFlush(?CancellationInterface $cancellation = null): bool + { + return $this->tracerSharedState->getSpanProcessor()->forceFlush($cancellation); + } + + /** + * @inheritDoc + */ + public function getTracer( + string $name, + ?string $version = null, + ?string $schemaUrl = null, + iterable $attributes = [] + ): API\TracerInterface { + if ($this->tracerSharedState->hasShutdown()) { + return NoopTracer::getInstance(); + } + + return new Tracer( + $this->tracerSharedState, + $this->instrumentationScopeFactory->create($name, $version, $schemaUrl, $attributes), + ); + } + + public function getSampler(): SamplerInterface + { + return $this->tracerSharedState->getSampler(); + } + + /** + * Returns `false` is the provider is already shutdown, otherwise `true`. + */ + public function shutdown(?CancellationInterface $cancellation = null): bool + { + if ($this->tracerSharedState->hasShutdown()) { + return true; + } + + return $this->tracerSharedState->shutdown($cancellation); + } + + public static function builder(): TracerProviderBuilder + { + return new TracerProviderBuilder(); + } +} diff --git a/vendor/open-telemetry/sdk/Trace/TracerProviderBuilder.php b/vendor/open-telemetry/sdk/Trace/TracerProviderBuilder.php new file mode 100644 index 000000000..8dcfdc700 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/TracerProviderBuilder.php @@ -0,0 +1,45 @@ + + private ?array $spanProcessors = []; + private ?ResourceInfo $resource = null; + private ?SamplerInterface $sampler = null; + + public function addSpanProcessor(SpanProcessorInterface $spanProcessor): self + { + $this->spanProcessors[] = $spanProcessor; + + return $this; + } + + public function setResource(ResourceInfo $resource): self + { + $this->resource = $resource; + + return $this; + } + + public function setSampler(SamplerInterface $sampler): self + { + $this->sampler = $sampler; + + return $this; + } + + public function build(): TracerProviderInterface + { + return new TracerProvider( + $this->spanProcessors, + $this->sampler, + $this->resource, + ); + } +} diff --git a/vendor/open-telemetry/sdk/Trace/TracerProviderFactory.php b/vendor/open-telemetry/sdk/Trace/TracerProviderFactory.php new file mode 100644 index 000000000..a545319b6 --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/TracerProviderFactory.php @@ -0,0 +1,60 @@ +exporterFactory = $exporterFactory ?: new ExporterFactory(); + $this->samplerFactory = $samplerFactory ?: new SamplerFactory(); + $this->spanProcessorFactory = $spanProcessorFactory ?: new SpanProcessorFactory(); + } + + public function create(): TracerProviderInterface + { + if (Sdk::isDisabled()) { + return new NoopTracerProvider(); + } + + try { + $exporter = $this->exporterFactory->create(); + } catch (\Throwable $t) { + self::logWarning('Unable to create exporter', ['exception' => $t]); + $exporter = null; + } + + try { + $sampler = $this->samplerFactory->create(); + } catch (\Throwable $t) { + self::logWarning('Unable to create sampler', ['exception' => $t]); + $sampler = null; + } + + try { + $spanProcessor = $this->spanProcessorFactory->create($exporter); + } catch (\Throwable $t) { + self::logWarning('Unable to create span processor', ['exception' => $t]); + $spanProcessor = null; + } + + return new TracerProvider( + $spanProcessor, + $sampler, + ); + } +} diff --git a/vendor/open-telemetry/sdk/Trace/TracerProviderInterface.php b/vendor/open-telemetry/sdk/Trace/TracerProviderInterface.php new file mode 100644 index 000000000..d61c1ea8f --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/TracerProviderInterface.php @@ -0,0 +1,15 @@ +idGenerator = $idGenerator; + $this->resource = $resource; + $this->spanLimits = $spanLimits; + $this->sampler = $sampler; + + switch (count($spanProcessors)) { + case 0: + $this->spanProcessor = NoopSpanProcessor::getInstance(); + + break; + case 1: + $this->spanProcessor = $spanProcessors[0]; + + break; + default: + $this->spanProcessor = new MultiSpanProcessor(...$spanProcessors); + + break; + } + } + + public function hasShutdown(): bool + { + return null !== $this->shutdownResult; + } + + public function getIdGenerator(): IdGeneratorInterface + { + return $this->idGenerator; + } + + public function getResource(): ResourceInfo + { + return $this->resource; + } + + public function getSpanLimits(): SpanLimits + { + return $this->spanLimits; + } + + public function getSampler(): SamplerInterface + { + return $this->sampler; + } + + public function getSpanProcessor(): SpanProcessorInterface + { + return $this->spanProcessor; + } + + /** + * Returns `false` is the provider is already shutdown, otherwise `true`. + */ + public function shutdown(?CancellationInterface $cancellation = null): bool + { + return $this->shutdownResult ?? ($this->shutdownResult = $this->spanProcessor->shutdown($cancellation)); + } +} diff --git a/vendor/open-telemetry/sdk/_autoload.php b/vendor/open-telemetry/sdk/_autoload.php new file mode 100644 index 000000000..4e1de3450 --- /dev/null +++ b/vendor/open-telemetry/sdk/_autoload.php @@ -0,0 +1,5 @@ + + *
  • AWS Lambda: The function ARN. + * Take care not to use the "invoked ARN" directly but replace any + * alias suffix + * with the resolved function version, as the same runtime instance may be invokable with + * multiple different aliases.
  • + *
  • GCP: The URI of the resource
  • + *
  • Azure: The Fully Qualified Resource ID of the invoked function, + * not the function app, having the form + * `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. + * This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share + * a TracerProvider.
  • + * + * + * @example arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function + * @example //run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID + * @example /subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/ + */ + public const CLOUD_RESOURCE_ID = 'cloud.resource_id'; + + /** + * The ARN of an ECS cluster. + * + * @example arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster + */ + public const AWS_ECS_CLUSTER_ARN = 'aws.ecs.cluster.arn'; + + /** + * The Amazon Resource Name (ARN) of an ECS container instance. + * + * @example arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9 + */ + public const AWS_ECS_CONTAINER_ARN = 'aws.ecs.container.arn'; + + /** + * The launch type for an ECS task. + */ + public const AWS_ECS_LAUNCHTYPE = 'aws.ecs.launchtype'; + + /** + * The ARN of an ECS task definition. + * + * @example arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b + */ + public const AWS_ECS_TASK_ARN = 'aws.ecs.task.arn'; + + /** + * The task definition family this task definition is a member of. + * + * @example opentelemetry-family + */ + public const AWS_ECS_TASK_FAMILY = 'aws.ecs.task.family'; + + /** + * The revision for this task definition. + * + * @example 8 + * @example 26 + */ + public const AWS_ECS_TASK_REVISION = 'aws.ecs.task.revision'; + + /** + * The ARN of an EKS cluster. + * + * @example arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster + */ + public const AWS_EKS_CLUSTER_ARN = 'aws.eks.cluster.arn'; + + /** + * The Amazon Resource Name(s) (ARN) of the AWS log group(s). + * + * See the log group ARN format documentation. + * + * @example arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:* + */ + public const AWS_LOG_GROUP_ARNS = 'aws.log.group.arns'; + + /** + * The name(s) of the AWS log group(s) an application is writing to. + * + * Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. + * + * @example /aws/lambda/my-function + * @example opentelemetry-service + */ + public const AWS_LOG_GROUP_NAMES = 'aws.log.group.names'; + + /** + * The ARN(s) of the AWS log stream(s). + * + * See the log stream ARN format documentation. One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. + * + * @example arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b + */ + public const AWS_LOG_STREAM_ARNS = 'aws.log.stream.arns'; + + /** + * The name(s) of the AWS log stream(s) an application is writing to. + * + * @example logs/main/10838bed-421f-43ef-870a-f43feacbbb5b + */ + public const AWS_LOG_STREAM_NAMES = 'aws.log.stream.names'; + + /** + * The name of the Cloud Run execution being run for the Job, as set by the `CLOUD_RUN_EXECUTION` environment variable. + * + * @example job-name-xxxx + * @example sample-job-mdw84 + */ + public const GCP_CLOUD_RUN_JOB_EXECUTION = 'gcp.cloud_run.job.execution'; + + /** + * The index for a task within an execution as provided by the `CLOUD_RUN_TASK_INDEX` environment variable. + * + * @example 1 + */ + public const GCP_CLOUD_RUN_JOB_TASK_INDEX = 'gcp.cloud_run.job.task_index'; + + /** + * The hostname of a GCE instance. This is the full value of the default or custom hostname. + * + * @example my-host1234.example.com + * @example sample-vm.us-west1-b.c.my-project.internal + */ + public const GCP_GCE_INSTANCE_HOSTNAME = 'gcp.gce.instance.hostname'; + + /** + * The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the default internal DNS name. + * + * @example instance-1 + * @example my-vm-name + */ + public const GCP_GCE_INSTANCE_NAME = 'gcp.gce.instance.name'; + + /** + * Unique identifier for the application. + * + * @example 2daa2797-e42b-4624-9322-ec3f968df4da + */ + public const HEROKU_APP_ID = 'heroku.app.id'; + + /** + * Commit hash for the current release. + * + * @example e6134959463efd8966b20e75b913cafe3f5ec + */ + public const HEROKU_RELEASE_COMMIT = 'heroku.release.commit'; + + /** + * Time and date the release was created. + * + * @example 2022-10-23T18:00:42Z + */ + public const HEROKU_RELEASE_CREATION_TIMESTAMP = 'heroku.release.creation_timestamp'; + + /** + * The command used to run the container (i.e. the command name). + * + * If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. + * + * @example otelcontribcol + */ + public const CONTAINER_COMMAND = 'container.command'; + + /** + * All the command arguments (including the command/executable itself) run by the container. [2]. + * + * @example otelcontribcol, --config, config.yaml + */ + public const CONTAINER_COMMAND_ARGS = 'container.command_args'; + + /** + * The full command run by the container as a single string representing the full command. [2]. + * + * @example otelcontribcol --config config.yaml + */ + public const CONTAINER_COMMAND_LINE = 'container.command_line'; + + /** + * Container ID. Usually a UUID, as for example used to identify Docker containers. The UUID might be abbreviated. + * + * @example a3bf90e006b2 + */ + public const CONTAINER_ID = 'container.id'; + + /** + * Runtime specific image identifier. Usually a hash algorithm followed by a UUID. + * + * Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect API endpoint. + * K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. + * The ID is assinged by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes. + * + * @example sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f + */ + public const CONTAINER_IMAGE_ID = 'container.image.id'; + + /** + * Name of the image the container was built on. + * + * @example gcr.io/opentelemetry/operator + */ + public const CONTAINER_IMAGE_NAME = 'container.image.name'; + + /** + * Repo digests of the container image as provided by the container runtime. + * + * Docker and CRI report those under the `RepoDigests` field. + * + * @example example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb + * @example internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578 + */ + public const CONTAINER_IMAGE_REPO_DIGESTS = 'container.image.repo_digests'; + + /** + * Container image tags. An example can be found in Docker Image Inspect. Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. + * + * @example v1.27.1 + * @example 3.5.7-0 + */ + public const CONTAINER_IMAGE_TAGS = 'container.image.tags'; + + /** + * Container name used by container runtime. + * + * @example opentelemetry-autoconf + */ + public const CONTAINER_NAME = 'container.name'; + + /** + * The container runtime managing this container. + * + * @example docker + * @example containerd + * @example rkt + */ + public const CONTAINER_RUNTIME = 'container.runtime'; + + /** + * Name of the deployment environment (aka deployment tier). + * + * @example staging + * @example production + */ + public const DEPLOYMENT_ENVIRONMENT = 'deployment.environment'; + + /** + * A unique identifier representing the device. + * + * The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the vendor identifier. On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found here on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. + * + * @example 2ab2916d-a51f-4ac8-80ee-45ac31a28092 + */ + public const DEVICE_ID = 'device.id'; + + /** + * The name of the device manufacturer. + * + * The Android OS provides this field via Build. iOS apps SHOULD hardcode the value `Apple`. + * + * @example Apple + * @example Samsung + */ + public const DEVICE_MANUFACTURER = 'device.manufacturer'; + + /** + * The model identifier for the device. + * + * It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device. + * + * @example iPhone3,4 + * @example SM-G920F + */ + public const DEVICE_MODEL_IDENTIFIER = 'device.model.identifier'; + + /** + * The marketing name for the device model. + * + * It's recommended this value represents a human readable version of the device model rather than a machine readable alternative. + * + * @example iPhone 6s Plus + * @example Samsung Galaxy S6 + */ + public const DEVICE_MODEL_NAME = 'device.model.name'; + + /** + * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. + * + *
      + *
    • AWS Lambda: Use the (full) log stream name.
    • + *
    + * + * @example 2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de + */ + public const FAAS_INSTANCE = 'faas.instance'; + + /** + * The amount of memory available to the serverless function converted to Bytes. + * + * It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). + * + * @example 134217728 + */ + public const FAAS_MAX_MEMORY = 'faas.max_memory'; + + /** + * The name of the single function that this runtime instance executes. + * + * This is the name of the function as configured/deployed on the FaaS + * platform and is usually different from the name of the callback + * function (which may be stored in the + * `code.namespace`/`code.function` + * span attributes).For some cloud providers, the above definition is ambiguous. The following + * definition of function name MUST be used for this attribute + * (and consequently the span name) for the listed cloud providers/products:
      + *
    • Azure: The full name `/`, i.e., function app name + * followed by a forward slash followed by the function name (this form + * can also be seen in the resource JSON for the function). + * This means that a span attribute MUST be used, as an Azure function + * app can host multiple functions that would usually share + * a TracerProvider (see also the `cloud.resource_id` attribute).
    • + *
    + * + * @example my-function + * @example myazurefunctionapp/some-function-name + */ + public const FAAS_NAME = 'faas.name'; + + /** + * The immutable version of the function being executed. + * + * Depending on the cloud provider and platform, use:
      + *
    • AWS Lambda: The function version + * (an integer represented as a decimal string).
    • + *
    • Google Cloud Run (Services): The revision + * (i.e., the function name plus the revision suffix).
    • + *
    • Google Cloud Functions: The value of the + * `K_REVISION` environment variable.
    • + *
    • Azure Functions: Not applicable. Do not set this attribute.
    • + *
    + * + * @example 26 + * @example pinkfroid-00002 + */ + public const FAAS_VERSION = 'faas.version'; + + /** + * The CPU architecture the host system is running on. + */ + public const HOST_ARCH = 'host.arch'; + + /** + * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. + * + * @example fdbf79e8af94cb7f9e8df36789187052 + */ + public const HOST_ID = 'host.id'; + + /** + * VM image ID or host OS image ID. For Cloud, this value is from the provider. + * + * @example ami-07b06b442921831e5 + */ + public const HOST_IMAGE_ID = 'host.image.id'; + + /** + * Name of the VM image or OS install the host was instantiated from. + * + * @example infra-ami-eks-worker-node-7d4ec78312 + * @example CentOS-8-x86_64-1905 + */ + public const HOST_IMAGE_NAME = 'host.image.name'; + + /** + * The version string of the VM image or host OS as defined in Version Attributes. + * + * @example 0.1 + */ + public const HOST_IMAGE_VERSION = 'host.image.version'; + + /** + * Available IP addresses of the host, excluding loopback interfaces. + * + * IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the RFC 5952 format. + * + * @example 192.168.1.140 + * @example fe80::abc2:4a28:737a:609e + */ + public const HOST_IP = 'host.ip'; + + /** + * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. + * + * @example opentelemetry-test + */ + public const HOST_NAME = 'host.name'; + + /** + * Type of host. For Cloud, this must be the machine type. + * + * @example n1-standard-1 + */ + public const HOST_TYPE = 'host.type'; + + /** + * The amount of level 2 memory cache available to the processor (in Bytes). + * + * @example 12288000 + */ + public const HOST_CPU_CACHE_L2_SIZE = 'host.cpu.cache.l2.size'; + + /** + * Numeric value specifying the family or generation of the CPU. + * + * @example 6 + */ + public const HOST_CPU_FAMILY = 'host.cpu.family'; + + /** + * Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. + * + * @example 6 + */ + public const HOST_CPU_MODEL_ID = 'host.cpu.model.id'; + + /** + * Model designation of the processor. + * + * @example 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz + */ + public const HOST_CPU_MODEL_NAME = 'host.cpu.model.name'; + + /** + * Stepping or core revisions. + * + * @example 1 + */ + public const HOST_CPU_STEPPING = 'host.cpu.stepping'; + + /** + * Processor manufacturer identifier. A maximum 12-character string. + * + * CPUID command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string. + * + * @example GenuineIntel + */ + public const HOST_CPU_VENDOR_ID = 'host.cpu.vendor.id'; + + /** + * The name of the cluster. + * + * @example opentelemetry-cluster + */ + public const K8S_CLUSTER_NAME = 'k8s.cluster.name'; + + /** + * A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. + * + * K8s does not have support for obtaining a cluster ID. If this is ever + * added, we will recommend collecting the `k8s.cluster.uid` through the + * official APIs. In the meantime, we are able to use the `uid` of the + * `kube-system` namespace as a proxy for cluster ID. Read on for the + * rationale.Every object created in a K8s cluster is assigned a distinct UID. The + * `kube-system` namespace is used by Kubernetes itself and will exist + * for the lifetime of the cluster. Using the `uid` of the `kube-system` + * namespace is a reasonable proxy for the K8s ClusterID as it will only + * change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are + * UUIDs as standardized by + * ISO/IEC 9834-8 and ITU-T X.667. + * Which states:
    + * If generated according to one of the mechanisms defined in Rec.
    + * ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be + * different from all other UUIDs generated before 3603 A.D., or is + * extremely likely to be different (depending on the mechanism chosen).Therefore, UIDs between clusters should be extremely unlikely to + * conflict. + * + * @example 218fc5a9-a5f1-4b54-aa05-46717d0ab26d + */ + public const K8S_CLUSTER_UID = 'k8s.cluster.uid'; + + /** + * The name of the Node. + * + * @example node-1 + */ + public const K8S_NODE_NAME = 'k8s.node.name'; + + /** + * The UID of the Node. + * + * @example 1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2 + */ + public const K8S_NODE_UID = 'k8s.node.uid'; + + /** + * The name of the namespace that the pod is running in. + * + * @example default + */ + public const K8S_NAMESPACE_NAME = 'k8s.namespace.name'; + + /** + * The name of the Pod. + * + * @example opentelemetry-pod-autoconf + */ + public const K8S_POD_NAME = 'k8s.pod.name'; + + /** + * The UID of the Pod. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + */ + public const K8S_POD_UID = 'k8s.pod.uid'; + + /** + * The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). + * + * @example redis + */ + public const K8S_CONTAINER_NAME = 'k8s.container.name'; + + /** + * Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. + * + * @example 2 + */ + public const K8S_CONTAINER_RESTART_COUNT = 'k8s.container.restart_count'; + + /** + * The name of the ReplicaSet. + * + * @example opentelemetry + */ + public const K8S_REPLICASET_NAME = 'k8s.replicaset.name'; + + /** + * The UID of the ReplicaSet. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + */ + public const K8S_REPLICASET_UID = 'k8s.replicaset.uid'; + + /** + * The name of the Deployment. + * + * @example opentelemetry + */ + public const K8S_DEPLOYMENT_NAME = 'k8s.deployment.name'; + + /** + * The UID of the Deployment. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + */ + public const K8S_DEPLOYMENT_UID = 'k8s.deployment.uid'; + + /** + * The name of the StatefulSet. + * + * @example opentelemetry + */ + public const K8S_STATEFULSET_NAME = 'k8s.statefulset.name'; + + /** + * The UID of the StatefulSet. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + */ + public const K8S_STATEFULSET_UID = 'k8s.statefulset.uid'; + + /** + * The name of the DaemonSet. + * + * @example opentelemetry + */ + public const K8S_DAEMONSET_NAME = 'k8s.daemonset.name'; + + /** + * The UID of the DaemonSet. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + */ + public const K8S_DAEMONSET_UID = 'k8s.daemonset.uid'; + + /** + * The name of the Job. + * + * @example opentelemetry + */ + public const K8S_JOB_NAME = 'k8s.job.name'; + + /** + * The UID of the Job. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + */ + public const K8S_JOB_UID = 'k8s.job.uid'; + + /** + * The name of the CronJob. + * + * @example opentelemetry + */ + public const K8S_CRONJOB_NAME = 'k8s.cronjob.name'; + + /** + * The UID of the CronJob. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + */ + public const K8S_CRONJOB_UID = 'k8s.cronjob.uid'; + + /** + * The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. + * + * Follows OCI Image Manifest Specification, and specifically the Digest property. + * An example can be found in Example Image Manifest. + * + * @example sha256:e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4 + */ + public const OCI_MANIFEST_DIGEST = 'oci.manifest.digest'; + + /** + * Unique identifier for a particular build or compilation of the operating system. + * + * @example TQ3C.230805.001.B2 + * @example 20E247 + * @example 22621 + */ + public const OS_BUILD_ID = 'os.build_id'; + + /** + * Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. + * + * @example Microsoft Windows [Version 10.0.18363.778] + * @example Ubuntu 18.04.1 LTS + */ + public const OS_DESCRIPTION = 'os.description'; + + /** + * Human readable operating system name. + * + * @example iOS + * @example Android + * @example Ubuntu + */ + public const OS_NAME = 'os.name'; + + /** + * The operating system type. + */ + public const OS_TYPE = 'os.type'; + + /** + * The version string of the operating system as defined in Version Attributes. + * + * @example 14.2.1 + * @example 18.04.1 + */ + public const OS_VERSION = 'os.version'; + + /** + * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. + * + * @example cmd/otelcol + */ + public const PROCESS_COMMAND = 'process.command'; + + /** + * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. + * + * @example cmd/otecol + * @example --config=config.yaml + */ + public const PROCESS_COMMAND_ARGS = 'process.command_args'; + + /** + * The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. + * + * @example C:\cmd\otecol --config="my directory\config.yaml" + */ + public const PROCESS_COMMAND_LINE = 'process.command_line'; + + /** + * The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. + * + * @example otelcol + */ + public const PROCESS_EXECUTABLE_NAME = 'process.executable.name'; + + /** + * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. + * + * @example /usr/bin/cmd/otelcol + */ + public const PROCESS_EXECUTABLE_PATH = 'process.executable.path'; + + /** + * The username of the user that owns the process. + * + * @example root + */ + public const PROCESS_OWNER = 'process.owner'; + + /** + * Parent Process identifier (PID). + * + * @example 111 + */ + public const PROCESS_PARENT_PID = 'process.parent_pid'; + + /** + * Process identifier (PID). + * + * @example 1234 + */ + public const PROCESS_PID = 'process.pid'; + + /** + * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. + * + * @example Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0 + */ + public const PROCESS_RUNTIME_DESCRIPTION = 'process.runtime.description'; + + /** + * The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. + * + * @example OpenJDK Runtime Environment + */ + public const PROCESS_RUNTIME_NAME = 'process.runtime.name'; + + /** + * The version of the runtime of this process, as returned by the runtime without modification. + * + * @example 14.0.2 + */ + public const PROCESS_RUNTIME_VERSION = 'process.runtime.version'; + + /** + * Logical name of the service. + * + * MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with `process.executable.name`, e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. + * + * @example shoppingcart + */ + public const SERVICE_NAME = 'service.name'; + + /** + * The version string of the service API or implementation. The format is not defined by these conventions. + * + * @example 2.0.0 + * @example a01dbef8a + */ + public const SERVICE_VERSION = 'service.version'; + + /** + * The string ID of the service instance. + * + * MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). + * + * @example my-k8s-pod-deployment-1 + * @example 627cc493-f310-47de-96bd-71410b7dec09 + */ + public const SERVICE_INSTANCE_ID = 'service.instance.id'; + + /** + * A namespace for `service.name`. + * + * A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. + * + * @example Shop + */ + public const SERVICE_NAMESPACE = 'service.namespace'; + + /** + * The language of the telemetry SDK. + */ + public const TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language'; + + /** + * The name of the telemetry SDK as defined above. + * + * The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`. + * If another SDK, like a fork or a vendor-provided implementation, is used, this SDK MUST set the + * `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point + * or another suitable identifier depending on the language. + * The identifier `opentelemetry` is reserved and MUST NOT be used in this case. + * All custom identifiers SHOULD be stable across different versions of an implementation. + * + * @example opentelemetry + */ + public const TELEMETRY_SDK_NAME = 'telemetry.sdk.name'; + + /** + * The version string of the telemetry SDK. + * + * @example 1.2.3 + */ + public const TELEMETRY_SDK_VERSION = 'telemetry.sdk.version'; + + /** + * The name of the auto instrumentation agent or distribution, if used. + * + * Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to + * a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. + * + * @example parts-unlimited-java + */ + public const TELEMETRY_DISTRO_NAME = 'telemetry.distro.name'; + + /** + * The version string of the auto instrumentation agent or distribution, if used. + * + * @example 1.2.3 + */ + public const TELEMETRY_DISTRO_VERSION = 'telemetry.distro.version'; + + /** + * Additional description of the web engine (e.g. detailed version and edition information). + * + * @example WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final + */ + public const WEBENGINE_DESCRIPTION = 'webengine.description'; + + /** + * The name of the web engine. + * + * @example WildFly + */ + public const WEBENGINE_NAME = 'webengine.name'; + + /** + * The version of the web engine. + * + * @example 21.0.0 + */ + public const WEBENGINE_VERSION = 'webengine.version'; + + /** + * The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). + * + * @example io.opentelemetry.contrib.mongodb + */ + public const OTEL_SCOPE_NAME = 'otel.scope.name'; + + /** + * The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). + * + * @example 1.0.0 + */ + public const OTEL_SCOPE_VERSION = 'otel.scope.version'; + + /** + * Deprecated, use the `otel.scope.name` attribute. + * + * @deprecated Deprecated, use the `otel.scope.name` attribute.. + * @example io.opentelemetry.contrib.mongodb + */ + public const OTEL_LIBRARY_NAME = 'otel.library.name'; + + /** + * Deprecated, use the `otel.scope.version` attribute. + * + * @deprecated Deprecated, use the `otel.scope.version` attribute.. + * @example 1.0.0 + */ + public const OTEL_LIBRARY_VERSION = 'otel.library.version'; + + /** + * @deprecated Use USER_AGENT_ORIGINAL + */ + public const BROWSER_USER_AGENT = 'browser.user_agent'; + + /** + * @deprecated Use CLOUD_RESOURCE_ID + */ + public const FAAS_ID = 'faas.id'; + + /** + * @deprecated Use TELEMETRY_DISTRO_VERSION + */ + public const TELEMETRY_AUTO_VERSION = 'telemetry.auto.version'; + + /** + * @deprecated Use CONTAINER_IMAGE_TAGS + */ + public const CONTAINER_IMAGE_TAG = 'container.image.tag'; +} diff --git a/vendor/open-telemetry/sem-conv/TraceAttributes.php b/vendor/open-telemetry/sem-conv/TraceAttributes.php new file mode 100644 index 000000000..4329db5f9 --- /dev/null +++ b/vendor/open-telemetry/sem-conv/TraceAttributes.php @@ -0,0 +1,2052 @@ + + *
  • Host identifier of the request target + * if it's sent in absolute-form
  • + *
  • Host identifier of the `Host` header
  • + * + * If an HTTP client request is explicitly made to an IP address, e.g. `http://x.x.x.x:8080`, then + * `server.address` SHOULD be the IP address `x.x.x.x`. A DNS lookup SHOULD NOT be used. + * + * @example example.com + * @example 10.1.2.80 + * @example /tmp/my.sock + */ + public const SERVER_ADDRESS = 'server.address'; + + /** + * Port identifier of the "URI origin" HTTP request is sent to. + * + * When request target is absolute URI, `server.port` MUST match URI port identifier, otherwise it MUST match `Host` header port identifier. + * + * @example 80 + * @example 8080 + * @example 443 + */ + public const SERVER_PORT = 'server.port'; + + /** + * The matched route (path template in the format used by the respective server framework). See note below. + * + * MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. + * SHOULD include the application root if there is one. + * + * @example /users/:userID? + * @example {controller}/{action}/{id?} + */ + public const HTTP_ROUTE = 'http.route'; + + /** + * The URI scheme component identifying the used protocol. + * + * @example http + * @example https + */ + public const URL_SCHEME = 'url.scheme'; + + /** + * The domain identifies the business context for the events. + * + * Events across different domains may have same `event.name`, yet be + * unrelated events. + */ + public const EVENT_DOMAIN = 'event.domain'; + + /** + * The name identifies the event. + * + * @example click + * @example exception + */ + public const EVENT_NAME = 'event.name'; + + /** + * A unique identifier for the Log Record. + * + * If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values. + * The id MAY be an Universally Unique Lexicographically Sortable Identifier (ULID), but other identifiers (e.g. UUID) may be used as needed. + * + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + public const LOG_RECORD_UID = 'log.record.uid'; + + /** + * The unique identifier of the feature flag. + * + * @example logo-color + */ + public const FEATURE_FLAG_KEY = 'feature_flag.key'; + + /** + * The name of the service provider that performs the flag evaluation. + * + * @example Flag Manager + */ + public const FEATURE_FLAG_PROVIDER_NAME = 'feature_flag.provider_name'; + + /** + * SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. + * + * A semantic identifier, commonly referred to as a variant, provides a means + * for referring to a value without including the value itself. This can + * provide additional context for understanding the meaning behind a value. + * For example, the variant `red` maybe be used for the value `#c05543`.A stringified version of the value can be used in situations where a + * semantic identifier is unavailable. String representation of the value + * should be determined by the implementer. + * + * @example red + * @example true + * @example on + */ + public const FEATURE_FLAG_VARIANT = 'feature_flag.variant'; + + /** + * The stream associated with the log. See below for a list of well-known values. + */ + public const LOG_IOSTREAM = 'log.iostream'; + + /** + * The basename of the file. + * + * @example audit.log + */ + public const LOG_FILE_NAME = 'log.file.name'; + + /** + * The basename of the file, with symlinks resolved. + * + * @example uuid.log + */ + public const LOG_FILE_NAME_RESOLVED = 'log.file.name_resolved'; + + /** + * The full path to the file. + * + * @example /var/log/mysql/audit.log + */ + public const LOG_FILE_PATH = 'log.file.path'; + + /** + * The full path to the file, with symlinks resolved. + * + * @example /var/lib/docker/uuid.log + */ + public const LOG_FILE_PATH_RESOLVED = 'log.file.path_resolved'; + + /** + * The name of the connection pool; unique within the instrumented application. In case the connection pool implementation does not provide a name, then the db.connection_string should be used. + * + * @example myDataSource + */ + public const POOL_NAME = 'pool.name'; + + /** + * The state of a connection in the pool. + * + * @example idle + */ + public const STATE = 'state'; + + /** + * Name of the buffer pool. + * + * Pool names are generally obtained via BufferPoolMXBean#getName(). + * + * @example mapped + * @example direct + */ + public const JVM_BUFFER_POOL_NAME = 'jvm.buffer.pool.name'; + + /** + * Name of the memory pool. + * + * Pool names are generally obtained via MemoryPoolMXBean#getName(). + * + * @example G1 Old Gen + * @example G1 Eden space + * @example G1 Survivor Space + */ + public const JVM_MEMORY_POOL_NAME = 'jvm.memory.pool.name'; + + /** + * The type of memory. + * + * @example heap + * @example non_heap + */ + public const JVM_MEMORY_TYPE = 'jvm.memory.type'; + + /** + * OSI transport layer or inter-process communication method. + * + * The value SHOULD be normalized to lowercase.Consider always setting the transport when setting a port number, since + * a port number is ambiguous without knowing the transport, for example + * different processes could be listening on TCP port 12345 and UDP port 12345. + * + * @example tcp + * @example udp + */ + public const NETWORK_TRANSPORT = 'network.transport'; + + /** + * OSI network layer or non-OSI equivalent. + * + * The value SHOULD be normalized to lowercase. + * + * @example ipv4 + * @example ipv6 + */ + public const NETWORK_TYPE = 'network.type'; + + /** + * The name of the (logical) method being called, must be equal to the $method part in the span name. + * + * This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). + * + * @example exampleMethod + */ + public const RPC_METHOD = 'rpc.method'; + + /** + * The full (logical) name of the service being called, including its package name, if applicable. + * + * This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). + * + * @example myservice.EchoService + */ + public const RPC_SERVICE = 'rpc.service'; + + /** + * A string identifying the remoting system. See below for a list of well-known identifiers. + */ + public const RPC_SYSTEM = 'rpc.system'; + + /** + * The device identifier. + * + * @example (identifier) + */ + public const SYSTEM_DEVICE = 'system.device'; + + /** + * The logical CPU number [0..n-1]. + * + * @example 1 + */ + public const SYSTEM_CPU_LOGICAL_NUMBER = 'system.cpu.logical_number'; + + /** + * The state of the CPU. + * + * @example idle + * @example interrupt + */ + public const SYSTEM_CPU_STATE = 'system.cpu.state'; + + /** + * The memory state. + * + * @example free + * @example cached + */ + public const SYSTEM_MEMORY_STATE = 'system.memory.state'; + + /** + * The paging access direction. + * + * @example in + */ + public const SYSTEM_PAGING_DIRECTION = 'system.paging.direction'; + + /** + * The memory paging state. + * + * @example free + */ + public const SYSTEM_PAGING_STATE = 'system.paging.state'; + + /** + * The memory paging type. + * + * @example minor + */ + public const SYSTEM_PAGING_TYPE = 'system.paging.type'; + + /** + * The disk operation direction. + * + * @example read + */ + public const SYSTEM_DISK_DIRECTION = 'system.disk.direction'; + + /** + * The filesystem mode. + * + * @example rw, ro + */ + public const SYSTEM_FILESYSTEM_MODE = 'system.filesystem.mode'; + + /** + * The filesystem mount path. + * + * @example /mnt/data + */ + public const SYSTEM_FILESYSTEM_MOUNTPOINT = 'system.filesystem.mountpoint'; + + /** + * The filesystem state. + * + * @example used + */ + public const SYSTEM_FILESYSTEM_STATE = 'system.filesystem.state'; + + /** + * The filesystem type. + * + * @example ext4 + */ + public const SYSTEM_FILESYSTEM_TYPE = 'system.filesystem.type'; + + /** + * . + * + * @example transmit + */ + public const SYSTEM_NETWORK_DIRECTION = 'system.network.direction'; + + /** + * A stateless protocol MUST NOT set this attribute. + * + * @example close_wait + */ + public const SYSTEM_NETWORK_STATE = 'system.network.state'; + + /** + * The process state, e.g., Linux Process State Codes. + * + * @example running + */ + public const SYSTEM_PROCESSES_STATUS = 'system.processes.status'; + + /** + * Local address of the network connection - IP address or Unix domain socket name. + * + * @example 10.1.2.80 + * @example /tmp/my.sock + */ + public const NETWORK_LOCAL_ADDRESS = 'network.local.address'; + + /** + * Local port number of the network connection. + * + * @example 65123 + */ + public const NETWORK_LOCAL_PORT = 'network.local.port'; + + /** + * Peer address of the network connection - IP address or Unix domain socket name. + * + * @example 10.1.2.80 + * @example /tmp/my.sock + */ + public const NETWORK_PEER_ADDRESS = 'network.peer.address'; + + /** + * Peer port number of the network connection. + * + * @example 65123 + */ + public const NETWORK_PEER_PORT = 'network.peer.port'; + + /** + * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. + * + * @example DE + */ + public const NETWORK_CARRIER_ICC = 'network.carrier.icc'; + + /** + * The mobile carrier country code. + * + * @example 310 + */ + public const NETWORK_CARRIER_MCC = 'network.carrier.mcc'; + + /** + * The mobile carrier network code. + * + * @example 001 + */ + public const NETWORK_CARRIER_MNC = 'network.carrier.mnc'; + + /** + * The name of the mobile carrier. + * + * @example sprint + */ + public const NETWORK_CARRIER_NAME = 'network.carrier.name'; + + /** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * + * @example LTE + */ + public const NETWORK_CONNECTION_SUBTYPE = 'network.connection.subtype'; + + /** + * The internet connection type. + * + * @example wifi + */ + public const NETWORK_CONNECTION_TYPE = 'network.connection.type'; + + /** + * Deprecated, use `http.request.method` instead. + * + * @deprecated Deprecated, use `http.request.method` instead.. + * @example GET + * @example POST + * @example HEAD + */ + public const HTTP_METHOD = 'http.method'; + + /** + * Deprecated, use `http.request.body.size` instead. + * + * @deprecated Deprecated, use `http.request.body.size` instead.. + * @example 3495 + */ + public const HTTP_REQUEST_CONTENT_LENGTH = 'http.request_content_length'; + + /** + * Deprecated, use `http.response.body.size` instead. + * + * @deprecated Deprecated, use `http.response.body.size` instead.. + * @example 3495 + */ + public const HTTP_RESPONSE_CONTENT_LENGTH = 'http.response_content_length'; + + /** + * Deprecated, use `url.scheme` instead. + * + * @deprecated Deprecated, use `url.scheme` instead.. + * @example http + * @example https + */ + public const HTTP_SCHEME = 'http.scheme'; + + /** + * Deprecated, use `http.response.status_code` instead. + * + * @deprecated Deprecated, use `http.response.status_code` instead.. + * @example 200 + */ + public const HTTP_STATUS_CODE = 'http.status_code'; + + /** + * Deprecated, use `url.path` and `url.query` instead. + * + * @deprecated Deprecated, use `url.path` and `url.query` instead.. + * @example /search?q=OpenTelemetry#SemConv + */ + public const HTTP_TARGET = 'http.target'; + + /** + * Deprecated, use `url.full` instead. + * + * @deprecated Deprecated, use `url.full` instead.. + * @example https://www.foo.bar/search?q=OpenTelemetry#SemConv + */ + public const HTTP_URL = 'http.url'; + + /** + * The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. + * + * @example 3495 + */ + public const HTTP_REQUEST_BODY_SIZE = 'http.request.body.size'; + + /** + * Original HTTP method sent by the client in the request line. + * + * @example GeT + * @example ACL + * @example foo + */ + public const HTTP_REQUEST_METHOD_ORIGINAL = 'http.request.method_original'; + + /** + * The ordinal number of request resending attempt (for any reason, including redirects). + * + * The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). + * + * @example 3 + */ + public const HTTP_RESEND_COUNT = 'http.resend_count'; + + /** + * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size. + * + * @example 3495 + */ + public const HTTP_RESPONSE_BODY_SIZE = 'http.response.body.size'; + + /** + * A unique id to identify a session. + * + * @example 00112233-4455-6677-8899-aabbccddeeff + */ + public const SESSION_ID = 'session.id'; + + /** + * Source address - domain name if available without reverse DNS lookup, otherwise IP address or Unix domain socket name. + * + * When observed from the destination side, and when communicating through an intermediary, `source.address` SHOULD represent the source address behind any intermediaries (e.g. proxies) if it's available. + * + * @example source.example.com + * @example 10.1.2.80 + * @example /tmp/my.sock + */ + public const SOURCE_ADDRESS = 'source.address'; + + /** + * Source port number. + * + * @example 3389 + * @example 2888 + */ + public const SOURCE_PORT = 'source.port'; + + /** + * The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). + * + * This may be different from `cloud.resource_id` if an alias is involved. + * + * @example arn:aws:lambda:us-east-1:123456:function:myfunction:myalias + */ + public const AWS_LAMBDA_INVOKED_ARN = 'aws.lambda.invoked_arn'; + + /** + * The event_id uniquely identifies the event. + * + * @example 123e4567-e89b-12d3-a456-426614174000 + * @example 0001 + */ + public const CLOUDEVENTS_EVENT_ID = 'cloudevents.event_id'; + + /** + * The source identifies the context in which an event happened. + * + * @example https://github.com/cloudevents + * @example /cloudevents/spec/pull/123 + * @example my-service + */ + public const CLOUDEVENTS_EVENT_SOURCE = 'cloudevents.event_source'; + + /** + * The version of the CloudEvents specification which the event uses. + * + * @example 1.0 + */ + public const CLOUDEVENTS_EVENT_SPEC_VERSION = 'cloudevents.event_spec_version'; + + /** + * The subject of the event in the context of the event producer (identified by source). + * + * @example mynewfile.jpg + */ + public const CLOUDEVENTS_EVENT_SUBJECT = 'cloudevents.event_subject'; + + /** + * The event_type contains a value describing the type of event related to the originating occurrence. + * + * @example com.github.pull_request.opened + * @example com.example.object.deleted.v2 + */ + public const CLOUDEVENTS_EVENT_TYPE = 'cloudevents.event_type'; + + /** + * Parent-child Reference type. + * + * The causal relationship between a child Span and a parent Span. + */ + public const OPENTRACING_REF_TYPE = 'opentracing.ref_type'; + + /** + * The connection string used to connect to the database. It is recommended to remove embedded credentials. + * + * @example Server=(localdb)\v11.0;Integrated Security=true; + */ + public const DB_CONNECTION_STRING = 'db.connection_string'; + + /** + * The fully-qualified class name of the Java Database Connectivity (JDBC) driver used to connect. + * + * @example org.postgresql.Driver + * @example com.microsoft.sqlserver.jdbc.SQLServerDriver + */ + public const DB_JDBC_DRIVER_CLASSNAME = 'db.jdbc.driver_classname'; + + /** + * This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). + * + * In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). + * + * @example customers + * @example main + */ + public const DB_NAME = 'db.name'; + + /** + * The name of the operation being executed, e.g. the MongoDB command name such as `findAndModify`, or the SQL keyword. + * + * When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. + * + * @example findAndModify + * @example HMSET + * @example SELECT + */ + public const DB_OPERATION = 'db.operation'; + + /** + * The database statement being executed. + * + * @example SELECT * FROM wuser_table + * @example SET mykey "WuValue" + */ + public const DB_STATEMENT = 'db.statement'; + + /** + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + */ + public const DB_SYSTEM = 'db.system'; + + /** + * Username for accessing the database. + * + * @example readonly_user + * @example reporting_user + */ + public const DB_USER = 'db.user'; + + /** + * The Microsoft SQL Server instance name connecting to. This name is used to determine the port of a named instance. + * + * If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). + * + * @example MSSQLSERVER + */ + public const DB_MSSQL_INSTANCE_NAME = 'db.mssql.instance_name'; + + /** + * The consistency level of the query. Based on consistency values from CQL. + */ + public const DB_CASSANDRA_CONSISTENCY_LEVEL = 'db.cassandra.consistency_level'; + + /** + * The data center of the coordinating node for a query. + * + * @example us-west-2 + */ + public const DB_CASSANDRA_COORDINATOR_DC = 'db.cassandra.coordinator.dc'; + + /** + * The ID of the coordinating node for a query. + * + * @example be13faa2-8574-4d71-926d-27f16cf8a7af + */ + public const DB_CASSANDRA_COORDINATOR_ID = 'db.cassandra.coordinator.id'; + + /** + * Whether or not the query is idempotent. + */ + public const DB_CASSANDRA_IDEMPOTENCE = 'db.cassandra.idempotence'; + + /** + * The fetch size used for paging, i.e. how many rows will be returned at once. + * + * @example 5000 + */ + public const DB_CASSANDRA_PAGE_SIZE = 'db.cassandra.page_size'; + + /** + * The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. + * + * @example 2 + */ + public const DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = 'db.cassandra.speculative_execution_count'; + + /** + * The name of the primary table that the operation is acting upon, including the keyspace name (if applicable). + * + * This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. + * + * @example mytable + */ + public const DB_CASSANDRA_TABLE = 'db.cassandra.table'; + + /** + * The index of the database being accessed as used in the `SELECT` command, provided as an integer. To be used instead of the generic `db.name` attribute. + * + * @example 1 + * @example 15 + */ + public const DB_REDIS_DATABASE_INDEX = 'db.redis.database_index'; + + /** + * The collection being accessed within the database stated in `db.name`. + * + * @example customers + * @example products + */ + public const DB_MONGODB_COLLECTION = 'db.mongodb.collection'; + + /** + * Represents the identifier of an Elasticsearch cluster. + * + * @example e9106fc68e3044f0b1475b04bf4ffd5f + */ + public const DB_ELASTICSEARCH_CLUSTER_NAME = 'db.elasticsearch.cluster.name'; + + /** + * Represents the human-readable identifier of the node/instance to which a request was routed. + * + * @example instance-0000000001 + */ + public const DB_ELASTICSEARCH_NODE_NAME = 'db.elasticsearch.node.name'; + + /** + * Absolute URL describing a network resource according to RFC3986. + * + * For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. + * `url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password should be redacted and attribute's value should be `https://REDACTED:REDACTED@www.example.com/`. + * `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. + * + * @example https://localhost:9200/index/_search?q=user.id:kimchy + */ + public const URL_FULL = 'url.full'; + + /** + * The name of the primary table that the operation is acting upon, including the database name (if applicable). + * + * It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. + * + * @example public.users + * @example customers + */ + public const DB_SQL_TABLE = 'db.sql.table'; + + /** + * Unique Cosmos client instance id. + * + * @example 3ba4827d-4422-483f-b59f-85b74211c11d + */ + public const DB_COSMOSDB_CLIENT_ID = 'db.cosmosdb.client_id'; + + /** + * Cosmos client connection mode. + */ + public const DB_COSMOSDB_CONNECTION_MODE = 'db.cosmosdb.connection_mode'; + + /** + * Cosmos DB container name. + * + * @example anystring + */ + public const DB_COSMOSDB_CONTAINER = 'db.cosmosdb.container'; + + /** + * CosmosDB Operation Type. + */ + public const DB_COSMOSDB_OPERATION_TYPE = 'db.cosmosdb.operation_type'; + + /** + * RU consumed for that operation. + * + * @example 46.18 + * @example 1.0 + */ + public const DB_COSMOSDB_REQUEST_CHARGE = 'db.cosmosdb.request_charge'; + + /** + * Request payload size in bytes. + */ + public const DB_COSMOSDB_REQUEST_CONTENT_LENGTH = 'db.cosmosdb.request_content_length'; + + /** + * Cosmos DB status code. + * + * @example 200 + * @example 201 + */ + public const DB_COSMOSDB_STATUS_CODE = 'db.cosmosdb.status_code'; + + /** + * Cosmos DB sub status code. + * + * @example 1000 + * @example 1002 + */ + public const DB_COSMOSDB_SUB_STATUS_CODE = 'db.cosmosdb.sub_status_code'; + + /** + * Full user-agent string is generated by Cosmos DB SDK. + * + * The user-agent value is generated by SDK which is a combination of<br> `sdk_version` : Current version of SDK. e.g. 'cosmos-netstandard-sdk/3.23.0'<br> `direct_pkg_version` : Direct package version used by Cosmos DB SDK. e.g. '3.23.1'<br> `number_of_client_instances` : Number of cosmos client instances created by the application. e.g. '1'<br> `type_of_machine_architecture` : Machine architecture. e.g. 'X64'<br> `operating_system` : Operating System. e.g. 'Linux 5.4.0-1098-azure 104 18'<br> `runtime_framework` : Runtime Framework. e.g. '.NET Core 3.1.32'<br> `failover_information` : Generated key to determine if region failover enabled. + * Format Reg-{D (Disabled discovery)}-S(application region)|L(List of preferred regions)|N(None, user did not configure it). + * Default value is "NS". + * + * @example cosmos-netstandard-sdk/3.23.0\|3.23.1\|1\|X64\|Linux 5.4.0-1098-azure 104 18\|.NET Core 3.1.32\|S\| + */ + public const USER_AGENT_ORIGINAL = 'user_agent.original'; + + /** + * Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. + */ + public const OTEL_STATUS_CODE = 'otel.status_code'; + + /** + * Description of the Status if it has a value, otherwise not set. + * + * @example resource not found + */ + public const OTEL_STATUS_DESCRIPTION = 'otel.status_description'; + + /** + * Cloud provider-specific native identifier of the monitored cloud resource (e.g. an ARN on AWS, a fully qualified resource ID on Azure, a full resource name on GCP). + * + * On some cloud providers, it may not be possible to determine the full ID at startup, + * so it may be necessary to set `cloud.resource_id` as a span attribute instead.The exact value to use for `cloud.resource_id` depends on the cloud provider. + * The following well-known definitions MUST be used if you set this attribute and they apply:
      + *
    • AWS Lambda: The function ARN. + * Take care not to use the "invoked ARN" directly but replace any + * alias suffix + * with the resolved function version, as the same runtime instance may be invokable with + * multiple different aliases.
    • + *
    • GCP: The URI of the resource
    • + *
    • Azure: The Fully Qualified Resource ID of the invoked function, + * not the function app, having the form + * `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. + * This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share + * a TracerProvider.
    • + *
    + * + * @example arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function + * @example //run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID + * @example /subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/ + */ + public const CLOUD_RESOURCE_ID = 'cloud.resource_id'; + + /** + * The invocation ID of the current function invocation. + * + * @example af9d5aa4-a685-4c5f-a22b-444f80b3cc28 + */ + public const FAAS_INVOCATION_ID = 'faas.invocation_id'; + + /** + * The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. + * + * @example myBucketName + * @example myDbName + */ + public const FAAS_DOCUMENT_COLLECTION = 'faas.document.collection'; + + /** + * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. + * + * @example myFile.txt + * @example myTableName + */ + public const FAAS_DOCUMENT_NAME = 'faas.document.name'; + + /** + * Describes the type of the operation that was performed on the data. + */ + public const FAAS_DOCUMENT_OPERATION = 'faas.document.operation'; + + /** + * A string containing the time when the data was accessed in the ISO 8601 format expressed in UTC. + * + * @example 2020-01-23T13:47:06Z + */ + public const FAAS_DOCUMENT_TIME = 'faas.document.time'; + + /** + * The URI path component. + * + * When missing, the value is assumed to be `/` + * + * @example /search + */ + public const URL_PATH = 'url.path'; + + /** + * The URI query component. + * + * Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. + * + * @example q=OpenTelemetry + */ + public const URL_QUERY = 'url.query'; + + /** + * The number of messages sent, received, or processed in the scope of the batching operation. + * + * Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. + * + * @example 1 + * @example 2 + */ + public const MESSAGING_BATCH_MESSAGE_COUNT = 'messaging.batch.message_count'; + + /** + * A unique identifier for the client that consumes or produces a message. + * + * @example client-5 + * @example myhost@8742@s8083jm + */ + public const MESSAGING_CLIENT_ID = 'messaging.client_id'; + + /** + * A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). + */ + public const MESSAGING_DESTINATION_ANONYMOUS = 'messaging.destination.anonymous'; + + /** + * The message destination name. + * + * Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If + * the broker does not have such notion, the destination name SHOULD uniquely identify the broker. + * + * @example MyQueue + * @example MyTopic + */ + public const MESSAGING_DESTINATION_NAME = 'messaging.destination.name'; + + /** + * Low cardinality representation of the messaging destination name. + * + * Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. + * + * @example /customers/{customerId} + */ + public const MESSAGING_DESTINATION_TEMPLATE = 'messaging.destination.template'; + + /** + * A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. + */ + public const MESSAGING_DESTINATION_TEMPORARY = 'messaging.destination.temporary'; + + /** + * The size of the message body in bytes. + * + * This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed + * body size should be used. + * + * @example 1439 + */ + public const MESSAGING_MESSAGE_BODY_SIZE = 'messaging.message.body.size'; + + /** + * The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". + * + * @example MyConversationId + */ + public const MESSAGING_MESSAGE_CONVERSATION_ID = 'messaging.message.conversation_id'; + + /** + * The size of the message body and metadata in bytes. + * + * This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed + * size should be used. + * + * @example 2738 + */ + public const MESSAGING_MESSAGE_ENVELOPE_SIZE = 'messaging.message.envelope.size'; + + /** + * A value used by the messaging system as an identifier for the message, represented as a string. + * + * @example 452a7c7c7c7048c2f887f61572b18fc2 + */ + public const MESSAGING_MESSAGE_ID = 'messaging.message.id'; + + /** + * A string identifying the kind of messaging operation as defined in the Operation names section above. + * + * If a custom value is used, it MUST be of low cardinality. + */ + public const MESSAGING_OPERATION = 'messaging.operation'; + + /** + * A string identifying the messaging system. + * + * @example kafka + * @example rabbitmq + * @example rocketmq + * @example activemq + * @example AmazonSQS + */ + public const MESSAGING_SYSTEM = 'messaging.system'; + + /** + * A string containing the schedule period as Cron Expression. + * + * @example 0/5 * * * ? * + */ + public const FAAS_CRON = 'faas.cron'; + + /** + * A string containing the function invocation time in the ISO 8601 format expressed in UTC. + * + * @example 2020-01-23T13:47:06Z + */ + public const FAAS_TIME = 'faas.time'; + + /** + * A boolean that is true if the serverless function is executed for the first time (aka cold-start). + */ + public const FAAS_COLDSTART = 'faas.coldstart'; + + /** + * The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. + * + * @example 79b9da39-b7ae-508a-a6bc-864b2829c622 + * @example C9ER4AJX75574TDJ + */ + public const AWS_REQUEST_ID = 'aws.request_id'; + + /** + * The value of the `AttributesToGet` request parameter. + * + * @example lives + * @example id + */ + public const AWS_DYNAMODB_ATTRIBUTES_TO_GET = 'aws.dynamodb.attributes_to_get'; + + /** + * The value of the `ConsistentRead` request parameter. + */ + public const AWS_DYNAMODB_CONSISTENT_READ = 'aws.dynamodb.consistent_read'; + + /** + * The JSON-serialized value of each item in the `ConsumedCapacity` response field. + * + * @example { "CapacityUnits": number, "GlobalSecondaryIndexes": { "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table": { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number }, "TableName": "string", "WriteCapacityUnits": number } + */ + public const AWS_DYNAMODB_CONSUMED_CAPACITY = 'aws.dynamodb.consumed_capacity'; + + /** + * The value of the `IndexName` request parameter. + * + * @example name_to_group + */ + public const AWS_DYNAMODB_INDEX_NAME = 'aws.dynamodb.index_name'; + + /** + * The JSON-serialized value of the `ItemCollectionMetrics` response field. + * + * @example { "string" : [ { "ItemCollectionKey": { "string" : { "B": blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ], "NULL": boolean, "S": "string", "SS": [ "string" ] } }, "SizeEstimateRangeGB": [ number ] } ] } + */ + public const AWS_DYNAMODB_ITEM_COLLECTION_METRICS = 'aws.dynamodb.item_collection_metrics'; + + /** + * The value of the `Limit` request parameter. + * + * @example 10 + */ + public const AWS_DYNAMODB_LIMIT = 'aws.dynamodb.limit'; + + /** + * The value of the `ProjectionExpression` request parameter. + * + * @example Title + * @example Title, Price, Color + * @example Title, Description, RelatedItems, ProductReviews + */ + public const AWS_DYNAMODB_PROJECTION = 'aws.dynamodb.projection'; + + /** + * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. + * + * @example 1.0 + * @example 2.0 + */ + public const AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = 'aws.dynamodb.provisioned_read_capacity'; + + /** + * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. + * + * @example 1.0 + * @example 2.0 + */ + public const AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = 'aws.dynamodb.provisioned_write_capacity'; + + /** + * The value of the `Select` request parameter. + * + * @example ALL_ATTRIBUTES + * @example COUNT + */ + public const AWS_DYNAMODB_SELECT = 'aws.dynamodb.select'; + + /** + * The keys in the `RequestItems` object field. + * + * @example Users + * @example Cats + */ + public const AWS_DYNAMODB_TABLE_NAMES = 'aws.dynamodb.table_names'; + + /** + * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. + * + * @example { "IndexName": "string", "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits": number } } + */ + public const AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = 'aws.dynamodb.global_secondary_indexes'; + + /** + * The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. + * + * @example { "IndexArn": "string", "IndexName": "string", "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } } + */ + public const AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = 'aws.dynamodb.local_secondary_indexes'; + + /** + * The value of the `ExclusiveStartTableName` request parameter. + * + * @example Users + * @example CatsTable + */ + public const AWS_DYNAMODB_EXCLUSIVE_START_TABLE = 'aws.dynamodb.exclusive_start_table'; + + /** + * The the number of items in the `TableNames` response parameter. + * + * @example 20 + */ + public const AWS_DYNAMODB_TABLE_COUNT = 'aws.dynamodb.table_count'; + + /** + * The value of the `ScanIndexForward` request parameter. + */ + public const AWS_DYNAMODB_SCAN_FORWARD = 'aws.dynamodb.scan_forward'; + + /** + * The value of the `Count` response parameter. + * + * @example 10 + */ + public const AWS_DYNAMODB_COUNT = 'aws.dynamodb.count'; + + /** + * The value of the `ScannedCount` response parameter. + * + * @example 50 + */ + public const AWS_DYNAMODB_SCANNED_COUNT = 'aws.dynamodb.scanned_count'; + + /** + * The value of the `Segment` request parameter. + * + * @example 10 + */ + public const AWS_DYNAMODB_SEGMENT = 'aws.dynamodb.segment'; + + /** + * The value of the `TotalSegments` request parameter. + * + * @example 100 + */ + public const AWS_DYNAMODB_TOTAL_SEGMENTS = 'aws.dynamodb.total_segments'; + + /** + * The JSON-serialized value of each item in the `AttributeDefinitions` request field. + * + * @example { "AttributeName": "string", "AttributeType": "string" } + */ + public const AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = 'aws.dynamodb.attribute_definitions'; + + /** + * The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. + * + * @example { "Create": { "IndexName": "string", "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits": number } } + */ + public const AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = 'aws.dynamodb.global_secondary_index_updates'; + + /** + * The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the S3 API operations. + * + * The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. + * This applies to almost all S3 operations except `list-buckets`. + * + * @example some-bucket-name + */ + public const AWS_S3_BUCKET = 'aws.s3.bucket'; + + /** + * The source object (in the form `bucket`/`key`) for the copy operation. + * + * The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter + * of the copy-object operation within the S3 API. + * This applies in particular to the following operations:
      + *
    • copy-object
    • + *
    • upload-part-copy
    • + *
    + * + * @example someFile.yml + */ + public const AWS_S3_COPY_SOURCE = 'aws.s3.copy_source'; + + /** + * The delete request container that specifies the objects to be deleted. + * + * The `delete` attribute is only applicable to the delete-object operation. + * The `delete` attribute corresponds to the `--delete` parameter of the + * delete-objects operation within the S3 API. + * + * @example Objects=[{Key=string,VersionId=string},{Key=string,VersionId=string}],Quiet=boolean + */ + public const AWS_S3_DELETE = 'aws.s3.delete'; + + /** + * The S3 object key the request refers to. Corresponds to the `--key` parameter of the S3 API operations. + * + * The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. + * This applies in particular to the following operations:
      + *
    • copy-object
    • + *
    • delete-object
    • + *
    • get-object
    • + *
    • head-object
    • + *
    • put-object
    • + *
    • restore-object
    • + *
    • select-object-content
    • + *
    • abort-multipart-upload
    • + *
    • complete-multipart-upload
    • + *
    • create-multipart-upload
    • + *
    • list-parts
    • + *
    • upload-part
    • + *
    • upload-part-copy
    • + *
    + * + * @example someFile.yml + */ + public const AWS_S3_KEY = 'aws.s3.key'; + + /** + * The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. + * + * The `part_number` attribute is only applicable to the upload-part + * and upload-part-copy operations. + * The `part_number` attribute corresponds to the `--part-number` parameter of the + * upload-part operation within the S3 API. + * + * @example 3456 + */ + public const AWS_S3_PART_NUMBER = 'aws.s3.part_number'; + + /** + * Upload ID that identifies the multipart upload. + * + * The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter + * of the S3 API multipart operations. + * This applies in particular to the following operations:
      + *
    • abort-multipart-upload
    • + *
    • complete-multipart-upload
    • + *
    • list-parts
    • + *
    • upload-part
    • + *
    • upload-part-copy
    • + *
    + * + * @example dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ + */ + public const AWS_S3_UPLOAD_ID = 'aws.s3.upload_id'; + + /** + * The GraphQL document being executed. + * + * The value may be sanitized to exclude sensitive information. + * + * @example query findBookById { bookById(id: ?) { name } } + */ + public const GRAPHQL_DOCUMENT = 'graphql.document'; + + /** + * The name of the operation being executed. + * + * @example findBookById + */ + public const GRAPHQL_OPERATION_NAME = 'graphql.operation.name'; + + /** + * The type of the operation being executed. + * + * @example query + * @example mutation + * @example subscription + */ + public const GRAPHQL_OPERATION_TYPE = 'graphql.operation.type'; + + /** + * A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). + */ + public const MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = 'messaging.destination_publish.anonymous'; + + /** + * The name of the original destination the message was published to. + * + * The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If + * the broker does not have such notion, the original destination name SHOULD uniquely identify the broker. + * + * @example MyQueue + * @example MyTopic + */ + public const MESSAGING_DESTINATION_PUBLISH_NAME = 'messaging.destination_publish.name'; + + /** + * RabbitMQ message routing key. + * + * @example myKey + */ + public const MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = 'messaging.rabbitmq.destination.routing_key'; + + /** + * Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. + * + * @example my-group + */ + public const MESSAGING_KAFKA_CONSUMER_GROUP = 'messaging.kafka.consumer.group'; + + /** + * Partition the message is sent to. + * + * @example 2 + */ + public const MESSAGING_KAFKA_DESTINATION_PARTITION = 'messaging.kafka.destination.partition'; + + /** + * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. + * + * If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. + * + * @example myKey + */ + public const MESSAGING_KAFKA_MESSAGE_KEY = 'messaging.kafka.message.key'; + + /** + * The offset of a record in the corresponding Kafka partition. + * + * @example 42 + */ + public const MESSAGING_KAFKA_MESSAGE_OFFSET = 'messaging.kafka.message.offset'; + + /** + * A boolean that is true if the message is a tombstone. + */ + public const MESSAGING_KAFKA_MESSAGE_TOMBSTONE = 'messaging.kafka.message.tombstone'; + + /** + * Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. + * + * @example myConsumerGroup + */ + public const MESSAGING_ROCKETMQ_CLIENT_GROUP = 'messaging.rocketmq.client_group'; + + /** + * Model of message consumption. This only applies to consumer spans. + */ + public const MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = 'messaging.rocketmq.consumption_model'; + + /** + * The delay time level for delay message, which determines the message delay time. + * + * @example 3 + */ + public const MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = 'messaging.rocketmq.message.delay_time_level'; + + /** + * The timestamp in milliseconds that the delay message is expected to be delivered to consumer. + * + * @example 1665987217045 + */ + public const MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = 'messaging.rocketmq.message.delivery_timestamp'; + + /** + * It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group. + * + * @example myMessageGroup + */ + public const MESSAGING_ROCKETMQ_MESSAGE_GROUP = 'messaging.rocketmq.message.group'; + + /** + * Key(s) of message, another way to mark message besides message id. + * + * @example keyA + * @example keyB + */ + public const MESSAGING_ROCKETMQ_MESSAGE_KEYS = 'messaging.rocketmq.message.keys'; + + /** + * The secondary classifier of message besides topic. + * + * @example tagA + */ + public const MESSAGING_ROCKETMQ_MESSAGE_TAG = 'messaging.rocketmq.message.tag'; + + /** + * Type of message. + */ + public const MESSAGING_ROCKETMQ_MESSAGE_TYPE = 'messaging.rocketmq.message.type'; + + /** + * Namespace of RocketMQ resources, resources in different namespaces are individual. + * + * @example myNamespace + */ + public const MESSAGING_ROCKETMQ_NAMESPACE = 'messaging.rocketmq.namespace'; + + /** + * The numeric status code of the gRPC request. + */ + public const RPC_GRPC_STATUS_CODE = 'rpc.grpc.status_code'; + + /** + * `error.code` property of response if it is an error response. + * + * @example -32700 + * @example 100 + */ + public const RPC_JSONRPC_ERROR_CODE = 'rpc.jsonrpc.error_code'; + + /** + * `error.message` property of response if it is an error response. + * + * @example Parse error + * @example User already exists + */ + public const RPC_JSONRPC_ERROR_MESSAGE = 'rpc.jsonrpc.error_message'; + + /** + * `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. + * + * @example 10 + * @example request-7 + */ + public const RPC_JSONRPC_REQUEST_ID = 'rpc.jsonrpc.request_id'; + + /** + * Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted. + * + * @example 2.0 + * @example 1.0 + */ + public const RPC_JSONRPC_VERSION = 'rpc.jsonrpc.version'; + + /** + * Compressed size of the message in bytes. + */ + public const MESSAGE_COMPRESSED_SIZE = 'message.compressed_size'; + + /** + * MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. + * + * This way we guarantee that the values will be consistent between different implementations. + */ + public const MESSAGE_ID = 'message.id'; + + /** + * Whether this is a received or sent message. + */ + public const MESSAGE_TYPE = 'message.type'; + + /** + * Uncompressed size of the message in bytes. + */ + public const MESSAGE_UNCOMPRESSED_SIZE = 'message.uncompressed_size'; + + /** + * The error codes of the Connect request. Error codes are always string values. + */ + public const RPC_CONNECT_RPC_ERROR_CODE = 'rpc.connect_rpc.error_code'; + + /** + * SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. + * + * An exception is considered to have escaped (or left) the scope of a span, + * if that span is ended while the exception is still logically "in flight". + * This may be actually "in flight" in some languages (e.g. if the exception + * is passed to a Context manager's `__exit__` method in Python) but will + * usually be caught at the point of recording the exception in most languages.It is usually not possible to determine at the point where an exception is thrown + * whether it will escape the scope of a span. + * However, it is trivial to know that an exception + * will escape, if one checks for an active exception just before ending the span, + * as done in the example above.It follows that an exception may still escape the scope of the span + * even if the `exception.escaped` attribute was not set or set to false, + * since the event might have been recorded at a time where it was not + * clear whether the exception will escape. + */ + public const EXCEPTION_ESCAPED = 'exception.escaped'; + + /** + * The URI fragment component. + * + * @example SemConv + */ + public const URL_FRAGMENT = 'url.fragment'; + + /** + * @deprecated + */ + public const FAAS_EXECUTION = 'faas.execution'; + + /** + * @deprecated + */ + public const HTTP_HOST = 'http.host'; + + /** + * @deprecated + */ + public const HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = 'http.request_content_length_uncompressed'; + + /** + * @deprecated + */ + public const HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = 'http.response_content_length_uncompressed'; + + /** + * @deprecated + */ + public const HTTP_RETRY_COUNT = 'http.retry_count'; + + /** + * @deprecated + */ + public const HTTP_SERVER_NAME = 'http.server_name'; + + /** + * @deprecated + */ + public const HTTP_USER_AGENT = 'http.user_agent'; + + /** + * @deprecated + */ + public const MESSAGING_CONVERSATION_ID = 'messaging.conversation_id'; + + /** + * @deprecated + */ + public const MESSAGING_DESTINATION = 'messaging.destination'; + + /** + * @deprecated + */ + public const MESSAGING_KAFKA_PARTITION = 'messaging.kafka.partition'; + + /** + * @deprecated + */ + public const MESSAGING_KAFKA_TOMBSTONE = 'messaging.kafka.tombstone'; + + /** + * @deprecated + */ + public const MESSAGING_PROTOCOL = 'messaging.protocol'; + + /** + * @deprecated + */ + public const MESSAGING_PROTOCOL_VERSION = 'messaging.protocol_version'; + + /** + * @deprecated + */ + public const MESSAGING_RABBITMQ_ROUTING_KEY = 'messaging.rabbitmq.routing_key'; + + /** + * @deprecated + */ + public const MESSAGING_TEMP_DESTINATION = 'messaging.temp_destination'; + + /** + * @deprecated + */ + public const MESSAGING_URL = 'messaging.url'; + + /** + * @deprecated + */ + public const NET_HOST_IP = 'net.host.ip'; + + /** + * @deprecated + */ + public const NET_PEER_IP = 'net.peer.ip'; + + /** + * @deprecated + */ + public const HTTP_CLIENT_IP = 'http.client_ip'; + + /** + * @deprecated + */ + public const HTTP_FLAVOR = 'http.flavor'; + + /** + * @deprecated + */ + public const MESSAGING_CONSUMER_ID = 'messaging.consumer.id'; + + /** + * @deprecated + */ + public const MESSAGING_DESTINATION_KIND = 'messaging.destination.kind'; + + /** + * @deprecated + */ + public const MESSAGING_KAFKA_CLIENT_ID = 'messaging.kafka.client_id'; + + /** + * @deprecated + */ + public const MESSAGING_KAFKA_SOURCE_PARTITION = 'messaging.kafka.source.partition'; + + /** + * @deprecated + */ + public const MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = 'messaging.message.payload_compressed_size_bytes'; + + /** + * @deprecated + */ + public const MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = 'messaging.message.payload_size_bytes'; + + /** + * @deprecated + */ + public const MESSAGING_ROCKETMQ_CLIENT_ID = 'messaging.rocketmq.client_id'; + + /** + * @deprecated + */ + public const MESSAGING_SOURCE_ANONYMOUS = 'messaging.source.anonymous'; + + /** + * @deprecated + */ + public const MESSAGING_SOURCE_KIND = 'messaging.source.kind'; + + /** + * @deprecated + */ + public const MESSAGING_SOURCE_NAME = 'messaging.source.name'; + + /** + * @deprecated + */ + public const MESSAGING_SOURCE_TEMPLATE = 'messaging.source.template'; + + /** + * @deprecated + */ + public const MESSAGING_SOURCE_TEMPORARY = 'messaging.source.temporary'; + + /** + * @deprecated + */ + public const NET_APP_PROTOCOL_NAME = 'net.app.protocol.name'; + + /** + * @deprecated + */ + public const NET_APP_PROTOCOL_VERSION = 'net.app.protocol.version'; + + /** + * @deprecated + */ + public const NET_HOST_CARRIER_ICC = 'net.host.carrier.icc'; + + /** + * @deprecated + */ + public const NET_HOST_CARRIER_MCC = 'net.host.carrier.mcc'; + + /** + * @deprecated + */ + public const NET_HOST_CARRIER_MNC = 'net.host.carrier.mnc'; + + /** + * @deprecated + */ + public const NET_HOST_CARRIER_NAME = 'net.host.carrier.name'; + + /** + * @deprecated + */ + public const NET_HOST_CONNECTION_SUBTYPE = 'net.host.connection.subtype'; + + /** + * @deprecated + */ + public const NET_HOST_CONNECTION_TYPE = 'net.host.connection.type'; +} diff --git a/vendor/open-telemetry/sem-conv/composer.json b/vendor/open-telemetry/sem-conv/composer.json new file mode 100644 index 000000000..a601ca5dc --- /dev/null +++ b/vendor/open-telemetry/sem-conv/composer.json @@ -0,0 +1,32 @@ +{ + "name": "open-telemetry/sem-conv", + "description": "Semantic conventions for OpenTelemetry PHP.", + "keywords": ["opentelemetry", "otel", "metrics", "tracing", "logging", "apm", "semconv", "semantic conventions"], + "type": "library", + "support": { + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php", + "docs": "https://opentelemetry.io/docs/php", + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V" + }, + "license": "Apache-2.0", + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "require": { + "php": "^7.4 || ^8.0" + }, + "autoload": { + "psr-4": { + "OpenTelemetry\\SemConv\\": "." + } + }, + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + } +} diff --git a/vendor/opentracing/opentracing/.github/ISSUE_TEMPLATE.md b/vendor/opentracing/opentracing/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index f99dd606b..000000000 --- a/vendor/opentracing/opentracing/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,21 +0,0 @@ - - - -## Background -Something that gives context about why this is an issue. - -## Problem -Describe the problem. If the issue is about an improvement you can skip this. If possible, include a description of the impact of the problem. - -## Proposal -A proposal that from your POV would solve the problem or improve the existing situation. It should also include the impact. - -## Questions to address -Questions that should be answered as outcome of this issue. diff --git a/vendor/opentracing/opentracing/.github/PULL_REQUEST_TEMPLATE.md b/vendor/opentracing/opentracing/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index d81c08379..000000000 --- a/vendor/opentracing/opentracing/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,24 +0,0 @@ - - -### Short description of what this PR does: -- -- - -### Checklist -- [ ] I have made a material change to the repo (functionality, testing, spelling, grammar) -- [ ] I have read the [Contribution Guide] and my PR follows them. -- [ ] I updated my branch with the master branch. -- [ ] I have added tests that prove my fix is effective or that my feature works -- [ ] I have added necessary documentation about the functionality in the appropriate .md file -- [ ] I have added in line documentation to the code I modified - -Closes # \ No newline at end of file diff --git a/vendor/opentracing/opentracing/.github/workflows/ci.yml b/vendor/opentracing/opentracing/.github/workflows/ci.yml deleted file mode 100644 index 8fba7baf8..000000000 --- a/vendor/opentracing/opentracing/.github/workflows/ci.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build -on: - push: - branches: - - master - paths-ignore: - - "**/*.md" - - "LICENSE" - pull_request: -jobs: - test: - name: OpenTracing (PHP version ${{ matrix.php-versions }} on ${{ matrix.operating-system }}) - runs-on: ${{ matrix.operating-system }} - strategy: - fail-fast: false - matrix: - operating-system: [ubuntu-latest, windows-latest, macos-latest] - php-versions: ["7.1", "7.2", "7.3", "7.4", "8.0", "8.1"] - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php - with: - php-version: ${{ matrix.php-versions }} - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - name: Cache composer dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- - - name: Install Composer dependencies - run: | - composer install --no-progress --prefer-dist --optimize-autoloader - - name: Run lint - if: matrix.operating-system != 'windows-latest' - run: composer lint - - name: Run static check - run: composer static-check - - name: Run tests - run: composer test diff --git a/vendor/opentracing/opentracing/.gitignore b/vendor/opentracing/opentracing/.gitignore deleted file mode 100644 index 56e80855d..000000000 --- a/vendor/opentracing/opentracing/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.idea/ -.phpunit.result.cache -composer.lock -vendor \ No newline at end of file diff --git a/vendor/opentracing/opentracing/CONTRIBUTING.md b/vendor/opentracing/opentracing/CONTRIBUTING.md deleted file mode 100644 index a13c0fe1d..000000000 --- a/vendor/opentracing/opentracing/CONTRIBUTING.md +++ /dev/null @@ -1,75 +0,0 @@ -Contributing -============ - -Thank you for contributing to this project! - -Bug reports ------------ - -If you find a bug, please submit an issue. Try to be as detailed as possible -in your problem description to help us fix the bug. - -Feature requests ----------------- - -If you wish to propose a feature, please submit an issue. Try to explain your -use case as fully as possible to help us understand why you think the feature -should be added. - -License -------- - -By contributing your code, you agree to license your contribution under the terms of the APLv2: -https://github.com/opentracing/opentracing-php/blob/master/LICENSE - -All files are released with the Apache 2.0 license. - -Creating a pull request (PR) ----------------------------- - -First [fork the repository](https://help.github.com/articles/fork-a-repo/) on -GitHub. - -Then clone your fork: - -```bash -$ git clone https://github.com/your-name/opentracing-php.git -$ git checkout -b bug-or-feature-description -``` - -And install the dependencies: - -```bash -$ composer install -``` - -Write your code and add tests. Then run the static check and the tests: - -```bash -$ composer run static-check -$ composer run test -``` - -Commit your changes and push them to GitHub: - -```bash -$ git commit -m "Fix nasty bug" -$ git push -u origin bug-or-feature-description -``` - -Then [create a pull request](https://help.github.com/articles/creating-a-pull-request/) -on GitHub. - -If you need to make some changes, commit and push them as you like. When asked -to squash your commits, do so as follows: - -```bash -git rebase -i -git push origin bug-or-feature-description -f -``` - -Coding standard ---------------- - -This project follows the [PSR-2](http://www.php-fig.org/psr/psr-2/) coding style. -Please make sure your pull requests adhere to this standard. diff --git a/vendor/opentracing/opentracing/LICENSE b/vendor/opentracing/opentracing/LICENSE deleted file mode 100644 index 8dada3eda..000000000 --- a/vendor/opentracing/opentracing/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/opentracing/opentracing/README.md b/vendor/opentracing/opentracing/README.md deleted file mode 100644 index ce03bc951..000000000 --- a/vendor/opentracing/opentracing/README.md +++ /dev/null @@ -1,306 +0,0 @@ -# OpenTracing API for PHP - -[![Build](https://github.com/opentracing/opentracing-php/actions/workflows/ci.yml/badge.svg)](https://github.com/opentracing/opentracing-php/actions/workflows/ci.yml) -[![OpenTracing Badge](https://img.shields.io/badge/OpenTracing-enabled-blue.svg)](http://opentracing.io) -[![Total Downloads](https://poser.pugx.org/opentracing/opentracing/downloads)](https://packagist.org/packages/opentracing/opentracing) -[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%205.6-8892BF.svg)](https://php.net/) -[![License](https://img.shields.io/github/license/opentracing/opentracing-php.svg)](https://github.com/opentracing/opentracing-php/blob/master/LICENSE) -[![Join the chat at https://gitter.im/opentracing/opentracing-php](https://badges.gitter.im/opentracing/opentracing-php.svg)](https://gitter.im/opentracing/opentracing-php?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -PHP library for the OpenTracing's API. - -## Required Reading - -In order to understand the library, one must first be familiar with the -[OpenTracing project](http://opentracing.io) and -[specification](http://opentracing.io/documentation/pages/spec.html) more specifically. - -## Installation - -OpenTracing-PHP can be installed via Composer: - -```bash -composer require opentracing/opentracing -``` - -## Usage - -When consuming this library one really only need to worry about a couple of key -abstractions: the `Tracer::startActiveSpan` and `Tracer::startSpan` method, -the `Span` interface, the `Scope` interface and binding a `Tracer` at bootstrap time. Here are code snippets -demonstrating some important use cases: - -### Singleton initialization - -The simplest starting point is to set the global tracer. As early as possible, do: - -```php -use OpenTracing\GlobalTracer; - -GlobalTracer::set(new MyTracerImplementation()); -``` - -### Creating a Span given an existing Request - -To start a new `Span`, you can use the `startSpan` method. - -```php -use OpenTracing\Formats; -use OpenTracing\GlobalTracer; - -... - -// extract the span context -$spanContext = GlobalTracer::get()->extract( - Formats\HTTP_HEADERS, - getallheaders() -); - -function doSomething() { - ... - - // start a new span called 'my_span' and make it a child of the $spanContext - $span = GlobalTracer::get()->startSpan('my_span', ['child_of' => $spanContext]); - - ... - - // add some logs to the span - $span->log([ - 'event' => 'soft error', - 'type' => 'cache timeout', - 'waiter.millis' => 1500, - ]) - - // finish the the span - $span->finish(); -} -``` - -### Starting a new trace by creating a "root span" - -It's always possible to create a "root" `Span` with no parent or other causal reference. - -```php -$span = $tracer->startSpan('my_first_span'); -... -$span->finish(); -``` - -### Active Spans and Scope Manager - -For most use cases, it is recommended that you use the `Tracer::startActiveSpan` function for -creating new spans. - -An example of a linear, two level deep span tree using active spans looks like -this in PHP code: -```php -// At dispatcher level -$scope = $tracer->startActiveSpan('request'); -... -$scope->close(); -``` -```php -// At controller level -$scope = $tracer->startActiveSpan('controller'); -... -$scope->close(); -``` - -```php -// At RPC calls level -$scope = $tracer->startActiveSpan('http'); -file_get_contents('http://php.net'); -$scope->close(); -``` - -When using the `Tracer::startActiveSpan` function the underlying tracer uses an -abstraction called scope manager to keep track of the currently active span. - -Starting an active span will always use the currently active span as a parent. -If no parent is available, then the newly created span is considered to be the -root span of the trace. - -Unless you are using asynchronous code that tracks multiple spans at the same -time, such as when using cURL Multi Exec or MySQLi Polling it is recommended that you -use `Tracer::startActiveSpan` everywhere in your application. - -The currently active span gets automatically finished when you call `$scope->close()` -as you can see in the previous examples. - -If you don't want a span to automatically close when `$scope->close()` is called -then you must specify `'finish_span_on_close'=> false,` in the `$options` -argument of `startActiveSpan`. - -#### Creating a child span assigning parent manually - -```php -$parent = GlobalTracer::get()->startSpan('parent'); - -$child = GlobalTracer::get()->startSpan('child', [ - 'child_of' => $parent -]); - -... - -$child->finish(); - -... - -$parent->finish(); -``` - -#### Creating a child span using automatic active span management - -Every new span will take the active span as parent and it will take its spot. - -```php -$parent = GlobalTracer::get()->startActiveSpan('parent'); - -... - -/* - * Since the parent span has been created by using startActiveSpan we don't need - * to pass a reference for this child span - */ -$child = GlobalTracer::get()->startActiveSpan('my_second_span'); - -... - -$child->close(); - -... - -$parent->close(); -``` - -### Serializing to the wire - -```php -use GuzzleHttp\Client; -use OpenTracing\Formats; - -... - -$tracer = GlobalTracer::get(); - -$spanContext = $tracer->extract( - Formats\HTTP_HEADERS, - getallheaders() -); - -try { - $span = $tracer->startSpan('my_span', ['child_of' => $spanContext]); - - $client = new Client; - - $headers = []; - - $tracer->inject( - $span->getContext(), - Formats\HTTP_HEADERS, - $headers - ); - - $request = new \GuzzleHttp\Psr7\Request('GET', 'http://myservice', $headers); - $client->send($request); - ... - -} catch (\Exception $e) { - ... -} -... -``` - -### Deserializing from the wire - -When using http header for context propagation you can use either the `Request` or the `$_SERVER` -variable: - -```php -use OpenTracing\GlobalTracer; -use OpenTracing\Formats; - -$tracer = GlobalTracer::get(); -$spanContext = $tracer->extract(Formats\HTTP_HEADERS, getallheaders()); -$tracer->startSpan('my_span', [ - 'child_of' => $spanContext, -]); -``` - -### Flushing Spans - -PHP as a request scoped language has no simple means to pass the collected spans -data to a background process without blocking the main request thread/process. -The OpenTracing API makes no assumptions about this, but for PHP that might -cause problems for Tracer implementations. This is why the PHP API contains a -`flush` method that allows to trigger a span sending out of process. - -```php -use OpenTracing\GlobalTracer; - -$application->run(); - -register_shutdown_function(function() { - /* Flush the tracer to the backend */ - $tracer = GlobalTracer::get(); - $tracer->flush(); -}); -``` - -This is optional, tracers can decide to immediately send finished spans to a -backend. The flush call can be implemented as a NO-OP for these tracers. - -### Using `StartSpanOptions` - -Passing options to the pass can be done using either an array or the -SpanOptions wrapper object. The following keys are valid: - -- `start_time` is a float, int or `\DateTime` representing a timestamp with arbitrary precision. -- `child_of` is an object of type `OpenTracing\SpanContext` or `OpenTracing\Span`. -- `references` is an array of `OpenTracing\Reference`. -- `tags` is an array with string keys and scalar values that represent OpenTracing tags. -- `finish_span_on_close` is a boolean that determines whether a span should be finished or not when the -scope is closed. - -```php -$span = $tracer->startActiveSpan('my_span', [ - 'child_of' => $spanContext, - 'tags' => ['foo' => 'bar'], - 'start_time' => time(), -]); -``` - -### Propagation Formats - -The propagation formats should be implemented consistently across all tracers. -If you want to implement your own format, then don't reuse the existing constants. -Tracers will throw an exception if the requested format is not handled by them. - -- `Tracer::FORMAT_TEXT_MAP` should represent the span context as a key value map. There is no - assumption about the semantics where the context is coming from and sent to. - -- `Tracer::FORMAT_HTTP_HEADERS` should represent the span context as HTTP header lines - in an array list. For two context details "Span-Id" and "Trace-Id", the - result would be `['Span-Id: abc123', 'Trace-Id: def456']`. This definition can be - passed directly to `curl` and `file_get_contents`. - -- `Tracer::FORMAT_BINARY` makes no assumptions about the data format other than it is - proprietary and each Tracer can handle it as it wants. - -## Mock implementation - -OpenTracing PHP comes with a mock implementation, it has three purposes: - -1. Helps to iron the API. -2. Works as a reference implementation. -3. Enhances vendor agnostic unit testing as it allows developers to inspect the tracing objects -in order to do assertions about them. - -## Coding Style - -OpenTracing PHP follows the [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) -coding standard and the [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md) autoloading standard. - -## License - -All the open source contributions are under the terms of the [Apache-2.0 License](https://opensource.org/licenses/Apache-2.0). diff --git a/vendor/opentracing/opentracing/composer.json b/vendor/opentracing/opentracing/composer.json deleted file mode 100644 index b00b67381..000000000 --- a/vendor/opentracing/opentracing/composer.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "opentracing/opentracing", - "type": "library", - "description": "OpenTracing API for PHP", - "license": "Apache-2.0", - "minimum-stability": "stable", - "authors": [ - { - "name": "José Carlos Chávez", - "email": "jcchavezs@gmail.com" - } - ], - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "~0.12", - "phpunit/phpunit": "^7.0 || ^9.0", - "squizlabs/php_codesniffer": "3.*" - }, - "config": { - "sort-packages": true - }, - "autoload": { - "psr-4": { - "OpenTracing\\": "src/OpenTracing/" - }, - "files": [ - "src/OpenTracing/Tags.php", - "src/OpenTracing/Formats.php" - ] - }, - "autoload-dev": { - "psr-4": { - "OpenTracing\\Tests\\": "tests/OpenTracing" - } - }, - "scripts": { - "fix-lint": "phpcbf --standard=ZEND --standard=PSR2 --ignore=*/vendor/* ./", - "lint": "phpcs --standard=ZEND --standard=PSR2 --ignore=*/vendor/* ./", - "test": "phpunit tests", - "static-check": "phpstan analyse" - } -} diff --git a/vendor/opentracing/opentracing/phpstan.neon b/vendor/opentracing/opentracing/phpstan.neon deleted file mode 100644 index c9e64bf1f..000000000 --- a/vendor/opentracing/opentracing/phpstan.neon +++ /dev/null @@ -1,5 +0,0 @@ -parameters: - paths: - - src - - level: 5 diff --git a/vendor/opentracing/opentracing/phpunit.xml b/vendor/opentracing/opentracing/phpunit.xml deleted file mode 100644 index 2083a425c..000000000 --- a/vendor/opentracing/opentracing/phpunit.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - tests - - - diff --git a/vendor/opentracing/opentracing/src/OpenTracing/Formats.php b/vendor/opentracing/opentracing/src/OpenTracing/Formats.php deleted file mode 100644 index f26c5ecf1..000000000 --- a/vendor/opentracing/opentracing/src/OpenTracing/Formats.php +++ /dev/null @@ -1,49 +0,0 @@ -inject($span->getContext(), Formats\HTTP_HEADERS, $headers) - * $request = new GuzzleHttp\Psr7\Request($uri, $body, $headers); - * - * Or Tracer::extract(): - * - * $headers = $request->getHeaders() - * $clientContext = $tracer->extract(Formats\HTTP_HEADERS, $headers) - * - * @see http://www.php-fig.org/psr/psr-7/#12-http-headers - * @see http://php.net/manual/en/function.getallheaders.php - */ -const HTTP_HEADERS = 'http_headers'; diff --git a/vendor/opentracing/opentracing/src/OpenTracing/GlobalTracer.php b/vendor/opentracing/opentracing/src/OpenTracing/GlobalTracer.php deleted file mode 100644 index aafdba121..000000000 --- a/vendor/opentracing/opentracing/src/OpenTracing/GlobalTracer.php +++ /dev/null @@ -1,60 +0,0 @@ -scopeManager = $scopeManager; - $this->span = $span; - $this->finishSpanOnClose = $finishSpanOnClose; - } - - /** - * {@inheritdoc} - */ - public function close(): void - { - if ($this->finishSpanOnClose) { - $this->span->finish(); - } - - $this->scopeManager->deactivate($this); - } - - /** - * {@inheritdoc} - * @return Span|MockSpan - */ - public function getSpan(): Span - { - return $this->span; - } -} diff --git a/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockScopeManager.php b/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockScopeManager.php deleted file mode 100644 index c75c71942..000000000 --- a/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockScopeManager.php +++ /dev/null @@ -1,49 +0,0 @@ -scopes[] = $scope; - - return $scope; - } - - /** - * {@inheritdoc} - */ - public function getActive(): ?Scope - { - if (empty($this->scopes)) { - return null; - } - - return $this->scopes[count($this->scopes) - 1]; - } - - public function deactivate(MockScope $scope): void - { - foreach ($this->scopes as $scopeIndex => $scopeItem) { - if ($scope === $scopeItem) { - unset($this->scopes[$scopeIndex]); - } - } - } -} diff --git a/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockSpan.php b/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockSpan.php deleted file mode 100644 index db53649bf..000000000 --- a/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockSpan.php +++ /dev/null @@ -1,145 +0,0 @@ -operationName = $operationName; - $this->context = $context; - $this->startTime = $startTime ?: time(); - } - - /** - * {@inheritdoc} - */ - public function getOperationName(): string - { - return $this->operationName; - } - - /** - * {@inheritdoc} - * @return SpanContext|MockSpanContext - */ - public function getContext(): SpanContext - { - return $this->context; - } - - public function getStartTime(): ?int - { - return $this->startTime; - } - - /** - * {@inheritdoc} - */ - public function finish($finishTime = null): void - { - $finishTime = ($finishTime ?: time()); - $this->duration = $finishTime - $this->startTime; - } - - public function isFinished(): bool - { - return $this->duration !== null; - } - - public function getDuration(): ?int - { - return $this->duration; - } - - /** - * {@inheritdoc} - */ - public function overwriteOperationName(string $newOperationName): void - { - $this->operationName = (string)$newOperationName; - } - - /** - * {@inheritdoc} - */ - public function setTag(string $key, $value): void - { - $this->tags[$key] = $value; - } - - public function getTags(): array - { - return $this->tags; - } - - /** - * {@inheritdoc} - */ - public function log(array $fields = [], $timestamp = null): void - { - $this->logs[] = [ - 'timestamp' => $timestamp ?: time(), - 'fields' => $fields, - ]; - } - - public function getLogs(): array - { - return $this->logs; - } - - /** - * {@inheritdoc} - */ - public function addBaggageItem(string $key, string $value): void - { - $this->context = $this->context->withBaggageItem($key, $value); - } - - /** - * {@inheritdoc} - */ - public function getBaggageItem(string $key): ?string - { - return $this->context->getBaggageItem($key); - } -} diff --git a/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockSpanContext.php b/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockSpanContext.php deleted file mode 100644 index d094ea0e0..000000000 --- a/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockSpanContext.php +++ /dev/null @@ -1,100 +0,0 @@ -traceId = $traceId; - $this->spanId = $spanId; - $this->isSampled = $isSampled; - $this->items = $items; - } - - public static function create(int $traceId, int $spanId, bool $sampled = true, array $items = []): SpanContext - { - return new self($traceId, $spanId, $sampled, $items); - } - - public static function createAsRoot(bool $sampled = true, array $items = []): SpanContext - { - $traceId = $spanId = self::nextId(); - return new self($traceId, $spanId, $sampled, $items); - } - - public static function createAsChildOf(MockSpanContext $spanContext): SpanContext - { - $spanId = self::nextId(); - return new self($spanContext->traceId, $spanId, $spanContext->isSampled, $spanContext->items); - } - - public function getTraceId(): int - { - return $this->traceId; - } - - public function getSpanId(): int - { - return $this->spanId; - } - - public function isSampled(): bool - { - return $this->isSampled; - } - - /** - * {@inheritdoc} - */ - public function getIterator(): ArrayIterator - { - return new ArrayIterator($this->items); - } - - /** - * {@inheritdoc} - */ - public function getBaggageItem(string $key): ?string - { - return array_key_exists($key, $this->items) ? $this->items[$key] : null; - } - - /** - * {@inheritdoc} - */ - public function withBaggageItem(string $key, string $value): SpanContext - { - return new self($this->traceId, $this->spanId, $this->isSampled, array_merge($this->items, [$key => $value])); - } - - private static function nextId(): int - { - return mt_rand(0, 99999); - } -} diff --git a/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockTracer.php b/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockTracer.php deleted file mode 100644 index f4f4577a1..000000000 --- a/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockTracer.php +++ /dev/null @@ -1,152 +0,0 @@ -injectors = $injectors; - $this->extractors = $extractors; - $this->scopeManager = new MockScopeManager(); - } - - /** - * {@inheritdoc} - */ - public function startActiveSpan(string $operationName, $options = []): Scope - { - if (!($options instanceof StartSpanOptions)) { - $options = StartSpanOptions::create($options); - } - - if (($activeSpan = $this->getActiveSpan()) !== null) { - $options = $options->withParent($activeSpan); - } - - $span = $this->startSpan($operationName, $options); - - return $this->scopeManager->activate($span, $options->shouldFinishSpanOnClose()); - } - - /** - * {@inheritdoc} - */ - public function startSpan(string $operationName, $options = []): Span - { - if (!($options instanceof StartSpanOptions)) { - $options = StartSpanOptions::create($options); - } - - if (empty($options->getReferences())) { - $spanContext = MockSpanContext::createAsRoot(); - } else { - $referenceContext = $options->getReferences()[0]->getSpanContext(); - if (!$referenceContext instanceof MockSpanContext) { - throw InvalidReferenceArgumentException::forInvalidContext($referenceContext); - } - $spanContext = MockSpanContext::createAsChildOf($referenceContext); - } - - $span = new MockSpan($operationName, $spanContext, $options->getStartTime()); - - foreach ($options->getTags() as $key => $value) { - $span->setTag($key, $value); - } - - $this->spans[] = $span; - - return $span; - } - - /** - * {@inheritdoc} - */ - public function inject(SpanContext $spanContext, string $format, &$carrier): void - { - if (!array_key_exists($format, $this->injectors)) { - throw UnsupportedFormatException::forFormat($format); - } - - $this->injectors[$format]($spanContext, $carrier); - } - - /** - * {@inheritdoc} - */ - public function extract(string $format, $carrier): ?SpanContext - { - if (!array_key_exists($format, $this->extractors)) { - throw UnsupportedFormatException::forFormat($format); - } - - return $this->extractors[$format]($carrier); - } - - /** - * {@inheritdoc} - */ - public function flush(): void - { - $this->spans = []; - } - - /** - * @return array|MockSpan[] - */ - public function getSpans(): array - { - return $this->spans; - } - - /** - * {@inheritdoc} - */ - public function getScopeManager(): ScopeManager - { - return $this->scopeManager; - } - - /** - * {@inheritdoc} - */ - public function getActiveSpan(): ?Span - { - if (null !== ($activeScope = $this->scopeManager->getActive())) { - return $activeScope->getSpan(); - } - - return null; - } -} diff --git a/vendor/opentracing/opentracing/src/OpenTracing/NoopScope.php b/vendor/opentracing/opentracing/src/OpenTracing/NoopScope.php deleted file mode 100644 index 7170c846a..000000000 --- a/vendor/opentracing/opentracing/src/OpenTracing/NoopScope.php +++ /dev/null @@ -1,23 +0,0 @@ -type = $type; - $this->spanContext = $spanContext; - } - - /** - * @param string $type - * @param Span $span - * @return Reference when context is invalid - * @throws InvalidReferenceArgumentException on empty type - */ - public static function createForSpan(string $type, Span $span): Reference - { - return new self($type, $span->getContext()); - } - - /** - * @return SpanContext - */ - public function getSpanContext(): SpanContext - { - return $this->spanContext; - } - - /** - * Checks whether a Reference is of one type. - * - * @param string $type the type for the reference - * @return bool - */ - public function isType(string $type): bool - { - return $this->type === $type; - } -} diff --git a/vendor/opentracing/opentracing/src/OpenTracing/Scope.php b/vendor/opentracing/opentracing/src/OpenTracing/Scope.php deleted file mode 100644 index 174495434..000000000 --- a/vendor/opentracing/opentracing/src/OpenTracing/Scope.php +++ /dev/null @@ -1,32 +0,0 @@ -is scheduled and on the path. - */ -interface Scope -{ - /** - * Mark the end of the active period for the current thread and {@link Scope}, - * updating the {@link ScopeManager#active()} in the process. - * - * NOTE: Calling {@link #close} more than once on a single {@link Scope} instance leads to undefined - * behavior. - * - * @return void - */ - public function close(): void; - - /** - * @return Span the {@link Span} that's been scoped by this {@link Scope} - */ - public function getSpan(): Span; -} diff --git a/vendor/opentracing/opentracing/src/OpenTracing/ScopeManager.php b/vendor/opentracing/opentracing/src/OpenTracing/ScopeManager.php deleted file mode 100644 index db5fcaa47..000000000 --- a/vendor/opentracing/opentracing/src/OpenTracing/ScopeManager.php +++ /dev/null @@ -1,40 +0,0 @@ - value format, key must be a string and tag must be either - * a string, a boolean value, or a numeric type. - * - * If the span is already finished, a warning should be logged. - * - * @param array $fields - * @param int|float|DateTimeInterface $timestamp - * @return void - */ - public function log(array $fields = [], $timestamp = null): void; - - /** - * Adds a baggage item to the SpanContext which is immutable so it is required to use - * SpanContext::withBaggageItem to get a new one. - * - * If the span is already finished, a warning should be logged. - * - * @param string $key - * @param string $value - * @return void - */ - public function addBaggageItem(string $key, string $value): void; - - /** - * @param string $key - * @return string|null returns null when there is not a item under the provided key - */ - public function getBaggageItem(string $key): ?string; -} diff --git a/vendor/opentracing/opentracing/src/OpenTracing/SpanContext.php b/vendor/opentracing/opentracing/src/OpenTracing/SpanContext.php deleted file mode 100644 index ca05ff9ac..000000000 --- a/vendor/opentracing/opentracing/src/OpenTracing/SpanContext.php +++ /dev/null @@ -1,37 +0,0 @@ - value string pairs that apply to the given Span, - * its SpanContext, and all Spans which directly or transitively reference - * the local Span. That is, baggage items propagate in-band along with the - * trace itself. - */ -interface SpanContext extends IteratorAggregate -{ - /** - * Returns the value of a baggage item based on its key. If there is no - * value with such key it will return null. - * - * @param string $key - * @return string|null - */ - public function getBaggageItem(string $key): ?string; - - /** - * Creates a new SpanContext out of the existing one and the new key => value pair. - * - * @param string $key - * @param string $value - * @return SpanContext - */ - public function withBaggageItem(string $key, string $value): SpanContext; -} diff --git a/vendor/opentracing/opentracing/src/OpenTracing/StartSpanOptions.php b/vendor/opentracing/opentracing/src/OpenTracing/StartSpanOptions.php deleted file mode 100644 index 28b73ff0a..000000000 --- a/vendor/opentracing/opentracing/src/OpenTracing/StartSpanOptions.php +++ /dev/null @@ -1,206 +0,0 @@ - $value) { - switch ($key) { - case 'child_of': - if (!empty($spanOptions->references)) { - throw InvalidSpanOptionException::forIncludingBothChildOfAndReferences(); - } - - $spanOptions->references[] = self::buildChildOf($value); - break; - - case 'references': - if (!empty($spanOptions->references)) { - throw InvalidSpanOptionException::forIncludingBothChildOfAndReferences(); - } - - if ($value instanceof Reference) { - $spanOptions->references = [$value]; - } elseif (is_array($value)) { - $spanOptions->references = self::buildReferences($value); - } else { - throw InvalidSpanOptionException::forInvalidReferenceSet($value); - } - - break; - - case 'tags': - if (!is_array($value)) { - throw InvalidSpanOptionException::forInvalidTags($value); - } - - foreach ($value as $tag => $tagValue) { - if ($tag !== (string)$tag) { - throw InvalidSpanOptionException::forInvalidTag($tag); - } - - $spanOptions->tags[$tag] = $tagValue; - } - break; - - case 'start_time': - if (is_scalar($value) && !is_numeric($value)) { - throw InvalidSpanOptionException::forInvalidStartTime(); - } - - $spanOptions->startTime = $value; - break; - - case 'finish_span_on_close': - if (!is_bool($value)) { - throw InvalidSpanOptionException::forFinishSpanOnClose($value); - } - - $spanOptions->finishSpanOnClose = $value; - break; - - case 'ignore_active_span': - if (!is_bool($value)) { - throw InvalidSpanOptionException::forIgnoreActiveSpan($value); - } - - $spanOptions->ignoreActiveSpan = $value; - break; - - default: - throw InvalidSpanOptionException::forUnknownOption($key); - } - } - - return $spanOptions; - } - - /** - * @param Span|SpanContext $parent - * @return StartSpanOptions - */ - public function withParent($parent): StartSpanOptions - { - $newSpanOptions = new StartSpanOptions(); - $newSpanOptions->references[] = self::buildChildOf($parent); - $newSpanOptions->tags = $this->tags; - $newSpanOptions->startTime = $this->startTime; - $newSpanOptions->finishSpanOnClose = $this->finishSpanOnClose; - $newSpanOptions->ignoreActiveSpan = $this->ignoreActiveSpan; - - return $newSpanOptions; - } - - /** - * @return Reference[] - */ - public function getReferences(): array - { - return $this->references; - } - - /** - * @return array - */ - public function getTags(): array - { - return $this->tags; - } - - /** - * @return int|float|DateTime|null if returning float or int it should represent - * the timestamp (including as many decimal places as you need) - */ - public function getStartTime() - { - return $this->startTime; - } - - /** - * @return bool - */ - public function shouldFinishSpanOnClose(): bool - { - return $this->finishSpanOnClose; - } - - /** - * @return bool - */ - public function shouldIgnoreActiveSpan(): bool - { - return $this->ignoreActiveSpan; - } - - private static function buildChildOf($value): Reference - { - if ($value instanceof Span) { - return Reference::createForSpan(Reference::CHILD_OF, $value); - } - - if ($value instanceof SpanContext) { - return new Reference(Reference::CHILD_OF, $value); - } - - throw InvalidSpanOptionException::forInvalidChildOf($value); - } - - private static function buildReferences(array $referencesArray): array - { - $references = []; - - foreach ($referencesArray as $reference) { - if (!($reference instanceof Reference)) { - throw InvalidSpanOptionException::forInvalidReference($reference); - } - - $references[] = $reference; - } - - return $references; - } -} diff --git a/vendor/opentracing/opentracing/src/OpenTracing/Tags.php b/vendor/opentracing/opentracing/src/OpenTracing/Tags.php deleted file mode 100644 index 5d06627de..000000000 --- a/vendor/opentracing/opentracing/src/OpenTracing/Tags.php +++ /dev/null @@ -1,124 +0,0 @@ -getActive()->getSpan(), - * and null will be returned if {@link Scope#active()} is null. - * - * @return Span|null - */ - public function getActiveSpan(): ?Span; - - /** - * Starts a new span that is activated on a scope manager. - * - * It's also possible to not finish the {@see \OpenTracing\Span} when - * {@see \OpenTracing\Scope} context expires: - * - * $scope = $tracer->startActiveSpan('...', [ - * 'finish_span_on_close' => false, - * ]); - * $span = $scope->getSpan(); - * try { - * $span->setTag(Tags\HTTP_METHOD, 'GET'); - * // ... - * } finally { - * $scope->close(); - * } - * // $span->finish() is not called as part of Scope deactivation as - * // finish_span_on_close is false - * - * @param string $operationName - * @param array|StartSpanOptions $options Same as for startSpan() with - * additional option of `finish_span_on_close` that enables finishing - * of span whenever a scope is closed. It is true by default. - * - * @return Scope A Scope that holds newly created Span and is activated on - * a ScopeManager. - */ - public function startActiveSpan(string $operationName, $options = []): Scope; - - /** - * Starts and returns a new span representing a unit of work. - * - * Whenever `child_of` reference is not passed then - * {@see \OpenTracing\ScopeManager::getActive()} span is used as `child_of` - * reference. In order to ignore implicit parent span pass in - * `ignore_active_span` option set to true. - * - * Starting a span with explicit parent: - * - * $tracer->startSpan('...', [ - * 'child_of' => $parentSpan, - * ]); - * - * @param string $operationName - * @param array|StartSpanOptions $options See StartSpanOptions for - * available options. - * - * @return Span - * - * @throws InvalidSpanOptionException for invalid option - * @throws InvalidReferencesSetException for invalid references set - * @see \OpenTracing\StartSpanOptions - */ - public function startSpan(string $operationName, $options = []): Span; - - /** - * @param SpanContext $spanContext - * @param string $format - * @param mixed $carrier - * @return void - * - * @throws UnsupportedFormatException when the format is not recognized by the tracer - * implementation - * @see Formats - */ - public function inject(SpanContext $spanContext, string $format, &$carrier): void; - - /** - * @param string $format - * @param mixed $carrier - * @return SpanContext|null - * - * @throws UnsupportedFormatException when the format is not recognized by the tracer - * implementation - * @see Formats - */ - public function extract(string $format, $carrier): ?SpanContext; - - /** - * Allow tracer to send span data to be instrumented. - * - * This method might not be needed depending on the tracing implementation - * but one should make sure this method is called after the request is delivered - * to the client. - * - * As an implementor, a good idea would be to use {@see register_shutdown_function} - * or {@see fastcgi_finish_request} in order to not to delay the end of the request - * to the client. - */ - public function flush(): void; -} diff --git a/vendor/opentracing/opentracing/src/OpenTracing/UnsupportedFormatException.php b/vendor/opentracing/opentracing/src/OpenTracing/UnsupportedFormatException.php deleted file mode 100644 index dd4ef56a3..000000000 --- a/vendor/opentracing/opentracing/src/OpenTracing/UnsupportedFormatException.php +++ /dev/null @@ -1,22 +0,0 @@ -assertNull($scopeManager->getActive()); - } - - public function testActivateSuccess() - { - $tracer = new MockTracer(); - $span = $tracer->startSpan(self::OPERATION_NAME); - $scopeManager = new MockScopeManager(); - $scopeManager->activate($span); - - $this->assertSame($span, $scopeManager->getActive()->getSpan()); - } - - public function testGetScopeReturnsNull() - { - $tracer = new MockTracer(); - $tracer->startSpan(self::OPERATION_NAME); - $scopeManager = new MockScopeManager(); - - $this->assertNull($scopeManager->getActive()); - } - - public function testGetScopeSuccess() - { - $tracer = new MockTracer(); - $span = $tracer->startSpan(self::OPERATION_NAME); - $scopeManager = new MockScopeManager(); - $scopeManager->activate($span); - $scope = $scopeManager->getActive(); - - $this->assertSame($span, $scope->getSpan()); - } - - public function testDeactivateSuccess() - { - $tracer = new MockTracer(); - $span = $tracer->startSpan(self::OPERATION_NAME); - $scopeManager = new MockScopeManager(); - $scopeManager->activate($span); - $scope = $scopeManager->getActive(); - $scopeManager->deactivate($scope); - - $this->assertNull($scopeManager->getActive()); - } -} diff --git a/vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockSpanContextTest.php b/vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockSpanContextTest.php deleted file mode 100644 index 501450b24..000000000 --- a/vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockSpanContextTest.php +++ /dev/null @@ -1,54 +0,0 @@ -assertEquals($parentContext->getTraceId(), $childContext->getTraceId()); - } - - public function testCreateMockSpanContextSuccess() - { - $spanContext = MockSpanContext::create( - self::TRACE_ID, - self::SPAN_ID, - self::IS_SAMPLED, - [self::BAGGAGE_ITEM_KEY => self::BAGGAGE_ITEM_VALUE] - ); - - $this->assertEquals($spanContext->getTraceId(), self::TRACE_ID); - $this->assertEquals($spanContext->getSpanId(), self::SPAN_ID); - $this->assertEquals($spanContext->isSampled(), self::IS_SAMPLED); - $this->assertEquals([self::BAGGAGE_ITEM_KEY => self::BAGGAGE_ITEM_VALUE], iterator_to_array($spanContext)); - $this->assertEquals(self::BAGGAGE_ITEM_VALUE, $spanContext->getBaggageItem(self::BAGGAGE_ITEM_KEY)); - } - - public function testAddBaggageItemSuccess() - { - $spanContext = MockSpanContext::create( - self::TRACE_ID, - self::SPAN_ID, - self::IS_SAMPLED - ); - $this->assertEmpty(iterator_to_array($spanContext)); - - $spanContext = $spanContext->withBaggageItem(self::BAGGAGE_ITEM_KEY, self::BAGGAGE_ITEM_VALUE); - $this->assertEquals([self::BAGGAGE_ITEM_KEY => self::BAGGAGE_ITEM_VALUE], iterator_to_array($spanContext)); - } -} diff --git a/vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockSpanTest.php b/vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockSpanTest.php deleted file mode 100644 index 51e4b66f8..000000000 --- a/vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockSpanTest.php +++ /dev/null @@ -1,52 +0,0 @@ -assertEquals($startTime, $span->getStartTime()); - $this->assertEmpty($span->getTags()); - $this->assertEmpty($span->getLogs()); - } - - public function testAddTagsAndLogsToSpanSuccess() - { - $span = new MockSpan(self::OPERATION_NAME, MockSpanContext::createAsRoot()); - - $span->setTag(self::TAG_KEY, self::TAG_VALUE); - $span->log([self::LOG_FIELD]); - - $this->assertEquals([self::TAG_KEY => self::TAG_VALUE], $span->getTags()); - $this->assertEquals(self::LOG_FIELD, $span->getLogs()[0]['fields'][0]); - } - - public function testSpanIsFinished() - { - $startTime = time(); - $span = new MockSpan(self::OPERATION_NAME, MockSpanContext::createAsRoot(), $startTime); - $span->finish($startTime + self::DURATION); - - $this->assertTrue($span->isFinished()); - $this->assertEquals(self::DURATION, $span->getDuration()); - } -} diff --git a/vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockTracerTest.php b/vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockTracerTest.php deleted file mode 100644 index ab2faf159..000000000 --- a/vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockTracerTest.php +++ /dev/null @@ -1,139 +0,0 @@ -startActiveSpan(self::OPERATION_NAME); - $activeSpan = $tracer->getActiveSpan(); - - $this->assertEquals($scope->getSpan(), $activeSpan); - } - - public function testStartSpanSuccess() - { - $tracer = new MockTracer(); - $tracer->startSpan(self::OPERATION_NAME); - $activeSpan = $tracer->getActiveSpan(); - - $this->assertNull($activeSpan); - } - - public function testStartSpanWithReference(): void - { - $tracer = new MockTracer(); - $tracer->startSpan('parent_name'); - /** @var Span $parentSpan */ - $parentSpan = $tracer->getSpans()[0]; - $tracer->startSpan( - self::OPERATION_NAME, - ['references' => [Reference::createForSpan(Reference::CHILD_OF, $parentSpan)]] - ); - $activeSpan = $tracer->getActiveSpan(); - - self::assertNull($activeSpan); - } - - public function testStartSpanWithReferenceWithoutExpectedContextType(): void - { - $tracer = new MockTracer(); - $notAMockContext = new NoopSpanContext(); - - $this->expectException(InvalidReferenceArgumentException::class); - - $tracer->startSpan( - self::OPERATION_NAME, - ['references' => [new Reference(Reference::CHILD_OF, $notAMockContext)]] - ); - } - - public function testInjectWithNoInjectorsFails() - { - $tracer = new MockTracer(); - $span = $tracer->startSpan(self::OPERATION_NAME); - $carrier = []; - - $this->expectException(UnsupportedFormatException::class); - $tracer->inject($span->getContext(), self::FORMAT, $carrier); - } - - public function testInjectSuccess() - { - $actualSpanContext = null; - $actualCarrier = null; - - $injector = function ($spanContext, &$carrier) use (&$actualSpanContext, &$actualCarrier) { - $actualSpanContext = $spanContext; - $actualCarrier = $carrier; - }; - - $tracer = new MockTracer([self::FORMAT => $injector]); - $span = $tracer->startSpan(self::OPERATION_NAME); - $carrier = []; - $tracer->inject($span->getContext(), self::FORMAT, $carrier); - - $this->assertSame($span->getContext(), $actualSpanContext); - $this->assertSame($carrier, $actualCarrier); - } - - public function testExtractWithNoExtractorsFails() - { - $tracer = new MockTracer(); - $carrier = []; - - $this->expectException(UnsupportedFormatException::class); - $tracer->extract(self::FORMAT, $carrier); - } - - public function testExtractSuccess() - { - $actualSpanContext = null; - $actualCarrier = null; - - $extractor = function ($carrier) use (&$actualCarrier) { - $actualCarrier = $carrier; - return new NoopSpanContext(); - }; - - $tracer = new MockTracer([], [self::FORMAT => $extractor]); - $carrier = [ - 'TRACE_ID' => 'trace_id' - ]; - - $spanContext = $tracer->extract(self::FORMAT, $carrier); - - $this->assertInstanceOf(SpanContext::class, $spanContext); - } - - public function testFlushSuccess() - { - $tracer = new MockTracer(); - $tracer->startSpan(self::OPERATION_NAME); - - $this->assertCount(1, $tracer->getSpans()); - - $tracer->flush(); - - $this->assertCount(0, $tracer->getSpans()); - } -} diff --git a/vendor/opentracing/opentracing/tests/OpenTracing/ReferenceTest.php b/vendor/opentracing/opentracing/tests/OpenTracing/ReferenceTest.php deleted file mode 100644 index cb971a20c..000000000 --- a/vendor/opentracing/opentracing/tests/OpenTracing/ReferenceTest.php +++ /dev/null @@ -1,45 +0,0 @@ -expectException(TypeError::class); - new Reference('child_of', $context); - } - - public function testCreateAReferenceFailsOnEmptyType() - { - $context = new NoopSpanContext(); - - $this->expectException(InvalidReferenceArgumentException::class); - $this->expectExceptionMessage('Reference type can not be an empty string'); - new Reference('', $context); - } - - public function testAReferenceCanBeCreatedAsACustomType() - { - $context = new NoopSpanContext(); - $reference = new Reference(self::REFERENCE_TYPE, $context); - - $this->assertSame($context, $reference->getSpanContext()); - $this->assertTrue($reference->isType(self::REFERENCE_TYPE)); - } -} diff --git a/vendor/opentracing/opentracing/tests/OpenTracing/StartSpanOptionsTest.php b/vendor/opentracing/opentracing/tests/OpenTracing/StartSpanOptionsTest.php deleted file mode 100644 index d7e1504a8..000000000 --- a/vendor/opentracing/opentracing/tests/OpenTracing/StartSpanOptionsTest.php +++ /dev/null @@ -1,129 +0,0 @@ -expectException(InvalidSpanOptionException::class); - - StartSpanOptions::create([ - 'unknown_option' => 'value' - ]); - } - - public function testSpanOptionsWithInvalidCloseOnFinishOption() - { - $this->expectException(InvalidSpanOptionException::class); - - StartSpanOptions::create([ - 'finish_span_on_close' => 'value' - ]); - } - - public function testSpanOptionsCanNotBeCreatedBecauseInvalidStartTime() - { - $this->expectException(InvalidSpanOptionException::class); - - StartSpanOptions::create([ - 'start_time' => 'abc' - ]); - } - - /** @dataProvider validStartTime */ - public function testSpanOptionsCanBeCreatedBecauseWithValidStartTime($startTime) - { - $spanOptions = StartSpanOptions::create([ - 'start_time' => $startTime - ]); - - $this->assertEquals($spanOptions->getStartTime(), $startTime); - } - - public function validStartTime() - { - return [ - [new DateTime()], - ['1499355363'], - [1499355363], - [1499355363.123456] - ]; - } - - public function testSpanOptionsCanBeCreatedWithValidReference() - { - $context = new NoopSpanContext(); - - $options = [ - 'references' => new Reference(self::REFERENCE_TYPE, $context), - ]; - - $spanOptions = StartSpanOptions::create($options); - $references = $spanOptions->getReferences()[0]; - - $this->assertTrue($references->isType(self::REFERENCE_TYPE)); - $this->assertSame($context, $references->getSpanContext()); - } - - public function testSpanOptionsDefaultCloseOnFinishValue() - { - $options = StartSpanOptions::create([]); - - $this->assertTrue($options->shouldFinishSpanOnClose()); - } - - public function testSpanOptionsWithValidFinishSpanOnClose() - { - $options = StartSpanOptions::create([ - 'finish_span_on_close' => false, - ]); - - $this->assertFalse($options->shouldFinishSpanOnClose()); - } - - public function testSpanOptionsAddsANewReference() - { - $context1 = new NoopSpanContext(); - $spanOptions = StartSpanOptions::create([ - 'child_of' => $context1, - ]); - $this->assertCount(1, $spanOptions->getReferences()); - - $context2 = new NoopSpanContext(); - $spanOptions = $spanOptions->withParent($context2); - - $this->assertCount(1, $spanOptions->getReferences()); - $this->assertSame($context2, $spanOptions->getReferences()[0]->getSpanContext()); - } - - public function testDefaultIgnoreActiveSpan() - { - $options = StartSpanOptions::create([]); - - $this->assertFalse($options->shouldIgnoreActiveSpan()); - } - - public function testSpanOptionsWithValidIgnoreActiveSpan() - { - $options = StartSpanOptions::create([ - 'ignore_active_span' => true, - ]); - - $this->assertTrue($options->shouldIgnoreActiveSpan()); - } -} diff --git a/vendor/packaged/thrift/.gitignore b/vendor/packaged/thrift/.gitignore deleted file mode 100644 index ff72e2d08..000000000 --- a/vendor/packaged/thrift/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/composer.lock -/vendor diff --git a/vendor/packaged/thrift/README.md b/vendor/packaged/thrift/README.md deleted file mode 100644 index c35ca057e..000000000 --- a/vendor/packaged/thrift/README.md +++ /dev/null @@ -1,44 +0,0 @@ -Apache Thrift -===== - -The code provided by this library is from: -https://github.com/apache/thrift/tree/master/lib/php/lib - -This repo has been created to provide the thrift protocol via composer - - -Thrift PHP Software Library - -License -======= - -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. - -Dependencies -============ - -PHP_INT_SIZE - - This built-in signals whether your architecture is 32 or 64 bit and is - used by the TBinaryProtocol to properly use pack() and unpack() to - serialize data. - -apc_fetch(), apc_store() - - APC cache is used by the TSocketPool class. If you do not have APC installed, - Thrift will fill in null stub function definitions. diff --git a/vendor/packaged/thrift/composer.json b/vendor/packaged/thrift/composer.json deleted file mode 100644 index 8a8227dd3..000000000 --- a/vendor/packaged/thrift/composer.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "packaged/thrift", - "description": "Apache Thrift", - "keywords": ["thrift", "apache"], - "homepage": "http://thrift.apache.org/", - "minimum-stability": "stable", - "license": "Apache-2.0", - "require": { - "php": "^5.5 || ^7.0 || ^8.0" - }, - "autoload": { - "psr-4": { - "Thrift\\": "src/" - } - } -} diff --git a/vendor/packaged/thrift/src/Base/TBase.php b/vendor/packaged/thrift/src/Base/TBase.php deleted file mode 100644 index c61b631af..000000000 --- a/vendor/packaged/thrift/src/Base/TBase.php +++ /dev/null @@ -1,382 +0,0 @@ - 'Bool', - TType::BYTE => 'Byte', - TType::I16 => 'I16', - TType::I32 => 'I32', - TType::I64 => 'I64', - TType::DOUBLE => 'Double', - TType::STRING => 'String' - ); - - abstract public function read($input); - - abstract public function write($output); - - public function __construct($spec = null, $vals = null) - { - if (is_array($spec) && is_array($vals)) { - foreach ($spec as $fid => $fspec) { - $var = $fspec['var']; - if (isset($vals[$var])) { - $this->$var = $vals[$var]; - } - } - } - } - - public function __wakeup() - { - $this->__construct(get_object_vars($this)); - } - - private function _readMap(&$var, $spec, $input) - { - $xfer = 0; - $ktype = $spec['ktype']; - $vtype = $spec['vtype']; - $kread = $vread = null; - if (isset(TBase::$tmethod[$ktype])) { - $kread = 'read' . TBase::$tmethod[$ktype]; - } else { - $kspec = $spec['key']; - } - if (isset(TBase::$tmethod[$vtype])) { - $vread = 'read' . TBase::$tmethod[$vtype]; - } else { - $vspec = $spec['val']; - } - $var = array(); - $_ktype = $_vtype = $size = 0; - $xfer += $input->readMapBegin($_ktype, $_vtype, $size); - for ($i = 0; $i < $size; ++$i) { - $key = $val = null; - if ($kread !== null) { - $xfer += $input->$kread($key); - } else { - switch ($ktype) { - case TType::STRUCT: - $class = $kspec['class']; - $key = new $class(); - $xfer += $key->read($input); - break; - case TType::MAP: - $xfer += $this->_readMap($key, $kspec, $input); - break; - case TType::LST: - $xfer += $this->_readList($key, $kspec, $input, false); - break; - case TType::SET: - $xfer += $this->_readList($key, $kspec, $input, true); - break; - } - } - if ($vread !== null) { - $xfer += $input->$vread($val); - } else { - switch ($vtype) { - case TType::STRUCT: - $class = $vspec['class']; - $val = new $class(); - $xfer += $val->read($input); - break; - case TType::MAP: - $xfer += $this->_readMap($val, $vspec, $input); - break; - case TType::LST: - $xfer += $this->_readList($val, $vspec, $input, false); - break; - case TType::SET: - $xfer += $this->_readList($val, $vspec, $input, true); - break; - } - } - $var[$key] = $val; - } - $xfer += $input->readMapEnd(); - - return $xfer; - } - - private function _readList(&$var, $spec, $input, $set = false) - { - $xfer = 0; - $etype = $spec['etype']; - $eread = $vread = null; - if (isset(TBase::$tmethod[$etype])) { - $eread = 'read' . TBase::$tmethod[$etype]; - } else { - $espec = $spec['elem']; - } - $var = array(); - $_etype = $size = 0; - if ($set) { - $xfer += $input->readSetBegin($_etype, $size); - } else { - $xfer += $input->readListBegin($_etype, $size); - } - for ($i = 0; $i < $size; ++$i) { - $elem = null; - if ($eread !== null) { - $xfer += $input->$eread($elem); - } else { - $espec = $spec['elem']; - switch ($etype) { - case TType::STRUCT: - $class = $espec['class']; - $elem = new $class(); - $xfer += $elem->read($input); - break; - case TType::MAP: - $xfer += $this->_readMap($elem, $espec, $input); - break; - case TType::LST: - $xfer += $this->_readList($elem, $espec, $input, false); - break; - case TType::SET: - $xfer += $this->_readList($elem, $espec, $input, true); - break; - } - } - if ($set) { - $var[$elem] = true; - } else { - $var [] = $elem; - } - } - if ($set) { - $xfer += $input->readSetEnd(); - } else { - $xfer += $input->readListEnd(); - } - - return $xfer; - } - - protected function _read($class, $spec, $input) - { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - if (isset($spec[$fid])) { - $fspec = $spec[$fid]; - $var = $fspec['var']; - if ($ftype == $fspec['type']) { - $xfer = 0; - if (isset(TBase::$tmethod[$ftype])) { - $func = 'read' . TBase::$tmethod[$ftype]; - $xfer += $input->$func($this->$var); - } else { - switch ($ftype) { - case TType::STRUCT: - $class = $fspec['class']; - $this->$var = new $class(); - $xfer += $this->$var->read($input); - break; - case TType::MAP: - $xfer += $this->_readMap($this->$var, $fspec, $input); - break; - case TType::LST: - $xfer += $this->_readList($this->$var, $fspec, $input, false); - break; - case TType::SET: - $xfer += $this->_readList($this->$var, $fspec, $input, true); - break; - } - } - } else { - $xfer += $input->skip($ftype); - } - } else { - $xfer += $input->skip($ftype); - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - - return $xfer; - } - - private function _writeMap($var, $spec, $output) - { - $xfer = 0; - $ktype = $spec['ktype']; - $vtype = $spec['vtype']; - $kwrite = $vwrite = null; - if (isset(TBase::$tmethod[$ktype])) { - $kwrite = 'write' . TBase::$tmethod[$ktype]; - } else { - $kspec = $spec['key']; - } - if (isset(TBase::$tmethod[$vtype])) { - $vwrite = 'write' . TBase::$tmethod[$vtype]; - } else { - $vspec = $spec['val']; - } - $xfer += $output->writeMapBegin($ktype, $vtype, count($var)); - foreach ($var as $key => $val) { - if (isset($kwrite)) { - $xfer += $output->$kwrite($key); - } else { - switch ($ktype) { - case TType::STRUCT: - $xfer += $key->write($output); - break; - case TType::MAP: - $xfer += $this->_writeMap($key, $kspec, $output); - break; - case TType::LST: - $xfer += $this->_writeList($key, $kspec, $output, false); - break; - case TType::SET: - $xfer += $this->_writeList($key, $kspec, $output, true); - break; - } - } - if (isset($vwrite)) { - $xfer += $output->$vwrite($val); - } else { - switch ($vtype) { - case TType::STRUCT: - $xfer += $val->write($output); - break; - case TType::MAP: - $xfer += $this->_writeMap($val, $vspec, $output); - break; - case TType::LST: - $xfer += $this->_writeList($val, $vspec, $output, false); - break; - case TType::SET: - $xfer += $this->_writeList($val, $vspec, $output, true); - break; - } - } - } - $xfer += $output->writeMapEnd(); - - return $xfer; - } - - private function _writeList($var, $spec, $output, $set = false) - { - $xfer = 0; - $etype = $spec['etype']; - $ewrite = null; - if (isset(TBase::$tmethod[$etype])) { - $ewrite = 'write' . TBase::$tmethod[$etype]; - } else { - $espec = $spec['elem']; - } - if ($set) { - $xfer += $output->writeSetBegin($etype, count($var)); - } else { - $xfer += $output->writeListBegin($etype, count($var)); - } - foreach ($var as $key => $val) { - $elem = $set ? $key : $val; - if (isset($ewrite)) { - $xfer += $output->$ewrite($elem); - } else { - switch ($etype) { - case TType::STRUCT: - $xfer += $elem->write($output); - break; - case TType::MAP: - $xfer += $this->_writeMap($elem, $espec, $output); - break; - case TType::LST: - $xfer += $this->_writeList($elem, $espec, $output, false); - break; - case TType::SET: - $xfer += $this->_writeList($elem, $espec, $output, true); - break; - } - } - } - if ($set) { - $xfer += $output->writeSetEnd(); - } else { - $xfer += $output->writeListEnd(); - } - - return $xfer; - } - - protected function _write($class, $spec, $output) - { - $xfer = 0; - $xfer += $output->writeStructBegin($class); - foreach ($spec as $fid => $fspec) { - $var = $fspec['var']; - if ($this->$var !== null) { - $ftype = $fspec['type']; - $xfer += $output->writeFieldBegin($var, $ftype, $fid); - if (isset(TBase::$tmethod[$ftype])) { - $func = 'write' . TBase::$tmethod[$ftype]; - $xfer += $output->$func($this->$var); - } else { - switch ($ftype) { - case TType::STRUCT: - $xfer += $this->$var->write($output); - break; - case TType::MAP: - $xfer += $this->_writeMap($this->$var, $fspec, $output); - break; - case TType::LST: - $xfer += $this->_writeList($this->$var, $fspec, $output, false); - break; - case TType::SET: - $xfer += $this->_writeList($this->$var, $fspec, $output, true); - break; - } - } - $xfer += $output->writeFieldEnd(); - } - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - - return $xfer; - } -} diff --git a/vendor/packaged/thrift/src/ClassLoader/ThriftClassLoader.php b/vendor/packaged/thrift/src/ClassLoader/ThriftClassLoader.php deleted file mode 100644 index 4361bd84e..000000000 --- a/vendor/packaged/thrift/src/ClassLoader/ThriftClassLoader.php +++ /dev/null @@ -1,206 +0,0 @@ -apc = $apc; - $this->apc_prefix = $apc_prefix; - } - - /** - * Registers a namespace. - * - * @param string $namespace The namespace - * @param array|string $paths The location(s) of the namespace - */ - public function registerNamespace($namespace, $paths) - { - $this->namespaces[$namespace] = (array)$paths; - } - - /** - * Registers a Thrift definition namespace. - * - * @param string $namespace The definition namespace - * @param array|string $paths The location(s) of the definition namespace - */ - public function registerDefinition($namespace, $paths) - { - $this->definitions[$namespace] = (array)$paths; - } - - /** - * Registers this instance as an autoloader. - * - * @param Boolean $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Loads the given class, definition or interface. - * - * @param string $class The name of the class - */ - public function loadClass($class) - { - if ((true === $this->apc && ($file = $this->findFileInApc($class))) or - ($file = $this->findFile($class)) - ) { - require_once $file; - } - } - - /** - * Loads the given class or interface in APC. - * @param string $class The name of the class - * @return string - */ - protected function findFileInApc($class) - { - if (false === $file = apc_fetch($this->apc_prefix . $class)) { - apc_store($this->apc_prefix . $class, $file = $this->findFile($class)); - } - - return $file; - } - - /** - * Find class in namespaces or definitions directories - * @param string $class - * @return string - */ - public function findFile($class) - { - // Remove first backslash - if ('\\' == $class[0]) { - $class = substr($class, 1); - } - - if (false !== $pos = strrpos($class, '\\')) { - // Namespaced class name - $namespace = substr($class, 0, $pos); - - // Iterate in normal namespaces - foreach ($this->namespaces as $ns => $dirs) { - //Don't interfere with other autoloaders - if (0 !== strpos($namespace, $ns)) { - continue; - } - - foreach ($dirs as $dir) { - $className = substr($class, $pos + 1); - - $file = $dir . DIRECTORY_SEPARATOR . - str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . - DIRECTORY_SEPARATOR . - $className . '.php'; - - if (file_exists($file)) { - return $file; - } - } - } - - // Iterate in Thrift namespaces - - // Remove first part of namespace - $m = explode('\\', $class); - - // Ignore wrong call - if (count($m) <= 1) { - return; - } - - $class = array_pop($m); - $namespace = implode('\\', $m); - - foreach ($this->definitions as $ns => $dirs) { - //Don't interfere with other autoloaders - if (0 !== strpos($namespace, $ns)) { - continue; - } - - foreach ($dirs as $dir) { - /** - * Available in service: Interface, Client, Processor, Rest - * And every service methods (_.+) - */ - if (0 === preg_match('#(.+)(if|client|processor|rest)$#i', $class, $n) and - 0 === preg_match('#(.+)_[a-z0-9]+_(args|result)$#i', $class, $n) - ) { - $className = 'Types'; - } else { - $className = $n[1]; - } - - $file = $dir . DIRECTORY_SEPARATOR . - str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . - DIRECTORY_SEPARATOR . - $className . '.php'; - - if (file_exists($file)) { - return $file; - } - } - } - } - } -} diff --git a/vendor/packaged/thrift/src/Exception/TApplicationException.php b/vendor/packaged/thrift/src/Exception/TApplicationException.php deleted file mode 100644 index ebb6a6a89..000000000 --- a/vendor/packaged/thrift/src/Exception/TApplicationException.php +++ /dev/null @@ -1,76 +0,0 @@ - array('var' => 'message', - 'type' => TType::STRING), - 2 => array('var' => 'code', - 'type' => TType::I32)); - - const UNKNOWN = 0; - const UNKNOWN_METHOD = 1; - const INVALID_MESSAGE_TYPE = 2; - const WRONG_METHOD_NAME = 3; - const BAD_SEQUENCE_ID = 4; - const MISSING_RESULT = 5; - const INTERNAL_ERROR = 6; - const PROTOCOL_ERROR = 7; - const INVALID_TRANSFORM = 8; - const INVALID_PROTOCOL = 9; - const UNSUPPORTED_CLIENT_TYPE = 10; - - public function __construct($message = null, $code = 0) - { - parent::__construct($message, $code); - } - - public function read($output) - { - return $this->_read('TApplicationException', self::$_TSPEC, $output); - } - - public function write($output) - { - $xfer = 0; - $xfer += $output->writeStructBegin('TApplicationException'); - if ($message = $this->getMessage()) { - $xfer += $output->writeFieldBegin('message', TType::STRING, 1); - $xfer += $output->writeString($message); - $xfer += $output->writeFieldEnd(); - } - if ($code = $this->getCode()) { - $xfer += $output->writeFieldBegin('type', TType::I32, 2); - $xfer += $output->writeI32($code); - $xfer += $output->writeFieldEnd(); - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - - return $xfer; - } -} diff --git a/vendor/packaged/thrift/src/Exception/TException.php b/vendor/packaged/thrift/src/Exception/TException.php deleted file mode 100644 index 7dbf83293..000000000 --- a/vendor/packaged/thrift/src/Exception/TException.php +++ /dev/null @@ -1,384 +0,0 @@ - $fspec) { - $var = $fspec['var']; - if (isset($vals[$var])) { - $this->$var = $vals[$var]; - } - } - } else { - parent::__construct($p1, $p2); - } - } - - public static $tmethod = array( - TType::BOOL => 'Bool', - TType::BYTE => 'Byte', - TType::I16 => 'I16', - TType::I32 => 'I32', - TType::I64 => 'I64', - TType::DOUBLE => 'Double', - TType::STRING => 'String' - ); - - private function _readMap(&$var, $spec, $input) - { - $xfer = 0; - $ktype = $spec['ktype']; - $vtype = $spec['vtype']; - $kread = $vread = null; - if (isset(TBase::$tmethod[$ktype])) { - $kread = 'read' . TBase::$tmethod[$ktype]; - } else { - $kspec = $spec['key']; - } - if (isset(TBase::$tmethod[$vtype])) { - $vread = 'read' . TBase::$tmethod[$vtype]; - } else { - $vspec = $spec['val']; - } - $var = array(); - $_ktype = $_vtype = $size = 0; - $xfer += $input->readMapBegin($_ktype, $_vtype, $size); - for ($i = 0; $i < $size; ++$i) { - $key = $val = null; - if ($kread !== null) { - $xfer += $input->$kread($key); - } else { - switch ($ktype) { - case TType::STRUCT: - $class = $kspec['class']; - $key = new $class(); - $xfer += $key->read($input); - break; - case TType::MAP: - $xfer += $this->_readMap($key, $kspec, $input); - break; - case TType::LST: - $xfer += $this->_readList($key, $kspec, $input, false); - break; - case TType::SET: - $xfer += $this->_readList($key, $kspec, $input, true); - break; - } - } - if ($vread !== null) { - $xfer += $input->$vread($val); - } else { - switch ($vtype) { - case TType::STRUCT: - $class = $vspec['class']; - $val = new $class(); - $xfer += $val->read($input); - break; - case TType::MAP: - $xfer += $this->_readMap($val, $vspec, $input); - break; - case TType::LST: - $xfer += $this->_readList($val, $vspec, $input, false); - break; - case TType::SET: - $xfer += $this->_readList($val, $vspec, $input, true); - break; - } - } - $var[$key] = $val; - } - $xfer += $input->readMapEnd(); - - return $xfer; - } - - private function _readList(&$var, $spec, $input, $set = false) - { - $xfer = 0; - $etype = $spec['etype']; - $eread = $vread = null; - if (isset(TBase::$tmethod[$etype])) { - $eread = 'read' . TBase::$tmethod[$etype]; - } else { - $espec = $spec['elem']; - } - $var = array(); - $_etype = $size = 0; - if ($set) { - $xfer += $input->readSetBegin($_etype, $size); - } else { - $xfer += $input->readListBegin($_etype, $size); - } - for ($i = 0; $i < $size; ++$i) { - $elem = null; - if ($eread !== null) { - $xfer += $input->$eread($elem); - } else { - $espec = $spec['elem']; - switch ($etype) { - case TType::STRUCT: - $class = $espec['class']; - $elem = new $class(); - $xfer += $elem->read($input); - break; - case TType::MAP: - $xfer += $this->_readMap($elem, $espec, $input); - break; - case TType::LST: - $xfer += $this->_readList($elem, $espec, $input, false); - break; - case TType::SET: - $xfer += $this->_readList($elem, $espec, $input, true); - break; - } - } - if ($set) { - $var[$elem] = true; - } else { - $var [] = $elem; - } - } - if ($set) { - $xfer += $input->readSetEnd(); - } else { - $xfer += $input->readListEnd(); - } - - return $xfer; - } - - protected function _read($class, $spec, $input) - { - $xfer = 0; - $fname = null; - $ftype = 0; - $fid = 0; - $xfer += $input->readStructBegin($fname); - while (true) { - $xfer += $input->readFieldBegin($fname, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - if (isset($spec[$fid])) { - $fspec = $spec[$fid]; - $var = $fspec['var']; - if ($ftype == $fspec['type']) { - $xfer = 0; - if (isset(TBase::$tmethod[$ftype])) { - $func = 'read' . TBase::$tmethod[$ftype]; - $xfer += $input->$func($this->$var); - } else { - switch ($ftype) { - case TType::STRUCT: - $class = $fspec['class']; - $this->$var = new $class(); - $xfer += $this->$var->read($input); - break; - case TType::MAP: - $xfer += $this->_readMap($this->$var, $fspec, $input); - break; - case TType::LST: - $xfer += $this->_readList($this->$var, $fspec, $input, false); - break; - case TType::SET: - $xfer += $this->_readList($this->$var, $fspec, $input, true); - break; - } - } - } else { - $xfer += $input->skip($ftype); - } - } else { - $xfer += $input->skip($ftype); - } - $xfer += $input->readFieldEnd(); - } - $xfer += $input->readStructEnd(); - - return $xfer; - } - - private function _writeMap($var, $spec, $output) - { - $xfer = 0; - $ktype = $spec['ktype']; - $vtype = $spec['vtype']; - $kwrite = $vwrite = null; - if (isset(TBase::$tmethod[$ktype])) { - $kwrite = 'write' . TBase::$tmethod[$ktype]; - } else { - $kspec = $spec['key']; - } - if (isset(TBase::$tmethod[$vtype])) { - $vwrite = 'write' . TBase::$tmethod[$vtype]; - } else { - $vspec = $spec['val']; - } - $xfer += $output->writeMapBegin($ktype, $vtype, count($var)); - foreach ($var as $key => $val) { - if (isset($kwrite)) { - $xfer += $output->$kwrite($key); - } else { - switch ($ktype) { - case TType::STRUCT: - $xfer += $key->write($output); - break; - case TType::MAP: - $xfer += $this->_writeMap($key, $kspec, $output); - break; - case TType::LST: - $xfer += $this->_writeList($key, $kspec, $output, false); - break; - case TType::SET: - $xfer += $this->_writeList($key, $kspec, $output, true); - break; - } - } - if (isset($vwrite)) { - $xfer += $output->$vwrite($val); - } else { - switch ($vtype) { - case TType::STRUCT: - $xfer += $val->write($output); - break; - case TType::MAP: - $xfer += $this->_writeMap($val, $vspec, $output); - break; - case TType::LST: - $xfer += $this->_writeList($val, $vspec, $output, false); - break; - case TType::SET: - $xfer += $this->_writeList($val, $vspec, $output, true); - break; - } - } - } - $xfer += $output->writeMapEnd(); - - return $xfer; - } - - private function _writeList($var, $spec, $output, $set = false) - { - $xfer = 0; - $etype = $spec['etype']; - $ewrite = null; - if (isset(TBase::$tmethod[$etype])) { - $ewrite = 'write' . TBase::$tmethod[$etype]; - } else { - $espec = $spec['elem']; - } - if ($set) { - $xfer += $output->writeSetBegin($etype, count($var)); - } else { - $xfer += $output->writeListBegin($etype, count($var)); - } - foreach ($var as $key => $val) { - $elem = $set ? $key : $val; - if (isset($ewrite)) { - $xfer += $output->$ewrite($elem); - } else { - switch ($etype) { - case TType::STRUCT: - $xfer += $elem->write($output); - break; - case TType::MAP: - $xfer += $this->_writeMap($elem, $espec, $output); - break; - case TType::LST: - $xfer += $this->_writeList($elem, $espec, $output, false); - break; - case TType::SET: - $xfer += $this->_writeList($elem, $espec, $output, true); - break; - } - } - } - if ($set) { - $xfer += $output->writeSetEnd(); - } else { - $xfer += $output->writeListEnd(); - } - - return $xfer; - } - - protected function _write($class, $spec, $output) - { - $xfer = 0; - $xfer += $output->writeStructBegin($class); - foreach ($spec as $fid => $fspec) { - $var = $fspec['var']; - if ($this->$var !== null) { - $ftype = $fspec['type']; - $xfer += $output->writeFieldBegin($var, $ftype, $fid); - if (isset(TBase::$tmethod[$ftype])) { - $func = 'write' . TBase::$tmethod[$ftype]; - $xfer += $output->$func($this->$var); - } else { - switch ($ftype) { - case TType::STRUCT: - $xfer += $this->$var->write($output); - break; - case TType::MAP: - $xfer += $this->_writeMap($this->$var, $fspec, $output); - break; - case TType::LST: - $xfer += $this->_writeList($this->$var, $fspec, $output, false); - break; - case TType::SET: - $xfer += $this->_writeList($this->$var, $fspec, $output, true); - break; - } - } - $xfer += $output->writeFieldEnd(); - } - } - $xfer += $output->writeFieldStop(); - $xfer += $output->writeStructEnd(); - - return $xfer; - } -} diff --git a/vendor/packaged/thrift/src/Exception/TProtocolException.php b/vendor/packaged/thrift/src/Exception/TProtocolException.php deleted file mode 100644 index 3a55d45ff..000000000 --- a/vendor/packaged/thrift/src/Exception/TProtocolException.php +++ /dev/null @@ -1,50 +0,0 @@ -strictRead_ = $strictRead; - $this->strictWrite_ = $strictWrite; - } - - public function getProtocol($trans) - { - return new TBinaryProtocol($trans, $this->strictRead_, $this->strictWrite_); - } -} diff --git a/vendor/packaged/thrift/src/Factory/TCompactProtocolFactory.php b/vendor/packaged/thrift/src/Factory/TCompactProtocolFactory.php deleted file mode 100644 index 11fb8ff33..000000000 --- a/vendor/packaged/thrift/src/Factory/TCompactProtocolFactory.php +++ /dev/null @@ -1,40 +0,0 @@ -p_ = $p; - } - - public function write() - { - if ($this->first_) { - $this->first_ = false; - } else { - $this->p_->getTransport()->write(TJSONProtocol::COMMA); - } - } - - public function read() - { - if ($this->first_) { - $this->first_ = false; - } else { - $this->p_->readJSONSyntaxChar(TJSONProtocol::COMMA); - } - } -} diff --git a/vendor/packaged/thrift/src/Protocol/JSON/LookaheadReader.php b/vendor/packaged/thrift/src/Protocol/JSON/LookaheadReader.php deleted file mode 100644 index 0b18c40d0..000000000 --- a/vendor/packaged/thrift/src/Protocol/JSON/LookaheadReader.php +++ /dev/null @@ -1,57 +0,0 @@ -p_ = $p; - } - - public function read() - { - if ($this->hasData_) { - $this->hasData_ = false; - } else { - $this->data_ = $this->p_->getTransport()->readAll(1); - } - - return substr($this->data_, 0, 1); - } - - public function peek() - { - if (!$this->hasData_) { - $this->data_ = $this->p_->getTransport()->readAll(1); - } - - $this->hasData_ = true; - - return substr($this->data_, 0, 1); - } -} diff --git a/vendor/packaged/thrift/src/Protocol/JSON/PairContext.php b/vendor/packaged/thrift/src/Protocol/JSON/PairContext.php deleted file mode 100644 index 7b353c4ad..000000000 --- a/vendor/packaged/thrift/src/Protocol/JSON/PairContext.php +++ /dev/null @@ -1,64 +0,0 @@ -p_ = $p; - } - - public function write() - { - if ($this->first_) { - $this->first_ = false; - $this->colon_ = true; - } else { - $this->p_->getTransport()->write($this->colon_ ? TJSONProtocol::COLON : TJSONProtocol::COMMA); - $this->colon_ = !$this->colon_; - } - } - - public function read() - { - if ($this->first_) { - $this->first_ = false; - $this->colon_ = true; - } else { - $this->p_->readJSONSyntaxChar($this->colon_ ? TJSONProtocol::COLON : TJSONProtocol::COMMA); - $this->colon_ = !$this->colon_; - } - } - - public function escapeNum() - { - return $this->colon_; - } -} diff --git a/vendor/packaged/thrift/src/Protocol/SimpleJSON/CollectionMapKeyException.php b/vendor/packaged/thrift/src/Protocol/SimpleJSON/CollectionMapKeyException.php deleted file mode 100644 index 522b85a5b..000000000 --- a/vendor/packaged/thrift/src/Protocol/SimpleJSON/CollectionMapKeyException.php +++ /dev/null @@ -1,33 +0,0 @@ -p_ = $p; - } - - public function write() - { - if ($this->first_) { - $this->first_ = false; - } else { - $this->p_->getTransport()->write(TSimpleJSONProtocol::COMMA); - } - } -} diff --git a/vendor/packaged/thrift/src/Protocol/SimpleJSON/MapContext.php b/vendor/packaged/thrift/src/Protocol/SimpleJSON/MapContext.php deleted file mode 100644 index 61c060d09..000000000 --- a/vendor/packaged/thrift/src/Protocol/SimpleJSON/MapContext.php +++ /dev/null @@ -1,47 +0,0 @@ -isKey = !$this->isKey; - } - - public function isMapKey() - { - // we want to coerce map keys to json strings regardless - // of their type - return $this->isKey; - } -} diff --git a/vendor/packaged/thrift/src/Protocol/SimpleJSON/StructContext.php b/vendor/packaged/thrift/src/Protocol/SimpleJSON/StructContext.php deleted file mode 100644 index 38a62d1a2..000000000 --- a/vendor/packaged/thrift/src/Protocol/SimpleJSON/StructContext.php +++ /dev/null @@ -1,52 +0,0 @@ -p_ = $p; - } - - public function write() - { - if ($this->first_) { - $this->first_ = false; - $this->colon_ = true; - } else { - $this->p_->getTransport()->write( - $this->colon_ ? - TSimpleJSONProtocol::COLON : - TSimpleJSONProtocol::COMMA - ); - $this->colon_ = !$this->colon_; - } - } -} diff --git a/vendor/packaged/thrift/src/Protocol/TBinaryProtocol.php b/vendor/packaged/thrift/src/Protocol/TBinaryProtocol.php deleted file mode 100644 index cda5c0d4c..000000000 --- a/vendor/packaged/thrift/src/Protocol/TBinaryProtocol.php +++ /dev/null @@ -1,453 +0,0 @@ -strictRead_ = $strictRead; - $this->strictWrite_ = $strictWrite; - } - - public function writeMessageBegin($name, $type, $seqid) - { - if ($this->strictWrite_) { - $version = self::VERSION_1 | $type; - - return - $this->writeI32($version) + - $this->writeString($name) + - $this->writeI32($seqid); - } else { - return - $this->writeString($name) + - $this->writeByte($type) + - $this->writeI32($seqid); - } - } - - public function writeMessageEnd() - { - return 0; - } - - public function writeStructBegin($name) - { - return 0; - } - - public function writeStructEnd() - { - return 0; - } - - public function writeFieldBegin($fieldName, $fieldType, $fieldId) - { - return - $this->writeByte($fieldType) + - $this->writeI16($fieldId); - } - - public function writeFieldEnd() - { - return 0; - } - - public function writeFieldStop() - { - return - $this->writeByte(TType::STOP); - } - - public function writeMapBegin($keyType, $valType, $size) - { - return - $this->writeByte($keyType) + - $this->writeByte($valType) + - $this->writeI32($size); - } - - public function writeMapEnd() - { - return 0; - } - - public function writeListBegin($elemType, $size) - { - return - $this->writeByte($elemType) + - $this->writeI32($size); - } - - public function writeListEnd() - { - return 0; - } - - public function writeSetBegin($elemType, $size) - { - return - $this->writeByte($elemType) + - $this->writeI32($size); - } - - public function writeSetEnd() - { - return 0; - } - - public function writeBool($value) - { - $data = pack('c', $value ? 1 : 0); - $this->trans_->write($data, 1); - - return 1; - } - - public function writeByte($value) - { - $data = pack('c', $value); - $this->trans_->write($data, 1); - - return 1; - } - - public function writeI16($value) - { - $data = pack('n', $value); - $this->trans_->write($data, 2); - - return 2; - } - - public function writeI32($value) - { - $data = pack('N', $value); - $this->trans_->write($data, 4); - - return 4; - } - - public function writeI64($value) - { - // If we are on a 32bit architecture we have to explicitly deal with - // 64-bit twos-complement arithmetic since PHP wants to treat all ints - // as signed and any int over 2^31 - 1 as a float - if (PHP_INT_SIZE == 4) { - $neg = $value < 0; - - if ($neg) { - $value *= -1; - } - - $hi = (int)($value / 4294967296); - $lo = (int)$value; - - if ($neg) { - $hi = ~$hi; - $lo = ~$lo; - if (($lo & (int)0xffffffff) == (int)0xffffffff) { - $lo = 0; - $hi++; - } else { - $lo++; - } - } - $data = pack('N2', $hi, $lo); - } else { - $hi = $value >> 32; - $lo = $value & 0xFFFFFFFF; - $data = pack('N2', $hi, $lo); - } - - $this->trans_->write($data, 8); - - return 8; - } - - public function writeDouble($value) - { - $data = pack('d', $value); - $this->trans_->write(strrev($data), 8); - - return 8; - } - - public function writeString($value) - { - $len = TStringFuncFactory::create()->strlen($value); - $result = $this->writeI32($len); - if ($len) { - $this->trans_->write($value, $len); - } - - return $result + $len; - } - - public function readMessageBegin(&$name, &$type, &$seqid) - { - $result = $this->readI32($sz); - if ($sz < 0) { - $version = (int)($sz & self::VERSION_MASK); - if ($version != (int)self::VERSION_1) { - throw new TProtocolException('Bad version identifier: ' . $sz, TProtocolException::BAD_VERSION); - } - $type = $sz & 0x000000ff; - $result += - $this->readString($name) + - $this->readI32($seqid); - } else { - if ($this->strictRead_) { - throw new TProtocolException( - 'No version identifier, old protocol client?', - TProtocolException::BAD_VERSION - ); - } else { - // Handle pre-versioned input - $name = $this->trans_->readAll($sz); - $result += - $sz + - $this->readByte($type) + - $this->readI32($seqid); - } - } - - return $result; - } - - public function readMessageEnd() - { - return 0; - } - - public function readStructBegin(&$name) - { - $name = ''; - - return 0; - } - - public function readStructEnd() - { - return 0; - } - - public function readFieldBegin(&$name, &$fieldType, &$fieldId) - { - $result = $this->readByte($fieldType); - if ($fieldType == TType::STOP) { - $fieldId = 0; - - return $result; - } - $result += $this->readI16($fieldId); - - return $result; - } - - public function readFieldEnd() - { - return 0; - } - - public function readMapBegin(&$keyType, &$valType, &$size) - { - return - $this->readByte($keyType) + - $this->readByte($valType) + - $this->readI32($size); - } - - public function readMapEnd() - { - return 0; - } - - public function readListBegin(&$elemType, &$size) - { - return - $this->readByte($elemType) + - $this->readI32($size); - } - - public function readListEnd() - { - return 0; - } - - public function readSetBegin(&$elemType, &$size) - { - return - $this->readByte($elemType) + - $this->readI32($size); - } - - public function readSetEnd() - { - return 0; - } - - public function readBool(&$value) - { - $data = $this->trans_->readAll(1); - $arr = unpack('c', $data); - $value = $arr[1] == 1; - - return 1; - } - - public function readByte(&$value) - { - $data = $this->trans_->readAll(1); - $arr = unpack('c', $data); - $value = $arr[1]; - - return 1; - } - - public function readI16(&$value) - { - $data = $this->trans_->readAll(2); - $arr = unpack('n', $data); - $value = $arr[1]; - if ($value > 0x7fff) { - $value = 0 - (($value - 1) ^ 0xffff); - } - - return 2; - } - - public function readI32(&$value) - { - $data = $this->trans_->readAll(4); - $arr = unpack('N', $data); - $value = $arr[1]; - if ($value > 0x7fffffff) { - $value = 0 - (($value - 1) ^ 0xffffffff); - } - - return 4; - } - - public function readI64(&$value) - { - $data = $this->trans_->readAll(8); - - $arr = unpack('N2', $data); - - // If we are on a 32bit architecture we have to explicitly deal with - // 64-bit twos-complement arithmetic since PHP wants to treat all ints - // as signed and any int over 2^31 - 1 as a float - if (PHP_INT_SIZE == 4) { - $hi = $arr[1]; - $lo = $arr[2]; - $isNeg = $hi < 0; - - // Check for a negative - if ($isNeg) { - $hi = ~$hi & (int)0xffffffff; - $lo = ~$lo & (int)0xffffffff; - - if ($lo == (int)0xffffffff) { - $hi++; - $lo = 0; - } else { - $lo++; - } - } - - // Force 32bit words in excess of 2G to pe positive - we deal wigh sign - // explicitly below - - if ($hi & (int)0x80000000) { - $hi &= (int)0x7fffffff; - $hi += 0x80000000; - } - - if ($lo & (int)0x80000000) { - $lo &= (int)0x7fffffff; - $lo += 0x80000000; - } - - $value = $hi * 4294967296 + $lo; - - if ($isNeg) { - $value = 0 - $value; - } - } else { - // Upcast negatives in LSB bit - if ($arr[2] & 0x80000000) { - $arr[2] = $arr[2] & 0xffffffff; - } - - // Check for a negative - if ($arr[1] & 0x80000000) { - $arr[1] = $arr[1] & 0xffffffff; - $arr[1] = $arr[1] ^ 0xffffffff; - $arr[2] = $arr[2] ^ 0xffffffff; - $value = 0 - $arr[1] * 4294967296 - $arr[2] - 1; - } else { - $value = $arr[1] * 4294967296 + $arr[2]; - } - } - - return 8; - } - - public function readDouble(&$value) - { - $data = strrev($this->trans_->readAll(8)); - $arr = unpack('d', $data); - $value = $arr[1]; - - return 8; - } - - public function readString(&$value) - { - $result = $this->readI32($len); - if ($len) { - $value = $this->trans_->readAll($len); - } else { - $value = ''; - } - - return $result + $len; - } -} diff --git a/vendor/packaged/thrift/src/Protocol/TBinaryProtocolAccelerated.php b/vendor/packaged/thrift/src/Protocol/TBinaryProtocolAccelerated.php deleted file mode 100644 index ff799a6ab..000000000 --- a/vendor/packaged/thrift/src/Protocol/TBinaryProtocolAccelerated.php +++ /dev/null @@ -1,67 +0,0 @@ -strictRead_; - } - - public function isStrictWrite() - { - return $this->strictWrite_; - } -} diff --git a/vendor/packaged/thrift/src/Protocol/TCompactProtocol.php b/vendor/packaged/thrift/src/Protocol/TCompactProtocol.php deleted file mode 100644 index 1af2a274a..000000000 --- a/vendor/packaged/thrift/src/Protocol/TCompactProtocol.php +++ /dev/null @@ -1,739 +0,0 @@ - TCompactProtocol::COMPACT_STOP, - TType::BOOL => TCompactProtocol::COMPACT_TRUE, // used for collection - TType::BYTE => TCompactProtocol::COMPACT_BYTE, - TType::I16 => TCompactProtocol::COMPACT_I16, - TType::I32 => TCompactProtocol::COMPACT_I32, - TType::I64 => TCompactProtocol::COMPACT_I64, - TType::DOUBLE => TCompactProtocol::COMPACT_DOUBLE, - TType::STRING => TCompactProtocol::COMPACT_BINARY, - TType::STRUCT => TCompactProtocol::COMPACT_STRUCT, - TType::LST => TCompactProtocol::COMPACT_LIST, - TType::SET => TCompactProtocol::COMPACT_SET, - TType::MAP => TCompactProtocol::COMPACT_MAP, - ); - - protected static $ttypes = array( - TCompactProtocol::COMPACT_STOP => TType::STOP, - TCompactProtocol::COMPACT_TRUE => TType::BOOL, // used for collection - TCompactProtocol::COMPACT_FALSE => TType::BOOL, - TCompactProtocol::COMPACT_BYTE => TType::BYTE, - TCompactProtocol::COMPACT_I16 => TType::I16, - TCompactProtocol::COMPACT_I32 => TType::I32, - TCompactProtocol::COMPACT_I64 => TType::I64, - TCompactProtocol::COMPACT_DOUBLE => TType::DOUBLE, - TCompactProtocol::COMPACT_BINARY => TType::STRING, - TCompactProtocol::COMPACT_STRUCT => TType::STRUCT, - TCompactProtocol::COMPACT_LIST => TType::LST, - TCompactProtocol::COMPACT_SET => TType::SET, - TCompactProtocol::COMPACT_MAP => TType::MAP, - ); - - protected $state = TCompactProtocol::STATE_CLEAR; - protected $lastFid = 0; - protected $boolFid = null; - protected $boolValue = null; - protected $structs = array(); - protected $containers = array(); - - // Some varint / zigzag helper methods - public function toZigZag($n, $bits) - { - return ($n << 1) ^ ($n >> ($bits - 1)); - } - - public function fromZigZag($n) - { - return ($n >> 1) ^ -($n & 1); - } - - public function getVarint($data) - { - $out = ""; - while (true) { - if (($data & ~0x7f) === 0) { - $out .= chr($data); - break; - } else { - $out .= chr(($data & 0xff) | 0x80); - $data = $data >> 7; - } - } - - return $out; - } - - public function writeVarint($data) - { - $out = $this->getVarint($data); - $result = TStringFuncFactory::create()->strlen($out); - $this->trans_->write($out, $result); - - return $result; - } - - public function readVarint(&$result) - { - $idx = 0; - $shift = 0; - $result = 0; - while (true) { - $x = $this->trans_->readAll(1); - $arr = unpack('C', $x); - $byte = $arr[1]; - $idx += 1; - $result |= ($byte & 0x7f) << $shift; - if (($byte >> 7) === 0) { - return $idx; - } - $shift += 7; - } - - return $idx; - } - - public function __construct($trans) - { - parent::__construct($trans); - } - - public function writeMessageBegin($name, $type, $seqid) - { - $written = - $this->writeUByte(TCompactProtocol::PROTOCOL_ID) + - $this->writeUByte(TCompactProtocol::VERSION | - ($type << TCompactProtocol::TYPE_SHIFT_AMOUNT)) + - $this->writeVarint($seqid) + - $this->writeString($name); - $this->state = TCompactProtocol::STATE_VALUE_WRITE; - - return $written; - } - - public function writeMessageEnd() - { - $this->state = TCompactProtocol::STATE_CLEAR; - - return 0; - } - - public function writeStructBegin($name) - { - $this->structs[] = array($this->state, $this->lastFid); - $this->state = TCompactProtocol::STATE_FIELD_WRITE; - $this->lastFid = 0; - - return 0; - } - - public function writeStructEnd() - { - $old_values = array_pop($this->structs); - $this->state = $old_values[0]; - $this->lastFid = $old_values[1]; - - return 0; - } - - public function writeFieldStop() - { - return $this->writeByte(0); - } - - public function writeFieldHeader($type, $fid) - { - $written = 0; - $delta = $fid - $this->lastFid; - if (0 < $delta && $delta <= 15) { - $written = $this->writeUByte(($delta << 4) | $type); - } else { - $written = $this->writeByte($type) + - $this->writeI16($fid); - } - $this->lastFid = $fid; - - return $written; - } - - public function writeFieldBegin($field_name, $field_type, $field_id) - { - if ($field_type == TTYPE::BOOL) { - $this->state = TCompactProtocol::STATE_BOOL_WRITE; - $this->boolFid = $field_id; - - return 0; - } else { - $this->state = TCompactProtocol::STATE_VALUE_WRITE; - - return $this->writeFieldHeader(self::$ctypes[$field_type], $field_id); - } - } - - public function writeFieldEnd() - { - $this->state = TCompactProtocol::STATE_FIELD_WRITE; - - return 0; - } - - public function writeCollectionBegin($etype, $size) - { - $written = 0; - if ($size <= 14) { - $written = $this->writeUByte($size << 4 | - self::$ctypes[$etype]); - } else { - $written = $this->writeUByte(0xf0 | - self::$ctypes[$etype]) + - $this->writeVarint($size); - } - $this->containers[] = $this->state; - $this->state = TCompactProtocol::STATE_CONTAINER_WRITE; - - return $written; - } - - public function writeMapBegin($key_type, $val_type, $size) - { - $written = 0; - if ($size == 0) { - $written = $this->writeByte(0); - } else { - $written = $this->writeVarint($size) + - $this->writeUByte(self::$ctypes[$key_type] << 4 | - self::$ctypes[$val_type]); - } - $this->containers[] = $this->state; - - return $written; - } - - public function writeCollectionEnd() - { - $this->state = array_pop($this->containers); - - return 0; - } - - public function writeMapEnd() - { - return $this->writeCollectionEnd(); - } - - public function writeListBegin($elem_type, $size) - { - return $this->writeCollectionBegin($elem_type, $size); - } - - public function writeListEnd() - { - return $this->writeCollectionEnd(); - } - - public function writeSetBegin($elem_type, $size) - { - return $this->writeCollectionBegin($elem_type, $size); - } - - public function writeSetEnd() - { - return $this->writeCollectionEnd(); - } - - public function writeBool($value) - { - if ($this->state == TCompactProtocol::STATE_BOOL_WRITE) { - $ctype = TCompactProtocol::COMPACT_FALSE; - if ($value) { - $ctype = TCompactProtocol::COMPACT_TRUE; - } - - return $this->writeFieldHeader($ctype, $this->boolFid); - } elseif ($this->state == TCompactProtocol::STATE_CONTAINER_WRITE) { - return $this->writeByte($value ? 1 : 0); - } else { - throw new TProtocolException('Invalid state in compact protocol'); - } - } - - public function writeByte($value) - { - $data = pack('c', $value); - $this->trans_->write($data, 1); - - return 1; - } - - public function writeUByte($byte) - { - $this->trans_->write(pack('C', $byte), 1); - - return 1; - } - - public function writeI16($value) - { - $thing = $this->toZigZag($value, 16); - - return $this->writeVarint($thing); - } - - public function writeI32($value) - { - $thing = $this->toZigZag($value, 32); - - return $this->writeVarint($thing); - } - - public function writeDouble($value) - { - $data = pack('d', $value); - $this->trans_->write($data, 8); - - return 8; - } - - public function writeString($value) - { - $len = TStringFuncFactory::create()->strlen($value); - $result = $this->writeVarint($len); - if ($len) { - $this->trans_->write($value, $len); - } - - return $result + $len; - } - - public function readFieldBegin(&$name, &$field_type, &$field_id) - { - $result = $this->readUByte($compact_type_and_delta); - - $compact_type = $compact_type_and_delta & 0x0f; - - if ($compact_type == TType::STOP) { - $field_type = $compact_type; - $field_id = 0; - - return $result; - } - $delta = $compact_type_and_delta >> 4; - if ($delta == 0) { - $result += $this->readI16($field_id); - } else { - $field_id = $this->lastFid + $delta; - } - $this->lastFid = $field_id; - $field_type = $this->getTType($compact_type); - - if ($compact_type == TCompactProtocol::COMPACT_TRUE) { - $this->state = TCompactProtocol::STATE_BOOL_READ; - $this->boolValue = true; - } elseif ($compact_type == TCompactProtocol::COMPACT_FALSE) { - $this->state = TCompactProtocol::STATE_BOOL_READ; - $this->boolValue = false; - } else { - $this->state = TCompactProtocol::STATE_VALUE_READ; - } - - return $result; - } - - public function readFieldEnd() - { - $this->state = TCompactProtocol::STATE_FIELD_READ; - - return 0; - } - - public function readUByte(&$value) - { - $data = $this->trans_->readAll(1); - $arr = unpack('C', $data); - $value = $arr[1]; - - return 1; - } - - public function readByte(&$value) - { - $data = $this->trans_->readAll(1); - $arr = unpack('c', $data); - $value = $arr[1]; - - return 1; - } - - public function readZigZag(&$value) - { - $result = $this->readVarint($value); - $value = $this->fromZigZag($value); - - return $result; - } - - public function readMessageBegin(&$name, &$type, &$seqid) - { - $protoId = 0; - $result = $this->readUByte($protoId); - if ($protoId != TCompactProtocol::PROTOCOL_ID) { - throw new TProtocolException('Bad protocol id in TCompact message'); - } - $verType = 0; - $result += $this->readUByte($verType); - $type = ($verType >> TCompactProtocol::TYPE_SHIFT_AMOUNT) & TCompactProtocol::TYPE_BITS; - $version = $verType & TCompactProtocol::VERSION_MASK; - if ($version != TCompactProtocol::VERSION) { - throw new TProtocolException('Bad version in TCompact message'); - } - $result += $this->readVarint($seqid); - $result += $this->readString($name); - - return $result; - } - - public function readMessageEnd() - { - return 0; - } - - public function readStructBegin(&$name) - { - $name = ''; // unused - $this->structs[] = array($this->state, $this->lastFid); - $this->state = TCompactProtocol::STATE_FIELD_READ; - $this->lastFid = 0; - - return 0; - } - - public function readStructEnd() - { - $last = array_pop($this->structs); - $this->state = $last[0]; - $this->lastFid = $last[1]; - - return 0; - } - - public function readCollectionBegin(&$type, &$size) - { - $sizeType = 0; - $result = $this->readUByte($sizeType); - $size = $sizeType >> 4; - $type = $this->getTType($sizeType); - if ($size == 15) { - $result += $this->readVarint($size); - } - $this->containers[] = $this->state; - $this->state = TCompactProtocol::STATE_CONTAINER_READ; - - return $result; - } - - public function readMapBegin(&$key_type, &$val_type, &$size) - { - $result = $this->readVarint($size); - $types = 0; - if ($size > 0) { - $result += $this->readUByte($types); - } - $val_type = $this->getTType($types); - $key_type = $this->getTType($types >> 4); - $this->containers[] = $this->state; - $this->state = TCompactProtocol::STATE_CONTAINER_READ; - - return $result; - } - - public function readCollectionEnd() - { - $this->state = array_pop($this->containers); - - return 0; - } - - public function readMapEnd() - { - return $this->readCollectionEnd(); - } - - public function readListBegin(&$elem_type, &$size) - { - return $this->readCollectionBegin($elem_type, $size); - } - - public function readListEnd() - { - return $this->readCollectionEnd(); - } - - public function readSetBegin(&$elem_type, &$size) - { - return $this->readCollectionBegin($elem_type, $size); - } - - public function readSetEnd() - { - return $this->readCollectionEnd(); - } - - public function readBool(&$value) - { - if ($this->state == TCompactProtocol::STATE_BOOL_READ) { - $value = $this->boolValue; - - return 0; - } elseif ($this->state == TCompactProtocol::STATE_CONTAINER_READ) { - return $this->readByte($value); - } else { - throw new TProtocolException('Invalid state in compact protocol'); - } - } - - public function readI16(&$value) - { - return $this->readZigZag($value); - } - - public function readI32(&$value) - { - return $this->readZigZag($value); - } - - public function readDouble(&$value) - { - $data = $this->trans_->readAll(8); - $arr = unpack('d', $data); - $value = $arr[1]; - - return 8; - } - - public function readString(&$value) - { - $result = $this->readVarint($len); - if ($len) { - $value = $this->trans_->readAll($len); - } else { - $value = ''; - } - - return $result + $len; - } - - public function getTType($byte) - { - return self::$ttypes[$byte & 0x0f]; - } - - // If we are on a 32bit architecture we have to explicitly deal with - // 64-bit twos-complement arithmetic since PHP wants to treat all ints - // as signed and any int over 2^31 - 1 as a float - - // Read and write I64 as two 32 bit numbers $hi and $lo - - public function readI64(&$value) - { - // Read varint from wire - $hi = 0; - $lo = 0; - - $idx = 0; - $shift = 0; - - while (true) { - $x = $this->trans_->readAll(1); - $arr = unpack('C', $x); - $byte = $arr[1]; - $idx += 1; - // Shift hi and lo together. - if ($shift < 28) { - $lo |= (($byte & 0x7f) << $shift); - } elseif ($shift == 28) { - $lo |= (($byte & 0x0f) << 28); - $hi |= (($byte & 0x70) >> 4); - } else { - $hi |= (($byte & 0x7f) << ($shift - 32)); - } - if (($byte >> 7) === 0) { - break; - } - $shift += 7; - } - - // Now, unzig it. - $xorer = 0; - if ($lo & 1) { - $xorer = 0xffffffff; - } - $lo = ($lo >> 1) & 0x7fffffff; - $lo = $lo | (($hi & 1) << 31); - $hi = ($hi >> 1) ^ $xorer; - $lo = $lo ^ $xorer; - - // Now put $hi and $lo back together - $isNeg = $hi < 0 || $hi & 0x80000000; - - // Check for a negative - if ($isNeg) { - $hi = ~$hi & (int)0xffffffff; - $lo = ~$lo & (int)0xffffffff; - - if ($lo == (int)0xffffffff) { - $hi++; - $lo = 0; - } else { - $lo++; - } - } - - // Force 32bit words in excess of 2G to be positive - we deal with sign - // explicitly below - - if ($hi & (int)0x80000000) { - $hi &= (int)0x7fffffff; - $hi += 0x80000000; - } - - if ($lo & (int)0x80000000) { - $lo &= (int)0x7fffffff; - $lo += 0x80000000; - } - - // Create as negative value first, since we can store -2^63 but not 2^63 - $value = -$hi * 4294967296 - $lo; - - if (!$isNeg) { - $value = -$value; - } - - return $idx; - } - - public function writeI64($value) - { - // If we are in an I32 range, use the easy method below. - if (($value > 4294967296) || ($value < -4294967296)) { - // Convert $value to $hi and $lo - $neg = $value < 0; - - if ($neg) { - $value *= -1; - } - - $hi = (int)$value >> 32; - $lo = (int)$value & 0xffffffff; - - if ($neg) { - $hi = ~$hi; - $lo = ~$lo; - if (($lo & (int)0xffffffff) == (int)0xffffffff) { - $lo = 0; - $hi++; - } else { - $lo++; - } - } - - // Now do the zigging and zagging. - $xorer = 0; - if ($neg) { - $xorer = 0xffffffff; - } - $lowbit = ($lo >> 31) & 1; - $hi = ($hi << 1) | $lowbit; - $lo = ($lo << 1); - $lo = ($lo ^ $xorer) & 0xffffffff; - $hi = ($hi ^ $xorer) & 0xffffffff; - - // now write out the varint, ensuring we shift both hi and lo - $out = ""; - while (true) { - if (($lo & ~0x7f) === 0 && - $hi === 0) { - $out .= chr($lo); - break; - } else { - $out .= chr(($lo & 0xff) | 0x80); - $lo = $lo >> 7; - $lo = $lo | ($hi << 25); - $hi = $hi >> 7; - // Right shift carries sign, but we don't want it to. - $hi = $hi & (127 << 25); - } - } - - $ret = TStringFuncFactory::create()->strlen($out); - $this->trans_->write($out, $ret); - - return $ret; - } else { - return $this->writeVarint($this->toZigZag($value, 64)); - } - } -} diff --git a/vendor/packaged/thrift/src/Protocol/TJSONProtocol.php b/vendor/packaged/thrift/src/Protocol/TJSONProtocol.php deleted file mode 100644 index 914488421..000000000 --- a/vendor/packaged/thrift/src/Protocol/TJSONProtocol.php +++ /dev/null @@ -1,815 +0,0 @@ - 1) { - switch (substr($name, 0, 1)) { - case 'd': - $result = TType::DOUBLE; - break; - case 'i': - switch (substr($name, 1, 1)) { - case '8': - $result = TType::BYTE; - break; - case '1': - $result = TType::I16; - break; - case '3': - $result = TType::I32; - break; - case '6': - $result = TType::I64; - break; - } - break; - case 'l': - $result = TType::LST; - break; - case 'm': - $result = TType::MAP; - break; - case 'r': - $result = TType::STRUCT; - break; - case 's': - if (substr($name, 1, 1) == 't') { - $result = TType::STRING; - } elseif (substr($name, 1, 1) == 'e') { - $result = TType::SET; - } - break; - case 't': - $result = TType::BOOL; - break; - } - } - if ($result == TType::STOP) { - throw new TProtocolException("Unrecognized type", TProtocolException::INVALID_DATA); - } - - return $result; - } - - public $contextStack_ = array(); - public $context_; - public $reader_; - - private function pushContext($c) - { - array_push($this->contextStack_, $this->context_); - $this->context_ = $c; - } - - private function popContext() - { - $this->context_ = array_pop($this->contextStack_); - } - - public function __construct($trans) - { - parent::__construct($trans); - $this->context_ = new BaseContext(); - $this->reader_ = new LookaheadReader($this); - } - - public function reset() - { - $this->contextStack_ = array(); - $this->context_ = new BaseContext(); - $this->reader_ = new LookaheadReader($this); - } - - private $tmpbuf_ = array(4); - - public function readJSONSyntaxChar($b) - { - $ch = $this->reader_->read(); - - if (substr($ch, 0, 1) != $b) { - throw new TProtocolException("Unexpected character: " . $ch, TProtocolException::INVALID_DATA); - } - } - - private function hexVal($s) - { - for ($i = 0; $i < strlen($s); $i++) { - $ch = substr($s, $i, 1); - - if (!($ch >= "a" && $ch <= "f") && !($ch >= "0" && $ch <= "9")) { - throw new TProtocolException("Expected hex character " . $ch, TProtocolException::INVALID_DATA); - } - } - - return hexdec($s); - } - - private function hexChar($val) - { - return dechex($val); - } - - private function hasJSONUnescapedUnicode() - { - if (PHP_MAJOR_VERSION > 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4)) { - return true; - } - - return false; - } - - private function unescapedUnicode($str) - { - if ($this->hasJSONUnescapedUnicode()) { - return json_encode($str, JSON_UNESCAPED_UNICODE); - } - - $json = json_encode($str); - - /* - * Unescaped character outside the Basic Multilingual Plane - * High surrogate: 0xD800 - 0xDBFF - * Low surrogate: 0xDC00 - 0xDFFF - */ - $json = preg_replace_callback( - '/\\\\u(d[89ab][0-9a-f]{2})\\\\u(d[cdef][0-9a-f]{2})/i', - function ($matches) { - return mb_convert_encoding(pack('H*', $matches[1] . $matches[2]), 'UTF-8', 'UTF-16BE'); - }, - $json - ); - - /* - * Unescaped characters within the Basic Multilingual Plane - */ - $json = preg_replace_callback( - '/\\\\u([0-9a-f]{4})/i', - function ($matches) { - return mb_convert_encoding(pack('H*', $matches[1]), 'UTF-8', 'UTF-16BE'); - }, - $json - ); - - return $json; - } - - private function writeJSONString($b) - { - $this->context_->write(); - - if (is_numeric($b) && $this->context_->escapeNum()) { - $this->trans_->write(self::QUOTE); - } - - $this->trans_->write($this->unescapedUnicode($b)); - - if (is_numeric($b) && $this->context_->escapeNum()) { - $this->trans_->write(self::QUOTE); - } - } - - private function writeJSONInteger($num) - { - $this->context_->write(); - - if ($this->context_->escapeNum()) { - $this->trans_->write(self::QUOTE); - } - - $this->trans_->write($num); - - if ($this->context_->escapeNum()) { - $this->trans_->write(self::QUOTE); - } - } - - private function writeJSONDouble($num) - { - $this->context_->write(); - - if ($this->context_->escapeNum()) { - $this->trans_->write(self::QUOTE); - } - - $this->trans_->write(json_encode($num)); - - if ($this->context_->escapeNum()) { - $this->trans_->write(self::QUOTE); - } - } - - private function writeJSONBase64($data) - { - $this->context_->write(); - $this->trans_->write(self::QUOTE); - $this->trans_->write(json_encode(base64_encode($data))); - $this->trans_->write(self::QUOTE); - } - - private function writeJSONObjectStart() - { - $this->context_->write(); - $this->trans_->write(self::LBRACE); - $this->pushContext(new PairContext($this)); - } - - private function writeJSONObjectEnd() - { - $this->popContext(); - $this->trans_->write(self::RBRACE); - } - - private function writeJSONArrayStart() - { - $this->context_->write(); - $this->trans_->write(self::LBRACKET); - $this->pushContext(new ListContext($this)); - } - - private function writeJSONArrayEnd() - { - $this->popContext(); - $this->trans_->write(self::RBRACKET); - } - - private function readJSONString($skipContext) - { - if (!$skipContext) { - $this->context_->read(); - } - - $jsonString = ''; - $lastChar = null; - while (true) { - $ch = $this->reader_->read(); - $jsonString .= $ch; - if ($ch == self::QUOTE && - $lastChar !== null && - $lastChar !== self::ESCSEQ) { - break; - } - if ($ch == self::ESCSEQ && $lastChar == self::ESCSEQ) { - $lastChar = self::DOUBLEESC; - } else { - $lastChar = $ch; - } - } - - return json_decode($jsonString); - } - - private function isJSONNumeric($b) - { - switch ($b) { - case '+': - case '-': - case '.': - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'E': - case 'e': - return true; - } - - return false; - } - - private function readJSONNumericChars() - { - $strbld = array(); - - while (true) { - $ch = $this->reader_->peek(); - - if (!$this->isJSONNumeric($ch)) { - break; - } - - $strbld[] = $this->reader_->read(); - } - - return implode("", $strbld); - } - - private function readJSONInteger() - { - $this->context_->read(); - - if ($this->context_->escapeNum()) { - $this->readJSONSyntaxChar(self::QUOTE); - } - - $str = $this->readJSONNumericChars(); - - if ($this->context_->escapeNum()) { - $this->readJSONSyntaxChar(self::QUOTE); - } - - if (!is_numeric($str)) { - throw new TProtocolException("Invalid data in numeric: " . $str, TProtocolException::INVALID_DATA); - } - - return intval($str); - } - - /** - * Identical to readJSONInteger but without the final cast. - * Needed for proper handling of i64 on 32 bit machines. Why a - * separate function? So we don't have to force the rest of the - * use cases through the extra conditional. - */ - private function readJSONIntegerAsString() - { - $this->context_->read(); - - if ($this->context_->escapeNum()) { - $this->readJSONSyntaxChar(self::QUOTE); - } - - $str = $this->readJSONNumericChars(); - - if ($this->context_->escapeNum()) { - $this->readJSONSyntaxChar(self::QUOTE); - } - - if (!is_numeric($str)) { - throw new TProtocolException("Invalid data in numeric: " . $str, TProtocolException::INVALID_DATA); - } - - return $str; - } - - private function readJSONDouble() - { - $this->context_->read(); - - if (substr($this->reader_->peek(), 0, 1) == self::QUOTE) { - $arr = $this->readJSONString(true); - - if ($arr == "NaN") { - return NAN; - } elseif ($arr == "Infinity") { - return INF; - } elseif (!$this->context_->escapeNum()) { - throw new TProtocolException( - "Numeric data unexpectedly quoted " . $arr, - TProtocolException::INVALID_DATA - ); - } - - return floatval($arr); - } else { - if ($this->context_->escapeNum()) { - $this->readJSONSyntaxChar(self::QUOTE); - } - - return floatval($this->readJSONNumericChars()); - } - } - - private function readJSONBase64() - { - $arr = $this->readJSONString(false); - $data = base64_decode($arr, true); - - if ($data === false) { - throw new TProtocolException("Invalid base64 data " . $arr, TProtocolException::INVALID_DATA); - } - - return $data; - } - - private function readJSONObjectStart() - { - $this->context_->read(); - $this->readJSONSyntaxChar(self::LBRACE); - $this->pushContext(new PairContext($this)); - } - - private function readJSONObjectEnd() - { - $this->readJSONSyntaxChar(self::RBRACE); - $this->popContext(); - } - - private function readJSONArrayStart() - { - $this->context_->read(); - $this->readJSONSyntaxChar(self::LBRACKET); - $this->pushContext(new ListContext($this)); - } - - private function readJSONArrayEnd() - { - $this->readJSONSyntaxChar(self::RBRACKET); - $this->popContext(); - } - - /** - * Writes the message header - * - * @param string $name Function name - * @param int $type message type TMessageType::CALL or TMessageType::REPLY - * @param int $seqid The sequence id of this message - */ - public function writeMessageBegin($name, $type, $seqid) - { - $this->writeJSONArrayStart(); - $this->writeJSONInteger(self::VERSION); - $this->writeJSONString($name); - $this->writeJSONInteger($type); - $this->writeJSONInteger($seqid); - } - - /** - * Close the message - */ - public function writeMessageEnd() - { - $this->writeJSONArrayEnd(); - } - - /** - * Writes a struct header. - * - * @param string $name Struct name - * @throws TException on write error - * @return int How many bytes written - */ - public function writeStructBegin($name) - { - $this->writeJSONObjectStart(); - } - - /** - * Close a struct. - * - * @throws TException on write error - * @return int How many bytes written - */ - public function writeStructEnd() - { - $this->writeJSONObjectEnd(); - } - - public function writeFieldBegin($fieldName, $fieldType, $fieldId) - { - $this->writeJSONInteger($fieldId); - $this->writeJSONObjectStart(); - $this->writeJSONString($this->getTypeNameForTypeID($fieldType)); - } - - public function writeFieldEnd() - { - $this->writeJsonObjectEnd(); - } - - public function writeFieldStop() - { - } - - public function writeMapBegin($keyType, $valType, $size) - { - $this->writeJSONArrayStart(); - $this->writeJSONString($this->getTypeNameForTypeID($keyType)); - $this->writeJSONString($this->getTypeNameForTypeID($valType)); - $this->writeJSONInteger($size); - $this->writeJSONObjectStart(); - } - - public function writeMapEnd() - { - $this->writeJSONObjectEnd(); - $this->writeJSONArrayEnd(); - } - - public function writeListBegin($elemType, $size) - { - $this->writeJSONArrayStart(); - $this->writeJSONString($this->getTypeNameForTypeID($elemType)); - $this->writeJSONInteger($size); - } - - public function writeListEnd() - { - $this->writeJSONArrayEnd(); - } - - public function writeSetBegin($elemType, $size) - { - $this->writeJSONArrayStart(); - $this->writeJSONString($this->getTypeNameForTypeID($elemType)); - $this->writeJSONInteger($size); - } - - public function writeSetEnd() - { - $this->writeJSONArrayEnd(); - } - - public function writeBool($bool) - { - $this->writeJSONInteger($bool ? 1 : 0); - } - - public function writeByte($byte) - { - $this->writeJSONInteger($byte); - } - - public function writeI16($i16) - { - $this->writeJSONInteger($i16); - } - - public function writeI32($i32) - { - $this->writeJSONInteger($i32); - } - - public function writeI64($i64) - { - $this->writeJSONInteger($i64); - } - - public function writeDouble($dub) - { - $this->writeJSONDouble($dub); - } - - public function writeString($str) - { - $this->writeJSONString($str); - } - - /** - * Reads the message header - * - * @param string $name Function name - * @param int $type message type TMessageType::CALL or TMessageType::REPLY - * @parem int $seqid The sequence id of this message - */ - public function readMessageBegin(&$name, &$type, &$seqid) - { - $this->readJSONArrayStart(); - - if ($this->readJSONInteger() != self::VERSION) { - throw new TProtocolException("Message contained bad version", TProtocolException::BAD_VERSION); - } - - $name = $this->readJSONString(false); - $type = $this->readJSONInteger(); - $seqid = $this->readJSONInteger(); - - return true; - } - - /** - * Read the close of message - */ - public function readMessageEnd() - { - $this->readJSONArrayEnd(); - } - - public function readStructBegin(&$name) - { - $this->readJSONObjectStart(); - - return 0; - } - - public function readStructEnd() - { - $this->readJSONObjectEnd(); - } - - public function readFieldBegin(&$name, &$fieldType, &$fieldId) - { - $ch = $this->reader_->peek(); - $name = ""; - - if (substr($ch, 0, 1) == self::RBRACE) { - $fieldType = TType::STOP; - } else { - $fieldId = $this->readJSONInteger(); - $this->readJSONObjectStart(); - $fieldType = $this->getTypeIDForTypeName($this->readJSONString(false)); - } - } - - public function readFieldEnd() - { - $this->readJSONObjectEnd(); - } - - public function readMapBegin(&$keyType, &$valType, &$size) - { - $this->readJSONArrayStart(); - $keyType = $this->getTypeIDForTypeName($this->readJSONString(false)); - $valType = $this->getTypeIDForTypeName($this->readJSONString(false)); - $size = $this->readJSONInteger(); - $this->readJSONObjectStart(); - } - - public function readMapEnd() - { - $this->readJSONObjectEnd(); - $this->readJSONArrayEnd(); - } - - public function readListBegin(&$elemType, &$size) - { - $this->readJSONArrayStart(); - $elemType = $this->getTypeIDForTypeName($this->readJSONString(false)); - $size = $this->readJSONInteger(); - - return true; - } - - public function readListEnd() - { - $this->readJSONArrayEnd(); - } - - public function readSetBegin(&$elemType, &$size) - { - $this->readJSONArrayStart(); - $elemType = $this->getTypeIDForTypeName($this->readJSONString(false)); - $size = $this->readJSONInteger(); - - return true; - } - - public function readSetEnd() - { - $this->readJSONArrayEnd(); - } - - public function readBool(&$bool) - { - $bool = $this->readJSONInteger() == 0 ? false : true; - - return true; - } - - public function readByte(&$byte) - { - $byte = $this->readJSONInteger(); - - return true; - } - - public function readI16(&$i16) - { - $i16 = $this->readJSONInteger(); - - return true; - } - - public function readI32(&$i32) - { - $i32 = $this->readJSONInteger(); - - return true; - } - - public function readI64(&$i64) - { - if (PHP_INT_SIZE === 4) { - $i64 = $this->readJSONIntegerAsString(); - } else { - $i64 = $this->readJSONInteger(); - } - - return true; - } - - public function readDouble(&$dub) - { - $dub = $this->readJSONDouble(); - - return true; - } - - public function readString(&$str) - { - $str = $this->readJSONString(false); - - return true; - } -} diff --git a/vendor/packaged/thrift/src/Protocol/TMultiplexedProtocol.php b/vendor/packaged/thrift/src/Protocol/TMultiplexedProtocol.php deleted file mode 100644 index d579c099d..000000000 --- a/vendor/packaged/thrift/src/Protocol/TMultiplexedProtocol.php +++ /dev/null @@ -1,85 +0,0 @@ -TMultiplexedProtocol is a protocol-independent concrete decorator - * that allows a Thrift client to communicate with a multiplexing Thrift server, - * by prepending the service name to the function name during function calls. - * - * @package Thrift\Protocol - */ -class TMultiplexedProtocol extends TProtocolDecorator -{ - /** - * Separator between service name and function name. - * Should be the same as used at multiplexed Thrift server. - * - * @var string - */ - const SEPARATOR = ":"; - - /** - * The name of service. - * - * @var string - */ - private $serviceName_; - - /** - * Constructor of TMultiplexedProtocol class. - * - * Wrap the specified protocol, allowing it to be used to communicate with a - * multiplexing server. The $serviceName is required as it is - * prepended to the message header so that the multiplexing server can broker - * the function call to the proper service. - * - * @param TProtocol $protocol - * @param string $serviceName The name of service. - */ - public function __construct(TProtocol $protocol, $serviceName) - { - parent::__construct($protocol); - $this->serviceName_ = $serviceName; - } - - /** - * Writes the message header. - * Prepends the service name to the function name, separated by TMultiplexedProtocol::SEPARATOR. - * - * @param string $name Function name. - * @param int $type Message type. - * @param int $seqid The sequence id of this message. - */ - public function writeMessageBegin($name, $type, $seqid) - { - if ($type == TMessageType::CALL || $type == TMessageType::ONEWAY) { - $nameWithService = $this->serviceName_ . self::SEPARATOR . $name; - parent::writeMessageBegin($nameWithService, $type, $seqid); - } else { - parent::writeMessageBegin($name, $type, $seqid); - } - } -} diff --git a/vendor/packaged/thrift/src/Protocol/TProtocol.php b/vendor/packaged/thrift/src/Protocol/TProtocol.php deleted file mode 100644 index f7b581f7b..000000000 --- a/vendor/packaged/thrift/src/Protocol/TProtocol.php +++ /dev/null @@ -1,352 +0,0 @@ -trans_ = $trans; - } - - /** - * Accessor for transport - * - * @return TTransport - */ - public function getTransport() - { - return $this->trans_; - } - - /** - * Writes the message header - * - * @param string $name Function name - * @param int $type message type TMessageType::CALL or TMessageType::REPLY - * @param int $seqid The sequence id of this message - */ - abstract public function writeMessageBegin($name, $type, $seqid); - - /** - * Close the message - */ - abstract public function writeMessageEnd(); - - /** - * Writes a struct header. - * - * @param string $name Struct name - * @throws TException on write error - * @return int How many bytes written - */ - abstract public function writeStructBegin($name); - - /** - * Close a struct. - * - * @throws TException on write error - * @return int How many bytes written - */ - abstract public function writeStructEnd(); - - /* - * Starts a field. - * - * @param string $name Field name - * @param int $type Field type - * @param int $fid Field id - * @throws TException on write error - * @return int How many bytes written - */ - abstract public function writeFieldBegin($fieldName, $fieldType, $fieldId); - - abstract public function writeFieldEnd(); - - abstract public function writeFieldStop(); - - abstract public function writeMapBegin($keyType, $valType, $size); - - abstract public function writeMapEnd(); - - abstract public function writeListBegin($elemType, $size); - - abstract public function writeListEnd(); - - abstract public function writeSetBegin($elemType, $size); - - abstract public function writeSetEnd(); - - abstract public function writeBool($bool); - - abstract public function writeByte($byte); - - abstract public function writeI16($i16); - - abstract public function writeI32($i32); - - abstract public function writeI64($i64); - - abstract public function writeDouble($dub); - - abstract public function writeString($str); - - /** - * Reads the message header - * - * @param string $name Function name - * @param int $type message type TMessageType::CALL or TMessageType::REPLY - * @parem int $seqid The sequence id of this message - */ - abstract public function readMessageBegin(&$name, &$type, &$seqid); - - /** - * Read the close of message - */ - abstract public function readMessageEnd(); - - abstract public function readStructBegin(&$name); - - abstract public function readStructEnd(); - - abstract public function readFieldBegin(&$name, &$fieldType, &$fieldId); - - abstract public function readFieldEnd(); - - abstract public function readMapBegin(&$keyType, &$valType, &$size); - - abstract public function readMapEnd(); - - abstract public function readListBegin(&$elemType, &$size); - - abstract public function readListEnd(); - - abstract public function readSetBegin(&$elemType, &$size); - - abstract public function readSetEnd(); - - abstract public function readBool(&$bool); - - abstract public function readByte(&$byte); - - abstract public function readI16(&$i16); - - abstract public function readI32(&$i32); - - abstract public function readI64(&$i64); - - abstract public function readDouble(&$dub); - - abstract public function readString(&$str); - - /** - * The skip function is a utility to parse over unrecognized date without - * causing corruption. - * - * @param TType $type What type is it - */ - public function skip($type) - { - switch ($type) { - case TType::BOOL: - return $this->readBool($bool); - case TType::BYTE: - return $this->readByte($byte); - case TType::I16: - return $this->readI16($i16); - case TType::I32: - return $this->readI32($i32); - case TType::I64: - return $this->readI64($i64); - case TType::DOUBLE: - return $this->readDouble($dub); - case TType::STRING: - return $this->readString($str); - case TType::STRUCT: - $result = $this->readStructBegin($name); - while (true) { - $result += $this->readFieldBegin($name, $ftype, $fid); - if ($ftype == TType::STOP) { - break; - } - $result += $this->skip($ftype); - $result += $this->readFieldEnd(); - } - $result += $this->readStructEnd(); - - return $result; - - case TType::MAP: - $result = $this->readMapBegin($keyType, $valType, $size); - for ($i = 0; $i < $size; $i++) { - $result += $this->skip($keyType); - $result += $this->skip($valType); - } - $result += $this->readMapEnd(); - - return $result; - - case TType::SET: - $result = $this->readSetBegin($elemType, $size); - for ($i = 0; $i < $size; $i++) { - $result += $this->skip($elemType); - } - $result += $this->readSetEnd(); - - return $result; - - case TType::LST: - $result = $this->readListBegin($elemType, $size); - for ($i = 0; $i < $size; $i++) { - $result += $this->skip($elemType); - } - $result += $this->readListEnd(); - - return $result; - - default: - throw new TProtocolException( - 'Unknown field type: ' . $type, - TProtocolException::INVALID_DATA - ); - } - } - - /** - * Utility for skipping binary data - * - * @param TTransport $itrans TTransport object - * @param int $type Field type - */ - public static function skipBinary($itrans, $type) - { - switch ($type) { - case TType::BOOL: - return $itrans->readAll(1); - case TType::BYTE: - return $itrans->readAll(1); - case TType::I16: - return $itrans->readAll(2); - case TType::I32: - return $itrans->readAll(4); - case TType::I64: - return $itrans->readAll(8); - case TType::DOUBLE: - return $itrans->readAll(8); - case TType::STRING: - $len = unpack('N', $itrans->readAll(4)); - $len = $len[1]; - if ($len > 0x7fffffff) { - $len = 0 - (($len - 1) ^ 0xffffffff); - } - - return 4 + $itrans->readAll($len); - - case TType::STRUCT: - $result = 0; - while (true) { - $ftype = 0; - $fid = 0; - $data = $itrans->readAll(1); - $arr = unpack('c', $data); - $ftype = $arr[1]; - if ($ftype == TType::STOP) { - break; - } - // I16 field id - $result += $itrans->readAll(2); - $result += self::skipBinary($itrans, $ftype); - } - - return $result; - - case TType::MAP: - // Ktype - $data = $itrans->readAll(1); - $arr = unpack('c', $data); - $ktype = $arr[1]; - // Vtype - $data = $itrans->readAll(1); - $arr = unpack('c', $data); - $vtype = $arr[1]; - // Size - $data = $itrans->readAll(4); - $arr = unpack('N', $data); - $size = $arr[1]; - if ($size > 0x7fffffff) { - $size = 0 - (($size - 1) ^ 0xffffffff); - } - $result = 6; - for ($i = 0; $i < $size; $i++) { - $result += self::skipBinary($itrans, $ktype); - $result += self::skipBinary($itrans, $vtype); - } - - return $result; - - case TType::SET: - case TType::LST: - // Vtype - $data = $itrans->readAll(1); - $arr = unpack('c', $data); - $vtype = $arr[1]; - // Size - $data = $itrans->readAll(4); - $arr = unpack('N', $data); - $size = $arr[1]; - if ($size > 0x7fffffff) { - $size = 0 - (($size - 1) ^ 0xffffffff); - } - $result = 5; - for ($i = 0; $i < $size; $i++) { - $result += self::skipBinary($itrans, $vtype); - } - - return $result; - - default: - throw new TProtocolException( - 'Unknown field type: ' . $type, - TProtocolException::INVALID_DATA - ); - } - } -} diff --git a/vendor/packaged/thrift/src/Protocol/TProtocolDecorator.php b/vendor/packaged/thrift/src/Protocol/TProtocolDecorator.php deleted file mode 100644 index a85e0b8e5..000000000 --- a/vendor/packaged/thrift/src/Protocol/TProtocolDecorator.php +++ /dev/null @@ -1,285 +0,0 @@ -TProtocolDecorator forwards all requests to an enclosed - * TProtocol instance, providing a way to author concise - * concrete decorator subclasses. While it has no abstract methods, it - * is marked abstract as a reminder that by itself, it does not modify - * the behaviour of the enclosed TProtocol. - * - * @package Thrift\Protocol - */ -abstract class TProtocolDecorator extends TProtocol -{ - /** - * Instance of protocol, to which all operations will be forwarded. - * - * @var TProtocol - */ - private $concreteProtocol_; - - /** - * Constructor of TProtocolDecorator class. - * Encloses the specified protocol. - * - * @param TProtocol $protocol All operations will be forward to this instance. Must be non-null. - */ - protected function __construct(TProtocol $protocol) - { - parent::__construct($protocol->getTransport()); - $this->concreteProtocol_ = $protocol; - } - - /** - * Writes the message header. - * - * @param string $name Function name - * @param int $type message type TMessageType::CALL or TMessageType::REPLY - * @param int $seqid The sequence id of this message - */ - public function writeMessageBegin($name, $type, $seqid) - { - return $this->concreteProtocol_->writeMessageBegin($name, $type, $seqid); - } - - /** - * Closes the message. - */ - public function writeMessageEnd() - { - return $this->concreteProtocol_->writeMessageEnd(); - } - - /** - * Writes a struct header. - * - * @param string $name Struct name - * - * @throws TException on write error - * @return int How many bytes written - */ - public function writeStructBegin($name) - { - return $this->concreteProtocol_->writeStructBegin($name); - } - - /** - * Close a struct. - * - * @throws TException on write error - * @return int How many bytes written - */ - public function writeStructEnd() - { - return $this->concreteProtocol_->writeStructEnd(); - } - - public function writeFieldBegin($fieldName, $fieldType, $fieldId) - { - return $this->concreteProtocol_->writeFieldBegin($fieldName, $fieldType, $fieldId); - } - - public function writeFieldEnd() - { - return $this->concreteProtocol_->writeFieldEnd(); - } - - public function writeFieldStop() - { - return $this->concreteProtocol_->writeFieldStop(); - } - - public function writeMapBegin($keyType, $valType, $size) - { - return $this->concreteProtocol_->writeMapBegin($keyType, $valType, $size); - } - - public function writeMapEnd() - { - return $this->concreteProtocol_->writeMapEnd(); - } - - public function writeListBegin($elemType, $size) - { - return $this->concreteProtocol_->writeListBegin($elemType, $size); - } - - public function writeListEnd() - { - return $this->concreteProtocol_->writeListEnd(); - } - - public function writeSetBegin($elemType, $size) - { - return $this->concreteProtocol_->writeSetBegin($elemType, $size); - } - - public function writeSetEnd() - { - return $this->concreteProtocol_->writeSetEnd(); - } - - public function writeBool($bool) - { - return $this->concreteProtocol_->writeBool($bool); - } - - public function writeByte($byte) - { - return $this->concreteProtocol_->writeByte($byte); - } - - public function writeI16($i16) - { - return $this->concreteProtocol_->writeI16($i16); - } - - public function writeI32($i32) - { - return $this->concreteProtocol_->writeI32($i32); - } - - public function writeI64($i64) - { - return $this->concreteProtocol_->writeI64($i64); - } - - public function writeDouble($dub) - { - return $this->concreteProtocol_->writeDouble($dub); - } - - public function writeString($str) - { - return $this->concreteProtocol_->writeString($str); - } - - /** - * Reads the message header - * - * @param string $name Function name - * @param int $type message type TMessageType::CALL or TMessageType::REPLY - * @param int $seqid The sequence id of this message - */ - public function readMessageBegin(&$name, &$type, &$seqid) - { - return $this->concreteProtocol_->readMessageBegin($name, $type, $seqid); - } - - /** - * Read the close of message - */ - public function readMessageEnd() - { - return $this->concreteProtocol_->readMessageEnd(); - } - - public function readStructBegin(&$name) - { - return $this->concreteProtocol_->readStructBegin($name); - } - - public function readStructEnd() - { - return $this->concreteProtocol_->readStructEnd(); - } - - public function readFieldBegin(&$name, &$fieldType, &$fieldId) - { - return $this->concreteProtocol_->readFieldBegin($name, $fieldType, $fieldId); - } - - public function readFieldEnd() - { - return $this->concreteProtocol_->readFieldEnd(); - } - - public function readMapBegin(&$keyType, &$valType, &$size) - { - $this->concreteProtocol_->readMapBegin($keyType, $valType, $size); - } - - public function readMapEnd() - { - return $this->concreteProtocol_->readMapEnd(); - } - - public function readListBegin(&$elemType, &$size) - { - $this->concreteProtocol_->readListBegin($elemType, $size); - } - - public function readListEnd() - { - return $this->concreteProtocol_->readListEnd(); - } - - public function readSetBegin(&$elemType, &$size) - { - return $this->concreteProtocol_->readSetBegin($elemType, $size); - } - - public function readSetEnd() - { - return $this->concreteProtocol_->readSetEnd(); - } - - public function readBool(&$bool) - { - return $this->concreteProtocol_->readBool($bool); - } - - public function readByte(&$byte) - { - return $this->concreteProtocol_->readByte($byte); - } - - public function readI16(&$i16) - { - return $this->concreteProtocol_->readI16($i16); - } - - public function readI32(&$i32) - { - return $this->concreteProtocol_->readI32($i32); - } - - public function readI64(&$i64) - { - return $this->concreteProtocol_->readI64($i64); - } - - public function readDouble(&$dub) - { - return $this->concreteProtocol_->readDouble($dub); - } - - public function readString(&$str) - { - return $this->concreteProtocol_->readString($str); - } -} diff --git a/vendor/packaged/thrift/src/Protocol/TSimpleJSONProtocol.php b/vendor/packaged/thrift/src/Protocol/TSimpleJSONProtocol.php deleted file mode 100644 index 1cf1f6407..000000000 --- a/vendor/packaged/thrift/src/Protocol/TSimpleJSONProtocol.php +++ /dev/null @@ -1,374 +0,0 @@ -writeContextStack_[] = $this->writeContext_; - $this->writeContext_ = $c; - } - - /** - * Pop the last write context off the stack - */ - protected function popWriteContext() - { - $this->writeContext_ = array_pop($this->writeContextStack_); - } - - /** - * Used to make sure that we are not encountering a map whose keys are containers - */ - protected function assertContextIsNotMapKey($invalidKeyType) - { - if ($this->writeContext_->isMapKey()) { - throw new CollectionMapKeyException( - "Cannot serialize a map with keys that are of type " . - $invalidKeyType - ); - } - } - - private function writeJSONString($b) - { - $this->writeContext_->write(); - - $this->trans_->write(json_encode((string)$b)); - } - - private function writeJSONInteger($num) - { - $isMapKey = $this->writeContext_->isMapKey(); - - $this->writeContext_->write(); - - if ($isMapKey) { - $this->trans_->write(self::QUOTE); - } - - $this->trans_->write((int)$num); - - if ($isMapKey) { - $this->trans_->write(self::QUOTE); - } - } - - private function writeJSONDouble($num) - { - $isMapKey = $this->writeContext_->isMapKey(); - - $this->writeContext_->write(); - - if ($isMapKey) { - $this->trans_->write(self::QUOTE); - } - - $this->trans_->write(json_encode((float)$num)); - - if ($isMapKey) { - $this->trans_->write(self::QUOTE); - } - } - - /** - * Constructor - */ - public function __construct($trans) - { - parent::__construct($trans); - $this->writeContext_ = new Context(); - } - - /** - * Writes the message header - * - * @param string $name Function name - * @param int $type message type TMessageType::CALL or TMessageType::REPLY - * @param int $seqid The sequence id of this message - */ - public function writeMessageBegin($name, $type, $seqid) - { - $this->trans_->write(self::LBRACKET); - $this->pushWriteContext(new ListContext($this)); - $this->writeJSONString($name); - $this->writeJSONInteger($type); - $this->writeJSONInteger($seqid); - } - - /** - * Close the message - */ - public function writeMessageEnd() - { - $this->popWriteContext(); - $this->trans_->write(self::RBRACKET); - } - - /** - * Writes a struct header. - * - * @param string $name Struct name - */ - public function writeStructBegin($name) - { - $this->writeContext_->write(); - $this->trans_->write(self::LBRACE); - $this->pushWriteContext(new StructContext($this)); - } - - /** - * Close a struct. - */ - public function writeStructEnd() - { - $this->popWriteContext(); - $this->trans_->write(self::RBRACE); - } - - public function writeFieldBegin($fieldName, $fieldType, $fieldId) - { - $this->writeJSONString($fieldName); - } - - public function writeFieldEnd() - { - } - - public function writeFieldStop() - { - } - - public function writeMapBegin($keyType, $valType, $size) - { - $this->assertContextIsNotMapKey(self::NAME_MAP); - $this->writeContext_->write(); - $this->trans_->write(self::LBRACE); - $this->pushWriteContext(new MapContext($this)); - } - - public function writeMapEnd() - { - $this->popWriteContext(); - $this->trans_->write(self::RBRACE); - } - - public function writeListBegin($elemType, $size) - { - $this->assertContextIsNotMapKey(self::NAME_LIST); - $this->writeContext_->write(); - $this->trans_->write(self::LBRACKET); - $this->pushWriteContext(new ListContext($this)); - // No metadata! - } - - public function writeListEnd() - { - $this->popWriteContext(); - $this->trans_->write(self::RBRACKET); - } - - public function writeSetBegin($elemType, $size) - { - $this->assertContextIsNotMapKey(self::NAME_SET); - $this->writeContext_->write(); - $this->trans_->write(self::LBRACKET); - $this->pushWriteContext(new ListContext($this)); - // No metadata! - } - - public function writeSetEnd() - { - $this->popWriteContext(); - $this->trans_->write(self::RBRACKET); - } - - public function writeBool($bool) - { - $this->writeJSONInteger($bool ? 1 : 0); - } - - public function writeByte($byte) - { - $this->writeJSONInteger($byte); - } - - public function writeI16($i16) - { - $this->writeJSONInteger($i16); - } - - public function writeI32($i32) - { - $this->writeJSONInteger($i32); - } - - public function writeI64($i64) - { - $this->writeJSONInteger($i64); - } - - public function writeDouble($dub) - { - $this->writeJSONDouble($dub); - } - - public function writeString($str) - { - $this->writeJSONString($str); - } - - /** - * Reading methods. - * - * simplejson is not meant to be read back into thrift - * - see http://wiki.apache.org/thrift/ThriftUsageJava - * - use JSON instead - */ - - public function readMessageBegin(&$name, &$type, &$seqid) - { - throw new TException("Not implemented"); - } - - public function readMessageEnd() - { - throw new TException("Not implemented"); - } - - public function readStructBegin(&$name) - { - throw new TException("Not implemented"); - } - - public function readStructEnd() - { - throw new TException("Not implemented"); - } - - public function readFieldBegin(&$name, &$fieldType, &$fieldId) - { - throw new TException("Not implemented"); - } - - public function readFieldEnd() - { - throw new TException("Not implemented"); - } - - public function readMapBegin(&$keyType, &$valType, &$size) - { - throw new TException("Not implemented"); - } - - public function readMapEnd() - { - throw new TException("Not implemented"); - } - - public function readListBegin(&$elemType, &$size) - { - throw new TException("Not implemented"); - } - - public function readListEnd() - { - throw new TException("Not implemented"); - } - - public function readSetBegin(&$elemType, &$size) - { - throw new TException("Not implemented"); - } - - public function readSetEnd() - { - throw new TException("Not implemented"); - } - - public function readBool(&$bool) - { - throw new TException("Not implemented"); - } - - public function readByte(&$byte) - { - throw new TException("Not implemented"); - } - - public function readI16(&$i16) - { - throw new TException("Not implemented"); - } - - public function readI32(&$i32) - { - throw new TException("Not implemented"); - } - - public function readI64(&$i64) - { - throw new TException("Not implemented"); - } - - public function readDouble(&$dub) - { - throw new TException("Not implemented"); - } - - public function readString(&$str) - { - throw new TException("Not implemented"); - } -} diff --git a/vendor/packaged/thrift/src/Serializer/TBinarySerializer.php b/vendor/packaged/thrift/src/Serializer/TBinarySerializer.php deleted file mode 100644 index 9d2b14730..000000000 --- a/vendor/packaged/thrift/src/Serializer/TBinarySerializer.php +++ /dev/null @@ -1,87 +0,0 @@ -getName(), - TMessageType::REPLY, - $object, - 0, - $protocol->isStrictWrite() - ); - - $protocol->readMessageBegin($unused_name, $unused_type, $unused_seqid); - } else { - $object->write($protocol); - } - $protocol->getTransport()->flush(); - - return $transport->getBuffer(); - } - - public static function deserialize($string_object, $class_name, $buffer_size = 8192) - { - $transport = new TMemoryBuffer(); - $protocol = new TBinaryProtocolAccelerated($transport); - if (function_exists('thrift_protocol_read_binary')) { - // NOTE (t.heintz) TBinaryProtocolAccelerated internally wraps our TMemoryBuffer in a - // TBufferedTransport, so we have to retrieve it again or risk losing data when writing - // less than 512 bytes to the transport (see the comment there as well). - // @see THRIFT-1579 - $protocol->writeMessageBegin('', TMessageType::REPLY, 0); - $protocolTransport = $protocol->getTransport(); - $protocolTransport->write($string_object); - $protocolTransport->flush(); - - return thrift_protocol_read_binary($protocol, $class_name, $protocol->isStrictRead(), $buffer_size); - } else { - $transport->write($string_object); - $object = new $class_name(); - $object->read($protocol); - - return $object; - } - } -} diff --git a/vendor/packaged/thrift/src/Server/TForkingServer.php b/vendor/packaged/thrift/src/Server/TForkingServer.php deleted file mode 100644 index 0bb6e9192..000000000 --- a/vendor/packaged/thrift/src/Server/TForkingServer.php +++ /dev/null @@ -1,125 +0,0 @@ -transport_->listen(); - - while (!$this->stop_) { - try { - $transport = $this->transport_->accept(); - - if ($transport != null) { - $pid = pcntl_fork(); - - if ($pid > 0) { - $this->handleParent($transport, $pid); - } elseif ($pid === 0) { - $this->handleChild($transport); - } else { - throw new TException('Failed to fork'); - } - } - } catch (TTransportException $e) { - } - - $this->collectChildren(); - } - } - - /** - * Code run by the parent - * - * @param TTransport $transport - * @param int $pid - * @return void - */ - private function handleParent(TTransport $transport, $pid) - { - $this->children_[$pid] = $transport; - } - - /** - * Code run by the child. - * - * @param TTransport $transport - * @return void - */ - private function handleChild(TTransport $transport) - { - try { - $inputTransport = $this->inputTransportFactory_->getTransport($transport); - $outputTransport = $this->outputTransportFactory_->getTransport($transport); - $inputProtocol = $this->inputProtocolFactory_->getProtocol($inputTransport); - $outputProtocol = $this->outputProtocolFactory_->getProtocol($outputTransport); - while ($this->processor_->process($inputProtocol, $outputProtocol)) { - } - @$transport->close(); - } catch (TTransportException $e) { - } - - exit(0); - } - - /** - * Collects any children we may have - * - * @return void - */ - private function collectChildren() - { - foreach ($this->children_ as $pid => $transport) { - if (pcntl_waitpid($pid, $status, WNOHANG) > 0) { - unset($this->children_[$pid]); - if ($transport) { - @$transport->close(); - } - } - } - } - - /** - * Stops the server running. Kills the transport - * and then stops the main serving loop - * - * @return void - */ - public function stop() - { - $this->transport_->close(); - $this->stop_ = true; - } -} diff --git a/vendor/packaged/thrift/src/Server/TSSLServerSocket.php b/vendor/packaged/thrift/src/Server/TSSLServerSocket.php deleted file mode 100644 index ac589b76b..000000000 --- a/vendor/packaged/thrift/src/Server/TSSLServerSocket.php +++ /dev/null @@ -1,97 +0,0 @@ -getSSLHost($host); - parent::__construct($ssl_host, $port); - $this->context_ = $context; - } - - public function getSSLHost($host) - { - $transport_protocol_loc = strpos($host, "://"); - if ($transport_protocol_loc === false) { - $host = 'ssl://' . $host; - } - return $host; - } - - /** - * Opens a new socket server handle - * - * @return void - */ - public function listen() - { - $this->listener_ = @stream_socket_server( - $this->host_ . ':' . $this->port_, - $errno, - $errstr, - STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, - $this->context_ - ); - } - - /** - * Implementation of accept. If not client is accepted in the given time - * - * @return TSocket - */ - protected function acceptImpl() - { - $handle = @stream_socket_accept($this->listener_, $this->acceptTimeout_ / 1000.0); - if (!$handle) { - return null; - } - - $socket = new TSSLSocket(); - $socket->setHandle($handle); - - return $socket; - } -} diff --git a/vendor/packaged/thrift/src/Server/TServer.php b/vendor/packaged/thrift/src/Server/TServer.php deleted file mode 100644 index 268c37820..000000000 --- a/vendor/packaged/thrift/src/Server/TServer.php +++ /dev/null @@ -1,102 +0,0 @@ -processor_ = $processor; - $this->transport_ = $transport; - $this->inputTransportFactory_ = $inputTransportFactory; - $this->outputTransportFactory_ = $outputTransportFactory; - $this->inputProtocolFactory_ = $inputProtocolFactory; - $this->outputProtocolFactory_ = $outputProtocolFactory; - } - - /** - * Serves the server. This should never return - * unless a problem permits it to do so or it - * is interrupted intentionally - * - * @abstract - * @return void - */ - abstract public function serve(); - - /** - * Stops the server serving - * - * @abstract - * @return void - */ - abstract public function stop(); -} diff --git a/vendor/packaged/thrift/src/Server/TServerSocket.php b/vendor/packaged/thrift/src/Server/TServerSocket.php deleted file mode 100644 index 8f38fb23f..000000000 --- a/vendor/packaged/thrift/src/Server/TServerSocket.php +++ /dev/null @@ -1,124 +0,0 @@ -host_ = $host; - $this->port_ = $port; - } - - /** - * Sets the accept timeout - * - * @param int $acceptTimeout - * @return void - */ - public function setAcceptTimeout($acceptTimeout) - { - $this->acceptTimeout_ = $acceptTimeout; - } - - /** - * Opens a new socket server handle - * - * @return void - */ - public function listen() - { - $this->listener_ = stream_socket_server('tcp://' . $this->host_ . ':' . $this->port_); - } - - /** - * Closes the socket server handle - * - * @return void - */ - public function close() - { - @fclose($this->listener_); - $this->listener_ = null; - } - - /** - * Implementation of accept. If not client is accepted in the given time - * - * @return TSocket - */ - protected function acceptImpl() - { - $handle = @stream_socket_accept($this->listener_, $this->acceptTimeout_ / 1000.0); - if (!$handle) { - return null; - } - - $socket = new TSocket(); - $socket->setHandle($handle); - - return $socket; - } -} diff --git a/vendor/packaged/thrift/src/Server/TServerTransport.php b/vendor/packaged/thrift/src/Server/TServerTransport.php deleted file mode 100644 index 15a27afa8..000000000 --- a/vendor/packaged/thrift/src/Server/TServerTransport.php +++ /dev/null @@ -1,56 +0,0 @@ -acceptImpl(); - - if ($transport == null) { - throw new TTransportException("accept() may not return NULL"); - } - - return $transport; - } -} diff --git a/vendor/packaged/thrift/src/Server/TSimpleServer.php b/vendor/packaged/thrift/src/Server/TSimpleServer.php deleted file mode 100644 index 4c1dda5a5..000000000 --- a/vendor/packaged/thrift/src/Server/TSimpleServer.php +++ /dev/null @@ -1,60 +0,0 @@ -transport_->listen(); - - while (!$this->stop_) { - try { - $transport = $this->transport_->accept(); - - if ($transport != null) { - $inputTransport = $this->inputTransportFactory_->getTransport($transport); - $outputTransport = $this->outputTransportFactory_->getTransport($transport); - $inputProtocol = $this->inputProtocolFactory_->getProtocol($inputTransport); - $outputProtocol = $this->outputProtocolFactory_->getProtocol($outputTransport); - while ($this->processor_->process($inputProtocol, $outputProtocol)) { - } - } - } catch (TTransportException $e) { - } - } - } - - /** - * Stops the server running. Kills the transport - * and then stops the main serving loop - * - * @return void - */ - public function stop() - { - $this->transport_->close(); - $this->stop_ = true; - } -} diff --git a/vendor/packaged/thrift/src/StoredMessageProtocol.php b/vendor/packaged/thrift/src/StoredMessageProtocol.php deleted file mode 100644 index c4aaaa9ec..000000000 --- a/vendor/packaged/thrift/src/StoredMessageProtocol.php +++ /dev/null @@ -1,53 +0,0 @@ -fname_ = $fname; - $this->mtype_ = $mtype; - $this->rseqid_ = $rseqid; - } - - public function readMessageBegin(&$name, &$type, &$seqid) - { - $name = $this->fname_; - $type = $this->mtype_; - $seqid = $this->rseqid_; - } -} diff --git a/vendor/packaged/thrift/src/StringFunc/Core.php b/vendor/packaged/thrift/src/StringFunc/Core.php deleted file mode 100644 index 39a75b3a2..000000000 --- a/vendor/packaged/thrift/src/StringFunc/Core.php +++ /dev/null @@ -1,40 +0,0 @@ -strlen($str) - $start; - } - - return mb_substr($str, $start, $length, '8bit'); - } - - public function strlen($str) - { - return mb_strlen($str, '8bit'); - } -} diff --git a/vendor/packaged/thrift/src/StringFunc/TStringFunc.php b/vendor/packaged/thrift/src/StringFunc/TStringFunc.php deleted file mode 100644 index dea497f2e..000000000 --- a/vendor/packaged/thrift/src/StringFunc/TStringFunc.php +++ /dev/null @@ -1,28 +0,0 @@ -TMultiplexedProcessor is a Processor allowing - * a single TServer to provide multiple services. - * - *

    To do so, you instantiate the processor and then register additional - * processors with it, as shown in the following example:

    - * - *
    - * $processor = new TMultiplexedProcessor(); - * - * processor->registerProcessor( - * "Calculator", - * new \tutorial\CalculatorProcessor(new CalculatorHandler())); - * - * processor->registerProcessor( - * "WeatherReport", - * new \tutorial\WeatherReportProcessor(new WeatherReportHandler())); - * - * $processor->process($protocol, $protocol); - *
    - */ - -class TMultiplexedProcessor -{ - private $serviceProcessorMap_; - - /** - * 'Register' a service with this TMultiplexedProcessor. This - * allows us to broker requests to individual services by using the service - * name to select them at request time. - * - * @param serviceName Name of a service, has to be identical to the name - * declared in the Thrift IDL, e.g. "WeatherReport". - * @param processor Implementation of a service, usually referred to - * as "handlers", e.g. WeatherReportHandler implementing WeatherReport.Iface. - */ - public function registerProcessor($serviceName, $processor) - { - $this->serviceProcessorMap_[$serviceName] = $processor; - } - - /** - * This implementation of process performs the following steps: - * - *
      - *
    1. Read the beginning of the message.
    2. - *
    3. Extract the service name from the message.
    4. - *
    5. Using the service name to locate the appropriate processor.
    6. - *
    7. Dispatch to the processor, with a decorated instance of TProtocol - * that allows readMessageBegin() to return the original Message.
    8. - *
    - * - * @throws TException If the message type is not CALL or ONEWAY, if - * the service name was not found in the message, or if the service - * name was not found in the service map. - */ - public function process(TProtocol $input, TProtocol $output) - { - /* - Use the actual underlying protocol (e.g. TBinaryProtocol) to read the - message header. This pulls the message "off the wire", which we'll - deal with at the end of this method. - */ - $input->readMessageBegin($fname, $mtype, $rseqid); - - if ($mtype !== TMessageType::CALL && $mtype != TMessageType::ONEWAY) { - throw new TException("This should not have happened!?"); - } - - // Extract the service name and the new Message name. - if (strpos($fname, TMultiplexedProtocol::SEPARATOR) === false) { - throw new TException("Service name not found in message name: {$fname}. Did you " . - "forget to use a TMultiplexProtocol in your client?"); - } - list($serviceName, $messageName) = explode(':', $fname, 2); - if (!array_key_exists($serviceName, $this->serviceProcessorMap_)) { - throw new TException("Service name not found: {$serviceName}. Did you forget " . - "to call registerProcessor()?"); - } - - // Dispatch processing to the stored processor - $processor = $this->serviceProcessorMap_[$serviceName]; - - return $processor->process( - new StoredMessageProtocol($input, $messageName, $mtype, $rseqid), - $output - ); - } -} diff --git a/vendor/packaged/thrift/src/Transport/TBufferedTransport.php b/vendor/packaged/thrift/src/Transport/TBufferedTransport.php deleted file mode 100644 index 253c5acfb..000000000 --- a/vendor/packaged/thrift/src/Transport/TBufferedTransport.php +++ /dev/null @@ -1,206 +0,0 @@ -transport_ = $transport; - $this->rBufSize_ = $rBufSize; - $this->wBufSize_ = $wBufSize; - } - - public function isOpen() - { - return $this->transport_->isOpen(); - } - - /** - * @inheritdoc - * - * @throws TTransportException - */ - public function open() - { - $this->transport_->open(); - } - - public function close() - { - $this->transport_->close(); - } - - public function putBack($data) - { - if (TStringFuncFactory::create()->strlen($this->rBuf_) === 0) { - $this->rBuf_ = $data; - } else { - $this->rBuf_ = ($data . $this->rBuf_); - } - } - - /** - * The reason that we customize readAll here is that the majority of PHP - * streams are already internally buffered by PHP. The socket stream, for - * example, buffers internally and blocks if you call read with $len greater - * than the amount of data available, unlike recv() in C. - * - * Therefore, use the readAll method of the wrapped transport inside - * the buffered readAll. - * - * @throws TTransportException - */ - public function readAll($len) - { - $have = TStringFuncFactory::create()->strlen($this->rBuf_); - if ($have == 0) { - $data = $this->transport_->readAll($len); - } elseif ($have < $len) { - $data = $this->rBuf_; - $this->rBuf_ = ''; - $data .= $this->transport_->readAll($len - $have); - } elseif ($have == $len) { - $data = $this->rBuf_; - $this->rBuf_ = ''; - } elseif ($have > $len) { - $data = TStringFuncFactory::create()->substr($this->rBuf_, 0, $len); - $this->rBuf_ = TStringFuncFactory::create()->substr($this->rBuf_, $len); - } - - return $data; - } - - /** - * @inheritdoc - * - * @param int $len - * @return string - * @throws TTransportException - */ - public function read($len) - { - if (TStringFuncFactory::create()->strlen($this->rBuf_) === 0) { - $this->rBuf_ = $this->transport_->read($this->rBufSize_); - } - - if (TStringFuncFactory::create()->strlen($this->rBuf_) <= $len) { - $ret = $this->rBuf_; - $this->rBuf_ = ''; - - return $ret; - } - - $ret = TStringFuncFactory::create()->substr($this->rBuf_, 0, $len); - $this->rBuf_ = TStringFuncFactory::create()->substr($this->rBuf_, $len); - - return $ret; - } - - /** - * @inheritdoc - * - * @param string $buf - * @throws TTransportException - */ - public function write($buf) - { - $this->wBuf_ .= $buf; - if (TStringFuncFactory::create()->strlen($this->wBuf_) >= $this->wBufSize_) { - $out = $this->wBuf_; - - // Note that we clear the internal wBuf_ prior to the underlying write - // to ensure we're in a sane state (i.e. internal buffer cleaned) - // if the underlying write throws up an exception - $this->wBuf_ = ''; - $this->transport_->write($out); - } - } - - /** - * @inheritdoc - * - * @throws TTransportException - */ - public function flush() - { - if (TStringFuncFactory::create()->strlen($this->wBuf_) > 0) { - $out = $this->wBuf_; - - // Note that we clear the internal wBuf_ prior to the underlying write - // to ensure we're in a sane state (i.e. internal buffer cleaned) - // if the underlying write throws up an exception - $this->wBuf_ = ''; - $this->transport_->write($out); - } - $this->transport_->flush(); - } -} diff --git a/vendor/packaged/thrift/src/Transport/TCurlClient.php b/vendor/packaged/thrift/src/Transport/TCurlClient.php deleted file mode 100644 index f781da969..000000000 --- a/vendor/packaged/thrift/src/Transport/TCurlClient.php +++ /dev/null @@ -1,281 +0,0 @@ -strlen($uri) > 0) && ($uri[0] != '/')) { - $uri = '/' . $uri; - } - $this->scheme_ = $scheme; - $this->host_ = $host; - $this->port_ = $port; - $this->uri_ = $uri; - $this->request_ = ''; - $this->response_ = null; - $this->timeout_ = null; - $this->headers_ = array(); - } - - /** - * Set read timeout - * - * @param float $timeout - */ - public function setTimeoutSecs($timeout) - { - $this->timeout_ = $timeout; - } - - /** - * Whether this transport is open. - * - * @return boolean true if open - */ - public function isOpen() - { - return true; - } - - /** - * Open the transport for reading/writing - * - * @throws TTransportException if cannot open - */ - public function open() - { - } - - /** - * Close the transport. - */ - public function close() - { - $this->request_ = ''; - $this->response_ = null; - } - - /** - * Read some data into the array. - * - * @param int $len How much to read - * @return string The data that has been read - * @throws TTransportException if cannot read any more data - */ - public function read($len) - { - if ($len >= strlen($this->response_)) { - return $this->response_; - } else { - $ret = substr($this->response_, 0, $len); - $this->response_ = substr($this->response_, $len); - - return $ret; - } - } - - /** - * Guarantees that the full amount of data is read. Since TCurlClient gets entire payload at - * once, parent readAll cannot be used. - * - * @return string The data, of exact length - * @throws TTransportException if cannot read data - */ - public function readAll($len) - { - $data = $this->read($len); - - if (TStringFuncFactory::create()->strlen($data) !== $len) { - throw new TTransportException('TCurlClient could not read '.$len.' bytes'); - } - - return $data; - } - - /** - * Writes some data into the pending buffer - * - * @param string $buf The data to write - * @throws TTransportException if writing fails - */ - public function write($buf) - { - $this->request_ .= $buf; - } - - /** - * Opens and sends the actual request over the HTTP connection - * - * @throws TTransportException if a writing error occurs - */ - public function flush() - { - if (!self::$curlHandle) { - register_shutdown_function(array('Thrift\\Transport\\TCurlClient', 'closeCurlHandle')); - self::$curlHandle = curl_init(); - curl_setopt(self::$curlHandle, CURLOPT_RETURNTRANSFER, true); - curl_setopt(self::$curlHandle, CURLOPT_BINARYTRANSFER, true); - curl_setopt(self::$curlHandle, CURLOPT_USERAGENT, 'PHP/TCurlClient'); - curl_setopt(self::$curlHandle, CURLOPT_CUSTOMREQUEST, 'POST'); - curl_setopt(self::$curlHandle, CURLOPT_FOLLOWLOCATION, true); - curl_setopt(self::$curlHandle, CURLOPT_MAXREDIRS, 1); - } - // God, PHP really has some esoteric ways of doing simple things. - $host = $this->host_ . ($this->port_ != 80 ? ':' . $this->port_ : ''); - $fullUrl = $this->scheme_ . "://" . $host . $this->uri_; - - $headers = array(); - $defaultHeaders = array('Accept' => 'application/x-thrift', - 'Content-Type' => 'application/x-thrift', - 'Content-Length' => TStringFuncFactory::create()->strlen($this->request_)); - foreach (array_merge($defaultHeaders, $this->headers_) as $key => $value) { - $headers[] = "$key: $value"; - } - - curl_setopt(self::$curlHandle, CURLOPT_HTTPHEADER, $headers); - - if ($this->timeout_ > 0) { - if ($this->timeout_ < 1.0) { - // Timestamps smaller than 1 second are ignored when CURLOPT_TIMEOUT is used - curl_setopt(self::$curlHandle, CURLOPT_TIMEOUT_MS, 1000 * $this->timeout_); - } else { - curl_setopt(self::$curlHandle, CURLOPT_TIMEOUT, $this->timeout_); - } - } - curl_setopt(self::$curlHandle, CURLOPT_POSTFIELDS, $this->request_); - $this->request_ = ''; - - curl_setopt(self::$curlHandle, CURLOPT_URL, $fullUrl); - $this->response_ = curl_exec(self::$curlHandle); - $responseError = curl_error(self::$curlHandle); - - $code = curl_getinfo(self::$curlHandle, CURLINFO_HTTP_CODE); - - // Handle non 200 status code / connect failure - if ($this->response_ === false || $code !== 200) { - curl_close(self::$curlHandle); - self::$curlHandle = null; - $this->response_ = null; - $error = 'TCurlClient: Could not connect to ' . $fullUrl; - if ($responseError) { - $error .= ', ' . $responseError; - } - if ($code) { - $error .= ', HTTP status code: ' . $code; - } - throw new TTransportException($error, TTransportException::UNKNOWN); - } - } - - public static function closeCurlHandle() - { - try { - if (self::$curlHandle) { - curl_close(self::$curlHandle); - self::$curlHandle = null; - } - } catch (\Exception $x) { - error_log('There was an error closing the curl handle: ' . $x->getMessage()); - } - } - - public function addHeaders($headers) - { - $this->headers_ = array_merge($this->headers_, $headers); - } -} diff --git a/vendor/packaged/thrift/src/Transport/TFramedTransport.php b/vendor/packaged/thrift/src/Transport/TFramedTransport.php deleted file mode 100644 index 39d186987..000000000 --- a/vendor/packaged/thrift/src/Transport/TFramedTransport.php +++ /dev/null @@ -1,192 +0,0 @@ -transport_ = $transport; - $this->read_ = $read; - $this->write_ = $write; - } - - public function isOpen() - { - return $this->transport_->isOpen(); - } - - public function open() - { - $this->transport_->open(); - } - - public function close() - { - $this->transport_->close(); - } - - /** - * Reads from the buffer. When more data is required reads another entire - * chunk and serves future reads out of that. - * - * @param int $len How much data - */ - public function read($len) - { - if (!$this->read_) { - return $this->transport_->read($len); - } - - if (TStringFuncFactory::create()->strlen($this->rBuf_) === 0) { - $this->readFrame(); - } - - // Just return full buff - if ($len >= TStringFuncFactory::create()->strlen($this->rBuf_)) { - $out = $this->rBuf_; - $this->rBuf_ = null; - - return $out; - } - - // Return TStringFuncFactory::create()->substr - $out = TStringFuncFactory::create()->substr($this->rBuf_, 0, $len); - $this->rBuf_ = TStringFuncFactory::create()->substr($this->rBuf_, $len); - - return $out; - } - - /** - * Put previously read data back into the buffer - * - * @param string $data data to return - */ - public function putBack($data) - { - if (TStringFuncFactory::create()->strlen($this->rBuf_) === 0) { - $this->rBuf_ = $data; - } else { - $this->rBuf_ = ($data . $this->rBuf_); - } - } - - /** - * Reads a chunk of data into the internal read buffer. - */ - private function readFrame() - { - $buf = $this->transport_->readAll(4); - $val = unpack('N', $buf); - $sz = $val[1]; - - $this->rBuf_ = $this->transport_->readAll($sz); - } - - /** - * Writes some data to the pending output buffer. - * - * @param string $buf The data - * @param int $len Limit of bytes to write - */ - public function write($buf, $len = null) - { - if (!$this->write_) { - return $this->transport_->write($buf, $len); - } - - if ($len !== null && $len < TStringFuncFactory::create()->strlen($buf)) { - $buf = TStringFuncFactory::create()->substr($buf, 0, $len); - } - $this->wBuf_ .= $buf; - } - - /** - * Writes the output buffer to the stream in the format of a 4-byte length - * followed by the actual data. - */ - public function flush() - { - if (!$this->write_ || TStringFuncFactory::create()->strlen($this->wBuf_) == 0) { - return $this->transport_->flush(); - } - - $out = pack('N', TStringFuncFactory::create()->strlen($this->wBuf_)); - $out .= $this->wBuf_; - - // Note that we clear the internal wBuf_ prior to the underlying write - // to ensure we're in a sane state (i.e. internal buffer cleaned) - // if the underlying write throws up an exception - $this->wBuf_ = ''; - $this->transport_->write($out); - $this->transport_->flush(); - } -} diff --git a/vendor/packaged/thrift/src/Transport/THttpClient.php b/vendor/packaged/thrift/src/Transport/THttpClient.php deleted file mode 100644 index 4d6be32fe..000000000 --- a/vendor/packaged/thrift/src/Transport/THttpClient.php +++ /dev/null @@ -1,258 +0,0 @@ -strlen($uri) > 0) && ($uri[0] != '/')) { - $uri = '/' . $uri; - } - $this->scheme_ = $scheme; - $this->host_ = $host; - $this->port_ = $port; - $this->uri_ = $uri; - $this->buf_ = ''; - $this->handle_ = null; - $this->timeout_ = null; - $this->headers_ = array(); - $this->context_ = $context; - } - - /** - * Set read timeout - * - * @param float $timeout - */ - public function setTimeoutSecs($timeout) - { - $this->timeout_ = $timeout; - } - - /** - * Whether this transport is open. - * - * @return boolean true if open - */ - public function isOpen() - { - return true; - } - - /** - * Open the transport for reading/writing - * - * @throws TTransportException if cannot open - */ - public function open() - { - } - - /** - * Close the transport. - */ - public function close() - { - if ($this->handle_) { - @fclose($this->handle_); - $this->handle_ = null; - } - } - - /** - * Read some data into the array. - * - * @param int $len How much to read - * @return string The data that has been read - * @throws TTransportException if cannot read any more data - */ - public function read($len) - { - $data = @fread($this->handle_, $len); - if ($data === false || $data === '') { - $md = stream_get_meta_data($this->handle_); - if ($md['timed_out']) { - throw new TTransportException( - 'THttpClient: timed out reading ' . $len . ' bytes from ' . - $this->host_ . ':' . $this->port_ . $this->uri_, - TTransportException::TIMED_OUT - ); - } else { - throw new TTransportException( - 'THttpClient: Could not read ' . $len . ' bytes from ' . - $this->host_ . ':' . $this->port_ . $this->uri_, - TTransportException::UNKNOWN - ); - } - } - - return $data; - } - - /** - * Writes some data into the pending buffer - * - * @param string $buf The data to write - * @throws TTransportException if writing fails - */ - public function write($buf) - { - $this->buf_ .= $buf; - } - - /** - * Opens and sends the actual request over the HTTP connection - * - * @throws TTransportException if a writing error occurs - */ - public function flush() - { - // God, PHP really has some esoteric ways of doing simple things. - $host = $this->host_ . ($this->port_ != 80 ? ':' . $this->port_ : ''); - - $headers = array(); - $defaultHeaders = array('Host' => $host, - 'Accept' => 'application/x-thrift', - 'User-Agent' => 'PHP/THttpClient', - 'Content-Type' => 'application/x-thrift', - 'Content-Length' => TStringFuncFactory::create()->strlen($this->buf_)); - foreach (array_merge($defaultHeaders, $this->headers_) as $key => $value) { - $headers[] = "$key: $value"; - } - - $options = $this->context_; - - $baseHttpOptions = isset($options["http"]) ? $options["http"] : array(); - - $httpOptions = $baseHttpOptions + array('method' => 'POST', - 'header' => implode("\r\n", $headers), - 'max_redirects' => 1, - 'content' => $this->buf_); - if ($this->timeout_ > 0) { - $httpOptions['timeout'] = $this->timeout_; - } - $this->buf_ = ''; - - $options["http"] = $httpOptions; - $contextid = stream_context_create($options); - $this->handle_ = @fopen( - $this->scheme_ . '://' . $host . $this->uri_, - 'r', - false, - $contextid - ); - - // Connect failed? - if ($this->handle_ === false) { - $this->handle_ = null; - $error = 'THttpClient: Could not connect to ' . $host . $this->uri_; - throw new TTransportException($error, TTransportException::NOT_OPEN); - } - } - - public function addHeaders($headers) - { - $this->headers_ = array_merge($this->headers_, $headers); - } -} diff --git a/vendor/packaged/thrift/src/Transport/TMemoryBuffer.php b/vendor/packaged/thrift/src/Transport/TMemoryBuffer.php deleted file mode 100644 index fee03a2a4..000000000 --- a/vendor/packaged/thrift/src/Transport/TMemoryBuffer.php +++ /dev/null @@ -1,106 +0,0 @@ -buf_ = $buf; - } - - protected $buf_ = ''; - - public function isOpen() - { - return true; - } - - public function open() - { - } - - public function close() - { - } - - public function write($buf) - { - $this->buf_ .= $buf; - } - - public function read($len) - { - $bufLength = TStringFuncFactory::create()->strlen($this->buf_); - - if ($bufLength === 0) { - throw new TTransportException( - 'TMemoryBuffer: Could not read ' . - $len . ' bytes from buffer.', - TTransportException::UNKNOWN - ); - } - - if ($bufLength <= $len) { - $ret = $this->buf_; - $this->buf_ = ''; - - return $ret; - } - - $ret = TStringFuncFactory::create()->substr($this->buf_, 0, $len); - $this->buf_ = TStringFuncFactory::create()->substr($this->buf_, $len); - - return $ret; - } - - public function getBuffer() - { - return $this->buf_; - } - - public function available() - { - return TStringFuncFactory::create()->strlen($this->buf_); - } - - public function putBack($data) - { - $this->buf_ = $data . $this->buf_; - } -} diff --git a/vendor/packaged/thrift/src/Transport/TNullTransport.php b/vendor/packaged/thrift/src/Transport/TNullTransport.php deleted file mode 100644 index 7e086b67c..000000000 --- a/vendor/packaged/thrift/src/Transport/TNullTransport.php +++ /dev/null @@ -1,56 +0,0 @@ -read_ = $mode & self::MODE_R; - $this->write_ = $mode & self::MODE_W; - } - - public function open() - { - if ($this->read_) { - $this->inStream_ = @fopen(self::inStreamName(), 'r'); - if (!is_resource($this->inStream_)) { - throw new TException('TPhpStream: Could not open php://input'); - } - } - if ($this->write_) { - $this->outStream_ = @fopen('php://output', 'w'); - if (!is_resource($this->outStream_)) { - throw new TException('TPhpStream: Could not open php://output'); - } - } - } - - public function close() - { - if ($this->read_) { - @fclose($this->inStream_); - $this->inStream_ = null; - } - if ($this->write_) { - @fclose($this->outStream_); - $this->outStream_ = null; - } - } - - public function isOpen() - { - return - (!$this->read_ || is_resource($this->inStream_)) && - (!$this->write_ || is_resource($this->outStream_)); - } - - public function read($len) - { - $data = @fread($this->inStream_, $len); - if ($data === false || $data === '') { - throw new TException('TPhpStream: Could not read ' . $len . ' bytes'); - } - - return $data; - } - - public function write($buf) - { - while (TStringFuncFactory::create()->strlen($buf) > 0) { - $got = @fwrite($this->outStream_, $buf); - if ($got === 0 || $got === false) { - throw new TException( - 'TPhpStream: Could not write ' . TStringFuncFactory::create()->strlen($buf) . ' bytes' - ); - } - $buf = TStringFuncFactory::create()->substr($buf, $got); - } - } - - public function flush() - { - @fflush($this->outStream_); - } - - private static function inStreamName() - { - if (php_sapi_name() == 'cli') { - return 'php://stdin'; - } - - return 'php://input'; - } -} diff --git a/vendor/packaged/thrift/src/Transport/TSSLSocket.php b/vendor/packaged/thrift/src/Transport/TSSLSocket.php deleted file mode 100644 index b4a0adb54..000000000 --- a/vendor/packaged/thrift/src/Transport/TSSLSocket.php +++ /dev/null @@ -1,117 +0,0 @@ -host_ = $this->getSSLHost($host); - $this->port_ = $port; - $this->context_ = $context; - $this->debugHandler_ = $debugHandler ? $debugHandler : 'error_log'; - } - - /** - * Creates a host name with SSL transport protocol - * if no transport protocol already specified in - * the host name. - * - * @param string $host Host to listen on - * @return string $host Host name with transport protocol - */ - private function getSSLHost($host) - { - $transport_protocol_loc = strpos($host, "://"); - if ($transport_protocol_loc === false) { - $host = 'ssl://' . $host; - } - return $host; - } - - /** - * Connects the socket. - */ - public function open() - { - if ($this->isOpen()) { - throw new TTransportException('Socket already connected', TTransportException::ALREADY_OPEN); - } - - if (empty($this->host_)) { - throw new TTransportException('Cannot open null host', TTransportException::NOT_OPEN); - } - - if ($this->port_ <= 0) { - throw new TTransportException('Cannot open without port', TTransportException::NOT_OPEN); - } - - $this->handle_ = @stream_socket_client( - $this->host_ . ':' . $this->port_, - $errno, - $errstr, - $this->sendTimeoutSec_ + ($this->sendTimeoutUsec_ / 1000000), - STREAM_CLIENT_CONNECT, - $this->context_ - ); - - // Connect failed? - if ($this->handle_ === false) { - $error = 'TSocket: Could not connect to ' . - $this->host_ . ':' . $this->port_ . ' (' . $errstr . ' [' . $errno . '])'; - if ($this->debug_) { - call_user_func($this->debugHandler_, $error); - } - throw new TException($error); - } - } -} diff --git a/vendor/packaged/thrift/src/Transport/TSocket.php b/vendor/packaged/thrift/src/Transport/TSocket.php deleted file mode 100644 index 5147efa63..000000000 --- a/vendor/packaged/thrift/src/Transport/TSocket.php +++ /dev/null @@ -1,366 +0,0 @@ -host_ = $host; - $this->port_ = $port; - $this->persist_ = $persist; - $this->debugHandler_ = $debugHandler ? $debugHandler : 'error_log'; - } - - /** - * @param resource $handle - * @return void - */ - public function setHandle($handle) - { - $this->handle_ = $handle; - stream_set_blocking($this->handle_, false); - } - - /** - * Sets the send timeout. - * - * @param int $timeout Timeout in milliseconds. - */ - public function setSendTimeout($timeout) - { - $this->sendTimeoutSec_ = floor($timeout / 1000); - $this->sendTimeoutUsec_ = - ($timeout - ($this->sendTimeoutSec_ * 1000)) * 1000; - } - - /** - * Sets the receive timeout. - * - * @param int $timeout Timeout in milliseconds. - */ - public function setRecvTimeout($timeout) - { - $this->recvTimeoutSec_ = floor($timeout / 1000); - $this->recvTimeoutUsec_ = - ($timeout - ($this->recvTimeoutSec_ * 1000)) * 1000; - } - - /** - * Sets debugging output on or off - * - * @param bool $debug - */ - public function setDebug($debug) - { - $this->debug_ = $debug; - } - - /** - * Get the host that this socket is connected to - * - * @return string host - */ - public function getHost() - { - return $this->host_; - } - - /** - * Get the remote port that this socket is connected to - * - * @return int port - */ - public function getPort() - { - return $this->port_; - } - - /** - * Tests whether this is open - * - * @return bool true if the socket is open - */ - public function isOpen() - { - return is_resource($this->handle_); - } - - /** - * Connects the socket. - */ - public function open() - { - if ($this->isOpen()) { - throw new TTransportException('Socket already connected', TTransportException::ALREADY_OPEN); - } - - if (empty($this->host_)) { - throw new TTransportException('Cannot open null host', TTransportException::NOT_OPEN); - } - - if ($this->port_ <= 0) { - throw new TTransportException('Cannot open without port', TTransportException::NOT_OPEN); - } - - if ($this->persist_) { - $this->handle_ = @pfsockopen( - $this->host_, - $this->port_, - $errno, - $errstr, - $this->sendTimeoutSec_ + ($this->sendTimeoutUsec_ / 1000000) - ); - } else { - $this->handle_ = @fsockopen( - $this->host_, - $this->port_, - $errno, - $errstr, - $this->sendTimeoutSec_ + ($this->sendTimeoutUsec_ / 1000000) - ); - } - - // Connect failed? - if ($this->handle_ === false) { - $error = 'TSocket: Could not connect to ' . - $this->host_ . ':' . $this->port_ . ' (' . $errstr . ' [' . $errno . '])'; - if ($this->debug_) { - call_user_func($this->debugHandler_, $error); - } - throw new TException($error); - } - - if (function_exists('socket_import_stream') && function_exists('socket_set_option')) { - $socket = socket_import_stream($this->handle_); - socket_set_option($socket, SOL_TCP, TCP_NODELAY, 1); - } - } - - /** - * Closes the socket. - */ - public function close() - { - @fclose($this->handle_); - $this->handle_ = null; - } - - /** - * Read from the socket at most $len bytes. - * - * This method will not wait for all the requested data, it will return as - * soon as any data is received. - * - * @param int $len Maximum number of bytes to read. - * @return string Binary data - */ - public function read($len) - { - $null = null; - $read = array($this->handle_); - $readable = @stream_select( - $read, - $null, - $null, - $this->recvTimeoutSec_, - $this->recvTimeoutUsec_ - ); - - if ($readable > 0) { - $data = fread($this->handle_, $len); - if ($data === false) { - throw new TTransportException('TSocket: Could not read ' . $len . ' bytes from ' . - $this->host_ . ':' . $this->port_); - } elseif ($data == '' && feof($this->handle_)) { - throw new TTransportException('TSocket read 0 bytes'); - } - - return $data; - } elseif ($readable === 0) { - throw new TTransportException('TSocket: timed out reading ' . $len . ' bytes from ' . - $this->host_ . ':' . $this->port_); - } else { - throw new TTransportException('TSocket: Could not read ' . $len . ' bytes from ' . - $this->host_ . ':' . $this->port_); - } - } - - /** - * Write to the socket. - * - * @param string $buf The data to write - */ - public function write($buf) - { - $null = null; - $write = array($this->handle_); - - // keep writing until all the data has been written - while (TStringFuncFactory::create()->strlen($buf) > 0) { - // wait for stream to become available for writing - $writable = @stream_select( - $null, - $write, - $null, - $this->sendTimeoutSec_, - $this->sendTimeoutUsec_ - ); - if ($writable > 0) { - // write buffer to stream - $written = fwrite($this->handle_, $buf); - if ($written === -1 || $written === false) { - throw new TTransportException( - 'TSocket: Could not write ' . TStringFuncFactory::create()->strlen($buf) . ' bytes ' . - $this->host_ . ':' . $this->port_ - ); - } - // determine how much of the buffer is left to write - $buf = TStringFuncFactory::create()->substr($buf, $written); - } elseif ($writable === 0) { - throw new TTransportException( - 'TSocket: timed out writing ' . TStringFuncFactory::create()->strlen($buf) . ' bytes from ' . - $this->host_ . ':' . $this->port_ - ); - } else { - throw new TTransportException( - 'TSocket: Could not write ' . TStringFuncFactory::create()->strlen($buf) . ' bytes ' . - $this->host_ . ':' . $this->port_ - ); - } - } - } - - /** - * Flush output to the socket. - * - * Since read(), readAll() and write() operate on the sockets directly, - * this is a no-op - * - * If you wish to have flushable buffering behaviour, wrap this TSocket - * in a TBufferedTransport. - */ - public function flush() - { - // no-op - } -} diff --git a/vendor/packaged/thrift/src/Transport/TSocketPool.php b/vendor/packaged/thrift/src/Transport/TSocketPool.php deleted file mode 100644 index cb9e8ddfa..000000000 --- a/vendor/packaged/thrift/src/Transport/TSocketPool.php +++ /dev/null @@ -1,310 +0,0 @@ - $val) { - $ports[$key] = $port; - } - } - - foreach ($hosts as $key => $host) { - $this->servers_ [] = array('host' => $host, - 'port' => $ports[$key]); - } - } - - /** - * Add a server to the pool - * - * This function does not prevent you from adding a duplicate server entry. - * - * @param string $host hostname or IP - * @param int $port port - */ - public function addServer($host, $port) - { - $this->servers_[] = array('host' => $host, 'port' => $port); - } - - /** - * Sets how many time to keep retrying a host in the connect function. - * - * @param int $numRetries - */ - public function setNumRetries($numRetries) - { - $this->numRetries_ = $numRetries; - } - - /** - * Sets how long to wait until retrying a host if it was marked down - * - * @param int $numRetries - */ - public function setRetryInterval($retryInterval) - { - $this->retryInterval_ = $retryInterval; - } - - /** - * Sets how many time to keep retrying a host before marking it as down. - * - * @param int $numRetries - */ - public function setMaxConsecutiveFailures($maxConsecutiveFailures) - { - $this->maxConsecutiveFailures_ = $maxConsecutiveFailures; - } - - /** - * Turns randomization in connect order on or off. - * - * @param bool $randomize - */ - public function setRandomize($randomize) - { - $this->randomize_ = $randomize; - } - - /** - * Whether to always try the last server. - * - * @param bool $alwaysTryLast - */ - public function setAlwaysTryLast($alwaysTryLast) - { - $this->alwaysTryLast_ = $alwaysTryLast; - } - - /** - * Connects the socket by iterating through all the servers in the pool - * and trying to find one that works. - */ - public function open() - { - // Check if we want order randomization - if ($this->randomize_) { - shuffle($this->servers_); - } - - // Count servers to identify the "last" one - $numServers = count($this->servers_); - - for ($i = 0; $i < $numServers; ++$i) { - // This extracts the $host and $port variables - extract($this->servers_[$i]); - - // Check APC cache for a record of this server being down - $failtimeKey = 'thrift_failtime:' . $host . ':' . $port . '~'; - - // Cache miss? Assume it's OK - $lastFailtime = apc_fetch($failtimeKey); - if ($lastFailtime === false) { - $lastFailtime = 0; - } - - $retryIntervalPassed = false; - - // Cache hit...make sure enough the retry interval has elapsed - if ($lastFailtime > 0) { - $elapsed = time() - $lastFailtime; - if ($elapsed > $this->retryInterval_) { - $retryIntervalPassed = true; - if ($this->debug_) { - call_user_func( - $this->debugHandler_, - 'TSocketPool: retryInterval ' . - '(' . $this->retryInterval_ . ') ' . - 'has passed for host ' . $host . ':' . $port - ); - } - } - } - - // Only connect if not in the middle of a fail interval, OR if this - // is the LAST server we are trying, just hammer away on it - $isLastServer = false; - if ($this->alwaysTryLast_) { - $isLastServer = ($i == ($numServers - 1)); - } - - if (($lastFailtime === 0) || - ($isLastServer) || - ($lastFailtime > 0 && $retryIntervalPassed)) { - // Set underlying TSocket params to this one - $this->host_ = $host; - $this->port_ = $port; - - // Try up to numRetries_ connections per server - for ($attempt = 0; $attempt < $this->numRetries_; $attempt++) { - try { - // Use the underlying TSocket open function - parent::open(); - - // Only clear the failure counts if required to do so - if ($lastFailtime > 0) { - apc_store($failtimeKey, 0); - } - - // Successful connection, return now - return; - } catch (TException $tx) { - // Connection failed - } - } - - // Mark failure of this host in the cache - $consecfailsKey = 'thrift_consecfails:' . $host . ':' . $port . '~'; - - // Ignore cache misses - $consecfails = apc_fetch($consecfailsKey); - if ($consecfails === false) { - $consecfails = 0; - } - - // Increment by one - $consecfails++; - - // Log and cache this failure - if ($consecfails >= $this->maxConsecutiveFailures_) { - if ($this->debug_) { - call_user_func( - $this->debugHandler_, - 'TSocketPool: marking ' . $host . ':' . $port . - ' as down for ' . $this->retryInterval_ . ' secs ' . - 'after ' . $consecfails . ' failed attempts.' - ); - } - // Store the failure time - apc_store($failtimeKey, time()); - - // Clear the count of consecutive failures - apc_store($consecfailsKey, 0); - } else { - apc_store($consecfailsKey, $consecfails); - } - } - } - - // Oh no; we failed them all. The system is totally ill! - $error = 'TSocketPool: All hosts in pool are down. '; - $hosts = array(); - foreach ($this->servers_ as $server) { - $hosts [] = $server['host'] . ':' . $server['port']; - } - $hostlist = implode(',', $hosts); - $error .= '(' . $hostlist . ')'; - if ($this->debug_) { - call_user_func($this->debugHandler_, $error); - } - throw new TException($error); - } -} diff --git a/vendor/packaged/thrift/src/Transport/TTransport.php b/vendor/packaged/thrift/src/Transport/TTransport.php deleted file mode 100644 index 35921c666..000000000 --- a/vendor/packaged/thrift/src/Transport/TTransport.php +++ /dev/null @@ -1,98 +0,0 @@ -read($len); - - $data = ''; - $got = 0; - while (($got = TStringFuncFactory::create()->strlen($data)) < $len) { - $data .= $this->read($len - $got); - } - - return $data; - } - - /** - * Writes the given data out. - * - * @param string $buf The data to write - * @throws TTransportException if writing fails - */ - abstract public function write($buf); - - /** - * Flushes any pending data out of a buffer - * - * @throws TTransportException if a writing error occurs - */ - public function flush() - { - } -} diff --git a/vendor/packaged/thrift/src/Type/TConstant.php b/vendor/packaged/thrift/src/Type/TConstant.php deleted file mode 100644 index 215da4a3d..000000000 --- a/vendor/packaged/thrift/src/Type/TConstant.php +++ /dev/null @@ -1,52 +0,0 @@ -in(__DIR__.'/src') + ->name('*.php') +; + +$config = (new PhpCsFixer\Config()) + ->setRiskyAllowed(true) + ->setRules([ + '@Symfony' => true, + ]) + ->setFinder($finder) +; + +return $config; diff --git a/vendor/php-http/discovery/CHANGELOG.md b/vendor/php-http/discovery/CHANGELOG.md new file mode 100644 index 000000000..169f7f40f --- /dev/null +++ b/vendor/php-http/discovery/CHANGELOG.md @@ -0,0 +1,374 @@ +# Change Log + +## 1.19.1 - 2023-07-11 + +- [#250](https://github.com/php-http/discovery/pull/250) - Fix: Buzz client instantiation using deprecated Message Factory Discovery, use PSR-17 factory discovery instead. + +## 1.19.0 - 2023-06-19 + +- [#249](https://github.com/php-http/discovery/pull/249) - Have composer plugin correctly install Symfony http client when nothing explicitly requires psr 18 resp. httplug. +- [#241](https://github.com/php-http/discovery/pull/241) - Support discovering PSR-17 factories of `httpsoft/http-message` package + +## 1.18.1 - 2023-05-17 + +- [#242](https://github.com/php-http/discovery/pull/242) - Better exception message when no legacy php-http message factories can be built. Also needs php-http/message-factory package and they are deprecated in favor of PSR-17 anyways. + +## 1.18.0 - 2023-05-03 + +- [#235](https://github.com/php-http/discovery/pull/235) - Deprecate HttpClientDiscovery, use Psr18ClientDiscovery instead +- [#238](https://github.com/php-http/discovery/pull/238) - Skip requiring php-http/message-factory when installing symfony/http-client 6.3+ +- [#239](https://github.com/php-http/discovery/pull/239) - Skip auto-installing when the root package's extra.discovery is enough + +## 1.17.0 - 2023-04-26 + +- [#230](https://github.com/php-http/discovery/pull/230) - Add Psr18Client to make it straightforward to use PSR-18 +- [#232](https://github.com/php-http/discovery/pull/232) - Allow pinning the preferred implementations in composer.json +- [#233](https://github.com/php-http/discovery/pull/233) - Fix Psr17Factory::createServerRequestFromGlobals() when uploaded files have been moved + +## 1.16.0 - 2023-04-26 + +- [#225](https://github.com/php-http/discovery/pull/225) - Remove support for the abandoned Zend Diactoros which has been replaced with Laminas Diactoros; marked the zend library as conflict in composer.json to avoid confusion +- [#227](https://github.com/php-http/discovery/pull/227) - Fix handling requests with nested files + +## 1.15.3 - 2023-03-31 + +- [#224](https://github.com/php-http/discovery/pull/224) - Fix regression with Magento classloader + +## 1.15.2 - 2023-02-11 + +- [#219](https://github.com/php-http/discovery/pull/219) - Fix handling of replaced packages + +## 1.15.1 - 2023-02-10 + +- [#214](https://github.com/php-http/discovery/pull/214) - Fix resolving deps for psr/http-message-implementation +- [#216](https://github.com/php-http/discovery/pull/216) - Fix keeping platform requirements when rebooting composer +- [#217](https://github.com/php-http/discovery/pull/217) - Set extra.plugin-optional composer flag + +## 1.15.0 - 2023-02-09 + +- [#209](https://github.com/php-http/discovery/pull/209) - Add generic `Psr17Factory` class +- [#208](https://github.com/php-http/discovery/pull/208) - Add composer plugin to auto-install missing implementations. + When libraries require an http implementation but no packages providing that implementation is installed in the application, the plugin will automatically install one. + This is only done for libraries that directly require php-http/discovery to avoid unexpected dependency installation. + +## 1.14.3 - 2022-07-11 + +- [#207](https://github.com/php-http/discovery/pull/207) - Updates Exception to extend Throwable solving static analysis errors for consumers + +## 1.14.2 - 2022-05-25 + +- [#202](https://github.com/php-http/discovery/pull/202) - Avoid error when the Symfony PSR-18 client exists but its dependencies are not installed + +## 1.14.1 - 2021-09-18 + +- [#199](https://github.com/php-http/discovery/pull/199) - Fixes message factory discovery for `laminas-diactoros ^2.7` + +## 1.14.0 - 2021-06-21 + +- Deprecate puli as it has been unmaintained for a long time and is not compatible with composer 2 https://github.com/php-http/discovery/pull/195 + +## 1.13.0 - 2020-11-27 + +- Support discovering PSR-17 factories of `slim/psr7` package https://github.com/php-http/discovery/pull/192 + +## 1.12.0 - 2020-09-22 + +- Support discovering HttpClient of `php-http/guzzle7-adapter` https://github.com/php-http/discovery/pull/189 + +## 1.11.0 - 2020-09-22 + +- Use correct method name to find Uri Factory in PSR17 https://github.com/php-http/discovery/pull/181 + +## 1.10.0 - 2020-09-04 + +- Discover PSR-18 implementation of phalcon + +## 1.9.1 - 2020-07-13 + +### Fixed + +- Support PHP 7.4 and 8.0 + +## 1.9.0 - 2020-07-02 + +### Added + +- Support discovering PSR-18 factories of `guzzlehttp/guzzle` 7+ + +## 1.8.0 - 2020-06-14 + +### Added + +- Support discovering PSR-17 factories of `guzzlehttp/psr7` package +- Support discovering PSR-17 factories of `laminas/laminas-diactoros` package +- `ClassDiscovery::getStrategies()` to retrieve the list of current strategies. + +### Fixed + +- Ignore exception during discovery when Symfony HttplugClient checks if HTTPlug is available. + +## 1.7.4 - 2020-01-03 + +### Fixed + +- Improve conditions on Symfony's async HTTPlug client. + +## 1.7.3 - 2019-12-27 + +### Fixed + +- Enough conditions to only use Symfony HTTP client if all needed components are available. + +## 1.7.2 - 2019-12-27 + +### Fixed + +- Allow a condition to specify an interface and not just classes. + +## 1.7.1 - 2019-12-26 + +### Fixed + +- Better conditions to see if Symfony's HTTP clients are available. + +## 1.7.0 - 2019-06-30 + +### Added + +- Dropped support for PHP < 7.1 +- Support for `symfony/http-client` + +## 1.6.1 - 2019-02-23 + +### Fixed + +- MockClientStrategy also provides the mock client when requesting an async client + +## 1.6.0 - 2019-01-23 + +### Added + +- Support for PSR-17 factories +- Support for PSR-18 clients + +## 1.5.2 - 2018-12-31 + +Corrected mistakes in 1.5.1. The different between 1.5.2 and 1.5.0 is that +we removed some PHP 7 code. + +https://github.com/php-http/discovery/compare/1.5.0...1.5.2 + +## 1.5.1 - 2018-12-31 + +This version added new features by mistake. These are reverted in 1.5.2. + +Do not use 1.5.1. + +### Fixed + +- Removed PHP 7 code + +## 1.5.0 - 2018-12-30 + +### Added + +- Support for `nyholm/psr7` version 1.0. +- `ClassDiscovery::safeClassExists` which will help Magento users. +- Support for HTTPlug 2.0 +- Support for Buzz 1.0 +- Better error message when nothing found by introducing a new exception: `NoCandidateFoundException`. + +### Fixed + +- Fixed condition evaluation, it should stop after first invalid condition. + +## 1.4.0 - 2018-02-06 + +### Added + +- Discovery support for nyholm/psr7 + +## 1.3.0 - 2017-08-03 + +### Added + +- Discovery support for CakePHP adapter +- Discovery support for Zend adapter +- Discovery support for Artax adapter + +## 1.2.1 - 2017-03-02 + +### Fixed + +- Fixed minor issue with `MockClientStrategy`, also added more tests. + +## 1.2.0 - 2017-02-12 + +### Added + +- MockClientStrategy class. + +## 1.1.1 - 2016-11-27 + +### Changed + +- Made exception messages clearer. `StrategyUnavailableException` is no longer the previous exception to `DiscoveryFailedException`. +- `CommonClassesStrategy` is using `self` instead of `static`. Using `static` makes no sense when `CommonClassesStrategy` is final. + +## 1.1.0 - 2016-10-20 + +### Added + +- Discovery support for Slim Framework factories + +## 1.0.0 - 2016-07-18 + +### Added + +- Added back `Http\Discovery\NotFoundException` to preserve BC with 0.8 version. You may upgrade from 0.8.x and 0.9.x to 1.0.0 without any BC breaks. +- Added interface `Http\Discovery\Exception` which is implemented by all our exceptions + +### Changed + +- Puli strategy renamed to Puli Beta strategy to prevent incompatibility with a future Puli stable + +### Deprecated + +- For BC reasons, the old `Http\Discovery\NotFoundException` (extending the new exception) will be thrown until version 2.0 + + +## 0.9.1 - 2016-06-28 + +### Changed + +- Dropping PHP 5.4 support because we use the ::class constant. + + +## 0.9.0 - 2016-06-25 + +### Added + +- Discovery strategies to find classes + +### Changed + +- [Puli](http://puli.io) made optional +- Improved exceptions +- **[BC] `NotFoundException` moved to `Http\Discovery\Exception\NotFoundException`** + + +## 0.8.0 - 2016-02-11 + +### Changed + +- Puli composer plugin must be installed separately + + +## 0.7.0 - 2016-01-15 + +### Added + +- Temporary puli.phar (Beta 10) executable + +### Changed + +- Updated HTTPlug dependencies +- Updated Puli dependencies +- Local configuration to make tests passing + +### Removed + +- Puli CLI dependency + + +## 0.6.4 - 2016-01-07 + +### Fixed + +- Puli [not working](https://twitter.com/PuliPHP/status/685132540588507137) with the latest json-schema + + +## 0.6.3 - 2016-01-04 + +### Changed + +- Adjust Puli dependencies + + +## 0.6.2 - 2016-01-04 + +### Changed + +- Make Puli CLI a requirement + + +## 0.6.1 - 2016-01-03 + +### Changed + +- More flexible Puli requirement + + +## 0.6.0 - 2015-12-30 + +### Changed + +- Use [Puli](http://puli.io) for discovery +- Improved exception messages + + +## 0.5.0 - 2015-12-25 + +### Changed + +- Updated message factory dependency (php-http/message) + + +## 0.4.0 - 2015-12-17 + +### Added + +- Array condition evaluation in the Class Discovery + +### Removed + +- Message factories (moved to php-http/utils) + + +## 0.3.0 - 2015-11-18 + +### Added + +- HTTP Async Client Discovery +- Stream factories + +### Changed + +- Discoveries and Factories are final +- Message and Uri factories have the type in their names +- Diactoros Message factory uses Stream factory internally + +### Fixed + +- Improved docblocks for API documentation generation + + +## 0.2.0 - 2015-10-31 + +### Changed + +- Renamed AdapterDiscovery to ClientDiscovery + + +## 0.1.1 - 2015-06-13 + +### Fixed + +- Bad HTTP Adapter class name for Guzzle 5 + + +## 0.1.0 - 2015-06-12 + +### Added + +- Initial release diff --git a/vendor/php-http/discovery/LICENSE b/vendor/php-http/discovery/LICENSE new file mode 100644 index 000000000..4558d6f06 --- /dev/null +++ b/vendor/php-http/discovery/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-2016 PHP HTTP Team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/php-http/discovery/README.md b/vendor/php-http/discovery/README.md new file mode 100644 index 000000000..ef7e4991b --- /dev/null +++ b/vendor/php-http/discovery/README.md @@ -0,0 +1,122 @@ +# HTTPlug Discovery + +[![Latest Version](https://img.shields.io/github/release/php-http/discovery.svg?style=flat-square)](https://github.com/php-http/discovery/releases) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) +[![Tests](https://github.com/php-http/discovery/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/php-http/discovery/actions/workflows/ci.yml?query=branch%3Amaster) +[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/discovery.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/discovery) +[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/discovery.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/discovery) +[![Total Downloads](https://img.shields.io/packagist/dt/php-http/discovery.svg?style=flat-square)](https://packagist.org/packages/php-http/discovery) + +**This library provides auto-discovery and auto-installation of well-known PSR-17, PSR-18 and HTTPlug implementations.** + + +## Install + +Via Composer + +``` bash +composer require php-http/discovery +``` + + +## Usage as a library author + +Please see the [official documentation](http://php-http.readthedocs.org/en/latest/discovery.html). + +If your library/SDK needs a PSR-18 client, here is a quick example. + +First, you need to install a PSR-18 client and a PSR-17 factory implementations. +This should be done only for dev dependencies as you don't want to force a +specific implementation on your users: + +```bash +composer require --dev symfony/http-client +composer require --dev nyholm/psr7 +``` + +Then, you can disable the Composer plugin embeded in `php-http/discovery` +because you just installed the dev dependencies you need for testing: + +```bash +composer config allow-plugins.php-http/discovery false +``` + +Finally, you need to require `php-http/discovery` and the generic implementations +that your library is going to need: + +```bash +composer require 'php-http/discovery:^1.17' +composer require 'psr/http-client-implementation:*' +composer require 'psr/http-factory-implementation:*' +``` + +Now, you're ready to make an HTTP request: + +```php +use Http\Discovery\Psr18Client; + +$client = new Psr18Client(); + +$request = $client->createRequest('GET', 'https://example.com'); +$response = $client->sendRequest($request); +``` + +Internally, this code will use whatever PSR-7, PSR-17 and PSR-18 implementations +that your users have installed. + + +## Usage as a library user + +If you use a library/SDK that requires `php-http/discovery`, you can configure +the auto-discovery mechanism to use a specific implementation when many are +available in your project. + +For example, if you have both `nyholm/psr7` and `guzzlehttp/guzzle` in your +project, you can tell `php-http/discovery` to use `guzzlehttp/guzzle` instead of +`nyholm/psr7` by running the following command: + +```bash +composer config extra.discovery.psr/http-factory-implementation GuzzleHttp\\Psr7\\HttpFactory +``` + +This will update your `composer.json` file to add the following configuration: + +```json +{ + "extra": { + "discovery": { + "psr/http-factory-implementation": "GuzzleHttp\\Psr7\\HttpFactory" + } + } +} +``` + +Don't forget to run `composer install` to apply the changes, and ensure that +the composer plugin is enabled: + +```bash +composer config allow-plugins.php-http/discovery true +composer install +``` + + +## Testing + +``` bash +composer test +``` + + +## Contributing + +Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html). + + +## Security + +If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). + + +## License + +The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/discovery/composer.json b/vendor/php-http/discovery/composer.json new file mode 100644 index 000000000..d38ab83b3 --- /dev/null +++ b/vendor/php-http/discovery/composer.json @@ -0,0 +1,63 @@ +{ + "name": "php-http/discovery", + "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations", + "type": "composer-plugin", + "license": "MIT", + "keywords": ["http", "discovery", "client", "adapter", "message", "factory", "psr7", "psr17"], + "homepage": "http://php-http.org", + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "*", + "psr/http-factory-implementation": "*", + "psr/http-message-implementation": "*" + }, + "require": { + "php": "^7.1 || ^8.0", + "composer-plugin-api": "^1.0|^2.0" + }, + "require-dev": { + "composer/composer": "^1.0.2|^2.0", + "graham-campbell/phpspec-skip-example-extension": "^5.0", + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3", + "symfony/phpunit-bridge": "^6.2" + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + }, + "exclude-from-classmap": [ + "src/Composer/Plugin.php" + ] + }, + "autoload-dev": { + "psr-4": { + "spec\\Http\\Discovery\\": "spec/" + } + }, + "scripts": { + "test": [ + "vendor/bin/phpspec run", + "vendor/bin/simple-phpunit --group NothingInstalled" + ], + "test-ci": "vendor/bin/phpspec run -c phpspec.ci.yml" + }, + "extra": { + "class": "Http\\Discovery\\Composer\\Plugin", + "plugin-optional": true + }, + "conflict": { + "nyholm/psr7": "<1.0", + "zendframework/zend-diactoros": "*" + }, + "prefer-stable": true, + "minimum-stability": "beta" +} diff --git a/vendor/php-http/discovery/src/ClassDiscovery.php b/vendor/php-http/discovery/src/ClassDiscovery.php new file mode 100644 index 000000000..5ea469797 --- /dev/null +++ b/vendor/php-http/discovery/src/ClassDiscovery.php @@ -0,0 +1,255 @@ + + * @author Márk Sági-Kazár + * @author Tobias Nyholm + */ +abstract class ClassDiscovery +{ + /** + * A list of strategies to find classes. + * + * @var DiscoveryStrategy[] + */ + private static $strategies = [ + Strategy\GeneratedDiscoveryStrategy::class, + Strategy\CommonClassesStrategy::class, + Strategy\CommonPsr17ClassesStrategy::class, + Strategy\PuliBetaStrategy::class, + ]; + + private static $deprecatedStrategies = [ + Strategy\PuliBetaStrategy::class => true, + ]; + + /** + * Discovery cache to make the second time we use discovery faster. + * + * @var array + */ + private static $cache = []; + + /** + * Finds a class. + * + * @param string $type + * + * @return string|\Closure + * + * @throws DiscoveryFailedException + */ + protected static function findOneByType($type) + { + // Look in the cache + if (null !== ($class = self::getFromCache($type))) { + return $class; + } + + static $skipStrategy; + $skipStrategy ?? $skipStrategy = self::safeClassExists(Strategy\GeneratedDiscoveryStrategy::class) ? false : Strategy\GeneratedDiscoveryStrategy::class; + + $exceptions = []; + foreach (self::$strategies as $strategy) { + if ($skipStrategy === $strategy) { + continue; + } + + try { + $candidates = $strategy::getCandidates($type); + } catch (StrategyUnavailableException $e) { + if (!isset(self::$deprecatedStrategies[$strategy])) { + $exceptions[] = $e; + } + + continue; + } + + foreach ($candidates as $candidate) { + if (isset($candidate['condition'])) { + if (!self::evaluateCondition($candidate['condition'])) { + continue; + } + } + + // save the result for later use + self::storeInCache($type, $candidate); + + return $candidate['class']; + } + + $exceptions[] = new NoCandidateFoundException($strategy, $candidates); + } + + throw DiscoveryFailedException::create($exceptions); + } + + /** + * Get a value from cache. + * + * @param string $type + * + * @return string|null + */ + private static function getFromCache($type) + { + if (!isset(self::$cache[$type])) { + return; + } + + $candidate = self::$cache[$type]; + if (isset($candidate['condition'])) { + if (!self::evaluateCondition($candidate['condition'])) { + return; + } + } + + return $candidate['class']; + } + + /** + * Store a value in cache. + * + * @param string $type + * @param string $class + */ + private static function storeInCache($type, $class) + { + self::$cache[$type] = $class; + } + + /** + * Set new strategies and clear the cache. + * + * @param string[] $strategies list of fully qualified class names that implement DiscoveryStrategy + */ + public static function setStrategies(array $strategies) + { + self::$strategies = $strategies; + self::clearCache(); + } + + /** + * Returns the currently configured discovery strategies as fully qualified class names. + * + * @return string[] + */ + public static function getStrategies(): iterable + { + return self::$strategies; + } + + /** + * Append a strategy at the end of the strategy queue. + * + * @param string $strategy Fully qualified class name of a DiscoveryStrategy + */ + public static function appendStrategy($strategy) + { + self::$strategies[] = $strategy; + self::clearCache(); + } + + /** + * Prepend a strategy at the beginning of the strategy queue. + * + * @param string $strategy Fully qualified class name to a DiscoveryStrategy + */ + public static function prependStrategy($strategy) + { + array_unshift(self::$strategies, $strategy); + self::clearCache(); + } + + public static function clearCache() + { + self::$cache = []; + } + + /** + * Evaluates conditions to boolean. + * + * @return bool + */ + protected static function evaluateCondition($condition) + { + if (is_string($condition)) { + // Should be extended for functions, extensions??? + return self::safeClassExists($condition); + } + if (is_callable($condition)) { + return (bool) $condition(); + } + if (is_bool($condition)) { + return $condition; + } + if (is_array($condition)) { + foreach ($condition as $c) { + if (false === static::evaluateCondition($c)) { + // Immediately stop execution if the condition is false + return false; + } + } + + return true; + } + + return false; + } + + /** + * Get an instance of the $class. + * + * @param string|\Closure $class a FQCN of a class or a closure that instantiate the class + * + * @return object + * + * @throws ClassInstantiationFailedException + */ + protected static function instantiateClass($class) + { + try { + if (is_string($class)) { + return new $class(); + } + + if (is_callable($class)) { + return $class(); + } + } catch (\Exception $e) { + throw new ClassInstantiationFailedException('Unexpected exception when instantiating class.', 0, $e); + } + + throw new ClassInstantiationFailedException('Could not instantiate class because parameter is neither a callable nor a string'); + } + + /** + * We need a "safe" version of PHP's "class_exists" because Magento has a bug + * (or they call it a "feature"). Magento is throwing an exception if you do class_exists() + * on a class that ends with "Factory" and if that file does not exits. + * + * This function catches all potential exceptions and makes sure to always return a boolean. + * + * @param string $class + * + * @return bool + */ + public static function safeClassExists($class) + { + try { + return class_exists($class) || interface_exists($class); + } catch (\Exception $e) { + return false; + } + } +} diff --git a/vendor/php-http/discovery/src/Composer/Plugin.php b/vendor/php-http/discovery/src/Composer/Plugin.php new file mode 100644 index 000000000..32ef401e3 --- /dev/null +++ b/vendor/php-http/discovery/src/Composer/Plugin.php @@ -0,0 +1,465 @@ + + * + * @internal + */ +class Plugin implements PluginInterface, EventSubscriberInterface +{ + /** + * Describes, for every supported virtual implementation, which packages + * provide said implementation and which extra dependencies each package + * requires to provide the implementation. + */ + private const PROVIDE_RULES = [ + 'php-http/async-client-implementation' => [ + 'symfony/http-client:>=6.3' => ['guzzlehttp/promises', 'psr/http-factory-implementation', 'php-http/httplug'], + 'symfony/http-client' => ['guzzlehttp/promises', 'php-http/message-factory', 'psr/http-factory-implementation', 'php-http/httplug'], + 'php-http/guzzle7-adapter' => [], + 'php-http/guzzle6-adapter' => [], + 'php-http/curl-client' => [], + 'php-http/react-adapter' => [], + ], + 'php-http/client-implementation' => [ + 'symfony/http-client:>=6.3' => ['psr/http-factory-implementation', 'php-http/httplug'], + 'symfony/http-client' => ['php-http/message-factory', 'psr/http-factory-implementation', 'php-http/httplug'], + 'php-http/guzzle7-adapter' => [], + 'php-http/guzzle6-adapter' => [], + 'php-http/cakephp-adapter' => [], + 'php-http/curl-client' => [], + 'php-http/react-adapter' => [], + 'php-http/buzz-adapter' => [], + 'php-http/artax-adapter' => [], + 'kriswallsmith/buzz:^1' => [], + ], + 'psr/http-client-implementation' => [ + 'symfony/http-client' => ['psr/http-factory-implementation', 'psr/http-client'], + 'guzzlehttp/guzzle' => [], + 'kriswallsmith/buzz:^1' => [], + ], + 'psr/http-message-implementation' => [ + 'php-http/discovery' => ['psr/http-factory-implementation'], + ], + 'psr/http-factory-implementation' => [ + 'nyholm/psr7' => [], + 'guzzlehttp/psr7:>=2' => [], + 'slim/psr7' => [], + 'laminas/laminas-diactoros' => [], + 'phalcon/cphalcon:^4' => [], + 'http-interop/http-factory-guzzle' => [], + 'http-interop/http-factory-diactoros' => [], + 'http-interop/http-factory-slim' => [], + 'httpsoft/http-message' => [], + ], + ]; + + /** + * Describes which package should be preferred on the left side + * depending on which one is already installed on the right side. + */ + private const STICKYNESS_RULES = [ + 'symfony/http-client' => 'symfony/framework-bundle', + 'php-http/guzzle7-adapter' => 'guzzlehttp/guzzle:^7', + 'php-http/guzzle6-adapter' => 'guzzlehttp/guzzle:^6', + 'php-http/guzzle5-adapter' => 'guzzlehttp/guzzle:^5', + 'php-http/cakephp-adapter' => 'cakephp/cakephp', + 'php-http/react-adapter' => 'react/event-loop', + 'php-http/buzz-adapter' => 'kriswallsmith/buzz:^0.15.1', + 'php-http/artax-adapter' => 'amphp/artax:^3', + 'http-interop/http-factory-guzzle' => 'guzzlehttp/psr7:^1', + 'http-interop/http-factory-slim' => 'slim/slim:^3', + ]; + + private const INTERFACE_MAP = [ + 'php-http/async-client-implementation' => [ + 'Http\Client\HttpAsyncClient', + ], + 'php-http/client-implementation' => [ + 'Http\Client\HttpClient', + ], + 'psr/http-client-implementation' => [ + 'Psr\Http\Client\ClientInterface', + ], + 'psr/http-factory-implementation' => [ + 'Psr\Http\Message\RequestFactoryInterface', + 'Psr\Http\Message\ResponseFactoryInterface', + 'Psr\Http\Message\ServerRequestFactoryInterface', + 'Psr\Http\Message\StreamFactoryInterface', + 'Psr\Http\Message\UploadedFileFactoryInterface', + 'Psr\Http\Message\UriFactoryInterface', + ], + ]; + + public static function getSubscribedEvents(): array + { + return [ + ScriptEvents::PRE_AUTOLOAD_DUMP => 'preAutoloadDump', + ScriptEvents::POST_UPDATE_CMD => 'postUpdate', + ]; + } + + public function activate(Composer $composer, IOInterface $io): void + { + } + + public function deactivate(Composer $composer, IOInterface $io) + { + } + + public function uninstall(Composer $composer, IOInterface $io) + { + } + + public function postUpdate(Event $event) + { + $composer = $event->getComposer(); + $repo = $composer->getRepositoryManager()->getLocalRepository(); + $requires = [ + $composer->getPackage()->getRequires(), + $composer->getPackage()->getDevRequires(), + ]; + $pinnedAbstractions = []; + $pinned = $composer->getPackage()->getExtra()['discovery'] ?? []; + foreach (self::INTERFACE_MAP as $abstraction => $interfaces) { + foreach (isset($pinned[$abstraction]) ? [] : $interfaces as $interface) { + if (!isset($pinned[$interface])) { + continue 2; + } + } + $pinnedAbstractions[$abstraction] = true; + } + + $missingRequires = $this->getMissingRequires($repo, $requires, 'project' === $composer->getPackage()->getType(), $pinnedAbstractions); + $missingRequires = [ + 'require' => array_fill_keys(array_merge([], ...array_values($missingRequires[0])), '*'), + 'require-dev' => array_fill_keys(array_merge([], ...array_values($missingRequires[1])), '*'), + 'remove' => array_fill_keys(array_merge([], ...array_values($missingRequires[2])), '*'), + ]; + + if (!$missingRequires = array_filter($missingRequires)) { + return; + } + + $composerJsonContents = file_get_contents(Factory::getComposerFile()); + $this->updateComposerJson($missingRequires, $composer->getConfig()->get('sort-packages')); + + $installer = null; + // Find the composer installer, hack borrowed from symfony/flex + foreach (debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT) as $trace) { + if (isset($trace['object']) && $trace['object'] instanceof Installer) { + $installer = $trace['object']; + break; + } + } + + if (!$installer) { + return; + } + + $event->stopPropagation(); + + $dispatcher = $composer->getEventDispatcher(); + $disableScripts = !method_exists($dispatcher, 'setRunScripts') || !((array) $dispatcher)["\0*\0runScripts"]; + $composer = Factory::create($event->getIO(), null, false, $disableScripts); + + /** @var Installer $installer */ + $installer = clone $installer; + if (method_exists($installer, 'setAudit')) { + $trace['object']->setAudit(false); + } + // we need a clone of the installer to preserve its configuration state but with our own service objects + $installer->__construct( + $event->getIO(), + $composer->getConfig(), + $composer->getPackage(), + $composer->getDownloadManager(), + $composer->getRepositoryManager(), + $composer->getLocker(), + $composer->getInstallationManager(), + $composer->getEventDispatcher(), + $composer->getAutoloadGenerator() + ); + if (method_exists($installer, 'setPlatformRequirementFilter')) { + $installer->setPlatformRequirementFilter(((array) $trace['object'])["\0*\0platformRequirementFilter"]); + } + + if (0 !== $installer->run()) { + file_put_contents(Factory::getComposerFile(), $composerJsonContents); + + return; + } + + $versionSelector = new VersionSelector(ClassDiscovery::safeClassExists(RepositorySet::class) ? new RepositorySet() : new Pool()); + $updateComposerJson = false; + + foreach ($composer->getRepositoryManager()->getLocalRepository()->getPackages() as $package) { + foreach (['require', 'require-dev'] as $key) { + if (!isset($missingRequires[$key][$package->getName()])) { + continue; + } + $updateComposerJson = true; + $missingRequires[$key][$package->getName()] = $versionSelector->findRecommendedRequireVersion($package); + } + } + + if ($updateComposerJson) { + $this->updateComposerJson($missingRequires, $composer->getConfig()->get('sort-packages')); + $this->updateComposerLock($composer, $event->getIO()); + } + } + + public function getMissingRequires(InstalledRepositoryInterface $repo, array $requires, bool $isProject, array $pinnedAbstractions): array + { + $allPackages = []; + $devPackages = method_exists($repo, 'getDevPackageNames') ? array_fill_keys($repo->getDevPackageNames(), true) : []; + + // One must require "php-http/discovery" + // to opt-in for auto-installation of virtual package implementations + if (!isset($requires[0]['php-http/discovery'])) { + $requires = [[], []]; + } + + foreach ($repo->getPackages() as $package) { + $allPackages[$package->getName()] = true; + + if (1 < \count($names = $package->getNames(false))) { + $allPackages += array_fill_keys($names, false); + + if (isset($devPackages[$package->getName()])) { + $devPackages += $names; + } + } + + if (isset($package->getRequires()['php-http/discovery'])) { + $requires[(int) isset($devPackages[$package->getName()])] += $package->getRequires(); + } + } + + $missingRequires = [[], [], []]; + $versionParser = new VersionParser(); + + if (ClassDiscovery::safeClassExists(\Phalcon\Http\Message\RequestFactory::class, false)) { + $missingRequires[0]['psr/http-factory-implementation'] = []; + $missingRequires[1]['psr/http-factory-implementation'] = []; + } + + foreach ($requires as $dev => $rules) { + $abstractions = []; + $rules = array_intersect_key(self::PROVIDE_RULES, $rules); + + while ($rules) { + $abstraction = key($rules); + + if (isset($pinnedAbstractions[$abstraction])) { + unset($rules[$abstraction]); + continue; + } + + $abstractions[] = $abstraction; + + foreach (array_shift($rules) as $candidate => $deps) { + [$candidate, $version] = explode(':', $candidate, 2) + [1 => null]; + + if (!isset($allPackages[$candidate])) { + continue; + } + if (null !== $version && !$repo->findPackage($candidate, $versionParser->parseConstraints($version))) { + continue; + } + if ($isProject && !$dev && isset($devPackages[$candidate])) { + $missingRequires[0][$abstraction] = [$candidate]; + $missingRequires[2][$abstraction] = [$candidate]; + } else { + $missingRequires[$dev][$abstraction] = []; + } + + foreach ($deps as $dep) { + if (isset(self::PROVIDE_RULES[$dep])) { + $rules[$dep] = self::PROVIDE_RULES[$dep]; + } elseif (!isset($allPackages[$dep])) { + $missingRequires[$dev][$abstraction][] = $dep; + } elseif ($isProject && !$dev && isset($devPackages[$dep])) { + $missingRequires[0][$abstraction][] = $dep; + $missingRequires[2][$abstraction][] = $dep; + } + } + break; + } + } + + while ($abstractions) { + $abstraction = array_shift($abstractions); + + if (isset($missingRequires[$dev][$abstraction])) { + continue; + } + $candidates = self::PROVIDE_RULES[$abstraction]; + + foreach ($candidates as $candidate => $deps) { + [$candidate, $version] = explode(':', $candidate, 2) + [1 => null]; + + if (null !== $version && !$repo->findPackage($candidate, $versionParser->parseConstraints($version))) { + continue; + } + if (isset($allPackages[$candidate]) && (!$isProject || $dev || !isset($devPackages[$candidate]))) { + continue 2; + } + } + + foreach (array_intersect_key(self::STICKYNESS_RULES, $candidates) as $candidate => $stickyRule) { + [$stickyName, $stickyVersion] = explode(':', $stickyRule, 2) + [1 => null]; + if (!isset($allPackages[$stickyName]) || ($isProject && !$dev && isset($devPackages[$stickyName]))) { + continue; + } + if (null !== $stickyVersion && !$repo->findPackage($stickyName, $versionParser->parseConstraints($stickyVersion))) { + continue; + } + + $candidates = [$candidate => $candidates[$candidate]]; + break; + } + + $dep = key($candidates); + [$dep] = explode(':', $dep, 2); + $missingRequires[$dev][$abstraction] = [$dep]; + + if ($isProject && !$dev && isset($devPackages[$dep])) { + $missingRequires[2][$abstraction][] = $dep; + } + } + } + + $missingRequires[1] = array_diff_key($missingRequires[1], $missingRequires[0]); + + return $missingRequires; + } + + public function preAutoloadDump(Event $event) + { + $filesystem = new Filesystem(); + // Double realpath() on purpose, see https://bugs.php.net/72738 + $vendorDir = $filesystem->normalizePath(realpath(realpath($event->getComposer()->getConfig()->get('vendor-dir')))); + $filesystem->ensureDirectoryExists($vendorDir.'/composer'); + $pinned = $event->getComposer()->getPackage()->getExtra()['discovery'] ?? []; + $candidates = []; + + $allInterfaces = array_merge(...array_values(self::INTERFACE_MAP)); + foreach ($pinned as $abstraction => $class) { + if (isset(self::INTERFACE_MAP[$abstraction])) { + $interfaces = self::INTERFACE_MAP[$abstraction]; + } elseif (false !== $k = array_search($abstraction, $allInterfaces, true)) { + $interfaces = [$allInterfaces[$k]]; + } else { + throw new \UnexpectedValueException(sprintf('Invalid "extra.discovery" pinned in composer.json: "%s" is not one of ["%s"].', $abstraction, implode('", "', array_keys(self::INTERFACE_MAP)))); + } + + foreach ($interfaces as $interface) { + $candidates[] = sprintf("case %s: return [['class' => %s]];\n", var_export($interface, true), var_export($class, true)); + } + } + + $file = $vendorDir.'/composer/GeneratedDiscoveryStrategy.php'; + + if (!$candidates) { + if (file_exists($file)) { + unlink($file); + } + + return; + } + + $candidates = implode(' ', $candidates); + $code = <<getComposer()->getPackage(); + $autoload = $rootPackage->getAutoload(); + $autoload['classmap'][] = $vendorDir.'/composer/GeneratedDiscoveryStrategy.php'; + $rootPackage->setAutoload($autoload); + } + + private function updateComposerJson(array $missingRequires, bool $sortPackages) + { + $file = Factory::getComposerFile(); + $contents = file_get_contents($file); + + $manipulator = new JsonManipulator($contents); + + foreach ($missingRequires as $key => $packages) { + foreach ($packages as $package => $constraint) { + if ('remove' === $key) { + $manipulator->removeSubNode('require-dev', $package); + } else { + $manipulator->addLink($key, $package, $constraint, $sortPackages); + } + } + } + + file_put_contents($file, $manipulator->getContents()); + } + + private function updateComposerLock(Composer $composer, IOInterface $io) + { + $lock = substr(Factory::getComposerFile(), 0, -4).'lock'; + $composerJson = file_get_contents(Factory::getComposerFile()); + $lockFile = new JsonFile($lock, null, $io); + $locker = ClassDiscovery::safeClassExists(RepositorySet::class) + ? new Locker($io, $lockFile, $composer->getInstallationManager(), $composerJson) + : new Locker($io, $lockFile, $composer->getRepositoryManager(), $composer->getInstallationManager(), $composerJson); + $lockData = $locker->getLockData(); + $lockData['content-hash'] = Locker::getContentHash($composerJson); + $lockFile->write($lockData); + } +} diff --git a/vendor/php-http/discovery/src/Exception.php b/vendor/php-http/discovery/src/Exception.php new file mode 100644 index 000000000..0fa8c767e --- /dev/null +++ b/vendor/php-http/discovery/src/Exception.php @@ -0,0 +1,12 @@ + + */ +interface Exception extends \Throwable +{ +} diff --git a/vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php b/vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php new file mode 100644 index 000000000..e95bf5d82 --- /dev/null +++ b/vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php @@ -0,0 +1,14 @@ + + */ +final class ClassInstantiationFailedException extends \RuntimeException implements Exception +{ +} diff --git a/vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php b/vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php new file mode 100644 index 000000000..304b7276e --- /dev/null +++ b/vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php @@ -0,0 +1,51 @@ + + */ +final class DiscoveryFailedException extends \Exception implements Exception +{ + /** + * @var \Exception[] + */ + private $exceptions; + + /** + * @param string $message + * @param \Exception[] $exceptions + */ + public function __construct($message, array $exceptions = []) + { + $this->exceptions = $exceptions; + + parent::__construct($message); + } + + /** + * @param \Exception[] $exceptions + */ + public static function create($exceptions) + { + $message = 'Could not find resource using any discovery strategy. Find more information at http://docs.php-http.org/en/latest/discovery.html#common-errors'; + foreach ($exceptions as $e) { + $message .= "\n - ".$e->getMessage(); + } + $message .= "\n\n"; + + return new self($message, $exceptions); + } + + /** + * @return \Exception[] + */ + public function getExceptions() + { + return $this->exceptions; + } +} diff --git a/vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php b/vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php new file mode 100644 index 000000000..32f65db7b --- /dev/null +++ b/vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php @@ -0,0 +1,47 @@ + + */ +final class NoCandidateFoundException extends \Exception implements Exception +{ + /** + * @param string $strategy + */ + public function __construct($strategy, array $candidates) + { + $classes = array_map( + function ($a) { + return $a['class']; + }, + $candidates + ); + + $message = sprintf( + 'No valid candidate found using strategy "%s". We tested the following candidates: %s.', + $strategy, + implode(', ', array_map([$this, 'stringify'], $classes)) + ); + + parent::__construct($message); + } + + private function stringify($mixed) + { + if (is_string($mixed)) { + return $mixed; + } + + if (is_array($mixed) && 2 === count($mixed)) { + return sprintf('%s::%s', $this->stringify($mixed[0]), $mixed[1]); + } + + return is_object($mixed) ? get_class($mixed) : gettype($mixed); + } +} diff --git a/vendor/php-http/discovery/src/Exception/NotFoundException.php b/vendor/php-http/discovery/src/Exception/NotFoundException.php new file mode 100644 index 000000000..ef8b9c584 --- /dev/null +++ b/vendor/php-http/discovery/src/Exception/NotFoundException.php @@ -0,0 +1,16 @@ + + */ +/* final */ class NotFoundException extends \RuntimeException implements Exception +{ +} diff --git a/vendor/php-http/discovery/src/Exception/PuliUnavailableException.php b/vendor/php-http/discovery/src/Exception/PuliUnavailableException.php new file mode 100644 index 000000000..a6ade7332 --- /dev/null +++ b/vendor/php-http/discovery/src/Exception/PuliUnavailableException.php @@ -0,0 +1,12 @@ + + */ +final class PuliUnavailableException extends StrategyUnavailableException +{ +} diff --git a/vendor/php-http/discovery/src/Exception/StrategyUnavailableException.php b/vendor/php-http/discovery/src/Exception/StrategyUnavailableException.php new file mode 100644 index 000000000..89ecf3523 --- /dev/null +++ b/vendor/php-http/discovery/src/Exception/StrategyUnavailableException.php @@ -0,0 +1,15 @@ + + */ +class StrategyUnavailableException extends \RuntimeException implements Exception +{ +} diff --git a/vendor/php-http/discovery/src/HttpAsyncClientDiscovery.php b/vendor/php-http/discovery/src/HttpAsyncClientDiscovery.php new file mode 100644 index 000000000..a0c4d5b7c --- /dev/null +++ b/vendor/php-http/discovery/src/HttpAsyncClientDiscovery.php @@ -0,0 +1,32 @@ + + */ +final class HttpAsyncClientDiscovery extends ClassDiscovery +{ + /** + * Finds an HTTP Async Client. + * + * @return HttpAsyncClient + * + * @throws Exception\NotFoundException + */ + public static function find() + { + try { + $asyncClient = static::findOneByType(HttpAsyncClient::class); + } catch (DiscoveryFailedException $e) { + throw new NotFoundException('No HTTPlug async clients found. Make sure to install a package providing "php-http/async-client-implementation". Example: "php-http/guzzle6-adapter".', 0, $e); + } + + return static::instantiateClass($asyncClient); + } +} diff --git a/vendor/php-http/discovery/src/HttpClientDiscovery.php b/vendor/php-http/discovery/src/HttpClientDiscovery.php new file mode 100644 index 000000000..2501e5bbf --- /dev/null +++ b/vendor/php-http/discovery/src/HttpClientDiscovery.php @@ -0,0 +1,34 @@ + + * + * @deprecated This will be removed in 2.0. Consider using Psr18ClientDiscovery. + */ +final class HttpClientDiscovery extends ClassDiscovery +{ + /** + * Finds an HTTP Client. + * + * @return HttpClient + * + * @throws Exception\NotFoundException + */ + public static function find() + { + try { + $client = static::findOneByType(HttpClient::class); + } catch (DiscoveryFailedException $e) { + throw new NotFoundException('No HTTPlug clients found. Make sure to install a package providing "php-http/client-implementation". Example: "php-http/guzzle6-adapter".', 0, $e); + } + + return static::instantiateClass($client); + } +} diff --git a/vendor/php-http/discovery/src/MessageFactoryDiscovery.php b/vendor/php-http/discovery/src/MessageFactoryDiscovery.php new file mode 100644 index 000000000..4ae104aa6 --- /dev/null +++ b/vendor/php-http/discovery/src/MessageFactoryDiscovery.php @@ -0,0 +1,34 @@ + + * + * @deprecated This will be removed in 2.0. Consider using Psr17FactoryDiscovery. + */ +final class MessageFactoryDiscovery extends ClassDiscovery +{ + /** + * Finds a Message Factory. + * + * @return MessageFactory + * + * @throws Exception\NotFoundException + */ + public static function find() + { + try { + $messageFactory = static::findOneByType(MessageFactory::class); + } catch (DiscoveryFailedException $e) { + throw new NotFoundException('No php-http message factories found. Note that the php-http message factories are deprecated in favor of the PSR-17 message factories. To use the legacy Guzzle, Diactoros or Slim Framework factories of php-http, install php-http/message and php-http/message-factory and the chosen message implementation.', 0, $e); + } + + return static::instantiateClass($messageFactory); + } +} diff --git a/vendor/php-http/discovery/src/NotFoundException.php b/vendor/php-http/discovery/src/NotFoundException.php new file mode 100644 index 000000000..d59dadbf8 --- /dev/null +++ b/vendor/php-http/discovery/src/NotFoundException.php @@ -0,0 +1,14 @@ + + * + * @deprecated since since version 1.0, and will be removed in 2.0. Use {@link \Http\Discovery\Exception\NotFoundException} instead. + */ +final class NotFoundException extends \Http\Discovery\Exception\NotFoundException +{ +} diff --git a/vendor/php-http/discovery/src/Psr17Factory.php b/vendor/php-http/discovery/src/Psr17Factory.php new file mode 100644 index 000000000..5d3ab9273 --- /dev/null +++ b/vendor/php-http/discovery/src/Psr17Factory.php @@ -0,0 +1,303 @@ + + * Copyright (c) 2015 Michael Dowling + * Copyright (c) 2015 Márk Sági-Kazár + * Copyright (c) 2015 Graham Campbell + * Copyright (c) 2016 Tobias Schultze + * Copyright (c) 2016 George Mponos + * Copyright (c) 2016-2018 Tobias Nyholm + * + * @author Nicolas Grekas + */ +class Psr17Factory implements RequestFactoryInterface, ResponseFactoryInterface, ServerRequestFactoryInterface, StreamFactoryInterface, UploadedFileFactoryInterface, UriFactoryInterface +{ + private $requestFactory; + private $responseFactory; + private $serverRequestFactory; + private $streamFactory; + private $uploadedFileFactory; + private $uriFactory; + + public function __construct( + RequestFactoryInterface $requestFactory = null, + ResponseFactoryInterface $responseFactory = null, + ServerRequestFactoryInterface $serverRequestFactory = null, + StreamFactoryInterface $streamFactory = null, + UploadedFileFactoryInterface $uploadedFileFactory = null, + UriFactoryInterface $uriFactory = null + ) { + $this->requestFactory = $requestFactory; + $this->responseFactory = $responseFactory; + $this->serverRequestFactory = $serverRequestFactory; + $this->streamFactory = $streamFactory; + $this->uploadedFileFactory = $uploadedFileFactory; + $this->uriFactory = $uriFactory; + + $this->setFactory($requestFactory); + $this->setFactory($responseFactory); + $this->setFactory($serverRequestFactory); + $this->setFactory($streamFactory); + $this->setFactory($uploadedFileFactory); + $this->setFactory($uriFactory); + } + + /** + * @param UriInterface|string $uri + */ + public function createRequest(string $method, $uri): RequestInterface + { + $factory = $this->requestFactory ?? $this->setFactory(Psr17FactoryDiscovery::findRequestFactory()); + + return $factory->createRequest(...\func_get_args()); + } + + public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface + { + $factory = $this->responseFactory ?? $this->setFactory(Psr17FactoryDiscovery::findResponseFactory()); + + return $factory->createResponse(...\func_get_args()); + } + + /** + * @param UriInterface|string $uri + */ + public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface + { + $factory = $this->serverRequestFactory ?? $this->setFactory(Psr17FactoryDiscovery::findServerRequestFactory()); + + return $factory->createServerRequest(...\func_get_args()); + } + + public function createServerRequestFromGlobals(array $server = null, array $get = null, array $post = null, array $cookie = null, array $files = null, StreamInterface $body = null): ServerRequestInterface + { + $server = $server ?? $_SERVER; + $request = $this->createServerRequest($server['REQUEST_METHOD'] ?? 'GET', $this->createUriFromGlobals($server), $server); + + return $this->buildServerRequestFromGlobals($request, $server, $files ?? $_FILES) + ->withQueryParams($get ?? $_GET) + ->withParsedBody($post ?? $_POST) + ->withCookieParams($cookie ?? $_COOKIE) + ->withBody($body ?? $this->createStreamFromFile('php://input', 'r+')); + } + + public function createStream(string $content = ''): StreamInterface + { + $factory = $this->streamFactory ?? $this->setFactory(Psr17FactoryDiscovery::findStreamFactory()); + + return $factory->createStream($content); + } + + public function createStreamFromFile(string $filename, string $mode = 'r'): StreamInterface + { + $factory = $this->streamFactory ?? $this->setFactory(Psr17FactoryDiscovery::findStreamFactory()); + + return $factory->createStreamFromFile($filename, $mode); + } + + /** + * @param resource $resource + */ + public function createStreamFromResource($resource): StreamInterface + { + $factory = $this->streamFactory ?? $this->setFactory(Psr17FactoryDiscovery::findStreamFactory()); + + return $factory->createStreamFromResource($resource); + } + + public function createUploadedFile(StreamInterface $stream, int $size = null, int $error = \UPLOAD_ERR_OK, string $clientFilename = null, string $clientMediaType = null): UploadedFileInterface + { + $factory = $this->uploadedFileFactory ?? $this->setFactory(Psr17FactoryDiscovery::findUploadedFileFactory()); + + return $factory->createUploadedFile(...\func_get_args()); + } + + public function createUri(string $uri = ''): UriInterface + { + $factory = $this->uriFactory ?? $this->setFactory(Psr17FactoryDiscovery::findUriFactory()); + + return $factory->createUri(...\func_get_args()); + } + + public function createUriFromGlobals(array $server = null): UriInterface + { + return $this->buildUriFromGlobals($this->createUri(''), $server ?? $_SERVER); + } + + private function setFactory($factory) + { + if (!$this->requestFactory && $factory instanceof RequestFactoryInterface) { + $this->requestFactory = $factory; + } + if (!$this->responseFactory && $factory instanceof ResponseFactoryInterface) { + $this->responseFactory = $factory; + } + if (!$this->serverRequestFactory && $factory instanceof ServerRequestFactoryInterface) { + $this->serverRequestFactory = $factory; + } + if (!$this->streamFactory && $factory instanceof StreamFactoryInterface) { + $this->streamFactory = $factory; + } + if (!$this->uploadedFileFactory && $factory instanceof UploadedFileFactoryInterface) { + $this->uploadedFileFactory = $factory; + } + if (!$this->uriFactory && $factory instanceof UriFactoryInterface) { + $this->uriFactory = $factory; + } + + return $factory; + } + + private function buildServerRequestFromGlobals(ServerRequestInterface $request, array $server, array $files): ServerRequestInterface + { + $request = $request + ->withProtocolVersion(isset($server['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $server['SERVER_PROTOCOL']) : '1.1') + ->withUploadedFiles($this->normalizeFiles($files)); + + $headers = []; + foreach ($server as $k => $v) { + if (0 === strpos($k, 'HTTP_')) { + $k = substr($k, 5); + } elseif (!\in_array($k, ['CONTENT_TYPE', 'CONTENT_LENGTH', 'CONTENT_MD5'], true)) { + continue; + } + $k = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $k)))); + + $headers[$k] = $v; + } + + if (!isset($headers['Authorization'])) { + if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) { + $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; + } elseif (isset($_SERVER['PHP_AUTH_USER'])) { + $headers['Authorization'] = 'Basic '.base64_encode($_SERVER['PHP_AUTH_USER'].':'.($_SERVER['PHP_AUTH_PW'] ?? '')); + } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { + $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; + } + } + + foreach ($headers as $k => $v) { + try { + $request = $request->withHeader($k, $v); + } catch (\InvalidArgumentException $e) { + // ignore invalid headers + } + } + + return $request; + } + + private function buildUriFromGlobals(UriInterface $uri, array $server): UriInterface + { + $uri = $uri->withScheme(!empty($server['HTTPS']) && 'off' !== strtolower($server['HTTPS']) ? 'https' : 'http'); + + $hasPort = false; + if (isset($server['HTTP_HOST'])) { + $parts = parse_url('http://'.$server['HTTP_HOST']); + + $uri = $uri->withHost($parts['host'] ?? 'localhost'); + + if ($parts['port'] ?? false) { + $hasPort = true; + $uri = $uri->withPort($parts['port']); + } + } else { + $uri = $uri->withHost($server['SERVER_NAME'] ?? $server['SERVER_ADDR'] ?? 'localhost'); + } + + if (!$hasPort && isset($server['SERVER_PORT'])) { + $uri = $uri->withPort($server['SERVER_PORT']); + } + + $hasQuery = false; + if (isset($server['REQUEST_URI'])) { + $requestUriParts = explode('?', $server['REQUEST_URI'], 2); + $uri = $uri->withPath($requestUriParts[0]); + if (isset($requestUriParts[1])) { + $hasQuery = true; + $uri = $uri->withQuery($requestUriParts[1]); + } + } + + if (!$hasQuery && isset($server['QUERY_STRING'])) { + $uri = $uri->withQuery($server['QUERY_STRING']); + } + + return $uri; + } + + private function normalizeFiles(array $files): array + { + foreach ($files as $k => $v) { + if ($v instanceof UploadedFileInterface) { + continue; + } + if (!\is_array($v)) { + unset($files[$k]); + } elseif (!isset($v['tmp_name'])) { + $files[$k] = $this->normalizeFiles($v); + } else { + $files[$k] = $this->createUploadedFileFromSpec($v); + } + } + + return $files; + } + + /** + * Create and return an UploadedFile instance from a $_FILES specification. + * + * @param array $value $_FILES struct + * + * @return UploadedFileInterface|UploadedFileInterface[] + */ + private function createUploadedFileFromSpec(array $value) + { + if (!is_array($tmpName = $value['tmp_name'])) { + $file = is_file($tmpName) ? $this->createStreamFromFile($tmpName, 'r') : $this->createStream(); + + return $this->createUploadedFile($file, $value['size'], $value['error'], $value['name'], $value['type']); + } + + foreach ($tmpName as $k => $v) { + $tmpName[$k] = $this->createUploadedFileFromSpec([ + 'tmp_name' => $v, + 'size' => $value['size'][$k] ?? null, + 'error' => $value['error'][$k] ?? null, + 'name' => $value['name'][$k] ?? null, + 'type' => $value['type'][$k] ?? null, + ]); + } + + return $tmpName; + } +} diff --git a/vendor/php-http/discovery/src/Psr17FactoryDiscovery.php b/vendor/php-http/discovery/src/Psr17FactoryDiscovery.php new file mode 100644 index 000000000..a73c6414b --- /dev/null +++ b/vendor/php-http/discovery/src/Psr17FactoryDiscovery.php @@ -0,0 +1,136 @@ + + */ +final class Psr17FactoryDiscovery extends ClassDiscovery +{ + private static function createException($type, Exception $e) + { + return new \Http\Discovery\Exception\NotFoundException( + 'No PSR-17 '.$type.' found. Install a package from this list: https://packagist.org/providers/psr/http-factory-implementation', + 0, + $e + ); + } + + /** + * @return RequestFactoryInterface + * + * @throws Exception\NotFoundException + */ + public static function findRequestFactory() + { + try { + $messageFactory = static::findOneByType(RequestFactoryInterface::class); + } catch (DiscoveryFailedException $e) { + throw self::createException('request factory', $e); + } + + return static::instantiateClass($messageFactory); + } + + /** + * @return ResponseFactoryInterface + * + * @throws Exception\NotFoundException + */ + public static function findResponseFactory() + { + try { + $messageFactory = static::findOneByType(ResponseFactoryInterface::class); + } catch (DiscoveryFailedException $e) { + throw self::createException('response factory', $e); + } + + return static::instantiateClass($messageFactory); + } + + /** + * @return ServerRequestFactoryInterface + * + * @throws Exception\NotFoundException + */ + public static function findServerRequestFactory() + { + try { + $messageFactory = static::findOneByType(ServerRequestFactoryInterface::class); + } catch (DiscoveryFailedException $e) { + throw self::createException('server request factory', $e); + } + + return static::instantiateClass($messageFactory); + } + + /** + * @return StreamFactoryInterface + * + * @throws Exception\NotFoundException + */ + public static function findStreamFactory() + { + try { + $messageFactory = static::findOneByType(StreamFactoryInterface::class); + } catch (DiscoveryFailedException $e) { + throw self::createException('stream factory', $e); + } + + return static::instantiateClass($messageFactory); + } + + /** + * @return UploadedFileFactoryInterface + * + * @throws Exception\NotFoundException + */ + public static function findUploadedFileFactory() + { + try { + $messageFactory = static::findOneByType(UploadedFileFactoryInterface::class); + } catch (DiscoveryFailedException $e) { + throw self::createException('uploaded file factory', $e); + } + + return static::instantiateClass($messageFactory); + } + + /** + * @return UriFactoryInterface + * + * @throws Exception\NotFoundException + */ + public static function findUriFactory() + { + try { + $messageFactory = static::findOneByType(UriFactoryInterface::class); + } catch (DiscoveryFailedException $e) { + throw self::createException('url factory', $e); + } + + return static::instantiateClass($messageFactory); + } + + /** + * @return UriFactoryInterface + * + * @throws Exception\NotFoundException + * + * @deprecated This will be removed in 2.0. Consider using the findUriFactory() method. + */ + public static function findUrlFactory() + { + return static::findUriFactory(); + } +} diff --git a/vendor/php-http/discovery/src/Psr18Client.php b/vendor/php-http/discovery/src/Psr18Client.php new file mode 100644 index 000000000..c47780ec6 --- /dev/null +++ b/vendor/php-http/discovery/src/Psr18Client.php @@ -0,0 +1,45 @@ + + */ +class Psr18Client extends Psr17Factory implements ClientInterface +{ + private $client; + + public function __construct( + ClientInterface $client = null, + RequestFactoryInterface $requestFactory = null, + ResponseFactoryInterface $responseFactory = null, + ServerRequestFactoryInterface $serverRequestFactory = null, + StreamFactoryInterface $streamFactory = null, + UploadedFileFactoryInterface $uploadedFileFactory = null, + UriFactoryInterface $uriFactory = null + ) { + parent::__construct($requestFactory, $responseFactory, $serverRequestFactory, $streamFactory, $uploadedFileFactory, $uriFactory); + + $this->client = $client ?? Psr18ClientDiscovery::find(); + } + + public function sendRequest(RequestInterface $request): ResponseInterface + { + return $this->client->sendRequest($request); + } +} diff --git a/vendor/php-http/discovery/src/Psr18ClientDiscovery.php b/vendor/php-http/discovery/src/Psr18ClientDiscovery.php new file mode 100644 index 000000000..dfd2dd1e7 --- /dev/null +++ b/vendor/php-http/discovery/src/Psr18ClientDiscovery.php @@ -0,0 +1,32 @@ + + */ +final class Psr18ClientDiscovery extends ClassDiscovery +{ + /** + * Finds a PSR-18 HTTP Client. + * + * @return ClientInterface + * + * @throws Exception\NotFoundException + */ + public static function find() + { + try { + $client = static::findOneByType(ClientInterface::class); + } catch (DiscoveryFailedException $e) { + throw new \Http\Discovery\Exception\NotFoundException('No PSR-18 clients found. Make sure to install a package providing "psr/http-client-implementation". Example: "php-http/guzzle7-adapter".', 0, $e); + } + + return static::instantiateClass($client); + } +} diff --git a/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php b/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php new file mode 100644 index 000000000..ae0b0d842 --- /dev/null +++ b/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php @@ -0,0 +1,180 @@ + + * + * Don't miss updating src/Composer/Plugin.php when adding a new supported class. + */ +final class CommonClassesStrategy implements DiscoveryStrategy +{ + /** + * @var array + */ + private static $classes = [ + MessageFactory::class => [ + ['class' => NyholmHttplugFactory::class, 'condition' => [NyholmHttplugFactory::class]], + ['class' => GuzzleMessageFactory::class, 'condition' => [GuzzleRequest::class, GuzzleMessageFactory::class]], + ['class' => DiactorosMessageFactory::class, 'condition' => [DiactorosRequest::class, DiactorosMessageFactory::class]], + ['class' => SlimMessageFactory::class, 'condition' => [SlimRequest::class, SlimMessageFactory::class]], + ], + StreamFactory::class => [ + ['class' => NyholmHttplugFactory::class, 'condition' => [NyholmHttplugFactory::class]], + ['class' => GuzzleStreamFactory::class, 'condition' => [GuzzleRequest::class, GuzzleStreamFactory::class]], + ['class' => DiactorosStreamFactory::class, 'condition' => [DiactorosRequest::class, DiactorosStreamFactory::class]], + ['class' => SlimStreamFactory::class, 'condition' => [SlimRequest::class, SlimStreamFactory::class]], + ], + UriFactory::class => [ + ['class' => NyholmHttplugFactory::class, 'condition' => [NyholmHttplugFactory::class]], + ['class' => GuzzleUriFactory::class, 'condition' => [GuzzleRequest::class, GuzzleUriFactory::class]], + ['class' => DiactorosUriFactory::class, 'condition' => [DiactorosRequest::class, DiactorosUriFactory::class]], + ['class' => SlimUriFactory::class, 'condition' => [SlimRequest::class, SlimUriFactory::class]], + ], + HttpAsyncClient::class => [ + ['class' => SymfonyHttplug::class, 'condition' => [SymfonyHttplug::class, Promise::class, [self::class, 'isPsr17FactoryInstalled']]], + ['class' => Guzzle7::class, 'condition' => Guzzle7::class], + ['class' => Guzzle6::class, 'condition' => Guzzle6::class], + ['class' => Curl::class, 'condition' => Curl::class], + ['class' => React::class, 'condition' => React::class], + ], + HttpClient::class => [ + ['class' => SymfonyHttplug::class, 'condition' => [SymfonyHttplug::class, [self::class, 'isPsr17FactoryInstalled']]], + ['class' => Guzzle7::class, 'condition' => Guzzle7::class], + ['class' => Guzzle6::class, 'condition' => Guzzle6::class], + ['class' => Guzzle5::class, 'condition' => Guzzle5::class], + ['class' => Curl::class, 'condition' => Curl::class], + ['class' => Socket::class, 'condition' => Socket::class], + ['class' => Buzz::class, 'condition' => Buzz::class], + ['class' => React::class, 'condition' => React::class], + ['class' => Cake::class, 'condition' => Cake::class], + ['class' => Artax::class, 'condition' => Artax::class], + [ + 'class' => [self::class, 'buzzInstantiate'], + 'condition' => [\Buzz\Client\FileGetContents::class, \Buzz\Message\ResponseBuilder::class], + ], + ], + Psr18Client::class => [ + [ + 'class' => [self::class, 'symfonyPsr18Instantiate'], + 'condition' => [SymfonyPsr18::class, Psr17RequestFactory::class], + ], + [ + 'class' => GuzzleHttp::class, + 'condition' => [self::class, 'isGuzzleImplementingPsr18'], + ], + [ + 'class' => [self::class, 'buzzInstantiate'], + 'condition' => [\Buzz\Client\FileGetContents::class, \Buzz\Message\ResponseBuilder::class], + ], + ], + ]; + + public static function getCandidates($type) + { + if (Psr18Client::class === $type) { + return self::getPsr18Candidates(); + } + + return self::$classes[$type] ?? []; + } + + /** + * @return array The return value is always an array with zero or more elements. Each + * element is an array with two keys ['class' => string, 'condition' => mixed]. + */ + private static function getPsr18Candidates() + { + $candidates = self::$classes[Psr18Client::class]; + + // HTTPlug 2.0 clients implements PSR18Client too. + foreach (self::$classes[HttpClient::class] as $c) { + if (!is_string($c['class'])) { + continue; + } + try { + if (ClassDiscovery::safeClassExists($c['class']) && is_subclass_of($c['class'], Psr18Client::class)) { + $candidates[] = $c; + } + } catch (\Throwable $e) { + trigger_error(sprintf('Got exception "%s (%s)" while checking if a PSR-18 Client is available', get_class($e), $e->getMessage()), E_USER_WARNING); + } + } + + return $candidates; + } + + public static function buzzInstantiate() + { + return new \Buzz\Client\FileGetContents(Psr17FactoryDiscovery::findResponseFactory()); + } + + public static function symfonyPsr18Instantiate() + { + return new SymfonyPsr18(null, Psr17FactoryDiscovery::findResponseFactory(), Psr17FactoryDiscovery::findStreamFactory()); + } + + public static function isGuzzleImplementingPsr18() + { + return defined('GuzzleHttp\ClientInterface::MAJOR_VERSION'); + } + + /** + * Can be used as a condition. + * + * @return bool + */ + public static function isPsr17FactoryInstalled() + { + try { + Psr17FactoryDiscovery::findResponseFactory(); + } catch (NotFoundException $e) { + return false; + } catch (\Throwable $e) { + trigger_error(sprintf('Got exception "%s (%s)" while checking if a PSR-17 ResponseFactory is available', get_class($e), $e->getMessage()), E_USER_WARNING); + + return false; + } + + return true; + } +} diff --git a/vendor/php-http/discovery/src/Strategy/CommonPsr17ClassesStrategy.php b/vendor/php-http/discovery/src/Strategy/CommonPsr17ClassesStrategy.php new file mode 100644 index 000000000..04cf4baf8 --- /dev/null +++ b/vendor/php-http/discovery/src/Strategy/CommonPsr17ClassesStrategy.php @@ -0,0 +1,104 @@ + + * + * Don't miss updating src/Composer/Plugin.php when adding a new supported class. + */ +final class CommonPsr17ClassesStrategy implements DiscoveryStrategy +{ + /** + * @var array + */ + private static $classes = [ + RequestFactoryInterface::class => [ + 'Phalcon\Http\Message\RequestFactory', + 'Nyholm\Psr7\Factory\Psr17Factory', + 'GuzzleHttp\Psr7\HttpFactory', + 'Http\Factory\Diactoros\RequestFactory', + 'Http\Factory\Guzzle\RequestFactory', + 'Http\Factory\Slim\RequestFactory', + 'Laminas\Diactoros\RequestFactory', + 'Slim\Psr7\Factory\RequestFactory', + 'HttpSoft\Message\RequestFactory', + ], + ResponseFactoryInterface::class => [ + 'Phalcon\Http\Message\ResponseFactory', + 'Nyholm\Psr7\Factory\Psr17Factory', + 'GuzzleHttp\Psr7\HttpFactory', + 'Http\Factory\Diactoros\ResponseFactory', + 'Http\Factory\Guzzle\ResponseFactory', + 'Http\Factory\Slim\ResponseFactory', + 'Laminas\Diactoros\ResponseFactory', + 'Slim\Psr7\Factory\ResponseFactory', + 'HttpSoft\Message\ResponseFactory', + ], + ServerRequestFactoryInterface::class => [ + 'Phalcon\Http\Message\ServerRequestFactory', + 'Nyholm\Psr7\Factory\Psr17Factory', + 'GuzzleHttp\Psr7\HttpFactory', + 'Http\Factory\Diactoros\ServerRequestFactory', + 'Http\Factory\Guzzle\ServerRequestFactory', + 'Http\Factory\Slim\ServerRequestFactory', + 'Laminas\Diactoros\ServerRequestFactory', + 'Slim\Psr7\Factory\ServerRequestFactory', + 'HttpSoft\Message\ServerRequestFactory', + ], + StreamFactoryInterface::class => [ + 'Phalcon\Http\Message\StreamFactory', + 'Nyholm\Psr7\Factory\Psr17Factory', + 'GuzzleHttp\Psr7\HttpFactory', + 'Http\Factory\Diactoros\StreamFactory', + 'Http\Factory\Guzzle\StreamFactory', + 'Http\Factory\Slim\StreamFactory', + 'Laminas\Diactoros\StreamFactory', + 'Slim\Psr7\Factory\StreamFactory', + 'HttpSoft\Message\StreamFactory', + ], + UploadedFileFactoryInterface::class => [ + 'Phalcon\Http\Message\UploadedFileFactory', + 'Nyholm\Psr7\Factory\Psr17Factory', + 'GuzzleHttp\Psr7\HttpFactory', + 'Http\Factory\Diactoros\UploadedFileFactory', + 'Http\Factory\Guzzle\UploadedFileFactory', + 'Http\Factory\Slim\UploadedFileFactory', + 'Laminas\Diactoros\UploadedFileFactory', + 'Slim\Psr7\Factory\UploadedFileFactory', + 'HttpSoft\Message\UploadedFileFactory', + ], + UriFactoryInterface::class => [ + 'Phalcon\Http\Message\UriFactory', + 'Nyholm\Psr7\Factory\Psr17Factory', + 'GuzzleHttp\Psr7\HttpFactory', + 'Http\Factory\Diactoros\UriFactory', + 'Http\Factory\Guzzle\UriFactory', + 'Http\Factory\Slim\UriFactory', + 'Laminas\Diactoros\UriFactory', + 'Slim\Psr7\Factory\UriFactory', + 'HttpSoft\Message\UriFactory', + ], + ]; + + public static function getCandidates($type) + { + $candidates = []; + if (isset(self::$classes[$type])) { + foreach (self::$classes[$type] as $class) { + $candidates[] = ['class' => $class, 'condition' => [$class]]; + } + } + + return $candidates; + } +} diff --git a/vendor/php-http/discovery/src/Strategy/DiscoveryStrategy.php b/vendor/php-http/discovery/src/Strategy/DiscoveryStrategy.php new file mode 100644 index 000000000..1eadb145b --- /dev/null +++ b/vendor/php-http/discovery/src/Strategy/DiscoveryStrategy.php @@ -0,0 +1,23 @@ + + */ +interface DiscoveryStrategy +{ + /** + * Find a resource of a specific type. + * + * @param string $type + * + * @return array The return value is always an array with zero or more elements. Each + * element is an array with two keys ['class' => string, 'condition' => mixed]. + * + * @throws StrategyUnavailableException if we cannot use this strategy + */ + public static function getCandidates($type); +} diff --git a/vendor/php-http/discovery/src/Strategy/MockClientStrategy.php b/vendor/php-http/discovery/src/Strategy/MockClientStrategy.php new file mode 100644 index 000000000..77b9d276f --- /dev/null +++ b/vendor/php-http/discovery/src/Strategy/MockClientStrategy.php @@ -0,0 +1,24 @@ + + */ +final class MockClientStrategy implements DiscoveryStrategy +{ + public static function getCandidates($type) + { + if (is_a(HttpClient::class, $type, true) || is_a(HttpAsyncClient::class, $type, true)) { + return [['class' => Mock::class, 'condition' => Mock::class]]; + } + + return []; + } +} diff --git a/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php b/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php new file mode 100644 index 000000000..74b78b83f --- /dev/null +++ b/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php @@ -0,0 +1,90 @@ + + * @author Márk Sági-Kazár + */ +class PuliBetaStrategy implements DiscoveryStrategy +{ + /** + * @var GeneratedPuliFactory + */ + protected static $puliFactory; + + /** + * @var Discovery + */ + protected static $puliDiscovery; + + /** + * @return GeneratedPuliFactory + * + * @throws PuliUnavailableException + */ + private static function getPuliFactory() + { + if (null === self::$puliFactory) { + if (!defined('PULI_FACTORY_CLASS')) { + throw new PuliUnavailableException('Puli Factory is not available'); + } + + $puliFactoryClass = PULI_FACTORY_CLASS; + + if (!ClassDiscovery::safeClassExists($puliFactoryClass)) { + throw new PuliUnavailableException('Puli Factory class does not exist'); + } + + self::$puliFactory = new $puliFactoryClass(); + } + + return self::$puliFactory; + } + + /** + * Returns the Puli discovery layer. + * + * @return Discovery + * + * @throws PuliUnavailableException + */ + private static function getPuliDiscovery() + { + if (!isset(self::$puliDiscovery)) { + $factory = self::getPuliFactory(); + $repository = $factory->createRepository(); + + self::$puliDiscovery = $factory->createDiscovery($repository); + } + + return self::$puliDiscovery; + } + + public static function getCandidates($type) + { + $returnData = []; + $bindings = self::getPuliDiscovery()->findBindings($type); + + foreach ($bindings as $binding) { + $condition = true; + if ($binding->hasParameterValue('depends')) { + $condition = $binding->getParameterValue('depends'); + } + $returnData[] = ['class' => $binding->getClassName(), 'condition' => $condition]; + } + + return $returnData; + } +} diff --git a/vendor/php-http/discovery/src/StreamFactoryDiscovery.php b/vendor/php-http/discovery/src/StreamFactoryDiscovery.php new file mode 100644 index 000000000..e11c49ae2 --- /dev/null +++ b/vendor/php-http/discovery/src/StreamFactoryDiscovery.php @@ -0,0 +1,34 @@ + + * + * @deprecated This will be removed in 2.0. Consider using Psr17FactoryDiscovery. + */ +final class StreamFactoryDiscovery extends ClassDiscovery +{ + /** + * Finds a Stream Factory. + * + * @return StreamFactory + * + * @throws Exception\NotFoundException + */ + public static function find() + { + try { + $streamFactory = static::findOneByType(StreamFactory::class); + } catch (DiscoveryFailedException $e) { + throw new NotFoundException('No stream factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message and the chosen message implementation.', 0, $e); + } + + return static::instantiateClass($streamFactory); + } +} diff --git a/vendor/php-http/discovery/src/UriFactoryDiscovery.php b/vendor/php-http/discovery/src/UriFactoryDiscovery.php new file mode 100644 index 000000000..db3add206 --- /dev/null +++ b/vendor/php-http/discovery/src/UriFactoryDiscovery.php @@ -0,0 +1,34 @@ + + * + * @deprecated This will be removed in 2.0. Consider using Psr17FactoryDiscovery. + */ +final class UriFactoryDiscovery extends ClassDiscovery +{ + /** + * Finds a URI Factory. + * + * @return UriFactory + * + * @throws Exception\NotFoundException + */ + public static function find() + { + try { + $uriFactory = static::findOneByType(UriFactory::class); + } catch (DiscoveryFailedException $e) { + throw new NotFoundException('No uri factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message and the chosen message implementation.', 0, $e); + } + + return static::instantiateClass($uriFactory); + } +} diff --git a/vendor/php-http/guzzle7-adapter/CHANGELOG.md b/vendor/php-http/guzzle7-adapter/CHANGELOG.md new file mode 100644 index 000000000..9aa94407b --- /dev/null +++ b/vendor/php-http/guzzle7-adapter/CHANGELOG.md @@ -0,0 +1,18 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [1.0.0] - 2021-03-09 + +- Stable release - no changes since 0.1.1 + +## [0.1.1] - 2020-10-21 + +* Allow installation with PHP 8 + +## [0.1.0] - 2020-08-16 + +First release diff --git a/vendor/php-http/guzzle7-adapter/LICENSE b/vendor/php-http/guzzle7-adapter/LICENSE new file mode 100644 index 000000000..0d6ce83b8 --- /dev/null +++ b/vendor/php-http/guzzle7-adapter/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020 PHP HTTP Team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/php-http/guzzle7-adapter/README.md b/vendor/php-http/guzzle7-adapter/README.md new file mode 100644 index 000000000..7e6b5b5dc --- /dev/null +++ b/vendor/php-http/guzzle7-adapter/README.md @@ -0,0 +1,45 @@ +# Guzzle 7 HTTP Adapter + +[![Latest Version](https://img.shields.io/github/release/php-http/guzzle7-adapter.svg?style=flat-square)](https://github.com/php-http/guzzle7-adapter/releases) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) +[![Total Downloads](https://img.shields.io/packagist/dt/php-http/guzzle7-adapter.svg?style=flat-square)](https://packagist.org/packages/php-http/guzzle7-adapter) + +**Guzzle 7 HTTP Adapter.** + +## Install + +Via Composer + +``` bash +$ composer require php-http/guzzle7-adapter +``` + +## Documentation + +Please see the [official documentation](http://docs.php-http.org/en/latest/clients/guzzle7-adapter.html). + +## Testing + +First launch the http server: + +```bash +$ ./vendor/bin/http_test_server > /dev/null 2>&1 & +``` + +Then the test suite: + +``` bash +$ composer test +``` + +## Contributing + +Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html). + +## Security + +If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). + +## License + +The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/guzzle7-adapter/composer.json b/vendor/php-http/guzzle7-adapter/composer.json new file mode 100644 index 000000000..3299d2eb7 --- /dev/null +++ b/vendor/php-http/guzzle7-adapter/composer.json @@ -0,0 +1,43 @@ +{ + "name": "php-http/guzzle7-adapter", + "description": "Guzzle 7 HTTP Adapter", + "license": "MIT", + "keywords": ["guzzle", "http"], + "homepage": "http://httplug.io", + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + } + ], + "require": { + "php": "^7.2 | ^8.0", + "php-http/httplug": "^2.0", + "psr/http-client": "^1.0", + "guzzlehttp/guzzle": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.0|^9.3", + "php-http/client-integration-tests": "^3.0" + }, + "provide": { + "php-http/client-implementation": "1.0", + "php-http/async-client-implementation": "1.0", + "psr/http-client-implementation": "1.0" + }, + "autoload": { + "psr-4": { + "Http\\Adapter\\Guzzle7\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Http\\Adapter\\Guzzle7\\Tests\\": "tests/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "0.2.x-dev" + } + } +} diff --git a/vendor/php-http/guzzle7-adapter/phpstan.neon.dist b/vendor/php-http/guzzle7-adapter/phpstan.neon.dist new file mode 100644 index 000000000..d42940e93 --- /dev/null +++ b/vendor/php-http/guzzle7-adapter/phpstan.neon.dist @@ -0,0 +1,5 @@ +parameters: + level: 5 + reportUnmatchedIgnoredErrors: false + paths: + - src diff --git a/vendor/php-http/guzzle7-adapter/psalm.baseline.xml b/vendor/php-http/guzzle7-adapter/psalm.baseline.xml new file mode 100644 index 000000000..96ab42cf9 --- /dev/null +++ b/vendor/php-http/guzzle7-adapter/psalm.baseline.xml @@ -0,0 +1,8 @@ + + + + + $exception->getResponse() + + + diff --git a/vendor/php-http/guzzle7-adapter/psalm.xml b/vendor/php-http/guzzle7-adapter/psalm.xml new file mode 100644 index 000000000..d70acfe4f --- /dev/null +++ b/vendor/php-http/guzzle7-adapter/psalm.xml @@ -0,0 +1,16 @@ + + + + + + + + + diff --git a/vendor/php-http/guzzle7-adapter/src/Client.php b/vendor/php-http/guzzle7-adapter/src/Client.php new file mode 100644 index 000000000..a92ab06bd --- /dev/null +++ b/vendor/php-http/guzzle7-adapter/src/Client.php @@ -0,0 +1,75 @@ + + */ +final class Client implements HttpClient, HttpAsyncClient +{ + /** + * @var ClientInterface + */ + private $guzzle; + + public function __construct(?ClientInterface $guzzle = null) + { + if (!$guzzle) { + $guzzle = self::buildClient(); + } + + $this->guzzle = $guzzle; + } + + /** + * Factory method to create the Guzzle 7 adapter with custom Guzzle configuration. + */ + public static function createWithConfig(array $config): Client + { + return new self(self::buildClient($config)); + } + + /** + * {@inheritdoc} + */ + public function sendRequest(RequestInterface $request): ResponseInterface + { + return $this->sendAsyncRequest($request)->wait(); + } + + /** + * {@inheritdoc} + */ + public function sendAsyncRequest(RequestInterface $request) + { + $promise = $this->guzzle->sendAsync($request); + + return new Promise($promise, $request); + } + + /** + * Build the Guzzle client instance. + */ + private static function buildClient(array $config = []): GuzzleClient + { + $handlerStack = new HandlerStack(Utils::chooseHandler()); + $handlerStack->push(Middleware::prepareBody(), 'prepare_body'); + $config = array_merge(['handler' => $handlerStack], $config); + + return new GuzzleClient($config); + } +} diff --git a/vendor/php-http/guzzle7-adapter/src/Exception/UnexpectedValueException.php b/vendor/php-http/guzzle7-adapter/src/Exception/UnexpectedValueException.php new file mode 100644 index 000000000..f4731be07 --- /dev/null +++ b/vendor/php-http/guzzle7-adapter/src/Exception/UnexpectedValueException.php @@ -0,0 +1,9 @@ + + */ +final class Promise implements HttpPromise +{ + /** + * @var PromiseInterface + */ + private $promise; + + /** + * @var string State of the promise + */ + private $state; + + /** + * @var ResponseInterface + */ + private $response; + + /** + * @var HttplugException + */ + private $exception; + + /** + * @var RequestInterface + */ + private $request; + + public function __construct(PromiseInterface $promise, RequestInterface $request) + { + $this->request = $request; + $this->state = self::PENDING; + $this->promise = $promise->then(function ($response) { + $this->response = $response; + $this->state = self::FULFILLED; + + return $response; + }, function ($reason) use ($request) { + $this->state = self::REJECTED; + + if ($reason instanceof HttplugException) { + $this->exception = $reason; + } elseif ($reason instanceof GuzzleExceptions\GuzzleException) { + $this->exception = $this->handleException($reason, $request); + } elseif ($reason instanceof \Throwable) { + $this->exception = new HttplugException\TransferException('Invalid exception returned from Guzzle7', 0, $reason); + } else { + $this->exception = new UnexpectedValueException('Reason returned from Guzzle7 must be an Exception'); + } + + throw $this->exception; + }); + } + + /** + * {@inheritdoc} + */ + public function then(callable $onFulfilled = null, callable $onRejected = null) + { + return new static($this->promise->then($onFulfilled, $onRejected), $this->request); + } + + /** + * {@inheritdoc} + */ + public function getState() + { + return $this->state; + } + + /** + * {@inheritdoc} + */ + public function wait($unwrap = true) + { + $this->promise->wait(false); + + if ($unwrap) { + if (self::REJECTED == $this->getState()) { + throw $this->exception; + } + + return $this->response; + } + } + + /** + * Converts a Guzzle exception into an Httplug exception. + * + * @return HttplugException + */ + private function handleException(GuzzleExceptions\GuzzleException $exception, RequestInterface $request) + { + if ($exception instanceof GuzzleExceptions\ConnectException) { + return new HttplugException\NetworkException($exception->getMessage(), $exception->getRequest(), $exception); + } + + if ($exception instanceof GuzzleExceptions\RequestException) { + // Make sure we have a response for the HttpException + if ($exception->hasResponse()) { + return new HttplugException\HttpException( + $exception->getMessage(), + $exception->getRequest(), + $exception->getResponse(), + $exception + ); + } + + return new HttplugException\RequestException($exception->getMessage(), $exception->getRequest(), $exception); + } + + return new HttplugException\TransferException($exception->getMessage(), 0, $exception); + } +} diff --git a/vendor/php-http/httplug/.php-cs-fixer.dist.php b/vendor/php-http/httplug/.php-cs-fixer.dist.php new file mode 100644 index 000000000..83809c25d --- /dev/null +++ b/vendor/php-http/httplug/.php-cs-fixer.dist.php @@ -0,0 +1,16 @@ +in(__DIR__.'/src') + ->name('*.php') +; + +$config = (new PhpCsFixer\Config()) + ->setRiskyAllowed(true) + ->setRules([ + '@Symfony' => true, + ]) + ->setFinder($finder) +; + +return $config; diff --git a/vendor/php-http/httplug/CHANGELOG.md b/vendor/php-http/httplug/CHANGELOG.md new file mode 100644 index 000000000..efccd55d3 --- /dev/null +++ b/vendor/php-http/httplug/CHANGELOG.md @@ -0,0 +1,141 @@ +# Change Log + + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + + +## [2.4.0] - 2023-04-14 + +### Changed + +- Allow `psr/http-message` v2 in addition to v1 +- Deprecate `Http\Client\HttpClient`, use [PSR-18](https://www.php-fig.org/psr/psr-18/) instead + +## [2.3.0] - 2022-02-21 + +### Changed + +- Enabled the `$onRejected` callback of `HttpRejectedPromise` to return a promise for implementing a retry + mechanism [#168](https://github.com/php-http/httplug/pull/168) + +## [2.2.0] - 2020-07-13 + +### Changed + +- Support PHP 7.1-8.0 + +## [2.1.0] - 2019-12-27 + +### Changed + +- `Http\Client\Exception\NetworkException` no longer extends `Http\Client\Exception\RequestException`, + in accordance with [PSR-18](https://www.php-fig.org/psr/psr-18/) + +## [2.0.0] - 2018-10-31 + +This version is no BC break for consumers using HTTPlug. However, HTTP clients that +implement HTTPlug need to adjust because we add return type declarations. + +### Added + +- Support for PSR-18 (HTTP client). + +### Changed + +- **BC Break:** `HttpClient::sendRequest(RequestInterface $request)` has a return type annotation. The new +signature is `HttpClient::sendRequest(RequestInterface $request): ResponseInterface`. +- **BC Break:** `RequestException::getRequest()` has a return type annotation. The new +signature is `RequestException::getRequest(): RequestInterface`. + +### Removed + +- PHP 5 support + + +## [1.1.0] - 2016-08-31 + +### Added + +- HttpFulfilledPromise and HttpRejectedPromise which respect the HttpAsyncClient interface + + +## [1.0.0] - 2016-01-26 + +### Removed + +- Stability configuration from composer + + +## [1.0.0-RC1] - 2016-01-12 + +### Changed + +- Updated package files +- Updated promise dependency to RC1 + + +## [1.0.0-beta] - 2015-12-17 + +### Added + +- Puli configuration and binding types + +### Changed + +- Exception concept + + +## [1.0.0-alpha3] - 2015-12-13 + +### Changed + +- Async client does not throw exceptions + +### Removed + +- Promise interface moved to its own repository: [php-http/promise](https://github.com/php-http/promise) + + +## [1.0.0-alpha2] - 2015-11-16 + +### Added + +- Async client and Promise interface + + +## [1.0.0-alpha] - 2015-10-26 + +### Added + +- Better domain exceptions. + +### Changed + +- Purpose of the library: general HTTP CLient abstraction. + +### Removed + +- Request options: they should be configured at construction time. +- Multiple request sending: should be done asynchronously using Async Client. +- `getName` method + + +## 0.1.0 - 2015-06-03 + +### Added + +- Initial release + + +[Unreleased]: https://github.com/php-http/httplug/compare/v2.0.0...HEAD +[2.0.0]: https://github.com/php-http/httplug/compare/v1.1.0...HEAD +[1.1.0]: https://github.com/php-http/httplug/compare/v1.0.0...v1.1.0 +[1.0.0]: https://github.com/php-http/httplug/compare/v1.0.0-RC1...v1.0.0 +[1.0.0-RC1]: https://github.com/php-http/httplug/compare/v1.0.0-beta...v1.0.0-RC1 +[1.0.0-beta]: https://github.com/php-http/httplug/compare/v1.0.0-alpha3...v1.0.0-beta +[1.0.0-alpha3]: https://github.com/php-http/httplug/compare/v1.0.0-alpha2...v1.0.0-alpha3 +[1.0.0-alpha2]: https://github.com/php-http/httplug/compare/v1.0.0-alpha...v1.0.0-alpha2 +[1.0.0-alpha]: https://github.com/php-http/httplug/compare/v0.1.0...v1.0.0-alpha diff --git a/vendor/php-http/httplug/LICENSE b/vendor/php-http/httplug/LICENSE new file mode 100644 index 000000000..8cd264c6b --- /dev/null +++ b/vendor/php-http/httplug/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2014 Eric GELOEN +Copyright (c) 2015 PHP HTTP Team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/php-http/httplug/README.md b/vendor/php-http/httplug/README.md new file mode 100644 index 000000000..a9b476a5e --- /dev/null +++ b/vendor/php-http/httplug/README.md @@ -0,0 +1,54 @@ +# HTTPlug + +[![Latest Version](https://img.shields.io/github/release/php-http/httplug.svg?style=flat-square)](https://github.com/php-http/httplug/releases) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) +[![Build Status](https://github.com/php-http/httplug/actions/workflows/ci.yml/badge.svg)](https://github.com/php-http/httplug/actions/workflows/ci.yml) +[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/httplug.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/httplug) +[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/httplug.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/httplug) +[![Total Downloads](https://img.shields.io/packagist/dt/php-http/httplug.svg?style=flat-square)](https://packagist.org/packages/php-http/httplug) + +[![Email](https://img.shields.io/badge/email-team@httplug.io-blue.svg?style=flat-square)](mailto:team@httplug.io) + +**HTTPlug, the HTTP client abstraction for PHP.** + + +## Intro + +HTTP client standard built on [PSR-7](http://www.php-fig.org/psr/psr-7/) HTTP +messages. The HttpAsyncClient defines an asynchronous HTTP client for PHP. + +This package also provides a synchronous HttpClient interface with the same +method signature as the [PSR-18](http://www.php-fig.org/psr/psr-18/) client. +For synchronous requests, we recommend using PSR-18 directly. + + +## History + +HTTPlug is the official successor of the [ivory http adapter](https://github.com/egeloen/ivory-http-adapter). +HTTPlug is a predecessor of [PSR-18](http://www.php-fig.org/psr/psr-18/) + + +## Install + +Via Composer + +``` bash +$ composer require php-http/httplug +``` + + +## Documentation + +Please see the [official documentation](http://docs.php-http.org). + + +## Testing + +``` bash +$ composer test +``` + + +## License + +The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/httplug/composer.json b/vendor/php-http/httplug/composer.json new file mode 100644 index 000000000..739177017 --- /dev/null +++ b/vendor/php-http/httplug/composer.json @@ -0,0 +1,40 @@ +{ + "name": "php-http/httplug", + "description": "HTTPlug, the HTTP client abstraction for PHP", + "keywords": [ + "http", + "client" + ], + "homepage": "http://httplug.io", + "license": "MIT", + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "require": { + "php": "^7.1 || ^8.0", + "php-http/promise": "^1.1", + "psr/http-client": "^1.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0", + "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0" + }, + "autoload": { + "psr-4": { + "Http\\Client\\": "src/" + } + }, + "scripts": { + "test": "vendor/bin/phpspec run", + "test-ci": "vendor/bin/phpspec run -c phpspec.ci.yml" + } +} diff --git a/vendor/php-http/httplug/puli.json b/vendor/php-http/httplug/puli.json new file mode 100644 index 000000000..416833152 --- /dev/null +++ b/vendor/php-http/httplug/puli.json @@ -0,0 +1,12 @@ +{ + "version": "1.0", + "name": "php-http/httplug", + "binding-types": { + "Http\\Client\\HttpAsyncClient": { + "description": "Async HTTP Client" + }, + "Http\\Client\\HttpClient": { + "description": "HTTP Client" + } + } +} diff --git a/vendor/php-http/httplug/src/Exception.php b/vendor/php-http/httplug/src/Exception.php new file mode 100644 index 000000000..4df164c9a --- /dev/null +++ b/vendor/php-http/httplug/src/Exception.php @@ -0,0 +1,14 @@ + + */ +interface Exception extends PsrClientException +{ +} diff --git a/vendor/php-http/httplug/src/Exception/HttpException.php b/vendor/php-http/httplug/src/Exception/HttpException.php new file mode 100644 index 000000000..6c2a007a0 --- /dev/null +++ b/vendor/php-http/httplug/src/Exception/HttpException.php @@ -0,0 +1,65 @@ + + */ +class HttpException extends RequestException +{ + /** + * @var ResponseInterface + */ + protected $response; + + /** + * @param string $message + */ + public function __construct( + $message, + RequestInterface $request, + ResponseInterface $response, + \Exception $previous = null + ) { + parent::__construct($message, $request, $previous); + + $this->response = $response; + $this->code = $response->getStatusCode(); + } + + /** + * Returns the response. + * + * @return ResponseInterface + */ + public function getResponse() + { + return $this->response; + } + + /** + * Factory method to create a new exception with a normalized error message. + */ + public static function create( + RequestInterface $request, + ResponseInterface $response, + \Exception $previous = null + ) { + $message = sprintf( + '[url] %s [http method] %s [status code] %s [reason phrase] %s', + $request->getRequestTarget(), + $request->getMethod(), + $response->getStatusCode(), + $response->getReasonPhrase() + ); + + return new static($message, $request, $response, $previous); + } +} diff --git a/vendor/php-http/httplug/src/Exception/NetworkException.php b/vendor/php-http/httplug/src/Exception/NetworkException.php new file mode 100644 index 000000000..9b4f1e8fd --- /dev/null +++ b/vendor/php-http/httplug/src/Exception/NetworkException.php @@ -0,0 +1,28 @@ + + */ +class NetworkException extends TransferException implements PsrNetworkException +{ + use RequestAwareTrait; + + /** + * @param string $message + */ + public function __construct($message, RequestInterface $request, \Exception $previous = null) + { + $this->setRequest($request); + + parent::__construct($message, 0, $previous); + } +} diff --git a/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php b/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php new file mode 100644 index 000000000..71b4bb8c9 --- /dev/null +++ b/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php @@ -0,0 +1,26 @@ +request = $request; + } + + /** + * {@inheritdoc} + */ + public function getRequest(): RequestInterface + { + return $this->request; + } +} diff --git a/vendor/php-http/httplug/src/Exception/RequestException.php b/vendor/php-http/httplug/src/Exception/RequestException.php new file mode 100644 index 000000000..f6c60ce56 --- /dev/null +++ b/vendor/php-http/httplug/src/Exception/RequestException.php @@ -0,0 +1,29 @@ + + */ +class RequestException extends TransferException implements PsrRequestException +{ + use RequestAwareTrait; + + /** + * @param string $message + */ + public function __construct($message, RequestInterface $request, \Exception $previous = null) + { + $this->setRequest($request); + + parent::__construct($message, 0, $previous); + } +} diff --git a/vendor/php-http/httplug/src/Exception/TransferException.php b/vendor/php-http/httplug/src/Exception/TransferException.php new file mode 100644 index 000000000..a858cf5ec --- /dev/null +++ b/vendor/php-http/httplug/src/Exception/TransferException.php @@ -0,0 +1,14 @@ + + */ +class TransferException extends \RuntimeException implements Exception +{ +} diff --git a/vendor/php-http/httplug/src/HttpAsyncClient.php b/vendor/php-http/httplug/src/HttpAsyncClient.php new file mode 100644 index 000000000..c3b9d61aa --- /dev/null +++ b/vendor/php-http/httplug/src/HttpAsyncClient.php @@ -0,0 +1,25 @@ + + */ +interface HttpAsyncClient +{ + /** + * Sends a PSR-7 request in an asynchronous way. + * + * Exceptions related to processing the request are available from the returned Promise. + * + * @return Promise resolves a PSR-7 Response or fails with an Http\Client\Exception + * + * @throws \Exception If processing the request is impossible (eg. bad configuration). + */ + public function sendAsyncRequest(RequestInterface $request); +} diff --git a/vendor/php-http/httplug/src/HttpClient.php b/vendor/php-http/httplug/src/HttpClient.php new file mode 100644 index 000000000..22b94aaf7 --- /dev/null +++ b/vendor/php-http/httplug/src/HttpClient.php @@ -0,0 +1,17 @@ +response = $response; + } + + /** + * {@inheritdoc} + */ + public function then(callable $onFulfilled = null, callable $onRejected = null) + { + if (null === $onFulfilled) { + return $this; + } + + try { + return new self($onFulfilled($this->response)); + } catch (Exception $e) { + return new HttpRejectedPromise($e); + } + } + + /** + * {@inheritdoc} + */ + public function getState() + { + return Promise::FULFILLED; + } + + /** + * {@inheritdoc} + */ + public function wait($unwrap = true) + { + if ($unwrap) { + return $this->response; + } + } +} diff --git a/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php b/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php new file mode 100644 index 000000000..624cc8a94 --- /dev/null +++ b/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php @@ -0,0 +1,58 @@ +exception = $exception; + } + + /** + * {@inheritdoc} + */ + public function then(callable $onFulfilled = null, callable $onRejected = null) + { + if (null === $onRejected) { + return $this; + } + + try { + $result = $onRejected($this->exception); + if ($result instanceof Promise) { + return $result; + } + + return new HttpFulfilledPromise($result); + } catch (Exception $e) { + return new self($e); + } + } + + /** + * {@inheritdoc} + */ + public function getState() + { + return Promise::REJECTED; + } + + /** + * {@inheritdoc} + */ + public function wait($unwrap = true) + { + if ($unwrap) { + throw $this->exception; + } + } +} diff --git a/vendor/php-http/promise/CHANGELOG.md b/vendor/php-http/promise/CHANGELOG.md new file mode 100644 index 000000000..479deb8a7 --- /dev/null +++ b/vendor/php-http/promise/CHANGELOG.md @@ -0,0 +1,48 @@ +# Change Log + +## 1.1.0 - 2020-07-07 + +### Added + +- Test with PHP 7.1, 7.2, 7.3, 7.4 and 8.0 + +### Removed + +- PHP 5 and 7.0 support + +### Fixed + +- Fixed PHPDoc for `Promise::then` + +## 1.0.0 - 2016-01-26 + +### Removed + +- PSR-7 dependency + + +## 1.0.0-RC1 - 2016-01-12 + +### Added + +- Tests for full coverage + +## Changed + +- Updated package files +- Clarified wait method behavior +- Contributing guide moved to the documentation + + +## 0.1.1 - 2015-12-24 + +## Added + +- Fulfilled and Rejected promise implementations + + +## 0.1.0 - 2015-12-13 + +## Added + +- Promise interface diff --git a/vendor/php-http/promise/LICENSE b/vendor/php-http/promise/LICENSE new file mode 100644 index 000000000..4558d6f06 --- /dev/null +++ b/vendor/php-http/promise/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-2016 PHP HTTP Team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/php-http/promise/README.md b/vendor/php-http/promise/README.md new file mode 100644 index 000000000..ee95e0933 --- /dev/null +++ b/vendor/php-http/promise/README.md @@ -0,0 +1,48 @@ +# Promise + +[![Latest Version](https://img.shields.io/github/release/php-http/promise.svg?style=flat-square)](https://github.com/php-http/promise/releases) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) +[![Build Status](https://img.shields.io/travis/php-http/promise.svg?style=flat-square)](https://travis-ci.org/php-http/promise) +[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/promise.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/promise) +[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/promise.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/promise) +[![Total Downloads](https://img.shields.io/packagist/dt/php-http/promise.svg?style=flat-square)](https://packagist.org/packages/php-http/promise) + +**Promise used for asynchronous HTTP requests.** + +**Note:** This will eventually be removed/deprecated and replaced with the upcoming Promise PSR. + + +## Install + +Via Composer + +``` bash +$ composer require php-http/promise +``` + + +## Documentation + +Please see the [official documentation](http://docs.php-http.org/en/latest/components/promise.html). + + +## Testing + +``` bash +$ composer test +``` + + +## Contributing + +Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html). + + +## Security + +If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). + + +## License + +The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/promise/composer.json b/vendor/php-http/promise/composer.json new file mode 100644 index 000000000..812167bc8 --- /dev/null +++ b/vendor/php-http/promise/composer.json @@ -0,0 +1,38 @@ +{ + "name": "php-http/promise", + "description": "Promise used for asynchronous HTTP requests", + "license": "MIT", + "keywords": ["promise"], + "homepage": "http://httplug.io", + "authors": [ + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "require": { + "php" : "^7.1 || ^8.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage" : "^4.3.2", + "phpspec/phpspec": "^5.1.2 || ^6.2" + }, + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "scripts": { + "test": "vendor/bin/phpspec run", + "test-ci": "vendor/bin/phpspec run -c phpspec.yml.ci" + }, + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + } +} diff --git a/vendor/php-http/promise/src/FulfilledPromise.php b/vendor/php-http/promise/src/FulfilledPromise.php new file mode 100644 index 000000000..f60f686a2 --- /dev/null +++ b/vendor/php-http/promise/src/FulfilledPromise.php @@ -0,0 +1,58 @@ + + */ +final class FulfilledPromise implements Promise +{ + /** + * @var mixed + */ + private $result; + + /** + * @param $result + */ + public function __construct($result) + { + $this->result = $result; + } + + /** + * {@inheritdoc} + */ + public function then(callable $onFulfilled = null, callable $onRejected = null) + { + if (null === $onFulfilled) { + return $this; + } + + try { + return new self($onFulfilled($this->result)); + } catch (\Exception $e) { + return new RejectedPromise($e); + } + } + + /** + * {@inheritdoc} + */ + public function getState() + { + return Promise::FULFILLED; + } + + /** + * {@inheritdoc} + */ + public function wait($unwrap = true) + { + if ($unwrap) { + return $this->result; + } + } +} diff --git a/vendor/php-http/promise/src/Promise.php b/vendor/php-http/promise/src/Promise.php new file mode 100644 index 000000000..3258ed0d3 --- /dev/null +++ b/vendor/php-http/promise/src/Promise.php @@ -0,0 +1,69 @@ + + * @author Márk Sági-Kazár + */ +interface Promise +{ + /** + * Promise has not been fulfilled or rejected. + */ + const PENDING = 'pending'; + + /** + * Promise has been fulfilled. + */ + const FULFILLED = 'fulfilled'; + + /** + * Promise has been rejected. + */ + const REJECTED = 'rejected'; + + /** + * Adds behavior for when the promise is resolved or rejected (response will be available, or error happens). + * + * If you do not care about one of the cases, you can set the corresponding callable to null + * The callback will be called when the value arrived and never more than once. + * + * @param callable|null $onFulfilled called when a response will be available + * @param callable|null $onRejected called when an exception occurs + * + * @return Promise a new resolved promise with value of the executed callback (onFulfilled / onRejected) + */ + public function then(callable $onFulfilled = null, callable $onRejected = null); + + /** + * Returns the state of the promise, one of PENDING, FULFILLED or REJECTED. + * + * @return string + */ + public function getState(); + + /** + * Wait for the promise to be fulfilled or rejected. + * + * When this method returns, the request has been resolved and if callables have been + * specified, the appropriate one has terminated. + * + * When $unwrap is true (the default), the response is returned, or the exception thrown + * on failure. Otherwise, nothing is returned or thrown. + * + * @param bool $unwrap Whether to return resolved value / throw reason or not + * + * @return mixed Resolved value, null if $unwrap is set to false + * + * @throws \Exception the rejection reason if $unwrap is set to true and the request failed + */ + public function wait($unwrap = true); +} diff --git a/vendor/php-http/promise/src/RejectedPromise.php b/vendor/php-http/promise/src/RejectedPromise.php new file mode 100644 index 000000000..e396a40f7 --- /dev/null +++ b/vendor/php-http/promise/src/RejectedPromise.php @@ -0,0 +1,58 @@ + + */ +final class RejectedPromise implements Promise +{ + /** + * @var \Exception + */ + private $exception; + + /** + * @param \Exception $exception + */ + public function __construct(\Exception $exception) + { + $this->exception = $exception; + } + + /** + * {@inheritdoc} + */ + public function then(callable $onFulfilled = null, callable $onRejected = null) + { + if (null === $onRejected) { + return $this; + } + + try { + return new FulfilledPromise($onRejected($this->exception)); + } catch (\Exception $e) { + return new self($e); + } + } + + /** + * {@inheritdoc} + */ + public function getState() + { + return Promise::REJECTED; + } + + /** + * {@inheritdoc} + */ + public function wait($unwrap = true) + { + if ($unwrap) { + throw $this->exception; + } + } +} diff --git a/vendor/psr/cache/CHANGELOG.md b/vendor/psr/cache/CHANGELOG.md deleted file mode 100644 index 58ddab05a..000000000 --- a/vendor/psr/cache/CHANGELOG.md +++ /dev/null @@ -1,16 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file, in reverse chronological order by release. - -## 1.0.1 - 2016-08-06 - -### Fixed - -- Make spacing consistent in phpdoc annotations php-fig/cache#9 - chalasr -- Fix grammar in phpdoc annotations php-fig/cache#10 - chalasr -- Be more specific in docblocks that `getItems()` and `deleteItems()` take an array of strings (`string[]`) compared to just `array` php-fig/cache#8 - GrahamCampbell -- For `expiresAt()` and `expiresAfter()` in CacheItemInterface fix docblock to specify null as a valid parameters as well as an implementation of DateTimeInterface php-fig/cache#7 - GrahamCampbell - -## 1.0.0 - 2015-12-11 - -Initial stable release; reflects accepted PSR-6 specification diff --git a/vendor/psr/cache/LICENSE.txt b/vendor/psr/cache/LICENSE.txt deleted file mode 100644 index b1c2c97b9..000000000 --- a/vendor/psr/cache/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015 PHP Framework Interoperability Group - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/psr/cache/README.md b/vendor/psr/cache/README.md deleted file mode 100644 index 9855a318b..000000000 --- a/vendor/psr/cache/README.md +++ /dev/null @@ -1,12 +0,0 @@ -Caching Interface -============== - -This repository holds all interfaces related to [PSR-6 (Caching Interface)][psr-url]. - -Note that this is not a Caching implementation of its own. It is merely interfaces that describe the components of a Caching mechanism. - -The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. - -[psr-url]: https://www.php-fig.org/psr/psr-6/ -[package-url]: https://packagist.org/packages/psr/cache -[implementation-url]: https://packagist.org/providers/psr/cache-implementation diff --git a/vendor/psr/cache/composer.json b/vendor/psr/cache/composer.json deleted file mode 100644 index 4b687971e..000000000 --- a/vendor/psr/cache/composer.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "psr/cache", - "description": "Common interface for caching libraries", - "keywords": ["psr", "psr-6", "cache"], - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "require": { - "php": ">=8.0.0" - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/vendor/psr/cache/src/CacheException.php b/vendor/psr/cache/src/CacheException.php deleted file mode 100644 index bb785f46c..000000000 --- a/vendor/psr/cache/src/CacheException.php +++ /dev/null @@ -1,10 +0,0 @@ -=7.0.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} diff --git a/vendor/psr/http-factory/src/RequestFactoryInterface.php b/vendor/psr/http-factory/src/RequestFactoryInterface.php new file mode 100644 index 000000000..cb39a08bf --- /dev/null +++ b/vendor/psr/http-factory/src/RequestFactoryInterface.php @@ -0,0 +1,18 @@ + `RequestInterface`, `ServerRequestInterface`, `ResponseInterface` extend `MessageInterface` because the `Request` and the `Response` are `HTTP Messages`. +> When using `ServerRequestInterface`, both `RequestInterface` and `Psr\Http\Message\MessageInterface` methods are considered. + diff --git a/vendor/psr/http-message/docs/PSR7-Usage.md b/vendor/psr/http-message/docs/PSR7-Usage.md new file mode 100644 index 000000000..b6d048a34 --- /dev/null +++ b/vendor/psr/http-message/docs/PSR7-Usage.md @@ -0,0 +1,159 @@ +### PSR-7 Usage + +All PSR-7 applications comply with these interfaces +They were created to establish a standard between middleware implementations. + +> `RequestInterface`, `ServerRequestInterface`, `ResponseInterface` extend `MessageInterface` because the `Request` and the `Response` are `HTTP Messages`. +> When using `ServerRequestInterface`, both `RequestInterface` and `Psr\Http\Message\MessageInterface` methods are considered. + + +The following examples will illustrate how basic operations are done in PSR-7. + +##### Examples + + +For this examples to work (at least) a PSR-7 implementation package is required. (eg: zendframework/zend-diactoros, guzzlehttp/psr7, slim/slim, etc) +All PSR-7 implementations should have the same behaviour. + +The following will be assumed: +`$request` is an object of `Psr\Http\Message\RequestInterface` and + +`$response` is an object implementing `Psr\Http\Message\RequestInterface` + + +### Working with HTTP Headers + +#### Adding headers to response: + +```php +$response->withHeader('My-Custom-Header', 'My Custom Message'); +``` + +#### Appending values to headers + +```php +$response->withAddedHeader('My-Custom-Header', 'The second message'); +``` + +#### Checking if header exists: + +```php +$request->hasHeader('My-Custom-Header'); // will return false +$response->hasHeader('My-Custom-Header'); // will return true +``` + +> Note: My-Custom-Header was only added in the Response + +#### Getting comma-separated values from a header (also applies to request) + +```php +// getting value from request headers +$request->getHeaderLine('Content-Type'); // will return: "text/html; charset=UTF-8" +// getting value from response headers +$response->getHeaderLine('My-Custom-Header'); // will return: "My Custom Message; The second message" +``` + +#### Getting array of value from a header (also applies to request) +```php +// getting value from request headers +$request->getHeader('Content-Type'); // will return: ["text/html", "charset=UTF-8"] +// getting value from response headers +$response->getHeader('My-Custom-Header'); // will return: ["My Custom Message", "The second message"] +``` + +#### Removing headers from HTTP Messages +```php +// removing a header from Request, removing deprecated "Content-MD5" header +$request->withoutHeader('Content-MD5'); + +// removing a header from Response +// effect: the browser won't know the size of the stream +// the browser will download the stream till it ends +$response->withoutHeader('Content-Length'); +``` + +### Working with HTTP Message Body + +When working with the PSR-7 there are two methods of implementation: +#### 1. Getting the body separately + +> This method makes the body handling easier to understand and is useful when repeatedly calling body methods. (You only call `getBody()` once). Using this method mistakes like `$response->write()` are also prevented. + +```php +$body = $response->getBody(); +// operations on body, eg. read, write, seek +// ... +// replacing the old body +$response->withBody($body); +// this last statement is optional as we working with objects +// in this case the "new" body is same with the "old" one +// the $body variable has the same value as the one in $request, only the reference is passed +``` + +#### 2. Working directly on response + +> This method is useful when only performing few operations as the `$request->getBody()` statement fragment is required + +```php +$response->getBody()->write('hello'); +``` + +### Getting the body contents + +The following snippet gets the contents of a stream contents. +> Note: Streams must be rewinded, if content was written into streams, it will be ignored when calling `getContents()` because the stream pointer is set to the last character, which is `\0` - meaning end of stream. +```php +$body = $response->getBody(); +$body->rewind(); // or $body->seek(0); +$bodyText = $body->getContents(); +``` +> Note: If `$body->seek(1)` is called before `$body->getContents()`, the first character will be ommited as the starting pointer is set to `1`, not `0`. This is why using `$body->rewind()` is recommended. + +### Append to body + +```php +$response->getBody()->write('Hello'); // writing directly +$body = $request->getBody(); // which is a `StreamInterface` +$body->write('xxxxx'); +``` + +### Prepend to body +Prepending is different when it comes to streams. The content must be copied before writing the content to be prepended. +The following example will explain the behaviour of streams. + +```php +// assuming our response is initially empty +$body = $repsonse->getBody(); +// writing the string "abcd" +$body->write('abcd'); + +// seeking to start of stream +$body->seek(0); +// writing 'ef' +$body->write('ef'); // at this point the stream contains "efcd" +``` + +#### Prepending by rewriting separately + +```php +// assuming our response body stream only contains: "abcd" +$body = $response->getBody(); +$body->rewind(); +$contents = $body->getContents(); // abcd +// seeking the stream to beginning +$body->rewind(); +$body->write('ef'); // stream contains "efcd" +$body->write($contents); // stream contains "efabcd" +``` + +> Note: `getContents()` seeks the stream while reading it, therefore if the second `rewind()` method call was not present the stream would have resulted in `abcdefabcd` because the `write()` method appends to stream if not preceeded by `rewind()` or `seek(0)`. + +#### Prepending by using contents as a string +```php +$body = $response->getBody(); +$body->rewind(); +$contents = $body->getContents(); // efabcd +$contents = 'ef'.$contents; +$body->rewind(); +$body->write($contents); +``` diff --git a/vendor/psr/http-message/src/MessageInterface.php b/vendor/psr/http-message/src/MessageInterface.php new file mode 100644 index 000000000..a83c98518 --- /dev/null +++ b/vendor/psr/http-message/src/MessageInterface.php @@ -0,0 +1,187 @@ +getHeaders() as $name => $values) { + * echo $name . ": " . implode(", ", $values); + * } + * + * // Emit headers iteratively: + * foreach ($message->getHeaders() as $name => $values) { + * foreach ($values as $value) { + * header(sprintf('%s: %s', $name, $value), false); + * } + * } + * + * While header names are not case-sensitive, getHeaders() will preserve the + * exact case in which headers were originally specified. + * + * @return string[][] Returns an associative array of the message's headers. Each + * key MUST be a header name, and each value MUST be an array of strings + * for that header. + */ + public function getHeaders(): array; + + /** + * Checks if a header exists by the given case-insensitive name. + * + * @param string $name Case-insensitive header field name. + * @return bool Returns true if any header names match the given header + * name using a case-insensitive string comparison. Returns false if + * no matching header name is found in the message. + */ + public function hasHeader(string $name): bool; + + /** + * Retrieves a message header value by the given case-insensitive name. + * + * This method returns an array of all the header values of the given + * case-insensitive header name. + * + * If the header does not appear in the message, this method MUST return an + * empty array. + * + * @param string $name Case-insensitive header field name. + * @return string[] An array of string values as provided for the given + * header. If the header does not appear in the message, this method MUST + * return an empty array. + */ + public function getHeader(string $name): array; + + /** + * Retrieves a comma-separated string of the values for a single header. + * + * This method returns all of the header values of the given + * case-insensitive header name as a string concatenated together using + * a comma. + * + * NOTE: Not all header values may be appropriately represented using + * comma concatenation. For such headers, use getHeader() instead + * and supply your own delimiter when concatenating. + * + * If the header does not appear in the message, this method MUST return + * an empty string. + * + * @param string $name Case-insensitive header field name. + * @return string A string of values as provided for the given header + * concatenated together using a comma. If the header does not appear in + * the message, this method MUST return an empty string. + */ + public function getHeaderLine(string $name): string; + + /** + * Return an instance with the provided value replacing the specified header. + * + * While header names are case-insensitive, the casing of the header will + * be preserved by this function, and returned from getHeaders(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * new and/or updated header and value. + * + * @param string $name Case-insensitive header field name. + * @param string|string[] $value Header value(s). + * @return static + * @throws \InvalidArgumentException for invalid header names or values. + */ + public function withHeader(string $name, $value): MessageInterface; + + /** + * Return an instance with the specified header appended with the given value. + * + * Existing values for the specified header will be maintained. The new + * value(s) will be appended to the existing list. If the header did not + * exist previously, it will be added. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * new header and/or value. + * + * @param string $name Case-insensitive header field name to add. + * @param string|string[] $value Header value(s). + * @return static + * @throws \InvalidArgumentException for invalid header names or values. + */ + public function withAddedHeader(string $name, $value): MessageInterface; + + /** + * Return an instance without the specified header. + * + * Header resolution MUST be done without case-sensitivity. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that removes + * the named header. + * + * @param string $name Case-insensitive header field name to remove. + * @return static + */ + public function withoutHeader(string $name): MessageInterface; + + /** + * Gets the body of the message. + * + * @return StreamInterface Returns the body as a stream. + */ + public function getBody(): StreamInterface; + + /** + * Return an instance with the specified message body. + * + * The body MUST be a StreamInterface object. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return a new instance that has the + * new body stream. + * + * @param StreamInterface $body Body. + * @return static + * @throws \InvalidArgumentException When the body is not valid. + */ + public function withBody(StreamInterface $body): MessageInterface; +} diff --git a/vendor/psr/http-message/src/RequestInterface.php b/vendor/psr/http-message/src/RequestInterface.php new file mode 100644 index 000000000..33f85e559 --- /dev/null +++ b/vendor/psr/http-message/src/RequestInterface.php @@ -0,0 +1,130 @@ +getQuery()` + * or from the `QUERY_STRING` server param. + * + * @return array + */ + public function getQueryParams(): array; + + /** + * Return an instance with the specified query string arguments. + * + * These values SHOULD remain immutable over the course of the incoming + * request. They MAY be injected during instantiation, such as from PHP's + * $_GET superglobal, or MAY be derived from some other value such as the + * URI. In cases where the arguments are parsed from the URI, the data + * MUST be compatible with what PHP's parse_str() would return for + * purposes of how duplicate query parameters are handled, and how nested + * sets are handled. + * + * Setting query string arguments MUST NOT change the URI stored by the + * request, nor the values in the server params. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated query string arguments. + * + * @param array $query Array of query string arguments, typically from + * $_GET. + * @return static + */ + public function withQueryParams(array $query): ServerRequestInterface; + + /** + * Retrieve normalized file upload data. + * + * This method returns upload metadata in a normalized tree, with each leaf + * an instance of Psr\Http\Message\UploadedFileInterface. + * + * These values MAY be prepared from $_FILES or the message body during + * instantiation, or MAY be injected via withUploadedFiles(). + * + * @return array An array tree of UploadedFileInterface instances; an empty + * array MUST be returned if no data is present. + */ + public function getUploadedFiles(): array; + + /** + * Create a new instance with the specified uploaded files. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated body parameters. + * + * @param array $uploadedFiles An array tree of UploadedFileInterface instances. + * @return static + * @throws \InvalidArgumentException if an invalid structure is provided. + */ + public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface; + + /** + * Retrieve any parameters provided in the request body. + * + * If the request Content-Type is either application/x-www-form-urlencoded + * or multipart/form-data, and the request method is POST, this method MUST + * return the contents of $_POST. + * + * Otherwise, this method may return any results of deserializing + * the request body content; as parsing returns structured content, the + * potential types MUST be arrays or objects only. A null value indicates + * the absence of body content. + * + * @return null|array|object The deserialized body parameters, if any. + * These will typically be an array or object. + */ + public function getParsedBody(); + + /** + * Return an instance with the specified body parameters. + * + * These MAY be injected during instantiation. + * + * If the request Content-Type is either application/x-www-form-urlencoded + * or multipart/form-data, and the request method is POST, use this method + * ONLY to inject the contents of $_POST. + * + * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of + * deserializing the request body content. Deserialization/parsing returns + * structured data, and, as such, this method ONLY accepts arrays or objects, + * or a null value if nothing was available to parse. + * + * As an example, if content negotiation determines that the request data + * is a JSON payload, this method could be used to create a request + * instance with the deserialized parameters. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated body parameters. + * + * @param null|array|object $data The deserialized body data. This will + * typically be in an array or object. + * @return static + * @throws \InvalidArgumentException if an unsupported argument type is + * provided. + */ + public function withParsedBody($data): ServerRequestInterface; + + /** + * Retrieve attributes derived from the request. + * + * The request "attributes" may be used to allow injection of any + * parameters derived from the request: e.g., the results of path + * match operations; the results of decrypting cookies; the results of + * deserializing non-form-encoded message bodies; etc. Attributes + * will be application and request specific, and CAN be mutable. + * + * @return array Attributes derived from the request. + */ + public function getAttributes(): array; + + /** + * Retrieve a single derived request attribute. + * + * Retrieves a single derived request attribute as described in + * getAttributes(). If the attribute has not been previously set, returns + * the default value as provided. + * + * This method obviates the need for a hasAttribute() method, as it allows + * specifying a default value to return if the attribute is not found. + * + * @see getAttributes() + * @param string $name The attribute name. + * @param mixed $default Default value to return if the attribute does not exist. + * @return mixed + */ + public function getAttribute(string $name, $default = null); + + /** + * Return an instance with the specified derived request attribute. + * + * This method allows setting a single derived request attribute as + * described in getAttributes(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated attribute. + * + * @see getAttributes() + * @param string $name The attribute name. + * @param mixed $value The value of the attribute. + * @return static + */ + public function withAttribute(string $name, $value): ServerRequestInterface; + + /** + * Return an instance that removes the specified derived request attribute. + * + * This method allows removing a single derived request attribute as + * described in getAttributes(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that removes + * the attribute. + * + * @see getAttributes() + * @param string $name The attribute name. + * @return static + */ + public function withoutAttribute(string $name): ServerRequestInterface; +} diff --git a/vendor/psr/http-message/src/StreamInterface.php b/vendor/psr/http-message/src/StreamInterface.php new file mode 100644 index 000000000..a62aabb82 --- /dev/null +++ b/vendor/psr/http-message/src/StreamInterface.php @@ -0,0 +1,158 @@ + + * [user-info@]host[:port] + * + * + * If the port component is not set or is the standard port for the current + * scheme, it SHOULD NOT be included. + * + * @see https://tools.ietf.org/html/rfc3986#section-3.2 + * @return string The URI authority, in "[user-info@]host[:port]" format. + */ + public function getAuthority(): string; + + /** + * Retrieve the user information component of the URI. + * + * If no user information is present, this method MUST return an empty + * string. + * + * If a user is present in the URI, this will return that value; + * additionally, if the password is also present, it will be appended to the + * user value, with a colon (":") separating the values. + * + * The trailing "@" character is not part of the user information and MUST + * NOT be added. + * + * @return string The URI user information, in "username[:password]" format. + */ + public function getUserInfo(): string; + + /** + * Retrieve the host component of the URI. + * + * If no host is present, this method MUST return an empty string. + * + * The value returned MUST be normalized to lowercase, per RFC 3986 + * Section 3.2.2. + * + * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 + * @return string The URI host. + */ + public function getHost(): string; + + /** + * Retrieve the port component of the URI. + * + * If a port is present, and it is non-standard for the current scheme, + * this method MUST return it as an integer. If the port is the standard port + * used with the current scheme, this method SHOULD return null. + * + * If no port is present, and no scheme is present, this method MUST return + * a null value. + * + * If no port is present, but a scheme is present, this method MAY return + * the standard port for that scheme, but SHOULD return null. + * + * @return null|int The URI port. + */ + public function getPort(): ?int; + + /** + * Retrieve the path component of the URI. + * + * The path can either be empty or absolute (starting with a slash) or + * rootless (not starting with a slash). Implementations MUST support all + * three syntaxes. + * + * Normally, the empty path "" and absolute path "/" are considered equal as + * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically + * do this normalization because in contexts with a trimmed base path, e.g. + * the front controller, this difference becomes significant. It's the task + * of the user to handle both "" and "/". + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.3. + * + * As an example, if the value should include a slash ("/") not intended as + * delimiter between path segments, that value MUST be passed in encoded + * form (e.g., "%2F") to the instance. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.3 + * @return string The URI path. + */ + public function getPath(): string; + + /** + * Retrieve the query string of the URI. + * + * If no query string is present, this method MUST return an empty string. + * + * The leading "?" character is not part of the query and MUST NOT be + * added. + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.4. + * + * As an example, if a value in a key/value pair of the query string should + * include an ampersand ("&") not intended as a delimiter between values, + * that value MUST be passed in encoded form (e.g., "%26") to the instance. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.4 + * @return string The URI query string. + */ + public function getQuery(): string; + + /** + * Retrieve the fragment component of the URI. + * + * If no fragment is present, this method MUST return an empty string. + * + * The leading "#" character is not part of the fragment and MUST NOT be + * added. + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.5. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.5 + * @return string The URI fragment. + */ + public function getFragment(): string; + + /** + * Return an instance with the specified scheme. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified scheme. + * + * Implementations MUST support the schemes "http" and "https" case + * insensitively, and MAY accommodate other schemes if required. + * + * An empty scheme is equivalent to removing the scheme. + * + * @param string $scheme The scheme to use with the new instance. + * @return static A new instance with the specified scheme. + * @throws \InvalidArgumentException for invalid or unsupported schemes. + */ + public function withScheme(string $scheme): UriInterface; + + /** + * Return an instance with the specified user information. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified user information. + * + * Password is optional, but the user information MUST include the + * user; an empty string for the user is equivalent to removing user + * information. + * + * @param string $user The user name to use for authority. + * @param null|string $password The password associated with $user. + * @return static A new instance with the specified user information. + */ + public function withUserInfo(string $user, ?string $password = null): UriInterface; + + /** + * Return an instance with the specified host. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified host. + * + * An empty host value is equivalent to removing the host. + * + * @param string $host The hostname to use with the new instance. + * @return static A new instance with the specified host. + * @throws \InvalidArgumentException for invalid hostnames. + */ + public function withHost(string $host): UriInterface; + + /** + * Return an instance with the specified port. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified port. + * + * Implementations MUST raise an exception for ports outside the + * established TCP and UDP port ranges. + * + * A null value provided for the port is equivalent to removing the port + * information. + * + * @param null|int $port The port to use with the new instance; a null value + * removes the port information. + * @return static A new instance with the specified port. + * @throws \InvalidArgumentException for invalid ports. + */ + public function withPort(?int $port): UriInterface; + + /** + * Return an instance with the specified path. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified path. + * + * The path can either be empty or absolute (starting with a slash) or + * rootless (not starting with a slash). Implementations MUST support all + * three syntaxes. + * + * If the path is intended to be domain-relative rather than path relative then + * it must begin with a slash ("/"). Paths not starting with a slash ("/") + * are assumed to be relative to some base path known to the application or + * consumer. + * + * Users can provide both encoded and decoded path characters. + * Implementations ensure the correct encoding as outlined in getPath(). + * + * @param string $path The path to use with the new instance. + * @return static A new instance with the specified path. + * @throws \InvalidArgumentException for invalid paths. + */ + public function withPath(string $path): UriInterface; + + /** + * Return an instance with the specified query string. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified query string. + * + * Users can provide both encoded and decoded query characters. + * Implementations ensure the correct encoding as outlined in getQuery(). + * + * An empty query string value is equivalent to removing the query string. + * + * @param string $query The query string to use with the new instance. + * @return static A new instance with the specified query string. + * @throws \InvalidArgumentException for invalid query strings. + */ + public function withQuery(string $query): UriInterface; + + /** + * Return an instance with the specified URI fragment. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified URI fragment. + * + * Users can provide both encoded and decoded fragment characters. + * Implementations ensure the correct encoding as outlined in getFragment(). + * + * An empty fragment value is equivalent to removing the fragment. + * + * @param string $fragment The fragment to use with the new instance. + * @return static A new instance with the specified fragment. + */ + public function withFragment(string $fragment): UriInterface; + + /** + * Return the string representation as a URI reference. + * + * Depending on which components of the URI are present, the resulting + * string is either a full URI or relative reference according to RFC 3986, + * Section 4.1. The method concatenates the various components of the URI, + * using the appropriate delimiters: + * + * - If a scheme is present, it MUST be suffixed by ":". + * - If an authority is present, it MUST be prefixed by "//". + * - The path can be concatenated without delimiters. But there are two + * cases where the path has to be adjusted to make the URI reference + * valid as PHP does not allow to throw an exception in __toString(): + * - If the path is rootless and an authority is present, the path MUST + * be prefixed by "/". + * - If the path is starting with more than one "/" and no authority is + * present, the starting slashes MUST be reduced to one. + * - If a query is present, it MUST be prefixed by "?". + * - If a fragment is present, it MUST be prefixed by "#". + * + * @see http://tools.ietf.org/html/rfc3986#section-4.1 + * @return string + */ + public function __toString(): string; +} diff --git a/vendor/ralouphie/getallheaders/LICENSE b/vendor/ralouphie/getallheaders/LICENSE new file mode 100644 index 000000000..be5540c2a --- /dev/null +++ b/vendor/ralouphie/getallheaders/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Ralph Khattar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/ralouphie/getallheaders/README.md b/vendor/ralouphie/getallheaders/README.md new file mode 100644 index 000000000..9430d76bb --- /dev/null +++ b/vendor/ralouphie/getallheaders/README.md @@ -0,0 +1,27 @@ +getallheaders +============= + +PHP `getallheaders()` polyfill. Compatible with PHP >= 5.3. + +[![Build Status](https://travis-ci.org/ralouphie/getallheaders.svg?branch=master)](https://travis-ci.org/ralouphie/getallheaders) +[![Coverage Status](https://coveralls.io/repos/ralouphie/getallheaders/badge.png?branch=master)](https://coveralls.io/r/ralouphie/getallheaders?branch=master) +[![Latest Stable Version](https://poser.pugx.org/ralouphie/getallheaders/v/stable.png)](https://packagist.org/packages/ralouphie/getallheaders) +[![Latest Unstable Version](https://poser.pugx.org/ralouphie/getallheaders/v/unstable.png)](https://packagist.org/packages/ralouphie/getallheaders) +[![License](https://poser.pugx.org/ralouphie/getallheaders/license.png)](https://packagist.org/packages/ralouphie/getallheaders) + + +This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/function.getallheaders.php). + +## Install + +For PHP version **`>= 5.6`**: + +``` +composer require ralouphie/getallheaders +``` + +For PHP version **`< 5.6`**: + +``` +composer require ralouphie/getallheaders "^2" +``` diff --git a/vendor/ralouphie/getallheaders/composer.json b/vendor/ralouphie/getallheaders/composer.json new file mode 100644 index 000000000..de8ce62e4 --- /dev/null +++ b/vendor/ralouphie/getallheaders/composer.json @@ -0,0 +1,26 @@ +{ + "name": "ralouphie/getallheaders", + "description": "A polyfill for getallheaders.", + "license": "MIT", + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "^5 || ^6.5", + "php-coveralls/php-coveralls": "^2.1" + }, + "autoload": { + "files": ["src/getallheaders.php"] + }, + "autoload-dev": { + "psr-4": { + "getallheaders\\Tests\\": "tests/" + } + } +} diff --git a/vendor/ralouphie/getallheaders/src/getallheaders.php b/vendor/ralouphie/getallheaders/src/getallheaders.php new file mode 100644 index 000000000..c7285a5ba --- /dev/null +++ b/vendor/ralouphie/getallheaders/src/getallheaders.php @@ -0,0 +1,46 @@ + 'Content-Type', + 'CONTENT_LENGTH' => 'Content-Length', + 'CONTENT_MD5' => 'Content-Md5', + ); + + foreach ($_SERVER as $key => $value) { + if (substr($key, 0, 5) === 'HTTP_') { + $key = substr($key, 5); + if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) { + $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key)))); + $headers[$key] = $value; + } + } elseif (isset($copy_server[$key])) { + $headers[$copy_server[$key]] = $value; + } + } + + if (!isset($headers['Authorization'])) { + if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) { + $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; + } elseif (isset($_SERVER['PHP_AUTH_USER'])) { + $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; + $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); + } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { + $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; + } + } + + return $headers; + } + +} diff --git a/vendor/symfony/deprecation-contracts/.gitignore b/vendor/symfony/deprecation-contracts/.gitignore new file mode 100644 index 000000000..c49a5d8df --- /dev/null +++ b/vendor/symfony/deprecation-contracts/.gitignore @@ -0,0 +1,3 @@ +vendor/ +composer.lock +phpunit.xml diff --git a/vendor/symfony/deprecation-contracts/CHANGELOG.md b/vendor/symfony/deprecation-contracts/CHANGELOG.md new file mode 100644 index 000000000..7932e2613 --- /dev/null +++ b/vendor/symfony/deprecation-contracts/CHANGELOG.md @@ -0,0 +1,5 @@ +CHANGELOG +========= + +The changelog is maintained for all Symfony contracts at the following URL: +https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/vendor/symfony/deprecation-contracts/LICENSE b/vendor/symfony/deprecation-contracts/LICENSE new file mode 100644 index 000000000..406242ff2 --- /dev/null +++ b/vendor/symfony/deprecation-contracts/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020-2022 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/symfony/deprecation-contracts/README.md b/vendor/symfony/deprecation-contracts/README.md new file mode 100644 index 000000000..4957933a6 --- /dev/null +++ b/vendor/symfony/deprecation-contracts/README.md @@ -0,0 +1,26 @@ +Symfony Deprecation Contracts +============================= + +A generic function and convention to trigger deprecation notices. + +This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices. + +By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component, +the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments. + +The function requires at least 3 arguments: + - the name of the Composer package that is triggering the deprecation + - the version of the package that introduced the deprecation + - the message of the deprecation + - more arguments can be provided: they will be inserted in the message using `printf()` formatting + +Example: +```php +trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin'); +``` + +This will generate the following message: +`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.` + +While not necessarily recommended, the deprecation notices can be completely ignored by declaring an empty +`function trigger_deprecation() {}` in your application. diff --git a/vendor/symfony/deprecation-contracts/composer.json b/vendor/symfony/deprecation-contracts/composer.json new file mode 100644 index 000000000..1c1b4ba0e --- /dev/null +++ b/vendor/symfony/deprecation-contracts/composer.json @@ -0,0 +1,35 @@ +{ + "name": "symfony/deprecation-contracts", + "type": "library", + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=8.0.2" + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + } +} diff --git a/vendor/symfony/deprecation-contracts/function.php b/vendor/symfony/deprecation-contracts/function.php new file mode 100644 index 000000000..2d56512ba --- /dev/null +++ b/vendor/symfony/deprecation-contracts/function.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (!function_exists('trigger_deprecation')) { + /** + * Triggers a silenced deprecation notice. + * + * @param string $package The name of the Composer package that is triggering the deprecation + * @param string $version The version of the package that introduced the deprecation + * @param string $message The message of the deprecation + * @param mixed ...$args Values to insert in the message using printf() formatting + * + * @author Nicolas Grekas + */ + function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void + { + @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); + } +} diff --git a/vendor/symfony/polyfill-mbstring/LICENSE b/vendor/symfony/polyfill-mbstring/LICENSE new file mode 100644 index 000000000..6e3afce69 --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/symfony/polyfill-mbstring/Mbstring.php b/vendor/symfony/polyfill-mbstring/Mbstring.php new file mode 100644 index 000000000..2e0b96940 --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -0,0 +1,947 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Mbstring; + +/** + * Partial mbstring implementation in PHP, iconv based, UTF-8 centric. + * + * Implemented: + * - mb_chr - Returns a specific character from its Unicode code point + * - mb_convert_encoding - Convert character encoding + * - mb_convert_variables - Convert character code in variable(s) + * - mb_decode_mimeheader - Decode string in MIME header field + * - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED + * - mb_decode_numericentity - Decode HTML numeric string reference to character + * - mb_encode_numericentity - Encode character to HTML numeric string reference + * - mb_convert_case - Perform case folding on a string + * - mb_detect_encoding - Detect character encoding + * - mb_get_info - Get internal settings of mbstring + * - mb_http_input - Detect HTTP input character encoding + * - mb_http_output - Set/Get HTTP output character encoding + * - mb_internal_encoding - Set/Get internal character encoding + * - mb_list_encodings - Returns an array of all supported encodings + * - mb_ord - Returns the Unicode code point of a character + * - mb_output_handler - Callback function converts character encoding in output buffer + * - mb_scrub - Replaces ill-formed byte sequences with substitute characters + * - mb_strlen - Get string length + * - mb_strpos - Find position of first occurrence of string in a string + * - mb_strrpos - Find position of last occurrence of a string in a string + * - mb_str_split - Convert a string to an array + * - mb_strtolower - Make a string lowercase + * - mb_strtoupper - Make a string uppercase + * - mb_substitute_character - Set/Get substitution character + * - mb_substr - Get part of string + * - mb_stripos - Finds position of first occurrence of a string within another, case insensitive + * - mb_stristr - Finds first occurrence of a string within another, case insensitive + * - mb_strrchr - Finds the last occurrence of a character in a string within another + * - mb_strrichr - Finds the last occurrence of a character in a string within another, case insensitive + * - mb_strripos - Finds position of last occurrence of a string within another, case insensitive + * - mb_strstr - Finds first occurrence of a string within another + * - mb_strwidth - Return width of string + * - mb_substr_count - Count the number of substring occurrences + * + * Not implemented: + * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) + * - mb_ereg_* - Regular expression with multibyte support + * - mb_parse_str - Parse GET/POST/COOKIE data and set global variable + * - mb_preferred_mime_name - Get MIME charset string + * - mb_regex_encoding - Returns current encoding for multibyte regex as string + * - mb_regex_set_options - Set/Get the default options for mbregex functions + * - mb_send_mail - Send encoded mail + * - mb_split - Split multibyte string using regular expression + * - mb_strcut - Get part of string + * - mb_strimwidth - Get truncated string with specified width + * + * @author Nicolas Grekas + * + * @internal + */ +final class Mbstring +{ + public const MB_CASE_FOLD = \PHP_INT_MAX; + + private const SIMPLE_CASE_FOLD = [ + ['µ', 'Å¿', "\xCD\x85", 'Ï‚', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], + ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'Ï€', 'κ', 'Ï', 'ε', "\xE1\xB9\xA1", 'ι'], + ]; + + private static $encodingList = ['ASCII', 'UTF-8']; + private static $language = 'neutral'; + private static $internalEncoding = 'UTF-8'; + + public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) + { + if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) { + $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); + } else { + $fromEncoding = self::getEncoding($fromEncoding); + } + + $toEncoding = self::getEncoding($toEncoding); + + if ('BASE64' === $fromEncoding) { + $s = base64_decode($s); + $fromEncoding = $toEncoding; + } + + if ('BASE64' === $toEncoding) { + return base64_encode($s); + } + + if ('HTML-ENTITIES' === $toEncoding || 'HTML' === $toEncoding) { + if ('HTML-ENTITIES' === $fromEncoding || 'HTML' === $fromEncoding) { + $fromEncoding = 'Windows-1252'; + } + if ('UTF-8' !== $fromEncoding) { + $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s); + } + + return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s); + } + + if ('HTML-ENTITIES' === $fromEncoding) { + $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8'); + $fromEncoding = 'UTF-8'; + } + + return iconv($fromEncoding, $toEncoding.'//IGNORE', $s); + } + + public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) + { + $ok = true; + array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { + if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { + $ok = false; + } + }); + + return $ok ? $fromEncoding : false; + } + + public static function mb_decode_mimeheader($s) + { + return iconv_mime_decode($s, 2, self::$internalEncoding); + } + + public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) + { + trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING); + } + + public static function mb_decode_numericentity($s, $convmap, $encoding = null) + { + if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { + trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); + + return null; + } + + if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { + return false; + } + + if (null !== $encoding && !\is_scalar($encoding)) { + trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); + + return ''; // Instead of null (cf. mb_encode_numericentity). + } + + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + $cnt = floor(\count($convmap) / 4) * 4; + + for ($i = 0; $i < $cnt; $i += 4) { + // collector_decode_htmlnumericentity ignores $convmap[$i + 3] + $convmap[$i] += $convmap[$i + 2]; + $convmap[$i + 1] += $convmap[$i + 2]; + } + + $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { + $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; + for ($i = 0; $i < $cnt; $i += 4) { + if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { + return self::mb_chr($c - $convmap[$i + 2]); + } + } + + return $m[0]; + }, $s); + + if (null === $encoding) { + return $s; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $s); + } + + public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) + { + if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { + trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); + + return null; + } + + if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { + return false; + } + + if (null !== $encoding && !\is_scalar($encoding)) { + trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); + + return null; // Instead of '' (cf. mb_decode_numericentity). + } + + if (null !== $is_hex && !\is_scalar($is_hex)) { + trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING); + + return null; + } + + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; + + $cnt = floor(\count($convmap) / 4) * 4; + $i = 0; + $len = \strlen($s); + $result = ''; + + while ($i < $len) { + $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + $i += $ulen; + $c = self::mb_ord($uchr); + + for ($j = 0; $j < $cnt; $j += 4) { + if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { + $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3]; + $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; + continue 2; + } + } + $result .= $uchr; + } + + if (null === $encoding) { + return $result; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $result); + } + + public static function mb_convert_case($s, $mode, $encoding = null) + { + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + if (\MB_CASE_TITLE == $mode) { + static $titleRegexp = null; + if (null === $titleRegexp) { + $titleRegexp = self::getData('titleCaseRegexp'); + } + $s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s); + } else { + if (\MB_CASE_UPPER == $mode) { + static $upper = null; + if (null === $upper) { + $upper = self::getData('upperCase'); + } + $map = $upper; + } else { + if (self::MB_CASE_FOLD === $mode) { + static $caseFolding = null; + if (null === $caseFolding) { + $caseFolding = self::getData('caseFolding'); + } + $s = strtr($s, $caseFolding); + } + + static $lower = null; + if (null === $lower) { + $lower = self::getData('lowerCase'); + } + $map = $lower; + } + + static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; + + $i = 0; + $len = \strlen($s); + + while ($i < $len) { + $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + $i += $ulen; + + if (isset($map[$uchr])) { + $uchr = $map[$uchr]; + $nlen = \strlen($uchr); + + if ($nlen == $ulen) { + $nlen = $i; + do { + $s[--$nlen] = $uchr[--$ulen]; + } while ($ulen); + } else { + $s = substr_replace($s, $uchr, $i - $ulen, $ulen); + $len += $nlen - $ulen; + $i += $nlen - $ulen; + } + } + } + } + + if (null === $encoding) { + return $s; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $s); + } + + public static function mb_internal_encoding($encoding = null) + { + if (null === $encoding) { + return self::$internalEncoding; + } + + $normalizedEncoding = self::getEncoding($encoding); + + if ('UTF-8' === $normalizedEncoding || false !== @iconv($normalizedEncoding, $normalizedEncoding, ' ')) { + self::$internalEncoding = $normalizedEncoding; + + return true; + } + + if (80000 > \PHP_VERSION_ID) { + return false; + } + + throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding)); + } + + public static function mb_language($lang = null) + { + if (null === $lang) { + return self::$language; + } + + switch ($normalizedLang = strtolower($lang)) { + case 'uni': + case 'neutral': + self::$language = $normalizedLang; + + return true; + } + + if (80000 > \PHP_VERSION_ID) { + return false; + } + + throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang)); + } + + public static function mb_list_encodings() + { + return ['UTF-8']; + } + + public static function mb_encoding_aliases($encoding) + { + switch (strtoupper($encoding)) { + case 'UTF8': + case 'UTF-8': + return ['utf8']; + } + + return false; + } + + public static function mb_check_encoding($var = null, $encoding = null) + { + if (PHP_VERSION_ID < 70200 && \is_array($var)) { + trigger_error('mb_check_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING); + + return null; + } + + if (null === $encoding) { + if (null === $var) { + return false; + } + $encoding = self::$internalEncoding; + } + + if (!\is_array($var)) { + return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); + } + + foreach ($var as $key => $value) { + if (!self::mb_check_encoding($key, $encoding)) { + return false; + } + if (!self::mb_check_encoding($value, $encoding)) { + return false; + } + } + + return true; + + } + + public static function mb_detect_encoding($str, $encodingList = null, $strict = false) + { + if (null === $encodingList) { + $encodingList = self::$encodingList; + } else { + if (!\is_array($encodingList)) { + $encodingList = array_map('trim', explode(',', $encodingList)); + } + $encodingList = array_map('strtoupper', $encodingList); + } + + foreach ($encodingList as $enc) { + switch ($enc) { + case 'ASCII': + if (!preg_match('/[\x80-\xFF]/', $str)) { + return $enc; + } + break; + + case 'UTF8': + case 'UTF-8': + if (preg_match('//u', $str)) { + return 'UTF-8'; + } + break; + + default: + if (0 === strncmp($enc, 'ISO-8859-', 9)) { + return $enc; + } + } + } + + return false; + } + + public static function mb_detect_order($encodingList = null) + { + if (null === $encodingList) { + return self::$encodingList; + } + + if (!\is_array($encodingList)) { + $encodingList = array_map('trim', explode(',', $encodingList)); + } + $encodingList = array_map('strtoupper', $encodingList); + + foreach ($encodingList as $enc) { + switch ($enc) { + default: + if (strncmp($enc, 'ISO-8859-', 9)) { + return false; + } + // no break + case 'ASCII': + case 'UTF8': + case 'UTF-8': + } + } + + self::$encodingList = $encodingList; + + return true; + } + + public static function mb_strlen($s, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return \strlen($s); + } + + return @iconv_strlen($s, $encoding); + } + + public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return strpos($haystack, $needle, $offset); + } + + $needle = (string) $needle; + if ('' === $needle) { + if (80000 > \PHP_VERSION_ID) { + trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING); + + return false; + } + + return 0; + } + + return iconv_strpos($haystack, $needle, $offset, $encoding); + } + + public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return strrpos($haystack, $needle, $offset); + } + + if ($offset != (int) $offset) { + $offset = 0; + } elseif ($offset = (int) $offset) { + if ($offset < 0) { + if (0 > $offset += self::mb_strlen($needle)) { + $haystack = self::mb_substr($haystack, 0, $offset, $encoding); + } + $offset = 0; + } else { + $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding); + } + } + + $pos = '' !== $needle || 80000 > \PHP_VERSION_ID + ? iconv_strrpos($haystack, $needle, $encoding) + : self::mb_strlen($haystack, $encoding); + + return false !== $pos ? $offset + $pos : false; + } + + public static function mb_str_split($string, $split_length = 1, $encoding = null) + { + if (null !== $string && !\is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) { + trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); + + return null; + } + + if (1 > $split_length = (int) $split_length) { + if (80000 > \PHP_VERSION_ID) { + trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING); + + return false; + } + + throw new \ValueError('Argument #2 ($length) must be greater than 0'); + } + + if (null === $encoding) { + $encoding = mb_internal_encoding(); + } + + if ('UTF-8' === $encoding = self::getEncoding($encoding)) { + $rx = '/('; + while (65535 < $split_length) { + $rx .= '.{65535}'; + $split_length -= 65535; + } + $rx .= '.{'.$split_length.'})/us'; + + return preg_split($rx, $string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); + } + + $result = []; + $length = mb_strlen($string, $encoding); + + for ($i = 0; $i < $length; $i += $split_length) { + $result[] = mb_substr($string, $i, $split_length, $encoding); + } + + return $result; + } + + public static function mb_strtolower($s, $encoding = null) + { + return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding); + } + + public static function mb_strtoupper($s, $encoding = null) + { + return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding); + } + + public static function mb_substitute_character($c = null) + { + if (null === $c) { + return 'none'; + } + if (0 === strcasecmp($c, 'none')) { + return true; + } + if (80000 > \PHP_VERSION_ID) { + return false; + } + if (\is_int($c) || 'long' === $c || 'entity' === $c) { + return false; + } + + throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint'); + } + + public static function mb_substr($s, $start, $length = null, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return (string) substr($s, $start, null === $length ? 2147483647 : $length); + } + + if ($start < 0) { + $start = iconv_strlen($s, $encoding) + $start; + if ($start < 0) { + $start = 0; + } + } + + if (null === $length) { + $length = 2147483647; + } elseif ($length < 0) { + $length = iconv_strlen($s, $encoding) + $length - $start; + if ($length < 0) { + return ''; + } + } + + return (string) iconv_substr($s, $start, $length, $encoding); + } + + public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) + { + [$haystack, $needle] = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], [ + self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding), + self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding), + ]); + + return self::mb_strpos($haystack, $needle, $offset, $encoding); + } + + public static function mb_stristr($haystack, $needle, $part = false, $encoding = null) + { + $pos = self::mb_stripos($haystack, $needle, 0, $encoding); + + return self::getSubpart($pos, $part, $haystack, $encoding); + } + + public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + $pos = strrpos($haystack, $needle); + } else { + $needle = self::mb_substr($needle, 0, 1, $encoding); + $pos = iconv_strrpos($haystack, $needle, $encoding); + } + + return self::getSubpart($pos, $part, $haystack, $encoding); + } + + public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null) + { + $needle = self::mb_substr($needle, 0, 1, $encoding); + $pos = self::mb_strripos($haystack, $needle, $encoding); + + return self::getSubpart($pos, $part, $haystack, $encoding); + } + + public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) + { + $haystack = self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding); + $needle = self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding); + + $haystack = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $haystack); + $needle = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $needle); + + return self::mb_strrpos($haystack, $needle, $offset, $encoding); + } + + public static function mb_strstr($haystack, $needle, $part = false, $encoding = null) + { + $pos = strpos($haystack, $needle); + if (false === $pos) { + return false; + } + if ($part) { + return substr($haystack, 0, $pos); + } + + return substr($haystack, $pos); + } + + public static function mb_get_info($type = 'all') + { + $info = [ + 'internal_encoding' => self::$internalEncoding, + 'http_output' => 'pass', + 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)', + 'func_overload' => 0, + 'func_overload_list' => 'no overload', + 'mail_charset' => 'UTF-8', + 'mail_header_encoding' => 'BASE64', + 'mail_body_encoding' => 'BASE64', + 'illegal_chars' => 0, + 'encoding_translation' => 'Off', + 'language' => self::$language, + 'detect_order' => self::$encodingList, + 'substitute_character' => 'none', + 'strict_detection' => 'Off', + ]; + + if ('all' === $type) { + return $info; + } + if (isset($info[$type])) { + return $info[$type]; + } + + return false; + } + + public static function mb_http_input($type = '') + { + return false; + } + + public static function mb_http_output($encoding = null) + { + return null !== $encoding ? 'pass' === $encoding : 'pass'; + } + + public static function mb_strwidth($s, $encoding = null) + { + $encoding = self::getEncoding($encoding); + + if ('UTF-8' !== $encoding) { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide); + + return ($wide << 1) + iconv_strlen($s, 'UTF-8'); + } + + public static function mb_substr_count($haystack, $needle, $encoding = null) + { + return substr_count($haystack, $needle); + } + + public static function mb_output_handler($contents, $status) + { + return $contents; + } + + public static function mb_chr($code, $encoding = null) + { + if (0x80 > $code %= 0x200000) { + $s = \chr($code); + } elseif (0x800 > $code) { + $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); + } elseif (0x10000 > $code) { + $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); + } else { + $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); + } + + if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { + $s = mb_convert_encoding($s, $encoding, 'UTF-8'); + } + + return $s; + } + + public static function mb_ord($s, $encoding = null) + { + if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { + $s = mb_convert_encoding($s, 'UTF-8', $encoding); + } + + if (1 === \strlen($s)) { + return \ord($s); + } + + $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; + if (0xF0 <= $code) { + return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; + } + if (0xE0 <= $code) { + return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; + } + if (0xC0 <= $code) { + return (($code - 0xC0) << 6) + $s[2] - 0x80; + } + + return $code; + } + + public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, string $encoding = null): string + { + if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) { + throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH'); + } + + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } + + try { + $validEncoding = @self::mb_check_encoding('', $encoding); + } catch (\ValueError $e) { + throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding)); + } + + // BC for PHP 7.3 and lower + if (!$validEncoding) { + throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding)); + } + + if (self::mb_strlen($pad_string, $encoding) <= 0) { + throw new \ValueError('mb_str_pad(): Argument #3 ($pad_string) must be a non-empty string'); + } + + $paddingRequired = $length - self::mb_strlen($string, $encoding); + + if ($paddingRequired < 1) { + return $string; + } + + switch ($pad_type) { + case \STR_PAD_LEFT: + return self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding).$string; + case \STR_PAD_RIGHT: + return $string.self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding); + default: + $leftPaddingLength = floor($paddingRequired / 2); + $rightPaddingLength = $paddingRequired - $leftPaddingLength; + + return self::mb_substr(str_repeat($pad_string, $leftPaddingLength), 0, $leftPaddingLength, $encoding).$string.self::mb_substr(str_repeat($pad_string, $rightPaddingLength), 0, $rightPaddingLength, $encoding); + } + } + + private static function getSubpart($pos, $part, $haystack, $encoding) + { + if (false === $pos) { + return false; + } + if ($part) { + return self::mb_substr($haystack, 0, $pos, $encoding); + } + + return self::mb_substr($haystack, $pos, null, $encoding); + } + + private static function html_encoding_callback(array $m) + { + $i = 1; + $entities = ''; + $m = unpack('C*', htmlentities($m[0], \ENT_COMPAT, 'UTF-8')); + + while (isset($m[$i])) { + if (0x80 > $m[$i]) { + $entities .= \chr($m[$i++]); + continue; + } + if (0xF0 <= $m[$i]) { + $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; + } elseif (0xE0 <= $m[$i]) { + $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; + } else { + $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80; + } + + $entities .= '&#'.$c.';'; + } + + return $entities; + } + + private static function title_case(array $s) + { + return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8'); + } + + private static function getData($file) + { + if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { + return require $file; + } + + return false; + } + + private static function getEncoding($encoding) + { + if (null === $encoding) { + return self::$internalEncoding; + } + + if ('UTF-8' === $encoding) { + return 'UTF-8'; + } + + $encoding = strtoupper($encoding); + + if ('8BIT' === $encoding || 'BINARY' === $encoding) { + return 'CP850'; + } + + if ('UTF8' === $encoding) { + return 'UTF-8'; + } + + return $encoding; + } +} diff --git a/vendor/symfony/polyfill-mbstring/README.md b/vendor/symfony/polyfill-mbstring/README.md new file mode 100644 index 000000000..478b40da2 --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/README.md @@ -0,0 +1,13 @@ +Symfony Polyfill / Mbstring +=========================== + +This component provides a partial, native PHP implementation for the +[Mbstring](https://php.net/mbstring) extension. + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php new file mode 100644 index 000000000..512bba0bf --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php @@ -0,0 +1,119 @@ + 'i̇', + 'µ' => 'μ', + 'Å¿' => 's', + 'Í…' => 'ι', + 'Ï‚' => 'σ', + 'Ï' => 'β', + 'Ï‘' => 'θ', + 'Ï•' => 'φ', + 'Ï–' => 'Ï€', + 'Ï°' => 'κ', + 'ϱ' => 'Ï', + 'ϵ' => 'ε', + 'ẛ' => 'ṡ', + 'á¾¾' => 'ι', + 'ß' => 'ss', + 'ʼn' => 'ʼn', + 'Ç°' => 'Ç°', + 'Î' => 'Î', + 'ΰ' => 'ΰ', + 'Ö‡' => 'Õ¥Ö‚', + 'ẖ' => 'ẖ', + 'ẗ' => 'ẗ', + 'ẘ' => 'ẘ', + 'ẙ' => 'ẙ', + 'ẚ' => 'aʾ', + 'ẞ' => 'ss', + 'á½' => 'á½', + 'á½’' => 'á½’', + 'á½”' => 'á½”', + 'á½–' => 'á½–', + 'á¾€' => 'ἀι', + 'á¾' => 'á¼Î¹', + 'ᾂ' => 'ἂι', + 'ᾃ' => 'ἃι', + 'ᾄ' => 'ἄι', + 'á¾…' => 'ἅι', + 'ᾆ' => 'ἆι', + 'ᾇ' => 'ἇι', + 'ᾈ' => 'ἀι', + 'ᾉ' => 'á¼Î¹', + 'ᾊ' => 'ἂι', + 'ᾋ' => 'ἃι', + 'ᾌ' => 'ἄι', + 'á¾' => 'ἅι', + 'ᾎ' => 'ἆι', + 'á¾' => 'ἇι', + 'á¾' => 'ἠι', + 'ᾑ' => 'ἡι', + 'á¾’' => 'ἢι', + 'ᾓ' => 'ἣι', + 'á¾”' => 'ἤι', + 'ᾕ' => 'ἥι', + 'á¾–' => 'ἦι', + 'á¾—' => 'ἧι', + 'ᾘ' => 'ἠι', + 'á¾™' => 'ἡι', + 'ᾚ' => 'ἢι', + 'á¾›' => 'ἣι', + 'ᾜ' => 'ἤι', + 'á¾' => 'ἥι', + 'ᾞ' => 'ἦι', + 'ᾟ' => 'ἧι', + 'á¾ ' => 'ὠι', + 'ᾡ' => 'ὡι', + 'á¾¢' => 'ὢι', + 'á¾£' => 'ὣι', + 'ᾤ' => 'ὤι', + 'á¾¥' => 'ὥι', + 'ᾦ' => 'ὦι', + 'ᾧ' => 'ὧι', + 'ᾨ' => 'ὠι', + 'ᾩ' => 'ὡι', + 'ᾪ' => 'ὢι', + 'ᾫ' => 'ὣι', + 'ᾬ' => 'ὤι', + 'á¾­' => 'ὥι', + 'á¾®' => 'ὦι', + 'ᾯ' => 'ὧι', + 'á¾²' => 'ὰι', + 'á¾³' => 'αι', + 'á¾´' => 'άι', + 'ᾶ' => 'ᾶ', + 'á¾·' => 'ᾶι', + 'á¾¼' => 'αι', + 'á¿‚' => 'ὴι', + 'ῃ' => 'ηι', + 'á¿„' => 'ήι', + 'ῆ' => 'ῆ', + 'ῇ' => 'ῆι', + 'á¿Œ' => 'ηι', + 'á¿’' => 'á¿’', + 'á¿–' => 'á¿–', + 'á¿—' => 'á¿—', + 'á¿¢' => 'á¿¢', + 'ῤ' => 'ῤ', + 'ῦ' => 'ῦ', + 'ῧ' => 'ῧ', + 'ῲ' => 'ὼι', + 'ῳ' => 'ωι', + 'á¿´' => 'ώι', + 'ῶ' => 'ῶ', + 'á¿·' => 'ῶι', + 'ῼ' => 'ωι', + 'ff' => 'ff', + 'ï¬' => 'fi', + 'fl' => 'fl', + 'ffi' => 'ffi', + 'ffl' => 'ffl', + 'ſt' => 'st', + 'st' => 'st', + 'ﬓ' => 'Õ´Õ¶', + 'ﬔ' => 'Õ´Õ¥', + 'ﬕ' => 'Õ´Õ«', + 'ﬖ' => 'Õ¾Õ¶', + 'ﬗ' => 'Õ´Õ­', +]; diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php new file mode 100644 index 000000000..fac60b081 --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php @@ -0,0 +1,1397 @@ + 'a', + 'B' => 'b', + 'C' => 'c', + 'D' => 'd', + 'E' => 'e', + 'F' => 'f', + 'G' => 'g', + 'H' => 'h', + 'I' => 'i', + 'J' => 'j', + 'K' => 'k', + 'L' => 'l', + 'M' => 'm', + 'N' => 'n', + 'O' => 'o', + 'P' => 'p', + 'Q' => 'q', + 'R' => 'r', + 'S' => 's', + 'T' => 't', + 'U' => 'u', + 'V' => 'v', + 'W' => 'w', + 'X' => 'x', + 'Y' => 'y', + 'Z' => 'z', + 'À' => 'à', + 'Ã' => 'á', + 'Â' => 'â', + 'Ã' => 'ã', + 'Ä' => 'ä', + 'Ã…' => 'Ã¥', + 'Æ' => 'æ', + 'Ç' => 'ç', + 'È' => 'è', + 'É' => 'é', + 'Ê' => 'ê', + 'Ë' => 'ë', + 'ÃŒ' => 'ì', + 'Ã' => 'í', + 'ÃŽ' => 'î', + 'Ã' => 'ï', + 'Ã' => 'ð', + 'Ñ' => 'ñ', + 'Ã’' => 'ò', + 'Ó' => 'ó', + 'Ô' => 'ô', + 'Õ' => 'õ', + 'Ö' => 'ö', + 'Ø' => 'ø', + 'Ù' => 'ù', + 'Ú' => 'ú', + 'Û' => 'û', + 'Ãœ' => 'ü', + 'Ã' => 'ý', + 'Þ' => 'þ', + 'Ä€' => 'Ä', + 'Ä‚' => 'ă', + 'Ä„' => 'Ä…', + 'Ć' => 'ć', + 'Ĉ' => 'ĉ', + 'ÄŠ' => 'Ä‹', + 'ÄŒ' => 'Ä', + 'ÄŽ' => 'Ä', + 'Ä' => 'Ä‘', + 'Ä’' => 'Ä“', + 'Ä”' => 'Ä•', + 'Ä–' => 'Ä—', + 'Ę' => 'Ä™', + 'Äš' => 'Ä›', + 'Äœ' => 'Ä', + 'Äž' => 'ÄŸ', + 'Ä ' => 'Ä¡', + 'Ä¢' => 'Ä£', + 'Ĥ' => 'Ä¥', + 'Ħ' => 'ħ', + 'Ĩ' => 'Ä©', + 'Ī' => 'Ä«', + 'Ĭ' => 'Ä­', + 'Ä®' => 'į', + 'Ä°' => 'i̇', + 'IJ' => 'ij', + 'Ä´' => 'ĵ', + 'Ķ' => 'Ä·', + 'Ĺ' => 'ĺ', + 'Ä»' => 'ļ', + 'Ľ' => 'ľ', + 'Ä¿' => 'Å€', + 'Å' => 'Å‚', + 'Ń' => 'Å„', + 'Å…' => 'ņ', + 'Ň' => 'ň', + 'ÅŠ' => 'Å‹', + 'ÅŒ' => 'Å', + 'ÅŽ' => 'Å', + 'Å' => 'Å‘', + 'Å’' => 'Å“', + 'Å”' => 'Å•', + 'Å–' => 'Å—', + 'Ř' => 'Å™', + 'Åš' => 'Å›', + 'Åœ' => 'Å', + 'Åž' => 'ÅŸ', + 'Å ' => 'Å¡', + 'Å¢' => 'Å£', + 'Ť' => 'Å¥', + 'Ŧ' => 'ŧ', + 'Ũ' => 'Å©', + 'Ū' => 'Å«', + 'Ŭ' => 'Å­', + 'Å®' => 'ů', + 'Å°' => 'ű', + 'Ų' => 'ų', + 'Å´' => 'ŵ', + 'Ŷ' => 'Å·', + 'Ÿ' => 'ÿ', + 'Ź' => 'ź', + 'Å»' => 'ż', + 'Ž' => 'ž', + 'Æ' => 'É“', + 'Æ‚' => 'ƃ', + 'Æ„' => 'Æ…', + 'Ɔ' => 'É”', + 'Ƈ' => 'ƈ', + 'Ɖ' => 'É–', + 'ÆŠ' => 'É—', + 'Æ‹' => 'ÆŒ', + 'ÆŽ' => 'Ç', + 'Æ' => 'É™', + 'Æ' => 'É›', + 'Æ‘' => 'Æ’', + 'Æ“' => 'É ', + 'Æ”' => 'É£', + 'Æ–' => 'É©', + 'Æ—' => 'ɨ', + 'Ƙ' => 'Æ™', + 'Æœ' => 'ɯ', + 'Æ' => 'ɲ', + 'ÆŸ' => 'ɵ', + 'Æ ' => 'Æ¡', + 'Æ¢' => 'Æ£', + 'Ƥ' => 'Æ¥', + 'Ʀ' => 'Ê€', + 'Ƨ' => 'ƨ', + 'Æ©' => 'ʃ', + 'Ƭ' => 'Æ­', + 'Æ®' => 'ʈ', + 'Ư' => 'Æ°', + 'Ʊ' => 'ÊŠ', + 'Ʋ' => 'Ê‹', + 'Ƴ' => 'Æ´', + 'Ƶ' => 'ƶ', + 'Æ·' => 'Ê’', + 'Ƹ' => 'ƹ', + 'Ƽ' => 'ƽ', + 'Ç„' => 'dž', + 'Ç…' => 'dž', + 'LJ' => 'lj', + 'Lj' => 'lj', + 'ÇŠ' => 'ÇŒ', + 'Ç‹' => 'ÇŒ', + 'Ç' => 'ÇŽ', + 'Ç' => 'Ç', + 'Ç‘' => 'Ç’', + 'Ç“' => 'Ç”', + 'Ç•' => 'Ç–', + 'Ç—' => 'ǘ', + 'Ç™' => 'Çš', + 'Ç›' => 'Çœ', + 'Çž' => 'ÇŸ', + 'Ç ' => 'Ç¡', + 'Ç¢' => 'Ç£', + 'Ǥ' => 'Ç¥', + 'Ǧ' => 'ǧ', + 'Ǩ' => 'Ç©', + 'Ǫ' => 'Ç«', + 'Ǭ' => 'Ç­', + 'Ç®' => 'ǯ', + 'DZ' => 'dz', + 'Dz' => 'dz', + 'Ç´' => 'ǵ', + 'Ƕ' => 'Æ•', + 'Ç·' => 'Æ¿', + 'Ǹ' => 'ǹ', + 'Ǻ' => 'Ç»', + 'Ǽ' => 'ǽ', + 'Ǿ' => 'Ç¿', + 'È€' => 'È', + 'È‚' => 'ȃ', + 'È„' => 'È…', + 'Ȇ' => 'ȇ', + 'Ȉ' => 'ȉ', + 'ÈŠ' => 'È‹', + 'ÈŒ' => 'È', + 'ÈŽ' => 'È', + 'È' => 'È‘', + 'È’' => 'È“', + 'È”' => 'È•', + 'È–' => 'È—', + 'Ș' => 'È™', + 'Èš' => 'È›', + 'Èœ' => 'È', + 'Èž' => 'ÈŸ', + 'È ' => 'Æž', + 'È¢' => 'È£', + 'Ȥ' => 'È¥', + 'Ȧ' => 'ȧ', + 'Ȩ' => 'È©', + 'Ȫ' => 'È«', + 'Ȭ' => 'È­', + 'È®' => 'ȯ', + 'È°' => 'ȱ', + 'Ȳ' => 'ȳ', + 'Ⱥ' => 'â±¥', + 'È»' => 'ȼ', + 'Ƚ' => 'Æš', + 'Ⱦ' => 'ⱦ', + 'É' => 'É‚', + 'Ƀ' => 'Æ€', + 'É„' => 'ʉ', + 'É…' => 'ÊŒ', + 'Ɇ' => 'ɇ', + 'Ɉ' => 'ɉ', + 'ÉŠ' => 'É‹', + 'ÉŒ' => 'É', + 'ÉŽ' => 'É', + 'Í°' => 'ͱ', + 'Ͳ' => 'ͳ', + 'Ͷ' => 'Í·', + 'Í¿' => 'ϳ', + 'Ά' => 'ά', + 'Έ' => 'έ', + 'Ή' => 'ή', + 'Ί' => 'ί', + 'ÎŒ' => 'ÏŒ', + 'ÎŽ' => 'Ï', + 'Î' => 'ÏŽ', + 'Α' => 'α', + 'Î’' => 'β', + 'Γ' => 'γ', + 'Δ' => 'δ', + 'Ε' => 'ε', + 'Ζ' => 'ζ', + 'Η' => 'η', + 'Θ' => 'θ', + 'Ι' => 'ι', + 'Κ' => 'κ', + 'Λ' => 'λ', + 'Îœ' => 'μ', + 'Î' => 'ν', + 'Ξ' => 'ξ', + 'Ο' => 'ο', + 'Π' => 'Ï€', + 'Ρ' => 'Ï', + 'Σ' => 'σ', + 'Τ' => 'Ï„', + 'Î¥' => 'Ï…', + 'Φ' => 'φ', + 'Χ' => 'χ', + 'Ψ' => 'ψ', + 'Ω' => 'ω', + 'Ϊ' => 'ÏŠ', + 'Ϋ' => 'Ï‹', + 'Ï' => 'Ï—', + 'Ϙ' => 'Ï™', + 'Ïš' => 'Ï›', + 'Ïœ' => 'Ï', + 'Ïž' => 'ÏŸ', + 'Ï ' => 'Ï¡', + 'Ï¢' => 'Ï£', + 'Ϥ' => 'Ï¥', + 'Ϧ' => 'ϧ', + 'Ϩ' => 'Ï©', + 'Ϫ' => 'Ï«', + 'Ϭ' => 'Ï­', + 'Ï®' => 'ϯ', + 'Ï´' => 'θ', + 'Ï·' => 'ϸ', + 'Ϲ' => 'ϲ', + 'Ϻ' => 'Ï»', + 'Ͻ' => 'Í»', + 'Ͼ' => 'ͼ', + 'Ï¿' => 'ͽ', + 'Ѐ' => 'Ñ', + 'Ð' => 'Ñ‘', + 'Ђ' => 'Ñ’', + 'Ѓ' => 'Ñ“', + 'Є' => 'Ñ”', + 'Ð…' => 'Ñ•', + 'І' => 'Ñ–', + 'Ї' => 'Ñ—', + 'Ј' => 'ј', + 'Љ' => 'Ñ™', + 'Њ' => 'Ñš', + 'Ћ' => 'Ñ›', + 'ÐŒ' => 'Ñœ', + 'Ð' => 'Ñ', + 'ÐŽ' => 'Ñž', + 'Ð' => 'ÑŸ', + 'Ð' => 'а', + 'Б' => 'б', + 'Ð’' => 'в', + 'Г' => 'г', + 'Д' => 'д', + 'Е' => 'е', + 'Ж' => 'ж', + 'З' => 'з', + 'И' => 'и', + 'Й' => 'й', + 'К' => 'к', + 'Л' => 'л', + 'Ðœ' => 'м', + 'Ð' => 'н', + 'О' => 'о', + 'П' => 'п', + 'Р' => 'Ñ€', + 'С' => 'Ñ', + 'Т' => 'Ñ‚', + 'У' => 'у', + 'Ф' => 'Ñ„', + 'Ð¥' => 'Ñ…', + 'Ц' => 'ц', + 'Ч' => 'ч', + 'Ш' => 'ш', + 'Щ' => 'щ', + 'Ъ' => 'ÑŠ', + 'Ы' => 'Ñ‹', + 'Ь' => 'ÑŒ', + 'Э' => 'Ñ', + 'Ю' => 'ÑŽ', + 'Я' => 'Ñ', + 'Ñ ' => 'Ñ¡', + 'Ñ¢' => 'Ñ£', + 'Ѥ' => 'Ñ¥', + 'Ѧ' => 'ѧ', + 'Ѩ' => 'Ñ©', + 'Ѫ' => 'Ñ«', + 'Ѭ' => 'Ñ­', + 'Ñ®' => 'ѯ', + 'Ñ°' => 'ѱ', + 'Ѳ' => 'ѳ', + 'Ñ´' => 'ѵ', + 'Ѷ' => 'Ñ·', + 'Ѹ' => 'ѹ', + 'Ѻ' => 'Ñ»', + 'Ѽ' => 'ѽ', + 'Ѿ' => 'Ñ¿', + 'Ò€' => 'Ò', + 'ÒŠ' => 'Ò‹', + 'ÒŒ' => 'Ò', + 'ÒŽ' => 'Ò', + 'Ò' => 'Ò‘', + 'Ò’' => 'Ò“', + 'Ò”' => 'Ò•', + 'Ò–' => 'Ò—', + 'Ò˜' => 'Ò™', + 'Òš' => 'Ò›', + 'Òœ' => 'Ò', + 'Òž' => 'ÒŸ', + 'Ò ' => 'Ò¡', + 'Ò¢' => 'Ò£', + 'Ò¤' => 'Ò¥', + 'Ò¦' => 'Ò§', + 'Ò¨' => 'Ò©', + 'Òª' => 'Ò«', + 'Ò¬' => 'Ò­', + 'Ò®' => 'Ò¯', + 'Ò°' => 'Ò±', + 'Ò²' => 'Ò³', + 'Ò´' => 'Òµ', + 'Ò¶' => 'Ò·', + 'Ò¸' => 'Ò¹', + 'Òº' => 'Ò»', + 'Ò¼' => 'Ò½', + 'Ò¾' => 'Ò¿', + 'Ó€' => 'Ó', + 'Ó' => 'Ó‚', + 'Óƒ' => 'Ó„', + 'Ó…' => 'Ó†', + 'Ó‡' => 'Óˆ', + 'Ó‰' => 'ÓŠ', + 'Ó‹' => 'ÓŒ', + 'Ó' => 'ÓŽ', + 'Ó' => 'Ó‘', + 'Ó’' => 'Ó“', + 'Ó”' => 'Ó•', + 'Ó–' => 'Ó—', + 'Ó˜' => 'Ó™', + 'Óš' => 'Ó›', + 'Óœ' => 'Ó', + 'Óž' => 'ÓŸ', + 'Ó ' => 'Ó¡', + 'Ó¢' => 'Ó£', + 'Ó¤' => 'Ó¥', + 'Ó¦' => 'Ó§', + 'Ó¨' => 'Ó©', + 'Óª' => 'Ó«', + 'Ó¬' => 'Ó­', + 'Ó®' => 'Ó¯', + 'Ó°' => 'Ó±', + 'Ó²' => 'Ó³', + 'Ó´' => 'Óµ', + 'Ó¶' => 'Ó·', + 'Ó¸' => 'Ó¹', + 'Óº' => 'Ó»', + 'Ó¼' => 'Ó½', + 'Ó¾' => 'Ó¿', + 'Ô€' => 'Ô', + 'Ô‚' => 'Ôƒ', + 'Ô„' => 'Ô…', + 'Ô†' => 'Ô‡', + 'Ôˆ' => 'Ô‰', + 'ÔŠ' => 'Ô‹', + 'ÔŒ' => 'Ô', + 'ÔŽ' => 'Ô', + 'Ô' => 'Ô‘', + 'Ô’' => 'Ô“', + 'Ô”' => 'Ô•', + 'Ô–' => 'Ô—', + 'Ô˜' => 'Ô™', + 'Ôš' => 'Ô›', + 'Ôœ' => 'Ô', + 'Ôž' => 'ÔŸ', + 'Ô ' => 'Ô¡', + 'Ô¢' => 'Ô£', + 'Ô¤' => 'Ô¥', + 'Ô¦' => 'Ô§', + 'Ô¨' => 'Ô©', + 'Ôª' => 'Ô«', + 'Ô¬' => 'Ô­', + 'Ô®' => 'Ô¯', + 'Ô±' => 'Õ¡', + 'Ô²' => 'Õ¢', + 'Ô³' => 'Õ£', + 'Ô´' => 'Õ¤', + 'Ôµ' => 'Õ¥', + 'Ô¶' => 'Õ¦', + 'Ô·' => 'Õ§', + 'Ô¸' => 'Õ¨', + 'Ô¹' => 'Õ©', + 'Ôº' => 'Õª', + 'Ô»' => 'Õ«', + 'Ô¼' => 'Õ¬', + 'Ô½' => 'Õ­', + 'Ô¾' => 'Õ®', + 'Ô¿' => 'Õ¯', + 'Õ€' => 'Õ°', + 'Õ' => 'Õ±', + 'Õ‚' => 'Õ²', + 'Õƒ' => 'Õ³', + 'Õ„' => 'Õ´', + 'Õ…' => 'Õµ', + 'Õ†' => 'Õ¶', + 'Õ‡' => 'Õ·', + 'Õˆ' => 'Õ¸', + 'Õ‰' => 'Õ¹', + 'ÕŠ' => 'Õº', + 'Õ‹' => 'Õ»', + 'ÕŒ' => 'Õ¼', + 'Õ' => 'Õ½', + 'ÕŽ' => 'Õ¾', + 'Õ' => 'Õ¿', + 'Õ' => 'Ö€', + 'Õ‘' => 'Ö', + 'Õ’' => 'Ö‚', + 'Õ“' => 'Öƒ', + 'Õ”' => 'Ö„', + 'Õ•' => 'Ö…', + 'Õ–' => 'Ö†', + 'á‚ ' => 'â´€', + 'á‚¡' => 'â´', + 'á‚¢' => 'â´‚', + 'á‚£' => 'â´ƒ', + 'Ⴄ' => 'â´„', + 'á‚¥' => 'â´…', + 'Ⴆ' => 'â´†', + 'Ⴇ' => 'â´‡', + 'Ⴈ' => 'â´ˆ', + 'á‚©' => 'â´‰', + 'Ⴊ' => 'â´Š', + 'á‚«' => 'â´‹', + 'Ⴌ' => 'â´Œ', + 'á‚­' => 'â´', + 'á‚®' => 'â´Ž', + 'Ⴏ' => 'â´', + 'á‚°' => 'â´', + 'Ⴑ' => 'â´‘', + 'Ⴒ' => 'â´’', + 'Ⴓ' => 'â´“', + 'á‚´' => 'â´”', + 'Ⴕ' => 'â´•', + 'Ⴖ' => 'â´–', + 'á‚·' => 'â´—', + 'Ⴘ' => 'â´˜', + 'Ⴙ' => 'â´™', + 'Ⴚ' => 'â´š', + 'á‚»' => 'â´›', + 'Ⴜ' => 'â´œ', + 'Ⴝ' => 'â´', + 'Ⴞ' => 'â´ž', + 'á‚¿' => 'â´Ÿ', + 'Ⴠ' => 'â´ ', + 'áƒ' => 'â´¡', + 'Ⴢ' => 'â´¢', + 'Ⴣ' => 'â´£', + 'Ⴤ' => 'â´¤', + 'Ⴥ' => 'â´¥', + 'Ⴧ' => 'â´§', + 'áƒ' => 'â´­', + 'Ꭰ' => 'ê­°', + 'Ꭱ' => 'ê­±', + 'Ꭲ' => 'ê­²', + 'Ꭳ' => 'ê­³', + 'Ꭴ' => 'ê­´', + 'Ꭵ' => 'ê­µ', + 'Ꭶ' => 'ê­¶', + 'Ꭷ' => 'ê­·', + 'Ꭸ' => 'ê­¸', + 'Ꭹ' => 'ê­¹', + 'Ꭺ' => 'ê­º', + 'Ꭻ' => 'ê­»', + 'Ꭼ' => 'ê­¼', + 'Ꭽ' => 'ê­½', + 'Ꭾ' => 'ê­¾', + 'Ꭿ' => 'ê­¿', + 'Ꮀ' => 'ꮀ', + 'Ꮁ' => 'ê®', + 'Ꮂ' => 'ꮂ', + 'Ꮃ' => 'ꮃ', + 'Ꮄ' => 'ꮄ', + 'Ꮅ' => 'ê®…', + 'Ꮆ' => 'ꮆ', + 'Ꮇ' => 'ꮇ', + 'Ꮈ' => 'ꮈ', + 'Ꮉ' => 'ꮉ', + 'Ꮊ' => 'ꮊ', + 'Ꮋ' => 'ꮋ', + 'Ꮌ' => 'ꮌ', + 'Ꮍ' => 'ê®', + 'Ꮎ' => 'ꮎ', + 'Ꮏ' => 'ê®', + 'á€' => 'ê®', + 'á' => 'ꮑ', + 'á‚' => 'ê®’', + 'áƒ' => 'ꮓ', + 'á„' => 'ê®”', + 'á…' => 'ꮕ', + 'á†' => 'ê®–', + 'á‡' => 'ê®—', + 'áˆ' => 'ꮘ', + 'á‰' => 'ê®™', + 'áŠ' => 'ꮚ', + 'á‹' => 'ê®›', + 'áŒ' => 'ꮜ', + 'á' => 'ê®', + 'áŽ' => 'ꮞ', + 'á' => 'ꮟ', + 'á' => 'ê® ', + 'á‘' => 'ꮡ', + 'á’' => 'ꮢ', + 'á“' => 'ꮣ', + 'á”' => 'ꮤ', + 'á•' => 'ꮥ', + 'á–' => 'ꮦ', + 'á—' => 'ꮧ', + 'á˜' => 'ꮨ', + 'á™' => 'ꮩ', + 'áš' => 'ꮪ', + 'á›' => 'ꮫ', + 'áœ' => 'ꮬ', + 'á' => 'ê®­', + 'áž' => 'ê®®', + 'áŸ' => 'ꮯ', + 'á ' => 'ê®°', + 'á¡' => 'ê®±', + 'á¢' => 'ꮲ', + 'á£' => 'ꮳ', + 'á¤' => 'ê®´', + 'á¥' => 'ꮵ', + 'á¦' => 'ꮶ', + 'á§' => 'ê®·', + 'á¨' => 'ꮸ', + 'á©' => 'ꮹ', + 'áª' => 'ꮺ', + 'á«' => 'ê®»', + 'á¬' => 'ꮼ', + 'á­' => 'ꮽ', + 'á®' => 'ꮾ', + 'á¯' => 'ꮿ', + 'á°' => 'á¸', + 'á±' => 'á¹', + 'á²' => 'áº', + 'á³' => 'á»', + 'á´' => 'á¼', + 'áµ' => 'á½', + 'á²' => 'áƒ', + 'Ბ' => 'ბ', + 'á²’' => 'გ', + 'Დ' => 'დ', + 'á²”' => 'ე', + 'Ვ' => 'ვ', + 'á²–' => 'ზ', + 'á²—' => 'თ', + 'Ი' => 'ი', + 'á²™' => 'კ', + 'Ლ' => 'ლ', + 'á²›' => 'მ', + 'Ნ' => 'ნ', + 'á²' => 'áƒ', + 'Პ' => 'პ', + 'Ჟ' => 'ჟ', + 'á² ' => 'რ', + 'Ს' => 'ს', + 'á²¢' => 'ტ', + 'á²£' => 'უ', + 'Ფ' => 'ფ', + 'á²¥' => 'ქ', + 'Ღ' => 'ღ', + 'Ყ' => 'ყ', + 'Შ' => 'შ', + 'Ჩ' => 'ჩ', + 'Ც' => 'ც', + 'Ძ' => 'ძ', + 'Წ' => 'წ', + 'á²­' => 'ჭ', + 'á²®' => 'ხ', + 'Ჯ' => 'ჯ', + 'á²°' => 'ჰ', + 'á²±' => 'ჱ', + 'á²²' => 'ჲ', + 'á²³' => 'ჳ', + 'á²´' => 'ჴ', + 'á²µ' => 'ჵ', + 'Ჶ' => 'ჶ', + 'á²·' => 'ჷ', + 'Ჸ' => 'ჸ', + 'á²¹' => 'ჹ', + 'Ჺ' => 'ჺ', + 'á²½' => 'ჽ', + 'á²¾' => 'ჾ', + 'Ჿ' => 'ჿ', + 'Ḁ' => 'á¸', + 'Ḃ' => 'ḃ', + 'Ḅ' => 'ḅ', + 'Ḇ' => 'ḇ', + 'Ḉ' => 'ḉ', + 'Ḋ' => 'ḋ', + 'Ḍ' => 'á¸', + 'Ḏ' => 'á¸', + 'á¸' => 'ḑ', + 'Ḓ' => 'ḓ', + 'Ḕ' => 'ḕ', + 'Ḗ' => 'ḗ', + 'Ḙ' => 'ḙ', + 'Ḛ' => 'ḛ', + 'Ḝ' => 'á¸', + 'Ḟ' => 'ḟ', + 'Ḡ' => 'ḡ', + 'Ḣ' => 'ḣ', + 'Ḥ' => 'ḥ', + 'Ḧ' => 'ḧ', + 'Ḩ' => 'ḩ', + 'Ḫ' => 'ḫ', + 'Ḭ' => 'ḭ', + 'Ḯ' => 'ḯ', + 'Ḱ' => 'ḱ', + 'Ḳ' => 'ḳ', + 'Ḵ' => 'ḵ', + 'Ḷ' => 'ḷ', + 'Ḹ' => 'ḹ', + 'Ḻ' => 'ḻ', + 'Ḽ' => 'ḽ', + 'Ḿ' => 'ḿ', + 'á¹€' => 'á¹', + 'Ṃ' => 'ṃ', + 'Ṅ' => 'á¹…', + 'Ṇ' => 'ṇ', + 'Ṉ' => 'ṉ', + 'Ṋ' => 'ṋ', + 'Ṍ' => 'á¹', + 'Ṏ' => 'á¹', + 'á¹' => 'ṑ', + 'á¹’' => 'ṓ', + 'á¹”' => 'ṕ', + 'á¹–' => 'á¹—', + 'Ṙ' => 'á¹™', + 'Ṛ' => 'á¹›', + 'Ṝ' => 'á¹', + 'Ṟ' => 'ṟ', + 'á¹ ' => 'ṡ', + 'á¹¢' => 'á¹£', + 'Ṥ' => 'á¹¥', + 'Ṧ' => 'ṧ', + 'Ṩ' => 'ṩ', + 'Ṫ' => 'ṫ', + 'Ṭ' => 'á¹­', + 'á¹®' => 'ṯ', + 'á¹°' => 'á¹±', + 'á¹²' => 'á¹³', + 'á¹´' => 'á¹µ', + 'Ṷ' => 'á¹·', + 'Ṹ' => 'á¹¹', + 'Ṻ' => 'á¹»', + 'á¹¼' => 'á¹½', + 'á¹¾' => 'ṿ', + 'Ẁ' => 'áº', + 'Ẃ' => 'ẃ', + 'Ẅ' => 'ẅ', + 'Ẇ' => 'ẇ', + 'Ẉ' => 'ẉ', + 'Ẋ' => 'ẋ', + 'Ẍ' => 'áº', + 'Ẏ' => 'áº', + 'áº' => 'ẑ', + 'Ẓ' => 'ẓ', + 'Ẕ' => 'ẕ', + 'ẞ' => 'ß', + 'Ạ' => 'ạ', + 'Ả' => 'ả', + 'Ấ' => 'ấ', + 'Ầ' => 'ầ', + 'Ẩ' => 'ẩ', + 'Ẫ' => 'ẫ', + 'Ậ' => 'ậ', + 'Ắ' => 'ắ', + 'Ằ' => 'ằ', + 'Ẳ' => 'ẳ', + 'Ẵ' => 'ẵ', + 'Ặ' => 'ặ', + 'Ẹ' => 'ẹ', + 'Ẻ' => 'ẻ', + 'Ẽ' => 'ẽ', + 'Ế' => 'ế', + 'Ề' => 'á»', + 'Ể' => 'ể', + 'Ễ' => 'á»…', + 'Ệ' => 'ệ', + 'Ỉ' => 'ỉ', + 'Ị' => 'ị', + 'Ọ' => 'á»', + 'Ỏ' => 'á»', + 'á»' => 'ố', + 'á»’' => 'ồ', + 'á»”' => 'ổ', + 'á»–' => 'á»—', + 'Ộ' => 'á»™', + 'Ớ' => 'á»›', + 'Ờ' => 'á»', + 'Ở' => 'ở', + 'á» ' => 'ỡ', + 'Ợ' => 'ợ', + 'Ụ' => 'ụ', + 'Ủ' => 'ủ', + 'Ứ' => 'ứ', + 'Ừ' => 'ừ', + 'Ử' => 'á»­', + 'á»®' => 'ữ', + 'á»°' => 'á»±', + 'Ỳ' => 'ỳ', + 'á»´' => 'ỵ', + 'Ỷ' => 'á»·', + 'Ỹ' => 'ỹ', + 'Ỻ' => 'á»»', + 'Ỽ' => 'ỽ', + 'Ỿ' => 'ỿ', + 'Ἀ' => 'á¼€', + 'Ἁ' => 'á¼', + 'Ἂ' => 'ἂ', + 'Ἃ' => 'ἃ', + 'Ἄ' => 'ἄ', + 'á¼' => 'á¼…', + 'Ἆ' => 'ἆ', + 'á¼' => 'ἇ', + 'Ἐ' => 'á¼', + 'á¼™' => 'ἑ', + 'Ἒ' => 'á¼’', + 'á¼›' => 'ἓ', + 'Ἔ' => 'á¼”', + 'á¼' => 'ἕ', + 'Ἠ' => 'á¼ ', + 'Ἡ' => 'ἡ', + 'Ἢ' => 'á¼¢', + 'Ἣ' => 'á¼£', + 'Ἤ' => 'ἤ', + 'á¼­' => 'á¼¥', + 'á¼®' => 'ἦ', + 'Ἧ' => 'ἧ', + 'Ἰ' => 'á¼°', + 'á¼¹' => 'á¼±', + 'Ἲ' => 'á¼²', + 'á¼»' => 'á¼³', + 'á¼¼' => 'á¼´', + 'á¼½' => 'á¼µ', + 'á¼¾' => 'ἶ', + 'Ἷ' => 'á¼·', + 'Ὀ' => 'á½€', + 'Ὁ' => 'á½', + 'Ὂ' => 'ὂ', + 'Ὃ' => 'ὃ', + 'Ὄ' => 'ὄ', + 'á½' => 'á½…', + 'á½™' => 'ὑ', + 'á½›' => 'ὓ', + 'á½' => 'ὕ', + 'Ὗ' => 'á½—', + 'Ὠ' => 'á½ ', + 'Ὡ' => 'ὡ', + 'Ὢ' => 'á½¢', + 'Ὣ' => 'á½£', + 'Ὤ' => 'ὤ', + 'á½­' => 'á½¥', + 'á½®' => 'ὦ', + 'Ὧ' => 'ὧ', + 'ᾈ' => 'á¾€', + 'ᾉ' => 'á¾', + 'ᾊ' => 'ᾂ', + 'ᾋ' => 'ᾃ', + 'ᾌ' => 'ᾄ', + 'á¾' => 'á¾…', + 'ᾎ' => 'ᾆ', + 'á¾' => 'ᾇ', + 'ᾘ' => 'á¾', + 'á¾™' => 'ᾑ', + 'ᾚ' => 'á¾’', + 'á¾›' => 'ᾓ', + 'ᾜ' => 'á¾”', + 'á¾' => 'ᾕ', + 'ᾞ' => 'á¾–', + 'ᾟ' => 'á¾—', + 'ᾨ' => 'á¾ ', + 'ᾩ' => 'ᾡ', + 'ᾪ' => 'á¾¢', + 'ᾫ' => 'á¾£', + 'ᾬ' => 'ᾤ', + 'á¾­' => 'á¾¥', + 'á¾®' => 'ᾦ', + 'ᾯ' => 'ᾧ', + 'Ᾰ' => 'á¾°', + 'á¾¹' => 'á¾±', + 'Ὰ' => 'á½°', + 'á¾»' => 'á½±', + 'á¾¼' => 'á¾³', + 'Ὲ' => 'á½²', + 'Έ' => 'á½³', + 'á¿Š' => 'á½´', + 'á¿‹' => 'á½µ', + 'á¿Œ' => 'ῃ', + 'Ῐ' => 'á¿', + 'á¿™' => 'á¿‘', + 'á¿š' => 'ὶ', + 'á¿›' => 'á½·', + 'Ῠ' => 'á¿ ', + 'á¿©' => 'á¿¡', + 'Ὺ' => 'ὺ', + 'á¿«' => 'á½»', + 'Ῥ' => 'á¿¥', + 'Ὸ' => 'ὸ', + 'Ό' => 'á½¹', + 'Ὼ' => 'á½¼', + 'á¿»' => 'á½½', + 'ῼ' => 'ῳ', + 'Ω' => 'ω', + 'K' => 'k', + 'â„«' => 'Ã¥', + 'Ⅎ' => 'â…Ž', + 'â… ' => 'â…°', + 'â…¡' => 'â…±', + 'â…¢' => 'â…²', + 'â…£' => 'â…³', + 'â…¤' => 'â…´', + 'â…¥' => 'â…µ', + 'â…¦' => 'â…¶', + 'â…§' => 'â…·', + 'â…¨' => 'â…¸', + 'â…©' => 'â…¹', + 'â…ª' => 'â…º', + 'â…«' => 'â…»', + 'â…¬' => 'â…¼', + 'â…­' => 'â…½', + 'â…®' => 'â…¾', + 'â…¯' => 'â…¿', + 'Ↄ' => 'ↄ', + 'â’¶' => 'â“', + 'â’·' => 'â“‘', + 'â’¸' => 'â“’', + 'â’¹' => 'â““', + 'â’º' => 'â“”', + 'â’»' => 'â“•', + 'â’¼' => 'â“–', + 'â’½' => 'â“—', + 'â’¾' => 'ⓘ', + 'â’¿' => 'â“™', + 'â“€' => 'â“š', + 'â“' => 'â“›', + 'â“‚' => 'â“œ', + 'Ⓝ' => 'â“', + 'â“„' => 'â“ž', + 'â“…' => 'â“Ÿ', + 'Ⓠ' => 'â“ ', + 'Ⓡ' => 'â“¡', + 'Ⓢ' => 'â“¢', + 'Ⓣ' => 'â“£', + 'â“Š' => 'ⓤ', + 'â“‹' => 'â“¥', + 'â“Œ' => 'ⓦ', + 'â“' => 'ⓧ', + 'â“Ž' => 'ⓨ', + 'â“' => 'â“©', + 'â°€' => 'â°°', + 'â°' => 'â°±', + 'â°‚' => 'â°²', + 'â°ƒ' => 'â°³', + 'â°„' => 'â°´', + 'â°…' => 'â°µ', + 'â°†' => 'â°¶', + 'â°‡' => 'â°·', + 'â°ˆ' => 'â°¸', + 'â°‰' => 'â°¹', + 'â°Š' => 'â°º', + 'â°‹' => 'â°»', + 'â°Œ' => 'â°¼', + 'â°' => 'â°½', + 'â°Ž' => 'â°¾', + 'â°' => 'â°¿', + 'â°' => 'â±€', + 'â°‘' => 'â±', + 'â°’' => 'ⱂ', + 'â°“' => 'ⱃ', + 'â°”' => 'ⱄ', + 'â°•' => 'â±…', + 'â°–' => 'ⱆ', + 'â°—' => 'ⱇ', + 'â°˜' => 'ⱈ', + 'â°™' => 'ⱉ', + 'â°š' => 'ⱊ', + 'â°›' => 'ⱋ', + 'â°œ' => 'ⱌ', + 'â°' => 'â±', + 'â°ž' => 'ⱎ', + 'â°Ÿ' => 'â±', + 'â° ' => 'â±', + 'â°¡' => 'ⱑ', + 'â°¢' => 'â±’', + 'â°£' => 'ⱓ', + 'â°¤' => 'â±”', + 'â°¥' => 'ⱕ', + 'â°¦' => 'â±–', + 'â°§' => 'â±—', + 'â°¨' => 'ⱘ', + 'â°©' => 'â±™', + 'â°ª' => 'ⱚ', + 'â°«' => 'â±›', + 'â°¬' => 'ⱜ', + 'â°­' => 'â±', + 'â°®' => 'ⱞ', + 'â± ' => 'ⱡ', + 'â±¢' => 'É«', + 'â±£' => 'áµ½', + 'Ɽ' => 'ɽ', + 'Ⱨ' => 'ⱨ', + 'Ⱪ' => 'ⱪ', + 'Ⱬ' => 'ⱬ', + 'â±­' => 'É‘', + 'â±®' => 'ɱ', + 'Ɐ' => 'É', + 'â±°' => 'É’', + 'â±²' => 'â±³', + 'â±µ' => 'ⱶ', + 'â±¾' => 'È¿', + 'Ɀ' => 'É€', + 'â²€' => 'â²', + 'Ⲃ' => 'ⲃ', + 'Ⲅ' => 'â²…', + 'Ⲇ' => 'ⲇ', + 'Ⲉ' => 'ⲉ', + 'Ⲋ' => 'ⲋ', + 'Ⲍ' => 'â²', + 'Ⲏ' => 'â²', + 'â²' => 'ⲑ', + 'â²’' => 'ⲓ', + 'â²”' => 'ⲕ', + 'â²–' => 'â²—', + 'Ⲙ' => 'â²™', + 'Ⲛ' => 'â²›', + 'Ⲝ' => 'â²', + 'Ⲟ' => 'ⲟ', + 'â² ' => 'ⲡ', + 'â²¢' => 'â²£', + 'Ⲥ' => 'â²¥', + 'Ⲧ' => 'ⲧ', + 'Ⲩ' => 'ⲩ', + 'Ⲫ' => 'ⲫ', + 'Ⲭ' => 'â²­', + 'â²®' => 'ⲯ', + 'â²°' => 'â²±', + 'â²²' => 'â²³', + 'â²´' => 'â²µ', + 'Ⲷ' => 'â²·', + 'Ⲹ' => 'â²¹', + 'Ⲻ' => 'â²»', + 'â²¼' => 'â²½', + 'â²¾' => 'ⲿ', + 'â³€' => 'â³', + 'Ⳃ' => 'ⳃ', + 'Ⳅ' => 'â³…', + 'Ⳇ' => 'ⳇ', + 'Ⳉ' => 'ⳉ', + 'Ⳋ' => 'ⳋ', + 'Ⳍ' => 'â³', + 'Ⳏ' => 'â³', + 'â³' => 'ⳑ', + 'â³’' => 'ⳓ', + 'â³”' => 'ⳕ', + 'â³–' => 'â³—', + 'Ⳙ' => 'â³™', + 'Ⳛ' => 'â³›', + 'Ⳝ' => 'â³', + 'Ⳟ' => 'ⳟ', + 'â³ ' => 'ⳡ', + 'â³¢' => 'â³£', + 'Ⳬ' => 'ⳬ', + 'â³­' => 'â³®', + 'â³²' => 'â³³', + 'Ꙁ' => 'ê™', + 'Ꙃ' => 'ꙃ', + 'Ꙅ' => 'ê™…', + 'Ꙇ' => 'ꙇ', + 'Ꙉ' => 'ꙉ', + 'Ꙋ' => 'ꙋ', + 'Ꙍ' => 'ê™', + 'Ꙏ' => 'ê™', + 'ê™' => 'ꙑ', + 'ê™’' => 'ꙓ', + 'ê™”' => 'ꙕ', + 'ê™–' => 'ê™—', + 'Ꙙ' => 'ê™™', + 'Ꙛ' => 'ê™›', + 'Ꙝ' => 'ê™', + 'Ꙟ' => 'ꙟ', + 'ê™ ' => 'ꙡ', + 'Ꙣ' => 'ꙣ', + 'Ꙥ' => 'ꙥ', + 'Ꙧ' => 'ꙧ', + 'Ꙩ' => 'ꙩ', + 'Ꙫ' => 'ꙫ', + 'Ꙭ' => 'ê™­', + 'Ꚁ' => 'êš', + 'êš‚' => 'ꚃ', + 'êš„' => 'êš…', + 'Ꚇ' => 'ꚇ', + 'Ꚉ' => 'ꚉ', + 'Ꚋ' => 'êš‹', + 'Ꚍ' => 'êš', + 'Ꚏ' => 'êš', + 'êš' => 'êš‘', + 'êš’' => 'êš“', + 'êš”' => 'êš•', + 'êš–' => 'êš—', + 'Ꚙ' => 'êš™', + 'êšš' => 'êš›', + 'Ꜣ' => 'ꜣ', + 'Ꜥ' => 'ꜥ', + 'Ꜧ' => 'ꜧ', + 'Ꜩ' => 'ꜩ', + 'Ꜫ' => 'ꜫ', + 'Ꜭ' => 'ꜭ', + 'Ꜯ' => 'ꜯ', + 'Ꜳ' => 'ꜳ', + 'Ꜵ' => 'ꜵ', + 'Ꜷ' => 'ꜷ', + 'Ꜹ' => 'ꜹ', + 'Ꜻ' => 'ꜻ', + 'Ꜽ' => 'ꜽ', + 'Ꜿ' => 'ꜿ', + 'ê€' => 'ê', + 'ê‚' => 'êƒ', + 'ê„' => 'ê…', + 'ê†' => 'ê‡', + 'êˆ' => 'ê‰', + 'êŠ' => 'ê‹', + 'êŒ' => 'ê', + 'êŽ' => 'ê', + 'ê' => 'ê‘', + 'ê’' => 'ê“', + 'ê”' => 'ê•', + 'ê–' => 'ê—', + 'ê˜' => 'ê™', + 'êš' => 'ê›', + 'êœ' => 'ê', + 'êž' => 'êŸ', + 'ê ' => 'ê¡', + 'ê¢' => 'ê£', + 'ê¤' => 'ê¥', + 'ê¦' => 'ê§', + 'ê¨' => 'ê©', + 'êª' => 'ê«', + 'ê¬' => 'ê­', + 'ê®' => 'ê¯', + 'ê¹' => 'êº', + 'ê»' => 'ê¼', + 'ê½' => 'áµ¹', + 'ê¾' => 'ê¿', + 'Ꞁ' => 'êž', + 'êž‚' => 'ꞃ', + 'êž„' => 'êž…', + 'Ꞇ' => 'ꞇ', + 'êž‹' => 'ꞌ', + 'êž' => 'É¥', + 'êž' => 'êž‘', + 'êž’' => 'êž“', + 'êž–' => 'êž—', + 'Ꞙ' => 'êž™', + 'êžš' => 'êž›', + 'êžœ' => 'êž', + 'êžž' => 'ꞟ', + 'êž ' => 'êž¡', + 'Ꞣ' => 'ꞣ', + 'Ꞥ' => 'ꞥ', + 'Ꞧ' => 'ꞧ', + 'Ꞩ' => 'êž©', + 'Ɦ' => 'ɦ', + 'êž«' => 'Éœ', + 'Ɡ' => 'É¡', + 'êž­' => 'ɬ', + 'êž®' => 'ɪ', + 'êž°' => 'Êž', + 'êž±' => 'ʇ', + 'êž²' => 'Ê', + 'êž³' => 'ê­“', + 'êž´' => 'êžµ', + 'Ꞷ' => 'êž·', + 'Ꞹ' => 'êž¹', + 'Ꞻ' => 'êž»', + 'êž¼' => 'êž½', + 'êž¾' => 'êž¿', + 'Ꟃ' => 'ꟃ', + 'Ꞔ' => 'êž”', + 'Ʂ' => 'Ê‚', + 'Ᶎ' => 'ᶎ', + 'Ꟈ' => 'ꟈ', + 'Ꟊ' => 'ꟊ', + 'Ꟶ' => 'ꟶ', + 'A' => 'ï½', + 'ï¼¢' => 'b', + 'ï¼£' => 'c', + 'D' => 'd', + 'ï¼¥' => 'ï½…', + 'F' => 'f', + 'G' => 'g', + 'H' => 'h', + 'I' => 'i', + 'J' => 'j', + 'K' => 'k', + 'L' => 'l', + 'ï¼­' => 'ï½', + 'ï¼®' => 'n', + 'O' => 'ï½', + 'ï¼°' => 'ï½', + 'ï¼±' => 'q', + 'ï¼²' => 'ï½’', + 'ï¼³' => 's', + 'ï¼´' => 'ï½”', + 'ï¼µ' => 'u', + 'V' => 'ï½–', + 'ï¼·' => 'ï½—', + 'X' => 'x', + 'ï¼¹' => 'ï½™', + 'Z' => 'z', + 'ð€' => 'ð¨', + 'ð' => 'ð©', + 'ð‚' => 'ðª', + 'ðƒ' => 'ð«', + 'ð„' => 'ð¬', + 'ð…' => 'ð­', + 'ð†' => 'ð®', + 'ð‡' => 'ð¯', + 'ðˆ' => 'ð°', + 'ð‰' => 'ð±', + 'ðŠ' => 'ð²', + 'ð‹' => 'ð³', + 'ðŒ' => 'ð´', + 'ð' => 'ðµ', + 'ðŽ' => 'ð¶', + 'ð' => 'ð·', + 'ð' => 'ð¸', + 'ð‘' => 'ð¹', + 'ð’' => 'ðº', + 'ð“' => 'ð»', + 'ð”' => 'ð¼', + 'ð•' => 'ð½', + 'ð–' => 'ð¾', + 'ð—' => 'ð¿', + 'ð˜' => 'ð‘€', + 'ð™' => 'ð‘', + 'ðš' => 'ð‘‚', + 'ð›' => 'ð‘ƒ', + 'ðœ' => 'ð‘„', + 'ð' => 'ð‘…', + 'ðž' => 'ð‘†', + 'ðŸ' => 'ð‘‡', + 'ð ' => 'ð‘ˆ', + 'ð¡' => 'ð‘‰', + 'ð¢' => 'ð‘Š', + 'ð£' => 'ð‘‹', + 'ð¤' => 'ð‘Œ', + 'ð¥' => 'ð‘', + 'ð¦' => 'ð‘Ž', + 'ð§' => 'ð‘', + 'ð’°' => 'ð“˜', + 'ð’±' => 'ð“™', + 'ð’²' => 'ð“š', + 'ð’³' => 'ð“›', + 'ð’´' => 'ð“œ', + 'ð’µ' => 'ð“', + 'ð’¶' => 'ð“ž', + 'ð’·' => 'ð“Ÿ', + 'ð’¸' => 'ð“ ', + 'ð’¹' => 'ð“¡', + 'ð’º' => 'ð“¢', + 'ð’»' => 'ð“£', + 'ð’¼' => 'ð“¤', + 'ð’½' => 'ð“¥', + 'ð’¾' => 'ð“¦', + 'ð’¿' => 'ð“§', + 'ð“€' => 'ð“¨', + 'ð“' => 'ð“©', + 'ð“‚' => 'ð“ª', + 'ð“ƒ' => 'ð“«', + 'ð“„' => 'ð“¬', + 'ð“…' => 'ð“­', + 'ð“†' => 'ð“®', + 'ð“‡' => 'ð“¯', + 'ð“ˆ' => 'ð“°', + 'ð“‰' => 'ð“±', + 'ð“Š' => 'ð“²', + 'ð“‹' => 'ð“³', + 'ð“Œ' => 'ð“´', + 'ð“' => 'ð“µ', + 'ð“Ž' => 'ð“¶', + 'ð“' => 'ð“·', + 'ð“' => 'ð“¸', + 'ð“‘' => 'ð“¹', + 'ð“’' => 'ð“º', + 'ð““' => 'ð“»', + 'ð²€' => 'ð³€', + 'ð²' => 'ð³', + 'ð²‚' => 'ð³‚', + 'ð²ƒ' => 'ð³ƒ', + 'ð²„' => 'ð³„', + 'ð²…' => 'ð³…', + 'ð²†' => 'ð³†', + 'ð²‡' => 'ð³‡', + 'ð²ˆ' => 'ð³ˆ', + 'ð²‰' => 'ð³‰', + 'ð²Š' => 'ð³Š', + 'ð²‹' => 'ð³‹', + 'ð²Œ' => 'ð³Œ', + 'ð²' => 'ð³', + 'ð²Ž' => 'ð³Ž', + 'ð²' => 'ð³', + 'ð²' => 'ð³', + 'ð²‘' => 'ð³‘', + 'ð²’' => 'ð³’', + 'ð²“' => 'ð³“', + 'ð²”' => 'ð³”', + 'ð²•' => 'ð³•', + 'ð²–' => 'ð³–', + 'ð²—' => 'ð³—', + 'ð²˜' => 'ð³˜', + 'ð²™' => 'ð³™', + 'ð²š' => 'ð³š', + 'ð²›' => 'ð³›', + 'ð²œ' => 'ð³œ', + 'ð²' => 'ð³', + 'ð²ž' => 'ð³ž', + 'ð²Ÿ' => 'ð³Ÿ', + 'ð² ' => 'ð³ ', + 'ð²¡' => 'ð³¡', + 'ð²¢' => 'ð³¢', + 'ð²£' => 'ð³£', + 'ð²¤' => 'ð³¤', + 'ð²¥' => 'ð³¥', + 'ð²¦' => 'ð³¦', + 'ð²§' => 'ð³§', + 'ð²¨' => 'ð³¨', + 'ð²©' => 'ð³©', + 'ð²ª' => 'ð³ª', + 'ð²«' => 'ð³«', + 'ð²¬' => 'ð³¬', + 'ð²­' => 'ð³­', + 'ð²®' => 'ð³®', + 'ð²¯' => 'ð³¯', + 'ð²°' => 'ð³°', + 'ð²±' => 'ð³±', + 'ð²²' => 'ð³²', + 'ð‘¢ ' => 'ð‘£€', + '𑢡' => 'ð‘£', + 'ð‘¢¢' => '𑣂', + 'ð‘¢£' => '𑣃', + '𑢤' => '𑣄', + 'ð‘¢¥' => 'ð‘£…', + '𑢦' => '𑣆', + '𑢧' => '𑣇', + '𑢨' => '𑣈', + '𑢩' => '𑣉', + '𑢪' => '𑣊', + '𑢫' => '𑣋', + '𑢬' => '𑣌', + 'ð‘¢­' => 'ð‘£', + 'ð‘¢®' => '𑣎', + '𑢯' => 'ð‘£', + 'ð‘¢°' => 'ð‘£', + 'ð‘¢±' => '𑣑', + 'ð‘¢²' => 'ð‘£’', + 'ð‘¢³' => '𑣓', + 'ð‘¢´' => 'ð‘£”', + 'ð‘¢µ' => '𑣕', + '𑢶' => 'ð‘£–', + 'ð‘¢·' => 'ð‘£—', + '𑢸' => '𑣘', + 'ð‘¢¹' => 'ð‘£™', + '𑢺' => '𑣚', + 'ð‘¢»' => 'ð‘£›', + 'ð‘¢¼' => '𑣜', + 'ð‘¢½' => 'ð‘£', + 'ð‘¢¾' => '𑣞', + '𑢿' => '𑣟', + 'ð–¹€' => 'ð–¹ ', + 'ð–¹' => '𖹡', + '𖹂' => 'ð–¹¢', + '𖹃' => 'ð–¹£', + '𖹄' => '𖹤', + 'ð–¹…' => 'ð–¹¥', + '𖹆' => '𖹦', + '𖹇' => '𖹧', + '𖹈' => '𖹨', + '𖹉' => '𖹩', + '𖹊' => '𖹪', + '𖹋' => '𖹫', + '𖹌' => '𖹬', + 'ð–¹' => 'ð–¹­', + '𖹎' => 'ð–¹®', + 'ð–¹' => '𖹯', + 'ð–¹' => 'ð–¹°', + '𖹑' => 'ð–¹±', + 'ð–¹’' => 'ð–¹²', + '𖹓' => 'ð–¹³', + 'ð–¹”' => 'ð–¹´', + '𖹕' => 'ð–¹µ', + 'ð–¹–' => '𖹶', + 'ð–¹—' => 'ð–¹·', + '𖹘' => '𖹸', + 'ð–¹™' => 'ð–¹¹', + '𖹚' => '𖹺', + 'ð–¹›' => 'ð–¹»', + '𖹜' => 'ð–¹¼', + 'ð–¹' => 'ð–¹½', + '𖹞' => 'ð–¹¾', + '𖹟' => '𖹿', + '𞤀' => '𞤢', + 'ðž¤' => '𞤣', + '𞤂' => '𞤤', + '𞤃' => '𞤥', + '𞤄' => '𞤦', + '𞤅' => '𞤧', + '𞤆' => '𞤨', + '𞤇' => '𞤩', + '𞤈' => '𞤪', + '𞤉' => '𞤫', + '𞤊' => '𞤬', + '𞤋' => '𞤭', + '𞤌' => '𞤮', + 'ðž¤' => '𞤯', + '𞤎' => '𞤰', + 'ðž¤' => '𞤱', + 'ðž¤' => '𞤲', + '𞤑' => '𞤳', + '𞤒' => '𞤴', + '𞤓' => '𞤵', + '𞤔' => '𞤶', + '𞤕' => '𞤷', + '𞤖' => '𞤸', + '𞤗' => '𞤹', + '𞤘' => '𞤺', + '𞤙' => '𞤻', + '𞤚' => '𞤼', + '𞤛' => '𞤽', + '𞤜' => '𞤾', + 'ðž¤' => '𞤿', + '𞤞' => '𞥀', + '𞤟' => 'ðž¥', + '𞤠' => '𞥂', + '𞤡' => '𞥃', +); diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php new file mode 100644 index 000000000..2a8f6e73b --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php @@ -0,0 +1,5 @@ + 'A', + 'b' => 'B', + 'c' => 'C', + 'd' => 'D', + 'e' => 'E', + 'f' => 'F', + 'g' => 'G', + 'h' => 'H', + 'i' => 'I', + 'j' => 'J', + 'k' => 'K', + 'l' => 'L', + 'm' => 'M', + 'n' => 'N', + 'o' => 'O', + 'p' => 'P', + 'q' => 'Q', + 'r' => 'R', + 's' => 'S', + 't' => 'T', + 'u' => 'U', + 'v' => 'V', + 'w' => 'W', + 'x' => 'X', + 'y' => 'Y', + 'z' => 'Z', + 'µ' => 'Îœ', + 'à' => 'À', + 'á' => 'Ã', + 'â' => 'Â', + 'ã' => 'Ã', + 'ä' => 'Ä', + 'Ã¥' => 'Ã…', + 'æ' => 'Æ', + 'ç' => 'Ç', + 'è' => 'È', + 'é' => 'É', + 'ê' => 'Ê', + 'ë' => 'Ë', + 'ì' => 'ÃŒ', + 'í' => 'Ã', + 'î' => 'ÃŽ', + 'ï' => 'Ã', + 'ð' => 'Ã', + 'ñ' => 'Ñ', + 'ò' => 'Ã’', + 'ó' => 'Ó', + 'ô' => 'Ô', + 'õ' => 'Õ', + 'ö' => 'Ö', + 'ø' => 'Ø', + 'ù' => 'Ù', + 'ú' => 'Ú', + 'û' => 'Û', + 'ü' => 'Ãœ', + 'ý' => 'Ã', + 'þ' => 'Þ', + 'ÿ' => 'Ÿ', + 'Ä' => 'Ä€', + 'ă' => 'Ä‚', + 'Ä…' => 'Ä„', + 'ć' => 'Ć', + 'ĉ' => 'Ĉ', + 'Ä‹' => 'ÄŠ', + 'Ä' => 'ÄŒ', + 'Ä' => 'ÄŽ', + 'Ä‘' => 'Ä', + 'Ä“' => 'Ä’', + 'Ä•' => 'Ä”', + 'Ä—' => 'Ä–', + 'Ä™' => 'Ę', + 'Ä›' => 'Äš', + 'Ä' => 'Äœ', + 'ÄŸ' => 'Äž', + 'Ä¡' => 'Ä ', + 'Ä£' => 'Ä¢', + 'Ä¥' => 'Ĥ', + 'ħ' => 'Ħ', + 'Ä©' => 'Ĩ', + 'Ä«' => 'Ī', + 'Ä­' => 'Ĭ', + 'į' => 'Ä®', + 'ı' => 'I', + 'ij' => 'IJ', + 'ĵ' => 'Ä´', + 'Ä·' => 'Ķ', + 'ĺ' => 'Ĺ', + 'ļ' => 'Ä»', + 'ľ' => 'Ľ', + 'Å€' => 'Ä¿', + 'Å‚' => 'Å', + 'Å„' => 'Ń', + 'ņ' => 'Å…', + 'ň' => 'Ň', + 'Å‹' => 'ÅŠ', + 'Å' => 'ÅŒ', + 'Å' => 'ÅŽ', + 'Å‘' => 'Å', + 'Å“' => 'Å’', + 'Å•' => 'Å”', + 'Å—' => 'Å–', + 'Å™' => 'Ř', + 'Å›' => 'Åš', + 'Å' => 'Åœ', + 'ÅŸ' => 'Åž', + 'Å¡' => 'Å ', + 'Å£' => 'Å¢', + 'Å¥' => 'Ť', + 'ŧ' => 'Ŧ', + 'Å©' => 'Ũ', + 'Å«' => 'Ū', + 'Å­' => 'Ŭ', + 'ů' => 'Å®', + 'ű' => 'Å°', + 'ų' => 'Ų', + 'ŵ' => 'Å´', + 'Å·' => 'Ŷ', + 'ź' => 'Ź', + 'ż' => 'Å»', + 'ž' => 'Ž', + 'Å¿' => 'S', + 'Æ€' => 'Ƀ', + 'ƃ' => 'Æ‚', + 'Æ…' => 'Æ„', + 'ƈ' => 'Ƈ', + 'ÆŒ' => 'Æ‹', + 'Æ’' => 'Æ‘', + 'Æ•' => 'Ƕ', + 'Æ™' => 'Ƙ', + 'Æš' => 'Ƚ', + 'Æž' => 'È ', + 'Æ¡' => 'Æ ', + 'Æ£' => 'Æ¢', + 'Æ¥' => 'Ƥ', + 'ƨ' => 'Ƨ', + 'Æ­' => 'Ƭ', + 'Æ°' => 'Ư', + 'Æ´' => 'Ƴ', + 'ƶ' => 'Ƶ', + 'ƹ' => 'Ƹ', + 'ƽ' => 'Ƽ', + 'Æ¿' => 'Ç·', + 'Ç…' => 'Ç„', + 'dž' => 'Ç„', + 'Lj' => 'LJ', + 'lj' => 'LJ', + 'Ç‹' => 'ÇŠ', + 'ÇŒ' => 'ÇŠ', + 'ÇŽ' => 'Ç', + 'Ç' => 'Ç', + 'Ç’' => 'Ç‘', + 'Ç”' => 'Ç“', + 'Ç–' => 'Ç•', + 'ǘ' => 'Ç—', + 'Çš' => 'Ç™', + 'Çœ' => 'Ç›', + 'Ç' => 'ÆŽ', + 'ÇŸ' => 'Çž', + 'Ç¡' => 'Ç ', + 'Ç£' => 'Ç¢', + 'Ç¥' => 'Ǥ', + 'ǧ' => 'Ǧ', + 'Ç©' => 'Ǩ', + 'Ç«' => 'Ǫ', + 'Ç­' => 'Ǭ', + 'ǯ' => 'Ç®', + 'Dz' => 'DZ', + 'dz' => 'DZ', + 'ǵ' => 'Ç´', + 'ǹ' => 'Ǹ', + 'Ç»' => 'Ǻ', + 'ǽ' => 'Ǽ', + 'Ç¿' => 'Ǿ', + 'È' => 'È€', + 'ȃ' => 'È‚', + 'È…' => 'È„', + 'ȇ' => 'Ȇ', + 'ȉ' => 'Ȉ', + 'È‹' => 'ÈŠ', + 'È' => 'ÈŒ', + 'È' => 'ÈŽ', + 'È‘' => 'È', + 'È“' => 'È’', + 'È•' => 'È”', + 'È—' => 'È–', + 'È™' => 'Ș', + 'È›' => 'Èš', + 'È' => 'Èœ', + 'ÈŸ' => 'Èž', + 'È£' => 'È¢', + 'È¥' => 'Ȥ', + 'ȧ' => 'Ȧ', + 'È©' => 'Ȩ', + 'È«' => 'Ȫ', + 'È­' => 'Ȭ', + 'ȯ' => 'È®', + 'ȱ' => 'È°', + 'ȳ' => 'Ȳ', + 'ȼ' => 'È»', + 'È¿' => 'â±¾', + 'É€' => 'Ɀ', + 'É‚' => 'É', + 'ɇ' => 'Ɇ', + 'ɉ' => 'Ɉ', + 'É‹' => 'ÉŠ', + 'É' => 'ÉŒ', + 'É' => 'ÉŽ', + 'É' => 'Ɐ', + 'É‘' => 'â±­', + 'É’' => 'â±°', + 'É“' => 'Æ', + 'É”' => 'Ɔ', + 'É–' => 'Ɖ', + 'É—' => 'ÆŠ', + 'É™' => 'Æ', + 'É›' => 'Æ', + 'Éœ' => 'êž«', + 'É ' => 'Æ“', + 'É¡' => 'Ɡ', + 'É£' => 'Æ”', + 'É¥' => 'êž', + 'ɦ' => 'Ɦ', + 'ɨ' => 'Æ—', + 'É©' => 'Æ–', + 'ɪ' => 'êž®', + 'É«' => 'â±¢', + 'ɬ' => 'êž­', + 'ɯ' => 'Æœ', + 'ɱ' => 'â±®', + 'ɲ' => 'Æ', + 'ɵ' => 'ÆŸ', + 'ɽ' => 'Ɽ', + 'Ê€' => 'Ʀ', + 'Ê‚' => 'Ʂ', + 'ʃ' => 'Æ©', + 'ʇ' => 'êž±', + 'ʈ' => 'Æ®', + 'ʉ' => 'É„', + 'ÊŠ' => 'Ʊ', + 'Ê‹' => 'Ʋ', + 'ÊŒ' => 'É…', + 'Ê’' => 'Æ·', + 'Ê' => 'êž²', + 'Êž' => 'êž°', + 'Í…' => 'Ι', + 'ͱ' => 'Í°', + 'ͳ' => 'Ͳ', + 'Í·' => 'Ͷ', + 'Í»' => 'Ͻ', + 'ͼ' => 'Ͼ', + 'ͽ' => 'Ï¿', + 'ά' => 'Ά', + 'έ' => 'Έ', + 'ή' => 'Ή', + 'ί' => 'Ί', + 'α' => 'Α', + 'β' => 'Î’', + 'γ' => 'Γ', + 'δ' => 'Δ', + 'ε' => 'Ε', + 'ζ' => 'Ζ', + 'η' => 'Η', + 'θ' => 'Θ', + 'ι' => 'Ι', + 'κ' => 'Κ', + 'λ' => 'Λ', + 'μ' => 'Îœ', + 'ν' => 'Î', + 'ξ' => 'Ξ', + 'ο' => 'Ο', + 'Ï€' => 'Π', + 'Ï' => 'Ρ', + 'Ï‚' => 'Σ', + 'σ' => 'Σ', + 'Ï„' => 'Τ', + 'Ï…' => 'Î¥', + 'φ' => 'Φ', + 'χ' => 'Χ', + 'ψ' => 'Ψ', + 'ω' => 'Ω', + 'ÏŠ' => 'Ϊ', + 'Ï‹' => 'Ϋ', + 'ÏŒ' => 'ÎŒ', + 'Ï' => 'ÎŽ', + 'ÏŽ' => 'Î', + 'Ï' => 'Î’', + 'Ï‘' => 'Θ', + 'Ï•' => 'Φ', + 'Ï–' => 'Π', + 'Ï—' => 'Ï', + 'Ï™' => 'Ϙ', + 'Ï›' => 'Ïš', + 'Ï' => 'Ïœ', + 'ÏŸ' => 'Ïž', + 'Ï¡' => 'Ï ', + 'Ï£' => 'Ï¢', + 'Ï¥' => 'Ϥ', + 'ϧ' => 'Ϧ', + 'Ï©' => 'Ϩ', + 'Ï«' => 'Ϫ', + 'Ï­' => 'Ϭ', + 'ϯ' => 'Ï®', + 'Ï°' => 'Κ', + 'ϱ' => 'Ρ', + 'ϲ' => 'Ϲ', + 'ϳ' => 'Í¿', + 'ϵ' => 'Ε', + 'ϸ' => 'Ï·', + 'Ï»' => 'Ϻ', + 'а' => 'Ð', + 'б' => 'Б', + 'в' => 'Ð’', + 'г' => 'Г', + 'д' => 'Д', + 'е' => 'Е', + 'ж' => 'Ж', + 'з' => 'З', + 'и' => 'И', + 'й' => 'Й', + 'к' => 'К', + 'л' => 'Л', + 'м' => 'Ðœ', + 'н' => 'Ð', + 'о' => 'О', + 'п' => 'П', + 'Ñ€' => 'Р', + 'Ñ' => 'С', + 'Ñ‚' => 'Т', + 'у' => 'У', + 'Ñ„' => 'Ф', + 'Ñ…' => 'Ð¥', + 'ц' => 'Ц', + 'ч' => 'Ч', + 'ш' => 'Ш', + 'щ' => 'Щ', + 'ÑŠ' => 'Ъ', + 'Ñ‹' => 'Ы', + 'ÑŒ' => 'Ь', + 'Ñ' => 'Э', + 'ÑŽ' => 'Ю', + 'Ñ' => 'Я', + 'Ñ' => 'Ѐ', + 'Ñ‘' => 'Ð', + 'Ñ’' => 'Ђ', + 'Ñ“' => 'Ѓ', + 'Ñ”' => 'Є', + 'Ñ•' => 'Ð…', + 'Ñ–' => 'І', + 'Ñ—' => 'Ї', + 'ј' => 'Ј', + 'Ñ™' => 'Љ', + 'Ñš' => 'Њ', + 'Ñ›' => 'Ћ', + 'Ñœ' => 'ÐŒ', + 'Ñ' => 'Ð', + 'Ñž' => 'ÐŽ', + 'ÑŸ' => 'Ð', + 'Ñ¡' => 'Ñ ', + 'Ñ£' => 'Ñ¢', + 'Ñ¥' => 'Ѥ', + 'ѧ' => 'Ѧ', + 'Ñ©' => 'Ѩ', + 'Ñ«' => 'Ѫ', + 'Ñ­' => 'Ѭ', + 'ѯ' => 'Ñ®', + 'ѱ' => 'Ñ°', + 'ѳ' => 'Ѳ', + 'ѵ' => 'Ñ´', + 'Ñ·' => 'Ѷ', + 'ѹ' => 'Ѹ', + 'Ñ»' => 'Ѻ', + 'ѽ' => 'Ѽ', + 'Ñ¿' => 'Ѿ', + 'Ò' => 'Ò€', + 'Ò‹' => 'ÒŠ', + 'Ò' => 'ÒŒ', + 'Ò' => 'ÒŽ', + 'Ò‘' => 'Ò', + 'Ò“' => 'Ò’', + 'Ò•' => 'Ò”', + 'Ò—' => 'Ò–', + 'Ò™' => 'Ò˜', + 'Ò›' => 'Òš', + 'Ò' => 'Òœ', + 'ÒŸ' => 'Òž', + 'Ò¡' => 'Ò ', + 'Ò£' => 'Ò¢', + 'Ò¥' => 'Ò¤', + 'Ò§' => 'Ò¦', + 'Ò©' => 'Ò¨', + 'Ò«' => 'Òª', + 'Ò­' => 'Ò¬', + 'Ò¯' => 'Ò®', + 'Ò±' => 'Ò°', + 'Ò³' => 'Ò²', + 'Òµ' => 'Ò´', + 'Ò·' => 'Ò¶', + 'Ò¹' => 'Ò¸', + 'Ò»' => 'Òº', + 'Ò½' => 'Ò¼', + 'Ò¿' => 'Ò¾', + 'Ó‚' => 'Ó', + 'Ó„' => 'Óƒ', + 'Ó†' => 'Ó…', + 'Óˆ' => 'Ó‡', + 'ÓŠ' => 'Ó‰', + 'ÓŒ' => 'Ó‹', + 'ÓŽ' => 'Ó', + 'Ó' => 'Ó€', + 'Ó‘' => 'Ó', + 'Ó“' => 'Ó’', + 'Ó•' => 'Ó”', + 'Ó—' => 'Ó–', + 'Ó™' => 'Ó˜', + 'Ó›' => 'Óš', + 'Ó' => 'Óœ', + 'ÓŸ' => 'Óž', + 'Ó¡' => 'Ó ', + 'Ó£' => 'Ó¢', + 'Ó¥' => 'Ó¤', + 'Ó§' => 'Ó¦', + 'Ó©' => 'Ó¨', + 'Ó«' => 'Óª', + 'Ó­' => 'Ó¬', + 'Ó¯' => 'Ó®', + 'Ó±' => 'Ó°', + 'Ó³' => 'Ó²', + 'Óµ' => 'Ó´', + 'Ó·' => 'Ó¶', + 'Ó¹' => 'Ó¸', + 'Ó»' => 'Óº', + 'Ó½' => 'Ó¼', + 'Ó¿' => 'Ó¾', + 'Ô' => 'Ô€', + 'Ôƒ' => 'Ô‚', + 'Ô…' => 'Ô„', + 'Ô‡' => 'Ô†', + 'Ô‰' => 'Ôˆ', + 'Ô‹' => 'ÔŠ', + 'Ô' => 'ÔŒ', + 'Ô' => 'ÔŽ', + 'Ô‘' => 'Ô', + 'Ô“' => 'Ô’', + 'Ô•' => 'Ô”', + 'Ô—' => 'Ô–', + 'Ô™' => 'Ô˜', + 'Ô›' => 'Ôš', + 'Ô' => 'Ôœ', + 'ÔŸ' => 'Ôž', + 'Ô¡' => 'Ô ', + 'Ô£' => 'Ô¢', + 'Ô¥' => 'Ô¤', + 'Ô§' => 'Ô¦', + 'Ô©' => 'Ô¨', + 'Ô«' => 'Ôª', + 'Ô­' => 'Ô¬', + 'Ô¯' => 'Ô®', + 'Õ¡' => 'Ô±', + 'Õ¢' => 'Ô²', + 'Õ£' => 'Ô³', + 'Õ¤' => 'Ô´', + 'Õ¥' => 'Ôµ', + 'Õ¦' => 'Ô¶', + 'Õ§' => 'Ô·', + 'Õ¨' => 'Ô¸', + 'Õ©' => 'Ô¹', + 'Õª' => 'Ôº', + 'Õ«' => 'Ô»', + 'Õ¬' => 'Ô¼', + 'Õ­' => 'Ô½', + 'Õ®' => 'Ô¾', + 'Õ¯' => 'Ô¿', + 'Õ°' => 'Õ€', + 'Õ±' => 'Õ', + 'Õ²' => 'Õ‚', + 'Õ³' => 'Õƒ', + 'Õ´' => 'Õ„', + 'Õµ' => 'Õ…', + 'Õ¶' => 'Õ†', + 'Õ·' => 'Õ‡', + 'Õ¸' => 'Õˆ', + 'Õ¹' => 'Õ‰', + 'Õº' => 'ÕŠ', + 'Õ»' => 'Õ‹', + 'Õ¼' => 'ÕŒ', + 'Õ½' => 'Õ', + 'Õ¾' => 'ÕŽ', + 'Õ¿' => 'Õ', + 'Ö€' => 'Õ', + 'Ö' => 'Õ‘', + 'Ö‚' => 'Õ’', + 'Öƒ' => 'Õ“', + 'Ö„' => 'Õ”', + 'Ö…' => 'Õ•', + 'Ö†' => 'Õ–', + 'áƒ' => 'á²', + 'ბ' => 'Ბ', + 'გ' => 'á²’', + 'დ' => 'Დ', + 'ე' => 'á²”', + 'ვ' => 'Ვ', + 'ზ' => 'á²–', + 'თ' => 'á²—', + 'ი' => 'Ი', + 'კ' => 'á²™', + 'ლ' => 'Ლ', + 'მ' => 'á²›', + 'ნ' => 'Ნ', + 'áƒ' => 'á²', + 'პ' => 'Პ', + 'ჟ' => 'Ჟ', + 'რ' => 'á² ', + 'ს' => 'Ს', + 'ტ' => 'á²¢', + 'უ' => 'á²£', + 'ფ' => 'Ფ', + 'ქ' => 'á²¥', + 'ღ' => 'Ღ', + 'ყ' => 'Ყ', + 'შ' => 'Შ', + 'ჩ' => 'Ჩ', + 'ც' => 'Ც', + 'ძ' => 'Ძ', + 'წ' => 'Წ', + 'ჭ' => 'á²­', + 'ხ' => 'á²®', + 'ჯ' => 'Ჯ', + 'ჰ' => 'á²°', + 'ჱ' => 'á²±', + 'ჲ' => 'á²²', + 'ჳ' => 'á²³', + 'ჴ' => 'á²´', + 'ჵ' => 'á²µ', + 'ჶ' => 'Ჶ', + 'ჷ' => 'á²·', + 'ჸ' => 'Ჸ', + 'ჹ' => 'á²¹', + 'ჺ' => 'Ჺ', + 'ჽ' => 'á²½', + 'ჾ' => 'á²¾', + 'ჿ' => 'Ჿ', + 'á¸' => 'á°', + 'á¹' => 'á±', + 'áº' => 'á²', + 'á»' => 'á³', + 'á¼' => 'á´', + 'á½' => 'áµ', + 'á²€' => 'Ð’', + 'á²' => 'Д', + 'ᲂ' => 'О', + 'ᲃ' => 'С', + 'ᲄ' => 'Т', + 'á²…' => 'Т', + 'ᲆ' => 'Ъ', + 'ᲇ' => 'Ñ¢', + 'ᲈ' => 'Ꙋ', + 'áµ¹' => 'ê½', + 'áµ½' => 'â±£', + 'ᶎ' => 'Ᶎ', + 'á¸' => 'Ḁ', + 'ḃ' => 'Ḃ', + 'ḅ' => 'Ḅ', + 'ḇ' => 'Ḇ', + 'ḉ' => 'Ḉ', + 'ḋ' => 'Ḋ', + 'á¸' => 'Ḍ', + 'á¸' => 'Ḏ', + 'ḑ' => 'á¸', + 'ḓ' => 'Ḓ', + 'ḕ' => 'Ḕ', + 'ḗ' => 'Ḗ', + 'ḙ' => 'Ḙ', + 'ḛ' => 'Ḛ', + 'á¸' => 'Ḝ', + 'ḟ' => 'Ḟ', + 'ḡ' => 'Ḡ', + 'ḣ' => 'Ḣ', + 'ḥ' => 'Ḥ', + 'ḧ' => 'Ḧ', + 'ḩ' => 'Ḩ', + 'ḫ' => 'Ḫ', + 'ḭ' => 'Ḭ', + 'ḯ' => 'Ḯ', + 'ḱ' => 'Ḱ', + 'ḳ' => 'Ḳ', + 'ḵ' => 'Ḵ', + 'ḷ' => 'Ḷ', + 'ḹ' => 'Ḹ', + 'ḻ' => 'Ḻ', + 'ḽ' => 'Ḽ', + 'ḿ' => 'Ḿ', + 'á¹' => 'á¹€', + 'ṃ' => 'Ṃ', + 'á¹…' => 'Ṅ', + 'ṇ' => 'Ṇ', + 'ṉ' => 'Ṉ', + 'ṋ' => 'Ṋ', + 'á¹' => 'Ṍ', + 'á¹' => 'Ṏ', + 'ṑ' => 'á¹', + 'ṓ' => 'á¹’', + 'ṕ' => 'á¹”', + 'á¹—' => 'á¹–', + 'á¹™' => 'Ṙ', + 'á¹›' => 'Ṛ', + 'á¹' => 'Ṝ', + 'ṟ' => 'Ṟ', + 'ṡ' => 'á¹ ', + 'á¹£' => 'á¹¢', + 'á¹¥' => 'Ṥ', + 'ṧ' => 'Ṧ', + 'ṩ' => 'Ṩ', + 'ṫ' => 'Ṫ', + 'á¹­' => 'Ṭ', + 'ṯ' => 'á¹®', + 'á¹±' => 'á¹°', + 'á¹³' => 'á¹²', + 'á¹µ' => 'á¹´', + 'á¹·' => 'Ṷ', + 'á¹¹' => 'Ṹ', + 'á¹»' => 'Ṻ', + 'á¹½' => 'á¹¼', + 'ṿ' => 'á¹¾', + 'áº' => 'Ẁ', + 'ẃ' => 'Ẃ', + 'ẅ' => 'Ẅ', + 'ẇ' => 'Ẇ', + 'ẉ' => 'Ẉ', + 'ẋ' => 'Ẋ', + 'áº' => 'Ẍ', + 'áº' => 'Ẏ', + 'ẑ' => 'áº', + 'ẓ' => 'Ẓ', + 'ẕ' => 'Ẕ', + 'ẛ' => 'á¹ ', + 'ạ' => 'Ạ', + 'ả' => 'Ả', + 'ấ' => 'Ấ', + 'ầ' => 'Ầ', + 'ẩ' => 'Ẩ', + 'ẫ' => 'Ẫ', + 'ậ' => 'Ậ', + 'ắ' => 'Ắ', + 'ằ' => 'Ằ', + 'ẳ' => 'Ẳ', + 'ẵ' => 'Ẵ', + 'ặ' => 'Ặ', + 'ẹ' => 'Ẹ', + 'ẻ' => 'Ẻ', + 'ẽ' => 'Ẽ', + 'ế' => 'Ế', + 'á»' => 'Ề', + 'ể' => 'Ể', + 'á»…' => 'Ễ', + 'ệ' => 'Ệ', + 'ỉ' => 'Ỉ', + 'ị' => 'Ị', + 'á»' => 'Ọ', + 'á»' => 'Ỏ', + 'ố' => 'á»', + 'ồ' => 'á»’', + 'ổ' => 'á»”', + 'á»—' => 'á»–', + 'á»™' => 'Ộ', + 'á»›' => 'Ớ', + 'á»' => 'Ờ', + 'ở' => 'Ở', + 'ỡ' => 'á» ', + 'ợ' => 'Ợ', + 'ụ' => 'Ụ', + 'ủ' => 'Ủ', + 'ứ' => 'Ứ', + 'ừ' => 'Ừ', + 'á»­' => 'Ử', + 'ữ' => 'á»®', + 'á»±' => 'á»°', + 'ỳ' => 'Ỳ', + 'ỵ' => 'á»´', + 'á»·' => 'Ỷ', + 'ỹ' => 'Ỹ', + 'á»»' => 'Ỻ', + 'ỽ' => 'Ỽ', + 'ỿ' => 'Ỿ', + 'á¼€' => 'Ἀ', + 'á¼' => 'Ἁ', + 'ἂ' => 'Ἂ', + 'ἃ' => 'Ἃ', + 'ἄ' => 'Ἄ', + 'á¼…' => 'á¼', + 'ἆ' => 'Ἆ', + 'ἇ' => 'á¼', + 'á¼' => 'Ἐ', + 'ἑ' => 'á¼™', + 'á¼’' => 'Ἒ', + 'ἓ' => 'á¼›', + 'á¼”' => 'Ἔ', + 'ἕ' => 'á¼', + 'á¼ ' => 'Ἠ', + 'ἡ' => 'Ἡ', + 'á¼¢' => 'Ἢ', + 'á¼£' => 'Ἣ', + 'ἤ' => 'Ἤ', + 'á¼¥' => 'á¼­', + 'ἦ' => 'á¼®', + 'ἧ' => 'Ἧ', + 'á¼°' => 'Ἰ', + 'á¼±' => 'á¼¹', + 'á¼²' => 'Ἲ', + 'á¼³' => 'á¼»', + 'á¼´' => 'á¼¼', + 'á¼µ' => 'á¼½', + 'ἶ' => 'á¼¾', + 'á¼·' => 'Ἷ', + 'á½€' => 'Ὀ', + 'á½' => 'Ὁ', + 'ὂ' => 'Ὂ', + 'ὃ' => 'Ὃ', + 'ὄ' => 'Ὄ', + 'á½…' => 'á½', + 'ὑ' => 'á½™', + 'ὓ' => 'á½›', + 'ὕ' => 'á½', + 'á½—' => 'Ὗ', + 'á½ ' => 'Ὠ', + 'ὡ' => 'Ὡ', + 'á½¢' => 'Ὢ', + 'á½£' => 'Ὣ', + 'ὤ' => 'Ὤ', + 'á½¥' => 'á½­', + 'ὦ' => 'á½®', + 'ὧ' => 'Ὧ', + 'á½°' => 'Ὰ', + 'á½±' => 'á¾»', + 'á½²' => 'Ὲ', + 'á½³' => 'Έ', + 'á½´' => 'á¿Š', + 'á½µ' => 'á¿‹', + 'ὶ' => 'á¿š', + 'á½·' => 'á¿›', + 'ὸ' => 'Ὸ', + 'á½¹' => 'Ό', + 'ὺ' => 'Ὺ', + 'á½»' => 'á¿«', + 'á½¼' => 'Ὼ', + 'á½½' => 'á¿»', + 'á¾€' => 'ἈΙ', + 'á¾' => 'ἉΙ', + 'ᾂ' => 'ἊΙ', + 'ᾃ' => 'ἋΙ', + 'ᾄ' => 'ἌΙ', + 'á¾…' => 'á¼Î™', + 'ᾆ' => 'ἎΙ', + 'ᾇ' => 'á¼Î™', + 'á¾' => 'ἨΙ', + 'ᾑ' => 'ἩΙ', + 'á¾’' => 'ἪΙ', + 'ᾓ' => 'ἫΙ', + 'á¾”' => 'ἬΙ', + 'ᾕ' => 'ἭΙ', + 'á¾–' => 'ἮΙ', + 'á¾—' => 'ἯΙ', + 'á¾ ' => 'ὨΙ', + 'ᾡ' => 'ὩΙ', + 'á¾¢' => 'ὪΙ', + 'á¾£' => 'ὫΙ', + 'ᾤ' => 'ὬΙ', + 'á¾¥' => 'ὭΙ', + 'ᾦ' => 'ὮΙ', + 'ᾧ' => 'ὯΙ', + 'á¾°' => 'Ᾰ', + 'á¾±' => 'á¾¹', + 'á¾³' => 'ΑΙ', + 'á¾¾' => 'Ι', + 'ῃ' => 'ΗΙ', + 'á¿' => 'Ῐ', + 'á¿‘' => 'á¿™', + 'á¿ ' => 'Ῠ', + 'á¿¡' => 'á¿©', + 'á¿¥' => 'Ῥ', + 'ῳ' => 'ΩΙ', + 'â…Ž' => 'Ⅎ', + 'â…°' => 'â… ', + 'â…±' => 'â…¡', + 'â…²' => 'â…¢', + 'â…³' => 'â…£', + 'â…´' => 'â…¤', + 'â…µ' => 'â…¥', + 'â…¶' => 'â…¦', + 'â…·' => 'â…§', + 'â…¸' => 'â…¨', + 'â…¹' => 'â…©', + 'â…º' => 'â…ª', + 'â…»' => 'â…«', + 'â…¼' => 'â…¬', + 'â…½' => 'â…­', + 'â…¾' => 'â…®', + 'â…¿' => 'â…¯', + 'ↄ' => 'Ↄ', + 'â“' => 'â’¶', + 'â“‘' => 'â’·', + 'â“’' => 'â’¸', + 'â““' => 'â’¹', + 'â“”' => 'â’º', + 'â“•' => 'â’»', + 'â“–' => 'â’¼', + 'â“—' => 'â’½', + 'ⓘ' => 'â’¾', + 'â“™' => 'â’¿', + 'â“š' => 'â“€', + 'â“›' => 'â“', + 'â“œ' => 'â“‚', + 'â“' => 'Ⓝ', + 'â“ž' => 'â“„', + 'â“Ÿ' => 'â“…', + 'â“ ' => 'Ⓠ', + 'â“¡' => 'Ⓡ', + 'â“¢' => 'Ⓢ', + 'â“£' => 'Ⓣ', + 'ⓤ' => 'â“Š', + 'â“¥' => 'â“‹', + 'ⓦ' => 'â“Œ', + 'ⓧ' => 'â“', + 'ⓨ' => 'â“Ž', + 'â“©' => 'â“', + 'â°°' => 'â°€', + 'â°±' => 'â°', + 'â°²' => 'â°‚', + 'â°³' => 'â°ƒ', + 'â°´' => 'â°„', + 'â°µ' => 'â°…', + 'â°¶' => 'â°†', + 'â°·' => 'â°‡', + 'â°¸' => 'â°ˆ', + 'â°¹' => 'â°‰', + 'â°º' => 'â°Š', + 'â°»' => 'â°‹', + 'â°¼' => 'â°Œ', + 'â°½' => 'â°', + 'â°¾' => 'â°Ž', + 'â°¿' => 'â°', + 'â±€' => 'â°', + 'â±' => 'â°‘', + 'ⱂ' => 'â°’', + 'ⱃ' => 'â°“', + 'ⱄ' => 'â°”', + 'â±…' => 'â°•', + 'ⱆ' => 'â°–', + 'ⱇ' => 'â°—', + 'ⱈ' => 'â°˜', + 'ⱉ' => 'â°™', + 'ⱊ' => 'â°š', + 'ⱋ' => 'â°›', + 'ⱌ' => 'â°œ', + 'â±' => 'â°', + 'ⱎ' => 'â°ž', + 'â±' => 'â°Ÿ', + 'â±' => 'â° ', + 'ⱑ' => 'â°¡', + 'â±’' => 'â°¢', + 'ⱓ' => 'â°£', + 'â±”' => 'â°¤', + 'ⱕ' => 'â°¥', + 'â±–' => 'â°¦', + 'â±—' => 'â°§', + 'ⱘ' => 'â°¨', + 'â±™' => 'â°©', + 'ⱚ' => 'â°ª', + 'â±›' => 'â°«', + 'ⱜ' => 'â°¬', + 'â±' => 'â°­', + 'ⱞ' => 'â°®', + 'ⱡ' => 'â± ', + 'â±¥' => 'Ⱥ', + 'ⱦ' => 'Ⱦ', + 'ⱨ' => 'Ⱨ', + 'ⱪ' => 'Ⱪ', + 'ⱬ' => 'Ⱬ', + 'â±³' => 'â±²', + 'ⱶ' => 'â±µ', + 'â²' => 'â²€', + 'ⲃ' => 'Ⲃ', + 'â²…' => 'Ⲅ', + 'ⲇ' => 'Ⲇ', + 'ⲉ' => 'Ⲉ', + 'ⲋ' => 'Ⲋ', + 'â²' => 'Ⲍ', + 'â²' => 'Ⲏ', + 'ⲑ' => 'â²', + 'ⲓ' => 'â²’', + 'ⲕ' => 'â²”', + 'â²—' => 'â²–', + 'â²™' => 'Ⲙ', + 'â²›' => 'Ⲛ', + 'â²' => 'Ⲝ', + 'ⲟ' => 'Ⲟ', + 'ⲡ' => 'â² ', + 'â²£' => 'â²¢', + 'â²¥' => 'Ⲥ', + 'ⲧ' => 'Ⲧ', + 'ⲩ' => 'Ⲩ', + 'ⲫ' => 'Ⲫ', + 'â²­' => 'Ⲭ', + 'ⲯ' => 'â²®', + 'â²±' => 'â²°', + 'â²³' => 'â²²', + 'â²µ' => 'â²´', + 'â²·' => 'Ⲷ', + 'â²¹' => 'Ⲹ', + 'â²»' => 'Ⲻ', + 'â²½' => 'â²¼', + 'ⲿ' => 'â²¾', + 'â³' => 'â³€', + 'ⳃ' => 'Ⳃ', + 'â³…' => 'Ⳅ', + 'ⳇ' => 'Ⳇ', + 'ⳉ' => 'Ⳉ', + 'ⳋ' => 'Ⳋ', + 'â³' => 'Ⳍ', + 'â³' => 'Ⳏ', + 'ⳑ' => 'â³', + 'ⳓ' => 'â³’', + 'ⳕ' => 'â³”', + 'â³—' => 'â³–', + 'â³™' => 'Ⳙ', + 'â³›' => 'Ⳛ', + 'â³' => 'Ⳝ', + 'ⳟ' => 'Ⳟ', + 'ⳡ' => 'â³ ', + 'â³£' => 'â³¢', + 'ⳬ' => 'Ⳬ', + 'â³®' => 'â³­', + 'â³³' => 'â³²', + 'â´€' => 'á‚ ', + 'â´' => 'á‚¡', + 'â´‚' => 'á‚¢', + 'â´ƒ' => 'á‚£', + 'â´„' => 'Ⴄ', + 'â´…' => 'á‚¥', + 'â´†' => 'Ⴆ', + 'â´‡' => 'Ⴇ', + 'â´ˆ' => 'Ⴈ', + 'â´‰' => 'á‚©', + 'â´Š' => 'Ⴊ', + 'â´‹' => 'á‚«', + 'â´Œ' => 'Ⴌ', + 'â´' => 'á‚­', + 'â´Ž' => 'á‚®', + 'â´' => 'Ⴏ', + 'â´' => 'á‚°', + 'â´‘' => 'Ⴑ', + 'â´’' => 'Ⴒ', + 'â´“' => 'Ⴓ', + 'â´”' => 'á‚´', + 'â´•' => 'Ⴕ', + 'â´–' => 'Ⴖ', + 'â´—' => 'á‚·', + 'â´˜' => 'Ⴘ', + 'â´™' => 'Ⴙ', + 'â´š' => 'Ⴚ', + 'â´›' => 'á‚»', + 'â´œ' => 'Ⴜ', + 'â´' => 'Ⴝ', + 'â´ž' => 'Ⴞ', + 'â´Ÿ' => 'á‚¿', + 'â´ ' => 'Ⴠ', + 'â´¡' => 'áƒ', + 'â´¢' => 'Ⴢ', + 'â´£' => 'Ⴣ', + 'â´¤' => 'Ⴤ', + 'â´¥' => 'Ⴥ', + 'â´§' => 'Ⴧ', + 'â´­' => 'áƒ', + 'ê™' => 'Ꙁ', + 'ꙃ' => 'Ꙃ', + 'ê™…' => 'Ꙅ', + 'ꙇ' => 'Ꙇ', + 'ꙉ' => 'Ꙉ', + 'ꙋ' => 'Ꙋ', + 'ê™' => 'Ꙍ', + 'ê™' => 'Ꙏ', + 'ꙑ' => 'ê™', + 'ꙓ' => 'ê™’', + 'ꙕ' => 'ê™”', + 'ê™—' => 'ê™–', + 'ê™™' => 'Ꙙ', + 'ê™›' => 'Ꙛ', + 'ê™' => 'Ꙝ', + 'ꙟ' => 'Ꙟ', + 'ꙡ' => 'ê™ ', + 'ꙣ' => 'Ꙣ', + 'ꙥ' => 'Ꙥ', + 'ꙧ' => 'Ꙧ', + 'ꙩ' => 'Ꙩ', + 'ꙫ' => 'Ꙫ', + 'ê™­' => 'Ꙭ', + 'êš' => 'Ꚁ', + 'ꚃ' => 'êš‚', + 'êš…' => 'êš„', + 'ꚇ' => 'Ꚇ', + 'ꚉ' => 'Ꚉ', + 'êš‹' => 'Ꚋ', + 'êš' => 'Ꚍ', + 'êš' => 'Ꚏ', + 'êš‘' => 'êš', + 'êš“' => 'êš’', + 'êš•' => 'êš”', + 'êš—' => 'êš–', + 'êš™' => 'Ꚙ', + 'êš›' => 'êšš', + 'ꜣ' => 'Ꜣ', + 'ꜥ' => 'Ꜥ', + 'ꜧ' => 'Ꜧ', + 'ꜩ' => 'Ꜩ', + 'ꜫ' => 'Ꜫ', + 'ꜭ' => 'Ꜭ', + 'ꜯ' => 'Ꜯ', + 'ꜳ' => 'Ꜳ', + 'ꜵ' => 'Ꜵ', + 'ꜷ' => 'Ꜷ', + 'ꜹ' => 'Ꜹ', + 'ꜻ' => 'Ꜻ', + 'ꜽ' => 'Ꜽ', + 'ꜿ' => 'Ꜿ', + 'ê' => 'ê€', + 'êƒ' => 'ê‚', + 'ê…' => 'ê„', + 'ê‡' => 'ê†', + 'ê‰' => 'êˆ', + 'ê‹' => 'êŠ', + 'ê' => 'êŒ', + 'ê' => 'êŽ', + 'ê‘' => 'ê', + 'ê“' => 'ê’', + 'ê•' => 'ê”', + 'ê—' => 'ê–', + 'ê™' => 'ê˜', + 'ê›' => 'êš', + 'ê' => 'êœ', + 'êŸ' => 'êž', + 'ê¡' => 'ê ', + 'ê£' => 'ê¢', + 'ê¥' => 'ê¤', + 'ê§' => 'ê¦', + 'ê©' => 'ê¨', + 'ê«' => 'êª', + 'ê­' => 'ê¬', + 'ê¯' => 'ê®', + 'êº' => 'ê¹', + 'ê¼' => 'ê»', + 'ê¿' => 'ê¾', + 'êž' => 'Ꞁ', + 'ꞃ' => 'êž‚', + 'êž…' => 'êž„', + 'ꞇ' => 'Ꞇ', + 'ꞌ' => 'êž‹', + 'êž‘' => 'êž', + 'êž“' => 'êž’', + 'êž”' => 'Ꞔ', + 'êž—' => 'êž–', + 'êž™' => 'Ꞙ', + 'êž›' => 'êžš', + 'êž' => 'êžœ', + 'ꞟ' => 'êžž', + 'êž¡' => 'êž ', + 'ꞣ' => 'Ꞣ', + 'ꞥ' => 'Ꞥ', + 'ꞧ' => 'Ꞧ', + 'êž©' => 'Ꞩ', + 'êžµ' => 'êž´', + 'êž·' => 'Ꞷ', + 'êž¹' => 'Ꞹ', + 'êž»' => 'Ꞻ', + 'êž½' => 'êž¼', + 'êž¿' => 'êž¾', + 'ꟃ' => 'Ꟃ', + 'ꟈ' => 'Ꟈ', + 'ꟊ' => 'Ꟊ', + 'ꟶ' => 'Ꟶ', + 'ê­“' => 'êž³', + 'ê­°' => 'Ꭰ', + 'ê­±' => 'Ꭱ', + 'ê­²' => 'Ꭲ', + 'ê­³' => 'Ꭳ', + 'ê­´' => 'Ꭴ', + 'ê­µ' => 'Ꭵ', + 'ê­¶' => 'Ꭶ', + 'ê­·' => 'Ꭷ', + 'ê­¸' => 'Ꭸ', + 'ê­¹' => 'Ꭹ', + 'ê­º' => 'Ꭺ', + 'ê­»' => 'Ꭻ', + 'ê­¼' => 'Ꭼ', + 'ê­½' => 'Ꭽ', + 'ê­¾' => 'Ꭾ', + 'ê­¿' => 'Ꭿ', + 'ꮀ' => 'Ꮀ', + 'ê®' => 'Ꮁ', + 'ꮂ' => 'Ꮂ', + 'ꮃ' => 'Ꮃ', + 'ꮄ' => 'Ꮄ', + 'ê®…' => 'Ꮅ', + 'ꮆ' => 'Ꮆ', + 'ꮇ' => 'Ꮇ', + 'ꮈ' => 'Ꮈ', + 'ꮉ' => 'Ꮉ', + 'ꮊ' => 'Ꮊ', + 'ꮋ' => 'Ꮋ', + 'ꮌ' => 'Ꮌ', + 'ê®' => 'Ꮍ', + 'ꮎ' => 'Ꮎ', + 'ê®' => 'Ꮏ', + 'ê®' => 'á€', + 'ꮑ' => 'á', + 'ê®’' => 'á‚', + 'ꮓ' => 'áƒ', + 'ê®”' => 'á„', + 'ꮕ' => 'á…', + 'ê®–' => 'á†', + 'ê®—' => 'á‡', + 'ꮘ' => 'áˆ', + 'ê®™' => 'á‰', + 'ꮚ' => 'áŠ', + 'ê®›' => 'á‹', + 'ꮜ' => 'áŒ', + 'ê®' => 'á', + 'ꮞ' => 'áŽ', + 'ꮟ' => 'á', + 'ê® ' => 'á', + 'ꮡ' => 'á‘', + 'ꮢ' => 'á’', + 'ꮣ' => 'á“', + 'ꮤ' => 'á”', + 'ꮥ' => 'á•', + 'ꮦ' => 'á–', + 'ꮧ' => 'á—', + 'ꮨ' => 'á˜', + 'ꮩ' => 'á™', + 'ꮪ' => 'áš', + 'ꮫ' => 'á›', + 'ꮬ' => 'áœ', + 'ê®­' => 'á', + 'ê®®' => 'áž', + 'ꮯ' => 'áŸ', + 'ê®°' => 'á ', + 'ê®±' => 'á¡', + 'ꮲ' => 'á¢', + 'ꮳ' => 'á£', + 'ê®´' => 'á¤', + 'ꮵ' => 'á¥', + 'ꮶ' => 'á¦', + 'ê®·' => 'á§', + 'ꮸ' => 'á¨', + 'ꮹ' => 'á©', + 'ꮺ' => 'áª', + 'ê®»' => 'á«', + 'ꮼ' => 'á¬', + 'ꮽ' => 'á­', + 'ꮾ' => 'á®', + 'ꮿ' => 'á¯', + 'ï½' => 'A', + 'b' => 'ï¼¢', + 'c' => 'ï¼£', + 'd' => 'D', + 'ï½…' => 'ï¼¥', + 'f' => 'F', + 'g' => 'G', + 'h' => 'H', + 'i' => 'I', + 'j' => 'J', + 'k' => 'K', + 'l' => 'L', + 'ï½' => 'ï¼­', + 'n' => 'ï¼®', + 'ï½' => 'O', + 'ï½' => 'ï¼°', + 'q' => 'ï¼±', + 'ï½’' => 'ï¼²', + 's' => 'ï¼³', + 'ï½”' => 'ï¼´', + 'u' => 'ï¼µ', + 'ï½–' => 'V', + 'ï½—' => 'ï¼·', + 'x' => 'X', + 'ï½™' => 'ï¼¹', + 'z' => 'Z', + 'ð¨' => 'ð€', + 'ð©' => 'ð', + 'ðª' => 'ð‚', + 'ð«' => 'ðƒ', + 'ð¬' => 'ð„', + 'ð­' => 'ð…', + 'ð®' => 'ð†', + 'ð¯' => 'ð‡', + 'ð°' => 'ðˆ', + 'ð±' => 'ð‰', + 'ð²' => 'ðŠ', + 'ð³' => 'ð‹', + 'ð´' => 'ðŒ', + 'ðµ' => 'ð', + 'ð¶' => 'ðŽ', + 'ð·' => 'ð', + 'ð¸' => 'ð', + 'ð¹' => 'ð‘', + 'ðº' => 'ð’', + 'ð»' => 'ð“', + 'ð¼' => 'ð”', + 'ð½' => 'ð•', + 'ð¾' => 'ð–', + 'ð¿' => 'ð—', + 'ð‘€' => 'ð˜', + 'ð‘' => 'ð™', + 'ð‘‚' => 'ðš', + 'ð‘ƒ' => 'ð›', + 'ð‘„' => 'ðœ', + 'ð‘…' => 'ð', + 'ð‘†' => 'ðž', + 'ð‘‡' => 'ðŸ', + 'ð‘ˆ' => 'ð ', + 'ð‘‰' => 'ð¡', + 'ð‘Š' => 'ð¢', + 'ð‘‹' => 'ð£', + 'ð‘Œ' => 'ð¤', + 'ð‘' => 'ð¥', + 'ð‘Ž' => 'ð¦', + 'ð‘' => 'ð§', + 'ð“˜' => 'ð’°', + 'ð“™' => 'ð’±', + 'ð“š' => 'ð’²', + 'ð“›' => 'ð’³', + 'ð“œ' => 'ð’´', + 'ð“' => 'ð’µ', + 'ð“ž' => 'ð’¶', + 'ð“Ÿ' => 'ð’·', + 'ð“ ' => 'ð’¸', + 'ð“¡' => 'ð’¹', + 'ð“¢' => 'ð’º', + 'ð“£' => 'ð’»', + 'ð“¤' => 'ð’¼', + 'ð“¥' => 'ð’½', + 'ð“¦' => 'ð’¾', + 'ð“§' => 'ð’¿', + 'ð“¨' => 'ð“€', + 'ð“©' => 'ð“', + 'ð“ª' => 'ð“‚', + 'ð“«' => 'ð“ƒ', + 'ð“¬' => 'ð“„', + 'ð“­' => 'ð“…', + 'ð“®' => 'ð“†', + 'ð“¯' => 'ð“‡', + 'ð“°' => 'ð“ˆ', + 'ð“±' => 'ð“‰', + 'ð“²' => 'ð“Š', + 'ð“³' => 'ð“‹', + 'ð“´' => 'ð“Œ', + 'ð“µ' => 'ð“', + 'ð“¶' => 'ð“Ž', + 'ð“·' => 'ð“', + 'ð“¸' => 'ð“', + 'ð“¹' => 'ð“‘', + 'ð“º' => 'ð“’', + 'ð“»' => 'ð““', + 'ð³€' => 'ð²€', + 'ð³' => 'ð²', + 'ð³‚' => 'ð²‚', + 'ð³ƒ' => 'ð²ƒ', + 'ð³„' => 'ð²„', + 'ð³…' => 'ð²…', + 'ð³†' => 'ð²†', + 'ð³‡' => 'ð²‡', + 'ð³ˆ' => 'ð²ˆ', + 'ð³‰' => 'ð²‰', + 'ð³Š' => 'ð²Š', + 'ð³‹' => 'ð²‹', + 'ð³Œ' => 'ð²Œ', + 'ð³' => 'ð²', + 'ð³Ž' => 'ð²Ž', + 'ð³' => 'ð²', + 'ð³' => 'ð²', + 'ð³‘' => 'ð²‘', + 'ð³’' => 'ð²’', + 'ð³“' => 'ð²“', + 'ð³”' => 'ð²”', + 'ð³•' => 'ð²•', + 'ð³–' => 'ð²–', + 'ð³—' => 'ð²—', + 'ð³˜' => 'ð²˜', + 'ð³™' => 'ð²™', + 'ð³š' => 'ð²š', + 'ð³›' => 'ð²›', + 'ð³œ' => 'ð²œ', + 'ð³' => 'ð²', + 'ð³ž' => 'ð²ž', + 'ð³Ÿ' => 'ð²Ÿ', + 'ð³ ' => 'ð² ', + 'ð³¡' => 'ð²¡', + 'ð³¢' => 'ð²¢', + 'ð³£' => 'ð²£', + 'ð³¤' => 'ð²¤', + 'ð³¥' => 'ð²¥', + 'ð³¦' => 'ð²¦', + 'ð³§' => 'ð²§', + 'ð³¨' => 'ð²¨', + 'ð³©' => 'ð²©', + 'ð³ª' => 'ð²ª', + 'ð³«' => 'ð²«', + 'ð³¬' => 'ð²¬', + 'ð³­' => 'ð²­', + 'ð³®' => 'ð²®', + 'ð³¯' => 'ð²¯', + 'ð³°' => 'ð²°', + 'ð³±' => 'ð²±', + 'ð³²' => 'ð²²', + 'ð‘£€' => 'ð‘¢ ', + 'ð‘£' => '𑢡', + '𑣂' => 'ð‘¢¢', + '𑣃' => 'ð‘¢£', + '𑣄' => '𑢤', + 'ð‘£…' => 'ð‘¢¥', + '𑣆' => '𑢦', + '𑣇' => '𑢧', + '𑣈' => '𑢨', + '𑣉' => '𑢩', + '𑣊' => '𑢪', + '𑣋' => '𑢫', + '𑣌' => '𑢬', + 'ð‘£' => 'ð‘¢­', + '𑣎' => 'ð‘¢®', + 'ð‘£' => '𑢯', + 'ð‘£' => 'ð‘¢°', + '𑣑' => 'ð‘¢±', + 'ð‘£’' => 'ð‘¢²', + '𑣓' => 'ð‘¢³', + 'ð‘£”' => 'ð‘¢´', + '𑣕' => 'ð‘¢µ', + 'ð‘£–' => '𑢶', + 'ð‘£—' => 'ð‘¢·', + '𑣘' => '𑢸', + 'ð‘£™' => 'ð‘¢¹', + '𑣚' => '𑢺', + 'ð‘£›' => 'ð‘¢»', + '𑣜' => 'ð‘¢¼', + 'ð‘£' => 'ð‘¢½', + '𑣞' => 'ð‘¢¾', + '𑣟' => '𑢿', + 'ð–¹ ' => 'ð–¹€', + '𖹡' => 'ð–¹', + 'ð–¹¢' => '𖹂', + 'ð–¹£' => '𖹃', + '𖹤' => '𖹄', + 'ð–¹¥' => 'ð–¹…', + '𖹦' => '𖹆', + '𖹧' => '𖹇', + '𖹨' => '𖹈', + '𖹩' => '𖹉', + '𖹪' => '𖹊', + '𖹫' => '𖹋', + '𖹬' => '𖹌', + 'ð–¹­' => 'ð–¹', + 'ð–¹®' => '𖹎', + '𖹯' => 'ð–¹', + 'ð–¹°' => 'ð–¹', + 'ð–¹±' => '𖹑', + 'ð–¹²' => 'ð–¹’', + 'ð–¹³' => '𖹓', + 'ð–¹´' => 'ð–¹”', + 'ð–¹µ' => '𖹕', + '𖹶' => 'ð–¹–', + 'ð–¹·' => 'ð–¹—', + '𖹸' => '𖹘', + 'ð–¹¹' => 'ð–¹™', + '𖹺' => '𖹚', + 'ð–¹»' => 'ð–¹›', + 'ð–¹¼' => '𖹜', + 'ð–¹½' => 'ð–¹', + 'ð–¹¾' => '𖹞', + '𖹿' => '𖹟', + '𞤢' => '𞤀', + '𞤣' => 'ðž¤', + '𞤤' => '𞤂', + '𞤥' => '𞤃', + '𞤦' => '𞤄', + '𞤧' => '𞤅', + '𞤨' => '𞤆', + '𞤩' => '𞤇', + '𞤪' => '𞤈', + '𞤫' => '𞤉', + '𞤬' => '𞤊', + '𞤭' => '𞤋', + '𞤮' => '𞤌', + '𞤯' => 'ðž¤', + '𞤰' => '𞤎', + '𞤱' => 'ðž¤', + '𞤲' => 'ðž¤', + '𞤳' => '𞤑', + '𞤴' => '𞤒', + '𞤵' => '𞤓', + '𞤶' => '𞤔', + '𞤷' => '𞤕', + '𞤸' => '𞤖', + '𞤹' => '𞤗', + '𞤺' => '𞤘', + '𞤻' => '𞤙', + '𞤼' => '𞤚', + '𞤽' => '𞤛', + '𞤾' => '𞤜', + '𞤿' => 'ðž¤', + '𞥀' => '𞤞', + 'ðž¥' => '𞤟', + '𞥂' => '𞤠', + '𞥃' => '𞤡', + 'ß' => 'SS', + 'ff' => 'FF', + 'ï¬' => 'FI', + 'fl' => 'FL', + 'ffi' => 'FFI', + 'ffl' => 'FFL', + 'ſt' => 'ST', + 'st' => 'ST', + 'Ö‡' => 'ÔµÕ’', + 'ﬓ' => 'Õ„Õ†', + 'ﬔ' => 'Õ„Ôµ', + 'ﬕ' => 'Õ„Ô»', + 'ﬖ' => 'ÕŽÕ†', + 'ﬗ' => 'Õ„Ô½', + 'ʼn' => 'ʼN', + 'Î' => 'ΪÌ', + 'ΰ' => 'ΫÌ', + 'Ç°' => 'JÌŒ', + 'ẖ' => 'H̱', + 'ẗ' => 'T̈', + 'ẘ' => 'WÌŠ', + 'ẙ' => 'YÌŠ', + 'ẚ' => 'Aʾ', + 'á½' => 'Υ̓', + 'á½’' => 'Υ̓̀', + 'á½”' => 'Υ̓Ì', + 'á½–' => 'Υ̓͂', + 'ᾶ' => 'Α͂', + 'ῆ' => 'Η͂', + 'á¿’' => 'Ϊ̀', + 'á¿“' => 'ΪÌ', + 'á¿–' => 'Ι͂', + 'á¿—' => 'Ϊ͂', + 'á¿¢' => 'Ϋ̀', + 'á¿£' => 'ΫÌ', + 'ῤ' => 'Ρ̓', + 'ῦ' => 'Υ͂', + 'ῧ' => 'Ϋ͂', + 'ῶ' => 'Ω͂', + 'ᾈ' => 'ἈΙ', + 'ᾉ' => 'ἉΙ', + 'ᾊ' => 'ἊΙ', + 'ᾋ' => 'ἋΙ', + 'ᾌ' => 'ἌΙ', + 'á¾' => 'á¼Î™', + 'ᾎ' => 'ἎΙ', + 'á¾' => 'á¼Î™', + 'ᾘ' => 'ἨΙ', + 'á¾™' => 'ἩΙ', + 'ᾚ' => 'ἪΙ', + 'á¾›' => 'ἫΙ', + 'ᾜ' => 'ἬΙ', + 'á¾' => 'ἭΙ', + 'ᾞ' => 'ἮΙ', + 'ᾟ' => 'ἯΙ', + 'ᾨ' => 'ὨΙ', + 'ᾩ' => 'ὩΙ', + 'ᾪ' => 'ὪΙ', + 'ᾫ' => 'ὫΙ', + 'ᾬ' => 'ὬΙ', + 'á¾­' => 'ὭΙ', + 'á¾®' => 'ὮΙ', + 'ᾯ' => 'ὯΙ', + 'á¾¼' => 'ΑΙ', + 'á¿Œ' => 'ΗΙ', + 'ῼ' => 'ΩΙ', + 'á¾²' => 'ᾺΙ', + 'á¾´' => 'ΆΙ', + 'á¿‚' => 'ῊΙ', + 'á¿„' => 'ΉΙ', + 'ῲ' => 'ῺΙ', + 'á¿´' => 'ÎΙ', + 'á¾·' => 'Α͂Ι', + 'ῇ' => 'Η͂Ι', + 'á¿·' => 'Ω͂Ι', +); diff --git a/vendor/symfony/polyfill-mbstring/bootstrap.php b/vendor/symfony/polyfill-mbstring/bootstrap.php new file mode 100644 index 000000000..ecf1a0352 --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/bootstrap.php @@ -0,0 +1,151 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Mbstring as p; + +if (\PHP_VERSION_ID >= 80000) { + return require __DIR__.'/bootstrap80.php'; +} + +if (!function_exists('mb_convert_encoding')) { + function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); } +} +if (!function_exists('mb_decode_mimeheader')) { + function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } +} +if (!function_exists('mb_encode_mimeheader')) { + function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); } +} +if (!function_exists('mb_decode_numericentity')) { + function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } +} +if (!function_exists('mb_encode_numericentity')) { + function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); } +} +if (!function_exists('mb_convert_case')) { + function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } +} +if (!function_exists('mb_internal_encoding')) { + function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } +} +if (!function_exists('mb_language')) { + function mb_language($language = null) { return p\Mbstring::mb_language($language); } +} +if (!function_exists('mb_list_encodings')) { + function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } +} +if (!function_exists('mb_encoding_aliases')) { + function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } +} +if (!function_exists('mb_check_encoding')) { + function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); } +} +if (!function_exists('mb_detect_encoding')) { + function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); } +} +if (!function_exists('mb_detect_order')) { + function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } +} +if (!function_exists('mb_parse_str')) { + function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; } +} +if (!function_exists('mb_strlen')) { + function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } +} +if (!function_exists('mb_strpos')) { + function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strtolower')) { + function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } +} +if (!function_exists('mb_strtoupper')) { + function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } +} +if (!function_exists('mb_substitute_character')) { + function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } +} +if (!function_exists('mb_substr')) { + function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } +} +if (!function_exists('mb_stripos')) { + function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_stristr')) { + function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strrchr')) { + function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strrichr')) { + function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strripos')) { + function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strrpos')) { + function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strstr')) { + function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_get_info')) { + function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } +} +if (!function_exists('mb_http_output')) { + function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } +} +if (!function_exists('mb_strwidth')) { + function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } +} +if (!function_exists('mb_substr_count')) { + function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } +} +if (!function_exists('mb_output_handler')) { + function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } +} +if (!function_exists('mb_http_input')) { + function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); } +} + +if (!function_exists('mb_convert_variables')) { + function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); } +} + +if (!function_exists('mb_ord')) { + function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } +} +if (!function_exists('mb_chr')) { + function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } +} +if (!function_exists('mb_scrub')) { + function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } +} +if (!function_exists('mb_str_split')) { + function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } +} + +if (!function_exists('mb_str_pad')) { + function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } +} + +if (extension_loaded('mbstring')) { + return; +} + +if (!defined('MB_CASE_UPPER')) { + define('MB_CASE_UPPER', 0); +} +if (!defined('MB_CASE_LOWER')) { + define('MB_CASE_LOWER', 1); +} +if (!defined('MB_CASE_TITLE')) { + define('MB_CASE_TITLE', 2); +} diff --git a/vendor/symfony/polyfill-mbstring/bootstrap80.php b/vendor/symfony/polyfill-mbstring/bootstrap80.php new file mode 100644 index 000000000..2f9fb5b42 --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/bootstrap80.php @@ -0,0 +1,147 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Mbstring as p; + +if (!function_exists('mb_convert_encoding')) { + function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); } +} +if (!function_exists('mb_decode_mimeheader')) { + function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); } +} +if (!function_exists('mb_encode_mimeheader')) { + function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); } +} +if (!function_exists('mb_decode_numericentity')) { + function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); } +} +if (!function_exists('mb_encode_numericentity')) { + function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); } +} +if (!function_exists('mb_convert_case')) { + function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); } +} +if (!function_exists('mb_internal_encoding')) { + function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); } +} +if (!function_exists('mb_language')) { + function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); } +} +if (!function_exists('mb_list_encodings')) { + function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); } +} +if (!function_exists('mb_encoding_aliases')) { + function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); } +} +if (!function_exists('mb_check_encoding')) { + function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); } +} +if (!function_exists('mb_detect_encoding')) { + function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); } +} +if (!function_exists('mb_detect_order')) { + function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); } +} +if (!function_exists('mb_parse_str')) { + function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; } +} +if (!function_exists('mb_strlen')) { + function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); } +} +if (!function_exists('mb_strpos')) { + function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_strtolower')) { + function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); } +} +if (!function_exists('mb_strtoupper')) { + function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); } +} +if (!function_exists('mb_substitute_character')) { + function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); } +} +if (!function_exists('mb_substr')) { + function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); } +} +if (!function_exists('mb_stripos')) { + function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_stristr')) { + function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_strrchr')) { + function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_strrichr')) { + function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_strripos')) { + function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_strrpos')) { + function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_strstr')) { + function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_get_info')) { + function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); } +} +if (!function_exists('mb_http_output')) { + function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } +} +if (!function_exists('mb_strwidth')) { + function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); } +} +if (!function_exists('mb_substr_count')) { + function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); } +} +if (!function_exists('mb_output_handler')) { + function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); } +} +if (!function_exists('mb_http_input')) { + function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); } +} + +if (!function_exists('mb_convert_variables')) { + function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); } +} + +if (!function_exists('mb_ord')) { + function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); } +} +if (!function_exists('mb_chr')) { + function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); } +} +if (!function_exists('mb_scrub')) { + function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); } +} +if (!function_exists('mb_str_split')) { + function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); } +} + +if (!function_exists('mb_str_pad')) { + function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } +} + +if (extension_loaded('mbstring')) { + return; +} + +if (!defined('MB_CASE_UPPER')) { + define('MB_CASE_UPPER', 0); +} +if (!defined('MB_CASE_LOWER')) { + define('MB_CASE_LOWER', 1); +} +if (!defined('MB_CASE_TITLE')) { + define('MB_CASE_TITLE', 2); +} diff --git a/vendor/symfony/polyfill-mbstring/composer.json b/vendor/symfony/polyfill-mbstring/composer.json new file mode 100644 index 000000000..943e50296 --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/composer.json @@ -0,0 +1,41 @@ +{ + "name": "symfony/polyfill-mbstring", + "type": "library", + "description": "Symfony polyfill for the Mbstring extension", + "keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, + "files": [ "bootstrap.php" ] + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/vendor/symfony/polyfill-php80/LICENSE b/vendor/symfony/polyfill-php80/LICENSE new file mode 100644 index 000000000..0ed3a2465 --- /dev/null +++ b/vendor/symfony/polyfill-php80/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/symfony/polyfill-php80/Php80.php b/vendor/symfony/polyfill-php80/Php80.php new file mode 100644 index 000000000..362dd1a95 --- /dev/null +++ b/vendor/symfony/polyfill-php80/Php80.php @@ -0,0 +1,115 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php80; + +/** + * @author Ion Bazan + * @author Nico Oelgart + * @author Nicolas Grekas + * + * @internal + */ +final class Php80 +{ + public static function fdiv(float $dividend, float $divisor): float + { + return @($dividend / $divisor); + } + + public static function get_debug_type($value): string + { + switch (true) { + case null === $value: return 'null'; + case \is_bool($value): return 'bool'; + case \is_string($value): return 'string'; + case \is_array($value): return 'array'; + case \is_int($value): return 'int'; + case \is_float($value): return 'float'; + case \is_object($value): break; + case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; + default: + if (null === $type = @get_resource_type($value)) { + return 'unknown'; + } + + if ('Unknown' === $type) { + $type = 'closed'; + } + + return "resource ($type)"; + } + + $class = \get_class($value); + + if (false === strpos($class, '@')) { + return $class; + } + + return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; + } + + public static function get_resource_id($res): int + { + if (!\is_resource($res) && null === @get_resource_type($res)) { + throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); + } + + return (int) $res; + } + + public static function preg_last_error_msg(): string + { + switch (preg_last_error()) { + case \PREG_INTERNAL_ERROR: + return 'Internal error'; + case \PREG_BAD_UTF8_ERROR: + return 'Malformed UTF-8 characters, possibly incorrectly encoded'; + case \PREG_BAD_UTF8_OFFSET_ERROR: + return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; + case \PREG_BACKTRACK_LIMIT_ERROR: + return 'Backtrack limit exhausted'; + case \PREG_RECURSION_LIMIT_ERROR: + return 'Recursion limit exhausted'; + case \PREG_JIT_STACKLIMIT_ERROR: + return 'JIT stack limit exhausted'; + case \PREG_NO_ERROR: + return 'No error'; + default: + return 'Unknown error'; + } + } + + public static function str_contains(string $haystack, string $needle): bool + { + return '' === $needle || false !== strpos($haystack, $needle); + } + + public static function str_starts_with(string $haystack, string $needle): bool + { + return 0 === strncmp($haystack, $needle, \strlen($needle)); + } + + public static function str_ends_with(string $haystack, string $needle): bool + { + if ('' === $needle || $needle === $haystack) { + return true; + } + + if ('' === $haystack) { + return false; + } + + $needleLength = \strlen($needle); + + return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); + } +} diff --git a/vendor/symfony/polyfill-php80/PhpToken.php b/vendor/symfony/polyfill-php80/PhpToken.php new file mode 100644 index 000000000..fe6e69105 --- /dev/null +++ b/vendor/symfony/polyfill-php80/PhpToken.php @@ -0,0 +1,103 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php80; + +/** + * @author Fedonyuk Anton + * + * @internal + */ +class PhpToken implements \Stringable +{ + /** + * @var int + */ + public $id; + + /** + * @var string + */ + public $text; + + /** + * @var int + */ + public $line; + + /** + * @var int + */ + public $pos; + + public function __construct(int $id, string $text, int $line = -1, int $position = -1) + { + $this->id = $id; + $this->text = $text; + $this->line = $line; + $this->pos = $position; + } + + public function getTokenName(): ?string + { + if ('UNKNOWN' === $name = token_name($this->id)) { + $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; + } + + return $name; + } + + /** + * @param int|string|array $kind + */ + public function is($kind): bool + { + foreach ((array) $kind as $value) { + if (\in_array($value, [$this->id, $this->text], true)) { + return true; + } + } + + return false; + } + + public function isIgnorable(): bool + { + return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); + } + + public function __toString(): string + { + return (string) $this->text; + } + + /** + * @return static[] + */ + public static function tokenize(string $code, int $flags = 0): array + { + $line = 1; + $position = 0; + $tokens = token_get_all($code, $flags); + foreach ($tokens as $index => $token) { + if (\is_string($token)) { + $id = \ord($token); + $text = $token; + } else { + [$id, $text, $line] = $token; + } + $tokens[$index] = new static($id, $text, $line, $position); + $position += \strlen($text); + } + + return $tokens; + } +} diff --git a/vendor/symfony/polyfill-php80/README.md b/vendor/symfony/polyfill-php80/README.md new file mode 100644 index 000000000..3816c559d --- /dev/null +++ b/vendor/symfony/polyfill-php80/README.md @@ -0,0 +1,25 @@ +Symfony Polyfill / Php80 +======================== + +This component provides features added to PHP 8.0 core: + +- [`Stringable`](https://php.net/stringable) interface +- [`fdiv`](https://php.net/fdiv) +- [`ValueError`](https://php.net/valueerror) class +- [`UnhandledMatchError`](https://php.net/unhandledmatcherror) class +- `FILTER_VALIDATE_BOOL` constant +- [`get_debug_type`](https://php.net/get_debug_type) +- [`PhpToken`](https://php.net/phptoken) class +- [`preg_last_error_msg`](https://php.net/preg_last_error_msg) +- [`str_contains`](https://php.net/str_contains) +- [`str_starts_with`](https://php.net/str_starts_with) +- [`str_ends_with`](https://php.net/str_ends_with) +- [`get_resource_id`](https://php.net/get_resource_id) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php new file mode 100644 index 000000000..2b955423f --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#[Attribute(Attribute::TARGET_CLASS)] +final class Attribute +{ + public const TARGET_CLASS = 1; + public const TARGET_FUNCTION = 2; + public const TARGET_METHOD = 4; + public const TARGET_PROPERTY = 8; + public const TARGET_CLASS_CONSTANT = 16; + public const TARGET_PARAMETER = 32; + public const TARGET_ALL = 63; + public const IS_REPEATABLE = 64; + + /** @var int */ + public $flags; + + public function __construct(int $flags = self::TARGET_ALL) + { + $this->flags = $flags; + } +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php new file mode 100644 index 000000000..bd1212f6e --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) { + class PhpToken extends Symfony\Polyfill\Php80\PhpToken + { + } +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php new file mode 100644 index 000000000..7c62d7508 --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + interface Stringable + { + /** + * @return string + */ + public function __toString(); + } +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php new file mode 100644 index 000000000..01c6c6c8a --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + class UnhandledMatchError extends Error + { + } +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php b/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php new file mode 100644 index 000000000..783dbc28c --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + class ValueError extends Error + { + } +} diff --git a/vendor/symfony/polyfill-php80/bootstrap.php b/vendor/symfony/polyfill-php80/bootstrap.php new file mode 100644 index 000000000..e5f7dbc1a --- /dev/null +++ b/vendor/symfony/polyfill-php80/bootstrap.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php80 as p; + +if (\PHP_VERSION_ID >= 80000) { + return; +} + +if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { + define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); +} + +if (!function_exists('fdiv')) { + function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } +} +if (!function_exists('preg_last_error_msg')) { + function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } +} +if (!function_exists('str_contains')) { + function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('str_starts_with')) { + function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('str_ends_with')) { + function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('get_debug_type')) { + function get_debug_type($value): string { return p\Php80::get_debug_type($value); } +} +if (!function_exists('get_resource_id')) { + function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } +} diff --git a/vendor/symfony/polyfill-php80/composer.json b/vendor/symfony/polyfill-php80/composer.json new file mode 100644 index 000000000..f1801f403 --- /dev/null +++ b/vendor/symfony/polyfill-php80/composer.json @@ -0,0 +1,40 @@ +{ + "name": "symfony/polyfill-php80", + "type": "library", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "keywords": ["polyfill", "shim", "compatibility", "portable"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/vendor/symfony/polyfill-php81/LICENSE b/vendor/symfony/polyfill-php81/LICENSE new file mode 100644 index 000000000..99c6bdf35 --- /dev/null +++ b/vendor/symfony/polyfill-php81/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2021-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/symfony/polyfill-php81/Php81.php b/vendor/symfony/polyfill-php81/Php81.php new file mode 100644 index 000000000..f0507b765 --- /dev/null +++ b/vendor/symfony/polyfill-php81/Php81.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php81; + +/** + * @author Nicolas Grekas + * + * @internal + */ +final class Php81 +{ + public static function array_is_list(array $array): bool + { + if ([] === $array || $array === array_values($array)) { + return true; + } + + $nextKey = -1; + + foreach ($array as $k => $v) { + if ($k !== ++$nextKey) { + return false; + } + } + + return true; + } +} diff --git a/vendor/symfony/polyfill-php81/README.md b/vendor/symfony/polyfill-php81/README.md new file mode 100644 index 000000000..c07ef7820 --- /dev/null +++ b/vendor/symfony/polyfill-php81/README.md @@ -0,0 +1,18 @@ +Symfony Polyfill / Php81 +======================== + +This component provides features added to PHP 8.1 core: + +- [`array_is_list`](https://php.net/array_is_list) +- [`enum_exists`](https://php.net/enum-exists) +- [`MYSQLI_REFRESH_REPLICA`](https://php.net/mysqli.constants#constantmysqli-refresh-replica) constant +- [`ReturnTypeWillChange`](https://wiki.php.net/rfc/internal_method_return_types) +- [`CURLStringFile`](https://php.net/CURLStringFile) (but only if PHP >= 7.4 is used) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php b/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php new file mode 100644 index 000000000..eb5952ee3 --- /dev/null +++ b/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID >= 70400 && extension_loaded('curl')) { + /** + * @property string $data + */ + class CURLStringFile extends CURLFile + { + private $data; + + public function __construct(string $data, string $postname, string $mime = 'application/octet-stream') + { + $this->data = $data; + parent::__construct('data://application/octet-stream;base64,'.base64_encode($data), $mime, $postname); + } + + public function __set(string $name, $value): void + { + if ('data' !== $name) { + $this->$name = $value; + + return; + } + + if (is_object($value) ? !method_exists($value, '__toString') : !is_scalar($value)) { + throw new \TypeError('Cannot assign '.gettype($value).' to property CURLStringFile::$data of type string'); + } + + $this->name = 'data://application/octet-stream;base64,'.base64_encode($value); + } + + public function __isset(string $name): bool + { + return isset($this->$name); + } + + public function &__get(string $name) + { + return $this->$name; + } + } +} diff --git a/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php b/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php new file mode 100644 index 000000000..cb7720a8d --- /dev/null +++ b/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80100) { + #[Attribute(Attribute::TARGET_METHOD)] + final class ReturnTypeWillChange + { + public function __construct() + { + } + } +} diff --git a/vendor/symfony/polyfill-php81/bootstrap.php b/vendor/symfony/polyfill-php81/bootstrap.php new file mode 100644 index 000000000..9f872e02f --- /dev/null +++ b/vendor/symfony/polyfill-php81/bootstrap.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php81 as p; + +if (\PHP_VERSION_ID >= 80100) { + return; +} + +if (defined('MYSQLI_REFRESH_SLAVE') && !defined('MYSQLI_REFRESH_REPLICA')) { + define('MYSQLI_REFRESH_REPLICA', 64); +} + +if (!function_exists('array_is_list')) { + function array_is_list(array $array): bool { return p\Php81::array_is_list($array); } +} + +if (!function_exists('enum_exists')) { + function enum_exists(string $enum, bool $autoload = true): bool { return $autoload && class_exists($enum) && false; } +} diff --git a/vendor/symfony/polyfill-php81/composer.json b/vendor/symfony/polyfill-php81/composer.json new file mode 100644 index 000000000..e02d673d4 --- /dev/null +++ b/vendor/symfony/polyfill-php81/composer.json @@ -0,0 +1,36 @@ +{ + "name": "symfony/polyfill-php81", + "type": "library", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "keywords": ["polyfill", "shim", "compatibility", "portable"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Php81\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/vendor/symfony/polyfill-php82/LICENSE b/vendor/symfony/polyfill-php82/LICENSE new file mode 100644 index 000000000..733c826eb --- /dev/null +++ b/vendor/symfony/polyfill-php82/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2022-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/symfony/polyfill-php82/NoDynamicProperties.php b/vendor/symfony/polyfill-php82/NoDynamicProperties.php new file mode 100644 index 000000000..450deff45 --- /dev/null +++ b/vendor/symfony/polyfill-php82/NoDynamicProperties.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php82; + +/** + * @internal + */ +trait NoDynamicProperties +{ + public function __set(string $name, $value): void + { + throw new \Error('Cannot create dynamic property '.self::class.'::$'.$name); + } +} diff --git a/vendor/symfony/polyfill-php82/Php82.php b/vendor/symfony/polyfill-php82/Php82.php new file mode 100644 index 000000000..fcd1281a9 --- /dev/null +++ b/vendor/symfony/polyfill-php82/Php82.php @@ -0,0 +1,368 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php82; + +/** + * @author Alexander M. Turek + * @author Greg Roach + * + * @internal + */ +class Php82 +{ + /** + * Determines if a string matches the ODBC quoting rules. + * + * A valid quoted string begins with a '{', ends with a '}', and has no '}' + * inside of the string that aren't repeated (as to be escaped). + * + * These rules are what .NET also follows. + * + * @see https://github.com/php/php-src/blob/838f6bffff6363a204a2597cbfbaad1d7ee3f2b6/main/php_odbc_utils.c#L31-L57 + */ + public static function odbc_connection_string_is_quoted(string $str): bool + { + if ('' === $str || '{' !== $str[0]) { + return false; + } + + /* Check for } that aren't doubled up or at the end of the string */ + $length = \strlen($str) - 1; + for ($i = 0; $i < $length; ++$i) { + if ('}' !== $str[$i]) { + continue; + } + + if ('}' !== $str[++$i]) { + return $i === $length; + } + } + + return true; + } + + /** + * Determines if a value for a connection string should be quoted. + * + * The ODBC specification mentions: + * "Because of connection string and initialization file grammar, keywords and + * attribute values that contain the characters []{}(),;?*=!@ not enclosed + * with braces should be avoided." + * + * Note that it assumes that the string is *not* already quoted. You should + * check beforehand. + * + * @see https://github.com/php/php-src/blob/838f6bffff6363a204a2597cbfbaad1d7ee3f2b6/main/php_odbc_utils.c#L59-L73 + */ + public static function odbc_connection_string_should_quote(string $str): bool + { + return false !== strpbrk($str, '[]{}(),;?*=!@'); + } + + public static function odbc_connection_string_quote(string $str): string + { + return '{'.str_replace('}', '}}', $str).'}'; + } + + /** + * Implementation closely based on the original C code - including the GOTOs + * and pointer-style string access. + * + * @see https://github.com/php/php-src/blob/master/Zend/zend_ini.c + */ + public static function ini_parse_quantity(string $value): int + { + // Avoid dependency on ctype_space() + $ctype_space = " \t\v\r\n\f"; + + $str = 0; + $str_end = \strlen($value); + $digits = $str; + $overflow = false; + + /* Ignore leading whitespace, but keep it for error messages. */ + while ($digits < $str_end && false !== strpos($ctype_space, $value[$digits])) { + ++$digits; + } + + /* Ignore trailing whitespace, but keep it for error messages. */ + while ($digits < $str_end && false !== strpos($ctype_space, $value[$str_end - 1])) { + --$str_end; + } + + if ($digits === $str_end) { + return 0; + } + + $is_negative = false; + + if ('+' === $value[$digits]) { + ++$digits; + } elseif ('-' === $value[$digits]) { + $is_negative = true; + ++$digits; + } + + if ($value[$digits] < '0' || $value[$digits] > 9) { + $message = sprintf( + 'Invalid quantity "%s": no valid leading digits, interpreting as "0" for backwards compatibility', + self::escapeString($value) + ); + + trigger_error($message, \E_USER_WARNING); + + return 0; + } + + $base = 10; + $allowed_digits = '0123456789'; + + if ('0' === $value[$digits] && ($digits + 1 === $str_end || false === strpos($allowed_digits, $value[$digits + 1]))) { + if ($digits + 1 === $str_end) { + return 0; + } + + switch ($value[$digits + 1]) { + case 'g': + case 'G': + case 'm': + case 'M': + case 'k': + case 'K': + goto evaluation; + case 'x': + case 'X': + $base = 16; + $allowed_digits = '0123456789abcdefABCDEF'; + break; + case 'o': + case 'O': + $base = 8; + $allowed_digits = '01234567'; + break; + case 'b': + case 'B': + $base = 2; + $allowed_digits = '01'; + break; + default: + $message = sprintf( + 'Invalid prefix "0%s", interpreting as "0" for backwards compatibility', + $value[$digits + 1] + ); + trigger_error($message, \E_USER_WARNING); + + return 0; + } + + $digits += 2; + if ($digits === $str_end) { + $message = sprintf( + 'Invalid quantity "%s": no digits after base prefix, interpreting as "0" for backwards compatibility', + self::escapeString($value) + ); + trigger_error($message, \E_USER_WARNING); + + return 0; + } + } + + evaluation: + + if (10 === $base && '0' === $value[$digits]) { + $base = 8; + $allowed_digits = '01234567'; + } + + while ($digits < $str_end && ' ' === $value[$digits]) { + ++$digits; + } + + if ($digits < $str_end && '+' === $value[$digits]) { + ++$digits; + } elseif ($digits < $str_end && '-' === $value[$digits]) { + $is_negative = true; + $overflow = true; + ++$digits; + } + + $digits_end = $digits; + + // The native function treats 0x0x123 the same as 0x123. This is a bug which we must replicate. + if ( + 16 === $base + && $digits_end + 2 < $str_end + && '0x' === substr($value, $digits_end, 2) + && false !== strpos($allowed_digits, $value[$digits_end + 2]) + ) { + $digits_end += 2; + } + + while ($digits_end < $str_end && false !== strpos($allowed_digits, $value[$digits_end])) { + ++$digits_end; + } + + $retval = base_convert(substr($value, $digits, $digits_end - $digits), $base, 10); + + if ($is_negative && '0' === $retval) { + $is_negative = false; + $overflow = false; + } + + // Check for overflow - remember that -PHP_INT_MIN = 1 + PHP_INT_MAX + if ($is_negative) { + $signed_max = strtr((string) \PHP_INT_MIN, ['-' => '']); + } else { + $signed_max = (string) \PHP_INT_MAX; + } + + $max_length = max(\strlen($retval), \strlen($signed_max)); + + $tmp1 = str_pad($retval, $max_length, '0', \STR_PAD_LEFT); + $tmp2 = str_pad($signed_max, $max_length, '0', \STR_PAD_LEFT); + + if ($tmp1 > $tmp2) { + $retval = -1; + $overflow = true; + } elseif ($is_negative) { + $retval = '-'.$retval; + } + + $retval = (int) $retval; + + if ($digits_end === $digits) { + $message = sprintf( + 'Invalid quantity "%s": no valid leading digits, interpreting as "0" for backwards compatibility', + self::escapeString($value) + ); + trigger_error($message, \E_USER_WARNING); + + return 0; + } + + /* Allow for whitespace between integer portion and any suffix character */ + while ($digits_end < $str_end && false !== strpos($ctype_space, $value[$digits_end])) { + ++$digits_end; + } + + /* No exponent suffix. */ + if ($digits_end === $str_end) { + goto end; + } + + switch ($value[$str_end - 1]) { + case 'g': + case 'G': + $shift = 30; + break; + case 'm': + case 'M': + $shift = 20; + break; + case 'k': + case 'K': + $shift = 10; + break; + default: + /* Unknown suffix */ + $invalid = self::escapeString($value); + $interpreted = self::escapeString(substr($value, $str, $digits_end - $str)); + $chr = self::escapeString($value[$str_end - 1]); + + $message = sprintf( + 'Invalid quantity "%s": unknown multiplier "%s", interpreting as "%s" for backwards compatibility', + $invalid, + $chr, + $interpreted + ); + + trigger_error($message, \E_USER_WARNING); + + return $retval; + } + + $factor = 1 << $shift; + + if (!$overflow) { + if ($retval > 0) { + $overflow = $retval > \PHP_INT_MAX / $factor; + } else { + $overflow = $retval < \PHP_INT_MIN / $factor; + } + } + + if (\is_float($retval * $factor)) { + $overflow = true; + $retval <<= $shift; + } else { + $retval *= $factor; + } + + if ($digits_end !== $str_end - 1) { + /* More than one character in suffix */ + $message = sprintf( + 'Invalid quantity "%s", interpreting as "%s%s" for backwards compatibility', + self::escapeString($value), + self::escapeString(substr($value, $str, $digits_end - $str)), + self::escapeString($value[$str_end - 1]) + ); + trigger_error($message, \E_USER_WARNING); + + return $retval; + } + + end: + + if ($overflow) { + /* Not specifying the resulting value here because the caller may make + * additional conversions. Not specifying the allowed range + * because the caller may do narrower range checks. */ + $message = sprintf( + 'Invalid quantity "%s": value is out of range, using overflow result for backwards compatibility', + self::escapeString($value) + ); + trigger_error($message, \E_USER_WARNING); + } + + return $retval; + } + + /** + * Escape the string to avoid null bytes and to make non-printable chars visible. + */ + private static function escapeString(string $string): string + { + $escaped = ''; + + for ($n = 0, $len = \strlen($string); $n < $len; ++$n) { + $c = \ord($string[$n]); + + if ($c < 32 || '\\' === $string[$n] || $c > 126) { + switch ($string[$n]) { + case "\n": $escaped .= '\\n'; break; + case "\r": $escaped .= '\\r'; break; + case "\t": $escaped .= '\\t'; break; + case "\f": $escaped .= '\\f'; break; + case "\v": $escaped .= '\\v'; break; + case '\\': $escaped .= '\\\\'; break; + case "\x1B": $escaped .= '\\e'; break; + default: + $escaped .= '\\x'.strtoupper(sprintf('%02x', $c)); + } + } else { + $escaped .= $string[$n]; + } + } + + return $escaped; + } +} diff --git a/vendor/symfony/polyfill-php82/README.md b/vendor/symfony/polyfill-php82/README.md new file mode 100644 index 000000000..b3191557a --- /dev/null +++ b/vendor/symfony/polyfill-php82/README.md @@ -0,0 +1,23 @@ +Symfony Polyfill / Php82 +======================== + +This component provides features added to PHP 8.2 core: + +- [`AllowDynamicProperties`](https://wiki.php.net/rfc/deprecate_dynamic_properties) +- [`SensitiveParameter`](https://wiki.php.net/rfc/redact_parameters_in_back_traces) +- [`SensitiveParameterValue`](https://wiki.php.net/rfc/redact_parameters_in_back_traces) +- [`Random\Engine`](https://wiki.php.net/rfc/rng_extension) +- [`Random\Engine\CryptoSafeEngine`](https://wiki.php.net/rfc/rng_extension) +- [`Random\Engine\Secure`](https://wiki.php.net/rfc/rng_extension) (check [arokettu/random-polyfill](https://packagist.org/packages/arokettu/random-polyfill) for more engines) +- [`odbc_connection_string_is_quoted()`](https://php.net/odbc_connection_string_is_quoted) +- [`odbc_connection_string_should_quote()`](https://php.net/odbc_connection_string_should_quote) +- [`odbc_connection_string_quote()`](https://php.net/odbc_connection_string_quote) +- [`ini_parse_quantity()`](https://php.net/ini_parse_quantity) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-php82/Random/Engine/Secure.php b/vendor/symfony/polyfill-php82/Random/Engine/Secure.php new file mode 100644 index 000000000..5565386c2 --- /dev/null +++ b/vendor/symfony/polyfill-php82/Random/Engine/Secure.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php82\Random\Engine; + +use Random\RandomException; +use Symfony\Polyfill\Php82\NoDynamicProperties; + +/** + * @author Tim Düsterhus + * @author Anton Smirnov + * + * @internal + */ +class Secure +{ + use NoDynamicProperties; + + public function generate(): string + { + try { + return random_bytes(\PHP_INT_SIZE); + } catch (\Exception $e) { + throw new RandomException($e->getMessage(), $e->getCode(), $e->getPrevious()); + } + } + + public function __sleep(): array + { + throw new \Exception("Serialization of 'Random\Engine\Secure' is not allowed"); + } + + public function __wakeup(): void + { + throw new \Exception("Unserialization of 'Random\Engine\Secure' is not allowed"); + } + + public function __clone() + { + throw new \Error('Trying to clone an uncloneable object of class Random\Engine\Secure'); + } +} diff --git a/vendor/symfony/polyfill-php82/Resources/stubs/AllowDynamicProperties.php b/vendor/symfony/polyfill-php82/Resources/stubs/AllowDynamicProperties.php new file mode 100644 index 000000000..d216e0ade --- /dev/null +++ b/vendor/symfony/polyfill-php82/Resources/stubs/AllowDynamicProperties.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80200) { + #[Attribute(Attribute::TARGET_CLASS)] + final class AllowDynamicProperties + { + public function __construct() + { + } + } +} diff --git a/vendor/symfony/polyfill-php82/Resources/stubs/Random/BrokenRandomEngineError.php b/vendor/symfony/polyfill-php82/Resources/stubs/Random/BrokenRandomEngineError.php new file mode 100644 index 000000000..971ed570d --- /dev/null +++ b/vendor/symfony/polyfill-php82/Resources/stubs/Random/BrokenRandomEngineError.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Random; + +if (\PHP_VERSION_ID < 80200) { + class BrokenRandomEngineError extends RandomError + { + } +} diff --git a/vendor/symfony/polyfill-php82/Resources/stubs/Random/CryptoSafeEngine.php b/vendor/symfony/polyfill-php82/Resources/stubs/Random/CryptoSafeEngine.php new file mode 100644 index 000000000..fb32496f1 --- /dev/null +++ b/vendor/symfony/polyfill-php82/Resources/stubs/Random/CryptoSafeEngine.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Random; + +if (\PHP_VERSION_ID < 80200) { + interface CryptoSafeEngine extends Engine + { + } +} diff --git a/vendor/symfony/polyfill-php82/Resources/stubs/Random/Engine.php b/vendor/symfony/polyfill-php82/Resources/stubs/Random/Engine.php new file mode 100644 index 000000000..4fc78c8fb --- /dev/null +++ b/vendor/symfony/polyfill-php82/Resources/stubs/Random/Engine.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Random; + +if (\PHP_VERSION_ID < 80200) { + interface Engine + { + public function generate(): string; + } +} diff --git a/vendor/symfony/polyfill-php82/Resources/stubs/Random/Engine/Secure.php b/vendor/symfony/polyfill-php82/Resources/stubs/Random/Engine/Secure.php new file mode 100644 index 000000000..e779b5445 --- /dev/null +++ b/vendor/symfony/polyfill-php82/Resources/stubs/Random/Engine/Secure.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Random\Engine; + +use Symfony\Polyfill\Php82 as p; + +if (\PHP_VERSION_ID < 80200) { + final class Secure extends p\Random\Engine\Secure implements \Random\CryptoSafeEngine + { + } +} diff --git a/vendor/symfony/polyfill-php82/Resources/stubs/Random/RandomError.php b/vendor/symfony/polyfill-php82/Resources/stubs/Random/RandomError.php new file mode 100644 index 000000000..bf5e89e01 --- /dev/null +++ b/vendor/symfony/polyfill-php82/Resources/stubs/Random/RandomError.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Random; + +use Symfony\Polyfill\Php82\NoDynamicProperties; + +if (\PHP_VERSION_ID < 80200) { + class RandomError extends \Error + { + use NoDynamicProperties; + } +} diff --git a/vendor/symfony/polyfill-php82/Resources/stubs/Random/RandomException.php b/vendor/symfony/polyfill-php82/Resources/stubs/Random/RandomException.php new file mode 100644 index 000000000..3b9aae140 --- /dev/null +++ b/vendor/symfony/polyfill-php82/Resources/stubs/Random/RandomException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Random; + +use Symfony\Polyfill\Php82\NoDynamicProperties; + +if (\PHP_VERSION_ID < 80200) { + class RandomException extends \Exception + { + use NoDynamicProperties; + } +} diff --git a/vendor/symfony/polyfill-php82/Resources/stubs/SensitiveParameter.php b/vendor/symfony/polyfill-php82/Resources/stubs/SensitiveParameter.php new file mode 100644 index 000000000..aea4dfbdd --- /dev/null +++ b/vendor/symfony/polyfill-php82/Resources/stubs/SensitiveParameter.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80200) { + #[Attribute(Attribute::TARGET_PARAMETER)] + final class SensitiveParameter + { + public function __construct() + { + } + } +} diff --git a/vendor/symfony/polyfill-php82/Resources/stubs/SensitiveParameterValue.php b/vendor/symfony/polyfill-php82/Resources/stubs/SensitiveParameterValue.php new file mode 100644 index 000000000..8349170b6 --- /dev/null +++ b/vendor/symfony/polyfill-php82/Resources/stubs/SensitiveParameterValue.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80200) { + final class SensitiveParameterValue extends Symfony\Polyfill\Php82\SensitiveParameterValue + { + } +} diff --git a/vendor/symfony/polyfill-php82/SensitiveParameterValue.php b/vendor/symfony/polyfill-php82/SensitiveParameterValue.php new file mode 100644 index 000000000..944c0a659 --- /dev/null +++ b/vendor/symfony/polyfill-php82/SensitiveParameterValue.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php82; + +/** + * @author Tim Düsterhus + * + * @internal + */ +class SensitiveParameterValue +{ + private $value; + + public function __construct($value) + { + $this->value = $value; + } + + public function getValue() + { + return $this->value; + } + + public function __debugInfo(): array + { + return []; + } + + public function __sleep(): array + { + throw new \Exception("Serialization of 'SensitiveParameterValue' is not allowed"); + } + + public function __wakeup(): void + { + throw new \Exception("Unserialization of 'SensitiveParameterValue' is not allowed"); + } +} diff --git a/vendor/symfony/polyfill-php82/bootstrap.php b/vendor/symfony/polyfill-php82/bootstrap.php new file mode 100644 index 000000000..f875f3947 --- /dev/null +++ b/vendor/symfony/polyfill-php82/bootstrap.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php82 as p; + +if (\PHP_VERSION_ID >= 80200) { + return; +} + +if (!extension_loaded('odbc')) { + return; +} + +if (!function_exists('odbc_connection_string_is_quoted')) { + function odbc_connection_string_is_quoted(string $str): bool { return p\Php82::odbc_connection_string_is_quoted($str); } +} + +if (!function_exists('odbc_connection_string_should_quote')) { + function odbc_connection_string_should_quote(string $str): bool { return p\Php82::odbc_connection_string_should_quote($str); } +} + +if (!function_exists('odbc_connection_string_quote')) { + function odbc_connection_string_quote(string $str): string { return p\Php82::odbc_connection_string_quote($str); } +} + +if (!function_exists('ini_parse_quantity')) { + function ini_parse_quantity(string $shorthand): int { return p\Php82::ini_parse_quantity($shorthand); } +} diff --git a/vendor/symfony/polyfill-php82/composer.json b/vendor/symfony/polyfill-php82/composer.json new file mode 100644 index 000000000..e0422658a --- /dev/null +++ b/vendor/symfony/polyfill-php82/composer.json @@ -0,0 +1,36 @@ +{ + "name": "symfony/polyfill-php82", + "type": "library", + "description": "Symfony polyfill backporting some PHP 8.2+ features to lower PHP versions", + "keywords": ["polyfill", "shim", "compatibility", "portable"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Php82\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} -- cgit v1.2.3