summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
Diffstat (limited to 'vendor')
-rw-r--r--vendor/autoload.php18
-rw-r--r--vendor/composer/ClassLoader.php156
-rw-r--r--vendor/composer/InstalledVersions.php564
-rw-r--r--vendor/composer/LICENSE2
-rw-r--r--vendor/composer/autoload_classmap.php2
-rw-r--r--vendor/composer/autoload_files.php9
-rw-r--r--vendor/composer/autoload_namespaces.php2
-rw-r--r--vendor/composer/autoload_psr4.php7
-rw-r--r--vendor/composer/autoload_real.php49
-rw-r--r--vendor/composer/autoload_static.php38
-rw-r--r--vendor/composer/installed.json270
-rw-r--r--vendor/composer/installed.php847
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/.editorconfig16
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/.github/workflows/main.yaml44
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/.gitignore17
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/CONTRIBUTING.md3
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/LICENSE21
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/README.md219
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/build/.gitignore2
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/composer.json62
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/examples/config.php26
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/examples/jaeger.php51
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/phpcs.xml.dist37
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/phpunit.xml.dist47
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/scripts/thrift-gen.sh27
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/AgentClient/HttpAgentClient.php27
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/BinaryCodec.php39
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/CodecInterface.php36
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/CodecUtility.php41
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/TextCodec.php184
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/ZipkinCodec.php85
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Config.php390
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Constants.php100
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Mapper/SpanToJaegerMapper.php171
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/CompositeReporter.php51
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/InMemoryReporter.php47
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/JaegerReporter.php35
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/LoggingReporter.php51
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/NullReporter.php32
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/RemoteReporter.php46
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/ReporterInterface.php28
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/AbstractReporterFactory.php23
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/JaegerHttpReporterFactory.php35
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/JaegerReporterFactory.php44
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/ReporterFactoryInterface.php10
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/ZipkinReporterFactory.php46
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/ConstSampler.php68
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/ProbabilisticSampler.php88
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/RateLimitingSampler.php62
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/SamplerInterface.php29
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Scope.php71
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ScopeManager.php45
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sender/JaegerSender.php236
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sender/SenderInterface.php12
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sender/UdpSender.php305
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Span.php476
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/SpanContext.php120
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AgentClient.php76
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AgentIf.php30
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Agent_emitBatch_args.php56
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Agent_emitZipkinBatch_args.php60
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidatorClient.php83
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidatorIf.php27
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidator_validateTrace_args.php55
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidator_validateTrace_result.php56
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestriction.php65
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManagerClient.php83
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManagerIf.php31
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManager_getBaggageRestrictions_args.php55
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManager_getBaggageRestrictions_result.php60
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependencies.php61
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/DependencyClient.php105
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/DependencyIf.php31
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/DependencyLink.php74
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependency_getDependenciesForTrace_args.php55
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependency_getDependenciesForTrace_result.php56
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependency_saveDependencies_args.php56
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/OperationSamplingStrategy.php66
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/PerOperationSamplingStrategies.php88
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/ProbabilisticSamplingStrategy.php56
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/RateLimitingSamplingStrategy.php56
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManagerClient.php83
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManagerIf.php27
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManager_getSamplingStrategy_args.php55
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManager_getSamplingStrategy_result.php56
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingStrategyResponse.php86
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingStrategyType.php28
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/ValidateTraceResponse.php65
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Annotation.php87
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/AnnotationType.php38
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/BinaryAnnotation.php106
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Constant.php246
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Endpoint.php108
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Response.php56
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Span.php190
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollectorClient.php83
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollectorIf.php27
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollector_submitZipkinBatch_args.php60
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollector_submitZipkinBatch_result.php60
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Batch.php71
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/BatchSubmitResponse.php56
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/CollectorClient.php83
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/CollectorIf.php27
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Collector_submitBatches_args.php60
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Collector_submitBatches_result.php60
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/Downstream.php102
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/JoinTraceRequest.php66
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/ObservedSpan.php74
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/StartTraceRequest.php84
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TraceResponse.php82
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedServiceClient.php134
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedServiceIf.php40
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_joinTrace_args.php56
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_joinTrace_result.php56
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_startTrace_args.php56
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_startTrace_result.php56
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/Transport.php30
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Log.php70
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Process.php70
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Span.php161
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/SpanRef.php83
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/SpanRefType.php28
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Tag.php110
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/TagType.php34
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ThriftUdpTransport.php151
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Tracer.php420
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Util/RateLimiter.php128
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Codec/TextCodecTest.php170
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Codec/ZipkinCodecTest.php104
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ConfigTest.php257
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Logger/StackLogger.php30
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Mapper/SpanToJaegerMapperTest.php169
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/CompositeReporterTest.php52
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/InMemoryReporterTest.php24
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/LoggingReporterTest.php31
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/NullReporterTest.php29
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/RemoteReporterTest.php46
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sampler/ConstSamplerTest.php43
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sampler/ProbablisticSamplerTest.php68
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sampler/RateLimitSamplerTest.php48
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ScopeManagerTest.php49
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ScopeTest.php58
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sender/JaegerThriftSenderTest.php126
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sender/UdpSenderTest.php116
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/SpanContextTest.php37
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/SpanTest.php293
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ThriftUdpTransportTest.php166
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/TracerTest.php262
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/README.md48
-rw-r--r--vendor/jonahgeorge/jaeger-client-php/tests/php-test.sh64
-rw-r--r--vendor/opentracing/opentracing/.github/ISSUE_TEMPLATE.md21
-rw-r--r--vendor/opentracing/opentracing/.github/PULL_REQUEST_TEMPLATE.md24
-rw-r--r--vendor/opentracing/opentracing/.github/workflows/ci.yml44
-rw-r--r--vendor/opentracing/opentracing/.gitignore4
-rw-r--r--vendor/opentracing/opentracing/CONTRIBUTING.md75
-rw-r--r--vendor/opentracing/opentracing/LICENSE201
-rw-r--r--vendor/opentracing/opentracing/README.md306
-rw-r--r--vendor/opentracing/opentracing/composer.json44
-rw-r--r--vendor/opentracing/opentracing/phpstan.neon5
-rw-r--r--vendor/opentracing/opentracing/phpunit.xml27
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/Formats.php49
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/GlobalTracer.php60
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/InvalidReferenceArgumentException.php33
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/InvalidReferencesSetException.php30
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/InvalidSpanOptionException.php131
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/Mock/MockScope.php62
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/Mock/MockScopeManager.php49
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/Mock/MockSpan.php145
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/Mock/MockSpanContext.php100
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/Mock/MockTracer.php152
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/NoopScope.php23
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/NoopScopeManager.php24
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/NoopSpan.php67
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/NoopSpanContext.php35
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/NoopTracer.php62
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/Reference.php77
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/Scope.php32
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/ScopeManager.php40
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/Span.php95
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/SpanContext.php37
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/StartSpanOptions.php206
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/Tags.php124
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/Tracer.php119
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/UnsupportedFormatException.php22
-rw-r--r--vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockScopeManagerTest.php63
-rw-r--r--vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockSpanContextTest.php54
-rw-r--r--vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockSpanTest.php52
-rw-r--r--vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockTracerTest.php139
-rw-r--r--vendor/opentracing/opentracing/tests/OpenTracing/ReferenceTest.php45
-rw-r--r--vendor/opentracing/opentracing/tests/OpenTracing/StartSpanOptionsTest.php129
-rw-r--r--vendor/packaged/thrift/.gitignore2
-rw-r--r--vendor/packaged/thrift/README.md44
-rw-r--r--vendor/packaged/thrift/composer.json16
-rw-r--r--vendor/packaged/thrift/src/Base/TBase.php382
-rw-r--r--vendor/packaged/thrift/src/ClassLoader/ThriftClassLoader.php206
-rw-r--r--vendor/packaged/thrift/src/Exception/TApplicationException.php76
-rw-r--r--vendor/packaged/thrift/src/Exception/TException.php384
-rw-r--r--vendor/packaged/thrift/src/Exception/TProtocolException.php50
-rw-r--r--vendor/packaged/thrift/src/Exception/TTransportException.php40
-rw-r--r--vendor/packaged/thrift/src/Factory/TBinaryProtocolFactory.php45
-rw-r--r--vendor/packaged/thrift/src/Factory/TCompactProtocolFactory.php40
-rw-r--r--vendor/packaged/thrift/src/Factory/TJSONProtocolFactory.php40
-rw-r--r--vendor/packaged/thrift/src/Factory/TProtocolFactory.php36
-rw-r--r--vendor/packaged/thrift/src/Factory/TStringFuncFactory.php66
-rw-r--r--vendor/packaged/thrift/src/Factory/TTransportFactory.php18
-rw-r--r--vendor/packaged/thrift/src/Protocol/JSON/BaseContext.php39
-rw-r--r--vendor/packaged/thrift/src/Protocol/JSON/ListContext.php54
-rw-r--r--vendor/packaged/thrift/src/Protocol/JSON/LookaheadReader.php57
-rw-r--r--vendor/packaged/thrift/src/Protocol/JSON/PairContext.php64
-rw-r--r--vendor/packaged/thrift/src/Protocol/SimpleJSON/CollectionMapKeyException.php33
-rw-r--r--vendor/packaged/thrift/src/Protocol/SimpleJSON/Context.php35
-rw-r--r--vendor/packaged/thrift/src/Protocol/SimpleJSON/ListContext.php45
-rw-r--r--vendor/packaged/thrift/src/Protocol/SimpleJSON/MapContext.php47
-rw-r--r--vendor/packaged/thrift/src/Protocol/SimpleJSON/StructContext.php52
-rw-r--r--vendor/packaged/thrift/src/Protocol/TBinaryProtocol.php453
-rw-r--r--vendor/packaged/thrift/src/Protocol/TBinaryProtocolAccelerated.php67
-rw-r--r--vendor/packaged/thrift/src/Protocol/TCompactProtocol.php739
-rw-r--r--vendor/packaged/thrift/src/Protocol/TJSONProtocol.php815
-rw-r--r--vendor/packaged/thrift/src/Protocol/TMultiplexedProtocol.php85
-rw-r--r--vendor/packaged/thrift/src/Protocol/TProtocol.php352
-rw-r--r--vendor/packaged/thrift/src/Protocol/TProtocolDecorator.php285
-rw-r--r--vendor/packaged/thrift/src/Protocol/TSimpleJSONProtocol.php374
-rw-r--r--vendor/packaged/thrift/src/Serializer/TBinarySerializer.php87
-rw-r--r--vendor/packaged/thrift/src/Server/TForkingServer.php125
-rw-r--r--vendor/packaged/thrift/src/Server/TSSLServerSocket.php97
-rw-r--r--vendor/packaged/thrift/src/Server/TServer.php102
-rw-r--r--vendor/packaged/thrift/src/Server/TServerSocket.php124
-rw-r--r--vendor/packaged/thrift/src/Server/TServerTransport.php56
-rw-r--r--vendor/packaged/thrift/src/Server/TSimpleServer.php60
-rw-r--r--vendor/packaged/thrift/src/StoredMessageProtocol.php53
-rw-r--r--vendor/packaged/thrift/src/StringFunc/Core.php40
-rw-r--r--vendor/packaged/thrift/src/StringFunc/Mbstring.php46
-rw-r--r--vendor/packaged/thrift/src/StringFunc/TStringFunc.php28
-rw-r--r--vendor/packaged/thrift/src/TMultiplexedProcessor.php118
-rw-r--r--vendor/packaged/thrift/src/Transport/TBufferedTransport.php206
-rw-r--r--vendor/packaged/thrift/src/Transport/TCurlClient.php281
-rw-r--r--vendor/packaged/thrift/src/Transport/TFramedTransport.php192
-rw-r--r--vendor/packaged/thrift/src/Transport/THttpClient.php258
-rw-r--r--vendor/packaged/thrift/src/Transport/TMemoryBuffer.php106
-rw-r--r--vendor/packaged/thrift/src/Transport/TNullTransport.php56
-rw-r--r--vendor/packaged/thrift/src/Transport/TPhpStream.php124
-rw-r--r--vendor/packaged/thrift/src/Transport/TSSLSocket.php117
-rw-r--r--vendor/packaged/thrift/src/Transport/TSocket.php366
-rw-r--r--vendor/packaged/thrift/src/Transport/TSocketPool.php310
-rw-r--r--vendor/packaged/thrift/src/Transport/TTransport.php98
-rw-r--r--vendor/packaged/thrift/src/Type/TConstant.php52
-rw-r--r--vendor/packaged/thrift/src/Type/TMessageType.php34
-rw-r--r--vendor/packaged/thrift/src/Type/TType.php47
-rw-r--r--vendor/packaged/thrift/update.sh22
-rw-r--r--vendor/psr/cache/CHANGELOG.md16
-rw-r--r--vendor/psr/cache/LICENSE.txt19
-rw-r--r--vendor/psr/cache/README.md12
-rw-r--r--vendor/psr/cache/composer.json25
-rw-r--r--vendor/psr/cache/src/CacheException.php10
-rw-r--r--vendor/psr/cache/src/CacheItemInterface.php105
-rw-r--r--vendor/psr/cache/src/CacheItemPoolInterface.php138
-rw-r--r--vendor/psr/cache/src/InvalidArgumentException.php13
-rw-r--r--vendor/psr/log/LICENSE19
-rw-r--r--vendor/psr/log/README.md58
-rw-r--r--vendor/psr/log/composer.json26
-rw-r--r--vendor/psr/log/src/AbstractLogger.php15
-rw-r--r--vendor/psr/log/src/InvalidArgumentException.php7
-rw-r--r--vendor/psr/log/src/LogLevel.php18
-rw-r--r--vendor/psr/log/src/LoggerAwareInterface.php18
-rw-r--r--vendor/psr/log/src/LoggerAwareTrait.php26
-rw-r--r--vendor/psr/log/src/LoggerInterface.php125
-rw-r--r--vendor/psr/log/src/LoggerTrait.php142
-rw-r--r--vendor/psr/log/src/NullLogger.php30
268 files changed, 24607 insertions, 677 deletions
diff --git a/vendor/autoload.php b/vendor/autoload.php
index 8235051f8..e6e3ad736 100644
--- a/vendor/autoload.php
+++ b/vendor/autoload.php
@@ -2,24 +2,6 @@
// 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 a72151c77..4d989a212 100644
--- a/vendor/composer/ClassLoader.php
+++ b/vendor/composer/ClassLoader.php
@@ -42,79 +42,30 @@ namespace Composer\Autoload;
*/
class ClassLoader
{
- /** @var \Closure(string):void */
- private static $includeFile;
-
- /** @var ?string */
private $vendorDir;
// PSR-4
- /**
- * @var array[]
- * @psalm-var array<string, array<string, int>>
- */
private $prefixLengthsPsr4 = array();
- /**
- * @var array[]
- * @psalm-var array<string, array<int, string>>
- */
private $prefixDirsPsr4 = array();
- /**
- * @var array[]
- * @psalm-var array<string, string>
- */
private $fallbackDirsPsr4 = array();
// PSR-0
- /**
- * @var array[]
- * @psalm-var array<string, array<string, string[]>>
- */
private $prefixesPsr0 = array();
- /**
- * @var array[]
- * @psalm-var array<string, string>
- */
private $fallbackDirsPsr0 = array();
- /** @var bool */
private $useIncludePath = false;
-
- /**
- * @var string[]
- * @psalm-var array<string, string>
- */
private $classMap = array();
-
- /** @var bool */
private $classMapAuthoritative = false;
-
- /**
- * @var bool[]
- * @psalm-var array<string, bool>
- */
private $missingClasses = array();
-
- /** @var ?string */
private $apcuPrefix;
- /**
- * @var self[]
- */
private static $registeredLoaders = array();
- /**
- * @param ?string $vendorDir
- */
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
- self::initializeIncludeClosure();
}
- /**
- * @return string[]
- */
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
@@ -124,47 +75,28 @@ class ClassLoader
return array();
}
- /**
- * @return array[]
- * @psalm-return array<string, array<int, string>>
- */
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
- /**
- * @return array[]
- * @psalm-return array<string, string>
- */
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
- /**
- * @return array[]
- * @psalm-return array<string, string>
- */
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
- /**
- * @return string[] Array of classname => path
- * @psalm-return array<string, string>
- */
public function getClassMap()
{
return $this->classMap;
}
/**
- * @param string[] $classMap Class to filename map
- * @psalm-param array<string, string> $classMap
- *
- * @return void
+ * @param array $classMap Class to filename map
*/
public function addClassMap(array $classMap)
{
@@ -179,11 +111,9 @@ 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 string[]|string $paths The PSR-0 root directories
- * @param bool $prepend Whether to prepend the directories
- *
- * @return void
+ * @param string $prefix The prefix
+ * @param array|string $paths The PSR-0 root directories
+ * @param bool $prepend Whether to prepend the directories
*/
public function add($prefix, $paths, $prepend = false)
{
@@ -226,13 +156,11 @@ 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 string[]|string $paths The PSR-4 base directories
- * @param bool $prepend Whether to prepend the directories
+ * @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
*
* @throws \InvalidArgumentException
- *
- * @return void
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
@@ -276,10 +204,8 @@ 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 string[]|string $paths The PSR-0 base directories
- *
- * @return void
+ * @param string $prefix The prefix
+ * @param array|string $paths The PSR-0 base directories
*/
public function set($prefix, $paths)
{
@@ -294,12 +220,10 @@ 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 string[]|string $paths The PSR-4 base directories
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param array|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
- *
- * @return void
*/
public function setPsr4($prefix, $paths)
{
@@ -319,8 +243,6 @@ class ClassLoader
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
- *
- * @return void
*/
public function setUseIncludePath($useIncludePath)
{
@@ -343,8 +265,6 @@ class ClassLoader
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
- *
- * @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
@@ -365,8 +285,6 @@ 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)
{
@@ -387,18 +305,14 @@ 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) {
- return;
- }
-
- if ($prepend) {
+ //no-op
+ } elseif ($prepend) {
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
} else {
unset(self::$registeredLoaders[$this->vendorDir]);
@@ -408,8 +322,6 @@ class ClassLoader
/**
* Unregisters this instance as an autoloader.
- *
- * @return void
*/
public function unregister()
{
@@ -424,18 +336,15 @@ class ClassLoader
* Loads the given class or interface.
*
* @param string $class The name of the class
- * @return true|null True if loaded, null otherwise
+ * @return bool|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
- $includeFile = self::$includeFile;
- $includeFile($file);
+ includeFile($file);
return true;
}
-
- return null;
}
/**
@@ -490,11 +399,6 @@ class ClassLoader
return self::$registeredLoaders;
}
- /**
- * @param string $class
- * @param string $ext
- * @return string|false
- */
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
@@ -560,26 +464,14 @@ class ClassLoader
return false;
}
+}
- /**
- * @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);
- }
+/**
+ * Scope isolated include.
+ *
+ * Prevents access to $this/self from included files.
+ */
+function includeFile($file)
+{
+ include $file;
}
diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php
index c6b54af7b..cf83ee179 100644
--- a/vendor/composer/InstalledVersions.php
+++ b/vendor/composer/InstalledVersions.php
@@ -18,29 +18,459 @@ use Composer\Semver\VersionParser;
/**
* This class is copied in every Composer installed project and available to all
*
- * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
- *
- * To require its presence, you can require `composer-runtime-api ^2.0`
- *
- * @final
+ * To require it's presence, you can require `composer-runtime-api ^2.0`
*/
class InstalledVersions
{
- /**
- * @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<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
- */
- private static $installed;
-
- /**
- * @var bool|null
- */
+ 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',
+ ),
+ ),
+);
private static $canGetVendors;
-
- /**
- * @var array[]
- * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
- */
private static $installedByVendor = array();
/**
@@ -56,6 +486,7 @@ class InstalledVersions
$packages[] = array_keys($installed['versions']);
}
+
if (1 === \count($packages)) {
return $packages[0];
}
@@ -64,41 +495,18 @@ class InstalledVersions
}
/**
- * Returns a list of all package names with a specific type e.g. 'library'
- *
- * @param string $type
- * @return string[]
- * @psalm-return list<string>
- */
- 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, $includeDevRequirements = true)
+ public static function isInstalled($packageName)
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
- return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
+ return true;
}
}
@@ -112,9 +520,10 @@ 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)
@@ -225,25 +634,8 @@ class InstalledVersions
}
/**
- * @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, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
+ * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[]}
*/
public static function getRootPackage()
{
@@ -255,39 +647,15 @@ 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, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
+ * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[]}, versions: list<string, array{pretty_version: ?string, version: ?string, aliases: ?string[], reference: ?string, replaced: ?string[], provided: ?string[]}>}
*/
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<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
- */
- public static function getAllRawData()
- {
- return self::getInstalled();
- }
-
- /**
* Lets you reload the static array from another file
*
* This is only useful for complex integrations in which a project needs to use
@@ -303,7 +671,7 @@ class InstalledVersions
* @param array[] $data A vendor/composer/installed.php data set
* @return void
*
- * @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<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
+ * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[]}, versions: list<string, array{pretty_version: ?string, version: ?string, aliases: ?string[], reference: ?string, replaced: ?string[], provided: ?string[]}>} $data
*/
public static function reload($data)
{
@@ -313,7 +681,6 @@ class InstalledVersions
/**
* @return array[]
- * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
private static function getInstalled()
{
@@ -324,27 +691,16 @@ 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';
- if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
- self::$installed = $installed[count($installed) - 1];
- }
}
}
}
- 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 = require __DIR__ . '/installed.php';
- } else {
- self::$installed = array();
- }
- }
$installed[] = self::$installed;
return $installed;
diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE
index f27399a04..62ecfd8d0 100644
--- a/vendor/composer/LICENSE
+++ b/vendor/composer/LICENSE
@@ -1,4 +1,3 @@
-
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -18,4 +17,3 @@ 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 6835b271a..9e751e17c 100644
--- a/vendor/composer/autoload_classmap.php
+++ b/vendor/composer/autoload_classmap.php
@@ -2,7 +2,7 @@
// autoload_classmap.php @generated by Composer
-$vendorDir = dirname(__DIR__);
+$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php
index cfc7a8338..f940286e8 100644
--- a/vendor/composer/autoload_files.php
+++ b/vendor/composer/autoload_files.php
@@ -2,10 +2,12 @@
// autoload_files.php @generated by Composer
-$vendorDir = dirname(__DIR__);
+$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
+ '9b38cf48e83f5d8f60375221cd213eee' => $vendorDir . '/phpstan/phpstan/bootstrap.php',
+ 'ec07570ca5a812141189b1fa81503674' => $vendorDir . '/phpunit/phpunit/src/Framework/Assert/Functions.php',
'a4ecaeafb8cfb009ad0e052c90355e98' => $vendorDir . '/beberlei/assert/lib/Assert/functions.php',
'6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
'51fcf4e06c07cc00c920b44bcd900e7a' => $vendorDir . '/thecodingmachine/safe/deprecated/apc.php',
@@ -95,6 +97,7 @@ return array(
'4af1dca6db8c527c6eed27bff85ff0e5' => $vendorDir . '/thecodingmachine/safe/generated/yaz.php',
'fe43ca06499ac37bc2dedd823af71eb5' => $vendorDir . '/thecodingmachine/safe/generated/zip.php',
'356736db98a6834f0a886b8d509b0ecd' => $vendorDir . '/thecodingmachine/safe/generated/zlib.php',
- '9b38cf48e83f5d8f60375221cd213eee' => $vendorDir . '/phpstan/phpstan/bootstrap.php',
- 'ec07570ca5a812141189b1fa81503674' => $vendorDir . '/phpunit/phpunit/src/Framework/Assert/Functions.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',
);
diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php
index 15a2ff3ad..b7fc0125d 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(__DIR__);
+$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php
index e8aa5c7b4..98ef4f1fd 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(__DIR__);
+$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
@@ -10,10 +10,15 @@ 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'),
+ 'Psr\\Log\\' => array($vendorDir . '/psr/log/src'),
+ 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/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'),
'OTPHP\\' => array($vendorDir . '/spomky-labs/otphp/src'),
+ 'Jaeger\\' => array($vendorDir . '/jonahgeorge/jaeger-client-php/src/Jaeger'),
'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 ebee29895..51b54d2f0 100644
--- a/vendor/composer/autoload_real.php
+++ b/vendor/composer/autoload_real.php
@@ -23,26 +23,51 @@ class ComposerAutoloaderInit19fc2ff1c0f9a92279c7979386bb2056
}
spl_autoload_register(array('ComposerAutoloaderInit19fc2ff1c0f9a92279c7979386bb2056', 'loadClassLoader'), true, true);
- self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit19fc2ff1c0f9a92279c7979386bb2056', 'loadClassLoader'));
- require __DIR__ . '/autoload_static.php';
- call_user_func(\Composer\Autoload\ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056::getInitializer($loader));
+ $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';
- $loader->register(true);
+ call_user_func(\Composer\Autoload\ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056::getInitializer($loader));
+ } else {
+ $map = require __DIR__ . '/autoload_namespaces.php';
+ foreach ($map as $namespace => $path) {
+ $loader->set($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;
+ $map = require __DIR__ . '/autoload_psr4.php';
+ foreach ($map as $namespace => $path) {
+ $loader->setPsr4($namespace, $path);
+ }
- require $file;
+ $classMap = require __DIR__ . '/autoload_classmap.php';
+ if ($classMap) {
+ $loader->addClassMap($classMap);
}
- }, null, null);
- foreach ($filesToLoad as $fileIdentifier => $file) {
- $requireFile($fileIdentifier, $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);
}
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 a9ddd4831..67d12d734 100644
--- a/vendor/composer/autoload_static.php
+++ b/vendor/composer/autoload_static.php
@@ -7,6 +7,8 @@ namespace Composer\Autoload;
class ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056
{
public static $files = array (
+ '9b38cf48e83f5d8f60375221cd213eee' => __DIR__ . '/..' . '/phpstan/phpstan/bootstrap.php',
+ 'ec07570ca5a812141189b1fa81503674' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Assert/Functions.php',
'a4ecaeafb8cfb009ad0e052c90355e98' => __DIR__ . '/..' . '/beberlei/assert/lib/Assert/functions.php',
'6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
'51fcf4e06c07cc00c920b44bcd900e7a' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/apc.php',
@@ -96,8 +98,9 @@ class ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056
'4af1dca6db8c527c6eed27bff85ff0e5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/yaz.php',
'fe43ca06499ac37bc2dedd823af71eb5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/zip.php',
'356736db98a6834f0a886b8d509b0ecd' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/zlib.php',
- '9b38cf48e83f5d8f60375221cd213eee' => __DIR__ . '/..' . '/phpstan/phpstan/bootstrap.php',
- 'ec07570ca5a812141189b1fa81503674' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Assert/Functions.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',
);
public static $prefixLengthsPsr4 = array (
@@ -114,16 +117,27 @@ class ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056
array (
'Webmozart\\Assert\\' => 17,
),
+ 'T' =>
+ array (
+ 'Thrift\\' => 7,
+ ),
'P' =>
array (
+ 'Psr\\Log\\' => 8,
+ 'Psr\\Cache\\' => 10,
'Prophecy\\' => 9,
'PhpParser\\' => 10,
'ParagonIE\\ConstantTime\\' => 23,
),
'O' =>
array (
+ 'OpenTracing\\' => 12,
'OTPHP\\' => 6,
),
+ 'J' =>
+ array (
+ 'Jaeger\\' => 7,
+ ),
'D' =>
array (
'Doctrine\\Instantiator\\' => 22,
@@ -154,6 +168,18 @@ class ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056
array (
0 => __DIR__ . '/..' . '/webmozart/assert/src',
),
+ 'Thrift\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/packaged/thrift/src',
+ ),
+ 'Psr\\Log\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/psr/log/src',
+ ),
+ 'Psr\\Cache\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/psr/cache/src',
+ ),
'Prophecy\\' =>
array (
0 => __DIR__ . '/..' . '/phpspec/prophecy/src/Prophecy',
@@ -166,10 +192,18 @@ class ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056
array (
0 => __DIR__ . '/..' . '/paragonie/constant_time_encoding/src',
),
+ 'OpenTracing\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/opentracing/opentracing/src/OpenTracing',
+ ),
'OTPHP\\' =>
array (
0 => __DIR__ . '/..' . '/spomky-labs/otphp/src',
),
+ 'Jaeger\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/jonahgeorge/jaeger-client-php/src/Jaeger',
+ ),
'Doctrine\\Instantiator\\' =>
array (
0 => __DIR__ . '/..' . '/doctrine/instantiator/src/Doctrine/Instantiator',
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 6a7b5c878..0be499810 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -360,6 +360,77 @@
"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": "[email protected]"
+ },
+ {
+ "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",
"version_normalized": "2.2.0.0",
@@ -527,6 +598,100 @@
"install-path": "../nikic/php-parser"
},
{
+ "name": "opentracing/opentracing",
+ "version": "1.0.2",
+ "version_normalized": "1.0.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/opentracing/opentracing-php.git",
+ "reference": "cd60bd1fb2a25280600bc74c7f9e0c13881a9116"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/opentracing/opentracing-php/zipball/cd60bd1fb2a25280600bc74c7f9e0c13881a9116",
+ "reference": "cd60bd1fb2a25280600bc74c7f9e0c13881a9116",
+ "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",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "src/OpenTracing/Tags.php",
+ "src/OpenTracing/Formats.php"
+ ],
+ "psr-4": {
+ "OpenTracing\\": "src/OpenTracing/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "Apache-2.0"
+ ],
+ "authors": [
+ {
+ "name": "José Carlos Chávez",
+ "email": "[email protected]"
+ }
+ ],
+ "description": "OpenTracing API for PHP",
+ "support": {
+ "issues": "https://github.com/opentracing/opentracing-php/issues",
+ "source": "https://github.com/opentracing/opentracing-php/tree/1.0.2"
+ },
+ "install-path": "../opentracing/opentracing"
+ },
+ {
+ "name": "packaged/thrift",
+ "version": "0.13.01",
+ "version_normalized": "0.13.01.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/packaged/thrift.git",
+ "reference": "e3dbcfb79e319971d64264ffe9c340590cc8a228"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/packaged/thrift/zipball/e3dbcfb79e319971d64264ffe9c340590cc8a228",
+ "reference": "e3dbcfb79e319971d64264ffe9c340590cc8a228",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5 || ^7.0 || ^8.0"
+ },
+ "time": "2021-01-25T13:32:28+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Thrift\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "Apache-2.0"
+ ],
+ "description": "Apache Thrift",
+ "homepage": "http://thrift.apache.org/",
+ "keywords": [
+ "apache",
+ "thrift"
+ ],
+ "support": {
+ "issues": "https://github.com/packaged/thrift/issues",
+ "source": "https://github.com/packaged/thrift/tree/0.13.01"
+ },
+ "install-path": "../packaged/thrift"
+ },
+ {
"name": "paragonie/constant_time_encoding",
"version": "v2.6.3",
"version_normalized": "2.6.3.0",
@@ -1454,6 +1619,111 @@
"install-path": "../phpunit/phpunit"
},
{
+ "name": "psr/cache",
+ "version": "3.0.0",
+ "version_normalized": "3.0.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/cache.git",
+ "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf",
+ "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.0.0"
+ },
+ "time": "2021-02-03T23:26:27+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Cache\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for caching libraries",
+ "keywords": [
+ "cache",
+ "psr",
+ "psr-6"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/cache/tree/3.0.0"
+ },
+ "install-path": "../psr/cache"
+ },
+ {
+ "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": "sebastian/cli-parser",
"version": "1.0.1",
"version_normalized": "1.0.1.0",
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
index 13f4018bf..cec06e2b7 100644
--- a/vendor/composer/installed.php
+++ b/vendor/composer/installed.php
@@ -1,403 +1,448 @@
-<?php return array(
- 'root' => array(
- 'name' => '__root__',
- 'pretty_version' => 'dev-master',
- 'version' => 'dev-master',
- 'reference' => 'b7a6c948d078a59739f14de8454e0e7237d0722e',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../../',
- 'aliases' => array(),
- 'dev' => true,
- ),
- 'versions' => array(
- '__root__' => array(
- 'pretty_version' => 'dev-master',
- 'version' => 'dev-master',
- 'reference' => 'b7a6c948d078a59739f14de8454e0e7237d0722e',
- '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,
- ),
- '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,
- ),
- '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,
- ),
- '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,
- ),
- '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,
- ),
- '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,
- ),
+<?php return 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',
+ ),
+ ),
);
diff --git a/vendor/jonahgeorge/jaeger-client-php/.editorconfig b/vendor/jonahgeorge/jaeger-client-php/.editorconfig
new file mode 100644
index 000000000..1492202b4
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/.editorconfig
@@ -0,0 +1,16 @@
+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
new file mode 100644
index 000000000..d0e5dc1f5
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/.github/workflows/main.yaml
@@ -0,0 +1,44 @@
+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
new file mode 100644
index 000000000..07dc555db
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/.gitignore
@@ -0,0 +1,17 @@
+# 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
new file mode 100644
index 000000000..e5ec5ed4f
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/CONTRIBUTING.md
@@ -0,0 +1,3 @@
+# 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
new file mode 100644
index 000000000..8e37af0cb
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/LICENSE
@@ -0,0 +1,21 @@
+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
new file mode 100644
index 000000000..6396bb70f
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/README.md
@@ -0,0 +1,219 @@
+![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
+<?php
+
+require_once 'vendor/autoload.php';
+
+use Jaeger\Config;
+use OpenTracing\GlobalTracer;
+
+$config = new Config(
+ [
+ 'sampler' => [
+ '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
new file mode 100644
index 000000000..d6b7ef32c
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/build/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/vendor/jonahgeorge/jaeger-client-php/composer.json b/vendor/jonahgeorge/jaeger-client-php/composer.json
new file mode 100644
index 000000000..a9bb99a06
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/composer.json
@@ -0,0 +1,62 @@
+{
+ "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": "[email protected]"
+ },
+ {
+ "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
new file mode 100644
index 000000000..5c4726165
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/examples/config.php
@@ -0,0 +1,26 @@
+<?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,
+];
diff --git a/vendor/jonahgeorge/jaeger-client-php/examples/jaeger.php b/vendor/jonahgeorge/jaeger-client-php/examples/jaeger.php
new file mode 100644
index 000000000..ed9304fe2
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/examples/jaeger.php
@@ -0,0 +1,51 @@
+<?php
+
+require_once __DIR__.'/../vendor/autoload.php';
+
+use Jaeger\Config;
+use OpenTracing\GlobalTracer;
+
+$config = new Config(
+ require_once __DIR__.'/config.php',
+ 'your-app-name'
+);
+
+$config->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
new file mode 100644
index 000000000..7d5db0974
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/phpcs.xml.dist
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<ruleset name="Jaeger">
+
+ <!--
+ The name attribute of the ruleset tag is displayed
+ when running PHP_CodeSniffer with the -v command line
+ argument. The description tag below is not displayed anywhere
+ except in this file, so it can contain information for
+ developers who may change this file in the future.
+ -->
+ <description>The coding standard for Jaeger Client</description>
+
+ <!-- Show sniff codes in all reports -->
+ <arg value="s"/>
+
+ <!-- Use PSR-2 as a base -->
+ <rule ref="PSR2"/>
+
+ <!-- Uncomment to use colors in progress or report -->
+ <!-- arg name="colors" / -->
+
+ <!--
+ If no files or directories are specified on the command line
+ your custom standard can specify what files should be checked
+ instead.
+ Note that specifying any file or directory path
+ on the command line will ignore all file tags.
+ -->
+ <file>src</file>
+
+ <!--
+ You can hard-code ignore patterns directly into your
+ custom standard so you don't have to specify the
+ patterns on the command line.
+ -->
+ <exclude-pattern>src/Jaeger/Thrift/*</exclude-pattern>
+</ruleset>
diff --git a/vendor/jonahgeorge/jaeger-client-php/phpunit.xml.dist b/vendor/jonahgeorge/jaeger-client-php/phpunit.xml.dist
new file mode 100644
index 000000000..d6795d99b
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/phpunit.xml.dist
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
+ bootstrap="vendor/autoload.php"
+ colors="true"
+>
+ <filter>
+ <whitelist>
+ <directory suffix=".php">src/Jaeger</directory>
+ <exclude>
+ <directory suffix="Interface.php">src/</directory>
+ <file>src/Jaeger/Constants.php</file>
+ <file>src/Jaeger/Thrift/Agent/AgentIf.php</file>
+ <file>src/Jaeger/Thrift/Agent/AggregationValidatorIf.php</file>
+ <file>src/Jaeger/Thrift/Agent/BaggageRestrictionManagerIf.php</file>
+ <file>src/Jaeger/Thrift/Agent/DependencyIf.php</file>
+ <file>src/Jaeger/Thrift/Agent/SamplingManagerIf.php</file>
+ <file>src/Jaeger/Thrift/CollectorIf.php</file>
+ <file>src/Jaeger/Thrift/Crossdock/TracedServiceIf.php</file>
+ </exclude>
+ </whitelist>
+ </filter>
+
+ <testsuites>
+ <testsuite name="Jaeger Test Suite">
+ <directory suffix=".php">tests/Jaeger</directory>
+ </testsuite>
+ </testsuites>
+
+ <php>
+ <ini name="date.timezone" value="UTC"/>
+ <ini name="display_errors" value="on"/>
+ <ini name="display_startup_errors" value="on"/>
+ </php>
+
+ <logging>
+ <log
+ type="coverage-text"
+ target="php://stdout"
+ lowUpperBound="60"
+ highLowerBound="90"/>
+
+ <log
+ type="coverage-clover"
+ target="build/coverage.xml"/>
+ </logging>
+</phpunit>
diff --git a/vendor/jonahgeorge/jaeger-client-php/scripts/thrift-gen.sh b/vendor/jonahgeorge/jaeger-client-php/scripts/thrift-gen.sh
new file mode 100644
index 000000000..7420f915f
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/scripts/thrift-gen.sh
@@ -0,0 +1,27 @@
+#!/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
new file mode 100644
index 000000000..e270b76ac
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/AgentClient/HttpAgentClient.php
@@ -0,0 +1,27 @@
+<?php
+
+namespace Jaeger\AgentClient;
+
+class HttpAgentClient implements \Jaeger\Thrift\Agent\AgentIf
+{
+ protected $input_ = null;
+ protected $output_ = null;
+
+ protected $seqid_ = 0;
+
+ public function __construct($input, $output = null)
+ {
+ $this->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
new file mode 100644
index 000000000..36c2ffe2c
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/BinaryCodec.php
@@ -0,0 +1,39 @@
+<?php
+
+namespace Jaeger\Codec;
+
+use Jaeger\SpanContext;
+use OpenTracing\UnsupportedFormatException;
+
+class BinaryCodec implements CodecInterface
+{
+ /**
+ * {@inheritdoc}
+ *
+ * @see \Jaeger\Tracer::inject
+ *
+ * @param SpanContext $spanContext
+ * @param mixed $carrier
+ *
+ * @return void
+ */
+ public function inject(SpanContext $spanContext, &$carrier)
+ {
+ throw new UnsupportedFormatException('Binary encoding not implemented');
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * @see \Jaeger\Tracer::extract
+ *
+ * @param mixed $carrier
+ * @return SpanContext|null
+ *
+ * @throws UnsupportedFormatException
+ */
+ public function extract($carrier)
+ {
+ throw new UnsupportedFormatException('Binary encoding not implemented');
+ }
+}
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/CodecInterface.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/CodecInterface.php
new file mode 100644
index 000000000..2aa7d690d
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/CodecInterface.php
@@ -0,0 +1,36 @@
+<?php
+
+namespace Jaeger\Codec;
+
+use Jaeger\SpanContext;
+
+interface CodecInterface
+{
+ /**
+ * Handle the logic behind injecting propagation scheme specific information into the carrier
+ * (e.g. http request headers, amqp message headers, etc.).
+ *
+ * This method can modify the carrier.
+ *
+ * @see \Jaeger\Tracer::inject
+ *
+ * @param SpanContext $spanContext
+ * @param mixed $carrier
+ *
+ * @return void
+ */
+ public function inject(SpanContext $spanContext, &$carrier);
+
+ /**
+ * Handle the logic behind extracting propagation-scheme specific information from carrier
+ * (e.g. http request headers, amqp message headers, etc.).
+ *
+ * This method must not modify the carrier.
+ *
+ * @see \Jaeger\Tracer::extract
+ *
+ * @param mixed $carrier
+ * @return SpanContext|null
+ */
+ public function extract($carrier);
+}
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/CodecUtility.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/CodecUtility.php
new file mode 100644
index 000000000..eb86a1cde
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/CodecUtility.php
@@ -0,0 +1,41 @@
+<?php
+
+namespace Jaeger\Codec;
+
+class CodecUtility
+{
+
+ /**
+ * Incoming trace/span IDs are hex representations of 64-bit values. PHP
+ * represents ints internally as signed 32- or 64-bit values, but base_convert
+ * converts to string representations of arbitrarily large positive numbers.
+ * This means at least half the incoming IDs will be larger than PHP_INT_MAX.
+ *
+ * Thrift, while building a binary representation of the IDs, performs bitwise
+ * operations on the string values, implicitly casting to int and capping them
+ * at PHP_INT_MAX. So, incoming IDs larger than PHP_INT_MAX will be serialized
+ * and sent to the agent as PHP_INT_MAX, breaking trace/span correlation.
+ *
+ * This method therefore, on 64-bit architectures, splits the hex string into
+ * high and low values, converts them separately to ints, and manually combines
+ * them into a proper signed int. This int is then handled properly by the
+ * Thrift package.
+ *
+ * On 32-bit architectures, it falls back to base_convert.
+ *
+ * @param string $hex
+ * @return string|int
+ */
+ public static function hexToInt64($hex)
+ {
+ // If we're on a 32-bit architecture, fall back to base_convert.
+ if (PHP_INT_SIZE === 4) {
+ return base_convert($hex, 16, 10);
+ }
+
+ $hi = intval(substr($hex, -16, -8), 16);
+ $lo = intval(substr($hex, -8, 8), 16);
+
+ return $hi << 32 | $lo;
+ }
+}
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/TextCodec.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/TextCodec.php
new file mode 100644
index 000000000..d437f3812
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/TextCodec.php
@@ -0,0 +1,184 @@
+<?php
+
+namespace Jaeger\Codec;
+
+use Exception;
+use Jaeger\SpanContext;
+
+use const Jaeger\TRACE_ID_HEADER;
+use const Jaeger\BAGGAGE_HEADER_PREFIX;
+use const Jaeger\DEBUG_ID_HEADER_KEY;
+
+class TextCodec implements CodecInterface
+{
+ private $urlEncoding;
+ private $traceIdHeader;
+ private $baggagePrefix;
+ private $debugIdHeader;
+ private $prefixLength;
+
+ /**
+ * @param bool $urlEncoding
+ * @param string $traceIdHeader
+ * @param string $baggageHeaderPrefix
+ * @param string $debugIdHeader
+ */
+ public function __construct(
+ bool $urlEncoding = false,
+ string $traceIdHeader = TRACE_ID_HEADER,
+ string $baggageHeaderPrefix = BAGGAGE_HEADER_PREFIX,
+ string $debugIdHeader = DEBUG_ID_HEADER_KEY
+ ) {
+ $this->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
new file mode 100644
index 000000000..1ea5d7c0b
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Codec/ZipkinCodec.php
@@ -0,0 +1,85 @@
+<?php
+
+namespace Jaeger\Codec;
+
+use Jaeger\SpanContext;
+
+use const Jaeger\DEBUG_FLAG;
+use const Jaeger\SAMPLED_FLAG;
+
+class ZipkinCodec implements CodecInterface
+{
+ const SAMPLED_NAME = 'X-B3-Sampled';
+ const TRACE_ID_NAME = 'X-B3-TraceId';
+ const SPAN_ID_NAME = 'X-B3-SpanId';
+ const PARENT_ID_NAME = 'X-B3-ParentSpanId';
+ const FLAGS_NAME = 'X-B3-Flags';
+
+ /**
+ * {@inheritdoc}
+ *
+ * @see \Jaeger\Tracer::inject
+ *
+ * @param SpanContext $spanContext
+ * @param mixed $carrier
+ *
+ * @return void
+ */
+ public function inject(SpanContext $spanContext, &$carrier)
+ {
+ $carrier[self::TRACE_ID_NAME] = dechex($spanContext->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
new file mode 100644
index 000000000..28fb972da
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Config.php
@@ -0,0 +1,390 @@
+<?php
+
+namespace Jaeger;
+
+use Exception;
+use Jaeger\Reporter\CompositeReporter;
+use Jaeger\Reporter\LoggingReporter;
+use Jaeger\Reporter\ReporterInterface;
+use Jaeger\ReporterFactory\JaegerHttpReporterFactory;
+use Jaeger\ReporterFactory\JaegerReporterFactory;
+use Jaeger\ReporterFactory\ZipkinReporterFactory;
+use Jaeger\Sampler\ConstSampler;
+use Jaeger\Sampler\ProbabilisticSampler;
+use Jaeger\Sampler\RateLimitingSampler;
+use Jaeger\Sampler\SamplerInterface;
+use Jaeger\Util\RateLimiter;
+use OpenTracing\GlobalTracer;
+use Psr\Cache\CacheItemPoolInterface;
+use Psr\Log\LoggerInterface;
+use Psr\Log\NullLogger;
+
+class Config
+{
+ const IP_VERSION = "ip_version";
+
+ 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";
+
+ const IPV6 = "IPv6";
+ const IPV4 = "IPv4";
+
+ /**
+ * @return string[]
+ */
+ public static function getAvailableDispatchModes()
+ {
+ return [self::ZIPKIN_OVER_COMPACT_UDP, self::JAEGER_OVER_BINARY_UDP, self::JAEGER_OVER_BINARY_HTTP];
+ }
+
+ /**
+ * @var array
+ */
+ private $config;
+
+ /**
+ * @var string
+ */
+ private $serviceName;
+
+ /**
+ * @var bool
+ */
+ private $initialized = false;
+
+ /**
+ * @var LoggerInterface
+ */
+ private $logger;
+
+ /**
+ * @return LoggerInterface
+ */
+ public function getLogger()
+ {
+ return $this->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
new file mode 100644
index 000000000..1e4be65f5
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Constants.php
@@ -0,0 +1,100 @@
+<?php
+
+namespace Jaeger;
+
+// Max number of bits to use when generating random ID
+const MAX_ID_BITS = 64;
+
+// How often remotely controller sampler polls for sampling strategy
+const DEFAULT_SAMPLING_INTERVAL = 60;
+
+// How often remote reporter does a preemptive flush of its buffers
+const DEFAULT_FLUSH_INTERVAL = 1;
+
+// Name of the HTTP header used to encode trace ID
+const TRACE_ID_HEADER = 'uber-trace-id';
+
+// Prefix for HTTP headers used to record baggage items
+const BAGGAGE_HEADER_PREFIX = 'uberctx-';
+
+// The name of HTTP header or a TextMap carrier key which, if found in the
+// carrier, forces the trace to be sampled as "debug" trace. The value of the
+// header is recorded as the tag on the # root span, so that the trace can
+// be found in the UI using this value as a correlation ID.
+const DEBUG_ID_HEADER_KEY = 'jaeger-debug-id';
+
+const JAEGER_CLIENT_VERSION = 'PHP-' . PHP_VERSION;
+
+// Tracer-scoped tag that tells the version of Jaeger client library
+const JAEGER_VERSION_TAG_KEY = 'jaeger.version';
+
+// Tracer-scoped tag that contains the hostname
+const JAEGER_HOSTNAME_TAG_KEY = 'jaeger.hostname';
+
+const SAMPLER_TYPE_TAG_KEY = 'sampler.type';
+
+const SAMPLER_PARAM_TAG_KEY = 'sampler.param';
+
+const DEFAULT_SAMPLING_PROBABILITY = 0.001;
+
+const DEFAULT_LOWER_BOUND = 1.0 / (10.0 * 60.0); # sample once every 10 minutes
+
+const DEFAULT_MAX_OPERATIONS = 2000;
+
+const STRATEGIES_STR = 'perOperationStrategies';
+
+const OPERATION_STR = 'operation';
+
+const DEFAULT_LOWER_BOUND_STR = 'defaultLowerBoundTracesPerSecond';
+
+const PROBABILISTIC_SAMPLING_STR = 'probabilisticSampling';
+
+const SAMPLING_RATE_STR = 'samplingRate';
+
+const DEFAULT_SAMPLING_PROBABILITY_STR = 'defaultSamplingProbability';
+
+const OPERATION_SAMPLING_STR = 'operationSampling';
+
+const MAX_TRACES_PER_SECOND_STR = 'maxTracesPerSecond';
+
+const RATE_LIMITING_SAMPLING_STR = 'rateLimitingSampling';
+
+const STRATEGY_TYPE_STR = 'strategyType';
+
+// the type of sampler that always makes the same decision.
+const SAMPLER_TYPE_CONST = 'const';
+
+// the type of sampler that polls Jaeger agent for sampling strategy.
+const SAMPLER_TYPE_REMOTE = 'remote';
+
+// the type of sampler that samples traces with a certain fixed probability.
+const SAMPLER_TYPE_PROBABILISTIC = 'probabilistic';
+
+// the type of sampler that samples only up to a fixed number
+// of traces per second.
+// noinspection SpellCheckingInspection
+const SAMPLER_TYPE_RATE_LIMITING = 'ratelimiting';
+
+// the type of sampler that samples only up to a fixed number
+// of traces per second.
+// noinspection SpellCheckingInspection
+const SAMPLER_TYPE_LOWER_BOUND = 'lowerbound';
+
+const DEFAULT_REPORTING_HOST = 'localhost';
+
+/** @deprecated */
+const DEFAULT_REPORTING_PORT = 5775;
+
+const DEFAULT_ZIPKIN_UDP_COMPACT_REPORTING_PORT = 5775;
+const DEFAULT_JAEGER_UDP_BINARY_REPORTING_PORT = 6832;
+const DEFAULT_JAEGER_HTTP_BINARY_REPORTING_PORT = 14268;
+
+const DEFAULT_SAMPLING_PORT = 5778;
+
+const LOCAL_AGENT_DEFAULT_ENABLED = true;
+
+const ZIPKIN_SPAN_FORMAT = 'zipkin-span-format';
+
+const SAMPLED_FLAG = 0x01;
+
+const DEBUG_FLAG = 0x02;
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Mapper/SpanToJaegerMapper.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Mapper/SpanToJaegerMapper.php
new file mode 100644
index 000000000..da5871904
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Mapper/SpanToJaegerMapper.php
@@ -0,0 +1,171 @@
+<?php
+
+namespace Jaeger\Mapper;
+
+use Jaeger\Span;
+use Jaeger\Thrift\Agent\Zipkin\AnnotationType;
+use Jaeger\Thrift\Agent\Zipkin\BinaryAnnotation;
+use Jaeger\Thrift\Log;
+use Jaeger\Thrift\Span as JaegerThriftSpan;
+use Jaeger\Thrift\Tag;
+use Jaeger\Thrift\TagType;
+use const OpenTracing\Tags\COMPONENT;
+use const OpenTracing\Tags\PEER_HOST_IPV4;
+use const OpenTracing\Tags\PEER_PORT;
+use const OpenTracing\Tags\PEER_SERVICE;
+use const OpenTracing\Tags\SPAN_KIND;
+
+class SpanToJaegerMapper
+{
+ private $specialSpanTags = ["jaeger.hostname", "jaeger.version"];
+
+ private $processTagsPrefix = "process.";
+
+ /**
+ * @return string[]
+ */
+ public function getSpecialSpanTags(): array
+ {
+ return $this->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
new file mode 100644
index 000000000..78533cc76
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/CompositeReporter.php
@@ -0,0 +1,51 @@
+<?php
+
+namespace Jaeger\Reporter;
+
+use Jaeger\Span;
+
+/**
+ * CompositeReporter delegates reporting to one or more underlying reporters.
+ */
+class CompositeReporter implements ReporterInterface
+{
+ /**
+ * @var ReporterInterface[]
+ */
+ private $reporters;
+
+ /**
+ * CompositeReporter constructor.
+ *
+ * @param ReporterInterface ...$reporters
+ */
+ public function __construct(ReporterInterface ...$reporters)
+ {
+ $this->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
new file mode 100644
index 000000000..8aabe2ee8
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/InMemoryReporter.php
@@ -0,0 +1,47 @@
+<?php
+
+namespace Jaeger\Reporter;
+
+use Jaeger\Span;
+
+/**
+ * InMemoryReporter stores spans in memory and returns them via getSpans().
+ */
+class InMemoryReporter implements ReporterInterface
+{
+ /**
+ * @var Span[]
+ */
+ private $spans = [];
+
+ /**
+ * {@inheritdoc}
+ *
+ * @param Span $span
+ * @return void
+ */
+ public function reportSpan(Span $span)
+ {
+ $this->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
new file mode 100644
index 000000000..999d69e0a
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/JaegerReporter.php
@@ -0,0 +1,35 @@
+<?php
+
+namespace Jaeger\Reporter;
+
+use Jaeger\Sender\SenderInterface;
+use Jaeger\Span;
+
+class JaegerReporter implements ReporterInterface
+{
+ /**
+ * @var SenderInterface
+ */
+ private $sender;
+
+ /**
+ * RemoteReporter constructor.
+ *
+ * @param SenderInterface $sender
+ */
+ public function __construct(SenderInterface $sender)
+ {
+ $this->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
new file mode 100644
index 000000000..264ea94c5
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/LoggingReporter.php
@@ -0,0 +1,51 @@
+<?php
+
+namespace Jaeger\Reporter;
+
+use Jaeger\Span;
+use Psr\Log\LoggerInterface;
+use Psr\Log\NullLogger;
+
+/**
+ * LoggingReporter logs all spans.
+ */
+class LoggingReporter implements ReporterInterface
+{
+ /**
+ * @var LoggerInterface
+ */
+ private $logger;
+
+ /**
+ * LoggingReporter constructor.
+ *
+ * @param LoggerInterface|null $logger
+ */
+ public function __construct(LoggerInterface $logger = null)
+ {
+ $this->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
new file mode 100644
index 000000000..84a953bef
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/NullReporter.php
@@ -0,0 +1,32 @@
+<?php
+
+namespace Jaeger\Reporter;
+
+use Jaeger\Span;
+
+/**
+ * NullReporter ignores all spans.
+ */
+class NullReporter implements ReporterInterface
+{
+ /**
+ * {@inheritdoc}
+ *
+ * @param Span $span
+ * @return void
+ */
+ public function reportSpan(Span $span)
+ {
+ // nothing to do
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * @return void
+ */
+ public function close()
+ {
+ // nothing to do
+ }
+}
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/RemoteReporter.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/RemoteReporter.php
new file mode 100644
index 000000000..9b78aa3d1
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/RemoteReporter.php
@@ -0,0 +1,46 @@
+<?php
+
+namespace Jaeger\Reporter;
+
+use Jaeger\Sender\UdpSender;
+use Jaeger\Span;
+
+class RemoteReporter implements ReporterInterface
+{
+ /**
+ * @var UdpSender
+ */
+ private $transport;
+
+ /**
+ * RemoteReporter constructor.
+ *
+ * @param UdpSender $transport
+ */
+ public function __construct(UdpSender $transport)
+ {
+ $this->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
new file mode 100644
index 000000000..fea8a8713
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Reporter/ReporterInterface.php
@@ -0,0 +1,28 @@
+<?php
+
+namespace Jaeger\Reporter;
+
+use Jaeger\Span;
+
+/**
+ * Uses to report finished span to something that collects those spans.
+ *
+ * @package Jaeger\Reporter
+ */
+interface ReporterInterface
+{
+ /**
+ * Report finished span.
+ *
+ * @param Span $span
+ * @return void
+ */
+ public function reportSpan(Span $span);
+
+ /**
+ * Release any resources used by the reporter and flushes/sends the data.
+ *
+ * @return void
+ */
+ public function close();
+}
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/AbstractReporterFactory.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/AbstractReporterFactory.php
new file mode 100644
index 000000000..e34adc5dc
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/AbstractReporterFactory.php
@@ -0,0 +1,23 @@
+<?php
+
+namespace Jaeger\ReporterFactory;
+
+use Jaeger\Config;
+use Thrift\Transport\TTransport;
+
+abstract class AbstractReporterFactory implements ReporterFactoryInterface
+{
+ /**
+ * @var Config
+ */
+ protected $config;
+
+ /**
+ * AbstractReporterFactory constructor.
+ * @param Config $config
+ */
+ public function __construct($config)
+ {
+ $this->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
new file mode 100644
index 000000000..038e81161
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/JaegerHttpReporterFactory.php
@@ -0,0 +1,35 @@
+<?php
+
+namespace Jaeger\ReporterFactory;
+
+use Jaeger\AgentClient\HttpAgentClient;
+use Jaeger\Reporter\JaegerReporter;
+use Jaeger\Reporter\ReporterInterface;
+use Jaeger\Sender\JaegerSender;
+use Thrift\Exception\TTransportException;
+use Thrift\Protocol\TBinaryProtocol;
+use Thrift\Transport\THttpClient;
+
+class JaegerHttpReporterFactory extends AbstractReporterFactory implements ReporterFactoryInterface
+{
+ public function createReporter() : ReporterInterface
+ {
+ $transport = new THttpClient(
+ $this->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
new file mode 100644
index 000000000..9865884b5
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/JaegerReporterFactory.php
@@ -0,0 +1,44 @@
+<?php
+
+namespace Jaeger\ReporterFactory;
+
+use Jaeger\AgentClient\HttpAgentClient;
+use Jaeger\Reporter\JaegerReporter;
+use Jaeger\Reporter\ReporterInterface;
+use Jaeger\Sender\JaegerSender;
+use Jaeger\Thrift\Agent\AgentClient;
+use Jaeger\ThriftUdpTransport;
+use Thrift\Exception\TTransportException;
+use Thrift\Protocol\TBinaryProtocol;
+use Thrift\Transport\TBufferedTransport;
+
+class JaegerReporterFactory extends AbstractReporterFactory implements ReporterFactoryInterface
+{
+ public function createReporter() : ReporterInterface
+ {
+ $udp = new ThriftUdpTransport(
+ $this->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
new file mode 100644
index 000000000..4bfd3204f
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/ReporterFactoryInterface.php
@@ -0,0 +1,10 @@
+<?php
+
+namespace Jaeger\ReporterFactory;
+
+use Jaeger\Reporter\ReporterInterface;
+
+interface ReporterFactoryInterface
+{
+ public function createReporter() : ReporterInterface;
+}
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/ZipkinReporterFactory.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/ZipkinReporterFactory.php
new file mode 100644
index 000000000..736977b4d
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ReporterFactory/ZipkinReporterFactory.php
@@ -0,0 +1,46 @@
+<?php
+
+namespace Jaeger\ReporterFactory;
+
+use Jaeger\Reporter\JaegerReporter;
+use Jaeger\Reporter\RemoteReporter;
+use Jaeger\Reporter\ReporterInterface;
+use Jaeger\Sender\JaegerSender;
+use Jaeger\Sender\UdpSender;
+use Jaeger\Thrift\Agent\AgentClient;
+use Jaeger\ThriftUdpTransport;
+use Thrift\Exception\TTransportException;
+use Thrift\Protocol\TBinaryProtocol;
+use Thrift\Protocol\TCompactProtocol;
+use Thrift\Transport\TBufferedTransport;
+use Thrift\Transport\TTransport;
+
+class ZipkinReporterFactory extends AbstractReporterFactory implements ReporterFactoryInterface
+{
+ public function createReporter() : ReporterInterface
+ {
+ $udp = new ThriftUdpTransport(
+ $this->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
new file mode 100644
index 000000000..7c6ba3d62
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/ConstSampler.php
@@ -0,0 +1,68 @@
+<?php
+
+namespace Jaeger\Sampler;
+
+use const Jaeger\SAMPLER_PARAM_TAG_KEY;
+use const Jaeger\SAMPLER_TYPE_CONST;
+use const Jaeger\SAMPLER_TYPE_TAG_KEY;
+
+/**
+ * ConstSampler always returns the same decision.
+ *
+ * @package Jaeger\Sampler
+ */
+class ConstSampler implements SamplerInterface
+{
+ /**
+ * Whether or not the new trace should be sampled.
+ *
+ * @var bool
+ */
+ private $decision;
+
+ /**
+ * A list of the sampler tags.
+ *
+ * @var array
+ */
+ private $tags = [];
+
+ /**
+ * ConstSampler constructor.
+ *
+ * @param bool $decision
+ */
+ public function __construct(bool $decision = true)
+ {
+ $this->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
new file mode 100644
index 000000000..cb265d01e
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/ProbabilisticSampler.php
@@ -0,0 +1,88 @@
+<?php
+
+namespace Jaeger\Sampler;
+
+use OutOfBoundsException;
+use const Jaeger\SAMPLER_PARAM_TAG_KEY;
+use const Jaeger\SAMPLER_TYPE_PROBABILISTIC;
+use const Jaeger\SAMPLER_TYPE_TAG_KEY;
+
+/**
+ * A sampler that randomly samples a certain percentage of traces specified
+ * by the samplingRate, in the range between 0.0 and 1.0.
+ *
+ * @package Jaeger\Sampler
+ */
+class ProbabilisticSampler implements SamplerInterface
+{
+ /**
+ * The sampling rate rate between 0.0 and 1.0.
+ *
+ * @var float
+ */
+ private $rate;
+
+ /**
+ * A list of the sampler tags.
+ *
+ * @var array
+ */
+ private $tags = [];
+
+ /**
+ * The boundary of the sample sampling rate.
+ *
+ * @var float
+ */
+ private $boundary;
+
+ /**
+ * ProbabilisticSampler constructor.
+ *
+ * @param float $rate
+ * @throws OutOfBoundsException
+ */
+ public function __construct(float $rate)
+ {
+ $this->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
new file mode 100644
index 000000000..d0ea0f180
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/RateLimitingSampler.php
@@ -0,0 +1,62 @@
+<?php
+
+namespace Jaeger\Sampler;
+
+use Jaeger\Util\RateLimiter;
+
+use const Jaeger\SAMPLER_PARAM_TAG_KEY;
+use const Jaeger\SAMPLER_TYPE_RATE_LIMITING;
+use const Jaeger\SAMPLER_TYPE_TAG_KEY;
+
+class RateLimitingSampler implements SamplerInterface
+{
+ /**
+ * @var RateLimiter
+ */
+ private $rateLimiter;
+
+ /**
+ * A list of the sampler tags.
+ *
+ * @var array
+ */
+ private $tags = [];
+
+ public function __construct($maxTracesPerSecond, RateLimiter $rateLimiter)
+ {
+ $this->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
new file mode 100644
index 000000000..b6d44e783
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sampler/SamplerInterface.php
@@ -0,0 +1,29 @@
+<?php
+
+namespace Jaeger\Sampler;
+
+/**
+ * Sampler is responsible for deciding if a new trace should be sampled and captured for storage.
+ *
+ * @package Jaeger\Sampler
+ */
+interface SamplerInterface
+{
+ /**
+ * 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);
+
+ /**
+ * Release any resources used by the sampler.
+ *
+ * @return void
+ */
+ public function close();
+}
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Scope.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Scope.php
new file mode 100644
index 000000000..86511bae0
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Scope.php
@@ -0,0 +1,71 @@
+<?php
+
+namespace Jaeger;
+
+use OpenTracing\Scope as OTScope;
+use OpenTracing\Span as OTSpan;
+
+/**
+ * {@inheritdoc}
+ */
+class Scope implements OTScope
+{
+ /**
+ * @var ScopeManager
+ */
+ private $scopeManager;
+
+ /**
+ * @var OTSpan
+ */
+ private $wrapped;
+
+ /**
+ * @var OTScope|null
+ */
+ private $toRestore;
+
+ /**
+ * @var bool
+ */
+ private $finishSpanOnClose;
+
+ /**
+ * Scope constructor.
+ * @param ScopeManager $scopeManager
+ * @param OTSpan $wrapped
+ * @param bool $finishSpanOnClose
+ */
+ public function __construct(ScopeManager $scopeManager, OTSpan $wrapped, bool $finishSpanOnClose)
+ {
+ $this->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
new file mode 100644
index 000000000..eb5c27676
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ScopeManager.php
@@ -0,0 +1,45 @@
+<?php
+
+namespace Jaeger;
+
+use OpenTracing\ScopeManager as OTScopeManager;
+use OpenTracing\Span as OTSpan;
+use OpenTracing\Scope as OTScope;
+
+/**
+ * {@inheritdoc}
+ */
+class ScopeManager implements OTScopeManager
+{
+ /**
+ * @var OTScope
+ */
+ private $active;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function activate(OTSpan $span, bool $finishSpanOnClose = self::DEFAULT_FINISH_SPAN_ON_CLOSE): OTScope
+ {
+ $this->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
new file mode 100644
index 000000000..dfce510b8
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sender/JaegerSender.php
@@ -0,0 +1,236 @@
+<?php
+
+
+namespace Jaeger\Sender;
+
+use Jaeger\Mapper\SpanToJaegerMapper;
+use Jaeger\Span as JaegerSpan;
+use Jaeger\Thrift\Agent\AgentClient;
+use Jaeger\Thrift\Agent\AgentIf;
+use Jaeger\Thrift\Batch;
+use Jaeger\Thrift\Process;
+use Jaeger\Thrift\Span as JaegerThriftSpan;
+use Jaeger\Thrift\Tag;
+use Jaeger\Thrift\TagType;
+use Jaeger\Tracer;
+use Psr\Log\LoggerInterface;
+use Psr\Log\NullLogger;
+use Thrift\Protocol\TBinaryProtocol;
+use Thrift\Protocol\TCompactProtocol;
+use Thrift\Transport\TMemoryBuffer;
+use const Jaeger\JAEGER_HOSTNAME_TAG_KEY;
+
+class JaegerSender implements SenderInterface
+{
+ /**
+ * @var JaegerSpan[]
+ */
+ private $spans = [];
+
+ /**
+ * @var AgentIf
+ */
+ private $agentClient;
+
+ /**
+ * @var LoggerInterface
+ */
+ private $logger;
+
+ /**
+ * @var Tracer
+ */
+ private $tracer;
+
+ /**
+ * @var SpanToJaegerMapper
+ */
+ private $mapper;
+
+ /**
+ * @var int
+ */
+ private $jaegerBatchOverheadLength = 512;
+
+ /**
+ * The maximum length of the thrift-objects for a jaeger-batch.
+ *
+ * @var int
+ */
+ private $maxBufferLength = 64000;
+
+ /**
+ * @param AgentIf $agentClient
+ * @param LoggerInterface|null $logger
+ * @param SpanToJaegerMapper|null $mapper
+ */
+ public function __construct(
+ AgentIf $agentClient,
+ LoggerInterface $logger = null,
+ SpanToJaegerMapper $mapper = null
+ ) {
+ $this->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
new file mode 100644
index 000000000..24dc4fbfa
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sender/SenderInterface.php
@@ -0,0 +1,12 @@
+<?php
+
+namespace Jaeger\Sender;
+
+use Jaeger\Span as JaegerSpan;
+
+interface SenderInterface
+{
+ public function flush(): int;
+ public function append(JaegerSpan $span);
+ public function close();
+}
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sender/UdpSender.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sender/UdpSender.php
new file mode 100644
index 000000000..ff0e4cf3e
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Sender/UdpSender.php
@@ -0,0 +1,305 @@
+<?php
+
+namespace Jaeger\Sender;
+
+use Exception;
+use Jaeger\Thrift\Agent\AgentClient;
+use Jaeger\Thrift\Agent\Zipkin\Annotation;
+use Jaeger\Thrift\Agent\Zipkin\AnnotationType;
+use Jaeger\Thrift\Agent\Zipkin\BinaryAnnotation;
+use Jaeger\Thrift\Agent\Zipkin\Endpoint;
+use Jaeger\Thrift\Agent\Zipkin\Span as ThriftSpan;
+use Psr\Log\LoggerInterface;
+use Psr\Log\NullLogger;
+use Thrift\Base\TBase;
+use Thrift\Protocol\TCompactProtocol;
+use Thrift\Transport\TMemoryBuffer;
+use Jaeger\Span as JaegerSpan;
+
+use const OpenTracing\Tags\COMPONENT;
+
+class UdpSender
+{
+ const CLIENT_ADDR = "ca";
+ const SERVER_ADDR = "sa";
+
+ /**
+ * @var JaegerSpan[]
+ */
+ private $spans = [];
+
+ /**
+ * @var AgentClient
+ */
+ private $client;
+
+ /**
+ * @var LoggerInterface
+ */
+ private $logger;
+
+ /**
+ * The maximum length of the thrift-objects for a zipkin-batch.
+ *
+ * @var int
+ */
+ private $maxBufferLength;
+
+ /**
+ * The length of the zipkin-batch overhead.
+ *
+ * @var int
+ */
+ private $zipkinBatchOverheadLength = 30;
+
+ /**
+ * UdpSender constructor.
+ *
+ * @param AgentClient $client
+ * @param int $maxBufferLength
+ * @param LoggerInterface|null $logger
+ */
+ public function __construct(
+ AgentClient $client,
+ int $maxBufferLength,
+ LoggerInterface $logger = null
+ ) {
+ $this->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
new file mode 100644
index 000000000..abcb07c89
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Span.php
@@ -0,0 +1,476 @@
+<?php
+
+namespace Jaeger;
+
+use Jaeger\Thrift\Agent\Zipkin\AnnotationType;
+use Jaeger\Thrift\Agent\Zipkin\BinaryAnnotation;
+use OpenTracing\Span as OTSpan;
+use DateTime;
+use DateTimeInterface;
+use OpenTracing\SpanContext as OTSpanContext;
+use const OpenTracing\Tags\COMPONENT;
+use const OpenTracing\Tags\PEER_HOST_IPV4;
+use const OpenTracing\Tags\PEER_PORT;
+use const OpenTracing\Tags\PEER_SERVICE;
+use const OpenTracing\Tags\SPAN_KIND;
+use const OpenTracing\Tags\SPAN_KIND_MESSAGE_BUS_CONSUMER;
+use const OpenTracing\Tags\SPAN_KIND_MESSAGE_BUS_PRODUCER;
+use const OpenTracing\Tags\SPAN_KIND_RPC_CLIENT;
+use const OpenTracing\Tags\SPAN_KIND_RPC_SERVER;
+
+class Span implements OTSpan
+{
+ /**
+ * @var Tracer
+ */
+ private $tracer;
+
+ /**
+ * @var SpanContext
+ */
+ private $context;
+
+ /**
+ * @var string
+ */
+ private $operationName;
+
+ /**
+ * @var int|float|DateTime|null
+ */
+ private $startTime;
+
+ /**
+ * @var int|float|DateTime|null
+ */
+ private $endTime;
+
+ /**
+ * SPAN_RPC_CLIENT
+ * @var null|string
+ */
+ private $kind;
+
+ /**
+ * @var array|null
+ */
+ public $peer;
+
+ /**
+ * @var string|null
+ */
+ private $component;
+
+ /**
+ * @var array
+ */
+ private $logs = [];
+
+ /**
+ * @var BinaryAnnotation[]
+ */
+ public $tags = [];
+
+ /**
+ * @var bool
+ */
+ private $debug = false;
+
+ /**
+ * Span constructor.
+ * @param SpanContext $context
+ * @param Tracer $tracer
+ * @param string $operationName
+ * @param array $tags
+ * @param int|float|DateTime|null $startTime
+ */
+ public function __construct(
+ SpanContext $context,
+ Tracer $tracer,
+ string $operationName,
+ array $tags = [],
+ $startTime = null
+ ) {
+ $this->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
new file mode 100644
index 000000000..447ffd1a5
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/SpanContext.php
@@ -0,0 +1,120 @@
+<?php
+
+namespace Jaeger;
+
+use ArrayIterator;
+use OpenTracing\SpanContext as OTSpanContext;
+
+class SpanContext implements OTSpanContext
+{
+ private $traceId;
+
+ private $spanId;
+
+ private $parentId;
+
+ private $flags;
+
+ /**
+ * @var array
+ */
+ private $baggage;
+
+ private $debugId;
+
+ /**
+ * SpanContext constructor.
+ *
+ * @param string $traceId
+ * @param string $spanId
+ * @param string $parentId
+ * @param int|null $flags
+ * @param array $baggage
+ * @param int|null $debugId
+ */
+ public function __construct($traceId, $spanId, $parentId, $flags = null, $baggage = [], $debugId = null)
+ {
+ $this->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
new file mode 100644
index 000000000..640df4598
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AgentClient.php
@@ -0,0 +1,76 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class AgentClient implements \Jaeger\Thrift\Agent\AgentIf {
+ protected $input_ = null;
+ protected $output_ = null;
+
+ protected $seqid_ = 0;
+
+ public function __construct($input, $output=null) {
+ $this->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
new file mode 100644
index 000000000..30efc8cf3
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AgentIf.php
@@ -0,0 +1,30 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+interface AgentIf {
+ /**
+ * @param \Jaeger\Thrift\Agent\Zipkin\Span[] $spans
+ */
+ public function emitZipkinBatch(array $spans);
+ /**
+ * @param \Jaeger\Thrift\Batch $batch
+ */
+ public function emitBatch(\Jaeger\Thrift\Batch $batch);
+}
+
+
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Agent_emitBatch_args.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Agent_emitBatch_args.php
new file mode 100644
index 000000000..9d11b409c
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Agent_emitBatch_args.php
@@ -0,0 +1,56 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class Agent_emitBatch_args extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..cc58527bb
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Agent_emitZipkinBatch_args.php
@@ -0,0 +1,60 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class Agent_emitZipkinBatch_args extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..73825978a
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidatorClient.php
@@ -0,0 +1,83 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class AggregationValidatorClient implements \Jaeger\Thrift\Agent\AggregationValidatorIf {
+ protected $input_ = null;
+ protected $output_ = null;
+
+ protected $seqid_ = 0;
+
+ public function __construct($input, $output=null) {
+ $this->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
new file mode 100644
index 000000000..853cd2a4f
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidatorIf.php
@@ -0,0 +1,27 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+interface AggregationValidatorIf {
+ /**
+ * @param string $traceId
+ * @return \Jaeger\Thrift\Agent\ValidateTraceResponse
+ */
+ public function validateTrace($traceId);
+}
+
+
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidator_validateTrace_args.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidator_validateTrace_args.php
new file mode 100644
index 000000000..2f4d1171c
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidator_validateTrace_args.php
@@ -0,0 +1,55 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class AggregationValidator_validateTrace_args extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..6060c5ae3
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/AggregationValidator_validateTrace_result.php
@@ -0,0 +1,56 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class AggregationValidator_validateTrace_result extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 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
new file mode 100644
index 000000000..27593c4c1
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestriction.php
@@ -0,0 +1,65 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class BaggageRestriction extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..379153534
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManagerClient.php
@@ -0,0 +1,83 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class BaggageRestrictionManagerClient implements \Jaeger\Thrift\Agent\BaggageRestrictionManagerIf {
+ protected $input_ = null;
+ protected $output_ = null;
+
+ protected $seqid_ = 0;
+
+ public function __construct($input, $output=null) {
+ $this->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
new file mode 100644
index 000000000..010bda741
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManagerIf.php
@@ -0,0 +1,31 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+interface BaggageRestrictionManagerIf {
+ /**
+ * getBaggageRestrictions retrieves the baggage restrictions for a specific service.
+ * Usually, baggageRestrictions apply to all services however there may be situations
+ * where a baggageKey might only be allowed to be set by a specific service.
+ *
+ * @param string $serviceName
+ * @return \Jaeger\Thrift\Agent\BaggageRestriction[]
+ */
+ public function getBaggageRestrictions($serviceName);
+}
+
+
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManager_getBaggageRestrictions_args.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManager_getBaggageRestrictions_args.php
new file mode 100644
index 000000000..6f2b4650a
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManager_getBaggageRestrictions_args.php
@@ -0,0 +1,55 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class BaggageRestrictionManager_getBaggageRestrictions_args extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..a3c52b37c
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/BaggageRestrictionManager_getBaggageRestrictions_result.php
@@ -0,0 +1,60 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class BaggageRestrictionManager_getBaggageRestrictions_result extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 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
new file mode 100644
index 000000000..4295b9798
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependencies.php
@@ -0,0 +1,61 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class Dependencies extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..2c247633d
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/DependencyClient.php
@@ -0,0 +1,105 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class DependencyClient implements \Jaeger\Thrift\Agent\DependencyIf {
+ protected $input_ = null;
+ protected $output_ = null;
+
+ protected $seqid_ = 0;
+
+ public function __construct($input, $output=null) {
+ $this->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
new file mode 100644
index 000000000..c9432e7d8
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/DependencyIf.php
@@ -0,0 +1,31 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+interface DependencyIf {
+ /**
+ * @param string $traceId
+ * @return \Jaeger\Thrift\Agent\Dependencies
+ */
+ public function getDependenciesForTrace($traceId);
+ /**
+ * @param \Jaeger\Thrift\Agent\Dependencies $dependencies
+ */
+ public function saveDependencies(\Jaeger\Thrift\Agent\Dependencies $dependencies);
+}
+
+
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/DependencyLink.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/DependencyLink.php
new file mode 100644
index 000000000..14cfa5132
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/DependencyLink.php
@@ -0,0 +1,74 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class DependencyLink extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..5100ea77b
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependency_getDependenciesForTrace_args.php
@@ -0,0 +1,55 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class Dependency_getDependenciesForTrace_args extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..ebdd1303e
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependency_getDependenciesForTrace_result.php
@@ -0,0 +1,56 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class Dependency_getDependenciesForTrace_result extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 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
new file mode 100644
index 000000000..0d250c297
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Dependency_saveDependencies_args.php
@@ -0,0 +1,56 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class Dependency_saveDependencies_args extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..7532a7b50
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/OperationSamplingStrategy.php
@@ -0,0 +1,66 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class OperationSamplingStrategy extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..2a6ae8a61
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/PerOperationSamplingStrategies.php
@@ -0,0 +1,88 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class PerOperationSamplingStrategies extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..708ceb9a4
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/ProbabilisticSamplingStrategy.php
@@ -0,0 +1,56 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class ProbabilisticSamplingStrategy extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..d5502e8ee
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/RateLimitingSamplingStrategy.php
@@ -0,0 +1,56 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class RateLimitingSamplingStrategy extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..9f5494a91
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManagerClient.php
@@ -0,0 +1,83 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class SamplingManagerClient implements \Jaeger\Thrift\Agent\SamplingManagerIf {
+ protected $input_ = null;
+ protected $output_ = null;
+
+ protected $seqid_ = 0;
+
+ public function __construct($input, $output=null) {
+ $this->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
new file mode 100644
index 000000000..ef17cf308
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManagerIf.php
@@ -0,0 +1,27 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+interface SamplingManagerIf {
+ /**
+ * @param string $serviceName
+ * @return \Jaeger\Thrift\Agent\SamplingStrategyResponse
+ */
+ public function getSamplingStrategy($serviceName);
+}
+
+
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManager_getSamplingStrategy_args.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManager_getSamplingStrategy_args.php
new file mode 100644
index 000000000..f39203efe
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManager_getSamplingStrategy_args.php
@@ -0,0 +1,55 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class SamplingManager_getSamplingStrategy_args extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..79e6dce58
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingManager_getSamplingStrategy_result.php
@@ -0,0 +1,56 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class SamplingManager_getSamplingStrategy_result extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 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
new file mode 100644
index 000000000..bc807a57d
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingStrategyResponse.php
@@ -0,0 +1,86 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class SamplingStrategyResponse extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..c8dff918a
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/SamplingStrategyType.php
@@ -0,0 +1,28 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+final class SamplingStrategyType {
+ const PROBABILISTIC = 0;
+ const RATE_LIMITING = 1;
+ static public $__names = array(
+ 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
new file mode 100644
index 000000000..226f61e80
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/ValidateTraceResponse.php
@@ -0,0 +1,65 @@
+<?php
+namespace Jaeger\Thrift\Agent;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class ValidateTraceResponse extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..e7e48dade
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Annotation.php
@@ -0,0 +1,87 @@
+<?php
+namespace Jaeger\Thrift\Agent\Zipkin;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+/**
+ * An annotation is similar to a log statement. It includes a host field which
+ * allows these events to be attributed properly, and also aggregatable.
+ */
+class Annotation extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..e21c0b0d8
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/AnnotationType.php
@@ -0,0 +1,38 @@
+<?php
+namespace Jaeger\Thrift\Agent\Zipkin;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+final class AnnotationType {
+ const BOOL = 0;
+ const BYTES = 1;
+ const I16 = 2;
+ const I32 = 3;
+ const I64 = 4;
+ const DOUBLE = 5;
+ const STRING = 6;
+ static public $__names = array(
+ 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
new file mode 100644
index 000000000..806a74831
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/BinaryAnnotation.php
@@ -0,0 +1,106 @@
+<?php
+namespace Jaeger\Thrift\Agent\Zipkin;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+/**
+ * Binary annotations are tags applied to a Span to give it context. For
+ * example, a binary annotation of "http.uri" could the path to a resource in a
+ * RPC call.
+ *
+ * Binary annotations of type STRING are always queryable, though more a
+ * historical implementation detail than a structural concern.
+ *
+ * Binary annotations can repeat, and vary on the host. Similar to Annotation,
+ * the host indicates who logged the event. This allows you to tell the
+ * difference between the client and server side of the same key. For example,
+ * the key "http.uri" might be different on the client and server side due to
+ * rewriting, like "/api/v1/myresource" vs "/myresource. Via the host field,
+ * you can see the different points of view, which often help in debugging.
+ */
+class BinaryAnnotation extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..ebfcebe48
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Constant.php
@@ -0,0 +1,246 @@
+<?php
+namespace Jaeger\Thrift\Agent\Zipkin;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+final class Constant extends \Thrift\Type\TConstant {
+ static protected $CLIENT_SEND;
+ static protected $CLIENT_RECV;
+ static protected $SERVER_SEND;
+ static protected $SERVER_RECV;
+ static protected $MESSAGE_SEND;
+ static protected $MESSAGE_RECV;
+ static protected $WIRE_SEND;
+ static protected $WIRE_RECV;
+ static protected $CLIENT_SEND_FRAGMENT;
+ static protected $CLIENT_RECV_FRAGMENT;
+ static protected $SERVER_SEND_FRAGMENT;
+ static protected $SERVER_RECV_FRAGMENT;
+ static protected $LOCAL_COMPONENT;
+ static protected $CLIENT_ADDR;
+ static protected $SERVER_ADDR;
+ static protected $MESSAGE_ADDR;
+
+ static protected function init_CLIENT_SEND() {
+ return /**
+ * The client sent ("cs") a request to a server. There is only one send per
+ * span. For example, if there's a transport error, each attempt can be logged
+ * as a WIRE_SEND annotation.
+ *
+ * If chunking is involved, each chunk could be logged as a separate
+ * CLIENT_SEND_FRAGMENT in the same span.
+ *
+ * Annotation.host is not the server. It is the host which logged the send
+ * event, almost always the client. When logging CLIENT_SEND, instrumentation
+ * should also log the SERVER_ADDR.
+ */
+"cs";
+ }
+
+ static protected function init_CLIENT_RECV() {
+ return /**
+ * The client received ("cr") a response from a server. There is only one
+ * receive per span. For example, if duplicate responses were received, each
+ * can be logged as a WIRE_RECV annotation.
+ *
+ * If chunking is involved, each chunk could be logged as a separate
+ * CLIENT_RECV_FRAGMENT in the same span.
+ *
+ * Annotation.host is not the server. It is the host which logged the receive
+ * event, almost always the client. The actual endpoint of the server is
+ * recorded separately as SERVER_ADDR when CLIENT_SEND is logged.
+ */
+"cr";
+ }
+
+ static protected function init_SERVER_SEND() {
+ return /**
+ * The server sent ("ss") a response to a client. There is only one response
+ * per span. If there's a transport error, each attempt can be logged as a
+ * WIRE_SEND annotation.
+ *
+ * Typically, a trace ends with a server send, so the last timestamp of a trace
+ * is often the timestamp of the root span's server send.
+ *
+ * If chunking is involved, each chunk could be logged as a separate
+ * SERVER_SEND_FRAGMENT in the same span.
+ *
+ * Annotation.host is not the client. It is the host which logged the send
+ * event, almost always the server. The actual endpoint of the client is
+ * recorded separately as CLIENT_ADDR when SERVER_RECV is logged.
+ */
+"ss";
+ }
+
+ static protected function init_SERVER_RECV() {
+ return /**
+ * The server received ("sr") a request from a client. There is only one
+ * request per span. For example, if duplicate responses were received, each
+ * can be logged as a WIRE_RECV annotation.
+ *
+ * Typically, a trace starts with a server receive, so the first timestamp of a
+ * trace is often the timestamp of the root span's server receive.
+ *
+ * If chunking is involved, each chunk could be logged as a separate
+ * SERVER_RECV_FRAGMENT in the same span.
+ *
+ * Annotation.host is not the client. It is the host which logged the receive
+ * event, almost always the server. When logging SERVER_RECV, instrumentation
+ * should also log the CLIENT_ADDR.
+ */
+"sr";
+ }
+
+ static protected function init_MESSAGE_SEND() {
+ return /**
+ * Message send ("ms") is a request to send a message to a destination, usually
+ * a broker. This may be the only annotation in a messaging span. If WIRE_SEND
+ * exists in the same span, it follows this moment and clarifies delays sending
+ * the message, such as batching.
+ *
+ * Unlike RPC annotations like CLIENT_SEND, messaging spans never share a span
+ * ID. For example, "ms" should always be the parent of "mr".
+ *
+ * Annotation.host is not the destination, it is the host which logged the send
+ * event: the producer. When annotating MESSAGE_SEND, instrumentation should
+ * also tag the MESSAGE_ADDR.
+ */
+"ms";
+ }
+
+ static protected function init_MESSAGE_RECV() {
+ return /**
+ * A consumer received ("mr") a message from a broker. This may be the only
+ * annotation in a messaging span. If WIRE_RECV exists in the same span, it
+ * precedes this moment and clarifies any local queuing delay.
+ *
+ * Unlike RPC annotations like SERVER_RECV, messaging spans never share a span
+ * ID. For example, "mr" should always be a child of "ms" unless it is a root
+ * span.
+ *
+ * Annotation.host is not the broker, it is the host which logged the receive
+ * event: the consumer. When annotating MESSAGE_RECV, instrumentation should
+ * also tag the MESSAGE_ADDR.
+ */
+"mr";
+ }
+
+ static protected function init_WIRE_SEND() {
+ return /**
+ * Optionally logs an attempt to send a message on the wire. Multiple wire send
+ * events could indicate network retries. A lag between client or server send
+ * and wire send might indicate queuing or processing delay.
+ */
+"ws";
+ }
+
+ static protected function init_WIRE_RECV() {
+ return /**
+ * Optionally logs an attempt to receive a message from the wire. Multiple wire
+ * receive events could indicate network retries. A lag between wire receive
+ * and client or server receive might indicate queuing or processing delay.
+ */
+"wr";
+ }
+
+ static protected function init_CLIENT_SEND_FRAGMENT() {
+ return /**
+ * Optionally logs progress of a (CLIENT_SEND, WIRE_SEND). For example, this
+ * could be one chunk in a chunked request.
+ */
+"csf";
+ }
+
+ static protected function init_CLIENT_RECV_FRAGMENT() {
+ return /**
+ * Optionally logs progress of a (CLIENT_RECV, WIRE_RECV). For example, this
+ * could be one chunk in a chunked response.
+ */
+"crf";
+ }
+
+ static protected function init_SERVER_SEND_FRAGMENT() {
+ return /**
+ * Optionally logs progress of a (SERVER_SEND, WIRE_SEND). For example, this
+ * could be one chunk in a chunked response.
+ */
+"ssf";
+ }
+
+ static protected function init_SERVER_RECV_FRAGMENT() {
+ return /**
+ * Optionally logs progress of a (SERVER_RECV, WIRE_RECV). For example, this
+ * could be one chunk in a chunked request.
+ */
+"srf";
+ }
+
+ static protected function init_LOCAL_COMPONENT() {
+ return /**
+ * The value of "lc" is the component or namespace of a local span.
+ *
+ * BinaryAnnotation.host adds service context needed to support queries.
+ *
+ * Local Component("lc") supports three key features: flagging, query by
+ * service and filtering Span.name by namespace.
+ *
+ * While structurally the same, local spans are fundamentally different than
+ * RPC spans in how they should be interpreted. For example, zipkin v1 tools
+ * center on RPC latency and service graphs. Root local-spans are neither
+ * indicative of critical path RPC latency, nor have impact on the shape of a
+ * service graph. By flagging with "lc", tools can special-case local spans.
+ *
+ * Zipkin v1 Spans are unqueryable unless they can be indexed by service name.
+ * The only path to a service name is by (Binary)?Annotation.host.serviceName.
+ * By logging "lc", a local span can be queried even if no other annotations
+ * are logged.
+ *
+ * The value of "lc" is the namespace of Span.name. For example, it might be
+ * "finatra2", for a span named "bootstrap". "lc" allows you to resolves
+ * conflicts for the same Span.name, for example "finatra/bootstrap" vs
+ * "finch/bootstrap". Using local component, you'd search for spans named
+ * "bootstrap" where "lc=finch"
+ */
+"lc";
+ }
+
+ static protected function init_CLIENT_ADDR() {
+ return /**
+ * Indicates a client address ("ca") in a span. Most likely, there's only one.
+ * Multiple addresses are possible when a client changes its ip or port within
+ * a span.
+ */
+"ca";
+ }
+
+ static protected function init_SERVER_ADDR() {
+ return /**
+ * Indicates a server address ("sa") in a span. Most likely, there's only one.
+ * Multiple addresses are possible when a client is redirected, or fails to a
+ * different server ip or port.
+ */
+"sa";
+ }
+
+ static protected function init_MESSAGE_ADDR() {
+ return /**
+ * Indicates the remote address of a messaging span, usually the broker.
+ */
+"ma";
+ }
+}
+
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Endpoint.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Endpoint.php
new file mode 100644
index 000000000..12ff02f96
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Endpoint.php
@@ -0,0 +1,108 @@
+<?php
+namespace Jaeger\Thrift\Agent\Zipkin;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+/**
+ * Indicates the network context of a service recording an annotation with two
+ * exceptions.
+ *
+ * When a BinaryAnnotation, and key is CLIENT_ADDR or SERVER_ADDR,
+ * the endpoint 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.
+ */
+class Endpoint extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..88c7f5e5d
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Response.php
@@ -0,0 +1,56 @@
+<?php
+namespace Jaeger\Thrift\Agent\Zipkin;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class Response extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..32a69b645
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/Span.php
@@ -0,0 +1,190 @@
+<?php
+namespace Jaeger\Thrift\Agent\Zipkin;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+/**
+ * A trace is a series of spans (often RPC calls) which form a latency tree.
+ *
+ * The root span is where trace_id = id and parent_id = Nil. The root span is
+ * usually the longest interval in the trace, starting with a SERVER_RECV
+ * annotation and ending with a SERVER_SEND.
+ */
+class Span extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..2978675c4
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollectorClient.php
@@ -0,0 +1,83 @@
+<?php
+namespace Jaeger\Thrift\Agent\Zipkin;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class ZipkinCollectorClient implements \Jaeger\Thrift\Agent\Zipkin\ZipkinCollectorIf {
+ protected $input_ = null;
+ protected $output_ = null;
+
+ protected $seqid_ = 0;
+
+ public function __construct($input, $output=null) {
+ $this->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
new file mode 100644
index 000000000..83abf8119
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollectorIf.php
@@ -0,0 +1,27 @@
+<?php
+namespace Jaeger\Thrift\Agent\Zipkin;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+interface ZipkinCollectorIf {
+ /**
+ * @param \Jaeger\Thrift\Agent\Zipkin\Span[] $spans
+ * @return \Jaeger\Thrift\Agent\Zipkin\Response[]
+ */
+ public function submitZipkinBatch(array $spans);
+}
+
+
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollector_submitZipkinBatch_args.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollector_submitZipkinBatch_args.php
new file mode 100644
index 000000000..24d25b078
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollector_submitZipkinBatch_args.php
@@ -0,0 +1,60 @@
+<?php
+namespace Jaeger\Thrift\Agent\Zipkin;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class ZipkinCollector_submitZipkinBatch_args extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..faf165446
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Agent/Zipkin/ZipkinCollector_submitZipkinBatch_result.php
@@ -0,0 +1,60 @@
+<?php
+namespace Jaeger\Thrift\Agent\Zipkin;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class ZipkinCollector_submitZipkinBatch_result extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 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
new file mode 100644
index 000000000..56e9e5206
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Batch.php
@@ -0,0 +1,71 @@
+<?php
+namespace Jaeger\Thrift;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class Batch extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..7ddc25eb5
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/BatchSubmitResponse.php
@@ -0,0 +1,56 @@
+<?php
+namespace Jaeger\Thrift;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class BatchSubmitResponse extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..e3c6e14c1
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/CollectorClient.php
@@ -0,0 +1,83 @@
+<?php
+namespace Jaeger\Thrift;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class CollectorClient implements \Jaeger\Thrift\CollectorIf {
+ protected $input_ = null;
+ protected $output_ = null;
+
+ protected $seqid_ = 0;
+
+ public function __construct($input, $output=null) {
+ $this->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
new file mode 100644
index 000000000..da4f023ec
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/CollectorIf.php
@@ -0,0 +1,27 @@
+<?php
+namespace Jaeger\Thrift;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+interface CollectorIf {
+ /**
+ * @param \Jaeger\Thrift\Batch[] $batches
+ * @return \Jaeger\Thrift\BatchSubmitResponse[]
+ */
+ public function submitBatches(array $batches);
+}
+
+
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Collector_submitBatches_args.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Collector_submitBatches_args.php
new file mode 100644
index 000000000..014e3720d
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Collector_submitBatches_args.php
@@ -0,0 +1,60 @@
+<?php
+namespace Jaeger\Thrift;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class Collector_submitBatches_args extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..aae083707
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Collector_submitBatches_result.php
@@ -0,0 +1,60 @@
+<?php
+namespace Jaeger\Thrift;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class Collector_submitBatches_result extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 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
new file mode 100644
index 000000000..92b269aa6
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/Downstream.php
@@ -0,0 +1,102 @@
+<?php
+namespace Jaeger\Thrift\Crossdock;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class Downstream extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..39e6242b7
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/JoinTraceRequest.php
@@ -0,0 +1,66 @@
+<?php
+namespace Jaeger\Thrift\Crossdock;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class JoinTraceRequest extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..d60331851
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/ObservedSpan.php
@@ -0,0 +1,74 @@
+<?php
+namespace Jaeger\Thrift\Crossdock;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class ObservedSpan extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..50b9c6668
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/StartTraceRequest.php
@@ -0,0 +1,84 @@
+<?php
+namespace Jaeger\Thrift\Crossdock;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class StartTraceRequest extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..107d4e26d
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TraceResponse.php
@@ -0,0 +1,82 @@
+<?php
+namespace Jaeger\Thrift\Crossdock;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+/**
+ * Each server must include the information about the span it observed.
+ * It can only be omitted from the response if notImplementedError field is not empty.
+ * If the server was instructed to make a downstream call, it must embed the
+ * downstream response in its own response.
+ */
+class TraceResponse extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..2fd8b4fc9
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedServiceClient.php
@@ -0,0 +1,134 @@
+<?php
+namespace Jaeger\Thrift\Crossdock;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class TracedServiceClient implements \Jaeger\Thrift\Crossdock\TracedServiceIf {
+ protected $input_ = null;
+ protected $output_ = null;
+
+ protected $seqid_ = 0;
+
+ public function __construct($input, $output=null) {
+ $this->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
new file mode 100644
index 000000000..e2dd9a8eb
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedServiceIf.php
@@ -0,0 +1,40 @@
+<?php
+namespace Jaeger\Thrift\Crossdock;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+interface TracedServiceIf {
+ /**
+ * @param \Jaeger\Thrift\Crossdock\StartTraceRequest $request
+ * @return \Jaeger\Thrift\Crossdock\TraceResponse Each server must include the information about the span it observed.
+ * It can only be omitted from the response if notImplementedError field is not empty.
+ * If the server was instructed to make a downstream call, it must embed the
+ * downstream response in its own response.
+ *
+ */
+ public function startTrace(\Jaeger\Thrift\Crossdock\StartTraceRequest $request);
+ /**
+ * @param \Jaeger\Thrift\Crossdock\JoinTraceRequest $request
+ * @return \Jaeger\Thrift\Crossdock\TraceResponse Each server must include the information about the span it observed.
+ * It can only be omitted from the response if notImplementedError field is not empty.
+ * If the server was instructed to make a downstream call, it must embed the
+ * downstream response in its own response.
+ *
+ */
+ public function joinTrace(\Jaeger\Thrift\Crossdock\JoinTraceRequest $request);
+}
+
+
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_joinTrace_args.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_joinTrace_args.php
new file mode 100644
index 000000000..fb82b43c7
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_joinTrace_args.php
@@ -0,0 +1,56 @@
+<?php
+namespace Jaeger\Thrift\Crossdock;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class TracedService_joinTrace_args extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..26ebd7124
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_joinTrace_result.php
@@ -0,0 +1,56 @@
+<?php
+namespace Jaeger\Thrift\Crossdock;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class TracedService_joinTrace_result extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 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
new file mode 100644
index 000000000..cabc260ea
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_startTrace_args.php
@@ -0,0 +1,56 @@
+<?php
+namespace Jaeger\Thrift\Crossdock;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class TracedService_startTrace_args extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..f4b114e64
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/TracedService_startTrace_result.php
@@ -0,0 +1,56 @@
+<?php
+namespace Jaeger\Thrift\Crossdock;
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class TracedService_startTrace_result extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 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
new file mode 100644
index 000000000..1b71e686b
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Crossdock/Transport.php
@@ -0,0 +1,30 @@
+<?php
+namespace Jaeger\Thrift\Crossdock;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+final class Transport {
+ const HTTP = 0;
+ const TCHANNEL = 1;
+ const DUMMY = 2;
+ static public $__names = array(
+ 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
new file mode 100644
index 000000000..809a92d7c
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Log.php
@@ -0,0 +1,70 @@
+<?php
+namespace Jaeger\Thrift;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class Log extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..3b925220a
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Process.php
@@ -0,0 +1,70 @@
+<?php
+namespace Jaeger\Thrift;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class Process extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..cff0c324d
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Span.php
@@ -0,0 +1,161 @@
+<?php
+namespace Jaeger\Thrift;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class Span extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..cb5ee78db
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/SpanRef.php
@@ -0,0 +1,83 @@
+<?php
+namespace Jaeger\Thrift;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class SpanRef extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..d6d6f20c3
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/SpanRefType.php
@@ -0,0 +1,28 @@
+<?php
+namespace Jaeger\Thrift;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+final class SpanRefType {
+ const CHILD_OF = 0;
+ const FOLLOWS_FROM = 1;
+ static public $__names = array(
+ 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
new file mode 100644
index 000000000..06af59939
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/Tag.php
@@ -0,0 +1,110 @@
+<?php
+namespace Jaeger\Thrift;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class Tag extends TBase {
+ static $isValidate = false;
+
+ static $_TSPEC = array(
+ 1 => 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
new file mode 100644
index 000000000..3b1f69f9f
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/TagType.php
@@ -0,0 +1,34 @@
+<?php
+namespace Jaeger\Thrift;
+
+/**
+ * Autogenerated by Thrift Compiler (0.11.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+final class TagType {
+ const STRING = 0;
+ const DOUBLE = 1;
+ const BOOL = 2;
+ const LONG = 3;
+ const BINARY = 4;
+ static public $__names = array(
+ 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
new file mode 100644
index 000000000..babc689dc
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ThriftUdpTransport.php
@@ -0,0 +1,151 @@
+<?php
+
+namespace Jaeger;
+
+use Psr\Log\LoggerInterface;
+use Psr\Log\NullLogger;
+use Thrift\Transport\TTransport;
+
+class ThriftUdpTransport extends TTransport
+{
+ private $socket;
+
+ /**
+ * @var string
+ */
+ private $host;
+
+ /**
+ * @var int
+ */
+ private $port;
+
+ /**
+ * @var LoggerInterface
+ */
+ private $logger;
+
+ /**
+ * @var Config
+ */
+ private $config;
+
+ /**
+ * ThriftUdpTransport constructor.
+ * @param string $host
+ * @param int $port
+ * @param LoggerInterface $logger
+ */
+ public function __construct(string $host, int $port, LoggerInterface $logger = null, Config $config = null)
+ {
+ $this->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
new file mode 100644
index 000000000..bb0649a0b
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Tracer.php
@@ -0,0 +1,420 @@
+<?php
+
+namespace Jaeger;
+
+use Exception;
+use OpenTracing\Scope as OTScope;
+use OpenTracing\Span as OTSpan;
+use OpenTracing\UnsupportedFormatException;
+use Psr\Log\LoggerInterface;
+use Psr\Log\NullLogger;
+use Jaeger\Codec\BinaryCodec;
+use Jaeger\Codec\CodecInterface;
+use Jaeger\Codec\TextCodec;
+use Jaeger\Codec\ZipkinCodec;
+use Jaeger\Reporter\ReporterInterface;
+use Jaeger\Sampler\SamplerInterface;
+use OpenTracing\Tracer as OTTracer;
+use OpenTracing\SpanContext as OTSpanContext;
+use OpenTracing\Reference;
+use OpenTracing\StartSpanOptions;
+use OpenTracing\Exceptions\UnsupportedFormat;
+use const OpenTracing\Formats\BINARY;
+use const OpenTracing\Formats\HTTP_HEADERS;
+use const OpenTracing\Formats\TEXT_MAP;
+use const OpenTracing\Tags\SPAN_KIND;
+use const OpenTracing\Tags\SPAN_KIND_RPC_SERVER;
+use OpenTracing\ScopeManager as OTScopeManager;
+
+class Tracer implements OTTracer
+{
+ /**
+ * @var string
+ */
+ private $serviceName;
+
+ /**
+ * @var ReporterInterface
+ */
+ private $reporter;
+
+ /**
+ * @var SamplerInterface
+ */
+ private $sampler;
+
+ /**
+ * @var string
+ */
+ private $ipAddress;
+
+ /**
+ * @var string
+ */
+ private $debugIdHeader;
+
+ /**
+ * @var CodecInterface[]
+ */
+ private $codecs;
+
+ /**
+ * @var LoggerInterface
+ */
+ private $logger;
+
+ /**
+ * @var bool
+ */
+ private $oneSpanPerRpc;
+
+ /**
+ * @var string[]
+ */
+ private $tags;
+
+ /**
+ * @var ScopeManager
+ */
+ private $scopeManager;
+
+ /**
+ * Tracer constructor.
+ * @param string $serviceName
+ * @param ReporterInterface $reporter
+ * @param SamplerInterface $sampler
+ * @param bool $oneSpanPerRpc
+ * @param LoggerInterface|null $logger
+ * @param ScopeManager|null $scopeManager
+ * @param string $traceIdHeader
+ * @param string $baggageHeaderPrefix
+ * @param string $debugIdHeader
+ * @param array|null $tags
+ */
+ public function __construct(
+ $serviceName,
+ ReporterInterface $reporter,
+ SamplerInterface $sampler,
+ $oneSpanPerRpc = true,
+ LoggerInterface $logger = null,
+ ScopeManager $scopeManager = null,
+ $traceIdHeader = TRACE_ID_HEADER,
+ $baggageHeaderPrefix = BAGGAGE_HEADER_PREFIX,
+ $debugIdHeader = DEBUG_ID_HEADER_KEY,
+ $tags = null
+ ) {
+ $this->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
new file mode 100644
index 000000000..d767ad40f
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Util/RateLimiter.php
@@ -0,0 +1,128 @@
+<?php
+
+namespace Jaeger\Util;
+
+use Psr\Cache\CacheItemInterface;
+use Psr\Cache\CacheItemPoolInterface;
+
+class RateLimiter
+{
+ /**
+ * @var CacheItemPoolInterface
+ */
+ private $cache;
+
+ /**
+ * @var CacheItemInterface
+ */
+ private $balance;
+
+ /**
+ * @var CacheItemInterface
+ */
+ private $lastTick;
+
+ /**
+ * @var float
+ */
+ private $creditsPerNanosecond = 0;
+
+ /**
+ * @var float
+ */
+ private $maxBalance = 0;
+
+ /**
+ * RateLimiter constructor.
+ *
+ * @param CacheItemPoolInterface $cache
+ * @param string $currentBalanceKey key of current balance value in $cache
+ * @param string $lastTickKey key of last tick value in $cache
+ * @throws \Psr\Cache\InvalidArgumentException
+ */
+ public function __construct(
+ CacheItemPoolInterface $cache,
+ string $currentBalanceKey,
+ string $lastTickKey
+ ) {
+ $this->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
new file mode 100644
index 000000000..79a1dd96f
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Codec/TextCodecTest.php
@@ -0,0 +1,170 @@
+<?php
+
+namespace Jaeger\Tests\Codec;
+
+use Exception;
+use const Jaeger\BAGGAGE_HEADER_PREFIX;
+use Jaeger\Codec\TextCodec;
+use const Jaeger\DEBUG_ID_HEADER_KEY;
+use Jaeger\SpanContext;
+use const Jaeger\TRACE_ID_HEADER;
+use PHPUnit\Framework\TestCase;
+
+class TextCodecTest extends TestCase
+{
+ /** @var TextCodec */
+ private $textCodec;
+
+ public function setUp(): void
+ {
+ $this->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
new file mode 100644
index 000000000..047caac2e
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Codec/ZipkinCodecTest.php
@@ -0,0 +1,104 @@
+<?php
+
+namespace Jaeger\Tests\Codec;
+
+use Jaeger\Codec\ZipkinCodec;
+use Jaeger\SpanContext;
+use PHPUnit\Framework\TestCase;
+use const Jaeger\DEBUG_FLAG;
+use const Jaeger\SAMPLED_FLAG;
+
+class ZipkinCodecTest extends TestCase
+{
+ /** @var ZipkinCodec */
+ private $codec;
+
+ function setUp(): void
+ {
+ $this->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
new file mode 100644
index 000000000..da1a9781e
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ConfigTest.php
@@ -0,0 +1,257 @@
+<?php
+
+namespace Jaeger\Tests;
+
+use Exception;
+use Jaeger\Config;
+use Jaeger\Reporter\ReporterInterface;
+use Jaeger\Sampler\SamplerInterface;
+use Jaeger\Tracer;
+use OpenTracing\GlobalTracer;
+use PHPUnit\Framework\TestCase;
+use const Jaeger\SAMPLER_TYPE_CONST;
+
+class ConfigTest extends TestCase
+{
+ /**
+ * @var Config
+ */
+ private $config;
+
+ /**
+ * @var ReporterInterface
+ */
+ private $reporter;
+
+ /**
+ * @var SamplerInterface
+ */
+ private $sampler;
+
+ /**
+ * @var string
+ */
+ private $serviceName = 'test-service';
+
+ function setUp(): void
+ {
+ $this->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
new file mode 100644
index 000000000..fd8789dc3
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Logger/StackLogger.php
@@ -0,0 +1,30 @@
+<?php
+
+namespace Jaeger\Tests\Logger;
+
+use Psr\Log\LoggerTrait;
+
+class StackLogger implements \Psr\Log\LoggerInterface
+{
+ /** @var array */
+ protected $messagesStack = [];
+
+ use LoggerTrait;
+
+ public function log($level, $message, array $context = array()): void
+ {
+ $this->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
new file mode 100644
index 000000000..d536cb63a
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Mapper/SpanToJaegerMapperTest.php
@@ -0,0 +1,169 @@
+<?php
+
+use Jaeger\Mapper\SpanToJaegerMapper;
+use Jaeger\Reporter\NullReporter;
+use Jaeger\Sampler\ConstSampler;
+use Jaeger\Span;
+use Jaeger\SpanContext;
+use Jaeger\Thrift\TagType;
+use Jaeger\Tracer;
+use const Jaeger\SAMPLED_FLAG;
+use const OpenTracing\Tags\COMPONENT;
+use const OpenTracing\Tags\PEER_HOST_IPV4;
+use const OpenTracing\Tags\PEER_PORT;
+use const OpenTracing\Tags\PEER_SERVICE;
+use const OpenTracing\Tags\SPAN_KIND;
+use const OpenTracing\Tags\SPAN_KIND_RPC_CLIENT;
+
+class SpanToJaegerMapperTest extends \PHPUnit\Framework\TestCase
+{
+ private $serviceName = "test-service";
+ /**
+ * @var Tracer
+ */
+ private $tracer;
+
+ /**
+ * @var SpanContext
+ */
+ private $context;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setUp(): void
+ {
+ $this->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<string, mixed> $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
new file mode 100644
index 000000000..ef95ebfe7
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/CompositeReporterTest.php
@@ -0,0 +1,52 @@
+<?php
+
+namespace Jaeger\Tests\Reporter;
+
+use Jaeger\Reporter\CompositeReporter;
+use Jaeger\Reporter\ReporterInterface;
+use Jaeger\Span;
+use PHPUnit\Framework\TestCase;
+
+class CompositeReporterTest extends TestCase
+{
+ /** @var CompositeReporter */
+ private $reporter;
+
+ /** @var ReporterInterface|\PHPUnit\Framework\MockObject\MockObject */
+ private $childReporter1;
+
+ /** @var ReporterInterface|\PHPUnit\Framework\MockObject\MockObject */
+ private $childReporter2;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setUp(): void
+ {
+ $this->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
new file mode 100644
index 000000000..966a62fa4
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/InMemoryReporterTest.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace Jaeger\Tests\Reporter;
+
+use Jaeger\Reporter\InMemoryReporter;
+use Jaeger\Span;
+use PHPUnit\Framework\TestCase;
+
+class InMemoryReporterTest extends TestCase
+{
+ /** @test */
+ public function shouldReportSpan()
+ {
+ /** @var \Jaeger\Span|\PHPUnit\Framework\MockObject\MockObject $span */
+ $span = $this->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
new file mode 100644
index 000000000..dc7c490d2
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/LoggingReporterTest.php
@@ -0,0 +1,31 @@
+<?php
+
+namespace Jaeger\Tests\Reporter;
+
+use Jaeger\Reporter\LoggingReporter;
+use Jaeger\Span;
+use PHPUnit\Framework\TestCase;
+use Psr\Log\NullLogger;
+
+class LoggingReporterTest extends TestCase
+{
+ /** @test */
+ public function shouldReportSpan()
+ {
+ /**
+ * @var NullLogger|\PHPUnit\Framework\MockObject\MockObject v
+ * @var Span|\PHPUnit\Framework\MockObject\MockObject $span
+ */
+ $logger = $this->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
new file mode 100644
index 000000000..e6a66cb8a
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/NullReporterTest.php
@@ -0,0 +1,29 @@
+<?php
+
+namespace Jaeger\Tests\Reporter;
+
+use Jaeger\Reporter\NullReporter;
+use Jaeger\Span;
+use PHPUnit\Framework\TestCase;
+
+class NullReporterTest extends TestCase
+{
+ /**
+ * Nothing to test because NullReporter doing nothing.
+ *
+ * @test
+ */
+ public function shouldReportSpan()
+ {
+ /** @var \Jaeger\Span|\PHPUnit\Framework\MockObject\MockObject $span */
+ $span = $this->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
new file mode 100644
index 000000000..0b85f06d0
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Reporter/RemoteReporterTest.php
@@ -0,0 +1,46 @@
+<?php
+
+namespace Jaeger\Tests\Reporter;
+
+use Jaeger\Reporter\RemoteReporter;
+use Jaeger\Sender\UdpSender;
+use Jaeger\Span;
+use PHPUnit\Framework\TestCase;
+
+class RemoteReporterTest extends TestCase
+{
+ /** @var RemoteReporter */
+ private $reporter;
+
+ /** @var UdpSender|\PHPUnit\Framework\MockObject\MockObject */
+ private $transport;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setUp(): void
+ {
+ $this->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
new file mode 100644
index 000000000..85cb80504
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sampler/ConstSamplerTest.php
@@ -0,0 +1,43 @@
+<?php
+
+namespace Jaeger\Tests\Sampler;
+
+use Jaeger\Sampler\ConstSampler;
+use PHPUnit\Framework\TestCase;
+use const Jaeger\SAMPLER_PARAM_TAG_KEY;
+use const Jaeger\SAMPLER_TYPE_CONST;
+use const Jaeger\SAMPLER_TYPE_TAG_KEY;
+
+class ConstSamplerTest extends TestCase
+{
+ /**
+ * @test
+ * @dataProvider samplerProvider
+ * @param bool $decision
+ * @param mixed $traceId
+ */
+ public function shouldDetermineWhetherOrTraceShouldBeSampled($decision, $traceId)
+ {
+ $sampler = new ConstSampler($decision);
+
+ list($sampled, $tags) = $sampler->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
new file mode 100644
index 000000000..2840ebf8c
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sampler/ProbablisticSamplerTest.php
@@ -0,0 +1,68 @@
+<?php
+
+namespace Jaeger\Tests\Sampler;
+
+use Jaeger\Sampler\ProbabilisticSampler;
+use OutOfBoundsException;
+use PHPUnit\Framework\TestCase;
+use const Jaeger\SAMPLER_PARAM_TAG_KEY;
+use const Jaeger\SAMPLER_TYPE_PROBABILISTIC;
+use const Jaeger\SAMPLER_TYPE_TAG_KEY;
+
+class ProbablisticSamplerTest extends TestCase
+{
+ /**
+ * @test
+ * @dataProvider samplerProvider
+ * @param float $rate
+ * @param mixed $traceId
+ * @param bool $decision
+ */
+ public function shouldDetermineWhetherOrTraceShouldBeSampled($rate, $traceId, $decision)
+ {
+ $sampler = new ProbabilisticSampler($rate);
+
+ list($sampled, $tags) = $sampler->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
new file mode 100644
index 000000000..4f6b8a632
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sampler/RateLimitSamplerTest.php
@@ -0,0 +1,48 @@
+<?php
+
+namespace Jaeger\Tests\Sampler;
+
+use Cache\Adapter\PHPArray\ArrayCachePool;
+use Jaeger\Sampler\RateLimitingSampler;
+use Jaeger\Util\RateLimiter;
+use PHPUnit\Framework\TestCase;
+use const Jaeger\SAMPLER_PARAM_TAG_KEY;
+use const Jaeger\SAMPLER_TYPE_RATE_LIMITING;
+use const Jaeger\SAMPLER_TYPE_TAG_KEY;
+
+class RateLimitSamplerTest extends TestCase
+{
+ /**
+ * @test
+ * @dataProvider maxRateProvider
+ * @param integer $maxTracesPerSecond
+ * @param bool $decision
+ * @throws
+ */
+ public function shouldDetermineWhetherOrTraceShouldBeSampled($maxTracesPerSecond, $decision)
+ {
+ $sampler = new RateLimitingSampler(
+ $maxTracesPerSecond,
+ new RateLimiter(new ArrayCachePool(), 'balance', 'lastTick')
+ );
+
+ $sampler->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
new file mode 100644
index 000000000..43a303642
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ScopeManagerTest.php
@@ -0,0 +1,49 @@
+<?php
+
+namespace Jaeger\Tests;
+
+use Jaeger\ScopeManager;
+use Jaeger\Span;
+use PHPUnit\Framework\TestCase;
+
+class ScopeManagerTest extends TestCase
+{
+ /**
+ * @var ScopeManager
+ */
+ private $scopeManager;
+
+ function setUp(): void
+ {
+ $this->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
new file mode 100644
index 000000000..e36a8de3d
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ScopeTest.php
@@ -0,0 +1,58 @@
+<?php
+
+namespace Jaeger\Tests;
+
+use Jaeger\Scope;
+use Jaeger\ScopeManager;
+use Jaeger\Span;
+use PHPUnit\Framework\TestCase;
+
+class ScopeTest extends TestCase
+{
+ /**
+ * @var ScopeManager|\PHPUnit\Framework\MockObject\MockObject
+ */
+ private $scopeManager;
+
+ /**
+ * @var Span|\PHPUnit\Framework\MockObject\MockObject
+ */
+ private $span;
+
+ function setUp(): void
+ {
+ $this->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
new file mode 100644
index 000000000..5bd6d0a7b
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sender/JaegerThriftSenderTest.php
@@ -0,0 +1,126 @@
+<?php
+
+
+namespace Jaeger\Tests\Sender;
+
+use Jaeger\Sender\JaegerSender;
+use Jaeger\Sender\UdpSender;
+use Jaeger\Span;
+use Jaeger\SpanContext;
+use Jaeger\Thrift\Agent\AgentClient;
+use Jaeger\Thrift\Batch;
+use Jaeger\Tracer;
+use PHPUnit\Framework\TestCase;
+
+class JaegerThriftSenderTest extends TestCase
+{
+ /** @var Tracer|\PHPUnit\Framework\MockObject\MockObject */
+ private $tracer;
+
+ /** @var SpanContext|\PHPUnit\Framework\MockObject\MockObject */
+ private $context;
+
+ public function setUp(): void
+ {
+ $tracer = $this->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
new file mode 100644
index 000000000..9011d00e3
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/Sender/UdpSenderTest.php
@@ -0,0 +1,116 @@
+<?php
+
+namespace Jaeger\Tests\Sender;
+
+use Jaeger\Sender\UdpSender;
+use Jaeger\Span;
+use Jaeger\SpanContext;
+use Jaeger\Thrift\Agent\AgentClient;
+use Jaeger\Thrift\Agent\Zipkin\Annotation as ZipkinAnnotation;
+use Jaeger\Thrift\Agent\Zipkin\Span as ZipkinSpan;
+use Jaeger\Tracer;
+use PHPUnit\Framework\TestCase;
+
+class UdpSenderTest extends TestCase
+{
+ /**
+ * @var UdpSender
+ */
+ private $sender;
+
+ /**
+ * @var AgentClient
+ */
+ private $client;
+
+ public function setUp(): void
+ {
+ $this->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
new file mode 100644
index 000000000..998061088
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/SpanContextTest.php
@@ -0,0 +1,37 @@
+<?php
+
+namespace Jaeger\Tests;
+
+use Jaeger\SpanContext;
+use PHPUnit\Framework\TestCase;
+
+class SpanContextTest extends TestCase
+{
+ public function testIsDebugIdContainerOnly()
+ {
+ $ctx = new SpanContext(null, null, null, null, null, 'value1');
+ $this->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
new file mode 100644
index 000000000..d23879680
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/SpanTest.php
@@ -0,0 +1,293 @@
+<?php
+
+namespace Jaeger\Tests;
+
+use Jaeger\Reporter\NullReporter;
+use Jaeger\Sampler\ConstSampler;
+use Jaeger\Span;
+use Jaeger\SpanContext;
+use Jaeger\Thrift\Agent\Zipkin\AnnotationType;
+use Jaeger\Tracer;
+use PHPUnit\Framework\TestCase;
+use const Jaeger\SAMPLED_FLAG;
+
+class SpanTest extends TestCase
+{
+ /**
+ * @var Tracer
+ */
+ private $tracer;
+
+ /**
+ * @var SpanContext
+ */
+ private $context;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setUp(): void
+ {
+ $this->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
new file mode 100644
index 000000000..abc4e32aa
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/ThriftUdpTransportTest.php
@@ -0,0 +1,166 @@
+<?php
+
+namespace Jaeger\Tests;
+
+use Jaeger\Config;
+use Jaeger\Tests\Logger\StackLogger;
+use Jaeger\ThriftUdpTransport;
+use Jaeger\Tracer;
+use PHPUnit\Framework\TestCase;
+use Thrift\Exception\TTransportException;
+
+class ThriftUdpTransportTest extends TestCase
+{
+ /**
+ * @var ThriftUdpTransport
+ */
+ private $transport;
+
+ /**
+ * @var StackLogger
+ */
+ private $logger;
+
+ public function setUp(): void
+ {
+ $this->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
new file mode 100644
index 000000000..3e7b4c05f
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/TracerTest.php
@@ -0,0 +1,262 @@
+<?php
+
+namespace Jaeger\Tests;
+
+use Jaeger\Reporter\ReporterInterface;
+use Jaeger\Sampler\SamplerInterface;
+use Jaeger\Scope;
+use Jaeger\ScopeManager;
+use Jaeger\Span;
+use Jaeger\SpanContext;
+use Jaeger\Tracer;
+use OpenTracing\Exceptions\UnsupportedFormat;
+use OpenTracing\NoopSpanContext;
+use OpenTracing\UnsupportedFormatException;
+use PHPUnit\Framework\TestCase;
+use Psr\Log\LoggerInterface;
+use Psr\Log\NullLogger;
+use const Jaeger\BAGGAGE_HEADER_PREFIX;
+use const Jaeger\DEBUG_ID_HEADER_KEY;
+use const Jaeger\TRACE_ID_HEADER;
+use const Jaeger\ZIPKIN_SPAN_FORMAT;
+use const OpenTracing\Formats\TEXT_MAP;
+
+class TracerTest extends TestCase
+{
+ /**
+ * @var ReporterInterface|\PHPUnit\Framework\MockObject\MockObject
+ */
+ private $reporter;
+
+ /**
+ * @var SamplerInterface|\PHPUnit\Framework\MockObject\MockObject
+ */
+ private $sampler;
+
+ /**
+ * @var LoggerInterface
+ */
+ private $logger;
+
+ /**
+ * @var ScopeManager|\PHPUnit\Framework\MockObject\MockObject
+ */
+ private $scopeManager;
+
+ /**
+ * @var Tracer
+ */
+ private $tracer;
+
+ /**
+ * @var string
+ */
+ private $serviceName = 'test-service';
+
+ /**
+ * @var string
+ */
+ private $operationName = 'test-operation';
+
+ public function setUp(): void
+ {
+ $this->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
new file mode 100644
index 000000000..aa828030f
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/README.md
@@ -0,0 +1,48 @@
+# 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
new file mode 100644
index 000000000..99a522856
--- /dev/null
+++ b/vendor/jonahgeorge/jaeger-client-php/tests/php-test.sh
@@ -0,0 +1,64 @@
+#!/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/opentracing/opentracing/.github/ISSUE_TEMPLATE.md b/vendor/opentracing/opentracing/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 000000000..f99dd606b
--- /dev/null
+++ b/vendor/opentracing/opentracing/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,21 @@
+<!--
+Welcome to the OpenTracing PHP repo! 👋🎉
+
+- Please search for existing issues in order to ensure we don't have duplicate bugs/feature requests.)
+- Please be respectful and considerate of others when commenting on issues)
+- Please provide as much information as possible so we all understand the issue.)
+- Please don't ask questions here. If you have any question head to our gitter chat https://gitter.im/opentracing/opentracing-php
+-->
+
+
+## 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
new file mode 100644
index 000000000..d81c08379
--- /dev/null
+++ b/vendor/opentracing/opentracing/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,24 @@
+<!--
+We appreciate the effort for this pull request but before that please make sure you read the contribution guidelines given above, then fill out the blanks below.
+
+Please don't open huge pull requests and keep one pull request solving one problem.
+
+Please enter the issue number you are resolving in your PR after one of the following words [Fixes, Closes, Resolves]. This will auto-link these issues and close them when this PR is merged!
+e.g.
+Fixes #1
+Closes #2
+-->
+
+### 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
new file mode 100644
index 000000000..8fba7baf8
--- /dev/null
+++ b/vendor/opentracing/opentracing/.github/workflows/ci.yml
@@ -0,0 +1,44 @@
+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
new file mode 100644
index 000000000..56e80855d
--- /dev/null
+++ b/vendor/opentracing/opentracing/.gitignore
@@ -0,0 +1,4 @@
+.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
new file mode 100644
index 000000000..a13c0fe1d
--- /dev/null
+++ b/vendor/opentracing/opentracing/CONTRIBUTING.md
@@ -0,0 +1,75 @@
+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
new file mode 100644
index 000000000..8dada3eda
--- /dev/null
+++ b/vendor/opentracing/opentracing/LICENSE
@@ -0,0 +1,201 @@
+ 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
new file mode 100644
index 000000000..ce03bc951
--- /dev/null
+++ b/vendor/opentracing/opentracing/README.md
@@ -0,0 +1,306 @@
+# 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
new file mode 100644
index 000000000..b00b67381
--- /dev/null
+++ b/vendor/opentracing/opentracing/composer.json
@@ -0,0 +1,44 @@
+{
+ "name": "opentracing/opentracing",
+ "type": "library",
+ "description": "OpenTracing API for PHP",
+ "license": "Apache-2.0",
+ "minimum-stability": "stable",
+ "authors": [
+ {
+ "name": "José Carlos Chávez",
+ "email": "[email protected]"
+ }
+ ],
+ "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
new file mode 100644
index 000000000..c9e64bf1f
--- /dev/null
+++ b/vendor/opentracing/opentracing/phpstan.neon
@@ -0,0 +1,5 @@
+parameters:
+ paths:
+ - src
+
+ level: 5
diff --git a/vendor/opentracing/opentracing/phpunit.xml b/vendor/opentracing/opentracing/phpunit.xml
new file mode 100644
index 000000000..2083a425c
--- /dev/null
+++ b/vendor/opentracing/opentracing/phpunit.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
+ backupGlobals="true"
+ backupStaticAttributes="false"
+ bootstrap="./vendor/autoload.php"
+ colors="false"
+ convertErrorsToExceptions="true"
+ convertNoticesToExceptions="true"
+ convertWarningsToExceptions="true"
+ forceCoversAnnotation="false"
+ processIsolation="false"
+ stopOnError="false"
+ stopOnFailure="false"
+ stopOnIncomplete="false"
+ stopOnSkipped="false"
+ stopOnRisky="false"
+ timeoutForSmallTests="1"
+ timeoutForMediumTests="10"
+ timeoutForLargeTests="60"
+ verbose="false">
+ <testsuites>
+ <testsuite name="suite">
+ <directory>tests</directory>
+ </testsuite>
+ </testsuites>
+</phpunit>
diff --git a/vendor/opentracing/opentracing/src/OpenTracing/Formats.php b/vendor/opentracing/opentracing/src/OpenTracing/Formats.php
new file mode 100644
index 000000000..f26c5ecf1
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/Formats.php
@@ -0,0 +1,49 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing\Formats;
+
+/**
+ * Used a (single) arbitrary binary blob representing a SpanContext
+ *
+ * For both Tracer::inject() and Tracer::extract() the carrier must be a `string`.
+ */
+const BINARY = 'binary';
+
+/**
+ * Used for an arbitrary string-to-string map with an unrestricted character set for both keys and values
+ *
+ * Unlike `HTTP_HEADERS`, the `TEXT_MAP` format does not restrict the key or
+ * value character sets in any way.
+ *
+ * For both Tracer::inject() and Tracer::extract() the carrier must be a `array|ArrayObject`.
+ */
+const TEXT_MAP = 'text_map';
+
+/**
+ * Used for a string-to-string map with keys and values that are suitable for use in HTTP headers (a la RFC 7230.
+ * In practice, since there is such "diversity" in the way that HTTP headers are treated in the wild, it is strongly
+ * recommended that Tracer implementations use a limited HTTP header key space and escape values conservatively.
+ *
+ * Unlike `TEXT_MAP`, the `HTTP_HEADERS` format requires that the keys and values be valid as HTTP headers as-is
+ * (i.e., character casing may be unstable and special characters are disallowed in keys, values should be
+ * URL-escaped, etc).
+ *
+ * For both Tracer::inject() and Tracer::extract() the carrier must be a `array|ArrayObject`.
+ *
+ * For example, Tracer::inject():
+ *
+ * $headers = []
+ * $tracer->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
new file mode 100644
index 000000000..aafdba121
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/GlobalTracer.php
@@ -0,0 +1,60 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+final class GlobalTracer
+{
+ /**
+ * @var Tracer
+ */
+ private static $instance;
+
+ /**
+ * @var bool
+ */
+ private static $isRegistered = false;
+
+ /**
+ * GlobalTracer::set sets the [singleton] Tracer returned by get().
+ * Those who use GlobalTracer (rather than directly manage a Tracer instance)
+ * should call GlobalTracer::set as early as possible in bootstrap, prior to
+ * start a new span. Prior to calling GlobalTracer::set, any Spans started
+ * via the `Tracer::startActiveSpan` (etc) globals are noops.
+ *
+ * @param Tracer $tracer
+ * @return void
+ */
+ public static function set(Tracer $tracer): void
+ {
+ self::$instance = $tracer;
+ self::$isRegistered = true;
+ }
+
+ /**
+ * GlobalTracer::get returns the global singleton `Tracer` implementation.
+ * Before `GlobalTracer::set` is called, the `GlobalTracer::get` is a noop
+ * implementation that drops all data handed to it.
+ *
+ * @return Tracer
+ */
+ public static function get(): Tracer
+ {
+ if (self::$instance === null) {
+ self::$instance = new NoopTracer();
+ }
+
+ return self::$instance;
+ }
+
+ /**
+ * Returns true if a global tracer has been registered, otherwise returns false.
+ *
+ * @return bool
+ */
+ public static function isRegistered(): bool
+ {
+ return self::$isRegistered;
+ }
+}
diff --git a/vendor/opentracing/opentracing/src/OpenTracing/InvalidReferenceArgumentException.php b/vendor/opentracing/opentracing/src/OpenTracing/InvalidReferenceArgumentException.php
new file mode 100644
index 000000000..128360393
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/InvalidReferenceArgumentException.php
@@ -0,0 +1,33 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+use InvalidArgumentException;
+
+/**
+ * Thrown when passing an invalid argument for a reference
+ */
+final class InvalidReferenceArgumentException extends InvalidArgumentException
+{
+ /**
+ * @return InvalidReferenceArgumentException
+ */
+ public static function forEmptyType(): InvalidReferenceArgumentException
+ {
+ return new self('Reference type can not be an empty string');
+ }
+
+ /**
+ * @param mixed $context
+ * @return InvalidReferenceArgumentException
+ */
+ public static function forInvalidContext($context): InvalidReferenceArgumentException
+ {
+ return new self(sprintf(
+ 'Reference expects \OpenTracing\Span or \OpenTracing\SpanContext as context, got %s',
+ is_object($context) ? get_class($context) : gettype($context)
+ ));
+ }
+}
diff --git a/vendor/opentracing/opentracing/src/OpenTracing/InvalidReferencesSetException.php b/vendor/opentracing/opentracing/src/OpenTracing/InvalidReferencesSetException.php
new file mode 100644
index 000000000..de7d907c8
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/InvalidReferencesSetException.php
@@ -0,0 +1,30 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+use DomainException;
+
+/**
+ * Thrown when a reference has more than one parent in the SpanOptions
+ */
+final class InvalidReferencesSetException extends DomainException
+{
+ /**
+ * @param string $message
+ * @return InvalidReferencesSetException
+ */
+ public static function create(string $message): InvalidReferencesSetException
+ {
+ return new self($message);
+ }
+
+ /**
+ * @return InvalidReferencesSetException
+ */
+ public static function forMoreThanOneParent(): InvalidReferencesSetException
+ {
+ return new self('Span can not have more than one parent, either one as child_of or either one as follows_from');
+ }
+}
diff --git a/vendor/opentracing/opentracing/src/OpenTracing/InvalidSpanOptionException.php b/vendor/opentracing/opentracing/src/OpenTracing/InvalidSpanOptionException.php
new file mode 100644
index 000000000..f9b8003ff
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/InvalidSpanOptionException.php
@@ -0,0 +1,131 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+use InvalidArgumentException;
+
+/**
+ * Thrown when passing an invalid option on Span creation
+ */
+final class InvalidSpanOptionException extends InvalidArgumentException
+{
+ /**
+ * @return InvalidSpanOptionException
+ */
+ public static function forIncludingBothChildOfAndReferences(): InvalidSpanOptionException
+ {
+ return new self('Either "childOf" or "references" options are accepted but not both.');
+ }
+
+ /**
+ * @param mixed $reference
+ * @return InvalidSpanOptionException
+ */
+ public static function forInvalidReference($reference): InvalidSpanOptionException
+ {
+ return new self(sprintf(
+ 'Invalid reference. Expected OpenTracing\Reference, got %s.',
+ is_object($reference) ? get_class($reference) : gettype($reference)
+ ));
+ }
+
+ /**
+ * @return InvalidSpanOptionException
+ */
+ public static function forInvalidStartTime(): InvalidSpanOptionException
+ {
+ return new self('Invalid start_time option. Expected int or float got string.');
+ }
+
+ /**
+ * @param mixed $childOfOption
+ * @return InvalidSpanOptionException
+ */
+ public static function forInvalidChildOf($childOfOption): InvalidSpanOptionException
+ {
+ return new self(sprintf(
+ 'Invalid child_of option. Expected Span or SpanContext, got %s',
+ is_object($childOfOption) ? get_class($childOfOption) : gettype($childOfOption)
+ ));
+ }
+
+ /**
+ * @param string $key
+ * @return InvalidSpanOptionException
+ */
+ public static function forUnknownOption(string $key): InvalidSpanOptionException
+ {
+ return new self(sprintf('Invalid option %s.', $key));
+ }
+
+ /**
+ * @param mixed $tag
+ * @return InvalidSpanOptionException
+ */
+ public static function forInvalidTag($tag): InvalidSpanOptionException
+ {
+ return new self(sprintf('Invalid tag. Expected string, got %s', gettype($tag)));
+ }
+
+ /**
+ * @param mixed $tagValue
+ * @return InvalidSpanOptionException
+ */
+ public static function forInvalidTagValue($tagValue): InvalidSpanOptionException
+ {
+ return new self(sprintf(
+ 'Invalid tag value. Expected scalar or object with __toString method, got %s',
+ is_object($tagValue) ? get_class($tagValue) : gettype($tagValue)
+ ));
+ }
+
+ /**
+ * @param mixed $value
+ * @return InvalidSpanOptionException
+ */
+ public static function forInvalidTags($value): InvalidSpanOptionException
+ {
+ return new self(sprintf(
+ 'Invalid tags value. Expected a associative array of tags, got %s',
+ is_object($value) ? get_class($value) : gettype($value)
+ ));
+ }
+
+ /**
+ * @param mixed $value
+ * @return InvalidSpanOptionException
+ */
+ public static function forInvalidReferenceSet($value): InvalidSpanOptionException
+ {
+ return new self(sprintf(
+ 'Invalid references set. Expected Reference or Reference[], got %s',
+ is_object($value) ? get_class($value) : gettype($value)
+ ));
+ }
+
+ /**
+ * @param mixed $value
+ * @return InvalidSpanOptionException
+ */
+ public static function forFinishSpanOnClose($value): InvalidSpanOptionException
+ {
+ return new self(sprintf(
+ 'Invalid type for finish_span_on_close. Expected bool, got %s',
+ is_object($value) ? get_class($value) : gettype($value)
+ ));
+ }
+
+ /**
+ * @param mixed $value
+ * @return InvalidSpanOptionException
+ */
+ public static function forIgnoreActiveSpan($value): InvalidSpanOptionException
+ {
+ return new self(sprintf(
+ 'Invalid type for ignore_active_span. Expected bool, got %s',
+ is_object($value) ? get_class($value) : gettype($value)
+ ));
+ }
+}
diff --git a/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockScope.php b/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockScope.php
new file mode 100644
index 000000000..a814b45b5
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockScope.php
@@ -0,0 +1,62 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing\Mock;
+
+use OpenTracing\Scope;
+use OpenTracing\Span;
+
+final class MockScope implements Scope
+{
+ /**
+ * @var Span
+ */
+ private $span;
+
+ /**
+ * @var MockScopeManager
+ */
+ private $scopeManager;
+
+ /**
+ * @var bool
+ */
+ private $finishSpanOnClose;
+
+ /**
+ * @param MockScopeManager $scopeManager
+ * @param Span $span
+ * @param bool $finishSpanOnClose
+ */
+ public function __construct(
+ MockScopeManager $scopeManager,
+ Span $span,
+ bool $finishSpanOnClose
+ ) {
+ $this->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
new file mode 100644
index 000000000..c75c71942
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockScopeManager.php
@@ -0,0 +1,49 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing\Mock;
+
+use OpenTracing\Scope;
+use OpenTracing\ScopeManager;
+use OpenTracing\Span;
+
+final class MockScopeManager implements ScopeManager
+{
+ /**
+ * @var Scope[]
+ */
+ private $scopes = [];
+
+ /**
+ * {@inheritdoc}
+ */
+ public function activate(Span $span, bool $finishSpanOnClose = ScopeManager::DEFAULT_FINISH_SPAN_ON_CLOSE): Scope
+ {
+ $scope = new MockScope($this, $span, $finishSpanOnClose);
+ $this->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
new file mode 100644
index 000000000..db53649bf
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockSpan.php
@@ -0,0 +1,145 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing\Mock;
+
+use OpenTracing\Span;
+use OpenTracing\SpanContext;
+
+final class MockSpan implements Span
+{
+ /**
+ * @var string
+ */
+ private $operationName;
+
+ /**
+ * @var SpanContext
+ */
+ private $context;
+
+ /**
+ * @var array
+ */
+ private $tags = [];
+
+ /**
+ * @var array
+ */
+ private $logs = [];
+
+ /**
+ * @var int
+ */
+ private $startTime;
+
+ /**
+ * @var int|null
+ */
+ private $duration;
+
+ public function __construct(
+ string $operationName,
+ SpanContext $context,
+ ?int $startTime = null
+ ) {
+ $this->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
new file mode 100644
index 000000000..d094ea0e0
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockSpanContext.php
@@ -0,0 +1,100 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing\Mock;
+
+use OpenTracing\SpanContext;
+use ArrayIterator;
+
+final class MockSpanContext implements SpanContext
+{
+ /**
+ * @var int
+ */
+ private $traceId;
+
+ /**
+ * @var int
+ */
+ private $spanId;
+
+ /**
+ * @var bool
+ */
+ private $isSampled;
+
+ /**
+ * @var array
+ */
+ private $items;
+
+ private function __construct(int $traceId, int $spanId, bool $isSampled, array $items)
+ {
+ $this->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
new file mode 100644
index 000000000..f4f4577a1
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/Mock/MockTracer.php
@@ -0,0 +1,152 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing\Mock;
+
+use OpenTracing\InvalidReferenceArgumentException;
+use OpenTracing\UnsupportedFormatException;
+use OpenTracing\Scope;
+use OpenTracing\ScopeManager;
+use OpenTracing\Span;
+use OpenTracing\SpanContext;
+use OpenTracing\StartSpanOptions;
+use OpenTracing\Tracer;
+
+final class MockTracer implements Tracer
+{
+ /**
+ * @var array|MockSpan[]
+ */
+ private $spans = [];
+
+ /**
+ * @var array|callable[]
+ */
+ private $injectors;
+
+ /**
+ * @var array|callable[]
+ */
+ private $extractors;
+
+ /**
+ * @var ScopeManager
+ */
+ private $scopeManager;
+
+ public function __construct(array $injectors = [], array $extractors = [])
+ {
+ $this->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
new file mode 100644
index 000000000..7170c846a
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/NoopScope.php
@@ -0,0 +1,23 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+final class NoopScope implements Scope
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function close(): void
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getSpan(): Span
+ {
+ return new NoopSpan();
+ }
+}
diff --git a/vendor/opentracing/opentracing/src/OpenTracing/NoopScopeManager.php b/vendor/opentracing/opentracing/src/OpenTracing/NoopScopeManager.php
new file mode 100644
index 000000000..5576171a8
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/NoopScopeManager.php
@@ -0,0 +1,24 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+final class NoopScopeManager implements ScopeManager
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function activate(Span $span, bool $finishSpanOnClose = ScopeManager::DEFAULT_FINISH_SPAN_ON_CLOSE): Scope
+ {
+ return new NoopScope();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getActive(): ?Scope
+ {
+ return new NoopScope();
+ }
+}
diff --git a/vendor/opentracing/opentracing/src/OpenTracing/NoopSpan.php b/vendor/opentracing/opentracing/src/OpenTracing/NoopSpan.php
new file mode 100644
index 000000000..c1af8dfc7
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/NoopSpan.php
@@ -0,0 +1,67 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+final class NoopSpan implements Span
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function getOperationName(): string
+ {
+ return 'noop_span';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getContext(): SpanContext
+ {
+ return new NoopSpanContext();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function finish($finishTime = null): void
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function overwriteOperationName(string $newOperationName): void
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setTag(string $key, $value): void
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function log(array $fields = [], $timestamp = null): void
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function addBaggageItem(string $key, string $value): void
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getBaggageItem(string $key): ?string
+ {
+ return null;
+ }
+}
diff --git a/vendor/opentracing/opentracing/src/OpenTracing/NoopSpanContext.php b/vendor/opentracing/opentracing/src/OpenTracing/NoopSpanContext.php
new file mode 100644
index 000000000..5b0de7c93
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/NoopSpanContext.php
@@ -0,0 +1,35 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+use EmptyIterator;
+use Traversable;
+
+final class NoopSpanContext implements SpanContext
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function getIterator(): Traversable
+ {
+ return new EmptyIterator();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getBaggageItem(string $key): ?string
+ {
+ return null;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function withBaggageItem(string $key, string $value): SpanContext
+ {
+ return new self();
+ }
+}
diff --git a/vendor/opentracing/opentracing/src/OpenTracing/NoopTracer.php b/vendor/opentracing/opentracing/src/OpenTracing/NoopTracer.php
new file mode 100644
index 000000000..267823bb9
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/NoopTracer.php
@@ -0,0 +1,62 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+final class NoopTracer implements Tracer
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function getActiveSpan(): ?Span
+ {
+ return new NoopSpan();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getScopeManager(): ScopeManager
+ {
+ return new NoopScopeManager();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function startSpan(string $operationName, $options = []): Span
+ {
+ return new NoopSpan();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function startActiveSpan(string $operationName, $options = []): Scope
+ {
+ return new NoopScope();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function inject(SpanContext $spanContext, string $format, &$carrier): void
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function extract(string $format, $carrier): ?SpanContext
+ {
+ return new NoopSpanContext();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function flush(): void
+ {
+ }
+}
diff --git a/vendor/opentracing/opentracing/src/OpenTracing/Reference.php b/vendor/opentracing/opentracing/src/OpenTracing/Reference.php
new file mode 100644
index 000000000..7dadf1785
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/Reference.php
@@ -0,0 +1,77 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+use OpenTracing\InvalidReferenceArgumentException;
+
+final class Reference
+{
+ /**
+ * A Span may be the ChildOf a parent Span. In a ChildOf reference,
+ * the parent Span depends on the child Span in some capacity.
+ */
+ public const CHILD_OF = 'child_of';
+
+ /**
+ * Some parent Spans do not depend in any way on the result of their
+ * child Spans. In these cases, we say merely that the child Span
+ * FollowsFrom the parent Span in a causal sense.
+ */
+ public const FOLLOWS_FROM = 'follows_from';
+
+ /**
+ * @var string
+ */
+ private $type;
+
+ /**
+ * @var SpanContext
+ */
+ private $spanContext;
+
+ /**
+ * @param string $type
+ * @param SpanContext $spanContext
+ */
+ public function __construct(string $type, SpanContext $spanContext)
+ {
+ if (empty($type)) {
+ throw InvalidReferenceArgumentException::forEmptyType();
+ }
+
+ $this->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
new file mode 100644
index 000000000..174495434
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/Scope.php
@@ -0,0 +1,32 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+/**
+ * A {@link Scope} formalizes the activation and deactivation of a {@link Span}, usually from a CPU standpoint.
+ *
+ * Many times a {@link Span} will be extant (in that {@link Span#finish()} has not been called) despite being in a
+ * non-runnable state from a CPU/scheduler standpoint. For instance, a {@link Span} representing the client side of an
+ * RPC will be unfinished but blocked on IO while the RPC is still outstanding. A {@link Scope} defines when a given
+ * {@link Span} <em>is</em> 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
new file mode 100644
index 000000000..db5fcaa47
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/ScopeManager.php
@@ -0,0 +1,40 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+/**
+ * Keeps track of the current active `Span`.
+ */
+interface ScopeManager
+{
+ public const DEFAULT_FINISH_SPAN_ON_CLOSE = true;
+
+ /**
+ * Activates an `Span`, so that it is used as a parent when creating new spans.
+ * The implementation must keep track of the active spans sequence, so
+ * that previous spans can be resumed after a deactivation.
+ *
+ * @param Span $span the {@link Span} that should become the {@link #active()}
+ * @param bool $finishSpanOnClose whether span should automatically be finished
+ * when {@link Scope#close()} is called. Its default value is true.
+ *
+ * @return Scope instance to control the end of the active period for the {@link Span}. It is a
+ * programming error to neglect to call {@link Scope#close()} on the returned instance.
+ */
+ public function activate(Span $span, bool $finishSpanOnClose = self::DEFAULT_FINISH_SPAN_ON_CLOSE): Scope;
+
+ /**
+ * Return the currently active {@link Scope} which can be used to access the
+ * currently active {@link Scope#getSpan()}.
+ *
+ * If there is an {@link Scope non-null scope}, its wrapped {@link Span} becomes an implicit parent
+ * (as {@link References#CHILD_OF} reference) of any
+ * newly-created {@link Span} at {@link Tracer.SpanBuilder#startActive(boolean)} or {@link SpanBuilder#start()}
+ * time rather than at {@link Tracer#buildSpan(String)} time.
+ *
+ * @return Scope|null
+ */
+ public function getActive(): ?Scope;
+}
diff --git a/vendor/opentracing/opentracing/src/OpenTracing/Span.php b/vendor/opentracing/opentracing/src/OpenTracing/Span.php
new file mode 100644
index 000000000..9fa8c2bc2
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/Span.php
@@ -0,0 +1,95 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+use DateTimeInterface;
+
+interface Span
+{
+ /**
+ * @return string
+ */
+ public function getOperationName(): string;
+
+ /**
+ * Yields the SpanContext for this Span. Note that the return value of
+ * Span::getContext() is still valid after a call to Span::finish(), as is
+ * a call to Span::getContext() after a call to Span::finish().
+ *
+ * @return SpanContext
+ */
+ public function getContext(): SpanContext;
+
+ /**
+ * Sets the end timestamp and finalizes Span state.
+ *
+ * With the exception of calls to getContext() (which are always allowed),
+ * finish() must be the last call made to any span instance, and to do
+ * otherwise leads to undefined behavior but not returning an exception.
+ *
+ * As an implementor, make sure you call {@see Tracer::deactivate()}
+ * otherwise new spans might try to be child of this one.
+ *
+ * If the span is already finished, a warning should be logged.
+ *
+ * @param float|int|DateTimeInterface|null $finishTime if passing float or int
+ * it should represent the timestamp (including as many decimal places as you need)
+ * @return void
+ */
+ public function finish($finishTime = null): void;
+
+ /**
+ * If the span is already finished, a warning should be logged.
+ *
+ * @param string $newOperationName
+ * @return void
+ */
+ public function overwriteOperationName(string $newOperationName): void;
+
+ /**
+ * Adds a tag to the span.
+ *
+ * If there is a pre-existing tag set for key, it is overwritten.
+ *
+ * As an implementor, consider using "standard tags" listed in {@see \OpenTracing\Tags}
+ *
+ * If the span is already finished, a warning should be logged.
+ *
+ * @param string $key
+ * @param string|bool|int|float $value
+ * @return void
+ */
+ public function setTag(string $key, $value): void;
+
+ /**
+ * Adds a log record to the span in key => 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
new file mode 100644
index 000000000..ca05ff9ac
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/SpanContext.php
@@ -0,0 +1,37 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+use IteratorAggregate;
+
+/**
+ * SpanContext must be immutable in order to avoid complicated lifetime
+ * issues around Span finish and references.
+ *
+ * Baggage items are key => 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
new file mode 100644
index 000000000..28b73ff0a
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/StartSpanOptions.php
@@ -0,0 +1,206 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+use DateTime;
+use DateTimeInterface;
+use OpenTracing\InvalidReferencesSetException;
+use OpenTracing\InvalidSpanOptionException;
+
+final class StartSpanOptions
+{
+ /**
+ * @var Reference[]
+ */
+ private $references = [];
+
+ /**
+ * @var array
+ */
+ private $tags = [];
+
+ /**
+ * @var int|float|DateTimeInterface
+ */
+ private $startTime;
+
+ /**
+ * Only used for spans that are actively managed by scope manager.
+ *
+ * @var bool
+ */
+ private $finishSpanOnClose = ScopeManager::DEFAULT_FINISH_SPAN_ON_CLOSE;
+
+ /**
+ * @var bool
+ */
+ private $ignoreActiveSpan = false;
+
+ /**
+ * @param array $options
+ * @return StartSpanOptions
+ * @throws InvalidReferencesSetException when there are inconsistencies about the references
+ * @throws InvalidSpanOptionException when one of the options is invalid
+ */
+ public static function create(array $options): StartSpanOptions
+ {
+ $spanOptions = new self();
+
+ foreach ($options as $key => $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
new file mode 100644
index 000000000..5d06627de
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/Tags.php
@@ -0,0 +1,124 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing\Tags;
+
+/**
+ * SpanKind hints at relationship between spans, e.g. client/server
+ */
+const SPAN_KIND = 'span.kind';
+
+/**
+ * Marks a span representing the client-side of an RPC or other remote call
+ */
+const SPAN_KIND_RPC_CLIENT = 'client';
+
+/**
+ * Marks a span representing the server-side of an RPC or other remote call
+ */
+const SPAN_KIND_RPC_SERVER = 'server';
+
+/**
+ * Marks a span as representing the producer within a messaging context
+ */
+const SPAN_KIND_MESSAGE_BUS_PRODUCER = 'producer';
+
+/**
+ * Marks a span as representing the consumer within a messaging context
+ */
+const SPAN_KIND_MESSAGE_BUS_CONSUMER = 'consumer';
+
+/**
+ * Component is a low-cardinality identifier of the module, library,
+ * or package that is generating a span.
+ */
+const COMPONENT = 'component';
+
+/**
+ * SAMPLING_PRIORITY (uint16) determines the priority of sampling this Span.
+ */
+const SAMPLING_PRIORITY = 'sampling.priority';
+
+/**
+ * PeerService records the service name of the peer
+ */
+const PEER_SERVICE = 'peer.service';
+
+/**
+ * PeerHostname records the host name of the peer
+ */
+const PEER_HOSTNAME = 'peer.hostname';
+
+/**
+ * PEER_ADDRESS (string) suitable for use in a networking client library.
+ * This may be a "ip:port", a bare "hostname", a FQDN, or even a # JDBC
+ * substring like "mysql://prod-db:3306"
+ */
+const PEER_ADDRESS = 'peer.address';
+
+/**
+ * PEER_HOST_IPV4 (uint32) records IP v4 host address of the peer
+ */
+const PEER_HOST_IPV4 = 'peer.ipv4';
+
+/**
+ * PEER_HOST_IPV6 (string) records IP v6 host address of the peer
+ */
+const PEER_HOST_IPV6 = 'peer.ipv6';
+
+/** PEER_PORT (uint16) records port number of the peer */
+const PEER_PORT = 'peer.port';
+
+/**
+ * HTTPUrl should be the URL of the request being handled in this segment
+ * of the trace, in standard URI format. The protocol is optional.
+ */
+const HTTP_URL = 'http.url';
+
+/**
+ * HTTPMethod is the HTTP method of the request, and is case-insensitive.
+ */
+const HTTP_METHOD = 'http.method';
+
+/**
+ * HTTPStatusCode is the numeric HTTP status code (200, 404, etc) of the
+ * HTTP response.
+ */
+const HTTP_STATUS_CODE = 'http.status_code';
+
+/**
+ * DATABASE_INSTANCE (string) The database instance name.
+ */
+const DATABASE_INSTANCE = 'db.instance';
+
+/**
+ * DATABASE_STATEMENT (string) A database statement for the given database
+ * type. E.g., for db.type="SQL", "SELECT * FROM user_table"; # for
+ * db.type="redis", "SET mykey 'WuValue'". */
+const DATABASE_STATEMENT = 'db.statement';
+
+/**
+ * DATABASE_TYPE (string) For any SQL database, "sql". For others, the lower-case
+ * database category, e.g. "cassandra", "hbase", or "redis".
+ */
+const DATABASE_TYPE = 'db.type';
+
+/**
+ * DATABASE_USER (string) Username for accessing database. E.g., "readonly_user" or
+ * "reporting_user"
+ */
+const DATABASE_USER = 'db.user';
+
+/**
+ * MESSAGE_BUS_DESTINATION (string) An address at which messages can be #
+ * exchanged. E.g. A Kafka record has an associated "topic name" that can #
+ * be extracted by the instrumented producer or consumer and stored # using
+ * this tag.
+ */
+const MESSAGE_BUS_DESTINATION = 'message_bus.destination';
+
+/**
+ * Error indicates that operation represented by the span resulted in an error.
+ */
+const ERROR = 'error';
diff --git a/vendor/opentracing/opentracing/src/OpenTracing/Tracer.php b/vendor/opentracing/opentracing/src/OpenTracing/Tracer.php
new file mode 100644
index 000000000..391a5159b
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/Tracer.php
@@ -0,0 +1,119 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+use OpenTracing\UnsupportedFormatException;
+use OpenTracing\InvalidSpanOptionException;
+use OpenTracing\InvalidReferencesSetException;
+
+interface Tracer
+{
+ /**
+ * Returns the current {@link ScopeManager}, which may be a noop but may not be null.
+ *
+ * @return ScopeManager
+ */
+ public function getScopeManager(): ScopeManager;
+
+ /**
+ * Returns the active {@link Span}. This is a shorthand for
+ * Tracer::getScopeManager()->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
new file mode 100644
index 000000000..dd4ef56a3
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/UnsupportedFormatException.php
@@ -0,0 +1,22 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+use UnexpectedValueException;
+
+/**
+ * Thrown when trying to inject or extract in an invalid format
+ */
+final class UnsupportedFormatException extends UnexpectedValueException
+{
+ /**
+ * @param string $format
+ * @return UnsupportedFormatException
+ */
+ public static function forFormat(string $format): UnsupportedFormatException
+ {
+ return new self(sprintf('The format "%s" is not supported.', $format));
+ }
+}
diff --git a/vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockScopeManagerTest.php b/vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockScopeManagerTest.php
new file mode 100644
index 000000000..eeca24497
--- /dev/null
+++ b/vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockScopeManagerTest.php
@@ -0,0 +1,63 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing\Tests\Mock;
+
+use OpenTracing\Mock\MockScopeManager;
+use OpenTracing\Mock\MockTracer;
+use PHPUnit\Framework\TestCase;
+
+final class MockScopeManagerTest extends TestCase
+{
+ private const OPERATION_NAME = 'test_name';
+
+ public function testGetActiveFailsWithNoActiveSpans()
+ {
+ $scopeManager = new MockScopeManager();
+
+ $this->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
new file mode 100644
index 000000000..501450b24
--- /dev/null
+++ b/vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockSpanContextTest.php
@@ -0,0 +1,54 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing\Tests\Mock;
+
+use OpenTracing\Mock\MockSpanContext;
+use PHPUnit\Framework\TestCase;
+
+final class MockSpanContextTest extends TestCase
+{
+ private const TRACE_ID = 123987;
+ private const SPAN_ID = 555632;
+ private const IS_SAMPLED = true;
+ private const BAGGAGE_ITEM_KEY = 'test_key';
+ private const BAGGAGE_ITEM_VALUE = 'test_value';
+
+ public function testCreateAsRootSuccess()
+ {
+ $parentContext = MockSpanContext::createAsRoot();
+ $childContext = MockSpanContext::createAsChildOf($parentContext);
+
+ $this->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
new file mode 100644
index 000000000..51e4b66f8
--- /dev/null
+++ b/vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockSpanTest.php
@@ -0,0 +1,52 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing\Tests\Mock;
+
+use OpenTracing\Mock\MockSpan;
+use OpenTracing\Mock\MockSpanContext;
+use PHPUnit\Framework\TestCase;
+
+/**
+ * @covers MockSpan
+ */
+final class MockSpanTest extends TestCase
+{
+ private const OPERATION_NAME = 'test';
+ private const DURATION = 10;
+ private const TAG_KEY = 'test_key';
+ private const TAG_VALUE = 'test_value';
+ private const LOG_FIELD = 'test_log';
+
+ public function testCreateSpanSuccess()
+ {
+ $startTime = time();
+ $span = new MockSpan(self::OPERATION_NAME, MockSpanContext::createAsRoot(), $startTime);
+
+ $this->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
new file mode 100644
index 000000000..ab2faf159
--- /dev/null
+++ b/vendor/opentracing/opentracing/tests/OpenTracing/Mock/MockTracerTest.php
@@ -0,0 +1,139 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing\Tests\Mock;
+
+use OpenTracing\InvalidReferenceArgumentException;
+use OpenTracing\UnsupportedFormatException;
+use OpenTracing\Mock\MockTracer;
+use OpenTracing\NoopSpanContext;
+use OpenTracing\Reference;
+use OpenTracing\Span;
+use OpenTracing\SpanContext;
+use PHPUnit\Framework\TestCase;
+
+/**
+ * @covers MockTracer
+ */
+final class MockTracerTest extends TestCase
+{
+ private const OPERATION_NAME = 'test_name';
+ private const FORMAT = 'test_format';
+
+ public function testStartActiveSpanSuccess()
+ {
+ $tracer = new MockTracer();
+ $scope = $tracer->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
new file mode 100644
index 000000000..cb971a20c
--- /dev/null
+++ b/vendor/opentracing/opentracing/tests/OpenTracing/ReferenceTest.php
@@ -0,0 +1,45 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing\Tests;
+
+use TypeError;
+use PHPUnit\Framework\TestCase;
+use OpenTracing\Reference;
+use OpenTracing\NoopSpanContext;
+use OpenTracing\InvalidReferenceArgumentException;
+
+/**
+ * @covers Reference
+ */
+final class ReferenceTest extends TestCase
+{
+ const REFERENCE_TYPE = 'ref_type';
+
+ public function testCreateAReferenceFailsOnInvalidContext()
+ {
+ $context = 'invalid_context';
+
+ $this->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
new file mode 100644
index 000000000..d7e1504a8
--- /dev/null
+++ b/vendor/opentracing/opentracing/tests/OpenTracing/StartSpanOptionsTest.php
@@ -0,0 +1,129 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing\Tests;
+
+use DateTime;
+use OpenTracing\InvalidSpanOptionException;
+use OpenTracing\NoopSpanContext;
+use OpenTracing\Reference;
+use OpenTracing\StartSpanOptions;
+use PHPUnit\Framework\TestCase;
+
+/**
+ * @covers StartSpanOptions
+ */
+final class StartSpanOptionsTest extends TestCase
+{
+ const REFERENCE_TYPE = 'a_reference_type';
+
+ public function testSpanOptionsCanNotBeCreatedDueToInvalidOption()
+ {
+ $this->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
new file mode 100644
index 000000000..ff72e2d08
--- /dev/null
+++ b/vendor/packaged/thrift/.gitignore
@@ -0,0 +1,2 @@
+/composer.lock
+/vendor
diff --git a/vendor/packaged/thrift/README.md b/vendor/packaged/thrift/README.md
new file mode 100644
index 000000000..c35ca057e
--- /dev/null
+++ b/vendor/packaged/thrift/README.md
@@ -0,0 +1,44 @@
+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
new file mode 100644
index 000000000..8a8227dd3
--- /dev/null
+++ b/vendor/packaged/thrift/composer.json
@@ -0,0 +1,16 @@
+{
+ "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
new file mode 100644
index 000000000..c61b631af
--- /dev/null
+++ b/vendor/packaged/thrift/src/Base/TBase.php
@@ -0,0 +1,382 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift
+ */
+
+namespace Thrift\Base;
+
+use Thrift\Type\TType;
+
+/**
+ * Base class from which other Thrift structs extend. This is so that we can
+ * cut back on the size of the generated code which is turning out to have a
+ * nontrivial cost just to load thanks to the wondrously abysmal implementation
+ * of PHP. Note that code is intentionally duplicated in here to avoid making
+ * function calls for every field or member of a container..
+ */
+abstract class TBase
+{
+ 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'
+ );
+
+ 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
new file mode 100644
index 000000000..4361bd84e
--- /dev/null
+++ b/vendor/packaged/thrift/src/ClassLoader/ThriftClassLoader.php
@@ -0,0 +1,206 @@
+<?php
+/*
+ * 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.
+ *
+ * ClassLoader to load Thrift library and definitions
+ * Inspired from UniversalClassLoader from Symfony 2
+ *
+ * @package thrift.classloader
+ */
+
+namespace Thrift\ClassLoader;
+
+class ThriftClassLoader
+{
+ /**
+ * Namespaces path
+ * @var array
+ */
+ protected $namespaces = array();
+
+ /**
+ * Thrift definition paths
+ * @var type
+ */
+ protected $definitions = array();
+
+ /**
+ * Do we use APC cache ?
+ * @var boolean
+ */
+ protected $apc = false;
+
+ /**
+ * APC Cache prefix
+ * @var string
+ */
+ protected $apc_prefix;
+
+ /**
+ * Set autoloader to use APC cache
+ * @param boolean $apc
+ * @param string $apc_prefix
+ */
+ public function __construct($apc = false, $apc_prefix = null)
+ {
+ $this->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
new file mode 100644
index 000000000..ebb6a6a89
--- /dev/null
+++ b/vendor/packaged/thrift/src/Exception/TApplicationException.php
@@ -0,0 +1,76 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift
+ */
+
+namespace Thrift\Exception;
+
+use Thrift\Type\TType;
+
+class TApplicationException extends TException
+{
+ public static $_TSPEC =
+ array(1 => 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
new file mode 100644
index 000000000..7dbf83293
--- /dev/null
+++ b/vendor/packaged/thrift/src/Exception/TException.php
@@ -0,0 +1,384 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift
+ */
+
+namespace Thrift\Exception;
+
+use Thrift\Type\TType;
+use Thrift\Base\TBase;
+
+/**
+ * NOTE(mcslee): This currently contains a ton of duplicated code from TBase
+ * because we need to save CPU cycles and this is not yet in an extension.
+ * Ideally we'd multiply-inherit TException from both Exception and Base, but
+ * that's not possible in PHP and there are no modules either, so for now we
+ * apologetically take a trip to HackTown.
+ *
+ * Can be called with standard Exception constructor (message, code) or with
+ * Thrift Base object constructor (spec, vals).
+ *
+ * @param mixed $p1 Message (string) or type-spec (array)
+ * @param mixed $p2 Code (integer) or values (array)
+ */
+class TException extends \Exception
+{
+ public function __construct($p1 = null, $p2 = 0)
+ {
+ if (is_array($p1) && is_array($p2)) {
+ $spec = $p1;
+ $vals = $p2;
+ foreach ($spec as $fid => $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
new file mode 100644
index 000000000..3a55d45ff
--- /dev/null
+++ b/vendor/packaged/thrift/src/Exception/TProtocolException.php
@@ -0,0 +1,50 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ * @author: rmarin ([email protected])
+ */
+
+namespace Thrift\Exception;
+
+/**
+ * Protocol module. Contains all the types and definitions needed to implement
+ * a protocol encoder/decoder.
+ *
+ * @package thrift.protocol
+ */
+
+/**
+ * Protocol exceptions
+ */
+class TProtocolException extends TException
+{
+ const UNKNOWN = 0;
+ const INVALID_DATA = 1;
+ const NEGATIVE_SIZE = 2;
+ const SIZE_LIMIT = 3;
+ const BAD_VERSION = 4;
+ const NOT_IMPLEMENTED = 5;
+ const DEPTH_LIMIT = 6;
+
+ public function __construct($message = null, $code = 0)
+ {
+ parent::__construct($message, $code);
+ }
+}
diff --git a/vendor/packaged/thrift/src/Exception/TTransportException.php b/vendor/packaged/thrift/src/Exception/TTransportException.php
new file mode 100644
index 000000000..7d8d56743
--- /dev/null
+++ b/vendor/packaged/thrift/src/Exception/TTransportException.php
@@ -0,0 +1,40 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.transport
+ */
+
+namespace Thrift\Exception;
+
+/**
+ * Transport exceptions
+ */
+class TTransportException extends TException
+{
+ const UNKNOWN = 0;
+ const NOT_OPEN = 1;
+ const ALREADY_OPEN = 2;
+ const TIMED_OUT = 3;
+ const END_OF_FILE = 4;
+
+ public function __construct($message = null, $code = 0)
+ {
+ parent::__construct($message, $code);
+ }
+}
diff --git a/vendor/packaged/thrift/src/Factory/TBinaryProtocolFactory.php b/vendor/packaged/thrift/src/Factory/TBinaryProtocolFactory.php
new file mode 100644
index 000000000..2519183df
--- /dev/null
+++ b/vendor/packaged/thrift/src/Factory/TBinaryProtocolFactory.php
@@ -0,0 +1,45 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Factory;
+
+use Thrift\Protocol\TBinaryProtocol;
+
+/**
+ * Binary Protocol Factory
+ */
+class TBinaryProtocolFactory implements TProtocolFactory
+{
+ private $strictRead_ = false;
+ private $strictWrite_ = false;
+
+ public function __construct($strictRead = false, $strictWrite = false)
+ {
+ $this->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
new file mode 100644
index 000000000..11fb8ff33
--- /dev/null
+++ b/vendor/packaged/thrift/src/Factory/TCompactProtocolFactory.php
@@ -0,0 +1,40 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Factory;
+
+use Thrift\Protocol\TCompactProtocol;
+
+/**
+ * Compact Protocol Factory
+ */
+class TCompactProtocolFactory implements TProtocolFactory
+{
+ public function __construct()
+ {
+ }
+
+ public function getProtocol($trans)
+ {
+ return new TCompactProtocol($trans);
+ }
+}
diff --git a/vendor/packaged/thrift/src/Factory/TJSONProtocolFactory.php b/vendor/packaged/thrift/src/Factory/TJSONProtocolFactory.php
new file mode 100644
index 000000000..fbfb1d731
--- /dev/null
+++ b/vendor/packaged/thrift/src/Factory/TJSONProtocolFactory.php
@@ -0,0 +1,40 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Factory;
+
+use Thrift\Protocol\TJSONProtocol;
+
+/**
+ * JSON Protocol Factory
+ */
+class TJSONProtocolFactory implements TProtocolFactory
+{
+ public function __construct()
+ {
+ }
+
+ public function getProtocol($trans)
+ {
+ return new TJSONProtocol($trans);
+ }
+}
diff --git a/vendor/packaged/thrift/src/Factory/TProtocolFactory.php b/vendor/packaged/thrift/src/Factory/TProtocolFactory.php
new file mode 100644
index 000000000..d3066c8ec
--- /dev/null
+++ b/vendor/packaged/thrift/src/Factory/TProtocolFactory.php
@@ -0,0 +1,36 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Factory;
+
+/**
+ * Protocol factory creates protocol objects from transports
+ */
+interface TProtocolFactory
+{
+ /**
+ * Build a protocol from the base transport
+ *
+ * @return Thrift\Protocol\TProtocol protocol
+ */
+ public function getProtocol($trans);
+}
diff --git a/vendor/packaged/thrift/src/Factory/TStringFuncFactory.php b/vendor/packaged/thrift/src/Factory/TStringFuncFactory.php
new file mode 100644
index 000000000..30de4d780
--- /dev/null
+++ b/vendor/packaged/thrift/src/Factory/TStringFuncFactory.php
@@ -0,0 +1,66 @@
+<?php
+/*
+ * 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.
+ *
+ */
+
+namespace Thrift\Factory;
+
+use Thrift\StringFunc\Core;
+use Thrift\StringFunc\Mbstring;
+use Thrift\StringFunc\TStringFunc;
+
+class TStringFuncFactory
+{
+ private static $_instance;
+
+ /**
+ * Get the Singleton instance of TStringFunc implementation that is
+ * compatible with the current system's mbstring.func_overload settings.
+ *
+ * @return TStringFunc
+ */
+ public static function create()
+ {
+ if (!self::$_instance) {
+ self::_setInstance();
+ }
+
+ return self::$_instance;
+ }
+
+ private static function _setInstance()
+ {
+ /**
+ * Cannot use str* functions for byte counting because multibyte
+ * characters will be read a single bytes.
+ *
+ * See: http://php.net/manual/en/mbstring.overload.php
+ */
+ if (ini_get('mbstring.func_overload') & 2) {
+ self::$_instance = new Mbstring();
+ } else {
+ /**
+ * mbstring is not installed or does not have function overloading
+ * of the str* functions enabled so use PHP core str* functions for
+ * byte counting.
+ */
+ self::$_instance = new Core();
+ }
+ }
+}
diff --git a/vendor/packaged/thrift/src/Factory/TTransportFactory.php b/vendor/packaged/thrift/src/Factory/TTransportFactory.php
new file mode 100644
index 000000000..43f2eecde
--- /dev/null
+++ b/vendor/packaged/thrift/src/Factory/TTransportFactory.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace Thrift\Factory;
+
+use Thrift\Transport\TTransport;
+
+class TTransportFactory
+{
+ /**
+ * @static
+ * @param TTransport $transport
+ * @return TTransport
+ */
+ public static function getTransport(TTransport $transport)
+ {
+ return $transport;
+ }
+}
diff --git a/vendor/packaged/thrift/src/Protocol/JSON/BaseContext.php b/vendor/packaged/thrift/src/Protocol/JSON/BaseContext.php
new file mode 100644
index 000000000..31bcb48e4
--- /dev/null
+++ b/vendor/packaged/thrift/src/Protocol/JSON/BaseContext.php
@@ -0,0 +1,39 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Protocol\JSON;
+
+class BaseContext
+{
+ public function escapeNum()
+ {
+ return false;
+ }
+
+ public function write()
+ {
+ }
+
+ public function read()
+ {
+ }
+}
diff --git a/vendor/packaged/thrift/src/Protocol/JSON/ListContext.php b/vendor/packaged/thrift/src/Protocol/JSON/ListContext.php
new file mode 100644
index 000000000..eef659442
--- /dev/null
+++ b/vendor/packaged/thrift/src/Protocol/JSON/ListContext.php
@@ -0,0 +1,54 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Protocol\JSON;
+
+use Thrift\Protocol\TJSONProtocol;
+
+class ListContext extends BaseContext
+{
+ private $first_ = true;
+ private $p_;
+
+ public function __construct($p)
+ {
+ $this->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
new file mode 100644
index 000000000..0b18c40d0
--- /dev/null
+++ b/vendor/packaged/thrift/src/Protocol/JSON/LookaheadReader.php
@@ -0,0 +1,57 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Protocol\JSON;
+
+class LookaheadReader
+{
+ private $hasData_ = false;
+ private $data_ = array();
+ private $p_;
+
+ public function __construct($p)
+ {
+ $this->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
new file mode 100644
index 000000000..7b353c4ad
--- /dev/null
+++ b/vendor/packaged/thrift/src/Protocol/JSON/PairContext.php
@@ -0,0 +1,64 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Protocol\JSON;
+
+use Thrift\Protocol\TJSONProtocol;
+
+class PairContext extends BaseContext
+{
+ private $first_ = true;
+ private $colon_ = true;
+ private $p_ = null;
+
+ public function __construct($p)
+ {
+ $this->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
new file mode 100644
index 000000000..522b85a5b
--- /dev/null
+++ b/vendor/packaged/thrift/src/Protocol/SimpleJSON/CollectionMapKeyException.php
@@ -0,0 +1,33 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Protocol\SimpleJSON;
+
+use Thrift\Exception\TException;
+
+class CollectionMapKeyException extends TException
+{
+ public function __construct($message)
+ {
+ parent::__construct($message);
+ }
+}
diff --git a/vendor/packaged/thrift/src/Protocol/SimpleJSON/Context.php b/vendor/packaged/thrift/src/Protocol/SimpleJSON/Context.php
new file mode 100644
index 000000000..dbd16faa2
--- /dev/null
+++ b/vendor/packaged/thrift/src/Protocol/SimpleJSON/Context.php
@@ -0,0 +1,35 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Protocol\SimpleJSON;
+
+class Context
+{
+ public function write()
+ {
+ }
+
+ public function isMapKey()
+ {
+ return false;
+ }
+}
diff --git a/vendor/packaged/thrift/src/Protocol/SimpleJSON/ListContext.php b/vendor/packaged/thrift/src/Protocol/SimpleJSON/ListContext.php
new file mode 100644
index 000000000..6f346d8f8
--- /dev/null
+++ b/vendor/packaged/thrift/src/Protocol/SimpleJSON/ListContext.php
@@ -0,0 +1,45 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Protocol\SimpleJSON;
+
+use Thrift\Protocol\TSimpleJSONProtocol;
+
+class ListContext extends Context
+{
+ protected $first_ = true;
+ private $p_;
+
+ public function __construct($p)
+ {
+ $this->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
new file mode 100644
index 000000000..61c060d09
--- /dev/null
+++ b/vendor/packaged/thrift/src/Protocol/SimpleJSON/MapContext.php
@@ -0,0 +1,47 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Protocol\SimpleJSON;
+
+class MapContext extends StructContext
+{
+ protected $isKey = true;
+ private $p_;
+
+ public function __construct($p)
+ {
+ parent::__construct($p);
+ }
+
+ public function write()
+ {
+ parent::write();
+ $this->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
new file mode 100644
index 000000000..38a62d1a2
--- /dev/null
+++ b/vendor/packaged/thrift/src/Protocol/SimpleJSON/StructContext.php
@@ -0,0 +1,52 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Protocol\SimpleJSON;
+
+use Thrift\Protocol\TSimpleJSONProtocol;
+
+class StructContext extends Context
+{
+ protected $first_ = true;
+ protected $colon_ = true;
+ private $p_;
+
+ public function __construct($p)
+ {
+ $this->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
new file mode 100644
index 000000000..cda5c0d4c
--- /dev/null
+++ b/vendor/packaged/thrift/src/Protocol/TBinaryProtocol.php
@@ -0,0 +1,453 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Protocol;
+
+use Thrift\Type\TType;
+use Thrift\Exception\TProtocolException;
+use Thrift\Factory\TStringFuncFactory;
+
+/**
+ * Binary implementation of the Thrift protocol.
+ *
+ */
+class TBinaryProtocol extends TProtocol
+{
+ const VERSION_MASK = 0xffff0000;
+ const VERSION_1 = 0x80010000;
+
+ protected $strictRead_ = false;
+ protected $strictWrite_ = true;
+
+ public function __construct($trans, $strictRead = false, $strictWrite = true)
+ {
+ parent::__construct($trans);
+ $this->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
new file mode 100644
index 000000000..ff799a6ab
--- /dev/null
+++ b/vendor/packaged/thrift/src/Protocol/TBinaryProtocolAccelerated.php
@@ -0,0 +1,67 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Protocol;
+
+use Thrift\Transport\TBufferedTransport;
+
+/**
+ * Accelerated binary protocol: used in conjunction with the thrift_protocol
+ * extension for faster deserialization
+ */
+class TBinaryProtocolAccelerated extends TBinaryProtocol
+{
+ public function __construct($trans, $strictRead = false, $strictWrite = true)
+ {
+ // If the transport doesn't implement putBack, wrap it in a
+ // TBufferedTransport (which does)
+
+ // NOTE (t.heintz): This is very evil to do, because the TBufferedTransport may swallow bytes, which
+ // are then never written to the underlying transport. This happens precisely when a number of bytes
+ // less than the max buffer size (512 by default) is written to the transport and then flush() is NOT
+ // called. In that case the data stays in the writeBuffer of the transport, from where it can never be
+ // accessed again (for example through read()).
+ //
+ // Since the caller of this method does not know about the wrapping transport, this creates bugs which
+ // are very difficult to find. Hence the wrapping of a transport in a buffer should be left to the
+ // calling code. An interface could used to mandate the presence of the putBack() method in the transport.
+ //
+ // I am leaving this code in nonetheless, because there may be applications depending on this behavior.
+ //
+ // @see THRIFT-1579
+
+ if (!method_exists($trans, 'putBack')) {
+ $trans = new TBufferedTransport($trans);
+ }
+ parent::__construct($trans, $strictRead, $strictWrite);
+ }
+
+ public function isStrictRead()
+ {
+ return $this->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
new file mode 100644
index 000000000..1af2a274a
--- /dev/null
+++ b/vendor/packaged/thrift/src/Protocol/TCompactProtocol.php
@@ -0,0 +1,739 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Protocol;
+
+use Thrift\Type\TType;
+use Thrift\Exception\TProtocolException;
+use Thrift\Factory\TStringFuncFactory;
+
+/**
+ * Compact implementation of the Thrift protocol.
+ *
+ */
+class TCompactProtocol extends TProtocol
+{
+ const COMPACT_STOP = 0x00;
+ const COMPACT_TRUE = 0x01;
+ const COMPACT_FALSE = 0x02;
+ const COMPACT_BYTE = 0x03;
+ const COMPACT_I16 = 0x04;
+ const COMPACT_I32 = 0x05;
+ const COMPACT_I64 = 0x06;
+ const COMPACT_DOUBLE = 0x07;
+ const COMPACT_BINARY = 0x08;
+ const COMPACT_LIST = 0x09;
+ const COMPACT_SET = 0x0A;
+ const COMPACT_MAP = 0x0B;
+ const COMPACT_STRUCT = 0x0C;
+
+ const STATE_CLEAR = 0;
+ const STATE_FIELD_WRITE = 1;
+ const STATE_VALUE_WRITE = 2;
+ const STATE_CONTAINER_WRITE = 3;
+ const STATE_BOOL_WRITE = 4;
+ const STATE_FIELD_READ = 5;
+ const STATE_CONTAINER_READ = 6;
+ const STATE_VALUE_READ = 7;
+ const STATE_BOOL_READ = 8;
+
+ const VERSION_MASK = 0x1f;
+ const VERSION = 1;
+ const PROTOCOL_ID = 0x82;
+ const TYPE_MASK = 0xe0;
+ const TYPE_BITS = 0x07;
+ const TYPE_SHIFT_AMOUNT = 5;
+
+ protected static $ctypes = array(
+ TType::STOP => 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
new file mode 100644
index 000000000..914488421
--- /dev/null
+++ b/vendor/packaged/thrift/src/Protocol/TJSONProtocol.php
@@ -0,0 +1,815 @@
+<?php
+
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Protocol;
+
+use Thrift\Type\TType;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\JSON\BaseContext;
+use Thrift\Protocol\JSON\LookaheadReader;
+use Thrift\Protocol\JSON\PairContext;
+use Thrift\Protocol\JSON\ListContext;
+
+/**
+ * JSON implementation of thrift protocol, ported from Java.
+ */
+class TJSONProtocol extends TProtocol
+{
+ const COMMA = ',';
+ const COLON = ':';
+ const LBRACE = '{';
+ const RBRACE = '}';
+ const LBRACKET = '[';
+ const RBRACKET = ']';
+ const QUOTE = '"';
+ const BACKSLASH = '\\';
+ const ZERO = '0';
+ const ESCSEQ = '\\';
+ const DOUBLEESC = '__DOUBLE_ESCAPE_SEQUENCE__';
+
+ const VERSION = 1;
+
+ public static $JSON_CHAR_TABLE = array(
+ /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 'b', 't', 'n', 0, 'f', 'r', 0, 0, // 0
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1
+ 1, 1, '"', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2
+ );
+
+ public static $ESCAPE_CHARS = array('"', '\\', '/', "b", "f", "n", "r", "t");
+
+ public static $ESCAPE_CHAR_VALS = array(
+ '"', '\\', '/', "\x08", "\f", "\n", "\r", "\t",
+ );
+
+ const NAME_BOOL = "tf";
+ const NAME_BYTE = "i8";
+ const NAME_I16 = "i16";
+ const NAME_I32 = "i32";
+ const NAME_I64 = "i64";
+ const NAME_DOUBLE = "dbl";
+ const NAME_STRUCT = "rec";
+ const NAME_STRING = "str";
+ const NAME_MAP = "map";
+ const NAME_LIST = "lst";
+ const NAME_SET = "set";
+
+ private function getTypeNameForTypeID($typeID)
+ {
+ switch ($typeID) {
+ case TType::BOOL:
+ return self::NAME_BOOL;
+ case TType::BYTE:
+ return self::NAME_BYTE;
+ case TType::I16:
+ return self::NAME_I16;
+ case TType::I32:
+ return self::NAME_I32;
+ case TType::I64:
+ return self::NAME_I64;
+ case TType::DOUBLE:
+ return self::NAME_DOUBLE;
+ case TType::STRING:
+ return self::NAME_STRING;
+ case TType::STRUCT:
+ return self::NAME_STRUCT;
+ case TType::MAP:
+ return self::NAME_MAP;
+ case TType::SET:
+ return self::NAME_SET;
+ case TType::LST:
+ return self::NAME_LIST;
+ default:
+ throw new TProtocolException("Unrecognized type", TProtocolException::UNKNOWN);
+ }
+ }
+
+ private function getTypeIDForTypeName($name)
+ {
+ $result = TType::STOP;
+
+ if (strlen($name) > 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
new file mode 100644
index 000000000..d579c099d
--- /dev/null
+++ b/vendor/packaged/thrift/src/Protocol/TMultiplexedProtocol.php
@@ -0,0 +1,85 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Protocol;
+
+use Thrift\Type\TMessageType;
+
+/**
+ * <code>TMultiplexedProtocol</code> 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 <code>TMultiplexedProtocol</code> class.
+ *
+ * Wrap the specified protocol, allowing it to be used to communicate with a
+ * multiplexing server. The <code>$serviceName</code> 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 <code>TMultiplexedProtocol::SEPARATOR</code>.
+ *
+ * @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
new file mode 100644
index 000000000..f7b581f7b
--- /dev/null
+++ b/vendor/packaged/thrift/src/Protocol/TProtocol.php
@@ -0,0 +1,352 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Protocol;
+
+use Thrift\Exception\TException;
+use Thrift\Transport\TTransport;
+use Thrift\Type\TType;
+use Thrift\Exception\TProtocolException;
+
+/**
+ * Protocol base class module.
+ */
+abstract class TProtocol
+{
+ /**
+ * Underlying transport
+ *
+ * @var TTransport
+ */
+ protected $trans_;
+
+ /**
+ * @param TTransport $trans
+ */
+ protected function __construct($trans)
+ {
+ $this->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
new file mode 100644
index 000000000..a85e0b8e5
--- /dev/null
+++ b/vendor/packaged/thrift/src/Protocol/TProtocolDecorator.php
@@ -0,0 +1,285 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Protocol;
+
+use Thrift\Exception\TException;
+
+/**
+ * <code>TProtocolDecorator</code> forwards all requests to an enclosed
+ * <code>TProtocol</code> 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 <code>TProtocol</code>.
+ *
+ * @package Thrift\Protocol
+ */
+abstract class TProtocolDecorator extends TProtocol
+{
+ /**
+ * Instance of protocol, to which all operations will be forwarded.
+ *
+ * @var TProtocol
+ */
+ private $concreteProtocol_;
+
+ /**
+ * Constructor of <code>TProtocolDecorator</code> 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
new file mode 100644
index 000000000..1cf1f6407
--- /dev/null
+++ b/vendor/packaged/thrift/src/Protocol/TSimpleJSONProtocol.php
@@ -0,0 +1,374 @@
+<?php
+
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ */
+
+namespace Thrift\Protocol;
+
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\SimpleJSON\Context;
+use Thrift\Protocol\SimpleJSON\ListContext;
+use Thrift\Protocol\SimpleJSON\StructContext;
+use Thrift\Protocol\SimpleJSON\MapContext;
+use Thrift\Protocol\SimpleJSON\CollectionMapKeyException;
+
+/**
+ * SimpleJSON implementation of thrift protocol, ported from Java.
+ */
+class TSimpleJSONProtocol extends TProtocol
+{
+ const COMMA = ',';
+ const COLON = ':';
+ const LBRACE = '{';
+ const RBRACE = '}';
+ const LBRACKET = '[';
+ const RBRACKET = ']';
+ const QUOTE = '"';
+
+ const NAME_MAP = "map";
+ const NAME_LIST = "lst";
+ const NAME_SET = "set";
+
+ protected $writeContext_ = null;
+ protected $writeContextStack_ = [];
+
+ /**
+ * Push a new write context onto the stack.
+ */
+ protected function pushWriteContext(Context $c)
+ {
+ $this->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
new file mode 100644
index 000000000..9d2b14730
--- /dev/null
+++ b/vendor/packaged/thrift/src/Serializer/TBinarySerializer.php
@@ -0,0 +1,87 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.protocol
+ * @author: rmarin ([email protected])
+ */
+
+namespace Thrift\Serializer;
+
+use Thrift\Transport\TMemoryBuffer;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Type\TMessageType;
+
+/**
+ * Utility class for serializing and deserializing
+ * a thrift object using TBinaryProtocolAccelerated.
+ */
+class TBinarySerializer
+{
+ // NOTE(rmarin): Because thrift_protocol_write_binary
+ // adds a begin message prefix, you cannot specify
+ // a transport in which to serialize an object. It has to
+ // be a string. Otherwise we will break the compatibility with
+ // normal deserialization.
+ public static function serialize($object)
+ {
+ $transport = new TMemoryBuffer();
+ $protocol = new TBinaryProtocolAccelerated($transport);
+ if (function_exists('thrift_protocol_write_binary')) {
+ thrift_protocol_write_binary(
+ $protocol,
+ $object->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
new file mode 100644
index 000000000..0bb6e9192
--- /dev/null
+++ b/vendor/packaged/thrift/src/Server/TForkingServer.php
@@ -0,0 +1,125 @@
+<?php
+
+namespace Thrift\Server;
+
+use Thrift\Transport\TTransport;
+use Thrift\Exception\TException;
+use Thrift\Exception\TTransportException;
+
+/**
+ * A forking implementation of a Thrift server.
+ *
+ * @package thrift.server
+ */
+class TForkingServer extends TServer
+{
+ /**
+ * Flag for the main serving loop
+ *
+ * @var bool
+ */
+ private $stop_ = false;
+
+ /**
+ * List of children.
+ *
+ * @var array
+ */
+ protected $children_ = array();
+
+ /**
+ * Listens for new client using the supplied
+ * transport. We fork when a new connection
+ * arrives.
+ *
+ * @return void
+ */
+ public function serve()
+ {
+ $this->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
new file mode 100644
index 000000000..ac589b76b
--- /dev/null
+++ b/vendor/packaged/thrift/src/Server/TSSLServerSocket.php
@@ -0,0 +1,97 @@
+<?php
+/*
+ * 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.
+ *
+ */
+
+namespace Thrift\Server;
+
+use Thrift\Transport\TSSLSocket;
+
+/**
+ * Socket implementation of a server agent.
+ *
+ * @package thrift.transport
+ */
+class TSSLServerSocket extends TServerSocket
+{
+ /**
+ * Remote port
+ *
+ * @var resource
+ */
+ protected $context_ = null;
+
+ /**
+ * ServerSocket constructor
+ *
+ * @param string $host Host to listen on
+ * @param int $port Port to listen on
+ * @param resource $context Stream context
+ * @return void
+ */
+ public function __construct($host = 'localhost', $port = 9090, $context = null)
+ {
+ $ssl_host = $this->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
new file mode 100644
index 000000000..268c37820
--- /dev/null
+++ b/vendor/packaged/thrift/src/Server/TServer.php
@@ -0,0 +1,102 @@
+<?php
+
+namespace Thrift\Server;
+
+use Thrift\Factory\TTransportFactory;
+use Thrift\Factory\TProtocolFactory;
+
+/**
+ * Generic class for a Thrift server.
+ *
+ * @package thrift.server
+ */
+abstract class TServer
+{
+ /**
+ * Processor to handle new clients
+ *
+ * @var TProcessor
+ */
+ protected $processor_;
+
+ /**
+ * Server transport to be used for listening
+ * and accepting new clients
+ *
+ * @var TServerTransport
+ */
+ protected $transport_;
+
+ /**
+ * Input transport factory
+ *
+ * @var TTransportFactory
+ */
+ protected $inputTransportFactory_;
+
+ /**
+ * Output transport factory
+ *
+ * @var TTransportFactory
+ */
+ protected $outputTransportFactory_;
+
+ /**
+ * Input protocol factory
+ *
+ * @var TProtocolFactory
+ */
+ protected $inputProtocolFactory_;
+
+ /**
+ * Output protocol factory
+ *
+ * @var TProtocolFactory
+ */
+ protected $outputProtocolFactory_;
+
+ /**
+ * Sets up all the factories, etc
+ *
+ * @param object $processor
+ * @param TServerTransport $transport
+ * @param TTransportFactory $inputTransportFactory
+ * @param TTransportFactory $outputTransportFactory
+ * @param TProtocolFactory $inputProtocolFactory
+ * @param TProtocolFactory $outputProtocolFactory
+ * @return void
+ */
+ public function __construct(
+ $processor,
+ TServerTransport $transport,
+ TTransportFactory $inputTransportFactory,
+ TTransportFactory $outputTransportFactory,
+ TProtocolFactory $inputProtocolFactory,
+ TProtocolFactory $outputProtocolFactory
+ ) {
+ $this->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
new file mode 100644
index 000000000..8f38fb23f
--- /dev/null
+++ b/vendor/packaged/thrift/src/Server/TServerSocket.php
@@ -0,0 +1,124 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.transport
+ */
+
+namespace Thrift\Server;
+
+use Thrift\Transport\TSocket;
+
+/**
+ * Socket implementation of a server agent.
+ *
+ * @package thrift.transport
+ */
+class TServerSocket extends TServerTransport
+{
+ /**
+ * Handle for the listener socket
+ *
+ * @var resource
+ */
+ protected $listener_;
+
+ /**
+ * Port for the listener to listen on
+ *
+ * @var int
+ */
+ protected $port_;
+
+ /**
+ * Timeout when listening for a new client
+ *
+ * @var int
+ */
+ protected $acceptTimeout_ = 30000;
+
+ /**
+ * Host to listen on
+ *
+ * @var string
+ */
+ protected $host_;
+
+ /**
+ * ServerSocket constructor
+ *
+ * @param string $host Host to listen on
+ * @param int $port Port to listen on
+ * @return void
+ */
+ public function __construct($host = 'localhost', $port = 9090)
+ {
+ $this->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
new file mode 100644
index 000000000..15a27afa8
--- /dev/null
+++ b/vendor/packaged/thrift/src/Server/TServerTransport.php
@@ -0,0 +1,56 @@
+<?php
+
+namespace Thrift\Server;
+
+use Thrift\Exception\TTransportException;
+
+/**
+ * Generic class for Server agent.
+ *
+ * @package thrift.transport
+ */
+abstract class TServerTransport
+{
+ /**
+ * List for new clients
+ *
+ * @abstract
+ * @return void
+ */
+ abstract public function listen();
+
+ /**
+ * Close the server
+ *
+ * @abstract
+ * @return void
+ */
+ abstract public function close();
+
+ /**
+ * Subclasses should use this to implement
+ * accept.
+ *
+ * @abstract
+ * @return TTransport
+ */
+ abstract protected function acceptImpl();
+
+ /**
+ * Uses the accept implemtation. If null is returned, an
+ * exception is thrown.
+ *
+ * @throws TTransportException
+ * @return TTransport
+ */
+ public function accept()
+ {
+ $transport = $this->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
new file mode 100644
index 000000000..4c1dda5a5
--- /dev/null
+++ b/vendor/packaged/thrift/src/Server/TSimpleServer.php
@@ -0,0 +1,60 @@
+<?php
+
+namespace Thrift\Server;
+
+use Thrift\Exception\TTransportException;
+
+/**
+ * Simple implemtation of a Thrift server.
+ *
+ * @package thrift.server
+ */
+class TSimpleServer extends TServer
+{
+ /**
+ * Flag for the main serving loop
+ *
+ * @var bool
+ */
+ private $stop_ = false;
+
+ /**
+ * Listens for new client using the supplied
+ * transport. It handles TTransportExceptions
+ * to avoid timeouts etc killing it
+ *
+ * @return void
+ */
+ public function serve()
+ {
+ $this->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
new file mode 100644
index 000000000..c4aaaa9ec
--- /dev/null
+++ b/vendor/packaged/thrift/src/StoredMessageProtocol.php
@@ -0,0 +1,53 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.processor
+ */
+
+namespace Thrift;
+
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TProtocolDecorator;
+
+/**
+ * Our goal was to work with any protocol. In order to do that, we needed
+ * to allow them to call readMessageBegin() and get the Message in exactly
+ * the standard format, without the service name prepended to the Message name.
+ */
+class StoredMessageProtocol extends TProtocolDecorator
+{
+ private $fname_;
+ private $mtype_;
+ private $rseqid_;
+
+ public function __construct(TProtocol $protocol, $fname, $mtype, $rseqid)
+ {
+ parent::__construct($protocol);
+ $this->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
new file mode 100644
index 000000000..39a75b3a2
--- /dev/null
+++ b/vendor/packaged/thrift/src/StringFunc/Core.php
@@ -0,0 +1,40 @@
+<?php
+/*
+ * 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.
+ *
+ */
+
+namespace Thrift\StringFunc;
+
+class Core implements TStringFunc
+{
+ public function substr($str, $start, $length = null)
+ {
+ // specifying a null $length would return an empty string
+ if ($length === null) {
+ return substr($str, $start);
+ }
+
+ return substr($str, $start, $length);
+ }
+
+ public function strlen($str)
+ {
+ return strlen($str);
+ }
+}
diff --git a/vendor/packaged/thrift/src/StringFunc/Mbstring.php b/vendor/packaged/thrift/src/StringFunc/Mbstring.php
new file mode 100644
index 000000000..968ff18f1
--- /dev/null
+++ b/vendor/packaged/thrift/src/StringFunc/Mbstring.php
@@ -0,0 +1,46 @@
+<?php
+/*
+ * 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.
+ *
+ */
+
+namespace Thrift\StringFunc;
+
+class Mbstring implements TStringFunc
+{
+ public function substr($str, $start, $length = null)
+ {
+ /**
+ * We need to set the charset parameter, which is the second
+ * optional parameter and the first optional parameter can't
+ * be null or false as a "magic" value because that would
+ * cause an empty string to be returned, so we need to
+ * actually calculate the proper length value.
+ */
+ if ($length === null) {
+ $length = $this->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
new file mode 100644
index 000000000..dea497f2e
--- /dev/null
+++ b/vendor/packaged/thrift/src/StringFunc/TStringFunc.php
@@ -0,0 +1,28 @@
+<?php
+/*
+ * 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.
+ *
+ */
+
+namespace Thrift\StringFunc;
+
+interface TStringFunc
+{
+ public function substr($str, $start, $length = null);
+ public function strlen($str);
+}
diff --git a/vendor/packaged/thrift/src/TMultiplexedProcessor.php b/vendor/packaged/thrift/src/TMultiplexedProcessor.php
new file mode 100644
index 000000000..a64a9687c
--- /dev/null
+++ b/vendor/packaged/thrift/src/TMultiplexedProcessor.php
@@ -0,0 +1,118 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.processor
+ */
+
+namespace Thrift;
+
+use Thrift\Exception\TException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TMultiplexedProtocol;
+use Thrift\Type\TMessageType;
+
+/**
+ * <code>TMultiplexedProcessor</code> is a Processor allowing
+ * a single <code>TServer</code> to provide multiple services.
+ *
+ * <p>To do so, you instantiate the processor and then register additional
+ * processors with it, as shown in the following example:</p>
+ *
+ * <blockquote><code>
+ * $processor = new TMultiplexedProcessor();
+ *
+ * processor->registerProcessor(
+ * "Calculator",
+ * new \tutorial\CalculatorProcessor(new CalculatorHandler()));
+ *
+ * processor->registerProcessor(
+ * "WeatherReport",
+ * new \tutorial\WeatherReportProcessor(new WeatherReportHandler()));
+ *
+ * $processor->process($protocol, $protocol);
+ * </code></blockquote>
+ */
+
+class TMultiplexedProcessor
+{
+ private $serviceProcessorMap_;
+
+ /**
+ * 'Register' a service with this <code>TMultiplexedProcessor</code>. 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 <code>process</code> performs the following steps:
+ *
+ * <ol>
+ * <li>Read the beginning of the message.</li>
+ * <li>Extract the service name from the message.</li>
+ * <li>Using the service name to locate the appropriate processor.</li>
+ * <li>Dispatch to the processor, with a decorated instance of TProtocol
+ * that allows readMessageBegin() to return the original Message.</li>
+ * </ol>
+ *
+ * @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
new file mode 100644
index 000000000..253c5acfb
--- /dev/null
+++ b/vendor/packaged/thrift/src/Transport/TBufferedTransport.php
@@ -0,0 +1,206 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.transport
+ */
+
+namespace Thrift\Transport;
+
+use Thrift\Exception\TTransportException;
+use Thrift\Factory\TStringFuncFactory;
+
+/**
+ * Buffered transport. Stores data to an internal buffer that it doesn't
+ * actually write out until flush is called. For reading, we do a greedy
+ * read and then serve data out of the internal buffer.
+ *
+ * @package thrift.transport
+ */
+class TBufferedTransport extends TTransport
+{
+ /**
+ * The underlying transport
+ *
+ * @var TTransport
+ */
+ protected $transport_;
+
+ /**
+ * The receive buffer size
+ *
+ * @var int
+ */
+ protected $rBufSize_ = 512;
+
+ /**
+ * The write buffer size
+ *
+ * @var int
+ */
+ protected $wBufSize_ = 512;
+
+ /**
+ * The write buffer.
+ *
+ * @var string
+ */
+ protected $wBuf_ = '';
+
+ /**
+ * The read buffer.
+ *
+ * @var string
+ */
+ protected $rBuf_ = '';
+
+ /**
+ * Constructor. Creates a buffered transport around an underlying transport
+ */
+ public function __construct($transport, $rBufSize = 512, $wBufSize = 512)
+ {
+ $this->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
new file mode 100644
index 000000000..f781da969
--- /dev/null
+++ b/vendor/packaged/thrift/src/Transport/TCurlClient.php
@@ -0,0 +1,281 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.transport
+ */
+
+namespace Thrift\Transport;
+
+use Thrift\Exception\TTransportException;
+use Thrift\Factory\TStringFuncFactory;
+
+/**
+ * HTTP client for Thrift
+ *
+ * @package thrift.transport
+ */
+class TCurlClient extends TTransport
+{
+ private static $curlHandle;
+
+ /**
+ * The host to connect to
+ *
+ * @var string
+ */
+ protected $host_;
+
+ /**
+ * The port to connect on
+ *
+ * @var int
+ */
+ protected $port_;
+
+ /**
+ * The URI to request
+ *
+ * @var string
+ */
+ protected $uri_;
+
+ /**
+ * The scheme to use for the request, i.e. http, https
+ *
+ * @var string
+ */
+ protected $scheme_;
+
+ /**
+ * Buffer for the HTTP request data
+ *
+ * @var string
+ */
+ protected $request_;
+
+ /**
+ * Buffer for the HTTP response data.
+ *
+ * @var binary string
+ */
+ protected $response_;
+
+ /**
+ * Read timeout
+ *
+ * @var float
+ */
+ protected $timeout_;
+
+ /**
+ * http headers
+ *
+ * @var array
+ */
+ protected $headers_;
+
+ /**
+ * Make a new HTTP client.
+ *
+ * @param string $host
+ * @param int $port
+ * @param string $uri
+ */
+ public function __construct($host, $port = 80, $uri = '', $scheme = 'http')
+ {
+ if ((TStringFuncFactory::create()->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
new file mode 100644
index 000000000..39d186987
--- /dev/null
+++ b/vendor/packaged/thrift/src/Transport/TFramedTransport.php
@@ -0,0 +1,192 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.transport
+ */
+
+namespace Thrift\Transport;
+
+use Thrift\Factory\TStringFuncFactory;
+
+/**
+ * Framed transport. Writes and reads data in chunks that are stamped with
+ * their length.
+ *
+ * @package thrift.transport
+ */
+class TFramedTransport extends TTransport
+{
+ /**
+ * Underlying transport object.
+ *
+ * @var TTransport
+ */
+ private $transport_;
+
+ /**
+ * Buffer for read data.
+ *
+ * @var string
+ */
+ private $rBuf_;
+
+ /**
+ * Buffer for queued output data
+ *
+ * @var string
+ */
+ private $wBuf_;
+
+ /**
+ * Whether to frame reads
+ *
+ * @var bool
+ */
+ private $read_;
+
+ /**
+ * Whether to frame writes
+ *
+ * @var bool
+ */
+ private $write_;
+
+ /**
+ * Constructor.
+ *
+ * @param TTransport $transport Underlying transport
+ */
+ public function __construct($transport = null, $read = true, $write = true)
+ {
+ $this->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
new file mode 100644
index 000000000..4d6be32fe
--- /dev/null
+++ b/vendor/packaged/thrift/src/Transport/THttpClient.php
@@ -0,0 +1,258 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.transport
+ */
+
+namespace Thrift\Transport;
+
+use Thrift\Exception\TTransportException;
+use Thrift\Factory\TStringFuncFactory;
+
+/**
+ * HTTP client for Thrift
+ *
+ * @package thrift.transport
+ */
+class THttpClient extends TTransport
+{
+ /**
+ * The host to connect to
+ *
+ * @var string
+ */
+ protected $host_;
+
+ /**
+ * The port to connect on
+ *
+ * @var int
+ */
+ protected $port_;
+
+ /**
+ * The URI to request
+ *
+ * @var string
+ */
+ protected $uri_;
+
+ /**
+ * The scheme to use for the request, i.e. http, https
+ *
+ * @var string
+ */
+ protected $scheme_;
+
+ /**
+ * Buffer for the HTTP request data
+ *
+ * @var string
+ */
+ protected $buf_;
+
+ /**
+ * Input socket stream.
+ *
+ * @var resource
+ */
+ protected $handle_;
+
+ /**
+ * Read timeout
+ *
+ * @var float
+ */
+ protected $timeout_;
+
+ /**
+ * http headers
+ *
+ * @var array
+ */
+ protected $headers_;
+
+ /**
+ * Context additional options
+ *
+ * @var array
+ */
+ protected $context_;
+
+ /**
+ * Make a new HTTP client.
+ *
+ * @param string $host
+ * @param int $port
+ * @param string $uri
+ * @param string $scheme
+ * @param array $context
+ */
+ public function __construct($host, $port = 80, $uri = '', $scheme = 'http', array $context = array())
+ {
+ if ((TStringFuncFactory::create()->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
new file mode 100644
index 000000000..fee03a2a4
--- /dev/null
+++ b/vendor/packaged/thrift/src/Transport/TMemoryBuffer.php
@@ -0,0 +1,106 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.transport
+ */
+
+namespace Thrift\Transport;
+
+use Thrift\Exception\TTransportException;
+use Thrift\Factory\TStringFuncFactory;
+
+/**
+ * A memory buffer is a tranpsort that simply reads from and writes to an
+ * in-memory string buffer. Anytime you call write on it, the data is simply
+ * placed into a buffer, and anytime you call read, data is read from that
+ * buffer.
+ *
+ * @package thrift.transport
+ */
+class TMemoryBuffer extends TTransport
+{
+ /**
+ * Constructor. Optionally pass an initial value
+ * for the buffer.
+ */
+ public function __construct($buf = '')
+ {
+ $this->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
new file mode 100644
index 000000000..7e086b67c
--- /dev/null
+++ b/vendor/packaged/thrift/src/Transport/TNullTransport.php
@@ -0,0 +1,56 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.transport
+ */
+
+namespace Thrift\Transport;
+
+use Thrift\Exception\TTransportException;
+
+/**
+ * Transport that only accepts writes and ignores them.
+ * This is useful for measuring the serialized size of structures.
+ *
+ * @package thrift.transport
+ */
+class TNullTransport extends TTransport
+{
+ public function isOpen()
+ {
+ return true;
+ }
+
+ public function open()
+ {
+ }
+
+ public function close()
+ {
+ }
+
+ public function read($len)
+ {
+ throw new TTransportException("Can't read from TNullTransport.");
+ }
+
+ public function write($buf)
+ {
+ }
+}
diff --git a/vendor/packaged/thrift/src/Transport/TPhpStream.php b/vendor/packaged/thrift/src/Transport/TPhpStream.php
new file mode 100644
index 000000000..42823ff33
--- /dev/null
+++ b/vendor/packaged/thrift/src/Transport/TPhpStream.php
@@ -0,0 +1,124 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.transport
+ */
+
+namespace Thrift\Transport;
+
+use Thrift\Exception\TException;
+use Thrift\Factory\TStringFuncFactory;
+
+/**
+ * Php stream transport. Reads to and writes from the php standard streams
+ * php://input and php://output
+ *
+ * @package thrift.transport
+ */
+class TPhpStream extends TTransport
+{
+ const MODE_R = 1;
+ const MODE_W = 2;
+
+ private $inStream_ = null;
+
+ private $outStream_ = null;
+
+ private $read_ = false;
+
+ private $write_ = false;
+
+ public function __construct($mode)
+ {
+ $this->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
new file mode 100644
index 000000000..b4a0adb54
--- /dev/null
+++ b/vendor/packaged/thrift/src/Transport/TSSLSocket.php
@@ -0,0 +1,117 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.transport
+ */
+
+namespace Thrift\Transport;
+
+use Thrift\Exception\TException;
+use Thrift\Exception\TTransportException;
+use Thrift\Factory\TStringFuncFactory;
+
+/**
+ * Sockets implementation of the TTransport interface.
+ *
+ * @package thrift.transport
+ */
+class TSSLSocket extends TSocket
+{
+ /**
+ * Remote port
+ *
+ * @var resource
+ */
+ protected $context_ = null;
+
+ /**
+ * Socket constructor
+ *
+ * @param string $host Remote hostname
+ * @param int $port Remote port
+ * @param resource $context Stream context
+ * @param bool $persist Whether to use a persistent socket
+ * @param string $debugHandler Function to call for error logging
+ */
+ public function __construct(
+ $host = 'localhost',
+ $port = 9090,
+ $context = null,
+ $debugHandler = null
+ ) {
+ $this->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
new file mode 100644
index 000000000..5147efa63
--- /dev/null
+++ b/vendor/packaged/thrift/src/Transport/TSocket.php
@@ -0,0 +1,366 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.transport
+ */
+
+namespace Thrift\Transport;
+
+use Thrift\Exception\TException;
+use Thrift\Exception\TTransportException;
+use Thrift\Factory\TStringFuncFactory;
+
+/**
+ * Sockets implementation of the TTransport interface.
+ *
+ * @package thrift.transport
+ */
+class TSocket extends TTransport
+{
+ /**
+ * Handle to PHP socket
+ *
+ * @var resource
+ */
+ protected $handle_ = null;
+
+ /**
+ * Remote hostname
+ *
+ * @var string
+ */
+ protected $host_ = 'localhost';
+
+ /**
+ * Remote port
+ *
+ * @var int
+ */
+ protected $port_ = '9090';
+
+ /**
+ * Send timeout in seconds.
+ *
+ * Combined with sendTimeoutUsec this is used for send timeouts.
+ *
+ * @var int
+ */
+ protected $sendTimeoutSec_ = 0;
+
+ /**
+ * Send timeout in microseconds.
+ *
+ * Combined with sendTimeoutSec this is used for send timeouts.
+ *
+ * @var int
+ */
+ protected $sendTimeoutUsec_ = 100000;
+
+ /**
+ * Recv timeout in seconds
+ *
+ * Combined with recvTimeoutUsec this is used for recv timeouts.
+ *
+ * @var int
+ */
+ protected $recvTimeoutSec_ = 0;
+
+ /**
+ * Recv timeout in microseconds
+ *
+ * Combined with recvTimeoutSec this is used for recv timeouts.
+ *
+ * @var int
+ */
+ protected $recvTimeoutUsec_ = 750000;
+
+ /**
+ * Persistent socket or plain?
+ *
+ * @var bool
+ */
+ protected $persist_ = false;
+
+ /**
+ * Debugging on?
+ *
+ * @var bool
+ */
+ protected $debug_ = false;
+
+ /**
+ * Debug handler
+ *
+ * @var mixed
+ */
+ protected $debugHandler_ = null;
+
+ /**
+ * Socket constructor
+ *
+ * @param string $host Remote hostname
+ * @param int $port Remote port
+ * @param bool $persist Whether to use a persistent socket
+ * @param string $debugHandler Function to call for error logging
+ */
+ public function __construct(
+ $host = 'localhost',
+ $port = 9090,
+ $persist = false,
+ $debugHandler = null
+ ) {
+ $this->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
new file mode 100644
index 000000000..cb9e8ddfa
--- /dev/null
+++ b/vendor/packaged/thrift/src/Transport/TSocketPool.php
@@ -0,0 +1,310 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.transport
+ */
+
+namespace Thrift\Transport;
+
+use Thrift\Exception\TException;
+
+/**
+ * This library makes use of APC cache to make hosts as down in a web
+ * environment. If you are running from the CLI or on a system without APC
+ * installed, then these null functions will step in and act like cache
+ * misses.
+ */
+if (!function_exists('apc_fetch')) {
+ function apc_fetch($key)
+ {
+ return false;
+ }
+
+ function apc_store($key, $var, $ttl = 0)
+ {
+ return false;
+ }
+}
+
+/**
+ * Sockets implementation of the TTransport interface that allows connection
+ * to a pool of servers.
+ *
+ * @package thrift.transport
+ */
+class TSocketPool extends TSocket
+{
+ /**
+ * Remote servers. Array of associative arrays with 'host' and 'port' keys
+ */
+ private $servers_ = array();
+
+ /**
+ * How many times to retry each host in connect
+ *
+ * @var int
+ */
+ private $numRetries_ = 1;
+
+ /**
+ * Retry interval in seconds, how long to not try a host if it has been
+ * marked as down.
+ *
+ * @var int
+ */
+ private $retryInterval_ = 60;
+
+ /**
+ * Max consecutive failures before marking a host down.
+ *
+ * @var int
+ */
+ private $maxConsecutiveFailures_ = 1;
+
+ /**
+ * Try hosts in order? or Randomized?
+ *
+ * @var bool
+ */
+ private $randomize_ = true;
+
+ /**
+ * Always try last host, even if marked down?
+ *
+ * @var bool
+ */
+ private $alwaysTryLast_ = true;
+
+ /**
+ * Socket pool constructor
+ *
+ * @param array $hosts List of remote hostnames
+ * @param mixed $ports Array of remote ports, or a single common port
+ * @param bool $persist Whether to use a persistent socket
+ * @param mixed $debugHandler Function for error logging
+ */
+ public function __construct(
+ $hosts = array('localhost'),
+ $ports = array(9090),
+ $persist = false,
+ $debugHandler = null
+ ) {
+ parent::__construct(null, 0, $persist, $debugHandler);
+
+ if (!is_array($ports)) {
+ $port = $ports;
+ $ports = array();
+ foreach ($hosts as $key => $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
new file mode 100644
index 000000000..35921c666
--- /dev/null
+++ b/vendor/packaged/thrift/src/Transport/TTransport.php
@@ -0,0 +1,98 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift.transport
+ */
+
+namespace Thrift\Transport;
+
+use Thrift\Exception\TTransportException;
+use Thrift\Factory\TStringFuncFactory;
+
+/**
+ * Base interface for a transport agent.
+ *
+ * @package thrift.transport
+ */
+abstract class TTransport
+{
+ /**
+ * Whether this transport is open.
+ *
+ * @return boolean true if open
+ */
+ abstract public function isOpen();
+
+ /**
+ * Open the transport for reading/writing
+ *
+ * @throws TTransportException if cannot open
+ */
+ abstract public function open();
+
+ /**
+ * Close the transport.
+ */
+ abstract public function close();
+
+ /**
+ * 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
+ */
+ abstract public function read($len);
+
+ /**
+ * Guarantees that the full amount of data is read.
+ *
+ * @return string The data, of exact length
+ * @throws TTransportException if cannot read data
+ */
+ public function readAll($len)
+ {
+ // return $this->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
new file mode 100644
index 000000000..215da4a3d
--- /dev/null
+++ b/vendor/packaged/thrift/src/Type/TConstant.php
@@ -0,0 +1,52 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift
+ */
+
+namespace Thrift\Type;
+
+/**
+ * Base class for constant Management
+ */
+abstract class TConstant
+{
+ /**
+ * Don't instanciate this class
+ */
+ protected function __construct()
+ {
+ }
+
+ /**
+ * Get a constant value
+ * @param string $constant
+ * @return mixed
+ */
+ public static function get($constant)
+ {
+ if (is_null(static::$$constant)) {
+ static::$$constant = call_user_func(
+ sprintf('static::init_%s', $constant)
+ );
+ }
+
+ return static::$$constant;
+ }
+}
diff --git a/vendor/packaged/thrift/src/Type/TMessageType.php b/vendor/packaged/thrift/src/Type/TMessageType.php
new file mode 100644
index 000000000..dc9ae6284
--- /dev/null
+++ b/vendor/packaged/thrift/src/Type/TMessageType.php
@@ -0,0 +1,34 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift
+ */
+
+namespace Thrift\Type;
+
+/**
+ * Message types for RPC
+ */
+class TMessageType
+{
+ const CALL = 1;
+ const REPLY = 2;
+ const EXCEPTION = 3;
+ const ONEWAY = 4;
+}
diff --git a/vendor/packaged/thrift/src/Type/TType.php b/vendor/packaged/thrift/src/Type/TType.php
new file mode 100644
index 000000000..3fdb15f53
--- /dev/null
+++ b/vendor/packaged/thrift/src/Type/TType.php
@@ -0,0 +1,47 @@
+<?php
+/*
+ * 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.
+ *
+ * @package thrift
+ */
+
+namespace Thrift\Type;
+
+/**
+ * Data types that can be sent via Thrift
+ */
+class TType
+{
+ const STOP = 0;
+ const VOID = 1;
+ const BOOL = 2;
+ const BYTE = 3;
+ const I08 = 3;
+ const DOUBLE = 4;
+ const I16 = 6;
+ const I32 = 8;
+ const I64 = 10;
+ const STRING = 11;
+ const UTF7 = 11;
+ const STRUCT = 12;
+ const MAP = 13;
+ const SET = 14;
+ const LST = 15; // N.B. cannot use LIST keyword in PHP!
+ const UTF8 = 16;
+ const UTF16 = 17;
+}
diff --git a/vendor/packaged/thrift/update.sh b/vendor/packaged/thrift/update.sh
new file mode 100644
index 000000000..20cf145a7
--- /dev/null
+++ b/vendor/packaged/thrift/update.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+TAG=$1
+
+if [[ "$TAG" == "" ]]; then
+ echo "no branch or tag specified"
+ exit 1
+fi
+
+cd "$(dirname $0)"
+git clone --depth=1 --branch=$TAG [email protected]:apache/thrift tmp
+
+# Move old file to an upper level to fit the new requirements of psr-4
+if [ -d "src/Thrift" ]
+then
+ mv src/Thrift/* src/ && rm -Rf src/Thrift
+fi
+
+rm -Rf src/Thrift
+cp -R tmp/lib/php/lib/* src/
+rm -Rf tmp
+cd -
diff --git a/vendor/psr/cache/CHANGELOG.md b/vendor/psr/cache/CHANGELOG.md
new file mode 100644
index 000000000..58ddab05a
--- /dev/null
+++ b/vendor/psr/cache/CHANGELOG.md
@@ -0,0 +1,16 @@
+# 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
new file mode 100644
index 000000000..b1c2c97b9
--- /dev/null
+++ b/vendor/psr/cache/LICENSE.txt
@@ -0,0 +1,19 @@
+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
new file mode 100644
index 000000000..9855a318b
--- /dev/null
+++ b/vendor/psr/cache/README.md
@@ -0,0 +1,12 @@
+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
new file mode 100644
index 000000000..4b687971e
--- /dev/null
+++ b/vendor/psr/cache/composer.json
@@ -0,0 +1,25 @@
+{
+ "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
new file mode 100644
index 000000000..bb785f46c
--- /dev/null
+++ b/vendor/psr/cache/src/CacheException.php
@@ -0,0 +1,10 @@
+<?php
+
+namespace Psr\Cache;
+
+/**
+ * Exception interface for all exceptions thrown by an Implementing Library.
+ */
+interface CacheException extends \Throwable
+{
+}
diff --git a/vendor/psr/cache/src/CacheItemInterface.php b/vendor/psr/cache/src/CacheItemInterface.php
new file mode 100644
index 000000000..2b2e4bb88
--- /dev/null
+++ b/vendor/psr/cache/src/CacheItemInterface.php
@@ -0,0 +1,105 @@
+<?php
+
+namespace Psr\Cache;
+
+/**
+ * CacheItemInterface defines an interface for interacting with objects inside a cache.
+ *
+ * Each Item object MUST be associated with a specific key, which can be set
+ * according to the implementing system and is typically passed by the
+ * Cache\CacheItemPoolInterface object.
+ *
+ * The Cache\CacheItemInterface object encapsulates the storage and retrieval of
+ * cache items. Each Cache\CacheItemInterface is generated by a
+ * Cache\CacheItemPoolInterface object, which is responsible for any required
+ * setup as well as associating the object with a unique Key.
+ * Cache\CacheItemInterface objects MUST be able to store and retrieve any type
+ * of PHP value defined in the Data section of the specification.
+ *
+ * Calling Libraries MUST NOT instantiate Item objects themselves. They may only
+ * be requested from a Pool object via the getItem() method. Calling Libraries
+ * SHOULD NOT assume that an Item created by one Implementing Library is
+ * compatible with a Pool from another Implementing Library.
+ */
+interface CacheItemInterface
+{
+ /**
+ * Returns the key for the current cache item.
+ *
+ * The key is loaded by the Implementing Library, but should be available to
+ * the higher level callers when needed.
+ *
+ * @return string
+ * The key string for this cache item.
+ */
+ public function getKey(): string;
+
+ /**
+ * Retrieves the value of the item from the cache associated with this object's key.
+ *
+ * The value returned must be identical to the value originally stored by set().
+ *
+ * If isHit() returns false, this method MUST return null. Note that null
+ * is a legitimate cached value, so the isHit() method SHOULD be used to
+ * differentiate between "null value was found" and "no value was found."
+ *
+ * @return mixed
+ * The value corresponding to this cache item's key, or null if not found.
+ */
+ public function get(): mixed;
+
+ /**
+ * Confirms if the cache item lookup resulted in a cache hit.
+ *
+ * Note: This method MUST NOT have a race condition between calling isHit()
+ * and calling get().
+ *
+ * @return bool
+ * True if the request resulted in a cache hit. False otherwise.
+ */
+ public function isHit(): bool;
+
+ /**
+ * Sets the value represented by this cache item.
+ *
+ * The $value argument may be any item that can be serialized by PHP,
+ * although the method of serialization is left up to the Implementing
+ * Library.
+ *
+ * @param mixed $value
+ * The serializable value to be stored.
+ *
+ * @return static
+ * The invoked object.
+ */
+ public function set(mixed $value): static;
+
+ /**
+ * Sets the expiration time for this cache item.
+ *
+ * @param ?\DateTimeInterface $expiration
+ * The point in time after which the item MUST be considered expired.
+ * If null is passed explicitly, a default value MAY be used. If none is set,
+ * the value should be stored permanently or for as long as the
+ * implementation allows.
+ *
+ * @return static
+ * The called object.
+ */
+ public function expiresAt(?\DateTimeInterface $expiration): static;
+
+ /**
+ * Sets the expiration time for this cache item.
+ *
+ * @param int|\DateInterval|null $time
+ * The period of time from the present after which the item MUST be considered
+ * expired. An integer parameter is understood to be the time in seconds until
+ * expiration. If null is passed explicitly, a default value MAY be used.
+ * If none is set, the value should be stored permanently or for as long as the
+ * implementation allows.
+ *
+ * @return static
+ * The called object.
+ */
+ public function expiresAfter(int|\DateInterval|null $time): static;
+}
diff --git a/vendor/psr/cache/src/CacheItemPoolInterface.php b/vendor/psr/cache/src/CacheItemPoolInterface.php
new file mode 100644
index 000000000..4b3017c75
--- /dev/null
+++ b/vendor/psr/cache/src/CacheItemPoolInterface.php
@@ -0,0 +1,138 @@
+<?php
+
+namespace Psr\Cache;
+
+/**
+ * CacheItemPoolInterface generates CacheItemInterface objects.
+ *
+ * The primary purpose of Cache\CacheItemPoolInterface is to accept a key from
+ * the Calling Library and return the associated Cache\CacheItemInterface object.
+ * It is also the primary point of interaction with the entire cache collection.
+ * All configuration and initialization of the Pool is left up to an
+ * Implementing Library.
+ */
+interface CacheItemPoolInterface
+{
+ /**
+ * Returns a Cache Item representing the specified key.
+ *
+ * This method must always return a CacheItemInterface object, even in case of
+ * a cache miss. It MUST NOT return null.
+ *
+ * @param string $key
+ * The key for which to return the corresponding Cache Item.
+ *
+ * @throws InvalidArgumentException
+ * If the $key string is not a legal value a \Psr\Cache\InvalidArgumentException
+ * MUST be thrown.
+ *
+ * @return CacheItemInterface
+ * The corresponding Cache Item.
+ */
+ public function getItem(string $key): CacheItemInterface;
+
+ /**
+ * Returns a traversable set of cache items.
+ *
+ * @param string[] $keys
+ * An indexed array of keys of items to retrieve.
+ *
+ * @throws InvalidArgumentException
+ * If any of the keys in $keys are not a legal value a \Psr\Cache\InvalidArgumentException
+ * MUST be thrown.
+ *
+ * @return iterable
+ * An iterable collection of Cache Items keyed by the cache keys of
+ * each item. A Cache item will be returned for each key, even if that
+ * key is not found. However, if no keys are specified then an empty
+ * traversable MUST be returned instead.
+ */
+ public function getItems(array $keys = []): iterable;
+
+ /**
+ * Confirms if the cache contains specified cache item.
+ *
+ * Note: This method MAY avoid retrieving the cached value for performance reasons.
+ * This could result in a race condition with CacheItemInterface::get(). To avoid
+ * such situation use CacheItemInterface::isHit() instead.
+ *
+ * @param string $key
+ * The key for which to check existence.
+ *
+ * @throws InvalidArgumentException
+ * If the $key string is not a legal value a \Psr\Cache\InvalidArgumentException
+ * MUST be thrown.
+ *
+ * @return bool
+ * True if item exists in the cache, false otherwise.
+ */
+ public function hasItem(string $key): bool;
+
+ /**
+ * Deletes all items in the pool.
+ *
+ * @return bool
+ * True if the pool was successfully cleared. False if there was an error.
+ */
+ public function clear(): bool;
+
+ /**
+ * Removes the item from the pool.
+ *
+ * @param string $key
+ * The key to delete.
+ *
+ * @throws InvalidArgumentException
+ * If the $key string is not a legal value a \Psr\Cache\InvalidArgumentException
+ * MUST be thrown.
+ *
+ * @return bool
+ * True if the item was successfully removed. False if there was an error.
+ */
+ public function deleteItem(string $key): bool;
+
+ /**
+ * Removes multiple items from the pool.
+ *
+ * @param string[] $keys
+ * An array of keys that should be removed from the pool.
+ *
+ * @throws InvalidArgumentException
+ * If any of the keys in $keys are not a legal value a \Psr\Cache\InvalidArgumentException
+ * MUST be thrown.
+ *
+ * @return bool
+ * True if the items were successfully removed. False if there was an error.
+ */
+ public function deleteItems(array $keys): bool;
+
+ /**
+ * Persists a cache item immediately.
+ *
+ * @param CacheItemInterface $item
+ * The cache item to save.
+ *
+ * @return bool
+ * True if the item was successfully persisted. False if there was an error.
+ */
+ public function save(CacheItemInterface $item): bool;
+
+ /**
+ * Sets a cache item to be persisted later.
+ *
+ * @param CacheItemInterface $item
+ * The cache item to save.
+ *
+ * @return bool
+ * False if the item could not be queued or if a commit was attempted and failed. True otherwise.
+ */
+ public function saveDeferred(CacheItemInterface $item): bool;
+
+ /**
+ * Persists any deferred cache items.
+ *
+ * @return bool
+ * True if all not-yet-saved items were successfully saved or there were none. False otherwise.
+ */
+ public function commit(): bool;
+}
diff --git a/vendor/psr/cache/src/InvalidArgumentException.php b/vendor/psr/cache/src/InvalidArgumentException.php
new file mode 100644
index 000000000..be7c6fa0e
--- /dev/null
+++ b/vendor/psr/cache/src/InvalidArgumentException.php
@@ -0,0 +1,13 @@
+<?php
+
+namespace Psr\Cache;
+
+/**
+ * Exception interface for invalid cache arguments.
+ *
+ * Any time an invalid argument is passed into a method it must throw an
+ * exception class which implements Psr\Cache\InvalidArgumentException.
+ */
+interface InvalidArgumentException extends CacheException
+{
+}
diff --git a/vendor/psr/log/LICENSE b/vendor/psr/log/LICENSE
new file mode 100644
index 000000000..474c952b4
--- /dev/null
+++ b/vendor/psr/log/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2012 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/log/README.md b/vendor/psr/log/README.md
new file mode 100644
index 000000000..a9f20c437
--- /dev/null
+++ b/vendor/psr/log/README.md
@@ -0,0 +1,58 @@
+PSR Log
+=======
+
+This repository holds all interfaces/classes/traits related to
+[PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md).
+
+Note that this is not a logger of its own. It is merely an interface that
+describes a logger. See the specification for more details.
+
+Installation
+------------
+
+```bash
+composer require psr/log
+```
+
+Usage
+-----
+
+If you need a logger, you can use the interface like this:
+
+```php
+<?php
+
+use Psr\Log\LoggerInterface;
+
+class Foo
+{
+ private $logger;
+
+ public function __construct(LoggerInterface $logger = null)
+ {
+ $this->logger = $logger;
+ }
+
+ public function doSomething()
+ {
+ if ($this->logger) {
+ $this->logger->info('Doing work');
+ }
+
+ try {
+ $this->doSomethingElse();
+ } catch (Exception $exception) {
+ $this->logger->error('Oh no!', array('exception' => $exception));
+ }
+
+ // do something useful
+ }
+}
+```
+
+You can then pick one of the implementations of the interface to get a logger.
+
+If you want to implement the interface, you can require this package and
+implement `Psr\Log\LoggerInterface` in your code. Please read the
+[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
+for details.
diff --git a/vendor/psr/log/composer.json b/vendor/psr/log/composer.json
new file mode 100644
index 000000000..879fc6f53
--- /dev/null
+++ b/vendor/psr/log/composer.json
@@ -0,0 +1,26 @@
+{
+ "name": "psr/log",
+ "description": "Common interface for logging libraries",
+ "keywords": ["psr", "psr-3", "log"],
+ "homepage": "https://github.com/php-fig/log",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "require": {
+ "php": ">=8.0.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Log\\": "src"
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.x-dev"
+ }
+ }
+}
diff --git a/vendor/psr/log/src/AbstractLogger.php b/vendor/psr/log/src/AbstractLogger.php
new file mode 100644
index 000000000..d60a091af
--- /dev/null
+++ b/vendor/psr/log/src/AbstractLogger.php
@@ -0,0 +1,15 @@
+<?php
+
+namespace Psr\Log;
+
+/**
+ * This is a simple Logger implementation that other Loggers can inherit from.
+ *
+ * It simply delegates all log-level-specific methods to the `log` method to
+ * reduce boilerplate code that a simple Logger that does the same thing with
+ * messages regardless of the error level has to implement.
+ */
+abstract class AbstractLogger implements LoggerInterface
+{
+ use LoggerTrait;
+}
diff --git a/vendor/psr/log/src/InvalidArgumentException.php b/vendor/psr/log/src/InvalidArgumentException.php
new file mode 100644
index 000000000..67f852d1d
--- /dev/null
+++ b/vendor/psr/log/src/InvalidArgumentException.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace Psr\Log;
+
+class InvalidArgumentException extends \InvalidArgumentException
+{
+}
diff --git a/vendor/psr/log/src/LogLevel.php b/vendor/psr/log/src/LogLevel.php
new file mode 100644
index 000000000..9cebcace6
--- /dev/null
+++ b/vendor/psr/log/src/LogLevel.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace Psr\Log;
+
+/**
+ * Describes log levels.
+ */
+class LogLevel
+{
+ const EMERGENCY = 'emergency';
+ const ALERT = 'alert';
+ const CRITICAL = 'critical';
+ const ERROR = 'error';
+ const WARNING = 'warning';
+ const NOTICE = 'notice';
+ const INFO = 'info';
+ const DEBUG = 'debug';
+}
diff --git a/vendor/psr/log/src/LoggerAwareInterface.php b/vendor/psr/log/src/LoggerAwareInterface.php
new file mode 100644
index 000000000..cc46a9514
--- /dev/null
+++ b/vendor/psr/log/src/LoggerAwareInterface.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace Psr\Log;
+
+/**
+ * Describes a logger-aware instance.
+ */
+interface LoggerAwareInterface
+{
+ /**
+ * Sets a logger instance on the object.
+ *
+ * @param LoggerInterface $logger
+ *
+ * @return void
+ */
+ public function setLogger(LoggerInterface $logger): void;
+}
diff --git a/vendor/psr/log/src/LoggerAwareTrait.php b/vendor/psr/log/src/LoggerAwareTrait.php
new file mode 100644
index 000000000..4fb57a292
--- /dev/null
+++ b/vendor/psr/log/src/LoggerAwareTrait.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace Psr\Log;
+
+/**
+ * Basic Implementation of LoggerAwareInterface.
+ */
+trait LoggerAwareTrait
+{
+ /**
+ * The logger instance.
+ *
+ * @var LoggerInterface|null
+ */
+ protected ?LoggerInterface $logger = null;
+
+ /**
+ * Sets a logger.
+ *
+ * @param LoggerInterface $logger
+ */
+ public function setLogger(LoggerInterface $logger): void
+ {
+ $this->logger = $logger;
+ }
+}
diff --git a/vendor/psr/log/src/LoggerInterface.php b/vendor/psr/log/src/LoggerInterface.php
new file mode 100644
index 000000000..b3a24b5f7
--- /dev/null
+++ b/vendor/psr/log/src/LoggerInterface.php
@@ -0,0 +1,125 @@
+<?php
+
+namespace Psr\Log;
+
+/**
+ * Describes a logger instance.
+ *
+ * The message MUST be a string or object implementing __toString().
+ *
+ * The message MAY contain placeholders in the form: {foo} where foo
+ * will be replaced by the context data in key "foo".
+ *
+ * The context array can contain arbitrary data. The only assumption that
+ * can be made by implementors is that if an Exception instance is given
+ * to produce a stack trace, it MUST be in a key named "exception".
+ *
+ * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
+ * for the full interface specification.
+ */
+interface LoggerInterface
+{
+ /**
+ * System is unusable.
+ *
+ * @param string|\Stringable $message
+ * @param mixed[] $context
+ *
+ * @return void
+ */
+ public function emergency(string|\Stringable $message, array $context = []): void;
+
+ /**
+ * Action must be taken immediately.
+ *
+ * Example: Entire website down, database unavailable, etc. This should
+ * trigger the SMS alerts and wake you up.
+ *
+ * @param string|\Stringable $message
+ * @param mixed[] $context
+ *
+ * @return void
+ */
+ public function alert(string|\Stringable $message, array $context = []): void;
+
+ /**
+ * Critical conditions.
+ *
+ * Example: Application component unavailable, unexpected exception.
+ *
+ * @param string|\Stringable $message
+ * @param mixed[] $context
+ *
+ * @return void
+ */
+ public function critical(string|\Stringable $message, array $context = []): void;
+
+ /**
+ * Runtime errors that do not require immediate action but should typically
+ * be logged and monitored.
+ *
+ * @param string|\Stringable $message
+ * @param mixed[] $context
+ *
+ * @return void
+ */
+ public function error(string|\Stringable $message, array $context = []): void;
+
+ /**
+ * Exceptional occurrences that are not errors.
+ *
+ * Example: Use of deprecated APIs, poor use of an API, undesirable things
+ * that are not necessarily wrong.
+ *
+ * @param string|\Stringable $message
+ * @param mixed[] $context
+ *
+ * @return void
+ */
+ public function warning(string|\Stringable $message, array $context = []): void;
+
+ /**
+ * Normal but significant events.
+ *
+ * @param string|\Stringable $message
+ * @param mixed[] $context
+ *
+ * @return void
+ */
+ public function notice(string|\Stringable $message, array $context = []): void;
+
+ /**
+ * Interesting events.
+ *
+ * Example: User logs in, SQL logs.
+ *
+ * @param string|\Stringable $message
+ * @param mixed[] $context
+ *
+ * @return void
+ */
+ public function info(string|\Stringable $message, array $context = []): void;
+
+ /**
+ * Detailed debug information.
+ *
+ * @param string|\Stringable $message
+ * @param mixed[] $context
+ *
+ * @return void
+ */
+ public function debug(string|\Stringable $message, array $context = []): void;
+
+ /**
+ * Logs with an arbitrary level.
+ *
+ * @param mixed $level
+ * @param string|\Stringable $message
+ * @param mixed[] $context
+ *
+ * @return void
+ *
+ * @throws \Psr\Log\InvalidArgumentException
+ */
+ public function log($level, string|\Stringable $message, array $context = []): void;
+}
diff --git a/vendor/psr/log/src/LoggerTrait.php b/vendor/psr/log/src/LoggerTrait.php
new file mode 100644
index 000000000..9c8733f95
--- /dev/null
+++ b/vendor/psr/log/src/LoggerTrait.php
@@ -0,0 +1,142 @@
+<?php
+
+namespace Psr\Log;
+
+/**
+ * This is a simple Logger trait that classes unable to extend AbstractLogger
+ * (because they extend another class, etc) can include.
+ *
+ * It simply delegates all log-level-specific methods to the `log` method to
+ * reduce boilerplate code that a simple Logger that does the same thing with
+ * messages regardless of the error level has to implement.
+ */
+trait LoggerTrait
+{
+ /**
+ * System is unusable.
+ *
+ * @param string|\Stringable $message
+ * @param array $context
+ *
+ * @return void
+ */
+ public function emergency(string|\Stringable $message, array $context = []): void
+ {
+ $this->log(LogLevel::EMERGENCY, $message, $context);
+ }
+
+ /**
+ * Action must be taken immediately.
+ *
+ * Example: Entire website down, database unavailable, etc. This should
+ * trigger the SMS alerts and wake you up.
+ *
+ * @param string|\Stringable $message
+ * @param array $context
+ *
+ * @return void
+ */
+ public function alert(string|\Stringable $message, array $context = []): void
+ {
+ $this->log(LogLevel::ALERT, $message, $context);
+ }
+
+ /**
+ * Critical conditions.
+ *
+ * Example: Application component unavailable, unexpected exception.
+ *
+ * @param string|\Stringable $message
+ * @param array $context
+ *
+ * @return void
+ */
+ public function critical(string|\Stringable $message, array $context = []): void
+ {
+ $this->log(LogLevel::CRITICAL, $message, $context);
+ }
+
+ /**
+ * Runtime errors that do not require immediate action but should typically
+ * be logged and monitored.
+ *
+ * @param string|\Stringable $message
+ * @param array $context
+ *
+ * @return void
+ */
+ public function error(string|\Stringable $message, array $context = []): void
+ {
+ $this->log(LogLevel::ERROR, $message, $context);
+ }
+
+ /**
+ * Exceptional occurrences that are not errors.
+ *
+ * Example: Use of deprecated APIs, poor use of an API, undesirable things
+ * that are not necessarily wrong.
+ *
+ * @param string|\Stringable $message
+ * @param array $context
+ *
+ * @return void
+ */
+ public function warning(string|\Stringable $message, array $context = []): void
+ {
+ $this->log(LogLevel::WARNING, $message, $context);
+ }
+
+ /**
+ * Normal but significant events.
+ *
+ * @param string|\Stringable $message
+ * @param array $context
+ *
+ * @return void
+ */
+ public function notice(string|\Stringable $message, array $context = []): void
+ {
+ $this->log(LogLevel::NOTICE, $message, $context);
+ }
+
+ /**
+ * Interesting events.
+ *
+ * Example: User logs in, SQL logs.
+ *
+ * @param string|\Stringable $message
+ * @param array $context
+ *
+ * @return void
+ */
+ public function info(string|\Stringable $message, array $context = []): void
+ {
+ $this->log(LogLevel::INFO, $message, $context);
+ }
+
+ /**
+ * Detailed debug information.
+ *
+ * @param string|\Stringable $message
+ * @param array $context
+ *
+ * @return void
+ */
+ public function debug(string|\Stringable $message, array $context = []): void
+ {
+ $this->log(LogLevel::DEBUG, $message, $context);
+ }
+
+ /**
+ * Logs with an arbitrary level.
+ *
+ * @param mixed $level
+ * @param string|\Stringable $message
+ * @param array $context
+ *
+ * @return void
+ *
+ * @throws \Psr\Log\InvalidArgumentException
+ */
+ abstract public function log($level, string|\Stringable $message, array $context = []): void;
+}
diff --git a/vendor/psr/log/src/NullLogger.php b/vendor/psr/log/src/NullLogger.php
new file mode 100644
index 000000000..c1cc3c069
--- /dev/null
+++ b/vendor/psr/log/src/NullLogger.php
@@ -0,0 +1,30 @@
+<?php
+
+namespace Psr\Log;
+
+/**
+ * This Logger can be used to avoid conditional log calls.
+ *
+ * Logging should always be optional, and if no logger is provided to your
+ * library creating a NullLogger instance to have something to throw logs at
+ * is a good way to avoid littering your code with `if ($this->logger) { }`
+ * blocks.
+ */
+class NullLogger extends AbstractLogger
+{
+ /**
+ * Logs with an arbitrary level.
+ *
+ * @param mixed $level
+ * @param string|\Stringable $message
+ * @param array $context
+ *
+ * @return void
+ *
+ * @throws \Psr\Log\InvalidArgumentException
+ */
+ public function log($level, string|\Stringable $message, array $context = []): void
+ {
+ // noop
+ }
+}