From 18a06dccbab9486fed283d0c8fbbdeff9c2765ec Mon Sep 17 00:00:00 2001 From: Jay Trees Date: Fri, 21 Jan 2022 09:23:52 +0100 Subject: [PATCH] Install github api --- .gitignore | 10 +- composer.json | 5 +- composer.lock | 1358 ++++++- vendor/clue/stream-filter/.github/FUNDING.yml | 2 + vendor/clue/stream-filter/CHANGELOG.md | 75 + vendor/clue/stream-filter/LICENSE | 21 + vendor/clue/stream-filter/README.md | 323 ++ vendor/clue/stream-filter/composer.json | 26 + .../clue/stream-filter/src/CallbackFilter.php | 114 + vendor/clue/stream-filter/src/functions.php | 327 ++ .../stream-filter/src/functions_include.php | 6 + vendor/composer/ClassLoader.php | 572 +++ vendor/composer/InstalledVersions.php | 350 ++ vendor/composer/LICENSE | 21 + vendor/composer/autoload_classmap.php | 14 + vendor/composer/autoload_files.php | 33 + vendor/composer/autoload_namespaces.php | 10 + vendor/composer/autoload_psr4.php | 33 + vendor/composer/autoload_real.php | 75 + vendor/composer/autoload_static.php | 216 ++ vendor/composer/ca-bundle/LICENSE | 19 + vendor/composer/ca-bundle/README.md | 85 + vendor/composer/ca-bundle/composer.json | 54 + vendor/composer/ca-bundle/res/cacert.pem | 3232 +++++++++++++++++ vendor/composer/ca-bundle/src/CaBundle.php | 431 +++ vendor/composer/installed.json | 2056 +++++++++++ vendor/composer/installed.php | 309 ++ vendor/composer/platform_check.php | 26 + vendor/guzzlehttp/guzzle/CHANGELOG.md | 1490 ++++++++ vendor/guzzlehttp/guzzle/LICENSE | 27 + vendor/guzzlehttp/guzzle/README.md | 94 + vendor/guzzlehttp/guzzle/UPGRADING.md | 1253 +++++++ vendor/guzzlehttp/guzzle/composer.json | 98 + .../guzzlehttp/guzzle/src/BodySummarizer.php | 28 + .../guzzle/src/BodySummarizerInterface.php | 13 + vendor/guzzlehttp/guzzle/src/Client.php | 477 +++ .../guzzlehttp/guzzle/src/ClientInterface.php | 84 + vendor/guzzlehttp/guzzle/src/ClientTrait.php | 241 ++ .../guzzle/src/Cookie/CookieJar.php | 313 ++ .../guzzle/src/Cookie/CookieJarInterface.php | 79 + .../guzzle/src/Cookie/FileCookieJar.php | 101 + .../guzzle/src/Cookie/SessionCookieJar.php | 77 + .../guzzle/src/Cookie/SetCookie.php | 444 +++ .../src/Exception/BadResponseException.php | 39 + .../guzzle/src/Exception/ClientException.php | 10 + .../guzzle/src/Exception/ConnectException.php | 56 + .../guzzle/src/Exception/GuzzleException.php | 9 + .../Exception/InvalidArgumentException.php | 7 + .../guzzle/src/Exception/RequestException.php | 166 + .../guzzle/src/Exception/ServerException.php | 10 + .../Exception/TooManyRedirectsException.php | 7 + .../src/Exception/TransferException.php | 7 + .../guzzle/src/Handler/CurlFactory.php | 595 +++ .../src/Handler/CurlFactoryInterface.php | 25 + .../guzzle/src/Handler/CurlHandler.php | 49 + .../guzzle/src/Handler/CurlMultiHandler.php | 261 ++ .../guzzle/src/Handler/EasyHandle.php | 112 + .../guzzle/src/Handler/HeaderProcessor.php | 42 + .../guzzle/src/Handler/MockHandler.php | 211 ++ .../guzzlehttp/guzzle/src/Handler/Proxy.php | 51 + .../guzzle/src/Handler/StreamHandler.php | 586 +++ vendor/guzzlehttp/guzzle/src/HandlerStack.php | 275 ++ .../guzzle/src/MessageFormatter.php | 198 + .../guzzle/src/MessageFormatterInterface.php | 18 + vendor/guzzlehttp/guzzle/src/Middleware.php | 260 ++ vendor/guzzlehttp/guzzle/src/Pool.php | 125 + .../guzzle/src/PrepareBodyMiddleware.php | 104 + .../guzzle/src/RedirectMiddleware.php | 216 ++ .../guzzlehttp/guzzle/src/RequestOptions.php | 264 ++ .../guzzlehttp/guzzle/src/RetryMiddleware.php | 116 + .../guzzlehttp/guzzle/src/TransferStats.php | 133 + vendor/guzzlehttp/guzzle/src/Utils.php | 382 ++ vendor/guzzlehttp/guzzle/src/functions.php | 167 + .../guzzle/src/functions_include.php | 6 + vendor/guzzlehttp/promises/CHANGELOG.md | 103 + vendor/guzzlehttp/promises/LICENSE | 24 + vendor/guzzlehttp/promises/Makefile | 13 + vendor/guzzlehttp/promises/README.md | 547 +++ vendor/guzzlehttp/promises/composer.json | 58 + .../promises/src/AggregateException.php | 17 + .../promises/src/CancellationException.php | 10 + vendor/guzzlehttp/promises/src/Coroutine.php | 169 + vendor/guzzlehttp/promises/src/Create.php | 84 + vendor/guzzlehttp/promises/src/Each.php | 90 + .../guzzlehttp/promises/src/EachPromise.php | 255 ++ .../promises/src/FulfilledPromise.php | 84 + vendor/guzzlehttp/promises/src/Is.php | 46 + vendor/guzzlehttp/promises/src/Promise.php | 278 ++ .../promises/src/PromiseInterface.php | 97 + .../promises/src/PromisorInterface.php | 16 + .../promises/src/RejectedPromise.php | 91 + .../promises/src/RejectionException.php | 48 + vendor/guzzlehttp/promises/src/TaskQueue.php | 67 + .../promises/src/TaskQueueInterface.php | 24 + vendor/guzzlehttp/promises/src/Utils.php | 276 ++ vendor/guzzlehttp/promises/src/functions.php | 363 ++ .../promises/src/functions_include.php | 6 + vendor/guzzlehttp/psr7/CHANGELOG.md | 326 ++ vendor/guzzlehttp/psr7/LICENSE | 26 + vendor/guzzlehttp/psr7/README.md | 823 +++++ vendor/guzzlehttp/psr7/composer.json | 89 + vendor/guzzlehttp/psr7/src/AppendStream.php | 249 ++ vendor/guzzlehttp/psr7/src/BufferStream.php | 149 + vendor/guzzlehttp/psr7/src/CachingStream.php | 148 + vendor/guzzlehttp/psr7/src/DroppingStream.php | 46 + .../src/Exception/MalformedUriException.php | 14 + vendor/guzzlehttp/psr7/src/FnStream.php | 179 + vendor/guzzlehttp/psr7/src/Header.php | 69 + vendor/guzzlehttp/psr7/src/HttpFactory.php | 100 + vendor/guzzlehttp/psr7/src/InflateStream.php | 34 + vendor/guzzlehttp/psr7/src/LazyOpenStream.php | 40 + vendor/guzzlehttp/psr7/src/LimitStream.php | 154 + vendor/guzzlehttp/psr7/src/Message.php | 242 ++ vendor/guzzlehttp/psr7/src/MessageTrait.php | 235 ++ vendor/guzzlehttp/psr7/src/MimeType.php | 130 + .../guzzlehttp/psr7/src/MultipartStream.php | 153 + vendor/guzzlehttp/psr7/src/NoSeekStream.php | 25 + vendor/guzzlehttp/psr7/src/PumpStream.php | 179 + vendor/guzzlehttp/psr7/src/Query.php | 113 + vendor/guzzlehttp/psr7/src/Request.php | 157 + vendor/guzzlehttp/psr7/src/Response.php | 160 + vendor/guzzlehttp/psr7/src/Rfc7230.php | 23 + vendor/guzzlehttp/psr7/src/ServerRequest.php | 344 ++ vendor/guzzlehttp/psr7/src/Stream.php | 279 ++ .../psr7/src/StreamDecoratorTrait.php | 155 + vendor/guzzlehttp/psr7/src/StreamWrapper.php | 175 + vendor/guzzlehttp/psr7/src/UploadedFile.php | 211 ++ vendor/guzzlehttp/psr7/src/Uri.php | 733 ++++ vendor/guzzlehttp/psr7/src/UriNormalizer.php | 220 ++ vendor/guzzlehttp/psr7/src/UriResolver.php | 211 ++ vendor/guzzlehttp/psr7/src/Utils.php | 412 +++ .../vendor-bin/php-cs-fixer/composer.json | 9 + .../psr7/vendor-bin/phpstan/composer.json | 10 + .../psr7/vendor-bin/psalm/composer.json | 9 + .../.github/workflows/ci.yaml | 60 + .../http-interop/http-factory-guzzle/LICENSE | 21 + .../http-factory-guzzle/README.md | 7 + .../http-factory-guzzle/composer.json | 37 + .../src/RequestFactory.php | 15 + .../src/ResponseFactory.php | 15 + .../src/ServerRequestFactory.php | 24 + .../http-factory-guzzle/src/StreamFactory.php | 26 + .../src/UploadedFileFactory.php | 25 + .../http-factory-guzzle/src/UriFactory.php | 15 + vendor/knplabs/github-api/CHANGELOG-3.X.md | 97 + vendor/knplabs/github-api/CHANGELOG.md | 438 +++ vendor/knplabs/github-api/LICENSE | 22 + vendor/knplabs/github-api/README.md | 134 + vendor/knplabs/github-api/UPGRADE-3.0.md | 21 + vendor/knplabs/github-api/UPGRADE-4.0.md | 11 + vendor/knplabs/github-api/composer.json | 58 + .../github-api/lib/Github/Api/AbstractApi.php | 224 ++ .../lib/Github/Api/AcceptHeaderTrait.php | 66 + .../github-api/lib/Github/Api/Apps.php | 201 + .../lib/Github/Api/Authorizations.php | 65 + .../github-api/lib/Github/Api/CurrentUser.php | 193 + .../lib/Github/Api/CurrentUser/Emails.php | 94 + .../lib/Github/Api/CurrentUser/Followers.php | 71 + .../Github/Api/CurrentUser/Memberships.php | 48 + .../Github/Api/CurrentUser/Notifications.php | 145 + .../lib/Github/Api/CurrentUser/PublicKeys.php | 74 + .../lib/Github/Api/CurrentUser/Starring.php | 97 + .../lib/Github/Api/CurrentUser/Watchers.php | 75 + .../github-api/lib/Github/Api/Deployment.php | 133 + .../github-api/lib/Github/Api/Enterprise.php | 51 + .../lib/Github/Api/Enterprise/License.php | 20 + .../Api/Enterprise/ManagementConsole.php | 77 + .../lib/Github/Api/Enterprise/Stats.php | 128 + .../lib/Github/Api/Enterprise/UserAdmin.php | 36 + .../lib/Github/Api/Gist/Comments.php | 101 + .../github-api/lib/Github/Api/Gists.php | 182 + .../github-api/lib/Github/Api/GitData.php | 59 + .../lib/Github/Api/GitData/Blobs.php | 68 + .../lib/Github/Api/GitData/Commits.php | 48 + .../lib/Github/Api/GitData/References.php | 156 + .../lib/Github/Api/GitData/Tags.php | 65 + .../lib/Github/Api/GitData/Trees.php | 64 + .../github-api/lib/Github/Api/GraphQL.php | 48 + .../github-api/lib/Github/Api/Issue.php | 241 ++ .../lib/Github/Api/Issue/Assignees.php | 91 + .../lib/Github/Api/Issue/Comments.php | 133 + .../lib/Github/Api/Issue/Events.php | 54 + .../lib/Github/Api/Issue/Labels.php | 192 + .../lib/Github/Api/Issue/Milestones.php | 139 + .../lib/Github/Api/Issue/Timeline.php | 34 + .../github-api/lib/Github/Api/Markdown.php | 49 + .../github-api/lib/Github/Api/Meta.php | 23 + .../Api/Miscellaneous/CodeOfConduct.php | 44 + .../lib/Github/Api/Miscellaneous/Emojis.php | 20 + .../Github/Api/Miscellaneous/Gitignore.php | 34 + .../lib/Github/Api/Miscellaneous/Licenses.php | 34 + .../lib/Github/Api/Notification.php | 91 + .../lib/Github/Api/Organization.php | 134 + .../Api/Organization/Actions/Secrets.php | 144 + .../lib/Github/Api/Organization/Hooks.php | 111 + .../lib/Github/Api/Organization/Members.php | 75 + .../Api/Organization/OutsideCollaborators.php | 52 + .../lib/Github/Api/Organization/Projects.php | 23 + .../lib/Github/Api/Organization/Teams.php | 121 + .../Github/Api/Project/AbstractProjectApi.php | 45 + .../lib/Github/Api/Project/Cards.php | 60 + .../lib/Github/Api/Project/Columns.php | 73 + .../github-api/lib/Github/Api/PullRequest.php | 198 + .../lib/Github/Api/PullRequest/Comments.php | 153 + .../lib/Github/Api/PullRequest/Review.php | 211 ++ .../Github/Api/PullRequest/ReviewRequest.php | 72 + .../github-api/lib/Github/Api/RateLimit.php | 70 + .../Api/RateLimit/RateLimitResource.php | 73 + .../github-api/lib/Github/Api/Repo.php | 822 +++++ .../Api/Repository/Actions/Artifacts.php | 82 + .../Github/Api/Repository/Actions/Secrets.php | 95 + .../Repository/Actions/SelfHostedRunners.php | 65 + .../Api/Repository/Actions/WorkflowJobs.php | 54 + .../Api/Repository/Actions/WorkflowRuns.php | 155 + .../Api/Repository/Actions/Workflows.php | 82 + .../lib/Github/Api/Repository/Assets.php | 123 + .../Api/Repository/Checks/CheckRuns.php | 86 + .../Api/Repository/Checks/CheckSuites.php | 74 + .../Github/Api/Repository/Collaborators.php | 84 + .../lib/Github/Api/Repository/Comments.php | 75 + .../lib/Github/Api/Repository/Commits.php | 33 + .../lib/Github/Api/Repository/Contents.php | 297 ++ .../lib/Github/Api/Repository/DeployKeys.php | 49 + .../lib/Github/Api/Repository/Downloads.php | 60 + .../lib/Github/Api/Repository/Forks.php | 27 + .../lib/Github/Api/Repository/Hooks.php | 57 + .../lib/Github/Api/Repository/Labels.php | 43 + .../lib/Github/Api/Repository/Pages.php | 60 + .../lib/Github/Api/Repository/Projects.php | 23 + .../lib/Github/Api/Repository/Protection.php | 440 +++ .../lib/Github/Api/Repository/Releases.php | 127 + .../lib/Github/Api/Repository/Stargazers.php | 40 + .../lib/Github/Api/Repository/Statuses.php | 63 + .../lib/Github/Api/Repository/Traffic.php | 67 + .../github-api/lib/Github/Api/Search.php | 130 + .../github-api/lib/Github/Api/User.php | 249 ++ .../github-api/lib/Github/AuthMethod.php | 30 + .../knplabs/github-api/lib/Github/Client.php | 421 +++ .../Exception/ApiLimitExceedException.php | 46 + .../Exception/BadMethodCallException.php | 10 + .../lib/Github/Exception/ErrorException.php | 10 + .../Github/Exception/ExceptionInterface.php | 9 + .../Exception/InvalidArgumentException.php | 10 + .../Exception/MissingArgumentException.php | 25 + .../lib/Github/Exception/RuntimeException.php | 10 + .../Github/Exception/SsoRequiredException.php | 31 + ...oFactorAuthenticationRequiredException.php | 30 + .../Exception/ValidationFailedException.php | 12 + .../lib/Github/HttpClient/Builder.php | 214 ++ .../HttpClient/Message/ResponseMediator.php | 90 + .../HttpClient/Plugin/Authentication.php | 71 + .../Plugin/GithubExceptionThrower.php | 160 + .../lib/Github/HttpClient/Plugin/History.php | 44 + .../Github/HttpClient/Plugin/PathPrepend.php | 46 + .../github-api/lib/Github/ResultPager.php | 212 ++ .../lib/Github/ResultPagerInterface.php | 104 + vendor/knplabs/github-api/phpstan.neon.dist | 15 + vendor/ml/iri/ML/IRI/.gitignore | 3 + vendor/ml/iri/ML/IRI/.travis.yml | 7 + vendor/ml/iri/ML/IRI/IRI.php | 601 +++ vendor/ml/iri/ML/IRI/LICENSE | 19 + vendor/ml/iri/ML/IRI/README.md | 47 + vendor/ml/iri/ML/IRI/Test/IriTest.php | 1078 ++++++ vendor/ml/iri/ML/IRI/Test/bootstrap.php | 12 + vendor/ml/iri/ML/IRI/composer.json | 24 + vendor/ml/iri/ML/IRI/phpunit.xml.dist | 32 + vendor/ml/json-ld/.gitignore | 4 + vendor/ml/json-ld/.travis.yml | 23 + vendor/ml/json-ld/DefaultDocumentFactory.php | 28 + vendor/ml/json-ld/Document.php | 206 ++ .../ml/json-ld/DocumentFactoryInterface.php | 29 + vendor/ml/json-ld/DocumentInterface.php | 89 + vendor/ml/json-ld/DocumentLoaderInterface.php | 31 + .../Exception/InvalidQuadException.php | 61 + .../ml/json-ld/Exception/JsonLdException.php | 307 ++ vendor/ml/json-ld/FileGetContentsLoader.php | 197 + vendor/ml/json-ld/Graph.php | 273 ++ vendor/ml/json-ld/GraphInterface.php | 117 + vendor/ml/json-ld/JsonLD.php | 692 ++++ vendor/ml/json-ld/JsonLdSerializable.php | 38 + vendor/ml/json-ld/LICENSE | 19 + vendor/ml/json-ld/LanguageTaggedString.php | 95 + vendor/ml/json-ld/NQuads.php | 173 + vendor/ml/json-ld/Node.php | 509 +++ vendor/ml/json-ld/NodeInterface.php | 218 ++ vendor/ml/json-ld/Processor.php | 2973 +++++++++++++++ vendor/ml/json-ld/Quad.php | 152 + vendor/ml/json-ld/QuadParserInterface.php | 27 + vendor/ml/json-ld/QuadSerializerInterface.php | 27 + vendor/ml/json-ld/README.md | 104 + vendor/ml/json-ld/RdfConstants.php | 28 + vendor/ml/json-ld/RemoteDocument.php | 57 + vendor/ml/json-ld/Test/DocumentTest.php | 100 + .../ml/json-ld/Test/EarlReportGenerator.php | 273 ++ .../Test/FileGetContentsLoaderTest.php | 99 + .../ml/json-ld/Test/Fixtures/dataset.jsonld | 36 + .../Test/Fixtures/sample-compacted.jsonld | 24 + .../Test/Fixtures/sample-context.jsonld | 11 + .../Test/Fixtures/sample-expanded.jsonld | 20 + .../Test/Fixtures/sample-flattened.jsonld | 34 + .../ml/json-ld/Test/Fixtures/sample-in.jsonld | 22 + .../sample-serialized-document.jsonld | 23 + vendor/ml/json-ld/Test/GraphTest.php | 915 +++++ vendor/ml/json-ld/Test/JsonLDApiTest.php | 132 + vendor/ml/json-ld/Test/JsonTestCase.php | 64 + vendor/ml/json-ld/Test/NQuadsTest.php | 49 + .../ml/json-ld/Test/TestManifestIterator.php | 120 + vendor/ml/json-ld/Test/ValueTest.php | 138 + vendor/ml/json-ld/Test/W3CTestSuiteTest.php | 368 ++ vendor/ml/json-ld/Test/bootstrap.php | 19 + vendor/ml/json-ld/TypedValue.php | 139 + vendor/ml/json-ld/Value.php | 123 + vendor/ml/json-ld/composer.json | 30 + vendor/ml/json-ld/phpunit.xml.dist | 74 + vendor/oscarotero/html-parser/.travis.yml | 16 + vendor/oscarotero/html-parser/CHANGELOG.md | 44 + vendor/oscarotero/html-parser/LICENSE | 21 + vendor/oscarotero/html-parser/README.md | 25 + vendor/oscarotero/html-parser/composer.json | 41 + vendor/oscarotero/html-parser/src/Parser.php | 95 + vendor/php-http/cache-plugin/CHANGELOG.md | 117 + vendor/php-http/cache-plugin/LICENSE | 19 + vendor/php-http/cache-plugin/README.md | 46 + vendor/php-http/cache-plugin/composer.json | 42 + .../php-http/cache-plugin/phpstan.neon.dist | 5 + .../src/Cache/Generator/CacheKeyGenerator.php | 20 + .../Generator/HeaderCacheKeyGenerator.php | 38 + .../src/Cache/Generator/SimpleGenerator.php | 23 + .../Cache/Listener/AddHeaderCacheListener.php | 40 + .../src/Cache/Listener/CacheListener.php | 28 + .../php-http/cache-plugin/src/CachePlugin.php | 464 +++ .../src/Exception/RewindStreamException.php | 12 + vendor/php-http/client-common/.php_cs.dist | 24 + vendor/php-http/client-common/CHANGELOG.md | 276 ++ vendor/php-http/client-common/LICENSE | 19 + vendor/php-http/client-common/README.md | 55 + vendor/php-http/client-common/composer.json | 67 + .../client-common/src/BatchClient.php | 42 + .../src/BatchClientInterface.php | 34 + .../client-common/src/BatchResult.php | 157 + .../php-http/client-common/src/Deferred.php | 152 + .../src/EmulatedHttpAsyncClient.php | 25 + .../client-common/src/EmulatedHttpClient.php | 24 + .../src/Exception/BatchException.php | 37 + .../CircularRedirectionException.php | 16 + .../src/Exception/ClientErrorException.php | 16 + .../Exception/HttpClientNoMatchException.php | 33 + .../Exception/HttpClientNotFoundException.php | 16 + .../src/Exception/LoopException.php | 16 + .../MultipleRedirectionException.php | 16 + .../src/Exception/ServerErrorException.php | 16 + .../client-common/src/FlexibleHttpClient.php | 36 + .../src/HttpAsyncClientDecorator.php | 31 + .../src/HttpAsyncClientEmulator.php | 39 + .../client-common/src/HttpClientDecorator.php | 32 + .../client-common/src/HttpClientEmulator.php | 35 + .../client-common/src/HttpClientPool.php | 24 + .../src/HttpClientPool/HttpClientPool.php | 70 + .../src/HttpClientPool/HttpClientPoolItem.php | 181 + .../HttpClientPool/LeastUsedClientPool.php | 45 + .../src/HttpClientPool/RandomClientPool.php | 31 + .../HttpClientPool/RoundRobinClientPool.php | 42 + .../client-common/src/HttpClientRouter.php | 74 + .../src/HttpClientRouterInterface.php | 27 + .../client-common/src/HttpMethodsClient.php | 150 + .../src/HttpMethodsClientInterface.php | 116 + vendor/php-http/client-common/src/Plugin.php | 33 + .../src/Plugin/AddHostPlugin.php | 76 + .../src/Plugin/AddPathPlugin.php | 78 + .../src/Plugin/AuthenticationPlugin.php | 38 + .../src/Plugin/BaseUriPlugin.php | 57 + .../src/Plugin/ContentLengthPlugin.php | 39 + .../src/Plugin/ContentTypePlugin.php | 122 + .../client-common/src/Plugin/CookiePlugin.php | 180 + .../src/Plugin/DecoderPlugin.php | 135 + .../client-common/src/Plugin/ErrorPlugin.php | 92 + .../src/Plugin/HeaderAppendPlugin.php | 48 + .../src/Plugin/HeaderDefaultsPlugin.php | 46 + .../src/Plugin/HeaderRemovePlugin.php | 44 + .../src/Plugin/HeaderSetPlugin.php | 44 + .../src/Plugin/HistoryPlugin.php | 49 + .../client-common/src/Plugin/Journal.php | 33 + .../src/Plugin/QueryDefaultsPlugin.php | 50 + .../src/Plugin/RedirectPlugin.php | 265 ++ .../src/Plugin/RequestMatcherPlugin.php | 56 + .../src/Plugin/RequestSeekableBodyPlugin.php | 29 + .../src/Plugin/ResponseSeekableBodyPlugin.php | 32 + .../client-common/src/Plugin/RetryPlugin.php | 179 + .../src/Plugin/SeekableBodyPlugin.php | 47 + .../src/Plugin/VersionBridgePlugin.php | 24 + .../client-common/src/PluginChain.php | 62 + .../client-common/src/PluginClient.php | 130 + .../client-common/src/PluginClientBuilder.php | 76 + .../client-common/src/PluginClientFactory.php | 68 + .../client-common/src/VersionBridgeClient.php | 24 + vendor/php-http/discovery/CHANGELOG.md | 315 ++ vendor/php-http/discovery/LICENSE | 19 + vendor/php-http/discovery/README.md | 46 + vendor/php-http/discovery/composer.json | 50 + .../php-http/discovery/src/ClassDiscovery.php | 252 ++ vendor/php-http/discovery/src/Exception.php | 12 + .../ClassInstantiationFailedException.php | 14 + .../Exception/DiscoveryFailedException.php | 51 + .../Exception/NoCandidateFoundException.php | 47 + .../src/Exception/NotFoundException.php | 16 + .../Exception/PuliUnavailableException.php | 12 + .../StrategyUnavailableException.php | 15 + .../src/HttpAsyncClientDiscovery.php | 32 + .../discovery/src/HttpClientDiscovery.php | 32 + .../discovery/src/MessageFactoryDiscovery.php | 34 + .../discovery/src/NotFoundException.php | 14 + .../discovery/src/Psr17FactoryDiscovery.php | 136 + .../discovery/src/Psr18ClientDiscovery.php | 32 + .../src/Strategy/CommonClassesStrategy.php | 185 + .../Strategy/CommonPsr17ClassesStrategy.php | 105 + .../src/Strategy/DiscoveryStrategy.php | 23 + .../src/Strategy/MockClientStrategy.php | 27 + .../src/Strategy/PuliBetaStrategy.php | 92 + .../discovery/src/StreamFactoryDiscovery.php | 34 + .../discovery/src/UriFactoryDiscovery.php | 34 + vendor/php-http/httplug/CHANGELOG.md | 129 + vendor/php-http/httplug/LICENSE | 20 + vendor/php-http/httplug/README.md | 63 + vendor/php-http/httplug/composer.json | 45 + vendor/php-http/httplug/puli.json | 12 + vendor/php-http/httplug/src/Exception.php | 14 + .../httplug/src/Exception/HttpException.php | 65 + .../src/Exception/NetworkException.php | 28 + .../src/Exception/RequestAwareTrait.php | 26 + .../src/Exception/RequestException.php | 29 + .../src/Exception/TransferException.php | 14 + .../php-http/httplug/src/HttpAsyncClient.php | 25 + vendor/php-http/httplug/src/HttpClient.php | 15 + .../src/Promise/HttpFulfilledPromise.php | 54 + .../src/Promise/HttpRejectedPromise.php | 53 + vendor/php-http/message-factory/CHANGELOG.md | 65 + vendor/php-http/message-factory/LICENSE | 19 + vendor/php-http/message-factory/README.md | 36 + vendor/php-http/message-factory/composer.json | 27 + vendor/php-http/message-factory/puli.json | 43 + .../message-factory/src/MessageFactory.php | 12 + .../message-factory/src/RequestFactory.php | 34 + .../message-factory/src/ResponseFactory.php | 35 + .../message-factory/src/StreamFactory.php | 25 + .../message-factory/src/UriFactory.php | 24 + vendor/php-http/message/CHANGELOG.md | 249 ++ vendor/php-http/message/LICENSE | 19 + vendor/php-http/message/README.md | 51 + vendor/php-http/message/apigen.neon | 6 + vendor/php-http/message/composer.json | 65 + vendor/php-http/message/puli.json | 111 + .../php-http/message/src/Authentication.php | 25 + .../src/Authentication/AutoBasicAuth.php | 48 + .../message/src/Authentication/BasicAuth.php | 44 + .../message/src/Authentication/Bearer.php | 37 + .../message/src/Authentication/Chain.php | 47 + .../message/src/Authentication/Header.php | 33 + .../message/src/Authentication/Matching.php | 69 + .../message/src/Authentication/QueryParam.php | 47 + .../src/Authentication/RequestConditional.php | 43 + .../message/src/Authentication/Wsse.php | 68 + .../message/src/Builder/ResponseBuilder.php | 146 + vendor/php-http/message/src/Cookie.php | 524 +++ vendor/php-http/message/src/CookieJar.php | 210 ++ vendor/php-http/message/src/CookieUtil.php | 53 + .../src/Decorator/MessageDecorator.php | 133 + .../src/Decorator/RequestDecorator.php | 86 + .../src/Decorator/ResponseDecorator.php | 55 + .../message/src/Decorator/StreamDecorator.php | 138 + .../message/src/Encoding/ChunkStream.php | 39 + .../message/src/Encoding/CompressStream.php | 45 + .../message/src/Encoding/DechunkStream.php | 29 + .../message/src/Encoding/DecompressStream.php | 45 + .../message/src/Encoding/DeflateStream.php | 41 + .../message/src/Encoding/Filter/Chunk.php | 30 + .../message/src/Encoding/FilteredStream.php | 234 ++ .../message/src/Encoding/GzipDecodeStream.php | 45 + .../message/src/Encoding/GzipEncodeStream.php | 45 + .../message/src/Encoding/InflateStream.php | 45 + vendor/php-http/message/src/Exception.php | 10 + .../Exception/UnexpectedValueException.php | 9 + vendor/php-http/message/src/Formatter.php | 28 + .../src/Formatter/CurlCommandFormatter.php | 93 + .../Formatter/FullHttpMessageFormatter.php | 106 + .../message/src/Formatter/SimpleFormatter.php | 42 + .../DiactorosMessageFactory.php | 82 + .../MessageFactory/GuzzleMessageFactory.php | 55 + .../src/MessageFactory/SlimMessageFactory.php | 74 + .../php-http/message/src/RequestMatcher.php | 26 + .../RequestMatcher/CallbackRequestMatcher.php | 32 + .../RequestMatcher/RegexRequestMatcher.php | 41 + .../src/RequestMatcher/RequestMatcher.php | 78 + .../message/src/Stream/BufferedStream.php | 270 ++ .../StreamFactory/DiactorosStreamFactory.php | 48 + .../src/StreamFactory/GuzzleStreamFactory.php | 28 + .../src/StreamFactory/SlimStreamFactory.php | 39 + .../src/UriFactory/DiactorosUriFactory.php | 36 + .../src/UriFactory/GuzzleUriFactory.php | 29 + .../message/src/UriFactory/SlimUriFactory.php | 33 + vendor/php-http/message/src/filters.php | 6 + .../multipart-stream-builder/CHANGELOG.md | 78 + .../php-http/multipart-stream-builder/LICENSE | 19 + .../multipart-stream-builder/README.md | 38 + .../multipart-stream-builder/composer.json | 44 + .../src/ApacheMimetypeHelper.php | 142 + .../src/CustomMimetypeHelper.php | 51 + .../src/MimetypeHelper.php | 27 + .../src/MultipartStreamBuilder.php | 355 ++ vendor/php-http/promise/CHANGELOG.md | 48 + vendor/php-http/promise/LICENSE | 19 + vendor/php-http/promise/README.md | 48 + vendor/php-http/promise/composer.json | 38 + .../php-http/promise/src/FulfilledPromise.php | 58 + vendor/php-http/promise/src/Promise.php | 69 + .../php-http/promise/src/RejectedPromise.php | 58 + vendor/psr/cache/CHANGELOG.md | 16 + vendor/psr/cache/LICENSE.txt | 19 + vendor/psr/cache/README.md | 12 + vendor/psr/cache/composer.json | 25 + vendor/psr/cache/src/CacheException.php | 10 + vendor/psr/cache/src/CacheItemInterface.php | 105 + .../psr/cache/src/CacheItemPoolInterface.php | 138 + .../cache/src/InvalidArgumentException.php | 13 + vendor/psr/http-client/CHANGELOG.md | 23 + vendor/psr/http-client/LICENSE | 19 + vendor/psr/http-client/README.md | 12 + vendor/psr/http-client/composer.json | 27 + .../src/ClientExceptionInterface.php | 10 + .../psr/http-client/src/ClientInterface.php | 20 + .../src/NetworkExceptionInterface.php | 24 + .../src/RequestExceptionInterface.php | 24 + vendor/psr/http-factory/.gitignore | 2 + vendor/psr/http-factory/.pullapprove.yml | 7 + vendor/psr/http-factory/LICENSE | 21 + vendor/psr/http-factory/README.md | 10 + vendor/psr/http-factory/composer.json | 35 + .../src/RequestFactoryInterface.php | 18 + .../src/ResponseFactoryInterface.php | 18 + .../src/ServerRequestFactoryInterface.php | 24 + .../src/StreamFactoryInterface.php | 45 + .../src/UploadedFileFactoryInterface.php | 34 + .../http-factory/src/UriFactoryInterface.php | 17 + vendor/psr/http-message/CHANGELOG.md | 36 + vendor/psr/http-message/LICENSE | 19 + vendor/psr/http-message/README.md | 13 + vendor/psr/http-message/composer.json | 26 + .../psr/http-message/src/MessageInterface.php | 187 + .../psr/http-message/src/RequestInterface.php | 129 + .../http-message/src/ResponseInterface.php | 68 + .../src/ServerRequestInterface.php | 261 ++ .../psr/http-message/src/StreamInterface.php | 158 + .../src/UploadedFileInterface.php | 123 + vendor/psr/http-message/src/UriInterface.php | 323 ++ vendor/ralouphie/getallheaders/LICENSE | 21 + vendor/ralouphie/getallheaders/README.md | 27 + vendor/ralouphie/getallheaders/composer.json | 26 + .../getallheaders/src/getallheaders.php | 46 + .../symfony/deprecation-contracts/.gitignore | 3 + .../deprecation-contracts/CHANGELOG.md | 5 + vendor/symfony/deprecation-contracts/LICENSE | 19 + .../symfony/deprecation-contracts/README.md | 26 + .../deprecation-contracts/composer.json | 35 + .../deprecation-contracts/function.php | 27 + vendor/symfony/options-resolver/CHANGELOG.md | 86 + .../Debug/OptionsResolverIntrospector.php | 104 + .../Exception/AccessException.php | 22 + .../Exception/ExceptionInterface.php | 21 + .../Exception/InvalidArgumentException.php | 21 + .../Exception/InvalidOptionsException.php | 23 + .../Exception/MissingOptionsException.php | 23 + .../Exception/NoConfigurationException.php | 26 + .../Exception/NoSuchOptionException.php | 26 + .../Exception/OptionDefinitionException.php | 21 + .../Exception/UndefinedOptionsException.php | 24 + vendor/symfony/options-resolver/LICENSE | 19 + .../options-resolver/OptionConfigurator.php | 137 + vendor/symfony/options-resolver/Options.php | 22 + .../options-resolver/OptionsResolver.php | 1300 +++++++ vendor/symfony/options-resolver/README.md | 15 + vendor/symfony/options-resolver/composer.json | 29 + vendor/symfony/polyfill-php80/LICENSE | 19 + vendor/symfony/polyfill-php80/Php80.php | 105 + vendor/symfony/polyfill-php80/README.md | 24 + .../Resources/stubs/Attribute.php | 22 + .../Resources/stubs/Stringable.php | 11 + .../Resources/stubs/UnhandledMatchError.php | 7 + .../Resources/stubs/ValueError.php | 7 + vendor/symfony/polyfill-php80/bootstrap.php | 42 + vendor/symfony/polyfill-php80/composer.json | 40 + 589 files changed, 68631 insertions(+), 10 deletions(-) create mode 100644 vendor/clue/stream-filter/.github/FUNDING.yml create mode 100644 vendor/clue/stream-filter/CHANGELOG.md create mode 100644 vendor/clue/stream-filter/LICENSE create mode 100644 vendor/clue/stream-filter/README.md create mode 100644 vendor/clue/stream-filter/composer.json create mode 100644 vendor/clue/stream-filter/src/CallbackFilter.php create mode 100644 vendor/clue/stream-filter/src/functions.php create mode 100644 vendor/clue/stream-filter/src/functions_include.php create mode 100644 vendor/composer/ClassLoader.php create mode 100644 vendor/composer/InstalledVersions.php create mode 100644 vendor/composer/LICENSE create mode 100644 vendor/composer/autoload_classmap.php create mode 100644 vendor/composer/autoload_files.php create mode 100644 vendor/composer/autoload_namespaces.php create mode 100644 vendor/composer/autoload_psr4.php create mode 100644 vendor/composer/autoload_real.php create mode 100644 vendor/composer/autoload_static.php create mode 100644 vendor/composer/ca-bundle/LICENSE create mode 100644 vendor/composer/ca-bundle/README.md create mode 100644 vendor/composer/ca-bundle/composer.json create mode 100644 vendor/composer/ca-bundle/res/cacert.pem create mode 100644 vendor/composer/ca-bundle/src/CaBundle.php create mode 100644 vendor/composer/installed.json create mode 100644 vendor/composer/installed.php create mode 100644 vendor/composer/platform_check.php create mode 100644 vendor/guzzlehttp/guzzle/CHANGELOG.md create mode 100644 vendor/guzzlehttp/guzzle/LICENSE create mode 100644 vendor/guzzlehttp/guzzle/README.md create mode 100644 vendor/guzzlehttp/guzzle/UPGRADING.md create mode 100644 vendor/guzzlehttp/guzzle/composer.json create mode 100644 vendor/guzzlehttp/guzzle/src/BodySummarizer.php create mode 100644 vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php create mode 100644 vendor/guzzlehttp/guzzle/src/Client.php create mode 100644 vendor/guzzlehttp/guzzle/src/ClientInterface.php create mode 100644 vendor/guzzlehttp/guzzle/src/ClientTrait.php create mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php create mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php create mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php create mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php create mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/ClientException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/RequestException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/ServerException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/TransferException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/Proxy.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php create mode 100644 vendor/guzzlehttp/guzzle/src/HandlerStack.php create mode 100644 vendor/guzzlehttp/guzzle/src/MessageFormatter.php create mode 100644 vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php create mode 100644 vendor/guzzlehttp/guzzle/src/Middleware.php create mode 100644 vendor/guzzlehttp/guzzle/src/Pool.php create mode 100644 vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php create mode 100644 vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php create mode 100644 vendor/guzzlehttp/guzzle/src/RequestOptions.php create mode 100644 vendor/guzzlehttp/guzzle/src/RetryMiddleware.php create mode 100644 vendor/guzzlehttp/guzzle/src/TransferStats.php create mode 100644 vendor/guzzlehttp/guzzle/src/Utils.php create mode 100644 vendor/guzzlehttp/guzzle/src/functions.php create mode 100644 vendor/guzzlehttp/guzzle/src/functions_include.php create mode 100644 vendor/guzzlehttp/promises/CHANGELOG.md create mode 100644 vendor/guzzlehttp/promises/LICENSE create mode 100644 vendor/guzzlehttp/promises/Makefile create mode 100644 vendor/guzzlehttp/promises/README.md create mode 100644 vendor/guzzlehttp/promises/composer.json create mode 100644 vendor/guzzlehttp/promises/src/AggregateException.php create mode 100644 vendor/guzzlehttp/promises/src/CancellationException.php create mode 100644 vendor/guzzlehttp/promises/src/Coroutine.php create mode 100644 vendor/guzzlehttp/promises/src/Create.php create mode 100644 vendor/guzzlehttp/promises/src/Each.php create mode 100644 vendor/guzzlehttp/promises/src/EachPromise.php create mode 100644 vendor/guzzlehttp/promises/src/FulfilledPromise.php create mode 100644 vendor/guzzlehttp/promises/src/Is.php create mode 100644 vendor/guzzlehttp/promises/src/Promise.php create mode 100644 vendor/guzzlehttp/promises/src/PromiseInterface.php create mode 100644 vendor/guzzlehttp/promises/src/PromisorInterface.php create mode 100644 vendor/guzzlehttp/promises/src/RejectedPromise.php create mode 100644 vendor/guzzlehttp/promises/src/RejectionException.php create mode 100644 vendor/guzzlehttp/promises/src/TaskQueue.php create mode 100644 vendor/guzzlehttp/promises/src/TaskQueueInterface.php create mode 100644 vendor/guzzlehttp/promises/src/Utils.php create mode 100644 vendor/guzzlehttp/promises/src/functions.php create mode 100644 vendor/guzzlehttp/promises/src/functions_include.php create mode 100644 vendor/guzzlehttp/psr7/CHANGELOG.md create mode 100644 vendor/guzzlehttp/psr7/LICENSE create mode 100644 vendor/guzzlehttp/psr7/README.md create mode 100644 vendor/guzzlehttp/psr7/composer.json create mode 100644 vendor/guzzlehttp/psr7/src/AppendStream.php create mode 100644 vendor/guzzlehttp/psr7/src/BufferStream.php create mode 100644 vendor/guzzlehttp/psr7/src/CachingStream.php create mode 100644 vendor/guzzlehttp/psr7/src/DroppingStream.php create mode 100644 vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php create mode 100644 vendor/guzzlehttp/psr7/src/FnStream.php create mode 100644 vendor/guzzlehttp/psr7/src/Header.php create mode 100644 vendor/guzzlehttp/psr7/src/HttpFactory.php create mode 100644 vendor/guzzlehttp/psr7/src/InflateStream.php create mode 100644 vendor/guzzlehttp/psr7/src/LazyOpenStream.php create mode 100644 vendor/guzzlehttp/psr7/src/LimitStream.php create mode 100644 vendor/guzzlehttp/psr7/src/Message.php create mode 100644 vendor/guzzlehttp/psr7/src/MessageTrait.php create mode 100644 vendor/guzzlehttp/psr7/src/MimeType.php create mode 100644 vendor/guzzlehttp/psr7/src/MultipartStream.php create mode 100644 vendor/guzzlehttp/psr7/src/NoSeekStream.php create mode 100644 vendor/guzzlehttp/psr7/src/PumpStream.php create mode 100644 vendor/guzzlehttp/psr7/src/Query.php create mode 100644 vendor/guzzlehttp/psr7/src/Request.php create mode 100644 vendor/guzzlehttp/psr7/src/Response.php create mode 100644 vendor/guzzlehttp/psr7/src/Rfc7230.php create mode 100644 vendor/guzzlehttp/psr7/src/ServerRequest.php create mode 100644 vendor/guzzlehttp/psr7/src/Stream.php create mode 100644 vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php create mode 100644 vendor/guzzlehttp/psr7/src/StreamWrapper.php create mode 100644 vendor/guzzlehttp/psr7/src/UploadedFile.php create mode 100644 vendor/guzzlehttp/psr7/src/Uri.php create mode 100644 vendor/guzzlehttp/psr7/src/UriNormalizer.php create mode 100644 vendor/guzzlehttp/psr7/src/UriResolver.php create mode 100644 vendor/guzzlehttp/psr7/src/Utils.php create mode 100644 vendor/guzzlehttp/psr7/vendor-bin/php-cs-fixer/composer.json create mode 100644 vendor/guzzlehttp/psr7/vendor-bin/phpstan/composer.json create mode 100644 vendor/guzzlehttp/psr7/vendor-bin/psalm/composer.json create mode 100644 vendor/http-interop/http-factory-guzzle/.github/workflows/ci.yaml create mode 100644 vendor/http-interop/http-factory-guzzle/LICENSE create mode 100644 vendor/http-interop/http-factory-guzzle/README.md create mode 100644 vendor/http-interop/http-factory-guzzle/composer.json create mode 100644 vendor/http-interop/http-factory-guzzle/src/RequestFactory.php create mode 100644 vendor/http-interop/http-factory-guzzle/src/ResponseFactory.php create mode 100644 vendor/http-interop/http-factory-guzzle/src/ServerRequestFactory.php create mode 100644 vendor/http-interop/http-factory-guzzle/src/StreamFactory.php create mode 100644 vendor/http-interop/http-factory-guzzle/src/UploadedFileFactory.php create mode 100644 vendor/http-interop/http-factory-guzzle/src/UriFactory.php create mode 100644 vendor/knplabs/github-api/CHANGELOG-3.X.md create mode 100644 vendor/knplabs/github-api/CHANGELOG.md create mode 100644 vendor/knplabs/github-api/LICENSE create mode 100644 vendor/knplabs/github-api/README.md create mode 100644 vendor/knplabs/github-api/UPGRADE-3.0.md create mode 100644 vendor/knplabs/github-api/UPGRADE-4.0.md create mode 100644 vendor/knplabs/github-api/composer.json create mode 100644 vendor/knplabs/github-api/lib/Github/Api/AbstractApi.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/AcceptHeaderTrait.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Apps.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Authorizations.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/CurrentUser.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Emails.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Followers.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Memberships.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Notifications.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/CurrentUser/PublicKeys.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Starring.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Watchers.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Deployment.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Enterprise.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Enterprise/License.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Enterprise/ManagementConsole.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Enterprise/Stats.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Enterprise/UserAdmin.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Gist/Comments.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Gists.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/GitData.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/GitData/Blobs.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/GitData/Commits.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/GitData/References.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/GitData/Tags.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/GitData/Trees.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/GraphQL.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Issue.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Issue/Assignees.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Issue/Comments.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Issue/Events.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Issue/Labels.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Issue/Milestones.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Issue/Timeline.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Markdown.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Meta.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/CodeOfConduct.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Emojis.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Gitignore.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Licenses.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Notification.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Organization.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Organization/Actions/Secrets.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Organization/Hooks.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Organization/Members.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Organization/OutsideCollaborators.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Organization/Projects.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Organization/Teams.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Project/AbstractProjectApi.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Project/Cards.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Project/Columns.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/PullRequest.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/PullRequest/Comments.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/PullRequest/Review.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/PullRequest/ReviewRequest.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/RateLimit.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/RateLimit/RateLimitResource.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repo.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Artifacts.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Secrets.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/SelfHostedRunners.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/WorkflowJobs.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/WorkflowRuns.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Workflows.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Assets.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Checks/CheckRuns.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Checks/CheckSuites.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Collaborators.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Comments.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Commits.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Contents.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/DeployKeys.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Downloads.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Forks.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Hooks.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Labels.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Pages.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Projects.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Protection.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Releases.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Stargazers.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Statuses.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Traffic.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/Search.php create mode 100644 vendor/knplabs/github-api/lib/Github/Api/User.php create mode 100644 vendor/knplabs/github-api/lib/Github/AuthMethod.php create mode 100644 vendor/knplabs/github-api/lib/Github/Client.php create mode 100644 vendor/knplabs/github-api/lib/Github/Exception/ApiLimitExceedException.php create mode 100644 vendor/knplabs/github-api/lib/Github/Exception/BadMethodCallException.php create mode 100644 vendor/knplabs/github-api/lib/Github/Exception/ErrorException.php create mode 100644 vendor/knplabs/github-api/lib/Github/Exception/ExceptionInterface.php create mode 100644 vendor/knplabs/github-api/lib/Github/Exception/InvalidArgumentException.php create mode 100644 vendor/knplabs/github-api/lib/Github/Exception/MissingArgumentException.php create mode 100644 vendor/knplabs/github-api/lib/Github/Exception/RuntimeException.php create mode 100644 vendor/knplabs/github-api/lib/Github/Exception/SsoRequiredException.php create mode 100644 vendor/knplabs/github-api/lib/Github/Exception/TwoFactorAuthenticationRequiredException.php create mode 100644 vendor/knplabs/github-api/lib/Github/Exception/ValidationFailedException.php create mode 100644 vendor/knplabs/github-api/lib/Github/HttpClient/Builder.php create mode 100644 vendor/knplabs/github-api/lib/Github/HttpClient/Message/ResponseMediator.php create mode 100644 vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/Authentication.php create mode 100644 vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/GithubExceptionThrower.php create mode 100644 vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/History.php create mode 100644 vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/PathPrepend.php create mode 100644 vendor/knplabs/github-api/lib/Github/ResultPager.php create mode 100644 vendor/knplabs/github-api/lib/Github/ResultPagerInterface.php create mode 100644 vendor/knplabs/github-api/phpstan.neon.dist create mode 100644 vendor/ml/iri/ML/IRI/.gitignore create mode 100644 vendor/ml/iri/ML/IRI/.travis.yml create mode 100644 vendor/ml/iri/ML/IRI/IRI.php create mode 100644 vendor/ml/iri/ML/IRI/LICENSE create mode 100644 vendor/ml/iri/ML/IRI/README.md create mode 100644 vendor/ml/iri/ML/IRI/Test/IriTest.php create mode 100644 vendor/ml/iri/ML/IRI/Test/bootstrap.php create mode 100644 vendor/ml/iri/ML/IRI/composer.json create mode 100644 vendor/ml/iri/ML/IRI/phpunit.xml.dist create mode 100644 vendor/ml/json-ld/.gitignore create mode 100644 vendor/ml/json-ld/.travis.yml create mode 100644 vendor/ml/json-ld/DefaultDocumentFactory.php create mode 100644 vendor/ml/json-ld/Document.php create mode 100644 vendor/ml/json-ld/DocumentFactoryInterface.php create mode 100644 vendor/ml/json-ld/DocumentInterface.php create mode 100644 vendor/ml/json-ld/DocumentLoaderInterface.php create mode 100644 vendor/ml/json-ld/Exception/InvalidQuadException.php create mode 100644 vendor/ml/json-ld/Exception/JsonLdException.php create mode 100644 vendor/ml/json-ld/FileGetContentsLoader.php create mode 100644 vendor/ml/json-ld/Graph.php create mode 100644 vendor/ml/json-ld/GraphInterface.php create mode 100644 vendor/ml/json-ld/JsonLD.php create mode 100644 vendor/ml/json-ld/JsonLdSerializable.php create mode 100644 vendor/ml/json-ld/LICENSE create mode 100644 vendor/ml/json-ld/LanguageTaggedString.php create mode 100644 vendor/ml/json-ld/NQuads.php create mode 100644 vendor/ml/json-ld/Node.php create mode 100644 vendor/ml/json-ld/NodeInterface.php create mode 100644 vendor/ml/json-ld/Processor.php create mode 100644 vendor/ml/json-ld/Quad.php create mode 100644 vendor/ml/json-ld/QuadParserInterface.php create mode 100644 vendor/ml/json-ld/QuadSerializerInterface.php create mode 100644 vendor/ml/json-ld/README.md create mode 100644 vendor/ml/json-ld/RdfConstants.php create mode 100644 vendor/ml/json-ld/RemoteDocument.php create mode 100644 vendor/ml/json-ld/Test/DocumentTest.php create mode 100644 vendor/ml/json-ld/Test/EarlReportGenerator.php create mode 100644 vendor/ml/json-ld/Test/FileGetContentsLoaderTest.php create mode 100644 vendor/ml/json-ld/Test/Fixtures/dataset.jsonld create mode 100644 vendor/ml/json-ld/Test/Fixtures/sample-compacted.jsonld create mode 100644 vendor/ml/json-ld/Test/Fixtures/sample-context.jsonld create mode 100644 vendor/ml/json-ld/Test/Fixtures/sample-expanded.jsonld create mode 100644 vendor/ml/json-ld/Test/Fixtures/sample-flattened.jsonld create mode 100644 vendor/ml/json-ld/Test/Fixtures/sample-in.jsonld create mode 100644 vendor/ml/json-ld/Test/Fixtures/sample-serialized-document.jsonld create mode 100644 vendor/ml/json-ld/Test/GraphTest.php create mode 100644 vendor/ml/json-ld/Test/JsonLDApiTest.php create mode 100644 vendor/ml/json-ld/Test/JsonTestCase.php create mode 100644 vendor/ml/json-ld/Test/NQuadsTest.php create mode 100644 vendor/ml/json-ld/Test/TestManifestIterator.php create mode 100644 vendor/ml/json-ld/Test/ValueTest.php create mode 100644 vendor/ml/json-ld/Test/W3CTestSuiteTest.php create mode 100644 vendor/ml/json-ld/Test/bootstrap.php create mode 100644 vendor/ml/json-ld/TypedValue.php create mode 100644 vendor/ml/json-ld/Value.php create mode 100644 vendor/ml/json-ld/composer.json create mode 100644 vendor/ml/json-ld/phpunit.xml.dist create mode 100644 vendor/oscarotero/html-parser/.travis.yml create mode 100644 vendor/oscarotero/html-parser/CHANGELOG.md create mode 100644 vendor/oscarotero/html-parser/LICENSE create mode 100644 vendor/oscarotero/html-parser/README.md create mode 100644 vendor/oscarotero/html-parser/composer.json create mode 100644 vendor/oscarotero/html-parser/src/Parser.php create mode 100644 vendor/php-http/cache-plugin/CHANGELOG.md create mode 100644 vendor/php-http/cache-plugin/LICENSE create mode 100644 vendor/php-http/cache-plugin/README.md create mode 100644 vendor/php-http/cache-plugin/composer.json create mode 100644 vendor/php-http/cache-plugin/phpstan.neon.dist create mode 100644 vendor/php-http/cache-plugin/src/Cache/Generator/CacheKeyGenerator.php create mode 100644 vendor/php-http/cache-plugin/src/Cache/Generator/HeaderCacheKeyGenerator.php create mode 100644 vendor/php-http/cache-plugin/src/Cache/Generator/SimpleGenerator.php create mode 100644 vendor/php-http/cache-plugin/src/Cache/Listener/AddHeaderCacheListener.php create mode 100644 vendor/php-http/cache-plugin/src/Cache/Listener/CacheListener.php create mode 100644 vendor/php-http/cache-plugin/src/CachePlugin.php create mode 100644 vendor/php-http/cache-plugin/src/Exception/RewindStreamException.php create mode 100644 vendor/php-http/client-common/.php_cs.dist create mode 100644 vendor/php-http/client-common/CHANGELOG.md create mode 100644 vendor/php-http/client-common/LICENSE create mode 100644 vendor/php-http/client-common/README.md create mode 100644 vendor/php-http/client-common/composer.json create mode 100644 vendor/php-http/client-common/src/BatchClient.php create mode 100644 vendor/php-http/client-common/src/BatchClientInterface.php create mode 100644 vendor/php-http/client-common/src/BatchResult.php create mode 100644 vendor/php-http/client-common/src/Deferred.php create mode 100644 vendor/php-http/client-common/src/EmulatedHttpAsyncClient.php create mode 100644 vendor/php-http/client-common/src/EmulatedHttpClient.php create mode 100644 vendor/php-http/client-common/src/Exception/BatchException.php create mode 100644 vendor/php-http/client-common/src/Exception/CircularRedirectionException.php create mode 100644 vendor/php-http/client-common/src/Exception/ClientErrorException.php create mode 100644 vendor/php-http/client-common/src/Exception/HttpClientNoMatchException.php create mode 100644 vendor/php-http/client-common/src/Exception/HttpClientNotFoundException.php create mode 100644 vendor/php-http/client-common/src/Exception/LoopException.php create mode 100644 vendor/php-http/client-common/src/Exception/MultipleRedirectionException.php create mode 100644 vendor/php-http/client-common/src/Exception/ServerErrorException.php create mode 100644 vendor/php-http/client-common/src/FlexibleHttpClient.php create mode 100644 vendor/php-http/client-common/src/HttpAsyncClientDecorator.php create mode 100644 vendor/php-http/client-common/src/HttpAsyncClientEmulator.php create mode 100644 vendor/php-http/client-common/src/HttpClientDecorator.php create mode 100644 vendor/php-http/client-common/src/HttpClientEmulator.php create mode 100644 vendor/php-http/client-common/src/HttpClientPool.php create mode 100644 vendor/php-http/client-common/src/HttpClientPool/HttpClientPool.php create mode 100644 vendor/php-http/client-common/src/HttpClientPool/HttpClientPoolItem.php create mode 100644 vendor/php-http/client-common/src/HttpClientPool/LeastUsedClientPool.php create mode 100644 vendor/php-http/client-common/src/HttpClientPool/RandomClientPool.php create mode 100644 vendor/php-http/client-common/src/HttpClientPool/RoundRobinClientPool.php create mode 100644 vendor/php-http/client-common/src/HttpClientRouter.php create mode 100644 vendor/php-http/client-common/src/HttpClientRouterInterface.php create mode 100644 vendor/php-http/client-common/src/HttpMethodsClient.php create mode 100644 vendor/php-http/client-common/src/HttpMethodsClientInterface.php create mode 100644 vendor/php-http/client-common/src/Plugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/AddHostPlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/AddPathPlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/AuthenticationPlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/BaseUriPlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/ContentLengthPlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/ContentTypePlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/CookiePlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/DecoderPlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/ErrorPlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/HeaderAppendPlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/HeaderDefaultsPlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/HeaderRemovePlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/HeaderSetPlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/HistoryPlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/Journal.php create mode 100644 vendor/php-http/client-common/src/Plugin/QueryDefaultsPlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/RedirectPlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/RequestMatcherPlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/RequestSeekableBodyPlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/ResponseSeekableBodyPlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/RetryPlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/SeekableBodyPlugin.php create mode 100644 vendor/php-http/client-common/src/Plugin/VersionBridgePlugin.php create mode 100644 vendor/php-http/client-common/src/PluginChain.php create mode 100644 vendor/php-http/client-common/src/PluginClient.php create mode 100644 vendor/php-http/client-common/src/PluginClientBuilder.php create mode 100644 vendor/php-http/client-common/src/PluginClientFactory.php create mode 100644 vendor/php-http/client-common/src/VersionBridgeClient.php create mode 100644 vendor/php-http/discovery/CHANGELOG.md create mode 100644 vendor/php-http/discovery/LICENSE create mode 100644 vendor/php-http/discovery/README.md create mode 100644 vendor/php-http/discovery/composer.json create mode 100644 vendor/php-http/discovery/src/ClassDiscovery.php create mode 100644 vendor/php-http/discovery/src/Exception.php create mode 100644 vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php create mode 100644 vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php create mode 100644 vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php create mode 100644 vendor/php-http/discovery/src/Exception/NotFoundException.php create mode 100644 vendor/php-http/discovery/src/Exception/PuliUnavailableException.php create mode 100644 vendor/php-http/discovery/src/Exception/StrategyUnavailableException.php create mode 100644 vendor/php-http/discovery/src/HttpAsyncClientDiscovery.php create mode 100644 vendor/php-http/discovery/src/HttpClientDiscovery.php create mode 100644 vendor/php-http/discovery/src/MessageFactoryDiscovery.php create mode 100644 vendor/php-http/discovery/src/NotFoundException.php create mode 100644 vendor/php-http/discovery/src/Psr17FactoryDiscovery.php create mode 100644 vendor/php-http/discovery/src/Psr18ClientDiscovery.php create mode 100644 vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php create mode 100644 vendor/php-http/discovery/src/Strategy/CommonPsr17ClassesStrategy.php create mode 100644 vendor/php-http/discovery/src/Strategy/DiscoveryStrategy.php create mode 100644 vendor/php-http/discovery/src/Strategy/MockClientStrategy.php create mode 100644 vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php create mode 100644 vendor/php-http/discovery/src/StreamFactoryDiscovery.php create mode 100644 vendor/php-http/discovery/src/UriFactoryDiscovery.php create mode 100644 vendor/php-http/httplug/CHANGELOG.md create mode 100644 vendor/php-http/httplug/LICENSE create mode 100644 vendor/php-http/httplug/README.md create mode 100644 vendor/php-http/httplug/composer.json create mode 100644 vendor/php-http/httplug/puli.json create mode 100644 vendor/php-http/httplug/src/Exception.php create mode 100644 vendor/php-http/httplug/src/Exception/HttpException.php create mode 100644 vendor/php-http/httplug/src/Exception/NetworkException.php create mode 100644 vendor/php-http/httplug/src/Exception/RequestAwareTrait.php create mode 100644 vendor/php-http/httplug/src/Exception/RequestException.php create mode 100644 vendor/php-http/httplug/src/Exception/TransferException.php create mode 100644 vendor/php-http/httplug/src/HttpAsyncClient.php create mode 100644 vendor/php-http/httplug/src/HttpClient.php create mode 100644 vendor/php-http/httplug/src/Promise/HttpFulfilledPromise.php create mode 100644 vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php create mode 100644 vendor/php-http/message-factory/CHANGELOG.md create mode 100644 vendor/php-http/message-factory/LICENSE create mode 100644 vendor/php-http/message-factory/README.md create mode 100644 vendor/php-http/message-factory/composer.json create mode 100644 vendor/php-http/message-factory/puli.json create mode 100644 vendor/php-http/message-factory/src/MessageFactory.php create mode 100644 vendor/php-http/message-factory/src/RequestFactory.php create mode 100644 vendor/php-http/message-factory/src/ResponseFactory.php create mode 100644 vendor/php-http/message-factory/src/StreamFactory.php create mode 100644 vendor/php-http/message-factory/src/UriFactory.php create mode 100644 vendor/php-http/message/CHANGELOG.md create mode 100644 vendor/php-http/message/LICENSE create mode 100644 vendor/php-http/message/README.md create mode 100644 vendor/php-http/message/apigen.neon create mode 100644 vendor/php-http/message/composer.json create mode 100644 vendor/php-http/message/puli.json create mode 100644 vendor/php-http/message/src/Authentication.php create mode 100644 vendor/php-http/message/src/Authentication/AutoBasicAuth.php create mode 100644 vendor/php-http/message/src/Authentication/BasicAuth.php create mode 100644 vendor/php-http/message/src/Authentication/Bearer.php create mode 100644 vendor/php-http/message/src/Authentication/Chain.php create mode 100644 vendor/php-http/message/src/Authentication/Header.php create mode 100644 vendor/php-http/message/src/Authentication/Matching.php create mode 100644 vendor/php-http/message/src/Authentication/QueryParam.php create mode 100644 vendor/php-http/message/src/Authentication/RequestConditional.php create mode 100644 vendor/php-http/message/src/Authentication/Wsse.php create mode 100644 vendor/php-http/message/src/Builder/ResponseBuilder.php create mode 100644 vendor/php-http/message/src/Cookie.php create mode 100644 vendor/php-http/message/src/CookieJar.php create mode 100644 vendor/php-http/message/src/CookieUtil.php create mode 100644 vendor/php-http/message/src/Decorator/MessageDecorator.php create mode 100644 vendor/php-http/message/src/Decorator/RequestDecorator.php create mode 100644 vendor/php-http/message/src/Decorator/ResponseDecorator.php create mode 100644 vendor/php-http/message/src/Decorator/StreamDecorator.php create mode 100644 vendor/php-http/message/src/Encoding/ChunkStream.php create mode 100644 vendor/php-http/message/src/Encoding/CompressStream.php create mode 100644 vendor/php-http/message/src/Encoding/DechunkStream.php create mode 100644 vendor/php-http/message/src/Encoding/DecompressStream.php create mode 100644 vendor/php-http/message/src/Encoding/DeflateStream.php create mode 100644 vendor/php-http/message/src/Encoding/Filter/Chunk.php create mode 100644 vendor/php-http/message/src/Encoding/FilteredStream.php create mode 100644 vendor/php-http/message/src/Encoding/GzipDecodeStream.php create mode 100644 vendor/php-http/message/src/Encoding/GzipEncodeStream.php create mode 100644 vendor/php-http/message/src/Encoding/InflateStream.php create mode 100644 vendor/php-http/message/src/Exception.php create mode 100644 vendor/php-http/message/src/Exception/UnexpectedValueException.php create mode 100644 vendor/php-http/message/src/Formatter.php create mode 100644 vendor/php-http/message/src/Formatter/CurlCommandFormatter.php create mode 100644 vendor/php-http/message/src/Formatter/FullHttpMessageFormatter.php create mode 100644 vendor/php-http/message/src/Formatter/SimpleFormatter.php create mode 100644 vendor/php-http/message/src/MessageFactory/DiactorosMessageFactory.php create mode 100644 vendor/php-http/message/src/MessageFactory/GuzzleMessageFactory.php create mode 100644 vendor/php-http/message/src/MessageFactory/SlimMessageFactory.php create mode 100644 vendor/php-http/message/src/RequestMatcher.php create mode 100644 vendor/php-http/message/src/RequestMatcher/CallbackRequestMatcher.php create mode 100644 vendor/php-http/message/src/RequestMatcher/RegexRequestMatcher.php create mode 100644 vendor/php-http/message/src/RequestMatcher/RequestMatcher.php create mode 100644 vendor/php-http/message/src/Stream/BufferedStream.php create mode 100644 vendor/php-http/message/src/StreamFactory/DiactorosStreamFactory.php create mode 100644 vendor/php-http/message/src/StreamFactory/GuzzleStreamFactory.php create mode 100644 vendor/php-http/message/src/StreamFactory/SlimStreamFactory.php create mode 100644 vendor/php-http/message/src/UriFactory/DiactorosUriFactory.php create mode 100644 vendor/php-http/message/src/UriFactory/GuzzleUriFactory.php create mode 100644 vendor/php-http/message/src/UriFactory/SlimUriFactory.php create mode 100644 vendor/php-http/message/src/filters.php create mode 100644 vendor/php-http/multipart-stream-builder/CHANGELOG.md create mode 100644 vendor/php-http/multipart-stream-builder/LICENSE create mode 100644 vendor/php-http/multipart-stream-builder/README.md create mode 100644 vendor/php-http/multipart-stream-builder/composer.json create mode 100644 vendor/php-http/multipart-stream-builder/src/ApacheMimetypeHelper.php create mode 100644 vendor/php-http/multipart-stream-builder/src/CustomMimetypeHelper.php create mode 100644 vendor/php-http/multipart-stream-builder/src/MimetypeHelper.php create mode 100644 vendor/php-http/multipart-stream-builder/src/MultipartStreamBuilder.php create mode 100644 vendor/php-http/promise/CHANGELOG.md create mode 100644 vendor/php-http/promise/LICENSE create mode 100644 vendor/php-http/promise/README.md create mode 100644 vendor/php-http/promise/composer.json create mode 100644 vendor/php-http/promise/src/FulfilledPromise.php create mode 100644 vendor/php-http/promise/src/Promise.php create mode 100644 vendor/php-http/promise/src/RejectedPromise.php create mode 100644 vendor/psr/cache/CHANGELOG.md create mode 100644 vendor/psr/cache/LICENSE.txt create mode 100644 vendor/psr/cache/README.md create mode 100644 vendor/psr/cache/composer.json create mode 100644 vendor/psr/cache/src/CacheException.php create mode 100644 vendor/psr/cache/src/CacheItemInterface.php create mode 100644 vendor/psr/cache/src/CacheItemPoolInterface.php create mode 100644 vendor/psr/cache/src/InvalidArgumentException.php create mode 100644 vendor/psr/http-client/CHANGELOG.md create mode 100644 vendor/psr/http-client/LICENSE create mode 100644 vendor/psr/http-client/README.md create mode 100644 vendor/psr/http-client/composer.json create mode 100644 vendor/psr/http-client/src/ClientExceptionInterface.php create mode 100644 vendor/psr/http-client/src/ClientInterface.php create mode 100644 vendor/psr/http-client/src/NetworkExceptionInterface.php create mode 100644 vendor/psr/http-client/src/RequestExceptionInterface.php create mode 100644 vendor/psr/http-factory/.gitignore create mode 100644 vendor/psr/http-factory/.pullapprove.yml create mode 100644 vendor/psr/http-factory/LICENSE create mode 100644 vendor/psr/http-factory/README.md create mode 100644 vendor/psr/http-factory/composer.json create mode 100644 vendor/psr/http-factory/src/RequestFactoryInterface.php create mode 100644 vendor/psr/http-factory/src/ResponseFactoryInterface.php create mode 100644 vendor/psr/http-factory/src/ServerRequestFactoryInterface.php create mode 100644 vendor/psr/http-factory/src/StreamFactoryInterface.php create mode 100644 vendor/psr/http-factory/src/UploadedFileFactoryInterface.php create mode 100644 vendor/psr/http-factory/src/UriFactoryInterface.php create mode 100644 vendor/psr/http-message/CHANGELOG.md create mode 100644 vendor/psr/http-message/LICENSE create mode 100644 vendor/psr/http-message/README.md create mode 100644 vendor/psr/http-message/composer.json create mode 100644 vendor/psr/http-message/src/MessageInterface.php create mode 100644 vendor/psr/http-message/src/RequestInterface.php create mode 100644 vendor/psr/http-message/src/ResponseInterface.php create mode 100644 vendor/psr/http-message/src/ServerRequestInterface.php create mode 100644 vendor/psr/http-message/src/StreamInterface.php create mode 100644 vendor/psr/http-message/src/UploadedFileInterface.php create mode 100644 vendor/psr/http-message/src/UriInterface.php create mode 100644 vendor/ralouphie/getallheaders/LICENSE create mode 100644 vendor/ralouphie/getallheaders/README.md create mode 100644 vendor/ralouphie/getallheaders/composer.json create mode 100644 vendor/ralouphie/getallheaders/src/getallheaders.php create mode 100644 vendor/symfony/deprecation-contracts/.gitignore create mode 100644 vendor/symfony/deprecation-contracts/CHANGELOG.md create mode 100644 vendor/symfony/deprecation-contracts/LICENSE create mode 100644 vendor/symfony/deprecation-contracts/README.md create mode 100644 vendor/symfony/deprecation-contracts/composer.json create mode 100644 vendor/symfony/deprecation-contracts/function.php create mode 100644 vendor/symfony/options-resolver/CHANGELOG.md create mode 100644 vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php create mode 100644 vendor/symfony/options-resolver/Exception/AccessException.php create mode 100644 vendor/symfony/options-resolver/Exception/ExceptionInterface.php create mode 100644 vendor/symfony/options-resolver/Exception/InvalidArgumentException.php create mode 100644 vendor/symfony/options-resolver/Exception/InvalidOptionsException.php create mode 100644 vendor/symfony/options-resolver/Exception/MissingOptionsException.php create mode 100644 vendor/symfony/options-resolver/Exception/NoConfigurationException.php create mode 100644 vendor/symfony/options-resolver/Exception/NoSuchOptionException.php create mode 100644 vendor/symfony/options-resolver/Exception/OptionDefinitionException.php create mode 100644 vendor/symfony/options-resolver/Exception/UndefinedOptionsException.php create mode 100644 vendor/symfony/options-resolver/LICENSE create mode 100644 vendor/symfony/options-resolver/OptionConfigurator.php create mode 100644 vendor/symfony/options-resolver/Options.php create mode 100644 vendor/symfony/options-resolver/OptionsResolver.php create mode 100644 vendor/symfony/options-resolver/README.md create mode 100644 vendor/symfony/options-resolver/composer.json create mode 100644 vendor/symfony/polyfill-php80/LICENSE create mode 100644 vendor/symfony/polyfill-php80/Php80.php create mode 100644 vendor/symfony/polyfill-php80/README.md create mode 100644 vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php create mode 100644 vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php create mode 100644 vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php create mode 100644 vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php create mode 100644 vendor/symfony/polyfill-php80/bootstrap.php create mode 100644 vendor/symfony/polyfill-php80/composer.json diff --git a/.gitignore b/.gitignore index c0bf22c6..fa917d4f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,5 @@ -/vendor/* -!/vendor/autoload.php -!/vendor/embed -!/vendor/embed/embed -!/vendor/laminas -!/vendor/laminas/laminas-diactoros -!/vendor/grandel -!/vendor/grandel/include-directory +/vendor/squizlabs/php_codesniffer +/vendor/dealerdirect/phpcodesniffer-composer-installer /node_modules/* !/node_modules/jquery diff --git a/composer.json b/composer.json index 56fb94b3..2df911b2 100644 --- a/composer.json +++ b/composer.json @@ -5,6 +5,9 @@ "require": { "embed/embed": "^4.3", "laminas/laminas-diactoros": "^2.8", - "grandel/include-directory": "^0.2.2" + "grandel/include-directory": "^0.2.2", + "knplabs/github-api": "^3.4", + "guzzlehttp/guzzle": "^7.4", + "http-interop/http-factory-guzzle": "^1.2" } } diff --git a/composer.lock b/composer.lock index c6a7e292..fc4ab780 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,74 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3b4fa12289437129c7113dbe40a6bb96", + "content-hash": "ca48a113708d19fdd610e4bf44a5f5ab", "packages": [ + { + "name": "clue/stream-filter", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/clue/stream-filter.git", + "reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/stream-filter/zipball/aeb7d8ea49c7963d3b581378955dbf5bc49aa320", + "reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\StreamFilter\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "A simple and modern approach to stream filtering in PHP", + "homepage": "https://github.com/clue/php-stream-filter", + "keywords": [ + "bucket brigade", + "callback", + "filter", + "php_user_filter", + "stream", + "stream_filter_append", + "stream_filter_register" + ], + "support": { + "issues": "https://github.com/clue/stream-filter/issues", + "source": "https://github.com/clue/stream-filter/tree/v1.5.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2020-10-02T12:38:20+00:00" + }, { "name": "composer/ca-bundle", "version": "1.3.1", @@ -197,6 +263,475 @@ }, "time": "2021-12-01T14:10:17+00:00" }, + { + "name": "guzzlehttp/guzzle", + "version": "7.4.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee0a041b1760e6a53d2a39c8c34115adc2af2c79", + "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5", + "guzzlehttp/psr7": "^1.8.3 || ^2.1", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "ext-curl": "*", + "php-http/client-integration-tests": "^3.0", + "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.4.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2021-12-06T18:43:05+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2021-10-22T20:56:57+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.1.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2021-10-06T17:43:30+00:00" + }, + { + "name": "http-interop/http-factory-guzzle", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/http-interop/http-factory-guzzle.git", + "reference": "8f06e92b95405216b237521cc64c804dd44c4a81" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/http-interop/http-factory-guzzle/zipball/8f06e92b95405216b237521cc64c804dd44c4a81", + "reference": "8f06e92b95405216b237521cc64c804dd44c4a81", + "shasum": "" + }, + "require": { + "guzzlehttp/psr7": "^1.7||^2.0", + "php": ">=7.3", + "psr/http-factory": "^1.0" + }, + "provide": { + "psr/http-factory-implementation": "^1.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^9.5" + }, + "suggest": { + "guzzlehttp/psr7": "Includes an HTTP factory starting in version 2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Http\\Factory\\Guzzle\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "An HTTP Factory using Guzzle PSR7", + "keywords": [ + "factory", + "http", + "psr-17", + "psr-7" + ], + "support": { + "issues": "https://github.com/http-interop/http-factory-guzzle/issues", + "source": "https://github.com/http-interop/http-factory-guzzle/tree/1.2.0" + }, + "time": "2021-07-21T13:50:14+00:00" + }, + { + "name": "knplabs/github-api", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/php-github-api.git", + "reference": "bddf0f5e686a2dc72ca0ec642e3b487b08d841ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/bddf0f5e686a2dc72ca0ec642e3b487b08d841ce", + "reference": "bddf0f5e686a2dc72ca0ec642e3b487b08d841ce", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.2.5 || ^8.0", + "php-http/cache-plugin": "^1.7.1", + "php-http/client-common": "^2.3", + "php-http/discovery": "^1.12", + "php-http/httplug": "^2.2", + "php-http/multipart-stream-builder": "^1.1.2", + "psr/cache": "^1.0|^2.0", + "psr/http-client-implementation": "^1.0", + "psr/http-factory-implementation": "^1.0", + "psr/http-message": "^1.0", + "symfony/deprecation-contracts": "^2.2", + "symfony/polyfill-php80": "^1.17" + }, + "require-dev": { + "guzzlehttp/guzzle": "^7.2", + "guzzlehttp/psr7": "^1.7", + "http-interop/http-factory-guzzle": "^1.0", + "php-http/mock-client": "^1.4.1", + "phpstan/extension-installer": "^1.0.5", + "phpstan/phpstan": "^0.12.57", + "phpstan/phpstan-deprecation-rules": "^0.12.5", + "phpunit/phpunit": "^8.5 || ^9.4", + "symfony/cache": "^5.1.8", + "symfony/phpunit-bridge": "^5.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.20.x-dev", + "dev-master": "3.4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Github\\": "lib/Github/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KnpLabs Team", + "homepage": "http://knplabs.com" + }, + { + "name": "Thibault Duplessis", + "email": "thibault.duplessis@gmail.com", + "homepage": "http://ornicar.github.com" + } + ], + "description": "GitHub API v3 client", + "homepage": "https://github.com/KnpLabs/php-github-api", + "keywords": [ + "api", + "gh", + "gist", + "github" + ], + "support": { + "issues": "https://github.com/KnpLabs/php-github-api/issues", + "source": "https://github.com/KnpLabs/php-github-api/tree/v3.4.0" + }, + "funding": [ + { + "url": "https://github.com/acrobat", + "type": "github" + } + ], + "time": "2021-12-08T07:25:22+00:00" + }, { "name": "laminas/laminas-diactoros", "version": "2.8.0", @@ -453,6 +988,566 @@ }, "time": "2020-11-19T17:43:46+00:00" }, + { + "name": "php-http/cache-plugin", + "version": "1.7.5", + "source": { + "type": "git", + "url": "https://github.com/php-http/cache-plugin.git", + "reference": "63bc3f7242825c9a817db8f78e4c9703b0c471e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/cache-plugin/zipball/63bc3f7242825c9a817db8f78e4c9703b0c471e2", + "reference": "63bc3f7242825c9a817db8f78e4c9703b0c471e2", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/client-common": "^1.9 || ^2.0", + "php-http/message-factory": "^1.0", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + }, + "require-dev": { + "phpspec/phpspec": "^5.1 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\Plugin\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "PSR-6 Cache plugin for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "cache", + "http", + "httplug", + "plugin" + ], + "support": { + "issues": "https://github.com/php-http/cache-plugin/issues", + "source": "https://github.com/php-http/cache-plugin/tree/1.7.5" + }, + "time": "2022-01-18T12:24:56+00:00" + }, + { + "name": "php-http/client-common", + "version": "2.5.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/client-common.git", + "reference": "d135751167d57e27c74de674d6a30cef2dc8e054" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/client-common/zipball/d135751167d57e27c74de674d6a30cef2dc8e054", + "reference": "d135751167d57e27c74de674d6a30cef2dc8e054", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/httplug": "^2.0", + "php-http/message": "^1.6", + "php-http/message-factory": "^1.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0", + "symfony/polyfill-php80": "^1.17" + }, + "require-dev": { + "doctrine/instantiator": "^1.1", + "guzzlehttp/psr7": "^1.4", + "nyholm/psr7": "^1.2", + "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", + "phpspec/prophecy": "^1.10.2", + "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" + }, + "suggest": { + "ext-json": "To detect JSON responses with the ContentTypePlugin", + "ext-libxml": "To detect XML responses with the ContentTypePlugin", + "php-http/cache-plugin": "PSR-6 Cache plugin", + "php-http/logger-plugin": "PSR-3 Logger plugin", + "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Common HTTP Client implementations and tools for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "common", + "http", + "httplug" + ], + "support": { + "issues": "https://github.com/php-http/client-common/issues", + "source": "https://github.com/php-http/client-common/tree/2.5.0" + }, + "time": "2021-11-26T15:01:24+00:00" + }, + { + "name": "php-http/discovery", + "version": "1.14.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "de90ab2b41d7d61609f504e031339776bc8c7223" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/de90ab2b41d7d61609f504e031339776bc8c7223", + "reference": "de90ab2b41d7d61609f504e031339776bc8c7223", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "nyholm/psr7": "<1.0" + }, + "require-dev": { + "graham-campbell/phpspec-skip-example-extension": "^5.0", + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^5.1 || ^6.1", + "puli/composer-plugin": "1.0.0-beta10" + }, + "suggest": { + "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds installed HTTPlug implementations and PSR-7 message factories", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr7" + ], + "support": { + "issues": "https://github.com/php-http/discovery/issues", + "source": "https://github.com/php-http/discovery/tree/1.14.1" + }, + "time": "2021-09-18T07:57:46+00:00" + }, + { + "name": "php-http/httplug", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/httplug.git", + "reference": "191a0a1b41ed026b717421931f8d3bd2514ffbf9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/httplug/zipball/191a0a1b41ed026b717421931f8d3bd2514ffbf9", + "reference": "191a0a1b41ed026b717421931f8d3bd2514ffbf9", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/promise": "^1.1", + "psr/http-client": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.1", + "phpspec/phpspec": "^5.1 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "HTTPlug, the HTTP client abstraction for PHP", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http" + ], + "support": { + "issues": "https://github.com/php-http/httplug/issues", + "source": "https://github.com/php-http/httplug/tree/master" + }, + "time": "2020-07-13T15:43:23+00:00" + }, + { + "name": "php-http/message", + "version": "1.12.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/message.git", + "reference": "39eb7548be982a81085fe5a6e2a44268cd586291" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message/zipball/39eb7548be982a81085fe5a6e2a44268cd586291", + "reference": "39eb7548be982a81085fe5a6e2a44268cd586291", + "shasum": "" + }, + "require": { + "clue/stream-filter": "^1.5", + "php": "^7.1 || ^8.0", + "php-http/message-factory": "^1.0.2", + "psr/http-message": "^1.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.6", + "ext-zlib": "*", + "guzzlehttp/psr7": "^1.0", + "laminas/laminas-diactoros": "^2.0", + "phpspec/phpspec": "^5.1 || ^6.3", + "slim/slim": "^3.0" + }, + "suggest": { + "ext-zlib": "Used with compressor/decompressor streams", + "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", + "laminas/laminas-diactoros": "Used with Diactoros Factories", + "slim/slim": "Used with Slim Framework PSR-7 implementation" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + }, + "files": [ + "src/filters.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTP Message related tools", + "homepage": "http://php-http.org", + "keywords": [ + "http", + "message", + "psr-7" + ], + "support": { + "issues": "https://github.com/php-http/message/issues", + "source": "https://github.com/php-http/message/tree/1.12.0" + }, + "time": "2021-08-29T09:13:12+00:00" + }, + { + "name": "php-http/message-factory", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message-factory.git", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Factory interfaces for PSR-7 HTTP Message", + "homepage": "http://php-http.org", + "keywords": [ + "factory", + "http", + "message", + "stream", + "uri" + ], + "support": { + "issues": "https://github.com/php-http/message-factory/issues", + "source": "https://github.com/php-http/message-factory/tree/master" + }, + "time": "2015-12-19T14:08:53+00:00" + }, + { + "name": "php-http/multipart-stream-builder", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/multipart-stream-builder.git", + "reference": "11c1d31f72e01c738bbce9e27649a7cca829c30e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/multipart-stream-builder/zipball/11c1d31f72e01c738bbce9e27649a7cca829c30e", + "reference": "11c1d31f72e01c738bbce9e27649a7cca829c30e", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/discovery": "^1.7", + "php-http/message-factory": "^1.0.2", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "nyholm/psr7": "^1.0", + "php-http/message": "^1.5", + "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\MultipartStream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + } + ], + "description": "A builder class that help you create a multipart stream", + "homepage": "http://php-http.org", + "keywords": [ + "factory", + "http", + "message", + "multipart stream", + "stream" + ], + "support": { + "issues": "https://github.com/php-http/multipart-stream-builder/issues", + "source": "https://github.com/php-http/multipart-stream-builder/tree/1.2.0" + }, + "time": "2021-05-21T08:32:01+00:00" + }, + { + "name": "php-http/promise", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/promise.git", + "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/promise/zipball/4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", + "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.3.2", + "phpspec/phpspec": "^5.1.2 || ^6.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/php-http/promise/issues", + "source": "https://github.com/php-http/promise/tree/1.1.0" + }, + "time": "2020-07-07T09:29:14+00:00" + }, + { + "name": "psr/cache", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", + "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "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/2.0.0" + }, + "time": "2021-02-03T23:23:37+00:00" + }, { "name": "psr/http-client", "version": "1.0.1", @@ -612,6 +1707,267 @@ "source": "https://github.com/php-fig/http-message/tree/master" }, "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-12T14:48:14+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v6.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "be0facf48a42a232d6c0daadd76e4eb5657a4798" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/be0facf48a42a232d6c0daadd76e4eb5657a4798", + "reference": "be0facf48a42a232d6c0daadd76e4eb5657a4798", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/deprecation-contracts": "^2.1|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v6.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-23T19:05:29+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-09-13T13:58:33+00:00" } ], "packages-dev": [ diff --git a/vendor/clue/stream-filter/.github/FUNDING.yml b/vendor/clue/stream-filter/.github/FUNDING.yml new file mode 100644 index 00000000..9c09fb87 --- /dev/null +++ b/vendor/clue/stream-filter/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: clue +custom: https://clue.engineering/support diff --git a/vendor/clue/stream-filter/CHANGELOG.md b/vendor/clue/stream-filter/CHANGELOG.md new file mode 100644 index 00000000..12f5a4ef --- /dev/null +++ b/vendor/clue/stream-filter/CHANGELOG.md @@ -0,0 +1,75 @@ +# Changelog + +## 1.5.0 (2020-10-02) + +* Feature: Improve performance by using global imports. + (#38 by @clue) + +* Improve API documentation and add support / sponsorship info. + (#30 by @clue and #35 by @SimonFrings) + +* Improve test suite and add `.gitattributes` to exclude dev files from exports. + Prepare PHP 8 support, update to PHPUnit 9 and simplify test matrix. + (#32 and #37 by @clue and #34 and #36 by @SimonFrings) + +## 1.4.1 (2019-04-09) + +* Fix: Check if the function is declared before declaring it. + (#23 by @Niko9911) + +* Improve test suite to also test against PHP 7.2 and + add test for base64 encoding and decoding filters. + (#22 by @arubacao and #25 by @Nyholm and @clue) + +## 1.4.0 (2017-08-18) + +* Feature / Fix: The `fun()` function does not pass filter parameter `null` + to underlying `stream_filter_append()` by default + (#15 by @Nyholm) + + Certain filters (such as `convert.quoted-printable-encode`) do not accept + a filter parameter at all. If no explicit filter parameter is given, we no + longer pass a default `null` value. + + ```php + $encode = Filter\fun('convert.quoted-printable-encode'); + assert('t=C3=A4st' === $encode('täst')); + ``` + +* Add examples and improve documentation + (#13 and #20 by @clue and #18 by @Nyholm) + +* Improve test suite by adding PHPUnit to require-dev, + fix HHVM build for now again and ignore future HHVM build errors, + lock Travis distro so new future defaults will not break the build + and test on PHP 7.1 + (#12, #14 and #19 by @clue and #16 by @Nyholm) + +## 1.3.0 (2015-11-08) + +* Feature: Support accessing built-in filters as callbacks + (#5 by @clue) + + ```php + $fun = Filter\fun('zlib.deflate'); + + $ret = $fun('hello') . $fun('world') . $fun(); + assert('helloworld' === gzinflate($ret)); + ``` + +## 1.2.0 (2015-10-23) + +* Feature: Invoke close event when closing filter (flush buffer) + (#9 by @clue) + +## 1.1.0 (2015-10-22) + +* Feature: Abort filter operation when catching an Exception + (#10 by @clue) + +* Feature: Additional safeguards to prevent filter state corruption + (#7 by @clue) + +## 1.0.0 (2015-10-18) + +* First tagged release diff --git a/vendor/clue/stream-filter/LICENSE b/vendor/clue/stream-filter/LICENSE new file mode 100644 index 00000000..dc09d1e6 --- /dev/null +++ b/vendor/clue/stream-filter/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Christian Lück + +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/clue/stream-filter/README.md b/vendor/clue/stream-filter/README.md new file mode 100644 index 00000000..861f2b85 --- /dev/null +++ b/vendor/clue/stream-filter/README.md @@ -0,0 +1,323 @@ +# clue/stream-filter [![Build Status](https://travis-ci.org/clue/php-stream-filter.svg?branch=master)](https://travis-ci.org/clue/php-stream-filter) + +A simple and modern approach to stream filtering in PHP + +**Table of contents** + +* [Why?](#why) +* [Support us](#support-us) +* [Usage](#usage) + * [append()](#append) + * [prepend()](#prepend) + * [fun()](#fun) + * [remove()](#remove) +* [Install](#install) +* [Tests](#tests) +* [License](#license) + +## Why? + +PHP's stream filtering system is great! + +It offers very powerful stream filtering options and comes with a useful set of built-in filters. +These filters can be used to easily and efficiently perform various transformations on-the-fly, such as: + +* read from a gzip'ed input file, +* transcode from ISO-8859-1 (Latin1) to UTF-8, +* write to a bzip output file +* and much more. + +But let's face it: +Its API is [*difficult to work with*](https://www.php.net/manual/en/php-user-filter.filter.php) +and its documentation is [*subpar*](https://stackoverflow.com/questions/27103269/what-is-a-bucket-brigade). +This combined means its powerful features are often neglected. + +This project aims to make these features more accessible to a broader audience. +* **Lightweight, SOLID design** - + Provides a thin abstraction that is [*just good enough*](https://en.wikipedia.org/wiki/Principle_of_good_enough) + and does not get in your way. + Custom filters require trivial effort. +* **Good test coverage** - + Comes with an automated tests suite and is regularly tested in the *real world* + +## Support us + +We invest a lot of time developing, maintaining and updating our awesome +open-source projects. You can help us sustain this high-quality of our work by +[becoming a sponsor on GitHub](https://github.com/sponsors/clue). Sponsors get +numerous benefits in return, see our [sponsoring page](https://github.com/sponsors/clue) +for details. + +Let's take these projects to the next level together! 🚀 + +## Usage + +This lightweight library consists only of a few simple functions. +All functions reside under the `Clue\StreamFilter` namespace. + +The below examples assume you use an import statement similar to this: + +```php +use Clue\StreamFilter as Filter; + +Filter\append(…); +``` + +Alternatively, you can also refer to them with their fully-qualified name: + +```php +\Clue\StreamFilter\append(…); +``` + +As of PHP 5.6+ you can also import each required function into your code like this: + +```php +use function Clue\StreamFilter\append; + +append(…); +``` + +### append() + +The `append(resource $stream, callable $callback, int $read_write = STREAM_FILTER_ALL): resource` function can be used to +append a filter callback to the given stream. + +Each stream can have a list of filters attached. +This function appends a filter to the end of this list. + +If the given filter can not be added, it throws an `Exception`. + +The `$stream` can be any valid stream resource, such as: + +```php +$stream = fopen('demo.txt', 'w+'); +``` + +The `$callback` should be a valid callable function which accepts +an individual chunk of data and should return the updated chunk: + +```php +$filter = Filter\append($stream, function ($chunk) { + // will be called each time you read or write a $chunk to/from the stream + return $chunk; +}); +``` + +As such, you can also use native PHP functions or any other `callable`: + +```php +Filter\append($stream, 'strtoupper'); + +// will write "HELLO" to the underlying stream +fwrite($stream, 'hello'); +``` + +If the `$callback` accepts invocation without parameters, +then this signature will be invoked once ending (flushing) the filter: + +```php +Filter\append($stream, function ($chunk = null) { + if ($chunk === null) { + // will be called once ending the filter + return 'end'; + } + // will be called each time you read or write a $chunk to/from the stream + return $chunk; +}); + +fclose($stream); +``` + +> Note: Legacy PHP versions (PHP < 5.4) do not support passing additional data +from the end signal handler if the stream is being closed. + +If your callback throws an `Exception`, then the filter process will be aborted. +In order to play nice with PHP's stream handling, +the `Exception` will be transformed to a PHP warning instead: + +```php +Filter\append($stream, function ($chunk) { + throw new \RuntimeException('Unexpected chunk'); +}); + +// raises an E_USER_WARNING with "Error invoking filter: Unexpected chunk" +fwrite($stream, 'hello'); +``` + +The optional `$read_write` parameter can be used to only invoke the `$callback` +when either writing to the stream or only when reading from the stream: + +```php +Filter\append($stream, function ($chunk) { + // will be called each time you write to the stream + return $chunk; +}, STREAM_FILTER_WRITE); + +Filter\append($stream, function ($chunk) { + // will be called each time you read from the stream + return $chunk; +}, STREAM_FILTER_READ); +``` + +This function returns a filter resource which can be passed to [`remove()`](#remove). + +> Note that once a filter has been added to stream, the stream can no longer be passed to +> [`stream_select()`](https://www.php.net/manual/en/function.stream-select.php) +> (and family). +> +> > Warning: stream_select(): cannot cast a filtered stream on this system in {file} on line {line} +> +> This is due to limitations of PHP's stream filter support, as it can no longer reliably +> tell when the underlying stream resource is actually ready. +> As an alternative, consider calling `stream_select()` on the unfiltered stream and +> then pass the unfiltered data through the [`fun()`](#fun) function. + +### prepend() + +The `prepend(resource $stream, callable $callback, int $read_write = STREAM_FILTER_ALL): resource` function can be used to +prepend a filter callback to the given stream. + +Each stream can have a list of filters attached. +This function prepends a filter to the start of this list. + +If the given filter can not be added, it throws an `Exception`. + +```php +$filter = Filter\prepend($stream, function ($chunk) { + // will be called each time you read or write a $chunk to/from the stream + return $chunk; +}); +``` + +This function returns a filter resource which can be passed to [`remove()`](#remove). + +Except for the position in the list of filters, this function behaves exactly +like the [`append()`](#append) function. +For more details about its behavior, see also the [`append()`](#append) function. + +### fun() + +The `fun(string $filter, mixed $parameters = null): callable` function can be used to +create a filter function which uses the given built-in `$filter`. + +PHP comes with a useful set of [built-in filters](https://www.php.net/manual/en/filters.php). +Using `fun()` makes accessing these as easy as passing an input string to filter +and getting the filtered output string. + +```php +$fun = Filter\fun('string.rot13'); + +assert('grfg' === $fun('test')); +assert('test' === $fun($fun('test')); +``` + +Please note that not all filter functions may be available depending +on installed PHP extensions and the PHP version in use. +In particular, [HHVM](https://hhvm.com/) may not offer the same filter functions +or parameters as Zend PHP. +Accessing an unknown filter function will result in a `RuntimeException`: + +```php +Filter\fun('unknown'); // throws RuntimeException +``` + +Some filters may accept or require additional filter parameters – most +filters do not require filter parameters. +If given, the optional `$parameters` argument will be passed to the +underlying filter handler as-is. +In particular, note how *not passing* this parameter at all differs from +explicitly passing a `null` value (which many filters do not accept). +Please refer to the individual filter definition for more details. +For example, the `string.strip_tags` filter can be invoked like this: + +```php +$fun = Filter\fun('string.strip_tags', ''); + +$ret = $fun('h
i
'); +assert('hi' === $ret); +``` + +Under the hood, this function allocates a temporary memory stream, so it's +recommended to clean up the filter function after use. +Also, some filter functions (in particular the +[zlib compression filters](https://www.php.net/manual/en/filters.compression.php)) +may use internal buffers and may emit a final data chunk on close. +The filter function can be closed by invoking without any arguments: + +```php +$fun = Filter\fun('zlib.deflate'); + +$ret = $fun('hello') . $fun('world') . $fun(); +assert('helloworld' === gzinflate($ret)); +``` + +The filter function must not be used anymore after it has been closed. +Doing so will result in a `RuntimeException`: + +```php +$fun = Filter\fun('string.rot13'); +$fun(); + +$fun('test'); // throws RuntimeException +``` + +> Note: If you're using the zlib compression filters, then you should be wary +about engine inconsistencies between different PHP versions and HHVM. +These inconsistencies exist in the underlying PHP engines and there's little we +can do about this in this library. +[Our test suite](tests/) contains several test cases that exhibit these issues. +If you feel some test case is missing or outdated, we're happy to accept PRs! :) + +### remove() + +The `remove(resource $filter): bool` function can be used to +remove a filter previously added via [`append()`](#append) or [`prepend()`](#prepend). + +```php +$filter = Filter\append($stream, function () { + // … +}); +Filter\remove($filter); +``` + +## Install + +The recommended way to install this library is [through Composer](https://getcomposer.org). +[New to Composer?](https://getcomposer.org/doc/00-intro.md) + +This project follows [SemVer](https://semver.org/). +This will install the latest supported version: + +```bash +$ composer require clue/stream-filter:^1.5 +``` + +See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. + +This project aims to run on any platform and thus does not require any PHP +extensions and supports running on legacy PHP 5.3 through current PHP 7+ and +HHVM. +It's *highly recommended to use PHP 7+* for this project. +Older PHP versions may suffer from a number of inconsistencies documented above. + +## Tests + +To run the test suite, you first need to clone this repo and then install all +dependencies [through Composer](https://getcomposer.org): + +```bash +$ composer install +``` + +To run the test suite, go to the project root and run: + +```bash +$ php vendor/bin/phpunit +``` + +## License + +This project is released under the permissive [MIT license](LICENSE). + +> Did you know that I offer custom development services and issuing invoices for + sponsorships of releases and for contributions? Contact me (@clue) for details. diff --git a/vendor/clue/stream-filter/composer.json b/vendor/clue/stream-filter/composer.json new file mode 100644 index 00000000..797fb536 --- /dev/null +++ b/vendor/clue/stream-filter/composer.json @@ -0,0 +1,26 @@ +{ + "name": "clue/stream-filter", + "description": "A simple and modern approach to stream filtering in PHP", + "keywords": ["stream", "callback", "filter", "php_user_filter", "stream_filter_append", "stream_filter_register", "bucket brigade"], + "homepage": "https://github.com/clue/php-stream-filter", + "license": "MIT", + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + }, + "autoload": { + "psr-4": { "Clue\\StreamFilter\\": "src/" }, + "files": [ "src/functions_include.php" ] + }, + "autoload-dev": { + "psr-4": { "Clue\\Tests\\StreamFilter\\": "tests/" } + } +} diff --git a/vendor/clue/stream-filter/src/CallbackFilter.php b/vendor/clue/stream-filter/src/CallbackFilter.php new file mode 100644 index 00000000..1ca074b6 --- /dev/null +++ b/vendor/clue/stream-filter/src/CallbackFilter.php @@ -0,0 +1,114 @@ +closed = false; + + if (!\is_callable($this->params)) { + throw new \InvalidArgumentException('No valid callback parameter given to stream_filter_(append|prepend)'); + } + $this->callback = $this->params; + + // callback supports end event if it accepts invocation without arguments + $ref = new \ReflectionFunction($this->callback); + $this->supportsClose = ($ref->getNumberOfRequiredParameters() === 0); + + return true; + } + + public function onClose() + { + $this->closed = true; + + // callback supports closing and is not already closed + if ($this->supportsClose) { + $this->supportsClose = false; + // invoke without argument to signal end and discard resulting buffer + try { + \call_user_func($this->callback); + } catch (\Exception $ignored) { + // this might be called during engine shutdown, so it's not safe + // to raise any errors or exceptions here + // trigger_error('Error closing filter: ' . $ignored->getMessage(), E_USER_WARNING); + } + } + + $this->callback = null; + } + + public function filter($in, $out, &$consumed, $closing) + { + // concatenate whole buffer from input brigade + $data = ''; + while ($bucket = \stream_bucket_make_writeable($in)) { + $consumed += $bucket->datalen; + $data .= $bucket->data; + } + + // skip processing callback that already ended + if ($this->closed) { + return \PSFS_FEED_ME; + } + + // only invoke filter function if buffer is not empty + // this may skip flushing a closing filter + if ($data !== '') { + try { + $data = \call_user_func($this->callback, $data); + } catch (\Exception $e) { + // exception should mark filter as closed + $this->onClose(); + \trigger_error('Error invoking filter: ' . $e->getMessage(), \E_USER_WARNING); + + return \PSFS_ERR_FATAL; + } + } + + // mark filter as closed after processing closing chunk + if ($closing) { + $this->closed = true; + + // callback supports closing and is not already closed + if ($this->supportsClose) { + $this->supportsClose = false; + + // invoke without argument to signal end and append resulting buffer + try { + $data .= \call_user_func($this->callback); + } catch (\Exception $e) { + \trigger_error('Error ending filter: ' . $e->getMessage(), \E_USER_WARNING); + + return \PSFS_ERR_FATAL; + } + } + } + + if ($data !== '') { + // create a new bucket for writing the resulting buffer to the output brigade + // reusing an existing bucket turned out to be bugged in some environments (ancient PHP versions and HHVM) + $bucket = @\stream_bucket_new($this->stream, $data); + + // legacy PHP versions (PHP < 5.4) do not support passing data from the event signal handler + // because closing the stream invalidates the stream and its stream bucket brigade before + // invoking the filter close handler. + if ($bucket !== false) { + \stream_bucket_append($out, $bucket); + } + } + + return \PSFS_PASS_ON; + } +} diff --git a/vendor/clue/stream-filter/src/functions.php b/vendor/clue/stream-filter/src/functions.php new file mode 100644 index 00000000..4746d887 --- /dev/null +++ b/vendor/clue/stream-filter/src/functions.php @@ -0,0 +1,327 @@ + Note: Legacy PHP versions (PHP < 5.4) do not support passing additional data + * from the end signal handler if the stream is being closed. + * + * If your callback throws an `Exception`, then the filter process will be aborted. + * In order to play nice with PHP's stream handling, + * the `Exception` will be transformed to a PHP warning instead: + * + * ```php + * Filter\append($stream, function ($chunk) { + * throw new \RuntimeException('Unexpected chunk'); + * }); + * + * // raises an E_USER_WARNING with "Error invoking filter: Unexpected chunk" + * fwrite($stream, 'hello'); + * ``` + * + * The optional `$read_write` parameter can be used to only invoke the `$callback` + * when either writing to the stream or only when reading from the stream: + * + * ```php + * Filter\append($stream, function ($chunk) { + * // will be called each time you write to the stream + * return $chunk; + * }, STREAM_FILTER_WRITE); + * + * Filter\append($stream, function ($chunk) { + * // will be called each time you read from the stream + * return $chunk; + * }, STREAM_FILTER_READ); + * ``` + * + * This function returns a filter resource which can be passed to [`remove()`](#remove). + * + * > Note that once a filter has been added to stream, the stream can no longer be passed to + * > [`stream_select()`](https://www.php.net/manual/en/function.stream-select.php) + * > (and family). + * > + * > > Warning: stream_select(): cannot cast a filtered stream on this system in {file} on line {line} + * > + * > This is due to limitations of PHP's stream filter support, as it can no longer reliably + * > tell when the underlying stream resource is actually ready. + * > As an alternative, consider calling `stream_select()` on the unfiltered stream and + * > then pass the unfiltered data through the [`fun()`](#fun) function. + * + * @param resource $stream + * @param callable $callback + * @param int $read_write + * @return resource filter resource which can be used for `remove()` + * @throws \Exception on error + * @uses stream_filter_append() + */ +function append($stream, $callback, $read_write = STREAM_FILTER_ALL) +{ + $ret = @\stream_filter_append($stream, register(), $read_write, $callback); + + // PHP 8 throws above on type errors, older PHP and memory issues can throw here + // @codeCoverageIgnoreStart + if ($ret === false) { + $error = \error_get_last() + array('message' => ''); + throw new \RuntimeException('Unable to append filter: ' . $error['message']); + } + // @codeCoverageIgnoreEnd + + return $ret; +} + +/** + * Prepend a filter callback to the given stream. + * + * Each stream can have a list of filters attached. + * This function prepends a filter to the start of this list. + * + * If the given filter can not be added, it throws an `Exception`. + * + * ```php + * $filter = Filter\prepend($stream, function ($chunk) { + * // will be called each time you read or write a $chunk to/from the stream + * return $chunk; + * }); + * ``` + * + * This function returns a filter resource which can be passed to [`remove()`](#remove). + * + * Except for the position in the list of filters, this function behaves exactly + * like the [`append()`](#append) function. + * For more details about its behavior, see also the [`append()`](#append) function. + * + * @param resource $stream + * @param callable $callback + * @param int $read_write + * @return resource filter resource which can be used for `remove()` + * @throws \Exception on error + * @uses stream_filter_prepend() + */ +function prepend($stream, $callback, $read_write = STREAM_FILTER_ALL) +{ + $ret = @\stream_filter_prepend($stream, register(), $read_write, $callback); + + // PHP 8 throws above on type errors, older PHP and memory issues can throw here + // @codeCoverageIgnoreStart + if ($ret === false) { + $error = \error_get_last() + array('message' => ''); + throw new \RuntimeException('Unable to prepend filter: ' . $error['message']); + } + // @codeCoverageIgnoreEnd + + return $ret; +} + +/** + * Create a filter function which uses the given built-in `$filter`. + * + * PHP comes with a useful set of [built-in filters](https://www.php.net/manual/en/filters.php). + * Using `fun()` makes accessing these as easy as passing an input string to filter + * and getting the filtered output string. + * + * ```php + * $fun = Filter\fun('string.rot13'); + * + * assert('grfg' === $fun('test')); + * assert('test' === $fun($fun('test')); + * ``` + * + * Please note that not all filter functions may be available depending + * on installed PHP extensions and the PHP version in use. + * In particular, [HHVM](https://hhvm.com/) may not offer the same filter functions + * or parameters as Zend PHP. + * Accessing an unknown filter function will result in a `RuntimeException`: + * + * ```php + * Filter\fun('unknown'); // throws RuntimeException + * ``` + * + * Some filters may accept or require additional filter parameters – most + * filters do not require filter parameters. + * If given, the optional `$parameters` argument will be passed to the + * underlying filter handler as-is. + * In particular, note how *not passing* this parameter at all differs from + * explicitly passing a `null` value (which many filters do not accept). + * Please refer to the individual filter definition for more details. + * For example, the `string.strip_tags` filter can be invoked like this: + * + * ```php + * $fun = Filter\fun('string.strip_tags', '
'); + * + * $ret = $fun('h
i
'); + * assert('hi' === $ret); + * ``` + * + * Under the hood, this function allocates a temporary memory stream, so it's + * recommended to clean up the filter function after use. + * Also, some filter functions (in particular the + * [zlib compression filters](https://www.php.net/manual/en/filters.compression.php)) + * may use internal buffers and may emit a final data chunk on close. + * The filter function can be closed by invoking without any arguments: + * + * ```php + * $fun = Filter\fun('zlib.deflate'); + * + * $ret = $fun('hello') . $fun('world') . $fun(); + * assert('helloworld' === gzinflate($ret)); + * ``` + * + * The filter function must not be used anymore after it has been closed. + * Doing so will result in a `RuntimeException`: + * + * ```php + * $fun = Filter\fun('string.rot13'); + * $fun(); + * + * $fun('test'); // throws RuntimeException + * ``` + * + * > Note: If you're using the zlib compression filters, then you should be wary + * about engine inconsistencies between different PHP versions and HHVM. + * These inconsistencies exist in the underlying PHP engines and there's little we + * can do about this in this library. + * [Our test suite](tests/) contains several test cases that exhibit these issues. + * If you feel some test case is missing or outdated, we're happy to accept PRs! :) + * + * @param string $filter built-in filter name. See stream_get_filters() or http://php.net/manual/en/filters.php + * @param mixed $parameters (optional) parameters to pass to the built-in filter as-is + * @return callable a filter callback which can be append()'ed or prepend()'ed + * @throws \RuntimeException on error + * @link http://php.net/manual/en/filters.php + * @see stream_get_filters() + * @see append() + */ +function fun($filter, $parameters = null) +{ + $fp = \fopen('php://memory', 'w'); + if (\func_num_args() === 1) { + $filter = @\stream_filter_append($fp, $filter, \STREAM_FILTER_WRITE); + } else { + $filter = @\stream_filter_append($fp, $filter, \STREAM_FILTER_WRITE, $parameters); + } + + if ($filter === false) { + \fclose($fp); + $error = \error_get_last() + array('message' => ''); + throw new \RuntimeException('Unable to access built-in filter: ' . $error['message']); + } + + // append filter function which buffers internally + $buffer = ''; + append($fp, function ($chunk) use (&$buffer) { + $buffer .= $chunk; + + // always return empty string in order to skip actually writing to stream resource + return ''; + }, \STREAM_FILTER_WRITE); + + $closed = false; + + return function ($chunk = null) use ($fp, $filter, &$buffer, &$closed) { + if ($closed) { + throw new \RuntimeException('Unable to perform operation on closed stream'); + } + if ($chunk === null) { + $closed = true; + $buffer = ''; + \fclose($fp); + return $buffer; + } + // initialize buffer and invoke filters by attempting to write to stream + $buffer = ''; + \fwrite($fp, $chunk); + + // buffer now contains everything the filter function returned + return $buffer; + }; +} + +/** + * Remove a filter previously added via `append()` or `prepend()`. + * + * ```php + * $filter = Filter\append($stream, function () { + * // … + * }); + * Filter\remove($filter); + * ``` + * + * @param resource $filter + * @return bool true on success or false on error + * @throws \RuntimeException on error + * @uses stream_filter_remove() + */ +function remove($filter) +{ + if (@\stream_filter_remove($filter) === false) { + // PHP 8 throws above on type errors, older PHP and memory issues can throw here + $error = \error_get_last(); + throw new \RuntimeException('Unable to remove filter: ' . $error['message']); + } +} + +/** + * Registers the callback filter and returns the resulting filter name + * + * There should be little reason to call this function manually. + * + * @return string filter name + * @uses CallbackFilter + */ +function register() +{ + static $registered = null; + if ($registered === null) { + $registered = 'stream-callback'; + \stream_filter_register($registered, __NAMESPACE__ . '\CallbackFilter'); + } + return $registered; +} diff --git a/vendor/clue/stream-filter/src/functions_include.php b/vendor/clue/stream-filter/src/functions_include.php new file mode 100644 index 00000000..4b315ae8 --- /dev/null +++ b/vendor/clue/stream-filter/src/functions_include.php @@ -0,0 +1,6 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + /** @var ?string */ + private $vendorDir; + + // PSR-4 + /** + * @var array[] + * @psalm-var array> + */ + private $prefixLengthsPsr4 = array(); + /** + * @var array[] + * @psalm-var array> + */ + private $prefixDirsPsr4 = array(); + /** + * @var array[] + * @psalm-var array + */ + private $fallbackDirsPsr4 = array(); + + // PSR-0 + /** + * @var array[] + * @psalm-var array> + */ + private $prefixesPsr0 = array(); + /** + * @var array[] + * @psalm-var array + */ + private $fallbackDirsPsr0 = array(); + + /** @var bool */ + private $useIncludePath = false; + + /** + * @var string[] + * @psalm-var array + */ + private $classMap = array(); + + /** @var bool */ + private $classMapAuthoritative = false; + + /** + * @var bool[] + * @psalm-var array + */ + private $missingClasses = array(); + + /** @var ?string */ + private $apcuPrefix; + + /** + * @var self[] + */ + private static $registeredLoaders = array(); + + /** + * @param ?string $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + } + + /** + * @return string[] + */ + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); + } + + return array(); + } + + /** + * @return array[] + * @psalm-return array> + */ + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + /** + * @return array[] + * @psalm-return array + */ + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + /** + * @return array[] + * @psalm-return array + */ + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + /** + * @return string[] Array of classname => path + * @psalm-var array + */ + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param string[] $classMap Class to filename map + * @psalm-param array $classMap + * + * @return void + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * 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 + */ + public function add($prefix, $paths, $prepend = false) + { + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + (array) $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + (array) $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = (array) $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + (array) $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + (array) $paths + ); + } + } + + /** + * 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 + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + (array) $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + (array) $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + (array) $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + (array) $paths + ); + } + } + + /** + * 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 + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * 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 + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + * + * @return void + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + * + * @return void + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * 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) + { + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * 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) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } + } + + /** + * Unregisters this instance as an autoloader. + * + * @return void + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return true|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + includeFile($file); + + return true; + } + + return null; + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + /** + * Returns the currently registered loaders indexed by their corresponding vendor directories. + * + * @return self[] + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } +} + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private + */ +function includeFile($file) +{ + include $file; +} diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php new file mode 100644 index 00000000..d50e0c9f --- /dev/null +++ b/vendor/composer/InstalledVersions.php @@ -0,0 +1,350 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +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` + */ +class InstalledVersions +{ + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * 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 + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints($constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + 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 new file mode 100644 index 00000000..f27399a0 --- /dev/null +++ b/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +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/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php new file mode 100644 index 00000000..4ebd53fc --- /dev/null +++ b/vendor/composer/autoload_classmap.php @@ -0,0 +1,14 @@ + $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', + 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', + 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', + 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', + 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', +); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php new file mode 100644 index 00000000..1873794c --- /dev/null +++ b/vendor/composer/autoload_files.php @@ -0,0 +1,33 @@ + $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', + '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', + '9c67151ae59aff4788964ce8eb2a0f43' => $vendorDir . '/clue/stream-filter/src/functions_include.php', + '07d7f1a47144818725fd8d91a907ac57' => $vendorDir . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php', + 'da94ac5d3ca7d2dbab84ce561ce72bfd' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php', + '3d97c8dcdfba8cb85d3b34f116bb248b' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php', + 'e6f3bc6883e449ab367280b34158c05b' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.php', + 'd59fbae42019aedf227094ac49a46f50' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.php', + 'de95e0ac670b27c84ef8c5ac41fc1b34' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_server.php', + 'b6c2870932b0250c10334a86dcb33c7f' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.php', + 'd02cf21124526632320d6f20b1bbf905' => $vendorDir . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.php', + 'd919fc9d5ad52cfb7f322f7fe36458ab' => $vendorDir . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.legacy.php', + 'e397f74f8af3b1e56166a6e99f216ee7' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.legacy.php', + 'd154b49fab8e4da34fb553a2d644918c' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.legacy.php', + '9d3db23ca418094bcf0b641a0c9559ed' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.legacy.php', + 'b0b88a3b89caae681462c58ff19a7059' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.legacy.php', + 'cc8e14526dc240491e17a838cb78508c' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php', + '786bf90caabc9e09b6ad4cc5ca8f0e30' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php', + '751a5a3f463e4be759be31748b61737c' => $vendorDir . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php', + '8cff32064859f4559445b89279f3199c' => $vendorDir . '/php-http/message/src/filters.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', + 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', + '09fc349b549513bf7f4291502426f919' => $vendorDir . '/embed/embed/src/functions.php', +); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php new file mode 100644 index 00000000..98a5e85d --- /dev/null +++ b/vendor/composer/autoload_namespaces.php @@ -0,0 +1,10 @@ + array($vendorDir . '/ml/iri'), +); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php new file mode 100644 index 00000000..8c01f3d1 --- /dev/null +++ b/vendor/composer/autoload_psr4.php @@ -0,0 +1,33 @@ + array($vendorDir . '/symfony/polyfill-php80'), + 'Symfony\\Component\\OptionsResolver\\' => array($vendorDir . '/symfony/options-resolver'), + 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), + 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), + 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'), + 'ML\\JsonLD\\' => array($vendorDir . '/ml/json-ld'), + 'Laminas\\Diactoros\\' => array($vendorDir . '/laminas/laminas-diactoros/src'), + 'Http\\Promise\\' => array($vendorDir . '/php-http/promise/src'), + 'Http\\Message\\MultipartStream\\' => array($vendorDir . '/php-http/multipart-stream-builder/src'), + 'Http\\Message\\' => array($vendorDir . '/php-http/message/src', $vendorDir . '/php-http/message-factory/src'), + 'Http\\Factory\\Guzzle\\' => array($vendorDir . '/http-interop/http-factory-guzzle/src'), + 'Http\\Discovery\\' => array($vendorDir . '/php-http/discovery/src'), + 'Http\\Client\\Common\\Plugin\\' => array($vendorDir . '/php-http/cache-plugin/src'), + 'Http\\Client\\Common\\' => array($vendorDir . '/php-http/client-common/src'), + 'Http\\Client\\' => array($vendorDir . '/php-http/httplug/src'), + 'HtmlParser\\' => array($vendorDir . '/oscarotero/html-parser/src'), + 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), + 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), + 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), + 'Grandel\\' => array($vendorDir . '/grandel/include-directory/src'), + 'Github\\' => array($vendorDir . '/knplabs/github-api/lib/Github'), + 'Embed\\' => array($vendorDir . '/embed/embed/src'), + 'Composer\\CaBundle\\' => array($vendorDir . '/composer/ca-bundle/src'), + 'Clue\\StreamFilter\\' => array($vendorDir . '/clue/stream-filter/src'), +); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php new file mode 100644 index 00000000..56b5e75a --- /dev/null +++ b/vendor/composer/autoload_real.php @@ -0,0 +1,75 @@ += 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); + if ($useStaticLoader) { + require __DIR__ . '/autoload_static.php'; + + call_user_func(\Composer\Autoload\ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1::getInitializer($loader)); + } else { + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } + + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + } + + $loader->register(true); + + if ($useStaticLoader) { + $includeFiles = Composer\Autoload\ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1::$files; + } else { + $includeFiles = require __DIR__ . '/autoload_files.php'; + } + foreach ($includeFiles as $fileIdentifier => $file) { + composerRequire5f3db9fc1d0cf1dd6a77a1d84501b4b1($fileIdentifier, $file); + } + + return $loader; + } +} + +function composerRequire5f3db9fc1d0cf1dd6a77a1d84501b4b1($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 new file mode 100644 index 00000000..b2a3f29f --- /dev/null +++ b/vendor/composer/autoload_static.php @@ -0,0 +1,216 @@ + __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', + '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', + '9c67151ae59aff4788964ce8eb2a0f43' => __DIR__ . '/..' . '/clue/stream-filter/src/functions_include.php', + '07d7f1a47144818725fd8d91a907ac57' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php', + 'da94ac5d3ca7d2dbab84ce561ce72bfd' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php', + '3d97c8dcdfba8cb85d3b34f116bb248b' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php', + 'e6f3bc6883e449ab367280b34158c05b' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.php', + 'd59fbae42019aedf227094ac49a46f50' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.php', + 'de95e0ac670b27c84ef8c5ac41fc1b34' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_server.php', + 'b6c2870932b0250c10334a86dcb33c7f' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.php', + 'd02cf21124526632320d6f20b1bbf905' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.php', + 'd919fc9d5ad52cfb7f322f7fe36458ab' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.legacy.php', + 'e397f74f8af3b1e56166a6e99f216ee7' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.legacy.php', + 'd154b49fab8e4da34fb553a2d644918c' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.legacy.php', + '9d3db23ca418094bcf0b641a0c9559ed' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.legacy.php', + 'b0b88a3b89caae681462c58ff19a7059' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.legacy.php', + 'cc8e14526dc240491e17a838cb78508c' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php', + '786bf90caabc9e09b6ad4cc5ca8f0e30' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php', + '751a5a3f463e4be759be31748b61737c' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php', + '8cff32064859f4559445b89279f3199c' => __DIR__ . '/..' . '/php-http/message/src/filters.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', + 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', + '09fc349b549513bf7f4291502426f919' => __DIR__ . '/..' . '/embed/embed/src/functions.php', + ); + + public static $prefixLengthsPsr4 = array ( + 'S' => + array ( + 'Symfony\\Polyfill\\Php80\\' => 23, + 'Symfony\\Component\\OptionsResolver\\' => 34, + ), + 'P' => + array ( + 'Psr\\Http\\Message\\' => 17, + 'Psr\\Http\\Client\\' => 16, + 'Psr\\Cache\\' => 10, + ), + 'M' => + array ( + 'ML\\JsonLD\\' => 10, + ), + 'L' => + array ( + 'Laminas\\Diactoros\\' => 18, + ), + 'H' => + array ( + 'Http\\Promise\\' => 13, + 'Http\\Message\\MultipartStream\\' => 29, + 'Http\\Message\\' => 13, + 'Http\\Factory\\Guzzle\\' => 20, + 'Http\\Discovery\\' => 15, + 'Http\\Client\\Common\\Plugin\\' => 26, + 'Http\\Client\\Common\\' => 19, + 'Http\\Client\\' => 12, + 'HtmlParser\\' => 11, + ), + 'G' => + array ( + 'GuzzleHttp\\Psr7\\' => 16, + 'GuzzleHttp\\Promise\\' => 19, + 'GuzzleHttp\\' => 11, + 'Grandel\\' => 8, + 'Github\\' => 7, + ), + 'E' => + array ( + 'Embed\\' => 6, + ), + 'C' => + array ( + 'Composer\\CaBundle\\' => 18, + 'Clue\\StreamFilter\\' => 18, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'Symfony\\Polyfill\\Php80\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', + ), + 'Symfony\\Component\\OptionsResolver\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/options-resolver', + ), + 'Psr\\Http\\Message\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/http-factory/src', + 1 => __DIR__ . '/..' . '/psr/http-message/src', + ), + 'Psr\\Http\\Client\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/http-client/src', + ), + 'Psr\\Cache\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/cache/src', + ), + 'ML\\JsonLD\\' => + array ( + 0 => __DIR__ . '/..' . '/ml/json-ld', + ), + 'Laminas\\Diactoros\\' => + array ( + 0 => __DIR__ . '/..' . '/laminas/laminas-diactoros/src', + ), + 'Http\\Promise\\' => + array ( + 0 => __DIR__ . '/..' . '/php-http/promise/src', + ), + 'Http\\Message\\MultipartStream\\' => + array ( + 0 => __DIR__ . '/..' . '/php-http/multipart-stream-builder/src', + ), + 'Http\\Message\\' => + array ( + 0 => __DIR__ . '/..' . '/php-http/message/src', + 1 => __DIR__ . '/..' . '/php-http/message-factory/src', + ), + 'Http\\Factory\\Guzzle\\' => + array ( + 0 => __DIR__ . '/..' . '/http-interop/http-factory-guzzle/src', + ), + 'Http\\Discovery\\' => + array ( + 0 => __DIR__ . '/..' . '/php-http/discovery/src', + ), + 'Http\\Client\\Common\\Plugin\\' => + array ( + 0 => __DIR__ . '/..' . '/php-http/cache-plugin/src', + ), + 'Http\\Client\\Common\\' => + array ( + 0 => __DIR__ . '/..' . '/php-http/client-common/src', + ), + 'Http\\Client\\' => + array ( + 0 => __DIR__ . '/..' . '/php-http/httplug/src', + ), + 'HtmlParser\\' => + array ( + 0 => __DIR__ . '/..' . '/oscarotero/html-parser/src', + ), + 'GuzzleHttp\\Psr7\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', + ), + 'GuzzleHttp\\Promise\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/promises/src', + ), + 'GuzzleHttp\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src', + ), + 'Grandel\\' => + array ( + 0 => __DIR__ . '/..' . '/grandel/include-directory/src', + ), + 'Github\\' => + array ( + 0 => __DIR__ . '/..' . '/knplabs/github-api/lib/Github', + ), + 'Embed\\' => + array ( + 0 => __DIR__ . '/..' . '/embed/embed/src', + ), + 'Composer\\CaBundle\\' => + array ( + 0 => __DIR__ . '/..' . '/composer/ca-bundle/src', + ), + 'Clue\\StreamFilter\\' => + array ( + 0 => __DIR__ . '/..' . '/clue/stream-filter/src', + ), + ); + + public static $prefixesPsr0 = array ( + 'M' => + array ( + 'ML\\IRI' => + array ( + 0 => __DIR__ . '/..' . '/ml/iri', + ), + ), + ); + + public static $classMap = array ( + 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', + 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', + 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1::$prefixDirsPsr4; + $loader->prefixesPsr0 = ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1::$prefixesPsr0; + $loader->classMap = ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/vendor/composer/ca-bundle/LICENSE b/vendor/composer/ca-bundle/LICENSE new file mode 100644 index 00000000..c5b5220e --- /dev/null +++ b/vendor/composer/ca-bundle/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2016 Composer + +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/composer/ca-bundle/README.md b/vendor/composer/ca-bundle/README.md new file mode 100644 index 00000000..d8205ec5 --- /dev/null +++ b/vendor/composer/ca-bundle/README.md @@ -0,0 +1,85 @@ +composer/ca-bundle +================== + +Small utility library that lets you find a path to the system CA bundle, +and includes a fallback to the Mozilla CA bundle. + +Originally written as part of [composer/composer](https://github.com/composer/composer), +now extracted and made available as a stand-alone library. + + +Installation +------------ + +Install the latest version with: + +```bash +$ composer require composer/ca-bundle +``` + + +Requirements +------------ + +* PHP 5.3.2 is required but using the latest version of PHP is highly recommended. + + +Basic usage +----------- + +### `Composer\CaBundle\CaBundle` + +- `CaBundle::getSystemCaRootBundlePath()`: Returns the system CA bundle path, or a path to the bundled one as fallback +- `CaBundle::getBundledCaBundlePath()`: Returns the path to the bundled CA file +- `CaBundle::validateCaFile($filename)`: Validates a CA file using openssl_x509_parse only if it is safe to use +- `CaBundle::isOpensslParseSafe()`: Test if it is safe to use the PHP function openssl_x509_parse() +- `CaBundle::reset()`: Resets the static caches + + +#### To use with curl + +```php +$curl = curl_init("https://example.org/"); + +$caPathOrFile = \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath(); +if (is_dir($caPathOrFile)) { + curl_setopt($curl, CURLOPT_CAPATH, $caPathOrFile); +} else { + curl_setopt($curl, CURLOPT_CAINFO, $caPathOrFile); +} + +$result = curl_exec($curl); +``` + +#### To use with php streams + +```php +$opts = array( + 'http' => array( + 'method' => "GET" + ) +); + +$caPathOrFile = \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath(); +if (is_dir($caPathOrFile)) { + $opts['ssl']['capath'] = $caPathOrFile; +} else { + $opts['ssl']['cafile'] = $caPathOrFile; +} + +$context = stream_context_create($opts); +$result = file_get_contents('https://example.com', false, $context); +``` + +#### To use with Guzzle + +```php +$client = new \GuzzleHttp\Client([ + \GuzzleHttp\RequestOptions::VERIFY => \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath() +]); +``` + +License +------- + +composer/ca-bundle is licensed under the MIT License, see the LICENSE file for details. diff --git a/vendor/composer/ca-bundle/composer.json b/vendor/composer/ca-bundle/composer.json new file mode 100644 index 00000000..ed6a1b36 --- /dev/null +++ b/vendor/composer/ca-bundle/composer.json @@ -0,0 +1,54 @@ +{ + "name": "composer/ca-bundle", + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "type": "library", + "license": "MIT", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.2 || ^5", + "phpstan/phpstan": "^0.12.55", + "psr/log": "^1.0", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Composer\\CaBundle\\": "tests" + } + }, + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "scripts": { + "test": "SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 vendor/bin/simple-phpunit", + "phpstan": "vendor/bin/phpstan analyse" + } +} diff --git a/vendor/composer/ca-bundle/res/cacert.pem b/vendor/composer/ca-bundle/res/cacert.pem new file mode 100644 index 00000000..0bf312fe --- /dev/null +++ b/vendor/composer/ca-bundle/res/cacert.pem @@ -0,0 +1,3232 @@ +## +## Bundle of CA Root Certificates +## +## Certificate data from Mozilla as of: Tue Oct 26 03:12:05 2021 GMT +## +## This is a bundle of X.509 certificates of public Certificate Authorities +## (CA). These were automatically extracted from Mozilla's root certificates +## file (certdata.txt). This file can be found in the mozilla source tree: +## https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt +## +## It contains the certificates in PEM format and therefore +## can be directly used with curl / libcurl / php_curl, or with +## an Apache+mod_ssl webserver for SSL client authentication. +## Just configure this file as the SSLCACertificateFile. +## +## Conversion done with mk-ca-bundle.pl version 1.28. +## SHA256: bb36818a81feaa4cca61101e6d6276cd09e972efcb08112dfed846918ca41d7f +## + + +GlobalSign Root CA +================== +-----BEGIN CERTIFICATE----- +MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx +GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMT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rBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu +01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7 +9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 +TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== +-----END CERTIFICATE----- + +Entrust.net Premium 2048 Secure Server CA +========================================= +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u +ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp +bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV +BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx +NzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 +d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl +MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u +ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL +Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr +hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW +nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi +VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo0IwQDAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJ +KoZIhvcNAQEFBQADggEBADubj1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPy +T/4xmf3IDExoU8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf +zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5bu/8j72gZyxKT +J1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+bYQLCIt+jerXmCHG8+c8eS9e +nNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE= +-----END CERTIFICATE----- + +Baltimore CyberTrust Root +========================= +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE +ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li +ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC +SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs +dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME +uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB +UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C +G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9 +XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr +l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI +VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB +BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh +cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5 +hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa +Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H +RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp +-----END CERTIFICATE----- + +Entrust Root Certification Authority +==================================== +-----BEGIN CERTIFICATE----- +MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV +BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMga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To0LjADAgSQMA0GCSqGSIb3DQEBBQUA +A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9tO1KzKtvn1ISM +Y/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6ZuaAGAT/3B+XxFNSRuzFVJ7yVTa +v52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTS +W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0 +tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8 +-----END CERTIFICATE----- + +Comodo AAA Services root +======================== +-----BEGIN CERTIFICATE----- +MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS +R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg +TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw +MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl +c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV +BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG +C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs +i14HZ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ZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2fBluornFdLwUv +Z+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzng/iN/Ae42l9NLmeyhP3ZRPx3 +UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2BlfF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodm +VjB3pjd4M1IQWK4/YY7yarHvGH5KWWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK ++JDSV6IZUaUtl0HaB0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrW +IozchLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPRTUIZ3Ph1 +WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWDmbA4CD/pXvk1B+TJYm5X +f6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0ZohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II +4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8 +VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u +-----END CERTIFICATE----- + +QuoVadis Root CA 3 +================== +-----BEGIN CERTIFICATE----- +MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT +EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx +OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IEN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iYWwuY29tL2NwczALBgNVHQ8EBAMCAQYwHQYD +VR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4GA1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4 +ywLQoUmkRzBFMQswCQYDVQQGEwJCTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UE +AxMSUXVvVmFkaXMgUm9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZV +qyM07ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSemd1o417+s +hvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd+LJ2w/w4E6oM3kJpK27z +POuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2 +Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadNt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp +8kokUvd0/bpO5qgdAm6xDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC +bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu +g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p +vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr +qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= +-----END CERTIFICATE----- + +Security Communication Root CA +============================== +-----BEGIN CERTIFICATE----- +MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP +U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2C32 +qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j +YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY +vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O +BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o +atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu +MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG +A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim +PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt +I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ +HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI +Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b +vZ8= +-----END CERTIFICATE----- + +Starfield Class 2 CA +==================== +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc +U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg +Q2VydGlmaWNhdGlvbiBBdXRob3J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dheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD +KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3 +QBFGmh95DmK/D5fs4C8fF5Q= +-----END CERTIFICATE----- + +DigiCert Assured ID Root CA +=========================== +-----BEGIN CERTIFICATE----- +MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw +IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx +MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL +ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO +9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy +UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW +/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy +oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf +GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF +66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq +hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc +EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn +SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i +8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe ++o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== +-----END CERTIFICATE----- + +DigiCert Global Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw +HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw +MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 +dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn +TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5 +BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H +4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y +7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB +o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm +8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF +BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr +EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt +tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886 +UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk +CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= +-----END CERTIFICATE----- + +DigiCert High Assurance EV Root CA +================================== +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw +KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw +MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ +MBcGA1UECxMQd3d3LmRpZ2ljZXJ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WyV7lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64 +OfPAeGZe6Drn8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov +L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe645R88a7A3hfm +5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr +44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf +Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m +Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp +mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk +vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf +KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br +NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj +viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ +-----END CERTIFICATE----- + +SwissSign Silver CA - G2 +======================== +-----BEGIN CERTIFICATE----- +MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT +BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZ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V0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn +CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5 +3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc +f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW +-----END CERTIFICATE----- + +COMODO Certification Authority +============================== +-----BEGIN CERTIFICATE----- +MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE +BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG +A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1 +dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb +MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD +T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH ++7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww +xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV +4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA +1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI +rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k +b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC +AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP +OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ +RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc +IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN ++8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ== +-----END CERTIFICATE----- + +Network Solutions Certificate Authority +======================================= +-----BEGIN CERTIFICATE----- +MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG +EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr +IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx +MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5M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ICATE----- + +COMODO ECC Certification Authority +================================== +-----BEGIN CERTIFICATE----- +MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC +R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE +ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix +GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR +Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo +b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X +4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni +wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VG +FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA +U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= +-----END CERTIFICATE----- + +Certigna +======== +-----BEGIN CERTIFICATE----- +MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNVBAYTAkZSMRIw +EAYD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WaDYu5Def131TN3ubY +1gkIl2PlwS6wt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw +WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== +-----END CERTIFICATE----- + +Cybertrust Global Root +====================== +-----BEGIN CERTIFICATE----- +MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li +ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4 +MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD +ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA ++Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW +0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL +AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin +89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT +8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2 +MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G +A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO +lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi +5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2 +hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T +X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW +WL1WMRJOEcgh4LMRkWXbtKaIOM5V +-----END CERTIFICATE----- + +ePKI Root Certification Authority +================================= +-----BEGIN CERTIFICATE----- +MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG +EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg +Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx +MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq +MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs +IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi +lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv +qOx4UXCKXB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PxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IB +AQA+0hyJLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8 +SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0 +x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIlt +vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz +TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD +-----END CERTIFICATE----- + +NetLock Arany (Class Gold) Főtanúsítvány +======================================== +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G +A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610 +dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB +cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx +MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO +ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhbsO6 +c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCR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TIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n +IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1 +ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr +auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh +qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY +V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV +HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i +h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio +l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei +IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps +T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT +c4afU9hDDl3WY4JxHYB0yvbiAmvZWg== +-----END CERTIFICATE----- + +SecureSign RootCA11 +=================== +-----BEGIN CERTIFICATE----- +MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi +SmFwYW4gQ2VydGlmaWNhdGl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WgBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAbBgNVHREE +FDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqGSIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0o +lZMEyL/azXm4Q5DwpL7v8u8hmLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfX +I/OMn74dseGkddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 +tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c2Pm2G2JwCz02 +yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5tHMN1Rq41Bab2XD0h7lbwyYIi +LXpUq3DDfSJlgnCW +-----END CERTIFICATE----- + +GlobalSign Root CA - R3 +======================= +-----BEGIN CERTIFICATE----- +MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMXR2xv +YmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh +bFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT +aWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln +bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWt +iHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsTgHeMCOFJ +0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmmKPZpO/bLyCiR5Z2KYVc3 +rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zdQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjl +OCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2 +xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE +FI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7 +lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8 +EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1E +bddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18 +YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r +kpeDMdmztcpHWD9f +-----END CERTIFICATE----- + +Autoridad de Certificacion Firmaprofesional CIF A62634068 +========================================================= +-----BEGIN CERTIFICATE----- +MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA +BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 +MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw +QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB +NjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDD +Utd9thDIAl6zQyrET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wBEqgLk9am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qk +R71kMrv2JYSiJ0L1ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaP +T481PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS3a/DTg4f +Jl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5kSeTy36LssUzAKh3ntLFl +osS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF3dvd6qJ2gHN99ZwExEWN57kci57q13XR +crHedUTnQn3iV2t93Jm8PYMo6oCTjcVMZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR +saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD +KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi +6Et8Vcad+qMUu2WFbm5PEn4KPJ2V +-----END CERTIFICATE----- + +Izenpe.com +========== +-----BEGIN CERTIFICATE----- +MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYDVQQG +EwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcNMDcxMjEz +MTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMu +QS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ +03rKDx6sp4boFmVqscIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAK +ClaOxdgmlOHZSOEtPtoKct2jmRX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UIBzg/YsfqikuFgba56awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8q +hT/AQKM6WfxZSzwoJNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Cs +g1lwLDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCTVyvehQP5 +aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGkLhObNA5me0mrZJfQRsN5 +nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJbUjWumDqtujWTI6cfSN01RpiyEGjkpTHC +ClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZo +Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z +WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== +-----END CERTIFICATE----- + +Go Daddy Root Certificate Authority - G2 +======================================== +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMu +MTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 +MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 +b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8G +A1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKDE6bFIEMBO4Tx5oVJnyfq +9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD ++qK+ihVqf94Lw7YZFAXK6sOoBJQ7RnwyDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutd +fMh8+7ArU6SSYmlRJQVhGkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMl +NAJWJwGRtDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFDqahQcQZyi27/a9 +BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmXWWcDYfF+OwYxdS2hII5PZYe096ac +vNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r +5N9ss4UXnT3ZJE95kTXWXwTrgIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYV +N8Gb5DKj7Tjo2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO +LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1 +-----END CERTIFICATE----- + +Starfield Root Certificate Authority - G2 +========================================= +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaW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H7PfrHxBy22/L/K +pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZ +c2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 +-----END CERTIFICATE----- + +Starfield Services Root Certificate Authority - G2 +================================================== +-----BEGIN CERTIFICATE----- +MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s +b2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRl +IEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNV +BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxT +dGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2VydmljZXMg +Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20pOsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2 +h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm28xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4Pa +hHQUw2eeBGg6345AWh1KTs9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLP +LJGmpufehRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk6mFB +rMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAwDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMA0GCSqG +SIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMIbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPP +E95Dz+I0swSdHynVv/heyNXBve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTy +xQGjhdByPq1zqwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd +iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn0q23KXB56jza +YyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6 +-----END CERTIFICATE----- + +AffirmTrust Commercial +====================== +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMB4XDTEw +MDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly +bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6Eqdb +DuKPHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yrba0F8PrV +C8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPALMeIrJmqbTFeurCA+ukV6 +BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1yHp52UKqK39c/s4mT6NmgTWvRLpUHhww +MmWd5jyTXlBOeuM61G7MGvv50jeuJCqrVwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNV +HQ4EFgQUnZPGU4teyq8/nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwDQYJKoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYGXUPG +hi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNjvbz4YYCanrHOQnDi +qX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivtZ8SOyUOyXGsViQK8YvxO8rUzqrJv +0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9gN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0kh +sUlHRUe072o0EclNmsxZt9YCnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= +-----END CERTIFICATE----- + +AffirmTrust Networking +====================== +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMB4XDTEw +MDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly +bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SE +Hi3yYJ0wTsyEheIszx6e/jarM3c1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4fqENmS2NuB2OosSw/WDQMKSOyARiqcTtNd56l+0OOF6S +L5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK ++4w1IX2COPKpVJEZNZOUbWo6xbLQu4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmV +BtWVyuEklut89pMFu+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFg +IxpHYoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8GKa1qF60 +g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaORtGdFNrHF+QFlozEJLUb +zxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6eKeC2uAloGRwYQw== +-----END CERTIFICATE----- + +AffirmTrust Premium ECC +======================= +-----BEGIN CERTIFICATE----- +MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV +BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx +MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U +cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ +N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW +BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK +BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X +57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM +eQ== +-----END CERTIFICATE----- + +Certum Trusted Network CA +========================= +-----BEGIN CERTIFICATE----- +MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK +ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy +MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU +ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC +l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J +J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4 +fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0 +cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB +Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw +DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj +jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1 +mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj +Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI +03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= +-----END CERTIFICATE----- + +TWCA Root Certification Authority +================================= +-----BEGIN CERTIFICATE----- +MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJ +VEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQG +EwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NB +IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFEAcK0HMMx +QhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HHK3XLfJ+utdGdIzdjp9xC +oi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeXRfwZVzsrb+RH9JlF/h3x+JejiB03HFyP +4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1r +y+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIB +BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG +9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lC +mtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlW +QtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVY +T0bf+215WfKEIlKuD8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocny +Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== +-----END CERTIFICATE----- + +Security Communication RootCA2 +============================== +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UEChMc +U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkgQ29tbXVuaWNh +dGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoXDTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMC +SlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3Vy +aXR5IENvbW11bmljYXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQ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4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4opvpXY0wfwYD +VR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBodHRwczovL3d3dy5jYXRjZXJ0 +Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5l +dC92ZXJhcnJlbCAwDQYJKoZIhvcNAQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJ +lF7W2u++AVtd0x7Y/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNa +Al6kSBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhyRp/7SNVe +l+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOSAgu+TGbrIP65y7WZf+a2 +E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xlnJ2lYJU6Un/10asIbvPuW/mIPX64b24D +5EI= +-----END CERTIFICATE----- + +Hellenic Academic and Research Institutions RootCA 2011 +======================================================= +-----BEGIN CERTIFICATE----- +MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1IxRDBCBgNVBAoT +O0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9y +aXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z +IFJvb3RDQSAyMDExMB4XDTExMTIwNjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYT +AkdSMUQwQgYDVQQKEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXR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END CERTIFICATE----- + +Actalis Authentication Root CA +============================== +-----BEGIN CERTIFICATE----- +MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UEBhMCSVQxDjAM +BgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UE +AwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDky +MjExMjIwMlowazELMAkGA1UEBhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlz +IFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 +IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNvUTufClrJ +wkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX4ay8IMKx4INRimlNAJZa +by/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9KK3giq0itFZljoZUj5NDKd45RnijMCO6 +zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1f +YVEiVRvjRuPjPdA1YprbrxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2 +oxgkg4YQ51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2Fbe8l +EfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxeKF+w6D9Fz8+vm2/7 +hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4Fv6MGn8i1zeQf1xcGDXqVdFUNaBr8 +EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbnfpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5 +jF66CyCU3nuDuP/jVo23Eek7jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLY +iDrIn3hm7YnzezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt +ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQALe3KHwGCmSUyI +WOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70jsNjLiNmsGe+b7bAEzlgqqI0 +JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDzWochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKx +K3JCaKygvU5a2hi/a5iB0P2avl4VSM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+ +Xlff1ANATIGk0k9jpwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC +4yyXX04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+OkfcvHlXHo +2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7RK4X9p2jIugErsWx0Hbhz +lefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btUZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXem +OR/qnuOf0GZvBeyqdn6/axag67XH/JJULysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9 +vwGYT7JZVEc+NHt4bVaTLnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== +-----END CERTIFICATE----- + +Buypass Class 2 Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQY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605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF +AAOCAgEAU18h9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s +A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3tOluwlN5E40EI +osHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo+fsicdl9sz1Gv7SEr5AcD48S +aq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYd +DnkM/crqJIByw5c/8nerQyIKx+u2DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWD +LfJ6v9r9jv6ly0UsH8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0 +oyLQI+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK75t98biGC +wWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h3PFaTWwyI0PurKju7koS +CTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPzY11aWOIv4x3kqdbQCtCev9eBCfHJxyYN +rJgWVqA= +-----END CERTIFICATE----- + +Buypass Class 3 Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU +QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMyBSb290IENBMB4X +DTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFowTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 +eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXN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l13nIoUE9Q2HJLw5QY33KbmkJs4j1xrG0aG +Q0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsaO5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8 +ZORK15FTAaggiG6cX0S5y2CBNOxv033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2 +KSb12tjE8nVhz36udmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz +6MkEkbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg413OEMXbug +UZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvDu79leNKGef9JOxqDDPDe +eOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq4/g7u9xN12TyUb7mqqta6THuBrxzvxNi +Cp/HuZc= +-----END CERTIFICATE----- + +T-TeleSec GlobalRoot Class 3 +============================ +-----BEGIN CERTIFICATE----- +MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM +IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU +cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgx +MDAxMTAyOTU2WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz +dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD +ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN8ELg63iIVl6bmlQdTQyK +9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/RLyTPWGrTs0NvvAgJ1gORH8EGoel15YU +NpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZF +iP0Zf3WHHx+xGwpzJFu5ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W +0eDrXltMEnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGjQjBA +MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1A/d2O2GCahKqGFPr +AyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOyWL6ukK2YJ5f+AbGwUgC4TeQbIXQb +fsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzT +ucpH9sry9uetuUg/vBa3wW306gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7h +P0HHRwA11fXT91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml +e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4pTpPDpFQUWw== +-----END CERTIFICATE----- + +D-TRUST Root Class 3 CA 2 2009 +============================== +-----BEGIN CERTIFICATE----- +MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQK +DAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTAe +Fw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NThaME0xCzAJBgNVB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kj2wTZ51xY/GXUl77M/C4KzCUqNQT4YJEV +dT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8PIWmawomDeCTmGCufsYkl4ph +X5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3YJohw1+qRzT65ysCQblrGXnRl11z+o+I= +-----END CERTIFICATE----- + +D-TRUST Root Class 3 CA 2 EV 2009 +================================= +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK +DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw +OTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUwNDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK +DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw +OTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfS +egpnljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM03TP1YtHh +zRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6ZqQTMFexgaDbtCHu39b+T +7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lRp75mpoo6Kr3HGrHhFPC+Oh25z1uxav60 +sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure35 +11H3a6UCAwEAAaOCASQwggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyv +cop9NteaHNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGH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qJdI +zshNy/MGz19qCkKxHh53L46g5pIOBvwFItIm4TFRfTLcDwIDAQABoyMwITAOBgNVHQ8BAf8EBAMC +AQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAXzSBdu+WHdXltdkCY4QWwa6g +cFGn90xHNcgL1yg9iXHZqjNB6hQbbCEAwGxCGX6faVsgQt+i0trEfJdLjbDorMjupWkEmQqSpqsn +LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WFH6vPNOw/KP4M +8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNoRI2T9GRwoD2dKAXDOXC4Ynsg +/eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlg +lPx4mI88k1HtQJAH32RjJMtOcQWh15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryP +A9gK8kxkRr05YuWW6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3m +i4TWnsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5jwa19hAM8 +EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWzaGHQRiapIVJpLesux+t3 +zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmyKwbQBM0= +-----END CERTIFICATE----- + +TeliaSonera Root CA v1 +====================== +-----BEGIN CERTIFICATE----- +MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAwNzEUMBIGA1UE +CgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJvb3QgQ0EgdjEwHhcNMDcxMDE4 +MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MR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xc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1TjTQpgcmLNkQfW +pb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBedY2gea+zDTYa4EzAvXUYNR0PV +G6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpc +c41teyWRyu5FrgZLAMzTsVlQ2jqIOylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOT +JsjrDNYmiLbAJM+7vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2 +qReWt88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcnHL/EVlP6 +Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVxSK236thZiNSQvxaz2ems +WWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= +-----END CERTIFICATE----- + +E-Tugra Certification Authority +=============================== +-----BEGIN CERTIFICATE----- +MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNVBAYTAlRSMQ8w +DQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamls +ZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN +ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMw +NTEyMDk0OFoXDTIzMDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmEx +QDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIH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d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAK +kEh47U6YA5n+KGCRHTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jO +XKqYGwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c77NCR807 +VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3+GbHeJAAFS6LrVE1Uweo +a2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WKvJUawSg5TB9D0pH0clmKuVb8P7Sd2nCc +dlqMQ1DujjByTd//SffGqWfZbawCEeI6FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEV +KV0jq9BgoRJP3vQXzTLlyb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gT +Dx4JnW2PAJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpDy4Q0 +8ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8dNL/+I5c30jn6PQ0G +C7TbO6Orb1wdtn7os4I07QZcJA== +-----END CERTIFICATE----- + +T-TeleSec GlobalRoot Class 2 +============================ +-----BEGIN CERTIFICATE----- +MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM +IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU +cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgx +MDAxMTA0MDE0WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz +dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD +ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUdAqSzm1nzHoqvNK38DcLZ +SBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiCFoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/F +vudocP05l03Sx5iRUKrERLMjfTlH6VJi1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx970 +2cu+fjOlbpSD8DT6IavqjnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGV +WOHAD3bZwI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGjQjBA +MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/WSA2AHmgoCJrjNXy +YdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhyNsZt+U2e+iKo4YFWz827n+qrkRk4 +r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPACuvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNf +vNoBYimipidx5joifsFvHZVwIEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR +3p1m0IvVVGb6g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN +9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlPBSeOE6Fuwg== +-----END CERTIFICATE----- + +Atos TrustedRoot 2011 +===================== +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcN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XSthfbZxbGL0eUQMk1f +iyA6PEkfM4VZDdvLCXVDaXP7a3F98N/ETH3Goy7IlXnLc6KOTk0k+17kBL5yG6YnLUlamXrXXAkg +t3+UuU/xDRxeiEIbEbfnkduebPRq34wGmAOtzCjvpUfzUwIDAQABo0IwQDAPBgNVHRMBAf8EBTAD +AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUo5fW816iEOGrRZ88F2Q87gFwnMwwDQYJKoZI +hvcNAQELBQADggIBABj6W3X8PnrHX3fHyt/PX8MSxEBd1DKquGrX1RUVRpgjpeaQWxiZTOOtQqOC +MTaIzen7xASWSIsBx40Bz1szBpZGZnQdT+3Btrm0DWHMY37XLneMlhwqI2hrhVd2cDMT/uFPpiN3 +GPoajOi9ZcnPP/TJF9zrx7zABC4tRi9pZsMbj/7sPtPKlL92CiUNqXsCHKnQO18LwIE6PWThv6ct +Tr1NxNgpxiIY0MWscgKCP6o6ojoilzHdCGPDdRS5YCgtW2jgFqlmgiNR9etT2DGbe+m3nUvriBbP ++V04ikkwj+3x6xn0dxoxGE1nVGwvb2X52z3sIexe9PSLymBlVNFxZPT5pqOBMzYzcfCkeF9OrYMh +3jRJjehZrJ3ydlo28hP0r+AJx2EqbPfgna67hkooby7utHnNkDPDs3b69fBsnQGQ+p6Q9pxyz0fa +wx/kNSBT8lTR32GDpgLiJTjehTItXnOQUl1CxM49S+H5GYQd1aJQzEH7QRTDvdbJWqNjZgKAvQU6 +O0ec7AAmTPWIUb+oI38YB7AL7YsmoWTTYUrrXJ/es69nA7Mf3W1daWhpq1467HxpvMc7hU6eFbm0 +FU/DlXpY18ls6Wy58yljXrQs8C097Vpl4KlbQMJImYFtnh8GKjwStIsPm6Ik8KaN1nrgS7ZklmOV +hMJKzRwuJIczYOXD +-----END CERTIFICATE----- + +QuoVadis Root CA 2 G3 +===================== +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcN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AWzKNhxnQT5WvvoxXqA/4Ti2Tk08HS6IT7SdEQ +TXlm66r99I0xHnAUrdzeZxNMgRVhvLfZkXdxGYFgu/BYpbWcC/ePIlUnwEsBbTuZDdQdm2NnL9Du +DcpmvJRPpq3t/O5jrFc/ZSXPsoaP0Aj/uHYUbt7lJ+yreLVTubY/6CD50qi+YUbKh4yE8/nxoGib +Ih6BJpsQBJFxwAYf3KDTuVan45gtf4Od34wrnDKOMpTwATwiKp9Dwi7DmDkHOHv8XgBCH/MyJnmD +hPbl8MFREsALHgQjDFSlTC9JxUrRtm5gDWv8a4uFJGS3iQ6rJUdbPM9+Sb3H6QrG2vd+DhcI00iX +0HGS8A85PjRqHH3Y8iKuu2n0M7SmSFXRDw4m6Oy2Cy2nhTXN/VnIn9HNPlopNLk9hM6xZdRZkZFW +dSHBd575euFgndOtBBj0fOtek49TSiIp+EgrPk2GrFt/ywaZWWDYWGWVjUTR939+J399roD1B0y2 +PpxxVJkES/1Y+Zj0 +-----END CERTIFICATE----- + +DigiCert Assured ID Root G2 +=========================== +-----BEGIN CERTIFICATE----- +MIIDljCCAn6gAwIBAgIQC5McOtY5Z+pnI7/Dr5r0SzANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw +IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIwHhcNMTMwODAxMTIwMDAwWhcNMzgw +MTE1MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL +ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ5ygvUj82ckmIkzTz+GoeMVSAn61UQbVH +35ao1K+ALbkKz3X9iaV9JPrjIgwrvJUXCzO/GU1BBpAAvQxNEP4HteccbiJVMWWXvdMX0h5i89vq +bFCMP4QMls+3ywPgym2hFEwbid3tALBSfK+RbLE4E9HpEgjAALAcKxHad3A2m67OeYfcgnDmCXRw +VWmvo2ifv922ebPynXApVfSr/5Vh88lAbx3RvpO704gqu52/clpWcTs/1PPRCv4o76Pu2ZmvA9OP +YLfykqGxvYmJHzDNw6YuYjOuFgJ3RFrngQo8p0Quebg/BLxcoIfhG69Rjs3sLPr4/m3wOnyqi+Rn +lTGNAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTO +w0q5mVXyuNtgv6l+vVa1lzan1jANBgkqhkiG9w0BAQsFAAOCAQEAyqVVjOPIQW5pJ6d1Ee88hjZv +0p3GeDgdaZaikmkuOGybfQTUiaWxMTeKySHMq2zNixya1r9I0jJmwYrA8y8678Dj1JGG0VDjA9tz +d29KOVPt3ibHtX2vK0LRdWLjSisCx1BL4GnilmwORGYQRI+tBev4eaymG+g3NJ1TyWGqolKvSnAW +hsI6yLETcDbYz+70CjTVW0z9B5yiutkBclzzTcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0M +jomZmWzwPDCvON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwo +IhNzbM8m9Yop5w== +-----END CERTIFICATE----- + +DigiCert Assured ID Root G3 +=========================== +-----BEGIN CERTIFICATE----- +MIICRjCCAc2gAwIBAgIQC6Fa+h3foLVJRK/NJKBs7DAKBggqhkjOPQQDAzBlMQswCQYDVQQGEwJV +UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQwIgYD +VQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1 +MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwdjAQ +BgcqhkjOPQIBBgUrgQQAIgNiAAQZ57ysRGXtzbg/WPuNsVepRC0FFfLvC/8QdJ+1YlJfZn4f5dwb +RXkLzMZTCp2NXQLZqVneAlr2lSoOjThKiknGvMYDOAdfVdp+CW7if17QRSAPWXYQ1qAk8C3eNvJs +KTmjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTL0L2p4ZgF +UaFNN6KDec6NHSrkhDAKBggqhkjOPQQDAwNnADBkAjAlpIFFAmsSS3V0T8gj43DydXLefInwz5Fy +YZ5eEJJZVrmDxxDnOOlYJjZ91eQ0hjkCMHw2U/Aw5WJjOpnitqM7mzT6HtoQknFekROn3aRukswy +1vUhZscv6pZjamVFkpUBtA== +-----END CERTIFICATE----- + +DigiCert Global Root G2 +======================= +-----BEGIN CERTIFICATE----- +MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw +HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUx +MjAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 +dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI2/Ou8jqJ +kTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx1x7e/dfgy5SDN67sH0NO +3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQq2EGnI/yuum06ZIya7XzV+hdG82MHauV +BJVJ8zUtluNJbd134/tJS7SsVQepj5WztCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyM +UNGPHgm+F6HmIcr9g+UQvIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQAB +o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV5uNu +5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY1Yl9PMWLSn/pvtsr +F9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4NeF22d+mQrvHRAiGfzZ0JFrabA0U +WTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NGFdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBH +QRFXGU7Aj64GxJUTFy8bJZ918rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/ +iyK5S9kJRaTepLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl +MrY= +-----END CERTIFICATE----- + +DigiCert Global Root G3 +======================= +-----BEGIN CERTIFICATE----- +MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQswCQYDVQQGEwJV +UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAwHgYD +VQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMzAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAw +MDBaMGExCzAJB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KeWjzaIgQdfRnGTZ6iah +ixTXTBmyUEFxPT9NcCOGDErcgdLMMpSEDQgJlxxPwO5rIHQw0uA5NBCFIRUBCOhVMt5xSdkoF1BN +5r5N0XWs0Mr7QbhDparTwwVETyw2m+L64kW4I1NsBm9nVX9GtUw/bihaeSbSpKhil9Ie4u1Ki7wb +/UdKDd9nZn6yW0HQO+T0O/QEY+nvwlQAUaCKKsnOeMzV6ocEGLPOr0mIr/OSmbaz5mEP0oUA51Aa +5BuVnRmhuZyxm7EAHu/QD09CbMkKvO5D+jpxpchNJqU1/YldvIViHTLSoCtU7ZpXwdv6EM8Zt4tK +G48BtieVU+i2iW1bvGjUI+iLUaJW+fCmgKDWHrO8Dw9TdSmq6hN35N6MgSGtBxBHEa2HPQfRdbzP +82Z+ +-----END CERTIFICATE----- + +COMODO RSA Certification Authority +================================== +-----BEGIN CERTIFICATE----- +MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCBhTELMAkGA1UE +BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG +A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwHhcNMTAwMTE5MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMC +R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE +ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCR6FSS0gpWsawNJN3Fz0Rn +dJkrN6N9I3AAcbxT38T6KhKPS38QVr2fcHK3YX/JSw8Xpz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I7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiKboHGhfKp +pC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmckejkk9u+UJueBPSZI9FoJA +zMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yLS0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHq +ZJx64SIDqZxubw5lT2yHh17zbqD5daWbQOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk52 +7RH89elWsn2/x20Kk4yl0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7I +LaZRfyHBNVOFBkpdn627G190 +-----END CERTIFICATE----- + +USERTrust RSA Certification Authority +===================================== +-----BEGIN CERTIFICATE----- +MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCBiDELMAkGA1UE +BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK +ExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UE +BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK +ExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCAEmUXNg7D2wiz +0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2j +Y0K2dvKpOyuR+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ya7b6NnJSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZXHlKYC6SQK5MNyosycdi +yA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9c +J2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRBVXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGw +sAvgnEzDHNb842m1R0aBL6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gx +Q+6IHdfGjjxDah2nGN59PRbxYvnKkKj9 +-----END CERTIFICATE----- + +USERTrust ECC Certification Authority +===================================== +-----BEGIN CERTIFICATE----- +MIICjzCCAhWgAwIBAgIQXIuZxVqUxdJxVt7NiYDMJjAKBggqhkjOPQQDAzCBiDELMAkGA1UEBhMC +VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU +aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMC +VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU +aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQarFRaqfloI+d61SRvU8Za2EurxtW2 +0eZzca7dnNYMYf3boIkDuAUU7FfO7l0/4iGzzvfUinngo4N+LZfQYcTxmdwlkWOrfzCjtHDix6Ez +nPO/LlxTsV+zfTJ/ijTjeXmjQjBAMB0GA1UdDgQWBBQ64QmG1M8ZwpZ2dEl23OA1xmNjmjAOBgNV +HQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjA2Z6EWCNzklwBB +HU6+4WMBzzuqQhFkoJ2UOQIReVx7Hfpkue4WQrO/isIJxOzksU0CMQDpKmFHjFJKS04YcPbWRNZu +9YO6bVi9JNlWSOrvxKJGgYhqOkbRqZtNyWHa0V1Xahg= +-----END CERTIFICATE----- + +GlobalSign ECC Root CA - R4 +=========================== +-----BEGIN CERTIFICATE----- +MIIB4TCCAYegAwIBAgIRKjikHJYKBN5CsiilC+g0mAIwCgYIKoZIzj0EAwIwUDEkMCIGA1UECxMb +R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD +EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb +R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD +EwpHbG9iYWxTaWduMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuMZ5049sJQ6fLjkZHAOkrprl +OQcJFspjsbmG+IpXwVfOQvpzofdlQv8ewQCybnMO/8ch5RikqtlxP6jUuc6MHaNCMEAwDgYDVR0P +AQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFFSwe61FuOJAf/sKbvu+M8k8o4TV +MAoGCCqGSM49BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGXkPoUVy0D7O48027KqGx2vKLeuwIgJ6iF +JzWbVsaj8kfSt24bAgAXqmemFZHe+pTsewv4n4Q= +-----END CERTIFICATE----- + +GlobalSign ECC Root CA - R5 +=========================== +-----BEGIN CERTIFICATE----- +MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEkMCIGA1UECxMb +R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD +EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb +R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD +EwpHbG9iYWxTaWduMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9Xb/pOdEh+J8LttV7HpI6 +SFkc8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwzocWdTaRvQZU4f8kehOvRnkmS +h5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAd +BgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYIKoZIzj0EAwMDaAAwZQIxAOVpEslu28Yx +uglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7 +yFz9SO8NdCKoCOJuxUnOxwy8p2Fp8fc74SrL+SvzZpA3 +-----END CERTIFICATE----- + +Staat der Nederlanden EV Root CA +================================ +-----BEGIN CERTIFICATE----- +MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJOTDEeMBwGA1UE +CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFhdCBkZXIgTmVkZXJsYW5kZW4g +RVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0yMjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5M +MR4wHAYDVQQKDBVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xKTAnBgNVBAMMIFN0YWF0IGRlciBOZWRl +cmx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MMgsT7B/Zq +5SWEXwbKwYY5EdtYzXc7LMJMD16a4/CrPmEbUCTCwPTxGfARKbalGAKb12NMcIxHowNDXLldRqAN +b/9Zjr7dn3LDWyvfjFvO5QxGbJKyCqNMVEIYFRIYvdr8unRu/8G2oGTYqV9Vrp9canaW2HNnh/tN +f1zuacpzEPuKqf2evTY4SUmH9A4U8OmHuD+nT3pajnnUk+S7aFKErGzp85hwVXIy+TSrK0m1zSBi +5Dp6Z2Orltxtrpfs/J92VoguZs9btsmksNcFuuEnL5O7Jiqik7Ab846+HUCjuTaPPoIaGl6I6lD4 +WeKDRikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeLeG9QgkRQP2YGiqtDhFZK +DyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8FVdMpEbB4IMeDExNH08GGeL5qPQ6gqGy +eUN51q1veieQA6TqJIc/2b3Z6fJfUEkc7uzXLg== +-----END CERTIFICATE----- + +IdenTrust Commercial Root CA 1 +============================== +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBKMQswCQYDVQQG +EwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBS +b290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQwMTE2MTgxMjIzWjBKMQswCQYDVQQGEwJVUzES +MBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBSb290IENB +IDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCnUBneP5k91DNG8W9RYYKyqU+PZ4ld +hNlT3Qwo2dfw/66VQ3KZ+bVdfIrBQuExUHTRgQ18zZshq0PirK1ehm7zCYofWjK9ouuU+ehcCuz/ +mNKvcbO0U59Oh++SvL3sTzIwiEsXXlfEU8L2ApeN2WIr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vrX/hMUpu09lEpCdNTDd1lzzY9GvlU47/ro +kTLql1gEIt44w8y8bckzOmoKaT+gyOpyj4xjhiO9bTyWnpXgSUyqorkqG5w2gXjtw+hG4iZZRHUe +2XWJUc0QhJ1hYMtd+ZciTY6Y5uN/9lu7rs3KSoFrXgvzUeF0K+l+J6fZmUlO+KWA2yUPHGNiiskz +Z2s8EIPGrd6ozRaOjfAHN3Gf8qv8QfXBi+wAN10J5U6A7/qxXDgGpRtK4dw4LTzcqx+QGtVKnO7R +cGzM7vRX+Bi6hG6H +-----END CERTIFICATE----- + +IdenTrust Public Sector Root CA 1 +================================= +-----BEGIN CERTIFICATE----- +MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBNMQswCQYDVQQG +EwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3Rv +ciBSb290IENBIDEwHhcNMTQwMTE2MTc1MzMyWhcNMzQwMTE2MTc1MzMyWjBNMQswCQYDVQQGEwJV +UzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3RvciBS +b290IENBIDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2IpT8pEiv6EdrCvsnduTy +P4o7ekosMSqMjbCpwzFrqHd2hCa2rIFCDQjrVVi7evi8ZX3yoG2LqEfpYnYeEe4IFNGyRBb06tD6 +Hi9e28tzQa68ALBKK0CyrOE7S8ItneShm+waOh7wCLPQ5CQ1B5+ctMlSbdsHyo+1W/CD80/HLaXI +rcuVIKQxKFdYWuSNG5qrng0M8gozOSI5Cpcu81N3uURF/YTLNiCBWS2ab21ISGHKTN9T0a9SvESf +qy9rg3LvdYDaBjMbXcjaY8ZNzaxmMc3R3j6HEDbhuaR672BQssvKplbgN6+rNBM5Jeg5ZuSYeqoS +mJxZZoY+rfGwyj4GD3vwEUs3oERte8uoj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/q4/i6jC8UDfv8Ue1fXwsBOxonbRJRBD0ckscZOf85muQ +3Wl9af0AVqW3rLatt8o+Ae+c +-----END CERTIFICATE----- + +Entrust Root Certification Authority - G2 +========================================= +-----BEGIN CERTIFICATE----- +MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMCVVMxFjAUBgNV +BAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVy +bXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ug +b25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIw +HhcNMDkwNzA3MTcyNTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1UEBhMCVVMxFjAUBgNVBAoT +DUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMx +OTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25s +eTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIwggEi +MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6hLZy254Ma+KZ6TABp3bqMriVQRrJ2mFOWHLP +/vaCeb9zYQYKpSfYs1/TRU4cctZOMvJyig/3gxnQaoCAAEUesMfnmr8SVycco2gvCoe9amsOXmXz +HHfV1IWNcCG0szLni6LVhjkCsbjSR87kyUnEO6fe+1R9V77w6G7CebI6C1XiUJgWMhNcL3hWwcKU +s/Ja5CeanyTXxuzQmyWC48zCxEXFjJd6BmsqEZ+pCm5IO2/b1BEZQvePB7/1U1+cPvQXLOZprE4y +TGJ36rfo5bs0vBmLrpxR57d+tVOxMyLlbc9wPBr64ptntoP0jaWvYkxN4FisZDQSA/i2jZRjJKRx +AgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqciZ6 +0B7vfec7aVHUbI2fkBJmqzANBgkqhkiG9w0BAQsFAAOCAQEAeZ8dlsa2eT8ijYfThwMEYGprmi5Z +iXMRrEPR9RP/jTkrwPK9T3CMqS/qF8QLVJ7UG5aYMzyorWKiAHarWWluBh1+xLlEjZivEtRh2woZ +Rkfz6/djwUAFQKXSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v1fN2D807iDgi +nWyTmsQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4RnAuknZoh8/CbCzB428Hch0P+ +vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmHVHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xO +e4pIb4tF9g== +-----END CERTIFICATE----- + +Entrust Root Certification Authority - EC1 +========================================== +-----BEGIN CERTIFICATE----- +MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELMAkGA1UEBhMCVVMx +FjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVn +YWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXpl +ZCB1c2Ugb25seTEzMDEGA1UEAxMqRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +IC0gRUMxMB4XDTEyMTIxODE1MjUzNloXDTM3MTIxODE1NTUzNlowgb8xCzAJBgNVBAYTAlVTMRYw +FAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2Fs +LXRlcm1zMTkwNwYDV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rDMlI1Dlb4pd19xIsNER9Tyx6yF7Zod1rg1MvIB671Oi6ON7fQAUtDKXeMOZePglr4UeWJoBjn +aH9dCi77o0cOPaYjesYBx4/IXr9tgFa+iiS6M+qf4TIRnvHST4D2G0CvOJ4RUHlzEhLN5mydLIhy +PDCBBpEi6lmt2hkuIsKNuYyH4Ga8cyNfIWRjgEj1oDwYPZTISEEdQLpe/v5WOaHIz16eGWRGENoX +kbcFgKyLmZJ956LYBws2J+dIeWCKw9cTXPhyQN9Ky8+ZAAoACxGV2lZFA4gKn2fQ1XmxqI1AbQ3C +ekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63su +-----END CERTIFICATE----- + +OISTE WISeKey Global Root GB CA +=============================== +-----BEGIN CERTIFICATE----- +MIIDtTCCAp2gAwIBAgIQdrEgUnTwhYdGs/gjGvbCwDANBgkqhkiG9w0BAQsFADBtMQswCQYDVQQG +EwJDSDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNl +ZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQiBDQTAeFw0xNDEyMDExNTAw +MzJaFw0zOTEyMDExNTEwMzFaMG0xCzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYD +VQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEds +b2JhbCBSb290IEdCIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2Be3HEokKtaX +scriHvt9OO+Y9bI5mE4nuBFde9IllIiCFSZqGzG7qFshISvYD06fWvGxWuR51jIjK+FTzJlFXHtP +rby/h0oLS5daqPZI7H17Dc0hBt+eFf1Biki3IPShehtX1F1Q/7pn2COZH8g/497/b1t3sWtuuMlk +9+HKQU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SqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC3vD5Q +qEvNQLXOYeeWyrSh2gwisPq1e3YAd4wLz32ohswmUeQgPYUM1ljj5/QqGJ3a0a4m7utT3PSQ1hNK +DJA8w/Ta0o4NkjrcsbH/ON7Dui1fgLkCvUqdGw+0w8LBZwPd3BucPbOw3gAeqDRHu5rr/gsUvTaE +2g0gv/pby6kWIK05YO4vdbbnl5z5Pv1+TW9NL++IDWr63fE9biCloBK0TXC5ztdyO4mTp4CEHCdJ +ckm1/zuVnsHMyAHs6A6KCpbns6aH5db5BSsNl0BwPLqsdVqc1U2dAgrSS5tmS0YHF2Wtn2yIANwi +ieDhZNRnvDF5YTy7ykHNXGoAyDw4jlivAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0P +AQH/BAQDAgEGMB0GA1UdDgQWBBQuFqlKGLXLzPVvUPMjX/hd56zwyDANBgkqhkiG9w0BAQsFAAOC +AQEAtXP4A9xZWx126aMqe5Aosk3AM0+qmrHUuOQn/6mWmc5G4G18TKI4pAZw8PRBEew/R40/cof5 +O/2kbytTAOD/OblqBw7rHRz2onKQy4I9EYKL0rufKq8h5mOGnXkZ7/e7DDWQw4rtTw/1zBLZpD67 +oPwglV9PJi8RI4NOdQcPv5vRtB3pEAT+ymCPoky4rc/hkA/NrgrHXXu3UNLUYfrVFdvXn4dRVOul +4+vJhaAlIDf7js4MNIThPIGyd05DpYhfhmehPea0XGG2Ptv+tyjFogeutcrKjSoS75ftwjCkySp6 ++/NNIxuZMzSgLvWpCz/UXeHPhJ/iGcJfitYgHuNztw== +-----END CERTIFICATE----- + +Certum Trusted Network CA 2 +=========================== +-----BEGIN CERTIFICATE----- +MIIF0jCCA7qgAwIBAgIQIdbQSk8lD8kyN/yqXhKN6TANBgkqhkiG9w0BAQ0FADCBgDELMAkGA1UE +BhMCUEwxIjAgBgNVBAoTGVVuaXpldG8gVGVjaG5vbG9naWVzIFMuQS4xJzAlBgNVBAsTHkNlcn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Af8EBTAD +AQH/MB0GA1UdDgQWBBS2oVQ5AsOgP46KvPrU+Bym0ToO/TAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZI +hvcNAQENBQADggIBAHGlDs7k6b8/ONWJWsQCYftMxRQXLYtPU2sQF/xlhMcQSZDe28cmk4gmb3DW +Al45oPePq5a1pRNcgRRtDoGCERuKTsZPpd1iHkTfCVn0W3cLN+mLIMb4Ck4uWBzrM9DPhmDJ2vuA +L55MYIR4PSFk1vtBHxgP58l1cb29XN40hz5BsA72udY/CROWFC/emh1auVbONTqwX3BNXuMp8SMo +clm2q8KMZiYcdywmdjWLKKdpoPk79SPdhRB0yZADVpHnr7pH1BKXESLjokmUbOe3lEu6LaTaM4tM +pkT/WjzGHWTYtTHkpjx6qFcL2+1hGsvxznN3Y6SHb0xRONbkX8eftoEq5IVIeVheO/jbAoJnwTnb +w3RLPTYe+SmTiGhbqEQZIfCn6IENLOiTNrQ3ssqwGyZ6miUfmpqAnksqP/ujmv5zMnHCnsZy4Ypo +J/HkD7TETKVhk/iXEAcqMCWpuchxuO9ozC1+9eB+D4Kob7a6bINDd82Kkhehnlt4Fj1F4jNy3eFm +ypnTycUm/Q1oBEauttmbjL4ZvrHG8hnjXALKLNhvSgfZyTXaQHXyxKcZb55CEJh15pWLYLztxRLX +is7VmFxWlgPF7ncGNf/P5O4/E2Hu29othfDNrp2yGAlFw5Khchf8R7agCyzxxN5DaAhqXzvwdmP7 +zAYspsbiDrW5viSP +-----END CERTIFICATE----- + +Hellenic Academic and Research Institutions RootCA 2015 +======================================================= +-----BEGIN CERTIFICATE----- +MIIGCzCCA/OgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBpjELMAkGA1UEBhMCR1IxDzANBgNVBAcT +BkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0 +aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNVBAMTN0hlbGxlbmljIEFjY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1CoRc0CwIDAQABo0IwQDAPBgNVHRMBAf8EBTAD +AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUcRVnyMjJvXVdctA4GGqd83EkVAswDQYJKoZI +hvcNAQELBQADggIBAHW7bVRLqhBYRjTyYtcWNl0IXtVsyIe9tC5G8jH4fOpCtZMWVdyhDBKg2mF+ +D1hYc2Ryx+hFjtyp8iY/xnmMsVMIM4GwVhO+5lFc2JsKT0ucVlMC6U/2DWDqTUJV6HwbISHTGzrM +d/K4kPFox/la/vot9L/J9UUbzjgQKjeKeaO04wlshYaT/4mWJ3iBj2fjRnRUjtkNaeJK9E10A/+y +d+2VZ5fkscWrv2oj6NSU4kQoYsRL4vDY4ilrGnB+JGGTe08DMiUNRSQrlrRGar9KC/eaj8GsGsVn +82800vpzY4zvFrCopEYq+OsS7HK07/grfoxSwIuEVPkvPuNVqNxmsdnhX9izjFk0WaSrT2y7Hxjb +davYy5LNlDhhDgcGH0tGEPEVvo2FXDtKK4F5D7Rpn0lQl033DlZdwJVqwjbDG2jJ9SrcR5q+ss7F +Jej6A7na+RZukYT1HCjI/CbM1xyQVqdfbzoEvM14iQuODy+jqk+iGxI9FghAD/FGTNeqewjBCvVt +J94Cj8rDtSvK6evIIVM4pcw72Hc3MKJP2W/R8kCtQXoXxdZKNYm3QdV8hn9VTYNKpXMgwDqvkPGa +JI7ZjnHKe7iG2rKPmT4dEw0SEe7Uq/DpFXYC5ODfqiAeW2GFZECpkJcNrVPSWh2HagCXZWK0vm9q +p/UsQu0yrbYhnr68 +-----END CERTIFICATE----- + +Hellenic Academic and Research Institutions ECC RootCA 2015 +=========================================================== +-----BEGIN CERTIFICATE----- +MIICwzCCAkqgAwIBAgIBADAKBggqhkjOPQQDAjCBqjELMAkGA1UEBhMCR1IxDzANBgNVBAcTBkF0 +aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9u +cyBDZXJ0Li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MooqtyuGC2mDOL7Nii4LcK2NJpLuHvUBKwrZ1pebbuCoGRw6IYsMHkCtA+fdZn71uSANA+iW ++YJF1DngoABd15jmfZ5nc8OaKveri6E6FO80vFIOiZiaBECEHX5FaZNXzuvO+FB8TxxuBEOb+dY7 +Ixjp6o7RTUaN8Tvkasq6+yO3m/qZASlaWFot4/nUbQ4mrcFuNLwy+AwF+mWj2zs3gyLp1txyM/1d +8iC9djwj2ij3+RvrWWTV3F9yfiD8zYm1kGdNYno/Tq0dwzn+evQoFt9B9kiABdcPUXmsEKvU7ANm +5mqwujGSQkBqvjrTcuFqN1W8rB2Vt2lh8kORdOag0wokRqEIr9baRRmW1FMdW4R58MD3R++Lj8UG +rp1MYp3/RgT408m2ECVAdf4WqslKYIYvuu8wd+RU4riEmViAqhOLUTpPSPaLtrM= +-----END CERTIFICATE----- + +Amazon Root CA 1 +================ +-----BEGIN CERTIFICATE----- +MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsFADA5MQswCQYD +VQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSAxMB4XDTE1 +MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpv +bjEZMBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBALJ4gHHKeNXjca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgH +FzZM9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qwIFAGbHrQ +gLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6VOujw5H5SNz/0egwLX0t +dHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L93FcX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QbLU8uz/mtBzUF+fUwPfHJ5elnNXkoOrJupmHN5fLT0zLm4BwyydFy4x2+IoZCn9Kr5v2c69BoV +Yh63n749sSmvZ6ES8lgQGVMDMBu4Gon2nL2XA46jCfMdiyHxtN/kHNGfZQIG6lzWE7OE76KlXIx3 +KadowGuuQNKotOrN8I1LOJwZmhsoVLiJkO/KdYE+HvJkJMcYr07/R54H9jVlpNMKVv/1F2Rs76gi +JUmTtt8AF9pYfl3uxRuw0dFfIRDH+fO6AgonB8Xx1sfT4PsJYGw= +-----END CERTIFICATE----- + +Amazon Root CA 3 +================ +-----BEGIN CERTIFICATE----- +MIIBtjCCAVugAwIBAgITBmyf1XSXNmY/Owua2eiedgPySjAKBggqhkjOPQQDAjA5MQswCQYDVQQG +EwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSAzMB4XDTE1MDUy +NjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZ +MBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgMzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABCmXp8ZB +f8ANm+gBG1bG8lKlui2yEujSLtf6ycXYqm0fc4E7O5hrOXwzpcVOho6AF2hiRVd9RFgdszflZwjr +Zt6jQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSrttvXBp43 +rDCGB5Fwx5zEGbF4wDAKBggqhkjOPQQDAgNJADBGAiEA4IWSoxe3jfkrBqWTrBqYaGFy+uGh0Psc +eGCmQ5nFuMQCIQCcAu/xlJyzlvnrxir4tiz+OpAUFteMYyRIHN8wfdVoOw== +-----END CERTIFICATE----- + +Amazon Root CA 4 +================ +-----BEGIN CERTIFICATE----- +MIIB8jCCAXigAwIBAgITBmyf18G7EEwpQ+Vxe3ssyBrBDjAKBggqhkjOPQQDAzA5MQswCQYDVQQG +EwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSA0MB4XDTE1MDUy +NjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZ +MBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgNDB2MBAGByqGSM49AgEGBSuBBAAiA2IABNKrijdPo1MN +/sGKe0uoe0ZLY7Bi9i0b2whxIdIA6GO9mif78DluXeo9pcmBqqNbIJhFXRbb/egQbeOc4OO9X4Ri +83BkM6DLJC9wuoihKqB1+IGuYgbEgds5bimwHvouXKNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV +HQ8BAf8EBAMCAYYwHQYDVR0OBBYEFNPsxzplbszh2naaVvuc84ZtV+WBMAoGCCqGSM49BAMDA2gA +MGUCMDqLIfG9fhGt0O9Yli/W651+kI0rz2ZVwyzjKKlwCkcO8DdZEv8tmZQoTipPNU0zWgIxAOp1 +AE47xDqUEpHJWEadIRNyp4iciuRMStuW1KyLa2tJElMzrdfkviT8tQp21KW8EA== +-----END CERTIFICATE----- + +TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 +============================================= +-----BEGIN CERTIFICATE----- +MIIEYzCCA0ugAwIBAgIBATANBgkqhkiG9w0BAQsFADCB0jELMAkGA1UEBhMCVFIxGDAWBgNVBAcT +D0dlYnplIC0gS29jYWVsaTFCMEAGA1UEChM5VHVya2l5ZSBCaWxpbXNlbCB2ZSBUZWtub2xvamlr +IEFyYXN0aXJtYSBLdXJ1bXUgLSBUVUJJVEFLMS0wKwYDVQQLEyRLYW11IFNlcnRpZmlrYXN5b24g +TWVya2V6aSAtIEthbXUgU00xNjA0BgNVBAMTLVRVQklUQUsgS2FtdSBTTSBTU0wgS29rIFNlcnRp +ZmlrYXNpIC0gU3VydW0gMTAeFw0xMzExMjUwODI1NTVaFw00MzEwMjUwODI1NTVaMIHSMQswCQYD +VQQGEwJUUjEYMBYG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whuJi1/FwcJsoz7UMCflo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM= +-----END CERTIFICATE----- + +GDCA TrustAUTH R5 ROOT +====================== +-----BEGIN CERTIFICATE----- +MIIFiDCCA3CgAwIBAgIIfQmX/vBH6nowDQYJKoZIhvcNAQELBQAwYjELMAkGA1UEBhMCQ04xMjAw +BgNVBAoMKUdVQU5HIERPTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZIENPLixMVEQuMR8wHQYDVQQD +DBZHRENBIFRydXN0QVVUSCBSNSBST09UMB4XDTE0MTEyNjA1MTMxNVoXDTQwMTIzMTE1NTk1OVow +YjELMAkGA1UEBhMCQ04xMjAwBgNVBAoMKUdVQU5HIERPTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZ +IENPLixMVEQuMR8wHQYDVQQDDBZHRENBIFRydXN0QVVUSCBSNSBST09UMIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEA2aMW8Mh0dHeb7zMNOwZ+Vfy1YI92hhJCfVZmPoiC7XJjDp6L3TQs +AlFRwxn9WVSEyfFrs0yw6ehGXTjGoqcuEVe6ghWinI9tsJlKCvLriXBjTnnEt1u9ol2x8kECK62p +OqPseQrsXzrj/e+APK00mxqriCZ7VqKChh/rNYmDf1+uKU49tm7srsHwJ5uu4/Ts765/94Y9cnrr +pftZTqfrlYwiOXnhLQiPzLyRuEH3FMEjqcOtmkVEs7LXLM3GKeJQEK5cy4KOFxg2fZfmiJqwTTQJ +9Cy5WmYqsBebnh52nUpmMUHfP/vFBu8btn4aRjb3ZGM74zkYI+dndRTVdVeSN72+ahsmUPI2JgaQ +xXABZG12ZuGR224HwGGALrIuL4xwp9E7PLOR5G62xDtw8mySlwnNR30YwPO7ng/Wi64HtloPzgsM +R6flPri9fcebNaBhlzpBdRfMK5Z3KpIhHtmVdiBnaM8Nvd/WHwlqmuLMc3GkL30SgLdTMEZeS1SZ +D2fJpcjyIMGC7J0R38IC+xo70e0gmu9lZJIQDSri3nDxGGeCjGHeuLzRL5z7D9Ar7Rt2ueQ5Vfj4 +oR24qoAATILnsn8JuLwwoC8N9VKejveSswoAHQBUlwbgsQfZxw9cZX08bVlX5O2ljelAU58VS6Bx +9hoh49pwBiFYFIeFd3mqgnkCAwEAAaNCMEAwHQYDVR0OBBYEFOLJQJ9NzuiaoXzPDj9lxSmIahlR +MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQDRSVfg +p8xoWLoBDysZzY2wYUWsEe1jUGn4H3++Fo/9nesLqjJHdtJnJO29fDMylyrHBYZmDRd9FBUb1Ov9 +H5r2XpdptxolpAqzkT9fNqyL7FeoPueBihhXOYV0GkLH6VsTX4/5COmSdI31R9KrO9b7eGZONn35 +6ZLpBN79SWP8bfsUcZNnL0dKt7n/HipzcEYwv1ryL3ml4Y0M2fmyYzeMN2WFcGpcWwlyua1jPLHd ++PwyvzeG5LuOmCd+uh8W4XAR8gPfJWIyJyYYMoSf/wA6E7qaTfRPuBRwIrHKK5DOKcFw9C+df/KQ +HtZa37dG/OaG+svgIHZ6uqbL9XzeYqWxi+7egmaKTjowHz+Ay60nugxe19CxVsp3cbK1daFQqUBD +F8Io2c9Si1vIY9RCPqAzekYu9wogRlR+ak8x8YF+QnQ4ZXMn7sZ8uI7XpTrXmKGcjBBV09tL7ECQ +8s1uV9JiDnxXk7Gnbc2dg7sq5+W2O3FYrf3RRbxake5TFW/TRQl1brqQXR4EzzffHqhmsYzmIGrv +/EhOdJhCrylvLmrH+33RZjEizIYAfmaDDEL0vTSSwxrqT8p+ck0LcIymSLumoRT2+1hEmRSuqguT +aaApJUqlyyvdimYHFngVV3Eb7PVHhPOeMTd61X8kreS8/f3MboPoDKi3QWwH3b08hpcv0g== +-----END CERTIFICATE----- + +TrustCor RootCert CA-1 +====================== +-----BEGIN CERTIFICATE----- +MIIEMDCCAxigAwIBAgIJANqb7HHzA7AZMA0GCSqGSIb3DQEB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QEBAQUAA4IBDwAwggEKAoIBAQDPj+ARtZ+odnbb3w9U73NjKYKtR8aja+3+XzP4Q1HpGjOR +MRegdMTUpwHmspI+ap3tDvl0mEDTPwOABoJA6LHip1GnHYMma6ve+heRK9jGrB6xnhkB1Zem6g23 +xFUfJ3zSCNV2HykVh0A53ThFEXXQmqc04L/NyFIduUd+Dbi7xgz2c1cWWn5DkR9VOsZtRASqnKmc +p0yJF4OuowReUoCLHhIlERnXDH19MURB6tuvsBzvgdAsxZohmz3tQjtQJvLsznFhBmIhVE5/wZ0+ +fyCMgMsq2JdiyIMzkX2woloPV+g7zPIlstR8L+xNxqE6FXrntl019fZISjZFZtS6mFjBAgMBAAGj +YzBhMB0GA1UdDgQWBBREnkj1zG1I1KBLf/5ZJC+Dl5mahjAfBgNVHSMEGDAWgBREnkj1zG1I1KBL +f/5ZJC+Dl5mahjAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsF +AAOCAQEABT41XBVwm8nHc2FvcivUwo/yQ10CzsSUuZQRg2dd4mdsdXa/uwyqNsatR5Nj3B5+1t4u +/ukZMjgDfxT2AHMsWbEhBuH7rBiVDKP/mZb3Kyeb1STMHd3BOuCYRLDE5D53sXOpZCz2HAF8P11F +hcCF5yWPldwX8zyfGm6wyuMdKulMY/okYWLW2n62HGz1Ah3UKt1VkOsqEUc8Ll50soIipX1TH0Xs +J5F95yIW6MBoNtjG8U+ARDL54dHRHareqKucBK+tIA5kmE2la8BIWJZpTdwHjFGTot+fDz2LYLSC +jaoITmJF4PkL0uDgPFveXHEnJcLmA4GLEFPjx1WitJ/X5g== +-----END CERTIFICATE----- + +SSL.com Root Certification Authority RSA +======================================== +-----BEGIN CERTIFICATE----- +MIIF3TCCA8WgAwIBAgIIeyyb0xaAMpkwDQYJKoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMxDjAM +BgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYD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BAAGjYzBhMB0GA1UdDgQWBBTdBAkHovV6fVJTEpKV7jiAJQ2mWTAPBgNV +HRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFN0ECQei9Xp9UlMSkpXuOIAlDaZZMA4GA1UdDwEB/wQE +AwIBhjANBgkqhkiG9w0BAQsFAAOCAgEAIBgRlCn7Jp0cHh5wYfGVcpNxJK1ok1iOMq8bs3AD/CUr +dIWQPXhq9LmLpZc7tRiRux6n+UBbkflVma8eEdBcHadm47GUBwwyOabqG7B52B2ccETjit3E+ZUf +ijhDPwGFpUenPUayvOUiaPd7nNgsPgohyC0zrL/FgZkxdMF1ccW+sfAjRfSda/wZY52jvATGGAsl +u1OJD7OAUN5F7kR/q5R4ZJjT9ijdh9hwZXT7DrkT66cPYakylszeu+1jTBi7qUD3oFRuIIhxdRjq +erQ0cuAjJ3dctpDqhiVAq+8zD8ufgr6iIPv2tS0a5sKFsXQP+8hlAqRSAUfdSSLBv9jra6x+3uxj +MxW3IwiPxg+NQVrdjsW5j+VFP3jbutIbQLH+cU0/4IGiul607BXgk90IH37hVZkLId6Tngr75qNJ +vTYw/ud3sqB1l7UtgYgXZSD32pAAn8lSzDLKNXz1PQ/YK9f1JmzJBjSWFupwWRoyeXkLtoh/D1JI +Pb9s2KJELtFOt3JY04kTlf5Eq/jXixtunLwsoFvVagCvXzfh1foQC5ichucmj87w7G6KVwuA406y +wKBjYZC6VWg3dGq2ktufoYYitmUnDuy2n0Jg5GfCtdpBC8TTi2EbvPofkSvXRAdeuims2cXp71NI +WuuA8ShYIc2wBlX7Jz9TkHCpBB5XJ7k= +-----END CERTIFICATE----- + +SSL.com Root Certification Authority ECC +======================================== +-----BEGIN CERTIFICATE----- +MIICjTCCAhSgAwIBAgIIdebfy8FoW6gwCgYIKoZIzj0EAwIwfDELMAkGA1UEBhMCVVMxDjAMBgNV +BAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9TU0wgQ29ycG9yYXRpb24xMTAv +BgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYwMjEy +MTgxNDAzWhcNNDEwMjEyMTgxNDAzWjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAO +BgNVBAcMB0hvdXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNv +bSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49AgEGBSuBBAAiA2IA +BEVuqVDEpiM2nl8ojRfLliJkP9x6jh3MCLOicSS6jkm5BBtHllirLZXI7Z4INcgn64mMU1jrYor+ +8FsPazFSY0E7ic3s7LaNGdM0B9y7xgZ/wkWV7Mt/qCPgCemB+vNH06NjMGEwHQYDVR0OBBYEFILR +hXMw5zUE044CkvvlpNHEIejNMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUgtGFczDnNQTT +jgKS++Wk0cQh6M0wDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2cAMGQCMG/n61kRpGDPYbCW +e+0F+S8Tkdzt5fxQaxFGRrMcIQBiu77D5+jNB5n5DQtdcj7EqgIwH7y6C+IwJPt8bYBVCpk+gA0z +5Wajs6O7pdWLjwkspl1+4vAHCGht0nxpbl/f5Wpl +-----END CERTIFICATE----- + +SSL.com EV Root Certification Authority RSA R2 +============================================== +-----BEGIN CERTIFICATE----- +MIIF6zCCA9OgAwIBAgIIVrYpzTS8ePYwDQYJKoZIhvcNAQELBQAwgYIxCzAJBgNVBAYTAlVTMQ4w +DAYDVQQIDAVUZXhhczEQMA4GA1UEBwwHSG91c3RvbjEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9u +MTcwNQYDVQQDDC5TU0wuY29tIEVWIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIy +MB4XDTE3MDUzMTE4MTQzN1oXDTQ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A0GCSqGSIb3DQEBCwUAA4ICAQBWs47LCp1Jjr+kxJG7ZhcFUZh1 +++VQLHqe8RT6q9OKPv+RKY9ji9i0qVQBDb6Thi/5Sm3HXvVX+cpVHBK+Rw82xd9qt9t1wkclf7nx +Y/hoLVUE0fKNsKTPvDxeH3jnpaAgcLAExbf3cqfeIg29MyVGjGSSJuM+LmOW2puMPfgYCdcDzH2G +guDKBAdRUNf/ktUM79qGn5nX67evaOI5JpS6aLe/g9Pqemc9YmeuJeVy6OLk7K4S9ksrPJ/psEDz +OFSz/bdoyNrGj1E8svuR3Bznm53htw1yj+KkxKl4+esUrMZDBcJlOSgYAsOCsp0FvmXtll9ldDz7 +CTUue5wT/RsPXcdtgTpWD8w74a8CLyKsRspGPKAcTNZEtF4uXBVmCeEmKf7GUmG6sXP/wwyc5Wxq +lD8UykAWlYTzWamsX0xhk23RO8yilQwipmdnRC652dKKQbNmC1r7fSOl8hqw/96bg5Qu0T/fkreR +rwU7ZcegbLHNYhLDkBvjJc40vG93drEQw/cFGsDWr3RiSBd3kmmQYRzelYB0VI8YHMPzA9C/pEN1 +hlMYegouCRw2n5H9gooiS9EOUCXdywMMF8mDAAhONU2Ki+3wApRmLER/y5UnlhetCTCstnEXbosX +9hwJ1C07mKVx01QT2WDz9UtmT/rx7iASjbSsV7FFY6GsdqnC+w== +-----END CERTIFICATE----- + +SSL.com EV Root Certification Authority ECC +=========================================== +-----BEGIN CERTIFICATE----- +MIIClDCCAhqgAwIBAgIILCmcWxbtBZUwCgYIKoZIzj0EAwIwfzELMAkGA1UEBhMCVVMxDjAMBgNV +BAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9TU0wgQ29ycG9yYXRpb24xNDAy +BgNVBAMMK1NTTC5jb20gRVYgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYw +MjEyMTgxNTIzWhcNNDEwMjEyMTgxNTIzWjB/MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMx +EDAOBgNVBAcMB0hvdXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjE0MDIGA1UEAwwrU1NM +LmNvbSBFViBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49AgEGBSuB +BAAiA2IABKoSR5CYG/vvw0AHgyBO8TCCogbR8pKGYfL2IWjKAMTH6kMAVIbc/R/fALhBYlzccBYy +3h+Z1MzFB8gIH2EWB1E9fVwHU+M1OIzfzZ/ZLg1KthkuWnBaBu2+8KGwytAJKaNjMGEwHQYDVR0O +BBYEFFvKXuXe0oGqzagtZFG22XKbl+ZPMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUW8pe +5d7SgarNqC1kUbbZcpuX5k8wDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2gAMGUCMQCK5kCJ +N+vp1RPZytRrJPOwPYdGWBrssd9v+1a6cGvHOMzosYxPD/fxZ3YOg9AeUY8CMD32IygmTMZgh5Mm +m7I1HrrW9zzRHM76JTymGoEVW/MSD2zuZYrJh6j5B+BimoxcSg== +-----END CERTIFICATE----- + +GlobalSign Root CA - R6 +======================= +-----BEGIN CERTIFICATE----- +MIIFgzCCA2ugAwIBAgIORea7A4Mzw4VlSOb/RVEwDQYJKoZIhvcNAQEMBQAwTDEgMB4GA1UECxMX +R2xvYmFsU2lnbiBSb290IENBIC0gUjYxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkds +b2JhbFNpZ24wHhcNMTQxMjEwMDAwMDAwWhcNMzQxMjEwMDAwMDAwWjBMMSAwHgYDVQQLExdHbG9i +YWxTaWduIFJvb3QgQ0EgLSBSNjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFs +U2lnbjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJUH6HPKZvnsFMp7PPcNCPG0RQss +grRIxutbPK6D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cDDpw+5CRu3CkwWJ+n1jez/QcYF8AOiYrg54NMMl+68KnyBr +3TsTjxKM4kEaSHpzoHdpx7Zcf4LIHv5YGygrqGytXm3ABdJ7t+uA/iU3/gKbaKxCXcPu9czc8FB1 +0jZpnOZ7BN9uBmm23goJSFmH63sUYHpkqmlD75HHTOwY3WzvUy2MmeFe8nI+z1TIvWfspA9MRf/T +uTAjB0yPEL+GltmZWrSZVxykzLsViVO6LAUP5MSeGbEYNNVMnbrt9x+vJJUEeKgDu+6B5dpffItK +oZB0JaezPkvILFa9x8jvOOJckvB595yEunQtYQEgfn7R8k8HWV+LLUNS60YMlOH1Zkd5d9VUWx+t +JDfLRVpOoERIyNiwmcUVhAn21klJwGW45hpxbqCo8YLoRT5s1gLXCmeDBVrJpBA= +-----END CERTIFICATE----- + +OISTE WISeKey Global Root GC CA +=============================== +-----BEGIN CERTIFICATE----- +MIICaTCCAe+gAwIBAgIQISpWDK7aDKtARb8roi066jAKBggqhkjOPQQDAzBtMQswCQYDVQQGEwJD +SDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEo +MCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQyBDQTAeFw0xNzA1MDkwOTQ4MzRa +Fw00MjA1MDkwOTU4MzNaMG0xCzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYDVQQL +ExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEdsb2Jh +bCBSb290IEdDIENBMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAETOlQwMYPchi82PG6s4nieUqjFqdr +VCTbUf/q9Akkwwsin8tqJ4KBDdLArzHkdIJuyiXZjHWd8dvQmqJLIX4Wp2OQ0jnUsYd4XxiWD1Ab +NTcPasbc2RNNpI6QN+a9WzGRo1QwUjAOBgNVHQ8BAf8EBAM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VHLql +CFF1pkgl +-----END CERTIFICATE----- + +GTS Root R2 +=========== +-----BEGIN CERTIFICATE----- +MIIFWjCCA0KgAwIBAgIQbkepxlqz5yDFMJo/aFLybzANBgkqhkiG9w0BAQwFADBHMQswCQYDVQQG +EwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJv +b3QgUjIwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAG +A1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjIwggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDO3v2m++zsFDQ8BwZabFn3GTXd98GdVarTzTuk +k3LvCvptnfbwhYBboUhSnznFt+4orO/LdmgUud+tAWyZH8QiHZ/+cnfgLFuv5AS/T3KgGjSY6Dlo +7JUle3ah5mm5hRm9iYz+re026nO8/4Piy33B0s5Ks40FnotJk9/BW9BuXvAuMC6C/Pq8tBcKSOWI +m8Wba96wyrQD8Nr0kLhlZPdcTK3ofmZemde4wj7I0BOdre7kRXuJVfeKH2JShBKzwkCX44ofR5Gm +dFrS+LFjKBC4swm4VndAoiaYecb+3yXuPuWgf9RhD1FLPD+M2uFwdNjCaKH5wQzpoeJ/u1U8dgbu +ak7MkogwTZq9TwtImoS1mKPV+3PBV2HdKFZ1E66HjucMUQkQdYhMvI35ezzUIkgfKtzra7tEscsz +cTJGr61K8YzodDqs5xoic4DSMPclQsciOzsSrZYuxsN2B6ogtzVJV+mSSeh2FnIxZyuWfoqjx5RW +Ir9qS34BIbIjMt/kmkRtWVtd9QCgHJvGeJeNkP+byKq0rxFROV7Z+2et1VsRnTKaG73Vululycsl +aVNVJ1zgyjbLiGH7HrfQy+4W+9OmTN6SpdTi3/UGVN4unUu0kzCqgc7dGtxRcw1PcOnlthYhGXmy +5okLdWTK1au8CcE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1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSATNbrdP9JNqPV +2Py1PsVq8JQdjDAKBggqhkjOPQQDAwNnADBkAjBqUFJ0CMRw3J5QdCHojXohw0+WbhXRIjVhLfoI +N+4Zba3bssx9BzT1YBkstTTZbyACMANxsbqjYAuG7ZoIapVon+Kz4ZNkfF6Tpt95LY2F45TPI11x +zPKwTdb+mciUqXWi4w== +-----END CERTIFICATE----- + +UCA Global G2 Root +================== +-----BEGIN CERTIFICATE----- +MIIFRjCCAy6gAwIBAgIQXd+x2lqj7V2+WmUgZQOQ7zANBgkqhkiG9w0BAQsFADA9MQswCQYDVQQG +EwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxGzAZBgNVBAMMElVDQSBHbG9iYWwgRzIgUm9vdDAeFw0x +NjAzMTEwMDAwMDBaFw00MDEyMzEwMDAwMDBaMD0xCzAJBgNVBAYTAkNOMREwDwYDVQQKDAhVbmlU +cnVzdDEbMBkGA1UEAwwSVUNBIEdsb2JhbCBHMiBSb290MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A +MIICCgKCAgEAxeYrb3zvJgUno4Ek2m/LAfmZmqkywiKHYUGRO8vDaBsGxUypK8FnFyIdK+35KYmT +oni9kmugow2ifsqTs6bRjDXVdfkX9s9FxeV67HeToI8jrg4aA3++1NDtLnurRiNb/yzmVHqUwCoV +8MmNsHo7JOHXaOIxPAYzRrZUEaalLyJUKlgNAQLx+hVRZ2zA+te2G3/RVogvGjqNO7uCEeBHANBS +h6v7hn4PJGtAnTRnvI3HLYZveT6OqTwXS3+wmeOwcWDcC/Vkw85DvG1xudLeJ1uK6NjGruFZfc8o +LTW4lVYa8bJYS7cSN8h8s+1LgOGN+jIjtm+3SJUIsUROhYw6AlQgL9+/V087OpAh18EmNVQg7Mc/ +R+zvWr9LesGtOxdQXGLYD0tK3Cv6brxzks3sx1DoQZbXqX5t2Okdj4q1uViSukqSKwxW/YDrCPBe +KW4bHAyv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A Extended Validation Root +============================ +-----BEGIN CERTIFICATE----- +MIIFWjCCA0KgAwIBAgIQT9Irj/VkyDOeTzRYZiNwYDANBgkqhkiG9w0BAQsFADBHMQswCQYDVQQG +EwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxJTAjBgNVBAMMHFVDQSBFeHRlbmRlZCBWYWxpZGF0aW9u +IFJvb3QwHhcNMTUwMzEzMDAwMDAwWhcNMzgxMjMxMDAwMDAwWjBHMQswCQYDVQQGEwJDTjERMA8G +A1UECgwIVW5pVHJ1c3QxJTAjBgNVBAMMHFVDQSBFeHRlbmRlZCBWYWxpZGF0aW9uIFJvb3QwggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCpCQcoEwKwmeBkqh5DFnpzsZGgdT6o+uM4AHrs +iWogD4vFsJszA1qGxliG1cGFu0/GnEBNyr7uaZa4rYEwmnySBesFK5pI0Lh2PpbIILvSsPGP2KxF +Rv+qZ2C0d35qHzwaUnoEPQc8hQ2E0B92CvdqFN9y4zR8V05WAT558aopO2z6+I9tTcg1367r3CTu +eUWnhbYFiN6IXSV8l2RnCdm/WhUFhvMJHuxYMjMR83dksHYf5BA1FxvyDrFspCqjc/wJHx4yGVMR +59mzLC52LqGj3n5qiAno8geK+LLNEOfic0CTuwjRP+H8C5SzJe98ptfRr5//lpr1kXuYC3fUfugH +0mK1lTnj8/FtDw5lhIpjVMWAtuCeS31HJqcBCF3RiJ7XwzJE+oJKCmhUfzhTA8ykADNkUVkLo4KR +el7sFsLzKuZi2irbWWIQJUoqgQtHB0MGcIfS+pMRKXpITeuUx3BNr2fVUbGAIAEBtHoIppB/TuDv +B0GHr2qlXov7z1CymlSvw4m6WC31MJixNnI5fkkE/SmnTHnkBVfblLkWU41Gsx2VYVdWf6/wFlth +WG82UBEL2KwrlRYaDh8IzTY0ZRBiZtWAXxQgXy0MoHgKaNYs1+lvK9JKBZP8nm9rZ/+I8U6laUpS +NwXqxhaN0sSZ0YIrO7o1dfdRUVjzyAf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ADAxMC8GCCsGAQUFBwIBFiNodHRwczovL3d3d3cuY2Vy +dGlnbmEuZnIvYXV0b3JpdGVzLzBtBgNVHR8EZjBkMC+gLaArhilodHRwOi8vY3JsLmNlcnRpZ25h +LmZyL2NlcnRpZ25hcm9vdGNhLmNybDAxoC+gLYYraHR0cDovL2NybC5kaGlteW90aXMuY29tL2Nl +cnRpZ25hcm9vdGNhLmNybDANBgkqhkiG9w0BAQsFAAOCAgEAlLieT/DjlQgi581oQfccVdV8AOIt +OoldaDgvUSILSo3L6btdPrtcPbEo/uRTVRPPoZAbAh1fZkYJMyjhDSSXcNMQH+pkV5a7XdrnxIxP +TGRGHVyH41neQtGbqH6mid2PHMkwgu07nM3A6RngatgCdTer9zQoKJHyBApPNeNgJgH60BGM+RFq +7q89w1DTj18zeTyGqHNFkIwgtnJzFyO+B2XleJINugHA64wcZr+shncBlA2c5uk5jR+mUYyZDDl3 +4bSb+hxnV29qao6pK0xXeXpXIs/NX2NGjVxZOob4Mkdio2cNGJHc+6Zr9UhhcyNZjgKnvETq9Emd +8VRY+WCv2hikLyhF3HqgiIZd8zvn/yk1gPxkQ5Tm4xxvvq0OKmOZK8l+hfZx6AYDlf7ej0gcWtSS +6Cvu5zHbugRqh5jnxV/vfaci9wHYTfmJ0A6aBVmknpjZbyvKcL5kwlWj9Omvw5Ip3IgWJJk8jSaY +tlu3zM63Nwf9JtmYhST/WSMDmu2dnajkXjjO11INb9I/bbEFa0nOipFGc/T2L/Coc3cOZayhjWZS +aX5LaAzHHjcng6WMxwLkFM1JAbBzs/3GkDpv0mztO+7skb6iQ12LAEpmJURw3kAP+HwV96LOPNde +E4yBFxgX0b3xdxA61GU5wSesVywlVP+i2k+KYTlerj1KjL0= +-----END CERTIFICATE----- + +emSign Root CA - G1 +=================== +-----BEGIN CERTIFICATE----- +MIIDlDCCAnygAwIBAgIKMfXkYgxsWO3W2DANBgkqhkiG9w0BAQsFADBnMQswCQYDVQQGEwJJTjET +MBEGA1UECxMKZW1TaW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bv2noWgbyRQuQ+q7hv53yrlc8pa6yVvSLZUDp/TGBLPQ5Cdjua6e0ph0VpZj3AYHYhX3zUVxx +iN66zB+Afko= +-----END CERTIFICATE----- + +emSign ECC Root CA - G3 +======================= +-----BEGIN CERTIFICATE----- +MIICTjCCAdOgAwIBAgIKPPYHqWhwDtqLhDAKBggqhkjOPQQDAzBrMQswCQYDVQQGEwJJTjETMBEG +A1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9sb2dpZXMgTGltaXRlZDEg +MB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0gRzMwHhcNMTgwMjE4MTgzMDAwWhcNNDMwMjE4 +MTgzMDAwWjBrMQswCQYDVQQGEwJJTjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11 +ZGhyYSBUZWNobm9sb2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0g +RzMwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQjpQy4LRL1KPOxst3iAhKAnjlfSU2fySU0WXTsuwYc +58Byr+iuL+FBVIcUqEqy6HyC5ltqtdyzdc6LBtCGI79G1Y4PPwT01xySfvalY8L1X44uT6EYGQIr +MgqCZH0Wk9GjQjBAMB0GA1UdDgQWBBR8XQKEE9TMipuBzhccLikenEhjQjAOBgNVHQ8BAf8EBAMC +AQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNpADBmAjEAvvNhzwIQHWSVB7gYboiFBS+D +CBeQyh+KTOgNG3qxrdWBCUfvO6wIBHxcmbHtRwfSAjEAnbpV/KlK6O3t5nYBQnvI+GDZjVGLVTv7 +jHvrZQnD+JbNR6iC8hZVdyR+EhCVBCyj +-----END CERTIFICATE----- + +emSign Root CA - C1 +=================== +-----BEGIN CERTIFICATE----- +MIIDczCCAlugAwIBAgILAK7PALrEzzL4Q7IwDQYJKoZIhvcNAQELBQAwVjELMAkGA1UEBhMCVVM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ADMmpDqw8NQ +BmIMMMAVSKeoWXzhriKi4gp6D/piq1JM4fHfyr6DDUI= +-----END CERTIFICATE----- + +emSign ECC Root CA - C3 +======================= +-----BEGIN CERTIFICATE----- +MIICKzCCAbGgAwIBAgIKe3G2gla4EnycqDAKBggqhkjOPQQDAzBaMQswCQYDVQQGEwJVUzETMBEG +A1UECxMKZW1TaWduIFBLSTEUMBIGA1UEChMLZU11ZGhyYSBJbmMxIDAeBgNVBAMTF2VtU2lnbiBF +Q0MgUm9vdCBDQSAtIEMzMB4XDTE4MDIxODE4MzAwMFoXDTQzMDIxODE4MzAwMFowWjELMAkGA1UE +BhMCVVMxEzARBgNVBAsTCmVtU2lnbiBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMSAwHgYDVQQD +ExdlbVNpZ24gRUNDIFJvb3QgQ0EgLSBDMzB2MBAGByqGSM49AgEGBSuBBAAiA2IABP2lYa57JhAd +6bciMK4G9IGzsUJxlTm801Ljr6/58pc1kjZGDoeVjbk5Wum739D+yAdBPLtVb4OjavtisIGJAnB9 +SMVK4+kiVCJNk7tCDK93nCOmfddhEc5lx/h//vXyqaNCMEAwHQYDVR0OBBYEFPtaSNCAIEDyqOkA +B2kZd6fmw/TPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MAoGCCqGSM49BAMDA2gA +MGUCMQC02C8Cif22TGK6Q04ThHK1rt0c3ta13FaPWEBaLd4gTCKDypOofu4SQMfWh0/434UCMBwU +ZOR8loMRnLDRWmFLpg9J0wD8ofzkpf9/rdcw0Md3f76BB1UwUCAU9Vc4CqgxUQ== +-----END CERTIFICATE----- + +Hongkong Post Root CA 3 +======================= +-----BEGIN CERTIFICATE----- +MIIFzzCCA7egAwIBAgIUCBZfikyl7ADJk0DfxMauI7gcWqQwDQYJKoZIhvcNAQELBQAwbzELMAkG +A1UEBhMCSEsxEjAQBgNVBAgTCUhvbmcgS29uZzESMBAGA1UEBxMJSG9uZyBLb25nMRYwFAYDVQ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+i9Y5K3DTXNSguB+wAPzFYTAdBgNVHQ4EFgQUF53NHovWOStw01zUoLgfsAD8xWEwDQYJKoZIhvcN +AQELBQADggIBAFbVe27mIgHSQpsY1Q7XZiNc4/6gx5LS6ZStS6LG7BJ8dNVI0lkUmcDrudHr9Egw +W62nV3OZqdPlt9EuWSRY3GguLmLYauRwCy0gUCCkMpXRAJi70/33MvJJrsZ64Ee+bs7Lo3I6LWld +y8joRTnU+kLBEUx3XZL7av9YROXrgZ6voJmtvqkBZss4HTzfQx/0TW60uhdG/H39h4F5ag0zD/ov ++BS5gLNdTaqX4fnkGMX41TiMJjz98iji7lpJiCzfeT2OnpA8vUFKOt1b9pq0zj8lMH8yfaIDlNDc +eqFS3m6TjRgm/VWsvY+b0s+v54Ysyx8Jb6NvqYTUc79NoXQbTiNg8swOqn+knEwlqLJmOzj/2ZQw +9nKEvmhVEA/GcywWaZMH/rFF7buiVWqw2rVKAiUnhde3t4ZEFolsgCs+l6mc1X5VTMbeRRAc6uk7 +nwNT7u56AQIWeNTowr5GdogTPyK7SBIdUgC0An4hGh6cJfTzPV4e0hz5sy229zdcxsshTrD3mUcY +hcErulWuBurQB7Lcq9CClnXO0lD+mefPL5/ndtFhKvshuzHQqp9HpLIiyhY6UFfEW0NnxWViA0kB +60PZ2Pierc+xYw5F9KBaLJstxabArahH9CdMOA0uG0k7UvToiIMrVCjU8jVStDKDYmlkDJGcn5fq +dBb9HxEGmpv0 +-----END CERTIFICATE----- + +Entrust Root Certification Authority - G4 +========================================= +-----BEGIN CERTIFICATE----- +MIIGSzCCBDOgAwIBAgIRANm1Q3+vqTkPAAAAAFVlrVgwDQYJKoZIhvcNAQELBQAwgb4xCzAJBgNV +BAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3Qu +bmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNSBFbnRydXN0LCBJbmMuIC0gZm9yIG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k0X+IyqJwlN4y6mACXi0mW +Hv0liqzc2thddG5msP9E36EYxr5ILzeUePiVSj9/E15dWf10hkNjc0kCAwEAAaNCMEAwDwYDVR0T +AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJ84xFYjwznooHFs6FRM5Og6sb9n +MA0GCSqGSIb3DQEBCwUAA4ICAQAS5UKme4sPDORGpbZgQIeMJX6tuGguW8ZAdjwD+MlZ9POrYs4Q +jbRaZIxowLByQzTSGwv2LFPSypBLhmb8qoMi9IsabyZIrHZ3CL/FmFz0Jomee8O5ZDIBf9PD3Vht +7LGrhFV0d4QEJ1JrhkzO3bll/9bGXp+aEJlLdWr+aumXIOTkdnrG0CSqkM0gkLpHZPt/B7NTeLUK +YvJzQ85BK4FqLoUWlFPUa19yIqtRLULVAJyZv967lDtX/Zr1hstWO1uIAeV8KEsD+UmDfLJ/fOPt +jqF/YFOOVZ1QNBIPt5d7bIdKROf1beyAN/BYGW5KaHbwH5Lk6rWS02FREAutp9lfx1/cH6NcjKF+ +m7ee01ZvZl4HliDtC3T7Zk6LERXpgUl+b7DUUH8i119lAg2m9IUe2K4GS0qn0jFmwvjO5QimpAKW +RGhXxNUzzxkvFMSUHHuk2fCfDrGA4tGeEWSpiBE6doLlYsKA2KSD7ZPvfC+QsDJMlhVoSFLUmQjA +JOgc47OlIQ6SwJAfzyBfyjs4x7dtOvPmRLgOMWuIjnDrnBdSqEGULoe256YSxXXfW8AKbnuk5F6G ++TaU33fD6Q3AOfF5u0aOq0NZJ7cguyPpVkAh7DE9ZapD8j3fcEThuk0mEDuYn/PIjhs4ViFqUZPT +kcpG2om3PVODLAgfi49T3f+sHw== +-----END CERTIFICATE----- + +Microsoft ECC Root Certificate Authority 2017 +============================================= +-----BEGIN CERTIFICATE----- +MIICWTCCAd+gAwIBAgIQZvI9r4fei7FK6gxXMQHC7DAKBggqhkjOPQQDAzBlMQswCQYDVQQGEwJV +UzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYwNAYDVQQDEy1NaWNyb3NvZnQgRUND +IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTcwHhcNMTkxMjE4MjMwNjQ1WhcNNDIwNzE4 +MjMxNjA0WjBlMQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYw +NAYDVQQDEy1NaWNyb3NvZnQgRUNDIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTcwdjAQ +BgcqhkjOPQIBBgUrgQQAIgNiAATUvD0CQnVBEyPNgASGAlEvaqiBYgtlzPbKnR5vSmZRogPZnZH6 +thaxjG7efM3beaYvzrvOcS/lpaso7GMEZpn4+vKTEAXhgShC48Zo9OYbhGBKia/teQ87zvH2RPUB +eMCjVDBSMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTIy5lycFIM ++Oa+sgRXKSrPQhDtNTAQBgkrBgEEAYI3FQEEAwIBADAKBggqhkjOPQQDAwNoADBlAjBY8k3qDPlf +Xu5gKcs68tvWMoQZP3zVL8KxzJOuULsJMsbG7X7JNpQS5GiFBqIb0C8CMQCZ6Ra0DvpWSNSkMBaR +eNtUjGUBiudQZsIxtzm6uBoiB078a1QWIP8rtedMDE2mT3M= +-----END CERTIFICATE----- + +Microsoft RSA Root Certificate Authority 2017 +============================================= +-----BEGIN CERTIFICATE----- +MIIFqDCCA5CgAwIBAgIQHtOXCV/YtLNHcB6qvn9FszANBgkqhkiG9w0BAQwFADBlMQswCQYDVQQG +EwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYwNAYDVQQDEy1NaWNyb3NvZnQg +UlNBIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTcwHhcNMTkxMjE4MjI1MTIyWhcNNDIw +NzE4MjMwMDIzWjBlMQswCQYDVQQGEwJVUzEeMBwG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NVBAMMFWUtU3pp +Z25vIFJvb3QgQ0EgMjAxNzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABJbcPYrYsHtvxie+RJCx +s1YVe45DJH0ahFnuY2iyxl6H0BVIHqiQrb1TotreOpCmYF9oMrWGQd+HWyx7xf58etqjYzBhMA8G +A1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSHERUI0arBeAyxr87GyZDv +vzAEwDAfBgNVHSMEGDAWgBSHERUI0arBeAyxr87GyZDvvzAEwDAKBggqhkjOPQQDAgNJADBGAiEA +tVfd14pVCzbhhkT61NlojbjcI4qKDdQvfepz7L9NbKgCIQDLpbQS+ue16M9+k/zzNY9vTlp8tLxO +svxyqltZ+efcMQ== +-----END CERTIFICATE----- + +certSIGN Root CA G2 +=================== +-----BEGIN CERTIFICATE----- +MIIFRzCCAy+gAwIBAgIJEQA0tk7GNi02MA0GCSqGSIb3DQEBCwUAMEExCzAJBgNVBAYTAlJPMRQw +EgYDVQQKEwtDRVJUU0lHTiBTQTEcMBoGA1UECxMTY2VydFNJR04gUk9PVCBDQSBHMjAeFw0xNzAy +MDYwOTI3MzVaFw00MjAyMDYwOTI3MzVaMEExCzAJBgNVBAYTAlJPMRQwEgYDVQQKEwtDRVJUU0lH +TiBTQTEcMBoGA1UECxMTY2VydFNJR04gUk9PVCBDQSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAMDFdRmRfUR0dIf+DjuW3NgBFszuY5HnC2/OOwppGnzC46+CjobXXo9X69MhWf05 +N0IwvlDqtg+piNguLWkh59E3GE59kdUWX2tbAMI5Qw02hVK5U2UPHULlj88F0+7cDBrZuIt4Imfk +abBoxTzkbFpG583H+u/E7Eu9aqSs/cwoUe+StCmrqzWaTOTECMYmzPhpn+Sc8CnTXPnGFiWeI8Mg +wT0PPzhAsP6CRDiqWhqKa2NYOLQV07YRaXseVO6MGiKscpc/I1mbySKEwQdPzH/iV8oScLumZf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AhZkPuXaTH4M +NMn5X7azKFGnpyuqSfqNZSlO42sTp5SjLVFteAxEy9/eCG/Oo2Sr05WE1LlSVHJ7liXMvGnjSG4N +0MedJ5qq+BOS3R7fY581qRY27Iy4g/Q9iY/NtBde17MXQRBdJ3NghVdJIgc= +-----END CERTIFICATE----- + +Trustwave Global Certification Authority +======================================== +-----BEGIN CERTIFICATE----- +MIIF2jCCA8KgAwIBAgIMBfcOhtpJ80Y1LrqyMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJV +UzERMA8GA1UECAwISWxsaW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xITAfBgNVBAoMGFRydXN0d2F2 +ZSBIb2xkaW5ncywgSW5jLjExMC8GA1UEAwwoVHJ1c3R3YXZlIEdsb2JhbCBDZXJ0aWZpY2F0aW9u +IEF1dGhvcml0eTAeFw0xNzA4MjMxOTM0MTJaFw00MjA4MjMxOTM0MTJaMIGIMQswCQYDVQQGEwJV +UzERMA8GA1UECAwISWxsaW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xITAfBgNVBAoMGFRydXN0d2F2 +ZSBIb2xkaW5ncywgSW5jLjExMC8GA1UEAwwoVHJ1c3R3YXZlIEdsb2JhbCBDZXJ0aWZpY2F0aW9u +IEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALldUShLPDeS0YLOvR29 +zd24q88KPuFd5dyqCblXAj7mY2Hf8g+CY66j96xz0XznswuvCAAJWX/NKSqIk4cXGIDtiLK0thAf +LdZfVaITXdHG6wZWiYj+rDKd/VzDBcdu7oaJuogDnXIhhpCujwOl3J+IKMujkkkP7NAP4m1ET4Bq +stTnoApTAbqOl5F2brz81Ws25kCI1nsvXwXoLG0R8+eyvpJETNKXpP7ScoFDB5zpET71ixpZfR9o +WN0EACyW80OzfpgZdNmcc9kYvkHHNHnZ9GLCQ7mzJ7Aiy/k9UscwR7PJPrhq4ufogXBeQotPJqX+ +OsIgbrv4Fo7N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qQ9EEC+j2Jjg6mcgn0tAumDMHzLJ8n9HmYAsC7TIS+OMxZsmO0QqAfWzJPP +29FpHOTKyeC2nOnOcXHebD8WpHk= +-----END CERTIFICATE----- + +Trustwave Global ECC P256 Certification Authority +================================================= +-----BEGIN CERTIFICATE----- +MIICYDCCAgegAwIBAgIMDWpfCD8oXD5Rld9dMAoGCCqGSM49BAMCMIGRMQswCQYDVQQGEwJVUzER +MA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRydXN0d2F2ZSBI +b2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDI1NiBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eTAeFw0xNzA4MjMxOTM1MTBaFw00MjA4MjMxOTM1MTBaMIGRMQswCQYD +VQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRy +dXN0d2F2ZSBIb2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDI1 +NiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABH77bOYj +43MyCMpg5lOcunSNGLB4kFKA3TjASh3RqMyTpJcGOMoNFWLGjgEqZZ2q3zSRLoHB5DOSMcT9CTqm +P62jQzBBMA8GA1UdEwEB/wQFMAMBAf8wDwYDVR0PAQH/BAUDAwcGADAdBgNVHQ4EFgQUo0EGrJBt +0UrrdaVKEJmzsaGLSvcwCgYIKoZIzj0EAwIDRwAwRAIgB+ZU2g6gWrKuEZ+Hxbb/ad4lvvigtwjz +RM4q3wghDDcCIC0mA6AFvWvR9lz4ZcyGbbOcNEhjhAnFjXca4syc4XR7 +-----END CERTIFICATE----- + +Trustwave Global ECC P384 Certification Authority +================================================= +-----BEGIN CERTIFICATE----- +MIICnTCCAiSgAwIBAgIMCL2Fl2yZJ6SAaEc7MAoGCCqGSM49BAMDMIGRMQswCQYDVQQGEwJVUzER +MA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRydXN0d2F2ZSBI +b2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDM4NCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eTAeFw0xNzA4MjMxOTM2NDNaFw00MjA4MjMxOTM2NDNaMIGRMQswCQYD +VQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRy +dXN0d2F2ZSBIb2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDM4 +NCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTB2MBAGByqGSM49AgEGBSuBBAAiA2IABGvaDXU1CDFH +Ba5FmVXxERMuSvgQMSOjfoPTfygIOiYaOs+Xgh+AtycJj9GOMMQKmw6sWASr9zZ9lCOkmwqKi6vr +/TklZvFe/oyujUF5nQlgziip04pt89ZF1PKYhDhloKNDMEEwDwYDVR0TAQH/BAUwAwEB/zAPBgNV +HQ8BAf8EBQMDBwYAMB0GA1UdDgQWBBRVqYSJ0sEyvRjLbKYHTsjnnb6CkDAKBggqhkjOPQQDAwNn +ADBkAjA3AZKXRRJ+oPM+rRk6ct30UJMDEr5E0k9BpIycnR+j9sKS50gU/k6bpZFXrsY3crsCMGcl +CrEMXu6pY5Jv5ZAL/mYiykf9ijH3g/56vxC+GCsej/YpHpRZ744hN8tRmKVuSw== +-----END CERTIFICATE----- + +NAVER Global Root Certification Authority +========================================= +-----BEGIN CERTIFICATE----- +MIIFojCCA4qgAwIBAgIUAZQwHqIL3fXFMyqxQ0Rx+NZQTQ0wDQYJKoZIhvcNAQEMBQAwaTELMAkG +A1UEBhMCS1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HQ4EFgQU0p+I36HNLL3s9TsBAZMzJ7LrYEswDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMB +Af8wDQYJKoZIhvcNAQEMBQADggIBADLKgLOdPVQG3dLSLvCkASELZ0jKbY7gyKoNqo0hV4/GPnrK +21HUUrPUloSlWGB/5QuOH/XcChWB5Tu2tyIvCZwTFrFsDDUIbatjcu3cvuzHV+YwIHHW1xDBE1UB +jCpD5EHxzzp6U5LOogMFDTjfArsQLtk70pt6wKGm+LUx5vR1yblTmXVHIloUFcd4G7ad6Qz4G3bx +hYTeodoS76TiEJd6eN4MUZeoIUCLhr0N8F5OSza7OyAfikJW4Qsav3vQIkMsRIz75Sq0bBwcupTg +E34h5prCy8VCZLQelHsIJchxzIdFV4XTnyliIoNRlwAYl3dqmJLJfGBs32x9SuRwTMKeuB330DTH +D8z7p/8Dvq1wkNoL3chtl1+afwkyQf3NosxabUzyqkn+Zvjp2DXrDige7kgvOtB5CTh8piKCk5XQ +A76+AqAF3SAi428diDRgxuYKuQl1C/AH6GmWNcf7I4GOODm4RStDeKLRLBT/DShycpWbXgnbiUSY +qqFJu3FS8r/2/yehNq+4tneI3TqkbZs0kNwUXTC/t+sX5Ie3cdCh13cV1ELX8vMxmV2b3RZtP+oG +I/hGoiLtk/bdmuYqh7GYVPEi92tF4+KOdh2ajcQGjTa3FPOdVGm3jjzVpG2Tgbet9r1ke8LJaDmg +kpzNNIaRkPpkUZ3+/uul9XXeifdy +-----END CERTIFICATE----- + +AC RAIZ FNMT-RCM SERVIDORES SEGUROS +=================================== +-----BEGIN CERTIFICATE----- +MIICbjCCAfOgAwIBAgIQYvYybOXE42hcG2LdnC6dlTAKBggqhkjOPQQDAzB4MQswCQYDVQQGEwJF +UzERMA8GA1UECgwIRk5NVC1SQ00xDjAMBgNVBAsMBUNlcmVzMRgwFgYDVQRhDA9WQVRFUy1RMjgy +NjAwNEoxLDAqBgNVBAMMI0FDIFJBSVogRk5NVC1SQ00gU0VSVklET1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BlAjEA31SQ7Zvvi5QCkxeCmb6zniz2C5GMn0oUsfZk +vLtoURMMA/cVi4RguYv/Uo7njLwcAjA8+RHUjE7AwWHCFUyqqx0LMV87HOIAl0Qx5v5zli/altP+ +CAezNIm8BZ/3Hobui3A= +-----END CERTIFICATE----- + +GLOBALTRUST 2020 +================ +-----BEGIN CERTIFICATE----- +MIIFgjCCA2qgAwIBAgILWku9WvtPilv6ZeUwDQYJKoZIhvcNAQELBQAwTTELMAkGA1UEBhMCQVQx +IzAhBgNVBAoTGmUtY29tbWVyY2UgbW9uaXRvcmluZyBHbWJIMRkwFwYDVQQDExBHTE9CQUxUUlVT +VCAyMDIwMB4XDTIwMDIxMDAwMDAwMFoXDTQwMDYxMDAwMDAwMFowTTELMAkGA1UEBhMCQVQxIzAh +BgNVBAoTGmUtY29tbWVyY2UgbW9uaXRvcmluZyBHbWJIMRkwFwYDVQQDExBHTE9CQUxUUlVTVCAy +MDIwMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAri5WrRsc7/aVj6B3GyvTY4+ETUWi +D59bRatZe1E0+eyLinjF3WuvvcTfk0Uev5E4C64OFudBc/jbu9G4UeDLgztzOG53ig9ZYybNpyrO +VPu44sB8R85gfD+yc/LAGbaKkoc1DZAoouQVBGM+uq/ufF7MpotQsjj3QWPKzv9pj2gOlTblzLmM +CcpL3TGQlsjMH/1WljTbjhzqLL6FLmPdqqmV0/0plRPwyJiT2S0WR5ARg6I6IqIoV6Lr/sCMKKCm +fecqQjuCgGOlYx8ZzHyyZqjC0203b+J+BlHZRYQfEs4kUmSFC0iAToexIiIwquuuvuAC4EDosEKA +A1GqtH6qRNdDYfOiaxaJSaSjpCuKAsR49GiKweR6NrFvG5Ybd0mN1MkGco/PU+PcF4UgStyYJ9OR +JitHHmkHr96i5OTUawuzXnzUJIBHKWk7buis/UDr2O1xcSvy6Fgd60GXIsUf1DnQJ4+H4xj04KlG +DfV0OoIu0G4skaMxXDtG6nsEEFZegB31pWXog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BEGIN CERTIFICATE----- +MIICZTCCAeugAwIBAgIQeI8nXIESUiClBNAt3bpz9DAKBggqhkjOPQQDAzB0MQswCQYDVQQGEwJQ +TDEhMB8GA1UEChMYQXNzZWNvIERhdGEgU3lzdGVtcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2Vy +dGlmaWNhdGlvbiBBdXRob3JpdHkxGTAXBgNVBAMTEENlcnR1bSBFQy0zODQgQ0EwHhcNMTgwMzI2 +MDcyNDU0WhcNNDMwMzI2MDcyNDU0WjB0MQswCQYDVQQGEwJQTDEhMB8GA1UEChMYQXNzZWNvIERh +dGEgU3lzdGVtcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkx +GTAXBgNVBAMTEENlcnR1bSBFQy0zODQgQ0EwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAATEKI6rGFtq +vm5kN2PkzeyrOvfMobgOgknXhimfoZTy42B4mIF4Bk3y7JoOV2CDn7TmFy8as10CW4kjPMIRBSqn +iBMY81CE1700LCeJVf/OTOffph8oxPBUw7l8t1Ot68KjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD +VR0OBBYEFI0GZnQkdjrzife81r1HfS+8EF9LMA4GA1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNo +ADBlAjADVS2m5hjEfO/JUG7BJw+ch69u1RsIGL2SKcHvlJF40jocVYli5RsJHrpka/F2tNQCMQC0 +QoSZ/6vnnvuRlydd3LBbMHHOXjgaatkl5+r3YZJW+OraNsKHZZYuciUvf9/DE8k= +-----END CERTIFICATE----- + +Certum Trusted Root CA +====================== +-----BEGIN CERTIFICATE----- +MIIFwDCCA6igAwIBAgIQHr9ZULjJgDdMBvfrVU+17TANBgkqhkiG9w0BAQ0FADB6MQswCQYDVQQG +EwJQTDEhMB8GA1UEChMYQXNzZWNvIERhdGEgU3lzdGVtcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0g +Q2VydGlmaW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BSM+xx1 +vALTn04uSNn5YFSqxLNP+jAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQENBQADggIBAEii1QAL +LtA/vBzVtVRJHlpr9OTy4EA34MwUe7nJ+jW1dReTagVphZzNTxl4WxmB82M+w85bj/UvXgF2Ez8s +ALnNllI5SW0ETsXpD4YN4fqzX4IS8TrOZgYkNCvozMrnadyHncI013nR03e4qllY/p0m+jiGPp2K +h2RX5Rc64vmNueMzeMGQ2Ljdt4NR5MTMI9UGfOZR0800McD2RrsLrfw9EAUqO0qRJe6M1ISHgCq8 +CYyqOhNf6DR5UMEQGfnTKB7U0VEwKbOukGfWHwpjscWpxkIxYxeU72nLL/qMFH3EQxiJ2fAyQOaA +4kZf5ePBAFmo+eggvIksDkc0C+pXwlM2/KfUrzHN/gLldfq5Jwn58/U7yn2fqSLLiMmq0Uc9Nneo +WWRrJ8/vJ8HjJLWG965+Mk2weWjROeiQWMODvA8s1pfrzgzhIMfatz7DP78v3DSk+yshzWePS/Tj +6tQ/50+6uaWTRRxmHyH6ZF5v4HaUMst19W7l9o/HuKTMqJZ9ZPskWkoDbGs4xugDQ5r3V7mzKWmT +OPQD8rv7gmsHINFSH5pkAnuYZttcTVoP0ISVoDwUQwbKytu4QTbaakRnh6+v40URFWkIsr4WOZck +bxJF0WddCajJFdr60qZfE2Efv4WstK2tBZQIgx51F9NxO5NQI1mg7TyRVJ12AMXDuDjb +-----END CERTIFICATE----- + +TunTrust Root CA +================ +-----BEGIN CERTIFICATE----- +MIIFszCCA5ugAwIBAgIUEwLV4kBMkkaGFmddtLu7sms+/BMwDQYJKoZIhvcNAQELBQAwYTELMAkG +A1UEBhMCVE4xNzA1BgNVBAoMLkFnZW5jZSBOYXRpb25hbGUgZGUgQ2VydGlmaWNhdGlvbiBFbGVj +dHJvbmlxdWUxGTAXBgNVBAMMEFR1blRydXN0IFJvb3QgQ0EwHhcNMTkwNDI2MDg1NzU2WhcNNDQw +NDI2MDg1NzU2WjBhMQswCQY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VSJ4hxyXT968pk21vvHl26v9Hr7lxpuhbI87mP0zYuQEkHDVneixCwSQXi/5E/S7fd +Ao74gShczNxtr18UnH1YeA32gAm56Q6XKRm4t+v4FstVEuTGfbvE7Pi1HE4+Z7/FXxttbUcoqgRY +YdZ2vyJ/0Adqp2RT8JeNnYA/u8EH22Wv5psymsNUk8QcCMNE+3tjEUPRahphanltkE8pjkcFwRJp +adbGNjHh/PqAulxPxOu3Mqz4dWEX1xAZufHSCe96Qp1bWgvUxpVOKs7/B9dPfhgGiPEZtdmYu65x +xBzndFlY7wyJz4sfdZMaBBSSSFCp61cpABbjNhzI+L/wM9VBD8TMPN3pM0MBkRArHtG5Xc0yGYuP +jCB31yLEQtyEFpslbei0VXF/sHyz03FJuc9SpAQ/3D2gu68zngowYI7bnV2UqL1g52KAdoGDDIzM +MEZJ4gzSqK/rYXHv5yJiqfdcZGyfFoxnNidF9Ql7v/YQCvGwjVRDjAS6oz/v4jXH+XTgbzRB0L9z +ZVcg+ZtnemZoJE6AZb0QmQZZ8mWvuMZHu/2QeItBcy6vVR/cO5JyboTT0GFMDcx2V+IthSIVNg3r +AZ3r2OvEhJn7wAzMMujjd9qDRIueVSjAi1jTkD5OGwDxFa2DK5o= +-----END CERTIFICATE----- + +HARICA TLS RSA Root CA 2021 +=========================== +-----BEGIN CERTIFICATE----- +MIIFpDCCA4ygAwIBAgIQOcqTHO9D88aOk8f0ZIk4fjANBgkqhkiG9w0BAQsFADBsMQswCQYDVQQG +EwJHUjE3MDUGA1UECgwuSGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9u +cyBDQTEkMCIGA1UEAwwbSEFSSUNBIFRMUyBSU0EgUm9vdCBDQSAyMDIxMB4XDTIxMDIxOTEwNTUz +OFoXDTQ1MDIxMzEwNTUzN1owbDELMAkGA1UEBhMCR1IxNzA1BgNVBAoMLkhlbGxlbmljIEFjYWRl +bWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGl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MM7KKrxcm1l +AEeIhPyaJmuqS7psBAqIXhfyVYf8MLA04jRYVxqEU+kw2anylnTDUR9YSTHMmE5gEYd103KUkE+b +ECUqqHgtvpBBWJAVcqeht6NCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUyRtTgRL+BNUW +0aq8mm+3oJUZbsowDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMDA2cAMGQCMBHervjcToiwqfAi +rcJRQO9gcS3ujwLEXQNwSaSS6sUUiHCm0w2wqsosQJz76YJumgIwK0eaB8bRwoF8yguWGEEbo/Qw +CZ61IygNnxS2PFOiTAZpffpskcYqSUXm7LcT4Tps +-----END CERTIFICATE----- diff --git a/vendor/composer/ca-bundle/src/CaBundle.php b/vendor/composer/ca-bundle/src/CaBundle.php new file mode 100644 index 00000000..d99c00f6 --- /dev/null +++ b/vendor/composer/ca-bundle/src/CaBundle.php @@ -0,0 +1,431 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\CaBundle; + +use Psr\Log\LoggerInterface; +use Symfony\Component\Process\PhpProcess; + +/** + * @author Chris Smith + * @author Jordi Boggiano + */ +class CaBundle +{ + /** @var string|null */ + private static $caPath; + /** @var array */ + private static $caFileValidity = array(); + /** @var bool|null */ + private static $useOpensslParse; + + /** + * Returns the system CA bundle path, or a path to the bundled one + * + * This method was adapted from Sslurp. + * https://github.com/EvanDotPro/Sslurp + * + * (c) Evan Coury + * + * For the full copyright and license information, please see below: + * + * Copyright (c) 2013, Evan Coury + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @param LoggerInterface $logger optional logger for information about which CA files were loaded + * @return string path to a CA bundle file or directory + */ + public static function getSystemCaRootBundlePath(LoggerInterface $logger = null) + { + if (self::$caPath !== null) { + return self::$caPath; + } + $caBundlePaths = array(); + + // If SSL_CERT_FILE env variable points to a valid certificate/bundle, use that. + // This mimics how OpenSSL uses the SSL_CERT_FILE env variable. + $caBundlePaths[] = self::getEnvVariable('SSL_CERT_FILE'); + + // If SSL_CERT_DIR env variable points to a valid certificate/bundle, use that. + // This mimics how OpenSSL uses the SSL_CERT_FILE env variable. + $caBundlePaths[] = self::getEnvVariable('SSL_CERT_DIR'); + + $caBundlePaths[] = ini_get('openssl.cafile'); + $caBundlePaths[] = ini_get('openssl.capath'); + + $otherLocations = array( + '/etc/pki/tls/certs/ca-bundle.crt', // Fedora, RHEL, CentOS (ca-certificates package) + '/etc/ssl/certs/ca-certificates.crt', // Debian, Ubuntu, Gentoo, Arch Linux (ca-certificates package) + '/etc/ssl/ca-bundle.pem', // SUSE, openSUSE (ca-certificates package) + '/usr/local/share/certs/ca-root-nss.crt', // FreeBSD (ca_root_nss_package) + '/usr/ssl/certs/ca-bundle.crt', // Cygwin + '/opt/local/share/curl/curl-ca-bundle.crt', // OS X macports, curl-ca-bundle package + '/usr/local/share/curl/curl-ca-bundle.crt', // Default cURL CA bunde path (without --with-ca-bundle option) + '/usr/share/ssl/certs/ca-bundle.crt', // Really old RedHat? + '/etc/ssl/cert.pem', // OpenBSD + '/usr/local/etc/ssl/cert.pem', // FreeBSD 10.x + '/usr/local/etc/openssl/cert.pem', // OS X homebrew, openssl package + '/usr/local/etc/openssl@1.1/cert.pem', // OS X homebrew, openssl@1.1 package + ); + + foreach($otherLocations as $location) { + $otherLocations[] = dirname($location); + } + + $caBundlePaths = array_merge($caBundlePaths, $otherLocations); + + foreach ($caBundlePaths as $caBundle) { + if ($caBundle && self::caFileUsable($caBundle, $logger)) { + return self::$caPath = $caBundle; + } + + if ($caBundle && self::caDirUsable($caBundle, $logger)) { + return self::$caPath = $caBundle; + } + } + + return self::$caPath = static::getBundledCaBundlePath(); // Bundled CA file, last resort + } + + /** + * Returns the path to the bundled CA file + * + * In case you don't want to trust the user or the system, you can use this directly + * + * @return string path to a CA bundle file + */ + public static function getBundledCaBundlePath() + { + $caBundleFile = __DIR__.'/../res/cacert.pem'; + + // cURL does not understand 'phar://' paths + // see https://github.com/composer/ca-bundle/issues/10 + if (0 === strpos($caBundleFile, 'phar://')) { + $tempCaBundleFile = tempnam(sys_get_temp_dir(), 'openssl-ca-bundle-'); + if (false === $tempCaBundleFile) { + throw new \RuntimeException('Could not create a temporary file to store the bundled CA file'); + } + + file_put_contents( + $tempCaBundleFile, + file_get_contents($caBundleFile) + ); + + register_shutdown_function(function() use ($tempCaBundleFile) { + @unlink($tempCaBundleFile); + }); + + $caBundleFile = $tempCaBundleFile; + } + + return $caBundleFile; + } + + /** + * Validates a CA file using opensl_x509_parse only if it is safe to use + * + * @param string $filename + * @param LoggerInterface $logger optional logger for information about which CA files were loaded + * + * @return bool + */ + public static function validateCaFile($filename, LoggerInterface $logger = null) + { + static $warned = false; + + if (isset(self::$caFileValidity[$filename])) { + return self::$caFileValidity[$filename]; + } + + $contents = file_get_contents($filename); + + // assume the CA is valid if php is vulnerable to + // https://www.sektioneins.de/advisories/advisory-012013-php-openssl_x509_parse-memory-corruption-vulnerability.html + if (!static::isOpensslParseSafe()) { + if (!$warned && $logger) { + $logger->warning(sprintf( + 'Your version of PHP, %s, is affected by CVE-2013-6420 and cannot safely perform certificate validation, we strongly suggest you upgrade.', + PHP_VERSION + )); + $warned = true; + } + + $isValid = !empty($contents); + } elseif (is_string($contents) && strlen($contents) > 0) { + $contents = preg_replace("/^(\\-+(?:BEGIN|END))\\s+TRUSTED\\s+(CERTIFICATE\\-+)\$/m", '$1 $2', $contents); + if (null === $contents) { + // regex extraction failed + $isValid = false; + } else { + $isValid = (bool) openssl_x509_parse($contents); + } + } else { + $isValid = false; + } + + if ($logger) { + $logger->debug('Checked CA file '.realpath($filename).': '.($isValid ? 'valid' : 'invalid')); + } + + return self::$caFileValidity[$filename] = $isValid; + } + + /** + * Test if it is safe to use the PHP function openssl_x509_parse(). + * + * This checks if OpenSSL extensions is vulnerable to remote code execution + * via the exploit documented as CVE-2013-6420. + * + * @return bool + */ + public static function isOpensslParseSafe() + { + if (null !== self::$useOpensslParse) { + return self::$useOpensslParse; + } + + if (PHP_VERSION_ID >= 50600) { + return self::$useOpensslParse = true; + } + + // Vulnerable: + // PHP 5.3.0 - PHP 5.3.27 + // PHP 5.4.0 - PHP 5.4.22 + // PHP 5.5.0 - PHP 5.5.6 + if ( + (PHP_VERSION_ID < 50400 && PHP_VERSION_ID >= 50328) + || (PHP_VERSION_ID < 50500 && PHP_VERSION_ID >= 50423) + || PHP_VERSION_ID >= 50507 + ) { + // This version of PHP has the fix for CVE-2013-6420 applied. + return self::$useOpensslParse = true; + } + + if (defined('PHP_WINDOWS_VERSION_BUILD')) { + // Windows is probably insecure in this case. + return self::$useOpensslParse = false; + } + + $compareDistroVersionPrefix = function ($prefix, $fixedVersion) { + $regex = '{^'.preg_quote($prefix).'([0-9]+)$}'; + + if (preg_match($regex, PHP_VERSION, $m)) { + return ((int) $m[1]) >= $fixedVersion; + } + + return false; + }; + + // Hard coded list of PHP distributions with the fix backported. + if ( + $compareDistroVersionPrefix('5.3.3-7+squeeze', 18) // Debian 6 (Squeeze) + || $compareDistroVersionPrefix('5.4.4-14+deb7u', 7) // Debian 7 (Wheezy) + || $compareDistroVersionPrefix('5.3.10-1ubuntu3.', 9) // Ubuntu 12.04 (Precise) + ) { + return self::$useOpensslParse = true; + } + + // Symfony Process component is missing so we assume it is unsafe at this point + if (!class_exists('Symfony\Component\Process\PhpProcess')) { + return self::$useOpensslParse = false; + } + + // This is where things get crazy, because distros backport security + // fixes the chances are on NIX systems the fix has been applied but + // it's not possible to verify that from the PHP version. + // + // To verify exec a new PHP process and run the issue testcase with + // known safe input that replicates the bug. + + // Based on testcase in https://github.com/php/php-src/commit/c1224573c773b6845e83505f717fbf820fc18415 + // changes in https://github.com/php/php-src/commit/76a7fd893b7d6101300cc656058704a73254d593 + $cert = 'LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVwRENDQTR5Z0F3SUJBZ0lKQUp6dThyNnU2ZUJjTUEwR0NTcUdTSWIzRFFFQkJRVUFNSUhETVFzd0NRWUQKVlFRR0V3SkVSVEVjTUJvR0ExVUVDQXdUVG05eVpISm9aV2x1TFZkbGMzUm1ZV3hsYmpFUU1BNEdBMVVFQnd3SApTOE9Ed3Jac2JqRVVNQklHQTFVRUNnd0xVMlZyZEdsdmJrVnBibk14SHpBZEJnTlZCQXNNRmsxaGJHbGphVzkxCmN5QkRaWEowSUZObFkzUnBiMjR4SVRBZkJnTlZCQU1NR0cxaGJHbGphVzkxY3k1elpXdDBhVzl1WldsdWN5NWsKWlRFcU1DZ0dDU3FHU0liM0RRRUpBUlliYzNSbFptRnVMbVZ6YzJWeVFITmxhM1JwYjI1bGFXNXpMbVJsTUhVWQpaREU1TnpBd01UQXh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PdU4rblpMUEJtM3ZXeG50eUlJdlZBZ01CQUFHalFqQkFNQWtHQTFVZEV3UUNNQUF3CkVRWUpZSVpJQVliNFFnRUJCQVFEQWdlQU1Bc0dBMVVkRHdRRUF3SUZvREFUQmdOVkhTVUVEREFLQmdnckJnRUYKQlFjREFqQU5CZ2txaGtpRzl3MEJBUVVGQUFPQ0FRRUFHMGZaWVlDVGJkajFYWWMrMVNub2FQUit2SThDOENhRAo4KzBVWWhkbnlVNGdnYTBCQWNEclk5ZTk0ZUVBdTZacXljRjZGakxxWFhkQWJvcHBXb2NyNlQ2R0QxeDMzQ2tsClZBcnpHL0t4UW9oR0QySmVxa2hJTWxEb214SE83a2EzOStPYThpMnZXTFZ5alU4QVp2V01BcnVIYTRFRU55RzcKbFcyQWFnYUZLRkNyOVRuWFRmcmR4R1ZFYnY3S1ZRNmJkaGc1cDVTanBXSDErTXEwM3VSM1pYUEJZZHlWODMxOQpvMGxWajFLRkkyRENML2xpV2lzSlJvb2YrMWNSMzVDdGQwd1lCY3BCNlRac2xNY09QbDc2ZHdLd0pnZUpvMlFnClpzZm1jMnZDMS9xT2xOdU5xLzBUenprVkd2OEVUVDNDZ2FVK1VYZTRYT1Z2a2NjZWJKbjJkZz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K'; + $script = <<<'EOT' + +error_reporting(-1); +$info = openssl_x509_parse(base64_decode('%s')); +var_dump(PHP_VERSION, $info['issuer']['emailAddress'], $info['validFrom_time_t']); + +EOT; + $script = '<'."?php\n".sprintf($script, $cert); + + try { + $process = new PhpProcess($script); + $process->mustRun(); + } catch (\Exception $e) { + // In the case of any exceptions just accept it is not possible to + // determine the safety of openssl_x509_parse and bail out. + return self::$useOpensslParse = false; + } + + $output = preg_split('{\r?\n}', trim($process->getOutput())); + $errorOutput = trim($process->getErrorOutput()); + + if ( + is_array($output) + && count($output) === 3 + && $output[0] === sprintf('string(%d) "%s"', strlen(PHP_VERSION), PHP_VERSION) + && $output[1] === 'string(27) "stefan.esser@sektioneins.de"' + && $output[2] === 'int(-1)' + && preg_match('{openssl_x509_parse\(\): illegal (?:ASN1 data type for|length in) timestamp in - on line \d+}', $errorOutput) + ) { + // This PHP has the fix backported probably by a distro security team. + return self::$useOpensslParse = true; + } + + return self::$useOpensslParse = false; + } + + /** + * Resets the static caches + * @return void + */ + public static function reset() + { + self::$caFileValidity = array(); + self::$caPath = null; + self::$useOpensslParse = null; + } + + /** + * @param string $name + * @return string|false + */ + private static function getEnvVariable($name) + { + if (isset($_SERVER[$name])) { + return (string) $_SERVER[$name]; + } + + if (PHP_SAPI === 'cli' && ($value = getenv($name)) !== false && $value !== null) { + return (string) $value; + } + + return false; + } + + /** + * @param string|false $certFile + * @param LoggerInterface|null $logger + * @return bool + */ + private static function caFileUsable($certFile, LoggerInterface $logger = null) + { + return $certFile + && static::isFile($certFile, $logger) + && static::isReadable($certFile, $logger) + && static::validateCaFile($certFile, $logger); + } + + /** + * @param string|false $certDir + * @param LoggerInterface|null $logger + * @return bool + */ + private static function caDirUsable($certDir, LoggerInterface $logger = null) + { + return $certDir + && static::isDir($certDir, $logger) + && static::isReadable($certDir, $logger) + && static::glob($certDir . '/*', $logger); + } + + /** + * @param string $certFile + * @param LoggerInterface|null $logger + * @return bool + */ + private static function isFile($certFile, LoggerInterface $logger = null) + { + $isFile = @is_file($certFile); + if (!$isFile && $logger) { + $logger->debug(sprintf('Checked CA file %s does not exist or it is not a file.', $certFile)); + } + + return $isFile; + } + + /** + * @param string $certDir + * @param LoggerInterface|null $logger + * @return bool + */ + private static function isDir($certDir, LoggerInterface $logger = null) + { + $isDir = @is_dir($certDir); + if (!$isDir && $logger) { + $logger->debug(sprintf('Checked directory %s does not exist or it is not a directory.', $certDir)); + } + + return $isDir; + } + + /** + * @param string $certFileOrDir + * @param LoggerInterface|null $logger + * @return bool + */ + private static function isReadable($certFileOrDir, LoggerInterface $logger = null) + { + $isReadable = @is_readable($certFileOrDir); + if (!$isReadable && $logger) { + $logger->debug(sprintf('Checked file or directory %s is not readable.', $certFileOrDir)); + } + + return $isReadable; + } + + /** + * @param string $pattern + * @param LoggerInterface|null $logger + * @return bool + */ + private static function glob($pattern, LoggerInterface $logger = null) + { + $certs = glob($pattern); + if ($certs === false) { + if ($logger) { + $logger->debug(sprintf("An error occurred while trying to find certificates for pattern: %s", $pattern)); + } + return false; + } + + if (count($certs) === 0) { + if ($logger) { + $logger->debug(sprintf("No CA files found for pattern: %s", $pattern)); + } + return false; + } + + return true; + } +} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json new file mode 100644 index 00000000..f2432d65 --- /dev/null +++ b/vendor/composer/installed.json @@ -0,0 +1,2056 @@ +{ + "packages": [ + { + "name": "clue/stream-filter", + "version": "v1.5.0", + "version_normalized": "1.5.0.0", + "source": { + "type": "git", + "url": "https://github.com/clue/stream-filter.git", + "reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/stream-filter/zipball/aeb7d8ea49c7963d3b581378955dbf5bc49aa320", + "reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + }, + "time": "2020-10-02T12:38:20+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Clue\\StreamFilter\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "A simple and modern approach to stream filtering in PHP", + "homepage": "https://github.com/clue/php-stream-filter", + "keywords": [ + "bucket brigade", + "callback", + "filter", + "php_user_filter", + "stream", + "stream_filter_append", + "stream_filter_register" + ], + "support": { + "issues": "https://github.com/clue/stream-filter/issues", + "source": "https://github.com/clue/stream-filter/tree/v1.5.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "install-path": "../clue/stream-filter" + }, + { + "name": "composer/ca-bundle", + "version": "1.3.1", + "version_normalized": "1.3.1.0", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b", + "reference": "4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.55", + "psr/log": "^1.0", + "symfony/phpunit-bridge": "^4.2 || ^5", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + }, + "time": "2021-10-28T20:44:15+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues", + "source": "https://github.com/composer/ca-bundle/tree/1.3.1" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "install-path": "./ca-bundle" + }, + { + "name": "embed/embed", + "version": "v4.4.0", + "version_normalized": "4.4.0.0", + "source": { + "type": "git", + "url": "https://github.com/oscarotero/Embed.git", + "reference": "24fe9376e8de48c536ddaddf0025ae39cae5ddfe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/oscarotero/Embed/zipball/24fe9376e8de48c536ddaddf0025ae39cae5ddfe", + "reference": "24fe9376e8de48c536ddaddf0025ae39cae5ddfe", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.0", + "ext-curl": "*", + "ext-dom": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ml/json-ld": "^1.1", + "oscarotero/html-parser": "^0.1.4", + "php": "^7.4|^8", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "brick/varexporter": "^0.3.1", + "friendsofphp/php-cs-fixer": "^2.0", + "nyholm/psr7": "^1.2", + "oscarotero/php-cs-fixer-config": "^1.0", + "phpunit/phpunit": "^9.0", + "symfony/css-selector": "^5.0" + }, + "suggest": { + "symfony/css-selector": "If you want to get elements using css selectors" + }, + "time": "2022-01-08T13:26:18+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Embed\\": "src" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Oscar Otero", + "email": "oom@oscarotero.com", + "homepage": "http://oscarotero.com", + "role": "Developer" + } + ], + "description": "PHP library to retrieve page info using oembed, opengraph, etc", + "homepage": "https://github.com/oscarotero/Embed", + "keywords": [ + "embed", + "embedly", + "oembed", + "opengraph", + "twitter cards" + ], + "support": { + "email": "oom@oscarotero.com", + "issues": "https://github.com/oscarotero/Embed/issues", + "source": "https://github.com/oscarotero/Embed/tree/v4.4.0" + }, + "install-path": "../embed/embed" + }, + { + "name": "grandel/include-directory", + "version": "v0.2.2", + "version_normalized": "0.2.2.0", + "source": { + "type": "git", + "url": "https://github.com/grandeljay/include-directory.git", + "reference": "a5c830e8f1527c818b521ab18f2accecb02f9919" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grandeljay/include-directory/zipball/a5c830e8f1527c818b521ab18f2accecb02f9919", + "reference": "a5c830e8f1527c818b521ab18f2accecb02f9919", + "shasum": "" + }, + "require": { + "php": ">=7.4" + }, + "time": "2021-12-01T14:10:17+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Grandel\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "AGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Jay Trees", + "email": "github.jay@grandel.anonaddy.me" + } + ], + "description": "Automatically include all files in a given directory.", + "support": { + "issues": "https://github.com/grandeljay/include-directory/issues", + "source": "https://github.com/grandeljay/include-directory/tree/v0.2.2" + }, + "install-path": "../grandel/include-directory" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.4.1", + "version_normalized": "7.4.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee0a041b1760e6a53d2a39c8c34115adc2af2c79", + "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5", + "guzzlehttp/psr7": "^1.8.3 || ^2.1", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "ext-curl": "*", + "php-http/client-integration-tests": "^3.0", + "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "time": "2021-12-06T18:43:05+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.4-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.4.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "install-path": "../guzzlehttp/guzzle" + }, + { + "name": "guzzlehttp/promises", + "version": "1.5.1", + "version_normalized": "1.5.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "time": "2021-10-22T20:56:57+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "install-path": "../guzzlehttp/promises" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.1.0", + "version_normalized": "2.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "time": "2021-10-06T17:43:30+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.1.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "install-path": "../guzzlehttp/psr7" + }, + { + "name": "http-interop/http-factory-guzzle", + "version": "1.2.0", + "version_normalized": "1.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/http-interop/http-factory-guzzle.git", + "reference": "8f06e92b95405216b237521cc64c804dd44c4a81" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/http-interop/http-factory-guzzle/zipball/8f06e92b95405216b237521cc64c804dd44c4a81", + "reference": "8f06e92b95405216b237521cc64c804dd44c4a81", + "shasum": "" + }, + "require": { + "guzzlehttp/psr7": "^1.7||^2.0", + "php": ">=7.3", + "psr/http-factory": "^1.0" + }, + "provide": { + "psr/http-factory-implementation": "^1.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^9.5" + }, + "suggest": { + "guzzlehttp/psr7": "Includes an HTTP factory starting in version 2.0" + }, + "time": "2021-07-21T13:50:14+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Http\\Factory\\Guzzle\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "An HTTP Factory using Guzzle PSR7", + "keywords": [ + "factory", + "http", + "psr-17", + "psr-7" + ], + "support": { + "issues": "https://github.com/http-interop/http-factory-guzzle/issues", + "source": "https://github.com/http-interop/http-factory-guzzle/tree/1.2.0" + }, + "install-path": "../http-interop/http-factory-guzzle" + }, + { + "name": "knplabs/github-api", + "version": "v3.4.0", + "version_normalized": "3.4.0.0", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/php-github-api.git", + "reference": "bddf0f5e686a2dc72ca0ec642e3b487b08d841ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/bddf0f5e686a2dc72ca0ec642e3b487b08d841ce", + "reference": "bddf0f5e686a2dc72ca0ec642e3b487b08d841ce", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.2.5 || ^8.0", + "php-http/cache-plugin": "^1.7.1", + "php-http/client-common": "^2.3", + "php-http/discovery": "^1.12", + "php-http/httplug": "^2.2", + "php-http/multipart-stream-builder": "^1.1.2", + "psr/cache": "^1.0|^2.0", + "psr/http-client-implementation": "^1.0", + "psr/http-factory-implementation": "^1.0", + "psr/http-message": "^1.0", + "symfony/deprecation-contracts": "^2.2", + "symfony/polyfill-php80": "^1.17" + }, + "require-dev": { + "guzzlehttp/guzzle": "^7.2", + "guzzlehttp/psr7": "^1.7", + "http-interop/http-factory-guzzle": "^1.0", + "php-http/mock-client": "^1.4.1", + "phpstan/extension-installer": "^1.0.5", + "phpstan/phpstan": "^0.12.57", + "phpstan/phpstan-deprecation-rules": "^0.12.5", + "phpunit/phpunit": "^8.5 || ^9.4", + "symfony/cache": "^5.1.8", + "symfony/phpunit-bridge": "^5.2" + }, + "time": "2021-12-08T07:25:22+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.20.x-dev", + "dev-master": "3.4.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Github\\": "lib/Github/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KnpLabs Team", + "homepage": "http://knplabs.com" + }, + { + "name": "Thibault Duplessis", + "email": "thibault.duplessis@gmail.com", + "homepage": "http://ornicar.github.com" + } + ], + "description": "GitHub API v3 client", + "homepage": "https://github.com/KnpLabs/php-github-api", + "keywords": [ + "api", + "gh", + "gist", + "github" + ], + "support": { + "issues": "https://github.com/KnpLabs/php-github-api/issues", + "source": "https://github.com/KnpLabs/php-github-api/tree/v3.4.0" + }, + "funding": [ + { + "url": "https://github.com/acrobat", + "type": "github" + } + ], + "install-path": "../knplabs/github-api" + }, + { + "name": "laminas/laminas-diactoros", + "version": "2.8.0", + "version_normalized": "2.8.0.0", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-diactoros.git", + "reference": "0c26ef1d95b6d7e6e3943a243ba3dc0797227199" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/0c26ef1d95b6d7e6e3943a243ba3dc0797227199", + "reference": "0c26ef1d95b6d7e6e3943a243ba3dc0797227199", + "shasum": "" + }, + "require": { + "php": "^7.3 || ~8.0.0 || ~8.1.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0" + }, + "conflict": { + "phpspec/prophecy": "<1.9.0", + "zendframework/zend-diactoros": "*" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-curl": "*", + "ext-dom": "*", + "ext-gd": "*", + "ext-libxml": "*", + "http-interop/http-factory-tests": "^0.8.0", + "laminas/laminas-coding-standard": "~1.0.0", + "php-http/psr7-integration-tests": "^1.1", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.1", + "psalm/plugin-phpunit": "^0.14.0", + "vimeo/psalm": "^4.3" + }, + "time": "2021-09-22T03:54:36+00:00", + "type": "library", + "extra": { + "laminas": { + "config-provider": "Laminas\\Diactoros\\ConfigProvider", + "module": "Laminas\\Diactoros" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "src/functions/create_uploaded_file.php", + "src/functions/marshal_headers_from_sapi.php", + "src/functions/marshal_method_from_sapi.php", + "src/functions/marshal_protocol_version_from_sapi.php", + "src/functions/marshal_uri_from_sapi.php", + "src/functions/normalize_server.php", + "src/functions/normalize_uploaded_files.php", + "src/functions/parse_cookie_header.php", + "src/functions/create_uploaded_file.legacy.php", + "src/functions/marshal_headers_from_sapi.legacy.php", + "src/functions/marshal_method_from_sapi.legacy.php", + "src/functions/marshal_protocol_version_from_sapi.legacy.php", + "src/functions/marshal_uri_from_sapi.legacy.php", + "src/functions/normalize_server.legacy.php", + "src/functions/normalize_uploaded_files.legacy.php", + "src/functions/parse_cookie_header.legacy.php" + ], + "psr-4": { + "Laminas\\Diactoros\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "PSR HTTP Message implementations", + "homepage": "https://laminas.dev", + "keywords": [ + "http", + "laminas", + "psr", + "psr-17", + "psr-7" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-diactoros/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-diactoros/issues", + "rss": "https://github.com/laminas/laminas-diactoros/releases.atom", + "source": "https://github.com/laminas/laminas-diactoros" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "install-path": "../laminas/laminas-diactoros" + }, + { + "name": "ml/iri", + "version": "1.1.4", + "version_normalized": "1.1.4.0", + "target-dir": "ML/IRI", + "source": { + "type": "git", + "url": "https://github.com/lanthaler/IRI.git", + "reference": "cbd44fa913e00ea624241b38cefaa99da8d71341" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lanthaler/IRI/zipball/cbd44fa913e00ea624241b38cefaa99da8d71341", + "reference": "cbd44fa913e00ea624241b38cefaa99da8d71341", + "shasum": "" + }, + "require": { + "lib-pcre": ">=4.0", + "php": ">=5.3.0" + }, + "time": "2014-01-21T13:43:39+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "ML\\IRI": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Markus Lanthaler", + "email": "mail@markus-lanthaler.com", + "homepage": "http://www.markus-lanthaler.com", + "role": "Developer" + } + ], + "description": "IRI handling for PHP", + "homepage": "http://www.markus-lanthaler.com", + "keywords": [ + "URN", + "iri", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/lanthaler/IRI/issues", + "source": "https://github.com/lanthaler/IRI/tree/master" + }, + "install-path": "../ml/iri/ML/IRI" + }, + { + "name": "ml/json-ld", + "version": "1.2.0", + "version_normalized": "1.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/lanthaler/JsonLD.git", + "reference": "c74a1aed5979ed1cfb1be35a55a305fd30e30b93" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lanthaler/JsonLD/zipball/c74a1aed5979ed1cfb1be35a55a305fd30e30b93", + "reference": "c74a1aed5979ed1cfb1be35a55a305fd30e30b93", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ml/iri": "^1.1.1", + "php": ">=5.3.0" + }, + "require-dev": { + "json-ld/tests": "1.0", + "phpunit/phpunit": "^4" + }, + "time": "2020-06-16T17:45:06+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "ML\\JsonLD\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Markus Lanthaler", + "email": "mail@markus-lanthaler.com", + "homepage": "http://www.markus-lanthaler.com", + "role": "Developer" + } + ], + "description": "JSON-LD Processor for PHP", + "homepage": "http://www.markus-lanthaler.com", + "keywords": [ + "JSON-LD", + "jsonld" + ], + "support": { + "issues": "https://github.com/lanthaler/JsonLD/issues", + "source": "https://github.com/lanthaler/JsonLD/tree/1.2.0" + }, + "install-path": "../ml/json-ld" + }, + { + "name": "oscarotero/html-parser", + "version": "v0.1.6", + "version_normalized": "0.1.6.0", + "source": { + "type": "git", + "url": "https://github.com/oscarotero/html-parser.git", + "reference": "b61e92f634d0dc184339d24630a6968d3ac64ded" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/oscarotero/html-parser/zipball/b61e92f634d0dc184339d24630a6968d3ac64ded", + "reference": "b61e92f634d0dc184339d24630a6968d3ac64ded", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.11", + "phpunit/phpunit": "^8.0" + }, + "time": "2020-11-19T17:43:46+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "HtmlParser\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Oscar Otero", + "email": "oom@oscarotero.com", + "homepage": "http://oscarotero.com", + "role": "Developer" + } + ], + "description": "Parse html strings to DOMDocument", + "homepage": "https://github.com/oscarotero/html-parser", + "keywords": [ + "dom", + "html", + "parser" + ], + "support": { + "email": "oom@oscarotero.com", + "issues": "https://github.com/oscarotero/html-parser/issues", + "source": "https://github.com/oscarotero/html-parser/tree/v0.1.6" + }, + "install-path": "../oscarotero/html-parser" + }, + { + "name": "php-http/cache-plugin", + "version": "1.7.5", + "version_normalized": "1.7.5.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/cache-plugin.git", + "reference": "63bc3f7242825c9a817db8f78e4c9703b0c471e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/cache-plugin/zipball/63bc3f7242825c9a817db8f78e4c9703b0c471e2", + "reference": "63bc3f7242825c9a817db8f78e4c9703b0c471e2", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/client-common": "^1.9 || ^2.0", + "php-http/message-factory": "^1.0", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + }, + "require-dev": { + "phpspec/phpspec": "^5.1 || ^6.0" + }, + "time": "2022-01-18T12:24:56+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Http\\Client\\Common\\Plugin\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "PSR-6 Cache plugin for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "cache", + "http", + "httplug", + "plugin" + ], + "support": { + "issues": "https://github.com/php-http/cache-plugin/issues", + "source": "https://github.com/php-http/cache-plugin/tree/1.7.5" + }, + "install-path": "../php-http/cache-plugin" + }, + { + "name": "php-http/client-common", + "version": "2.5.0", + "version_normalized": "2.5.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/client-common.git", + "reference": "d135751167d57e27c74de674d6a30cef2dc8e054" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/client-common/zipball/d135751167d57e27c74de674d6a30cef2dc8e054", + "reference": "d135751167d57e27c74de674d6a30cef2dc8e054", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/httplug": "^2.0", + "php-http/message": "^1.6", + "php-http/message-factory": "^1.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0", + "symfony/polyfill-php80": "^1.17" + }, + "require-dev": { + "doctrine/instantiator": "^1.1", + "guzzlehttp/psr7": "^1.4", + "nyholm/psr7": "^1.2", + "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", + "phpspec/prophecy": "^1.10.2", + "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" + }, + "suggest": { + "ext-json": "To detect JSON responses with the ContentTypePlugin", + "ext-libxml": "To detect XML responses with the ContentTypePlugin", + "php-http/cache-plugin": "PSR-6 Cache plugin", + "php-http/logger-plugin": "PSR-3 Logger plugin", + "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" + }, + "time": "2021-11-26T15:01:24+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Http\\Client\\Common\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Common HTTP Client implementations and tools for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "common", + "http", + "httplug" + ], + "support": { + "issues": "https://github.com/php-http/client-common/issues", + "source": "https://github.com/php-http/client-common/tree/2.5.0" + }, + "install-path": "../php-http/client-common" + }, + { + "name": "php-http/discovery", + "version": "1.14.1", + "version_normalized": "1.14.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "de90ab2b41d7d61609f504e031339776bc8c7223" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/de90ab2b41d7d61609f504e031339776bc8c7223", + "reference": "de90ab2b41d7d61609f504e031339776bc8c7223", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "nyholm/psr7": "<1.0" + }, + "require-dev": { + "graham-campbell/phpspec-skip-example-extension": "^5.0", + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^5.1 || ^6.1", + "puli/composer-plugin": "1.0.0-beta10" + }, + "suggest": { + "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories" + }, + "time": "2021-09-18T07:57:46+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds installed HTTPlug implementations and PSR-7 message factories", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr7" + ], + "support": { + "issues": "https://github.com/php-http/discovery/issues", + "source": "https://github.com/php-http/discovery/tree/1.14.1" + }, + "install-path": "../php-http/discovery" + }, + { + "name": "php-http/httplug", + "version": "2.2.0", + "version_normalized": "2.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/httplug.git", + "reference": "191a0a1b41ed026b717421931f8d3bd2514ffbf9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/httplug/zipball/191a0a1b41ed026b717421931f8d3bd2514ffbf9", + "reference": "191a0a1b41ed026b717421931f8d3bd2514ffbf9", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/promise": "^1.1", + "psr/http-client": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.1", + "phpspec/phpspec": "^5.1 || ^6.0" + }, + "time": "2020-07-13T15:43:23+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "HTTPlug, the HTTP client abstraction for PHP", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http" + ], + "support": { + "issues": "https://github.com/php-http/httplug/issues", + "source": "https://github.com/php-http/httplug/tree/master" + }, + "install-path": "../php-http/httplug" + }, + { + "name": "php-http/message", + "version": "1.12.0", + "version_normalized": "1.12.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/message.git", + "reference": "39eb7548be982a81085fe5a6e2a44268cd586291" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message/zipball/39eb7548be982a81085fe5a6e2a44268cd586291", + "reference": "39eb7548be982a81085fe5a6e2a44268cd586291", + "shasum": "" + }, + "require": { + "clue/stream-filter": "^1.5", + "php": "^7.1 || ^8.0", + "php-http/message-factory": "^1.0.2", + "psr/http-message": "^1.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.6", + "ext-zlib": "*", + "guzzlehttp/psr7": "^1.0", + "laminas/laminas-diactoros": "^2.0", + "phpspec/phpspec": "^5.1 || ^6.3", + "slim/slim": "^3.0" + }, + "suggest": { + "ext-zlib": "Used with compressor/decompressor streams", + "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", + "laminas/laminas-diactoros": "Used with Diactoros Factories", + "slim/slim": "Used with Slim Framework PSR-7 implementation" + }, + "time": "2021-08-29T09:13:12+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + }, + "files": [ + "src/filters.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTP Message related tools", + "homepage": "http://php-http.org", + "keywords": [ + "http", + "message", + "psr-7" + ], + "support": { + "issues": "https://github.com/php-http/message/issues", + "source": "https://github.com/php-http/message/tree/1.12.0" + }, + "install-path": "../php-http/message" + }, + { + "name": "php-http/message-factory", + "version": "v1.0.2", + "version_normalized": "1.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/message-factory.git", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "psr/http-message": "^1.0" + }, + "time": "2015-12-19T14:08:53+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Factory interfaces for PSR-7 HTTP Message", + "homepage": "http://php-http.org", + "keywords": [ + "factory", + "http", + "message", + "stream", + "uri" + ], + "support": { + "issues": "https://github.com/php-http/message-factory/issues", + "source": "https://github.com/php-http/message-factory/tree/master" + }, + "install-path": "../php-http/message-factory" + }, + { + "name": "php-http/multipart-stream-builder", + "version": "1.2.0", + "version_normalized": "1.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/multipart-stream-builder.git", + "reference": "11c1d31f72e01c738bbce9e27649a7cca829c30e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/multipart-stream-builder/zipball/11c1d31f72e01c738bbce9e27649a7cca829c30e", + "reference": "11c1d31f72e01c738bbce9e27649a7cca829c30e", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/discovery": "^1.7", + "php-http/message-factory": "^1.0.2", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "nyholm/psr7": "^1.0", + "php-http/message": "^1.5", + "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" + }, + "time": "2021-05-21T08:32:01+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Http\\Message\\MultipartStream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + } + ], + "description": "A builder class that help you create a multipart stream", + "homepage": "http://php-http.org", + "keywords": [ + "factory", + "http", + "message", + "multipart stream", + "stream" + ], + "support": { + "issues": "https://github.com/php-http/multipart-stream-builder/issues", + "source": "https://github.com/php-http/multipart-stream-builder/tree/1.2.0" + }, + "install-path": "../php-http/multipart-stream-builder" + }, + { + "name": "php-http/promise", + "version": "1.1.0", + "version_normalized": "1.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/promise.git", + "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/promise/zipball/4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", + "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.3.2", + "phpspec/phpspec": "^5.1.2 || ^6.2" + }, + "time": "2020-07-07T09:29:14+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/php-http/promise/issues", + "source": "https://github.com/php-http/promise/tree/1.1.0" + }, + "install-path": "../php-http/promise" + }, + { + "name": "psr/cache", + "version": "2.0.0", + "version_normalized": "2.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", + "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "time": "2021-02-03T23:23:37+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/2.0.0" + }, + "install-path": "../psr/cache" + }, + { + "name": "psr/http-client", + "version": "1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0" + }, + "time": "2020-06-29T06:28:15+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client/tree/master" + }, + "install-path": "../psr/http-client" + }, + { + "name": "psr/http-factory", + "version": "1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "time": "2019-04-30T12:38:16+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, + "install-path": "../psr/http-factory" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2016-08-06T14:39:51+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, + "install-path": "../psr/http-message" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "version_normalized": "3.0.3.0", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "time": "2019-03-08T08:55:37+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "install-path": "../ralouphie/getallheaders" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.0", + "version_normalized": "2.5.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2021-07-12T14:48:14+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/deprecation-contracts" + }, + { + "name": "symfony/options-resolver", + "version": "v6.0.0", + "version_normalized": "6.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "be0facf48a42a232d6c0daadd76e4eb5657a4798" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/be0facf48a42a232d6c0daadd76e4eb5657a4798", + "reference": "be0facf48a42a232d6c0daadd76e4eb5657a4798", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/deprecation-contracts": "^2.1|^3" + }, + "time": "2021-11-23T19:05:29+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v6.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/options-resolver" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.24.0", + "version_normalized": "1.24.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2021-09-13T13:58:33+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php80" + } + ], + "dev": false, + "dev-package-names": [] +} diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php new file mode 100644 index 00000000..c9d854dc --- /dev/null +++ b/vendor/composer/installed.php @@ -0,0 +1,309 @@ + array( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'reference' => '4d22238cee98274d2098f0cbf116ad8e0581f24a', + 'name' => '__root__', + 'dev' => false, + ), + 'versions' => array( + '__root__' => array( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'reference' => '4d22238cee98274d2098f0cbf116ad8e0581f24a', + 'dev_requirement' => false, + ), + 'clue/stream-filter' => array( + 'pretty_version' => 'v1.5.0', + 'version' => '1.5.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../clue/stream-filter', + 'aliases' => array(), + 'reference' => 'aeb7d8ea49c7963d3b581378955dbf5bc49aa320', + 'dev_requirement' => false, + ), + 'composer/ca-bundle' => array( + 'pretty_version' => '1.3.1', + 'version' => '1.3.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/./ca-bundle', + 'aliases' => array(), + 'reference' => '4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b', + 'dev_requirement' => false, + ), + 'embed/embed' => array( + 'pretty_version' => 'v4.4.0', + 'version' => '4.4.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../embed/embed', + 'aliases' => array(), + 'reference' => '24fe9376e8de48c536ddaddf0025ae39cae5ddfe', + 'dev_requirement' => false, + ), + 'grandel/include-directory' => array( + 'pretty_version' => 'v0.2.2', + 'version' => '0.2.2.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../grandel/include-directory', + 'aliases' => array(), + 'reference' => 'a5c830e8f1527c818b521ab18f2accecb02f9919', + 'dev_requirement' => false, + ), + 'guzzlehttp/guzzle' => array( + 'pretty_version' => '7.4.1', + 'version' => '7.4.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', + 'aliases' => array(), + 'reference' => 'ee0a041b1760e6a53d2a39c8c34115adc2af2c79', + 'dev_requirement' => false, + ), + 'guzzlehttp/promises' => array( + 'pretty_version' => '1.5.1', + 'version' => '1.5.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/promises', + 'aliases' => array(), + 'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da', + 'dev_requirement' => false, + ), + 'guzzlehttp/psr7' => array( + 'pretty_version' => '2.1.0', + 'version' => '2.1.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/psr7', + 'aliases' => array(), + 'reference' => '089edd38f5b8abba6cb01567c2a8aaa47cec4c72', + 'dev_requirement' => false, + ), + 'http-interop/http-factory-guzzle' => array( + 'pretty_version' => '1.2.0', + 'version' => '1.2.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../http-interop/http-factory-guzzle', + 'aliases' => array(), + 'reference' => '8f06e92b95405216b237521cc64c804dd44c4a81', + 'dev_requirement' => false, + ), + 'knplabs/github-api' => array( + 'pretty_version' => 'v3.4.0', + 'version' => '3.4.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../knplabs/github-api', + 'aliases' => array(), + 'reference' => 'bddf0f5e686a2dc72ca0ec642e3b487b08d841ce', + 'dev_requirement' => false, + ), + 'laminas/laminas-diactoros' => array( + 'pretty_version' => '2.8.0', + 'version' => '2.8.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../laminas/laminas-diactoros', + 'aliases' => array(), + 'reference' => '0c26ef1d95b6d7e6e3943a243ba3dc0797227199', + 'dev_requirement' => false, + ), + 'ml/iri' => array( + 'pretty_version' => '1.1.4', + 'version' => '1.1.4.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ml/iri/ML/IRI', + 'aliases' => array(), + 'reference' => 'cbd44fa913e00ea624241b38cefaa99da8d71341', + 'dev_requirement' => false, + ), + 'ml/json-ld' => array( + 'pretty_version' => '1.2.0', + 'version' => '1.2.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ml/json-ld', + 'aliases' => array(), + 'reference' => 'c74a1aed5979ed1cfb1be35a55a305fd30e30b93', + 'dev_requirement' => false, + ), + 'oscarotero/html-parser' => array( + 'pretty_version' => 'v0.1.6', + 'version' => '0.1.6.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../oscarotero/html-parser', + 'aliases' => array(), + 'reference' => 'b61e92f634d0dc184339d24630a6968d3ac64ded', + 'dev_requirement' => false, + ), + 'php-http/cache-plugin' => array( + 'pretty_version' => '1.7.5', + 'version' => '1.7.5.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../php-http/cache-plugin', + 'aliases' => array(), + 'reference' => '63bc3f7242825c9a817db8f78e4c9703b0c471e2', + 'dev_requirement' => false, + ), + 'php-http/client-common' => array( + 'pretty_version' => '2.5.0', + 'version' => '2.5.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../php-http/client-common', + 'aliases' => array(), + 'reference' => 'd135751167d57e27c74de674d6a30cef2dc8e054', + 'dev_requirement' => false, + ), + 'php-http/discovery' => array( + 'pretty_version' => '1.14.1', + 'version' => '1.14.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../php-http/discovery', + 'aliases' => array(), + 'reference' => 'de90ab2b41d7d61609f504e031339776bc8c7223', + 'dev_requirement' => false, + ), + 'php-http/httplug' => array( + 'pretty_version' => '2.2.0', + 'version' => '2.2.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../php-http/httplug', + 'aliases' => array(), + 'reference' => '191a0a1b41ed026b717421931f8d3bd2514ffbf9', + 'dev_requirement' => false, + ), + 'php-http/message' => array( + 'pretty_version' => '1.12.0', + 'version' => '1.12.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../php-http/message', + 'aliases' => array(), + 'reference' => '39eb7548be982a81085fe5a6e2a44268cd586291', + 'dev_requirement' => false, + ), + 'php-http/message-factory' => array( + 'pretty_version' => 'v1.0.2', + 'version' => '1.0.2.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../php-http/message-factory', + 'aliases' => array(), + 'reference' => 'a478cb11f66a6ac48d8954216cfed9aa06a501a1', + 'dev_requirement' => false, + ), + 'php-http/message-factory-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), + 'php-http/multipart-stream-builder' => array( + 'pretty_version' => '1.2.0', + 'version' => '1.2.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../php-http/multipart-stream-builder', + 'aliases' => array(), + 'reference' => '11c1d31f72e01c738bbce9e27649a7cca829c30e', + 'dev_requirement' => false, + ), + 'php-http/promise' => array( + 'pretty_version' => '1.1.0', + 'version' => '1.1.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../php-http/promise', + 'aliases' => array(), + 'reference' => '4c4c1f9b7289a2ec57cde7f1e9762a5789506f88', + 'dev_requirement' => false, + ), + 'psr/cache' => array( + 'pretty_version' => '2.0.0', + 'version' => '2.0.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/cache', + 'aliases' => array(), + 'reference' => '213f9dbc5b9bfbc4f8db86d2838dc968752ce13b', + 'dev_requirement' => false, + ), + 'psr/http-client' => array( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-client', + 'aliases' => array(), + 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', + 'dev_requirement' => false, + ), + 'psr/http-client-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), + 'psr/http-factory' => array( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-factory', + 'aliases' => array(), + 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be', + 'dev_requirement' => false, + ), + 'psr/http-factory-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + 1 => '^1.0', + ), + ), + 'psr/http-message' => array( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-message', + 'aliases' => array(), + 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', + 'dev_requirement' => false, + ), + 'psr/http-message-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), + 'ralouphie/getallheaders' => array( + 'pretty_version' => '3.0.3', + 'version' => '3.0.3.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ralouphie/getallheaders', + 'aliases' => array(), + 'reference' => '120b605dfeb996808c31b6477290a714d356e822', + 'dev_requirement' => false, + ), + 'symfony/deprecation-contracts' => array( + 'pretty_version' => 'v2.5.0', + 'version' => '2.5.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', + 'aliases' => array(), + 'reference' => '6f981ee24cf69ee7ce9736146d1c57c2780598a8', + 'dev_requirement' => false, + ), + 'symfony/options-resolver' => array( + 'pretty_version' => 'v6.0.0', + 'version' => '6.0.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/options-resolver', + 'aliases' => array(), + 'reference' => 'be0facf48a42a232d6c0daadd76e4eb5657a4798', + 'dev_requirement' => false, + ), + 'symfony/polyfill-php80' => array( + 'pretty_version' => 'v1.24.0', + 'version' => '1.24.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php80', + 'aliases' => array(), + 'reference' => '57b712b08eddb97c762a8caa32c84e037892d2e9', + 'dev_requirement' => false, + ), + ), +); diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php new file mode 100644 index 00000000..b168ddd5 --- /dev/null +++ b/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 80002)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.2". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} diff --git a/vendor/guzzlehttp/guzzle/CHANGELOG.md b/vendor/guzzlehttp/guzzle/CHANGELOG.md new file mode 100644 index 00000000..b278efca --- /dev/null +++ b/vendor/guzzlehttp/guzzle/CHANGELOG.md @@ -0,0 +1,1490 @@ +# Change Log + +Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version. + +## 7.4.1 - 2021-12-06 + +### Changed + +- Replaced implicit URI to string coercion [#2946](https://github.com/guzzle/guzzle/pull/2946) +- Allow `symfony/deprecation-contracts` version 3 [#2961](https://github.com/guzzle/guzzle/pull/2961) + +### Fixed + +- Only close curl handle if it's done [#2950](https://github.com/guzzle/guzzle/pull/2950) + +## 7.4.0 - 2021-10-18 + +### Added + +- Support PHP 8.1 [#2929](https://github.com/guzzle/guzzle/pull/2929), [#2939](https://github.com/guzzle/guzzle/pull/2939) +- Support `psr/log` version 2 and 3 [#2943](https://github.com/guzzle/guzzle/pull/2943) + +### Fixed + +- Make sure we always call `restore_error_handler()` [#2915](https://github.com/guzzle/guzzle/pull/2915) +- Fix progress parameter type compatibility between the cURL and stream handlers [#2936](https://github.com/guzzle/guzzle/pull/2936) +- Throw `InvalidArgumentException` when an incorrect `headers` array is provided [#2916](https://github.com/guzzle/guzzle/pull/2916), [#2942](https://github.com/guzzle/guzzle/pull/2942) + +### Changed + +- Be more strict with types [#2914](https://github.com/guzzle/guzzle/pull/2914), [#2917](https://github.com/guzzle/guzzle/pull/2917), [#2919](https://github.com/guzzle/guzzle/pull/2919), [#2945](https://github.com/guzzle/guzzle/pull/2945) + +## 7.3.0 - 2021-03-23 + +### Added + +- Support for DER and P12 certificates [#2413](https://github.com/guzzle/guzzle/pull/2413) +- Support the cURL (http://) scheme for StreamHandler proxies [#2850](https://github.com/guzzle/guzzle/pull/2850) +- Support for `guzzlehttp/psr7:^2.0` [#2878](https://github.com/guzzle/guzzle/pull/2878) + +### Fixed + +- Handle exceptions on invalid header consistently between PHP versions and handlers [#2872](https://github.com/guzzle/guzzle/pull/2872) + +## 7.2.0 - 2020-10-10 + +### Added + +- Support for PHP 8 [#2712](https://github.com/guzzle/guzzle/pull/2712), [#2715](https://github.com/guzzle/guzzle/pull/2715), [#2789](https://github.com/guzzle/guzzle/pull/2789) +- Support passing a body summarizer to the http errors middleware [#2795](https://github.com/guzzle/guzzle/pull/2795) + +### Fixed + +- Handle exceptions during response creation [#2591](https://github.com/guzzle/guzzle/pull/2591) +- Fix CURLOPT_ENCODING not to be overwritten [#2595](https://github.com/guzzle/guzzle/pull/2595) +- Make sure the Request always has a body object [#2804](https://github.com/guzzle/guzzle/pull/2804) + +### Changed + +- The `TooManyRedirectsException` has a response [#2660](https://github.com/guzzle/guzzle/pull/2660) +- Avoid "functions" from dependencies [#2712](https://github.com/guzzle/guzzle/pull/2712) + +### Deprecated + +- Using environment variable GUZZLE_CURL_SELECT_TIMEOUT [#2786](https://github.com/guzzle/guzzle/pull/2786) + +## 7.1.1 - 2020-09-30 + +### Fixed + +- Incorrect EOF detection for response body streams on Windows. + +### Changed + +- We dont connect curl `sink` on HEAD requests. +- Removed some PHP 5 workarounds + +## 7.1.0 - 2020-09-22 + +### Added + +- `GuzzleHttp\MessageFormatterInterface` + +### Fixed + +- Fixed issue that caused cookies with no value not to be stored. +- On redirects, we allow all safe methods like GET, HEAD and OPTIONS. +- Fixed logging on empty responses. +- Make sure MessageFormatter::format returns string + +### Deprecated + +- All functions in `GuzzleHttp` has been deprecated. Use static methods on `Utils` instead. +- `ClientInterface::getConfig()` +- `Client::getConfig()` +- `Client::__call()` +- `Utils::defaultCaBundle()` +- `CurlFactory::LOW_CURL_VERSION_NUMBER` + +## 7.0.1 - 2020-06-27 + +* Fix multiply defined functions fatal error [#2699](https://github.com/guzzle/guzzle/pull/2699) + +## 7.0.0 - 2020-06-27 + +No changes since 7.0.0-rc1. + +## 7.0.0-rc1 - 2020-06-15 + +### Changed + +* Use error level for logging errors in Middleware [#2629](https://github.com/guzzle/guzzle/pull/2629) +* Disabled IDN support by default and require ext-intl to use it [#2675](https://github.com/guzzle/guzzle/pull/2675) + +## 7.0.0-beta2 - 2020-05-25 + +### Added + +* Using `Utils` class instead of functions in the `GuzzleHttp` namespace. [#2546](https://github.com/guzzle/guzzle/pull/2546) +* `ClientInterface::MAJOR_VERSION` [#2583](https://github.com/guzzle/guzzle/pull/2583) + +### Changed + +* Avoid the `getenv` function when unsafe [#2531](https://github.com/guzzle/guzzle/pull/2531) +* Added real client methods [#2529](https://github.com/guzzle/guzzle/pull/2529) +* Avoid functions due to global install conflicts [#2546](https://github.com/guzzle/guzzle/pull/2546) +* Use Symfony intl-idn polyfill [#2550](https://github.com/guzzle/guzzle/pull/2550) +* Adding methods for HTTP verbs like `Client::get()`, `Client::head()`, `Client::patch()` etc [#2529](https://github.com/guzzle/guzzle/pull/2529) +* `ConnectException` extends `TransferException` [#2541](https://github.com/guzzle/guzzle/pull/2541) +* Updated the default User Agent to "GuzzleHttp/7" [#2654](https://github.com/guzzle/guzzle/pull/2654) + +### Fixed + +* Various intl icu issues [#2626](https://github.com/guzzle/guzzle/pull/2626) + +### Removed + +* Pool option `pool_size` [#2528](https://github.com/guzzle/guzzle/pull/2528) + +## 7.0.0-beta1 - 2019-12-30 + +The diff might look very big but 95% of Guzzle users will be able to upgrade without modification. +Please see [the upgrade document](UPGRADING.md) that describes all BC breaking changes. + +### Added + +* Implement PSR-18 and dropped PHP 5 support [#2421](https://github.com/guzzle/guzzle/pull/2421) [#2474](https://github.com/guzzle/guzzle/pull/2474) +* PHP 7 types [#2442](https://github.com/guzzle/guzzle/pull/2442) [#2449](https://github.com/guzzle/guzzle/pull/2449) [#2466](https://github.com/guzzle/guzzle/pull/2466) [#2497](https://github.com/guzzle/guzzle/pull/2497) [#2499](https://github.com/guzzle/guzzle/pull/2499) +* IDN support for redirects [2424](https://github.com/guzzle/guzzle/pull/2424) + +### Changed + +* Dont allow passing null as third argument to `BadResponseException::__construct()` [#2427](https://github.com/guzzle/guzzle/pull/2427) +* Use SAPI constant instead of method call [#2450](https://github.com/guzzle/guzzle/pull/2450) +* Use native function invocation [#2444](https://github.com/guzzle/guzzle/pull/2444) +* Better defaults for PHP installations with old ICU lib [2454](https://github.com/guzzle/guzzle/pull/2454) +* Added visibility to all constants [#2462](https://github.com/guzzle/guzzle/pull/2462) +* Dont allow passing `null` as URI to `Client::request()` and `Client::requestAsync()` [#2461](https://github.com/guzzle/guzzle/pull/2461) +* Widen the exception argument to throwable [#2495](https://github.com/guzzle/guzzle/pull/2495) + +### Fixed + +* Logging when Promise rejected with a string [#2311](https://github.com/guzzle/guzzle/pull/2311) + +### Removed + +* Class `SeekException` [#2162](https://github.com/guzzle/guzzle/pull/2162) +* `RequestException::getResponseBodySummary()` [#2425](https://github.com/guzzle/guzzle/pull/2425) +* `CookieJar::getCookieValue()` [#2433](https://github.com/guzzle/guzzle/pull/2433) +* `uri_template()` and `UriTemplate` [#2440](https://github.com/guzzle/guzzle/pull/2440) +* Request options `save_to` and `exceptions` [#2464](https://github.com/guzzle/guzzle/pull/2464) + +## 6.5.2 - 2019-12-23 + +* idn_to_ascii() fix for old PHP versions [#2489](https://github.com/guzzle/guzzle/pull/2489) + +## 6.5.1 - 2019-12-21 + +* Better defaults for PHP installations with old ICU lib [#2454](https://github.com/guzzle/guzzle/pull/2454) +* IDN support for redirects [#2424](https://github.com/guzzle/guzzle/pull/2424) + +## 6.5.0 - 2019-12-07 + +* Improvement: Added support for reset internal queue in MockHandler. [#2143](https://github.com/guzzle/guzzle/pull/2143) +* Improvement: Added support to pass arbitrary options to `curl_multi_init`. [#2287](https://github.com/guzzle/guzzle/pull/2287) +* Fix: Gracefully handle passing `null` to the `header` option. [#2132](https://github.com/guzzle/guzzle/pull/2132) +* Fix: `RetryMiddleware` did not do exponential delay between retires due unit mismatch. [#2132](https://github.com/guzzle/guzzle/pull/2132) +* Fix: Prevent undefined offset when using array for ssl_key options. [#2348](https://github.com/guzzle/guzzle/pull/2348) +* Deprecated `ClientInterface::VERSION` + +## 6.4.1 - 2019-10-23 + +* No `guzzle.phar` was created in 6.4.0 due expired API token. This release will fix that +* Added `parent::__construct()` to `FileCookieJar` and `SessionCookieJar` + +## 6.4.0 - 2019-10-23 + +* Improvement: Improved error messages when using curl < 7.21.2 [#2108](https://github.com/guzzle/guzzle/pull/2108) +* Fix: Test if response is readable before returning a summary in `RequestException::getResponseBodySummary()` [#2081](https://github.com/guzzle/guzzle/pull/2081) +* Fix: Add support for GUZZLE_CURL_SELECT_TIMEOUT environment variable [#2161](https://github.com/guzzle/guzzle/pull/2161) +* Improvement: Added `GuzzleHttp\Exception\InvalidArgumentException` [#2163](https://github.com/guzzle/guzzle/pull/2163) +* Improvement: Added `GuzzleHttp\_current_time()` to use `hrtime()` if that function exists. [#2242](https://github.com/guzzle/guzzle/pull/2242) +* Improvement: Added curl's `appconnect_time` in `TransferStats` [#2284](https://github.com/guzzle/guzzle/pull/2284) +* Improvement: Make GuzzleException extend Throwable wherever it's available [#2273](https://github.com/guzzle/guzzle/pull/2273) +* Fix: Prevent concurrent writes to file when saving `CookieJar` [#2335](https://github.com/guzzle/guzzle/pull/2335) +* Improvement: Update `MockHandler` so we can test transfer time [#2362](https://github.com/guzzle/guzzle/pull/2362) + +## 6.3.3 - 2018-04-22 + +* Fix: Default headers when decode_content is specified + + +## 6.3.2 - 2018-03-26 + +* Fix: Release process + + +## 6.3.1 - 2018-03-26 + +* Bug fix: Parsing 0 epoch expiry times in cookies [#2014](https://github.com/guzzle/guzzle/pull/2014) +* Improvement: Better ConnectException detection [#2012](https://github.com/guzzle/guzzle/pull/2012) +* Bug fix: Malformed domain that contains a "/" [#1999](https://github.com/guzzle/guzzle/pull/1999) +* Bug fix: Undefined offset when a cookie has no first key-value pair [#1998](https://github.com/guzzle/guzzle/pull/1998) +* Improvement: Support PHPUnit 6 [#1953](https://github.com/guzzle/guzzle/pull/1953) +* Bug fix: Support empty headers [#1915](https://github.com/guzzle/guzzle/pull/1915) +* Bug fix: Ignore case during header modifications [#1916](https://github.com/guzzle/guzzle/pull/1916) + ++ Minor code cleanups, documentation fixes and clarifications. + + +## 6.3.0 - 2017-06-22 + +* Feature: force IP resolution (ipv4 or ipv6) [#1608](https://github.com/guzzle/guzzle/pull/1608), [#1659](https://github.com/guzzle/guzzle/pull/1659) +* Improvement: Don't include summary in exception message when body is empty [#1621](https://github.com/guzzle/guzzle/pull/1621) +* Improvement: Handle `on_headers` option in MockHandler [#1580](https://github.com/guzzle/guzzle/pull/1580) +* Improvement: Added SUSE Linux CA path [#1609](https://github.com/guzzle/guzzle/issues/1609) +* Improvement: Use class reference for getting the name of the class instead of using hardcoded strings [#1641](https://github.com/guzzle/guzzle/pull/1641) +* Feature: Added `read_timeout` option [#1611](https://github.com/guzzle/guzzle/pull/1611) +* Bug fix: PHP 7.x fixes [#1685](https://github.com/guzzle/guzzle/pull/1685), [#1686](https://github.com/guzzle/guzzle/pull/1686), [#1811](https://github.com/guzzle/guzzle/pull/1811) +* Deprecation: BadResponseException instantiation without a response [#1642](https://github.com/guzzle/guzzle/pull/1642) +* Feature: Added NTLM auth [#1569](https://github.com/guzzle/guzzle/pull/1569) +* Feature: Track redirect HTTP status codes [#1711](https://github.com/guzzle/guzzle/pull/1711) +* Improvement: Check handler type during construction [#1745](https://github.com/guzzle/guzzle/pull/1745) +* Improvement: Always include the Content-Length if there's a body [#1721](https://github.com/guzzle/guzzle/pull/1721) +* Feature: Added convenience method to access a cookie by name [#1318](https://github.com/guzzle/guzzle/pull/1318) +* Bug fix: Fill `CURLOPT_CAPATH` and `CURLOPT_CAINFO` properly [#1684](https://github.com/guzzle/guzzle/pull/1684) +* Improvement: Use `\GuzzleHttp\Promise\rejection_for` function instead of object init [#1827](https://github.com/guzzle/guzzle/pull/1827) + + ++ Minor code cleanups, documentation fixes and clarifications. + +## 6.2.3 - 2017-02-28 + +* Fix deprecations with guzzle/psr7 version 1.4 + +## 6.2.2 - 2016-10-08 + +* Allow to pass nullable Response to delay callable +* Only add scheme when host is present +* Fix drain case where content-length is the literal string zero +* Obfuscate in-URL credentials in exceptions + +## 6.2.1 - 2016-07-18 + +* Address HTTP_PROXY security vulnerability, CVE-2016-5385: + https://httpoxy.org/ +* Fixing timeout bug with StreamHandler: + https://github.com/guzzle/guzzle/pull/1488 +* Only read up to `Content-Length` in PHP StreamHandler to avoid timeouts when + a server does not honor `Connection: close`. +* Ignore URI fragment when sending requests. + +## 6.2.0 - 2016-03-21 + +* Feature: added `GuzzleHttp\json_encode` and `GuzzleHttp\json_decode`. + https://github.com/guzzle/guzzle/pull/1389 +* Bug fix: Fix sleep calculation when waiting for delayed requests. + https://github.com/guzzle/guzzle/pull/1324 +* Feature: More flexible history containers. + https://github.com/guzzle/guzzle/pull/1373 +* Bug fix: defer sink stream opening in StreamHandler. + https://github.com/guzzle/guzzle/pull/1377 +* Bug fix: do not attempt to escape cookie values. + https://github.com/guzzle/guzzle/pull/1406 +* Feature: report original content encoding and length on decoded responses. + https://github.com/guzzle/guzzle/pull/1409 +* Bug fix: rewind seekable request bodies before dispatching to cURL. + https://github.com/guzzle/guzzle/pull/1422 +* Bug fix: provide an empty string to `http_build_query` for HHVM workaround. + https://github.com/guzzle/guzzle/pull/1367 + +## 6.1.1 - 2015-11-22 + +* Bug fix: Proxy::wrapSync() now correctly proxies to the appropriate handler + https://github.com/guzzle/guzzle/commit/911bcbc8b434adce64e223a6d1d14e9a8f63e4e4 +* Feature: HandlerStack is now more generic. + https://github.com/guzzle/guzzle/commit/f2102941331cda544745eedd97fc8fd46e1ee33e +* Bug fix: setting verify to false in the StreamHandler now disables peer + verification. https://github.com/guzzle/guzzle/issues/1256 +* Feature: Middleware now uses an exception factory, including more error + context. https://github.com/guzzle/guzzle/pull/1282 +* Feature: better support for disabled functions. + https://github.com/guzzle/guzzle/pull/1287 +* Bug fix: fixed regression where MockHandler was not using `sink`. + https://github.com/guzzle/guzzle/pull/1292 + +## 6.1.0 - 2015-09-08 + +* Feature: Added the `on_stats` request option to provide access to transfer + statistics for requests. https://github.com/guzzle/guzzle/pull/1202 +* Feature: Added the ability to persist session cookies in CookieJars. + https://github.com/guzzle/guzzle/pull/1195 +* Feature: Some compatibility updates for Google APP Engine + https://github.com/guzzle/guzzle/pull/1216 +* Feature: Added support for NO_PROXY to prevent the use of a proxy based on + a simple set of rules. https://github.com/guzzle/guzzle/pull/1197 +* Feature: Cookies can now contain square brackets. + https://github.com/guzzle/guzzle/pull/1237 +* Bug fix: Now correctly parsing `=` inside of quotes in Cookies. + https://github.com/guzzle/guzzle/pull/1232 +* Bug fix: Cusotm cURL options now correctly override curl options of the + same name. https://github.com/guzzle/guzzle/pull/1221 +* Bug fix: Content-Type header is now added when using an explicitly provided + multipart body. https://github.com/guzzle/guzzle/pull/1218 +* Bug fix: Now ignoring Set-Cookie headers that have no name. +* Bug fix: Reason phrase is no longer cast to an int in some cases in the + cURL handler. https://github.com/guzzle/guzzle/pull/1187 +* Bug fix: Remove the Authorization header when redirecting if the Host + header changes. https://github.com/guzzle/guzzle/pull/1207 +* Bug fix: Cookie path matching fixes + https://github.com/guzzle/guzzle/issues/1129 +* Bug fix: Fixing the cURL `body_as_string` setting + https://github.com/guzzle/guzzle/pull/1201 +* Bug fix: quotes are no longer stripped when parsing cookies. + https://github.com/guzzle/guzzle/issues/1172 +* Bug fix: `form_params` and `query` now always uses the `&` separator. + https://github.com/guzzle/guzzle/pull/1163 +* Bug fix: Adding a Content-Length to PHP stream wrapper requests if not set. + https://github.com/guzzle/guzzle/pull/1189 + +## 6.0.2 - 2015-07-04 + +* Fixed a memory leak in the curl handlers in which references to callbacks + were not being removed by `curl_reset`. +* Cookies are now extracted properly before redirects. +* Cookies now allow more character ranges. +* Decoded Content-Encoding responses are now modified to correctly reflect + their state if the encoding was automatically removed by a handler. This + means that the `Content-Encoding` header may be removed an the + `Content-Length` modified to reflect the message size after removing the + encoding. +* Added a more explicit error message when trying to use `form_params` and + `multipart` in the same request. +* Several fixes for HHVM support. +* Functions are now conditionally required using an additional level of + indirection to help with global Composer installations. + +## 6.0.1 - 2015-05-27 + +* Fixed a bug with serializing the `query` request option where the `&` + separator was missing. +* Added a better error message for when `body` is provided as an array. Please + use `form_params` or `multipart` instead. +* Various doc fixes. + +## 6.0.0 - 2015-05-26 + +* See the UPGRADING.md document for more information. +* Added `multipart` and `form_params` request options. +* Added `synchronous` request option. +* Added the `on_headers` request option. +* Fixed `expect` handling. +* No longer adding default middlewares in the client ctor. These need to be + present on the provided handler in order to work. +* Requests are no longer initiated when sending async requests with the + CurlMultiHandler. This prevents unexpected recursion from requests completing + while ticking the cURL loop. +* Removed the semantics of setting `default` to `true`. This is no longer + required now that the cURL loop is not ticked for async requests. +* Added request and response logging middleware. +* No longer allowing self signed certificates when using the StreamHandler. +* Ensuring that `sink` is valid if saving to a file. +* Request exceptions now include a "handler context" which provides handler + specific contextual information. +* Added `GuzzleHttp\RequestOptions` to allow request options to be applied + using constants. +* `$maxHandles` has been removed from CurlMultiHandler. +* `MultipartPostBody` is now part of the `guzzlehttp/psr7` package. + +## 5.3.0 - 2015-05-19 + +* Mock now supports `save_to` +* Marked `AbstractRequestEvent::getTransaction()` as public. +* Fixed a bug in which multiple headers using different casing would overwrite + previous headers in the associative array. +* Added `Utils::getDefaultHandler()` +* Marked `GuzzleHttp\Client::getDefaultUserAgent` as deprecated. +* URL scheme is now always lowercased. + +## 6.0.0-beta.1 + +* Requires PHP >= 5.5 +* Updated to use PSR-7 + * Requires immutable messages, which basically means an event based system + owned by a request instance is no longer possible. + * Utilizing the [Guzzle PSR-7 package](https://github.com/guzzle/psr7). + * Removed the dependency on `guzzlehttp/streams`. These stream abstractions + are available in the `guzzlehttp/psr7` package under the `GuzzleHttp\Psr7` + namespace. +* Added middleware and handler system + * Replaced the Guzzle event and subscriber system with a middleware system. + * No longer depends on RingPHP, but rather places the HTTP handlers directly + in Guzzle, operating on PSR-7 messages. + * Retry logic is now encapsulated in `GuzzleHttp\Middleware::retry`, which + means the `guzzlehttp/retry-subscriber` is now obsolete. + * Mocking responses is now handled using `GuzzleHttp\Handler\MockHandler`. +* Asynchronous responses + * No longer supports the `future` request option to send an async request. + Instead, use one of the `*Async` methods of a client (e.g., `requestAsync`, + `getAsync`, etc.). + * Utilizing `GuzzleHttp\Promise` instead of React's promise library to avoid + recursion required by chaining and forwarding react promises. See + https://github.com/guzzle/promises + * Added `requestAsync` and `sendAsync` to send request asynchronously. + * Added magic methods for `getAsync()`, `postAsync()`, etc. to send requests + asynchronously. +* Request options + * POST and form updates + * Added the `form_fields` and `form_files` request options. + * Removed the `GuzzleHttp\Post` namespace. + * The `body` request option no longer accepts an array for POST requests. + * The `exceptions` request option has been deprecated in favor of the + `http_errors` request options. + * The `save_to` request option has been deprecated in favor of `sink` request + option. +* Clients no longer accept an array of URI template string and variables for + URI variables. You will need to expand URI templates before passing them + into a client constructor or request method. +* Client methods `get()`, `post()`, `put()`, `patch()`, `options()`, etc. are + now magic methods that will send synchronous requests. +* Replaced `Utils.php` with plain functions in `functions.php`. +* Removed `GuzzleHttp\Collection`. +* Removed `GuzzleHttp\BatchResults`. Batched pool results are now returned as + an array. +* Removed `GuzzleHttp\Query`. Query string handling is now handled using an + associative array passed into the `query` request option. The query string + is serialized using PHP's `http_build_query`. If you need more control, you + can pass the query string in as a string. +* `GuzzleHttp\QueryParser` has been replaced with the + `GuzzleHttp\Psr7\parse_query`. + +## 5.2.0 - 2015-01-27 + +* Added `AppliesHeadersInterface` to make applying headers to a request based + on the body more generic and not specific to `PostBodyInterface`. +* Reduced the number of stack frames needed to send requests. +* Nested futures are now resolved in the client rather than the RequestFsm +* Finishing state transitions is now handled in the RequestFsm rather than the + RingBridge. +* Added a guard in the Pool class to not use recursion for request retries. + +## 5.1.0 - 2014-12-19 + +* Pool class no longer uses recursion when a request is intercepted. +* The size of a Pool can now be dynamically adjusted using a callback. + See https://github.com/guzzle/guzzle/pull/943. +* Setting a request option to `null` when creating a request with a client will + ensure that the option is not set. This allows you to overwrite default + request options on a per-request basis. + See https://github.com/guzzle/guzzle/pull/937. +* Added the ability to limit which protocols are allowed for redirects by + specifying a `protocols` array in the `allow_redirects` request option. +* Nested futures due to retries are now resolved when waiting for synchronous + responses. See https://github.com/guzzle/guzzle/pull/947. +* `"0"` is now an allowed URI path. See + https://github.com/guzzle/guzzle/pull/935. +* `Query` no longer typehints on the `$query` argument in the constructor, + allowing for strings and arrays. +* Exceptions thrown in the `end` event are now correctly wrapped with Guzzle + specific exceptions if necessary. + +## 5.0.3 - 2014-11-03 + +This change updates query strings so that they are treated as un-encoded values +by default where the value represents an un-encoded value to send over the +wire. A Query object then encodes the value before sending over the wire. This +means that even value query string values (e.g., ":") are url encoded. This +makes the Query class match PHP's http_build_query function. However, if you +want to send requests over the wire using valid query string characters that do +not need to be encoded, then you can provide a string to Url::setQuery() and +pass true as the second argument to specify that the query string is a raw +string that should not be parsed or encoded (unless a call to getQuery() is +subsequently made, forcing the query-string to be converted into a Query +object). + +## 5.0.2 - 2014-10-30 + +* Added a trailing `\r\n` to multipart/form-data payloads. See + https://github.com/guzzle/guzzle/pull/871 +* Added a `GuzzleHttp\Pool::send()` convenience method to match the docs. +* Status codes are now returned as integers. See + https://github.com/guzzle/guzzle/issues/881 +* No longer overwriting an existing `application/x-www-form-urlencoded` header + when sending POST requests, allowing for customized headers. See + https://github.com/guzzle/guzzle/issues/877 +* Improved path URL serialization. + + * No longer double percent-encoding characters in the path or query string if + they are already encoded. + * Now properly encoding the supplied path to a URL object, instead of only + encoding ' ' and '?'. + * Note: This has been changed in 5.0.3 to now encode query string values by + default unless the `rawString` argument is provided when setting the query + string on a URL: Now allowing many more characters to be present in the + query string without being percent encoded. See https://tools.ietf.org/html/rfc3986#appendix-A + +## 5.0.1 - 2014-10-16 + +Bugfix release. + +* Fixed an issue where connection errors still returned response object in + error and end events event though the response is unusable. This has been + corrected so that a response is not returned in the `getResponse` method of + these events if the response did not complete. https://github.com/guzzle/guzzle/issues/867 +* Fixed an issue where transfer statistics were not being populated in the + RingBridge. https://github.com/guzzle/guzzle/issues/866 + +## 5.0.0 - 2014-10-12 + +Adding support for non-blocking responses and some minor API cleanup. + +### New Features + +* Added support for non-blocking responses based on `guzzlehttp/guzzle-ring`. +* Added a public API for creating a default HTTP adapter. +* Updated the redirect plugin to be non-blocking so that redirects are sent + concurrently. Other plugins like this can now be updated to be non-blocking. +* Added a "progress" event so that you can get upload and download progress + events. +* Added `GuzzleHttp\Pool` which implements FutureInterface and transfers + requests concurrently using a capped pool size as efficiently as possible. +* Added `hasListeners()` to EmitterInterface. +* Removed `GuzzleHttp\ClientInterface::sendAll` and marked + `GuzzleHttp\Client::sendAll` as deprecated (it's still there, just not the + recommended way). + +### Breaking changes + +The breaking changes in this release are relatively minor. The biggest thing to +look out for is that request and response objects no longer implement fluent +interfaces. + +* Removed the fluent interfaces (i.e., `return $this`) from requests, + responses, `GuzzleHttp\Collection`, `GuzzleHttp\Url`, + `GuzzleHttp\Query`, `GuzzleHttp\Post\PostBody`, and + `GuzzleHttp\Cookie\SetCookie`. This blog post provides a good outline of + why I did this: https://ocramius.github.io/blog/fluent-interfaces-are-evil/. + This also makes the Guzzle message interfaces compatible with the current + PSR-7 message proposal. +* Removed "functions.php", so that Guzzle is truly PSR-4 compliant. Except + for the HTTP request functions from function.php, these functions are now + implemented in `GuzzleHttp\Utils` using camelCase. `GuzzleHttp\json_decode` + moved to `GuzzleHttp\Utils::jsonDecode`. `GuzzleHttp\get_path` moved to + `GuzzleHttp\Utils::getPath`. `GuzzleHttp\set_path` moved to + `GuzzleHttp\Utils::setPath`. `GuzzleHttp\batch` should now be + `GuzzleHttp\Pool::batch`, which returns an `objectStorage`. Using functions.php + caused problems for many users: they aren't PSR-4 compliant, require an + explicit include, and needed an if-guard to ensure that the functions are not + declared multiple times. +* Rewrote adapter layer. + * Removing all classes from `GuzzleHttp\Adapter`, these are now + implemented as callables that are stored in `GuzzleHttp\Ring\Client`. + * Removed the concept of "parallel adapters". Sending requests serially or + concurrently is now handled using a single adapter. + * Moved `GuzzleHttp\Adapter\Transaction` to `GuzzleHttp\Transaction`. The + Transaction object now exposes the request, response, and client as public + properties. The getters and setters have been removed. +* Removed the "headers" event. This event was only useful for changing the + body a response once the headers of the response were known. You can implement + a similar behavior in a number of ways. One example might be to use a + FnStream that has access to the transaction being sent. For example, when the + first byte is written, you could check if the response headers match your + expectations, and if so, change the actual stream body that is being + written to. +* Removed the `asArray` parameter from + `GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header + value as an array, then use the newly added `getHeaderAsArray()` method of + `MessageInterface`. This change makes the Guzzle interfaces compatible with + the PSR-7 interfaces. +* `GuzzleHttp\Message\MessageFactory` no longer allows subclasses to add + custom request options using double-dispatch (this was an implementation + detail). Instead, you should now provide an associative array to the + constructor which is a mapping of the request option name mapping to a + function that applies the option value to a request. +* Removed the concept of "throwImmediately" from exceptions and error events. + This control mechanism was used to stop a transfer of concurrent requests + from completing. This can now be handled by throwing the exception or by + cancelling a pool of requests or each outstanding future request individually. +* Updated to "GuzzleHttp\Streams" 3.0. + * `GuzzleHttp\Stream\StreamInterface::getContents()` no longer accepts a + `maxLen` parameter. This update makes the Guzzle streams project + compatible with the current PSR-7 proposal. + * `GuzzleHttp\Stream\Stream::__construct`, + `GuzzleHttp\Stream\Stream::factory`, and + `GuzzleHttp\Stream\Utils::create` no longer accept a size in the second + argument. They now accept an associative array of options, including the + "size" key and "metadata" key which can be used to provide custom metadata. + +## 4.2.2 - 2014-09-08 + +* Fixed a memory leak in the CurlAdapter when reusing cURL handles. +* No longer using `request_fulluri` in stream adapter proxies. +* Relative redirects are now based on the last response, not the first response. + +## 4.2.1 - 2014-08-19 + +* Ensuring that the StreamAdapter does not always add a Content-Type header +* Adding automated github releases with a phar and zip + +## 4.2.0 - 2014-08-17 + +* Now merging in default options using a case-insensitive comparison. + Closes https://github.com/guzzle/guzzle/issues/767 +* Added the ability to automatically decode `Content-Encoding` response bodies + using the `decode_content` request option. This is set to `true` by default + to decode the response body if it comes over the wire with a + `Content-Encoding`. Set this value to `false` to disable decoding the + response content, and pass a string to provide a request `Accept-Encoding` + header and turn on automatic response decoding. This feature now allows you + to pass an `Accept-Encoding` header in the headers of a request but still + disable automatic response decoding. + Closes https://github.com/guzzle/guzzle/issues/764 +* Added the ability to throw an exception immediately when transferring + requests in parallel. Closes https://github.com/guzzle/guzzle/issues/760 +* Updating guzzlehttp/streams dependency to ~2.1 +* No longer utilizing the now deprecated namespaced methods from the stream + package. + +## 4.1.8 - 2014-08-14 + +* Fixed an issue in the CurlFactory that caused setting the `stream=false` + request option to throw an exception. + See: https://github.com/guzzle/guzzle/issues/769 +* TransactionIterator now calls rewind on the inner iterator. + See: https://github.com/guzzle/guzzle/pull/765 +* You can now set the `Content-Type` header to `multipart/form-data` + when creating POST requests to force multipart bodies. + See https://github.com/guzzle/guzzle/issues/768 + +## 4.1.7 - 2014-08-07 + +* Fixed an error in the HistoryPlugin that caused the same request and response + to be logged multiple times when an HTTP protocol error occurs. +* Ensuring that cURL does not add a default Content-Type when no Content-Type + has been supplied by the user. This prevents the adapter layer from modifying + the request that is sent over the wire after any listeners may have already + put the request in a desired state (e.g., signed the request). +* Throwing an exception when you attempt to send requests that have the + "stream" set to true in parallel using the MultiAdapter. +* Only calling curl_multi_select when there are active cURL handles. This was + previously changed and caused performance problems on some systems due to PHP + always selecting until the maximum select timeout. +* Fixed a bug where multipart/form-data POST fields were not correctly + aggregated (e.g., values with "&"). + +## 4.1.6 - 2014-08-03 + +* Added helper methods to make it easier to represent messages as strings, + including getting the start line and getting headers as a string. + +## 4.1.5 - 2014-08-02 + +* Automatically retrying cURL "Connection died, retrying a fresh connect" + errors when possible. +* cURL implementation cleanup +* Allowing multiple event subscriber listeners to be registered per event by + passing an array of arrays of listener configuration. + +## 4.1.4 - 2014-07-22 + +* Fixed a bug that caused multi-part POST requests with more than one field to + serialize incorrectly. +* Paths can now be set to "0" +* `ResponseInterface::xml` now accepts a `libxml_options` option and added a + missing default argument that was required when parsing XML response bodies. +* A `save_to` stream is now created lazily, which means that files are not + created on disk unless a request succeeds. + +## 4.1.3 - 2014-07-15 + +* Various fixes to multipart/form-data POST uploads +* Wrapping function.php in an if-statement to ensure Guzzle can be used + globally and in a Composer install +* Fixed an issue with generating and merging in events to an event array +* POST headers are only applied before sending a request to allow you to change + the query aggregator used before uploading +* Added much more robust query string parsing +* Fixed various parsing and normalization issues with URLs +* Fixing an issue where multi-valued headers were not being utilized correctly + in the StreamAdapter + +## 4.1.2 - 2014-06-18 + +* Added support for sending payloads with GET requests + +## 4.1.1 - 2014-06-08 + +* Fixed an issue related to using custom message factory options in subclasses +* Fixed an issue with nested form fields in a multi-part POST +* Fixed an issue with using the `json` request option for POST requests +* Added `ToArrayInterface` to `GuzzleHttp\Cookie\CookieJar` + +## 4.1.0 - 2014-05-27 + +* Added a `json` request option to easily serialize JSON payloads. +* Added a `GuzzleHttp\json_decode()` wrapper to safely parse JSON. +* Added `setPort()` and `getPort()` to `GuzzleHttp\Message\RequestInterface`. +* Added the ability to provide an emitter to a client in the client constructor. +* Added the ability to persist a cookie session using $_SESSION. +* Added a trait that can be used to add event listeners to an iterator. +* Removed request method constants from RequestInterface. +* Fixed warning when invalid request start-lines are received. +* Updated MessageFactory to work with custom request option methods. +* Updated cacert bundle to latest build. + +4.0.2 (2014-04-16) +------------------ + +* Proxy requests using the StreamAdapter now properly use request_fulluri (#632) +* Added the ability to set scalars as POST fields (#628) + +## 4.0.1 - 2014-04-04 + +* The HTTP status code of a response is now set as the exception code of + RequestException objects. +* 303 redirects will now correctly switch from POST to GET requests. +* The default parallel adapter of a client now correctly uses the MultiAdapter. +* HasDataTrait now initializes the internal data array as an empty array so + that the toArray() method always returns an array. + +## 4.0.0 - 2014-03-29 + +* For information on changes and upgrading, see: + https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 +* Added `GuzzleHttp\batch()` as a convenience function for sending requests in + parallel without needing to write asynchronous code. +* Restructured how events are added to `GuzzleHttp\ClientInterface::sendAll()`. + You can now pass a callable or an array of associative arrays where each + associative array contains the "fn", "priority", and "once" keys. + +## 4.0.0.rc-2 - 2014-03-25 + +* Removed `getConfig()` and `setConfig()` from clients to avoid confusion + around whether things like base_url, message_factory, etc. should be able to + be retrieved or modified. +* Added `getDefaultOption()` and `setDefaultOption()` to ClientInterface +* functions.php functions were renamed using snake_case to match PHP idioms +* Added support for `HTTP_PROXY`, `HTTPS_PROXY`, and + `GUZZLE_CURL_SELECT_TIMEOUT` environment variables +* Added the ability to specify custom `sendAll()` event priorities +* Added the ability to specify custom stream context options to the stream + adapter. +* Added a functions.php function for `get_path()` and `set_path()` +* CurlAdapter and MultiAdapter now use a callable to generate curl resources +* MockAdapter now properly reads a body and emits a `headers` event +* Updated Url class to check if a scheme and host are set before adding ":" + and "//". This allows empty Url (e.g., "") to be serialized as "". +* Parsing invalid XML no longer emits warnings +* Curl classes now properly throw AdapterExceptions +* Various performance optimizations +* Streams are created with the faster `Stream\create()` function +* Marked deprecation_proxy() as internal +* Test server is now a collection of static methods on a class + +## 4.0.0-rc.1 - 2014-03-15 + +* See https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 + +## 3.8.1 - 2014-01-28 + +* Bug: Always using GET requests when redirecting from a 303 response +* Bug: CURLOPT_SSL_VERIFYHOST is now correctly set to false when setting `$certificateAuthority` to false in + `Guzzle\Http\ClientInterface::setSslVerification()` +* Bug: RedirectPlugin now uses strict RFC 3986 compliance when combining a base URL with a relative URL +* Bug: The body of a request can now be set to `"0"` +* Sending PHP stream requests no longer forces `HTTP/1.0` +* Adding more information to ExceptionCollection exceptions so that users have more context, including a stack trace of + each sub-exception +* Updated the `$ref` attribute in service descriptions to merge over any existing parameters of a schema (rather than + clobbering everything). +* Merging URLs will now use the query string object from the relative URL (thus allowing custom query aggregators) +* Query strings are now parsed in a way that they do no convert empty keys with no value to have a dangling `=`. + For example `foo&bar=baz` is now correctly parsed and recognized as `foo&bar=baz` rather than `foo=&bar=baz`. +* Now properly escaping the regular expression delimiter when matching Cookie domains. +* Network access is now disabled when loading XML documents + +## 3.8.0 - 2013-12-05 + +* Added the ability to define a POST name for a file +* JSON response parsing now properly walks additionalProperties +* cURL error code 18 is now retried automatically in the BackoffPlugin +* Fixed a cURL error when URLs contain fragments +* Fixed an issue in the BackoffPlugin retry event where it was trying to access all exceptions as if they were + CurlExceptions +* CURLOPT_PROGRESS function fix for PHP 5.5 (69fcc1e) +* Added the ability for Guzzle to work with older versions of cURL that do not support `CURLOPT_TIMEOUT_MS` +* Fixed a bug that was encountered when parsing empty header parameters +* UriTemplate now has a `setRegex()` method to match the docs +* The `debug` request parameter now checks if it is truthy rather than if it exists +* Setting the `debug` request parameter to true shows verbose cURL output instead of using the LogPlugin +* Added the ability to combine URLs using strict RFC 3986 compliance +* Command objects can now return the validation errors encountered by the command +* Various fixes to cache revalidation (#437 and 29797e5) +* Various fixes to the AsyncPlugin +* Cleaned up build scripts + +## 3.7.4 - 2013-10-02 + +* Bug fix: 0 is now an allowed value in a description parameter that has a default value (#430) +* Bug fix: SchemaFormatter now returns an integer when formatting to a Unix timestamp + (see https://github.com/aws/aws-sdk-php/issues/147) +* Bug fix: Cleaned up and fixed URL dot segment removal to properly resolve internal dots +* Minimum PHP version is now properly specified as 5.3.3 (up from 5.3.2) (#420) +* Updated the bundled cacert.pem (#419) +* OauthPlugin now supports adding authentication to headers or query string (#425) + +## 3.7.3 - 2013-09-08 + +* Added the ability to get the exception associated with a request/command when using `MultiTransferException` and + `CommandTransferException`. +* Setting `additionalParameters` of a response to false is now honored when parsing responses with a service description +* Schemas are only injected into response models when explicitly configured. +* No longer guessing Content-Type based on the path of a request. Content-Type is now only guessed based on the path of + an EntityBody. +* Bug fix: ChunkedIterator can now properly chunk a \Traversable as well as an \Iterator. +* Bug fix: FilterIterator now relies on `\Iterator` instead of `\Traversable`. +* Bug fix: Gracefully handling malformed responses in RequestMediator::writeResponseBody() +* Bug fix: Replaced call to canCache with canCacheRequest in the CallbackCanCacheStrategy of the CachePlugin +* Bug fix: Visiting XML attributes first before visiting XML children when serializing requests +* Bug fix: Properly parsing headers that contain commas contained in quotes +* Bug fix: mimetype guessing based on a filename is now case-insensitive + +## 3.7.2 - 2013-08-02 + +* Bug fix: Properly URL encoding paths when using the PHP-only version of the UriTemplate expander + See https://github.com/guzzle/guzzle/issues/371 +* Bug fix: Cookie domains are now matched correctly according to RFC 6265 + See https://github.com/guzzle/guzzle/issues/377 +* Bug fix: GET parameters are now used when calculating an OAuth signature +* Bug fix: Fixed an issue with cache revalidation where the If-None-Match header was being double quoted +* `Guzzle\Common\AbstractHasDispatcher::dispatch()` now returns the event that was dispatched +* `Guzzle\Http\QueryString::factory()` now guesses the most appropriate query aggregator to used based on the input. + See https://github.com/guzzle/guzzle/issues/379 +* Added a way to add custom domain objects to service description parsing using the `operation.parse_class` event. See + https://github.com/guzzle/guzzle/pull/380 +* cURL multi cleanup and optimizations + +## 3.7.1 - 2013-07-05 + +* Bug fix: Setting default options on a client now works +* Bug fix: Setting options on HEAD requests now works. See #352 +* Bug fix: Moving stream factory before send event to before building the stream. See #353 +* Bug fix: Cookies no longer match on IP addresses per RFC 6265 +* Bug fix: Correctly parsing header parameters that are in `<>` and quotes +* Added `cert` and `ssl_key` as request options +* `Host` header can now diverge from the host part of a URL if the header is set manually +* `Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor` was rewritten to change from using SimpleXML to XMLWriter +* OAuth parameters are only added via the plugin if they aren't already set +* Exceptions are now thrown when a URL cannot be parsed +* Returning `false` if `Guzzle\Http\EntityBody::getContentMd5()` fails +* Not setting a `Content-MD5` on a command if calculating the Content-MD5 fails via the CommandContentMd5Plugin + +## 3.7.0 - 2013-06-10 + +* See UPGRADING.md for more information on how to upgrade. +* Requests now support the ability to specify an array of $options when creating a request to more easily modify a + request. You can pass a 'request.options' configuration setting to a client to apply default request options to + every request created by a client (e.g. default query string variables, headers, curl options, etc.). +* Added a static facade class that allows you to use Guzzle with static methods and mount the class to `\Guzzle`. + See `Guzzle\Http\StaticClient::mount`. +* Added `command.request_options` to `Guzzle\Service\Command\AbstractCommand` to pass request options to requests + created by a command (e.g. custom headers, query string variables, timeout settings, etc.). +* Stream size in `Guzzle\Stream\PhpStreamRequestFactory` will now be set if Content-Length is returned in the + headers of a response +* Added `Guzzle\Common\Collection::setPath($path, $value)` to set a value into an array using a nested key + (e.g. `$collection->setPath('foo/baz/bar', 'test'); echo $collection['foo']['bar']['bar'];`) +* ServiceBuilders now support storing and retrieving arbitrary data +* CachePlugin can now purge all resources for a given URI +* CachePlugin can automatically purge matching cached items when a non-idempotent request is sent to a resource +* CachePlugin now uses the Vary header to determine if a resource is a cache hit +* `Guzzle\Http\Message\Response` now implements `\Serializable` +* Added `Guzzle\Cache\CacheAdapterFactory::fromCache()` to more easily create cache adapters +* `Guzzle\Service\ClientInterface::execute()` now accepts an array, single command, or Traversable +* Fixed a bug in `Guzzle\Http\Message\Header\Link::addLink()` +* Better handling of calculating the size of a stream in `Guzzle\Stream\Stream` using fstat() and caching the size +* `Guzzle\Common\Exception\ExceptionCollection` now creates a more readable exception message +* Fixing BC break: Added back the MonologLogAdapter implementation rather than extending from PsrLog so that older + Symfony users can still use the old version of Monolog. +* Fixing BC break: Added the implementation back in for `Guzzle\Http\Message\AbstractMessage::getTokenizedHeader()`. + Now triggering an E_USER_DEPRECATED warning when used. Use `$message->getHeader()->parseParams()`. +* Several performance improvements to `Guzzle\Common\Collection` +* Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: + createRequest, head, delete, put, patch, post, options, prepareRequest +* Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` +* Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` +* Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to + `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a + resource, string, or EntityBody into the $options parameter to specify the download location of the response. +* Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a + default `array()` +* Added `Guzzle\Stream\StreamInterface::isRepeatable` +* Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use + $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or + $client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))`. +* Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use $client->getConfig()->getPath('request.options/headers')`. +* Removed `Guzzle\Http\ClientInterface::expandTemplate()` +* Removed `Guzzle\Http\ClientInterface::setRequestFactory()` +* Removed `Guzzle\Http\ClientInterface::getCurlMulti()` +* Removed `Guzzle\Http\Message\RequestInterface::canCache` +* Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect` +* Removed `Guzzle\Http\Message\RequestInterface::isRedirect` +* Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. +* You can now enable E_USER_DEPRECATED warnings to see if you are using a deprecated method by setting + `Guzzle\Common\Version::$emitWarnings` to true. +* Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use + `$request->getResponseBody()->isRepeatable()` instead. +* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use + `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use + `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +* Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. +* Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. +* Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated +* Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. + These will work through Guzzle 4.0 +* Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use [request.options][params]. +* Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. +* Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use $client->getConfig()->getPath('request.options/headers')`. +* Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. +* Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. +* Marked `Guzzle\Common\Collection::inject()` as deprecated. +* Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');` +* CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a + CacheStorageInterface. These two objects and interface will be removed in a future version. +* Always setting X-cache headers on cached responses +* Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin +* `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface + $request, Response $response);` +* `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` +* `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` +* Added `CacheStorageInterface::purge($url)` +* `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin + $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, + CanCacheStrategyInterface $canCache = null)` +* Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` + +## 3.6.0 - 2013-05-29 + +* ServiceDescription now implements ToArrayInterface +* Added command.hidden_params to blacklist certain headers from being treated as additionalParameters +* Guzzle can now correctly parse incomplete URLs +* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. +* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution +* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). +* Specific header implementations can be created for complex headers. When a message creates a header, it uses a + HeaderFactory which can map specific headers to specific header classes. There is now a Link header and + CacheControl header implementation. +* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate +* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() +* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in + Guzzle\Http\Curl\RequestMediator +* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. +* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface +* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() +* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() +* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). +* All response header helper functions return a string rather than mixing Header objects and strings inconsistently +* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle + directly via interfaces +* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist + but are a no-op until removed. +* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a + `Guzzle\Service\Command\ArrayCommandInterface`. +* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response + on a request while the request is still being transferred +* The ability to case-insensitively search for header values +* Guzzle\Http\Message\Header::hasExactHeader +* Guzzle\Http\Message\Header::raw. Use getAll() +* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object + instead. +* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess +* Added the ability to cast Model objects to a string to view debug information. + +## 3.5.0 - 2013-05-13 + +* Bug: Fixed a regression so that request responses are parsed only once per oncomplete event rather than multiple times +* Bug: Better cleanup of one-time events across the board (when an event is meant to fire once, it will now remove + itself from the EventDispatcher) +* Bug: `Guzzle\Log\MessageFormatter` now properly writes "total_time" and "connect_time" values +* Bug: Cloning an EntityEnclosingRequest now clones the EntityBody too +* Bug: Fixed an undefined index error when parsing nested JSON responses with a sentAs parameter that reference a + non-existent key +* Bug: All __call() method arguments are now required (helps with mocking frameworks) +* Deprecating Response::getRequest() and now using a shallow clone of a request object to remove a circular reference + to help with refcount based garbage collection of resources created by sending a request +* Deprecating ZF1 cache and log adapters. These will be removed in the next major version. +* Deprecating `Response::getPreviousResponse()` (method signature still exists, but it's deprecated). Use the + HistoryPlugin for a history. +* Added a `responseBody` alias for the `response_body` location +* Refactored internals to no longer rely on Response::getRequest() +* HistoryPlugin can now be cast to a string +* HistoryPlugin now logs transactions rather than requests and responses to more accurately keep track of the requests + and responses that are sent over the wire +* Added `getEffectiveUrl()` and `getRedirectCount()` to Response objects + +## 3.4.3 - 2013-04-30 + +* Bug fix: Fixing bug introduced in 3.4.2 where redirect responses are duplicated on the final redirected response +* Added a check to re-extract the temp cacert bundle from the phar before sending each request + +## 3.4.2 - 2013-04-29 + +* Bug fix: Stream objects now work correctly with "a" and "a+" modes +* Bug fix: Removing `Transfer-Encoding: chunked` header when a Content-Length is present +* Bug fix: AsyncPlugin no longer forces HEAD requests +* Bug fix: DateTime timezones are now properly handled when using the service description schema formatter +* Bug fix: CachePlugin now properly handles stale-if-error directives when a request to the origin server fails +* Setting a response on a request will write to the custom request body from the response body if one is specified +* LogPlugin now writes to php://output when STDERR is undefined +* Added the ability to set multiple POST files for the same key in a single call +* application/x-www-form-urlencoded POSTs now use the utf-8 charset by default +* Added the ability to queue CurlExceptions to the MockPlugin +* Cleaned up how manual responses are queued on requests (removed "queued_response" and now using request.before_send) +* Configuration loading now allows remote files + +## 3.4.1 - 2013-04-16 + +* Large refactoring to how CurlMulti handles work. There is now a proxy that sits in front of a pool of CurlMulti + handles. This greatly simplifies the implementation, fixes a couple bugs, and provides a small performance boost. +* Exceptions are now properly grouped when sending requests in parallel +* Redirects are now properly aggregated when a multi transaction fails +* Redirects now set the response on the original object even in the event of a failure +* Bug fix: Model names are now properly set even when using $refs +* Added support for PHP 5.5's CurlFile to prevent warnings with the deprecated @ syntax +* Added support for oauth_callback in OAuth signatures +* Added support for oauth_verifier in OAuth signatures +* Added support to attempt to retrieve a command first literally, then ucfirst, the with inflection + +## 3.4.0 - 2013-04-11 + +* Bug fix: URLs are now resolved correctly based on https://tools.ietf.org/html/rfc3986#section-5.2. #289 +* Bug fix: Absolute URLs with a path in a service description will now properly override the base URL. #289 +* Bug fix: Parsing a query string with a single PHP array value will now result in an array. #263 +* Bug fix: Better normalization of the User-Agent header to prevent duplicate headers. #264. +* Bug fix: Added `number` type to service descriptions. +* Bug fix: empty parameters are removed from an OAuth signature +* Bug fix: Revalidating a cache entry prefers the Last-Modified over the Date header +* Bug fix: Fixed "array to string" error when validating a union of types in a service description +* Bug fix: Removed code that attempted to determine the size of a stream when data is written to the stream +* Bug fix: Not including an `oauth_token` if the value is null in the OauthPlugin. +* Bug fix: Now correctly aggregating successful requests and failed requests in CurlMulti when a redirect occurs. +* The new default CURLOPT_TIMEOUT setting has been increased to 150 seconds so that Guzzle works on poor connections. +* Added a feature to EntityEnclosingRequest::setBody() that will automatically set the Content-Type of the request if + the Content-Type can be determined based on the entity body or the path of the request. +* Added the ability to overwrite configuration settings in a client when grabbing a throwaway client from a builder. +* Added support for a PSR-3 LogAdapter. +* Added a `command.after_prepare` event +* Added `oauth_callback` parameter to the OauthPlugin +* Added the ability to create a custom stream class when using a stream factory +* Added a CachingEntityBody decorator +* Added support for `additionalParameters` in service descriptions to define how custom parameters are serialized. +* The bundled SSL certificate is now provided in the phar file and extracted when running Guzzle from a phar. +* You can now send any EntityEnclosingRequest with POST fields or POST files and cURL will handle creating bodies +* POST requests using a custom entity body are now treated exactly like PUT requests but with a custom cURL method. This + means that the redirect behavior of POST requests with custom bodies will not be the same as POST requests that use + POST fields or files (the latter is only used when emulating a form POST in the browser). +* Lots of cleanup to CurlHandle::factory and RequestFactory::createRequest + +## 3.3.1 - 2013-03-10 + +* Added the ability to create PHP streaming responses from HTTP requests +* Bug fix: Running any filters when parsing response headers with service descriptions +* Bug fix: OauthPlugin fixes to allow for multi-dimensional array signing, and sorting parameters before signing +* Bug fix: Removed the adding of default empty arrays and false Booleans to responses in order to be consistent across + response location visitors. +* Bug fix: Removed the possibility of creating configuration files with circular dependencies +* RequestFactory::create() now uses the key of a POST file when setting the POST file name +* Added xmlAllowEmpty to serialize an XML body even if no XML specific parameters are set + +## 3.3.0 - 2013-03-03 + +* A large number of performance optimizations have been made +* Bug fix: Added 'wb' as a valid write mode for streams +* Bug fix: `Guzzle\Http\Message\Response::json()` now allows scalar values to be returned +* Bug fix: Fixed bug in `Guzzle\Http\Message\Response` where wrapping quotes were stripped from `getEtag()` +* BC: Removed `Guzzle\Http\Utils` class +* BC: Setting a service description on a client will no longer modify the client's command factories. +* BC: Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using + the 'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' +* BC: `Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getSteamType()` are no longer converted to + lowercase +* Operation parameter objects are now lazy loaded internally +* Added ErrorResponsePlugin that can throw errors for responses defined in service description operations' errorResponses +* Added support for instantiating responseType=class responseClass classes. Classes must implement + `Guzzle\Service\Command\ResponseClassInterface` +* Added support for additionalProperties for top-level parameters in responseType=model responseClasses. These + additional properties also support locations and can be used to parse JSON responses where the outermost part of the + JSON is an array +* Added support for nested renaming of JSON models (rename sentAs to name) +* CachePlugin + * Added support for stale-if-error so that the CachePlugin can now serve stale content from the cache on error + * Debug headers can now added to cached response in the CachePlugin + +## 3.2.0 - 2013-02-14 + +* CurlMulti is no longer reused globally. A new multi object is created per-client. This helps to isolate clients. +* URLs with no path no longer contain a "/" by default +* Guzzle\Http\QueryString does no longer manages the leading "?". This is now handled in Guzzle\Http\Url. +* BadResponseException no longer includes the full request and response message +* Adding setData() to Guzzle\Service\Description\ServiceDescriptionInterface +* Adding getResponseBody() to Guzzle\Http\Message\RequestInterface +* Various updates to classes to use ServiceDescriptionInterface type hints rather than ServiceDescription +* Header values can now be normalized into distinct values when multiple headers are combined with a comma separated list +* xmlEncoding can now be customized for the XML declaration of a XML service description operation +* Guzzle\Http\QueryString now uses Guzzle\Http\QueryAggregator\QueryAggregatorInterface objects to add custom value + aggregation and no longer uses callbacks +* The URL encoding implementation of Guzzle\Http\QueryString can now be customized +* Bug fix: Filters were not always invoked for array service description parameters +* Bug fix: Redirects now use a target response body rather than a temporary response body +* Bug fix: The default exponential backoff BackoffPlugin was not giving when the request threshold was exceeded +* Bug fix: Guzzle now takes the first found value when grabbing Cache-Control directives + +## 3.1.2 - 2013-01-27 + +* Refactored how operation responses are parsed. Visitors now include a before() method responsible for parsing the + response body. For example, the XmlVisitor now parses the XML response into an array in the before() method. +* Fixed an issue where cURL would not automatically decompress responses when the Accept-Encoding header was sent +* CURLOPT_SSL_VERIFYHOST is never set to 1 because it is deprecated (see 5e0ff2ef20f839e19d1eeb298f90ba3598784444) +* Fixed a bug where redirect responses were not chained correctly using getPreviousResponse() +* Setting default headers on a client after setting the user-agent will not erase the user-agent setting + +## 3.1.1 - 2013-01-20 + +* Adding wildcard support to Guzzle\Common\Collection::getPath() +* Adding alias support to ServiceBuilder configs +* Adding Guzzle\Service\Resource\CompositeResourceIteratorFactory and cleaning up factory interface + +## 3.1.0 - 2013-01-12 + +* BC: CurlException now extends from RequestException rather than BadResponseException +* BC: Renamed Guzzle\Plugin\Cache\CanCacheStrategyInterface::canCache() to canCacheRequest() and added CanCacheResponse() +* Added getData to ServiceDescriptionInterface +* Added context array to RequestInterface::setState() +* Bug: Removing hard dependency on the BackoffPlugin from Guzzle\Http +* Bug: Adding required content-type when JSON request visitor adds JSON to a command +* Bug: Fixing the serialization of a service description with custom data +* Made it easier to deal with exceptions thrown when transferring commands or requests in parallel by providing + an array of successful and failed responses +* Moved getPath from Guzzle\Service\Resource\Model to Guzzle\Common\Collection +* Added Guzzle\Http\IoEmittingEntityBody +* Moved command filtration from validators to location visitors +* Added `extends` attributes to service description parameters +* Added getModels to ServiceDescriptionInterface + +## 3.0.7 - 2012-12-19 + +* Fixing phar detection when forcing a cacert to system if null or true +* Allowing filename to be passed to `Guzzle\Http\Message\Request::setResponseBody()` +* Cleaning up `Guzzle\Common\Collection::inject` method +* Adding a response_body location to service descriptions + +## 3.0.6 - 2012-12-09 + +* CurlMulti performance improvements +* Adding setErrorResponses() to Operation +* composer.json tweaks + +## 3.0.5 - 2012-11-18 + +* Bug: Fixing an infinite recursion bug caused from revalidating with the CachePlugin +* Bug: Response body can now be a string containing "0" +* Bug: Using Guzzle inside of a phar uses system by default but now allows for a custom cacert +* Bug: QueryString::fromString now properly parses query string parameters that contain equal signs +* Added support for XML attributes in service description responses +* DefaultRequestSerializer now supports array URI parameter values for URI template expansion +* Added better mimetype guessing to requests and post files + +## 3.0.4 - 2012-11-11 + +* Bug: Fixed a bug when adding multiple cookies to a request to use the correct glue value +* Bug: Cookies can now be added that have a name, domain, or value set to "0" +* Bug: Using the system cacert bundle when using the Phar +* Added json and xml methods to Response to make it easier to parse JSON and XML response data into data structures +* Enhanced cookie jar de-duplication +* Added the ability to enable strict cookie jars that throw exceptions when invalid cookies are added +* Added setStream to StreamInterface to actually make it possible to implement custom rewind behavior for entity bodies +* Added the ability to create any sort of hash for a stream rather than just an MD5 hash + +## 3.0.3 - 2012-11-04 + +* Implementing redirects in PHP rather than cURL +* Added PECL URI template extension and using as default parser if available +* Bug: Fixed Content-Length parsing of Response factory +* Adding rewind() method to entity bodies and streams. Allows for custom rewinding of non-repeatable streams. +* Adding ToArrayInterface throughout library +* Fixing OauthPlugin to create unique nonce values per request + +## 3.0.2 - 2012-10-25 + +* Magic methods are enabled by default on clients +* Magic methods return the result of a command +* Service clients no longer require a base_url option in the factory +* Bug: Fixed an issue with URI templates where null template variables were being expanded + +## 3.0.1 - 2012-10-22 + +* Models can now be used like regular collection objects by calling filter, map, etc. +* Models no longer require a Parameter structure or initial data in the constructor +* Added a custom AppendIterator to get around a PHP bug with the `\AppendIterator` + +## 3.0.0 - 2012-10-15 + +* Rewrote service description format to be based on Swagger + * Now based on JSON schema + * Added nested input structures and nested response models + * Support for JSON and XML input and output models + * Renamed `commands` to `operations` + * Removed dot class notation + * Removed custom types +* Broke the project into smaller top-level namespaces to be more component friendly +* Removed support for XML configs and descriptions. Use arrays or JSON files. +* Removed the Validation component and Inspector +* Moved all cookie code to Guzzle\Plugin\Cookie +* Magic methods on a Guzzle\Service\Client now return the command un-executed. +* Calling getResult() or getResponse() on a command will lazily execute the command if needed. +* Now shipping with cURL's CA certs and using it by default +* Added previousResponse() method to response objects +* No longer sending Accept and Accept-Encoding headers on every request +* Only sending an Expect header by default when a payload is greater than 1MB +* Added/moved client options: + * curl.blacklist to curl.option.blacklist + * Added ssl.certificate_authority +* Added a Guzzle\Iterator component +* Moved plugins from Guzzle\Http\Plugin to Guzzle\Plugin +* Added a more robust backoff retry strategy (replaced the ExponentialBackoffPlugin) +* Added a more robust caching plugin +* Added setBody to response objects +* Updating LogPlugin to use a more flexible MessageFormatter +* Added a completely revamped build process +* Cleaning up Collection class and removing default values from the get method +* Fixed ZF2 cache adapters + +## 2.8.8 - 2012-10-15 + +* Bug: Fixed a cookie issue that caused dot prefixed domains to not match where popular browsers did + +## 2.8.7 - 2012-09-30 + +* Bug: Fixed config file aliases for JSON includes +* Bug: Fixed cookie bug on a request object by using CookieParser to parse cookies on requests +* Bug: Removing the path to a file when sending a Content-Disposition header on a POST upload +* Bug: Hardening request and response parsing to account for missing parts +* Bug: Fixed PEAR packaging +* Bug: Fixed Request::getInfo +* Bug: Fixed cases where CURLM_CALL_MULTI_PERFORM return codes were causing curl transactions to fail +* Adding the ability for the namespace Iterator factory to look in multiple directories +* Added more getters/setters/removers from service descriptions +* Added the ability to remove POST fields from OAuth signatures +* OAuth plugin now supports 2-legged OAuth + +## 2.8.6 - 2012-09-05 + +* Added the ability to modify and build service descriptions +* Added the use of visitors to apply parameters to locations in service descriptions using the dynamic command +* Added a `json` parameter location +* Now allowing dot notation for classes in the CacheAdapterFactory +* Using the union of two arrays rather than an array_merge when extending service builder services and service params +* Ensuring that a service is a string before doing strpos() checks on it when substituting services for references + in service builder config files. +* Services defined in two different config files that include one another will by default replace the previously + defined service, but you can now create services that extend themselves and merge their settings over the previous +* The JsonLoader now supports aliasing filenames with different filenames. This allows you to alias something like + '_default' with a default JSON configuration file. + +## 2.8.5 - 2012-08-29 + +* Bug: Suppressed empty arrays from URI templates +* Bug: Added the missing $options argument from ServiceDescription::factory to enable caching +* Added support for HTTP responses that do not contain a reason phrase in the start-line +* AbstractCommand commands are now invokable +* Added a way to get the data used when signing an Oauth request before a request is sent + +## 2.8.4 - 2012-08-15 + +* Bug: Custom delay time calculations are no longer ignored in the ExponentialBackoffPlugin +* Added the ability to transfer entity bodies as a string rather than streamed. This gets around curl error 65. Set `body_as_string` in a request's curl options to enable. +* Added a StreamInterface, EntityBodyInterface, and added ftell() to Guzzle\Common\Stream +* Added an AbstractEntityBodyDecorator and a ReadLimitEntityBody decorator to transfer only a subset of a decorated stream +* Stream and EntityBody objects will now return the file position to the previous position after a read required operation (e.g. getContentMd5()) +* Added additional response status codes +* Removed SSL information from the default User-Agent header +* DELETE requests can now send an entity body +* Added an EventDispatcher to the ExponentialBackoffPlugin and added an ExponentialBackoffLogger to log backoff retries +* Added the ability of the MockPlugin to consume mocked request bodies +* LogPlugin now exposes request and response objects in the extras array + +## 2.8.3 - 2012-07-30 + +* Bug: Fixed a case where empty POST requests were sent as GET requests +* Bug: Fixed a bug in ExponentialBackoffPlugin that caused fatal errors when retrying an EntityEnclosingRequest that does not have a body +* Bug: Setting the response body of a request to null after completing a request, not when setting the state of a request to new +* Added multiple inheritance to service description commands +* Added an ApiCommandInterface and added `getParamNames()` and `hasParam()` +* Removed the default 2mb size cutoff from the Md5ValidatorPlugin so that it now defaults to validating everything +* Changed CurlMulti::perform to pass a smaller timeout to CurlMulti::executeHandles + +## 2.8.2 - 2012-07-24 + +* Bug: Query string values set to 0 are no longer dropped from the query string +* Bug: A Collection object is no longer created each time a call is made to `Guzzle\Service\Command\AbstractCommand::getRequestHeaders()` +* Bug: `+` is now treated as an encoded space when parsing query strings +* QueryString and Collection performance improvements +* Allowing dot notation for class paths in filters attribute of a service descriptions + +## 2.8.1 - 2012-07-16 + +* Loosening Event Dispatcher dependency +* POST redirects can now be customized using CURLOPT_POSTREDIR + +## 2.8.0 - 2012-07-15 + +* BC: Guzzle\Http\Query + * Query strings with empty variables will always show an equal sign unless the variable is set to QueryString::BLANK (e.g. ?acl= vs ?acl) + * Changed isEncodingValues() and isEncodingFields() to isUrlEncoding() + * Changed setEncodeValues(bool) and setEncodeFields(bool) to useUrlEncoding(bool) + * Changed the aggregation functions of QueryString to be static methods + * Can now use fromString() with querystrings that have a leading ? +* cURL configuration values can be specified in service descriptions using `curl.` prefixed parameters +* Content-Length is set to 0 before emitting the request.before_send event when sending an empty request body +* Cookies are no longer URL decoded by default +* Bug: URI template variables set to null are no longer expanded + +## 2.7.2 - 2012-07-02 + +* BC: Moving things to get ready for subtree splits. Moving Inflection into Common. Moving Guzzle\Http\Parser to Guzzle\Parser. +* BC: Removing Guzzle\Common\Batch\Batch::count() and replacing it with isEmpty() +* CachePlugin now allows for a custom request parameter function to check if a request can be cached +* Bug fix: CachePlugin now only caches GET and HEAD requests by default +* Bug fix: Using header glue when transferring headers over the wire +* Allowing deeply nested arrays for composite variables in URI templates +* Batch divisors can now return iterators or arrays + +## 2.7.1 - 2012-06-26 + +* Minor patch to update version number in UA string +* Updating build process + +## 2.7.0 - 2012-06-25 + +* BC: Inflection classes moved to Guzzle\Inflection. No longer static methods. Can now inject custom inflectors into classes. +* BC: Removed magic setX methods from commands +* BC: Magic methods mapped to service description commands are now inflected in the command factory rather than the client __call() method +* Verbose cURL options are no longer enabled by default. Set curl.debug to true on a client to enable. +* Bug: Now allowing colons in a response start-line (e.g. HTTP/1.1 503 Service Unavailable: Back-end server is at capacity) +* Guzzle\Service\Resource\ResourceIteratorApplyBatched now internally uses the Guzzle\Common\Batch namespace +* Added Guzzle\Service\Plugin namespace and a PluginCollectionPlugin +* Added the ability to set POST fields and files in a service description +* Guzzle\Http\EntityBody::factory() now accepts objects with a __toString() method +* Adding a command.before_prepare event to clients +* Added BatchClosureTransfer and BatchClosureDivisor +* BatchTransferException now includes references to the batch divisor and transfer strategies +* Fixed some tests so that they pass more reliably +* Added Guzzle\Common\Log\ArrayLogAdapter + +## 2.6.6 - 2012-06-10 + +* BC: Removing Guzzle\Http\Plugin\BatchQueuePlugin +* BC: Removing Guzzle\Service\Command\CommandSet +* Adding generic batching system (replaces the batch queue plugin and command set) +* Updating ZF cache and log adapters and now using ZF's composer repository +* Bug: Setting the name of each ApiParam when creating through an ApiCommand +* Adding result_type, result_doc, deprecated, and doc_url to service descriptions +* Bug: Changed the default cookie header casing back to 'Cookie' + +## 2.6.5 - 2012-06-03 + +* BC: Renaming Guzzle\Http\Message\RequestInterface::getResourceUri() to getResource() +* BC: Removing unused AUTH_BASIC and AUTH_DIGEST constants from +* BC: Guzzle\Http\Cookie is now used to manage Set-Cookie data, not Cookie data +* BC: Renaming methods in the CookieJarInterface +* Moving almost all cookie logic out of the CookiePlugin and into the Cookie or CookieJar implementations +* Making the default glue for HTTP headers ';' instead of ',' +* Adding a removeValue to Guzzle\Http\Message\Header +* Adding getCookies() to request interface. +* Making it easier to add event subscribers to HasDispatcherInterface classes. Can now directly call addSubscriber() + +## 2.6.4 - 2012-05-30 + +* BC: Cleaning up how POST files are stored in EntityEnclosingRequest objects. Adding PostFile class. +* BC: Moving ApiCommand specific functionality from the Inspector and on to the ApiCommand +* Bug: Fixing magic method command calls on clients +* Bug: Email constraint only validates strings +* Bug: Aggregate POST fields when POST files are present in curl handle +* Bug: Fixing default User-Agent header +* Bug: Only appending or prepending parameters in commands if they are specified +* Bug: Not requiring response reason phrases or status codes to match a predefined list of codes +* Allowing the use of dot notation for class namespaces when using instance_of constraint +* Added any_match validation constraint +* Added an AsyncPlugin +* Passing request object to the calculateWait method of the ExponentialBackoffPlugin +* Allowing the result of a command object to be changed +* Parsing location and type sub values when instantiating a service description rather than over and over at runtime + +## 2.6.3 - 2012-05-23 + +* [BC] Guzzle\Common\FromConfigInterface no longer requires any config options. +* [BC] Refactoring how POST files are stored on an EntityEnclosingRequest. They are now separate from POST fields. +* You can now use an array of data when creating PUT request bodies in the request factory. +* Removing the requirement that HTTPS requests needed a Cache-Control: public directive to be cacheable. +* [Http] Adding support for Content-Type in multipart POST uploads per upload +* [Http] Added support for uploading multiple files using the same name (foo[0], foo[1]) +* Adding more POST data operations for easier manipulation of POST data. +* You can now set empty POST fields. +* The body of a request is only shown on EntityEnclosingRequest objects that do not use POST files. +* Split the Guzzle\Service\Inspector::validateConfig method into two methods. One to initialize when a command is created, and one to validate. +* CS updates + +## 2.6.2 - 2012-05-19 + +* [Http] Better handling of nested scope requests in CurlMulti. Requests are now always prepares in the send() method rather than the addRequest() method. + +## 2.6.1 - 2012-05-19 + +* [BC] Removing 'path' support in service descriptions. Use 'uri'. +* [BC] Guzzle\Service\Inspector::parseDocBlock is now protected. Adding getApiParamsForClass() with cache. +* [BC] Removing Guzzle\Common\NullObject. Use https://github.com/mtdowling/NullObject if you need it. +* [BC] Removing Guzzle\Common\XmlElement. +* All commands, both dynamic and concrete, have ApiCommand objects. +* Adding a fix for CurlMulti so that if all of the connections encounter some sort of curl error, then the loop exits. +* Adding checks to EntityEnclosingRequest so that empty POST files and fields are ignored. +* Making the method signature of Guzzle\Service\Builder\ServiceBuilder::factory more flexible. + +## 2.6.0 - 2012-05-15 + +* [BC] Moving Guzzle\Service\Builder to Guzzle\Service\Builder\ServiceBuilder +* [BC] Executing a Command returns the result of the command rather than the command +* [BC] Moving all HTTP parsing logic to Guzzle\Http\Parsers. Allows for faster C implementations if needed. +* [BC] Changing the Guzzle\Http\Message\Response::setProtocol() method to accept a protocol and version in separate args. +* [BC] Moving ResourceIterator* to Guzzle\Service\Resource +* [BC] Completely refactored ResourceIterators to iterate over a cloned command object +* [BC] Moved Guzzle\Http\UriTemplate to Guzzle\Http\Parser\UriTemplate\UriTemplate +* [BC] Guzzle\Guzzle is now deprecated +* Moving Guzzle\Common\Guzzle::inject to Guzzle\Common\Collection::inject +* Adding Guzzle\Version class to give version information about Guzzle +* Adding Guzzle\Http\Utils class to provide getDefaultUserAgent() and getHttpDate() +* Adding Guzzle\Curl\CurlVersion to manage caching curl_version() data +* ServiceDescription and ServiceBuilder are now cacheable using similar configs +* Changing the format of XML and JSON service builder configs. Backwards compatible. +* Cleaned up Cookie parsing +* Trimming the default Guzzle User-Agent header +* Adding a setOnComplete() method to Commands that is called when a command completes +* Keeping track of requests that were mocked in the MockPlugin +* Fixed a caching bug in the CacheAdapterFactory +* Inspector objects can be injected into a Command object +* Refactoring a lot of code and tests to be case insensitive when dealing with headers +* Adding Guzzle\Http\Message\HeaderComparison for easy comparison of HTTP headers using a DSL +* Adding the ability to set global option overrides to service builder configs +* Adding the ability to include other service builder config files from within XML and JSON files +* Moving the parseQuery method out of Url and on to QueryString::fromString() as a static factory method. + +## 2.5.0 - 2012-05-08 + +* Major performance improvements +* [BC] Simplifying Guzzle\Common\Collection. Please check to see if you are using features that are now deprecated. +* [BC] Using a custom validation system that allows a flyweight implementation for much faster validation. No longer using Symfony2 Validation component. +* [BC] No longer supporting "{{ }}" for injecting into command or UriTemplates. Use "{}" +* Added the ability to passed parameters to all requests created by a client +* Added callback functionality to the ExponentialBackoffPlugin +* Using microtime in ExponentialBackoffPlugin to allow more granular backoff strategies. +* Rewinding request stream bodies when retrying requests +* Exception is thrown when JSON response body cannot be decoded +* Added configurable magic method calls to clients and commands. This is off by default. +* Fixed a defect that added a hash to every parsed URL part +* Fixed duplicate none generation for OauthPlugin. +* Emitting an event each time a client is generated by a ServiceBuilder +* Using an ApiParams object instead of a Collection for parameters of an ApiCommand +* cache.* request parameters should be renamed to params.cache.* +* Added the ability to set arbitrary curl options on requests (disable_wire, progress, etc.). See CurlHandle. +* Added the ability to disable type validation of service descriptions +* ServiceDescriptions and ServiceBuilders are now Serializable diff --git a/vendor/guzzlehttp/guzzle/LICENSE b/vendor/guzzlehttp/guzzle/LICENSE new file mode 100644 index 00000000..fd2375d8 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/LICENSE @@ -0,0 +1,27 @@ +The MIT License (MIT) + +Copyright (c) 2011 Michael Dowling +Copyright (c) 2012 Jeremy Lindblom +Copyright (c) 2014 Graham Campbell +Copyright (c) 2015 Márk Sági-Kazár +Copyright (c) 2015 Tobias Schultze +Copyright (c) 2016 Tobias Nyholm +Copyright (c) 2016 George Mponos + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/guzzlehttp/guzzle/README.md b/vendor/guzzlehttp/guzzle/README.md new file mode 100644 index 00000000..0025aa7a --- /dev/null +++ b/vendor/guzzlehttp/guzzle/README.md @@ -0,0 +1,94 @@ +![Guzzle](.github/logo.png?raw=true) + +# Guzzle, PHP HTTP client + +[![Latest Version](https://img.shields.io/github/release/guzzle/guzzle.svg?style=flat-square)](https://github.com/guzzle/guzzle/releases) +[![Build Status](https://img.shields.io/github/workflow/status/guzzle/guzzle/CI?label=ci%20build&style=flat-square)](https://github.com/guzzle/guzzle/actions?query=workflow%3ACI) +[![Total Downloads](https://img.shields.io/packagist/dt/guzzlehttp/guzzle.svg?style=flat-square)](https://packagist.org/packages/guzzlehttp/guzzle) + +Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and +trivial to integrate with web services. + +- Simple interface for building query strings, POST requests, streaming large + uploads, streaming large downloads, using HTTP cookies, uploading JSON data, + etc... +- Can send both synchronous and asynchronous requests using the same interface. +- Uses PSR-7 interfaces for requests, responses, and streams. This allows you + to utilize other PSR-7 compatible libraries with Guzzle. +- Supports PSR-18 allowing interoperability between other PSR-18 HTTP Clients. +- Abstracts away the underlying HTTP transport, allowing you to write + environment and transport agnostic code; i.e., no hard dependency on cURL, + PHP streams, sockets, or non-blocking event loops. +- Middleware system allows you to augment and compose client behavior. + +```php +$client = new \GuzzleHttp\Client(); +$response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle'); + +echo $response->getStatusCode(); // 200 +echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8' +echo $response->getBody(); // '{"id": 1420053, "name": "guzzle", ...}' + +// Send an asynchronous request. +$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org'); +$promise = $client->sendAsync($request)->then(function ($response) { + echo 'I completed! ' . $response->getBody(); +}); + +$promise->wait(); +``` + +## Help and docs + +We use GitHub issues only to discuss bugs and new features. For support please refer to: + +- [Documentation](http://guzzlephp.org/) +- [Stack Overflow](http://stackoverflow.com/questions/tagged/guzzle) +- [#guzzle](https://app.slack.com/client/T0D2S9JCT/CE6UAAKL4) channel on [PHP-HTTP Slack](http://slack.httplug.io/) +- [Gitter](https://gitter.im/guzzle/guzzle) + + +## Installing Guzzle + +The recommended way to install Guzzle is through +[Composer](https://getcomposer.org/). + +```bash +composer require guzzlehttp/guzzle +``` + + +## Version Guidance + +| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version | +|---------|------------|---------------------|--------------|---------------------|---------------------|-------|-------------| +| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >= 5.3.3 | +| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >= 5.4 | +| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >= 5.4 | +| 6.x | Security fixes | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >= 5.5 | +| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >= 7.2 | + +[guzzle-3-repo]: https://github.com/guzzle/guzzle3 +[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x +[guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3 +[guzzle-6-repo]: https://github.com/guzzle/guzzle/tree/6.5 +[guzzle-7-repo]: https://github.com/guzzle/guzzle +[guzzle-3-docs]: http://guzzle3.readthedocs.org +[guzzle-5-docs]: http://docs.guzzlephp.org/en/5.3/ +[guzzle-6-docs]: http://docs.guzzlephp.org/en/6.5/ +[guzzle-7-docs]: http://docs.guzzlephp.org/en/latest/ + + +## Security + +If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/guzzle/security/policy) for more information. + +## License + +Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. + +## For Enterprise + +Available as part of the Tidelift Subscription + +The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-guzzle?utm_source=packagist-guzzlehttp-guzzle&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/vendor/guzzlehttp/guzzle/UPGRADING.md b/vendor/guzzlehttp/guzzle/UPGRADING.md new file mode 100644 index 00000000..45417a7e --- /dev/null +++ b/vendor/guzzlehttp/guzzle/UPGRADING.md @@ -0,0 +1,1253 @@ +Guzzle Upgrade Guide +==================== + +6.0 to 7.0 +---------- + +In order to take advantage of the new features of PHP, Guzzle dropped the support +of PHP 5. The minimum supported PHP version is now PHP 7.2. Type hints and return +types for functions and methods have been added wherever possible. + +Please make sure: +- You are calling a function or a method with the correct type. +- If you extend a class of Guzzle; update all signatures on methods you override. + +#### Other backwards compatibility breaking changes + +- Class `GuzzleHttp\UriTemplate` is removed. +- Class `GuzzleHttp\Exception\SeekException` is removed. +- Classes `GuzzleHttp\Exception\BadResponseException`, `GuzzleHttp\Exception\ClientException`, + `GuzzleHttp\Exception\ServerException` can no longer be initialized with an empty + Response as argument. +- Class `GuzzleHttp\Exception\ConnectException` now extends `GuzzleHttp\Exception\TransferException` + instead of `GuzzleHttp\Exception\RequestException`. +- Function `GuzzleHttp\Exception\ConnectException::getResponse()` is removed. +- Function `GuzzleHttp\Exception\ConnectException::hasResponse()` is removed. +- Constant `GuzzleHttp\ClientInterface::VERSION` is removed. Added `GuzzleHttp\ClientInterface::MAJOR_VERSION` instead. +- Function `GuzzleHttp\Exception\RequestException::getResponseBodySummary` is removed. + Use `\GuzzleHttp\Psr7\get_message_body_summary` as an alternative. +- Function `GuzzleHttp\Cookie\CookieJar::getCookieValue` is removed. +- Request option `exception` is removed. Please use `http_errors`. +- Request option `save_to` is removed. Please use `sink`. +- Pool option `pool_size` is removed. Please use `concurrency`. +- We now look for environment variables in the `$_SERVER` super global, due to thread safety issues with `getenv`. We continue to fallback to `getenv` in CLI environments, for maximum compatibility. +- The `get`, `head`, `put`, `post`, `patch`, `delete`, `getAsync`, `headAsync`, `putAsync`, `postAsync`, `patchAsync`, and `deleteAsync` methods are now implemented as genuine methods on `GuzzleHttp\Client`, with strong typing. The original `__call` implementation remains unchanged for now, for maximum backwards compatibility, but won't be invoked under normal operation. +- The `log` middleware will log the errors with level `error` instead of `notice` +- Support for international domain names (IDN) is now disabled by default, and enabling it requires installing ext-intl, linked against a modern version of the C library (ICU 4.6 or higher). + +#### Native functions calls + +All internal native functions calls of Guzzle are now prefixed with a slash. This +change makes it impossible for method overloading by other libraries or applications. +Example: + +```php +// Before: +curl_version(); + +// After: +\curl_version(); +``` + +For the full diff you can check [here](https://github.com/guzzle/guzzle/compare/6.5.4..master). + +5.0 to 6.0 +---------- + +Guzzle now uses [PSR-7](https://www.php-fig.org/psr/psr-7/) for HTTP messages. +Due to the fact that these messages are immutable, this prompted a refactoring +of Guzzle to use a middleware based system rather than an event system. Any +HTTP message interaction (e.g., `GuzzleHttp\Message\Request`) need to be +updated to work with the new immutable PSR-7 request and response objects. Any +event listeners or subscribers need to be updated to become middleware +functions that wrap handlers (or are injected into a +`GuzzleHttp\HandlerStack`). + +- Removed `GuzzleHttp\BatchResults` +- Removed `GuzzleHttp\Collection` +- Removed `GuzzleHttp\HasDataTrait` +- Removed `GuzzleHttp\ToArrayInterface` +- The `guzzlehttp/streams` dependency has been removed. Stream functionality + is now present in the `GuzzleHttp\Psr7` namespace provided by the + `guzzlehttp/psr7` package. +- Guzzle no longer uses ReactPHP promises and now uses the + `guzzlehttp/promises` library. We use a custom promise library for three + significant reasons: + 1. React promises (at the time of writing this) are recursive. Promise + chaining and promise resolution will eventually blow the stack. Guzzle + promises are not recursive as they use a sort of trampolining technique. + Note: there has been movement in the React project to modify promises to + no longer utilize recursion. + 2. Guzzle needs to have the ability to synchronously block on a promise to + wait for a result. Guzzle promises allows this functionality (and does + not require the use of recursion). + 3. Because we need to be able to wait on a result, doing so using React + promises requires wrapping react promises with RingPHP futures. This + overhead is no longer needed, reducing stack sizes, reducing complexity, + and improving performance. +- `GuzzleHttp\Mimetypes` has been moved to a function in + `GuzzleHttp\Psr7\mimetype_from_extension` and + `GuzzleHttp\Psr7\mimetype_from_filename`. +- `GuzzleHttp\Query` and `GuzzleHttp\QueryParser` have been removed. Query + strings must now be passed into request objects as strings, or provided to + the `query` request option when creating requests with clients. The `query` + option uses PHP's `http_build_query` to convert an array to a string. If you + need a different serialization technique, you will need to pass the query + string in as a string. There are a couple helper functions that will make + working with query strings easier: `GuzzleHttp\Psr7\parse_query` and + `GuzzleHttp\Psr7\build_query`. +- Guzzle no longer has a dependency on RingPHP. Due to the use of a middleware + system based on PSR-7, using RingPHP and it's middleware system as well adds + more complexity than the benefits it provides. All HTTP handlers that were + present in RingPHP have been modified to work directly with PSR-7 messages + and placed in the `GuzzleHttp\Handler` namespace. This significantly reduces + complexity in Guzzle, removes a dependency, and improves performance. RingPHP + will be maintained for Guzzle 5 support, but will no longer be a part of + Guzzle 6. +- As Guzzle now uses a middleware based systems the event system and RingPHP + integration has been removed. Note: while the event system has been removed, + it is possible to add your own type of event system that is powered by the + middleware system. + - Removed the `Event` namespace. + - Removed the `Subscriber` namespace. + - Removed `Transaction` class + - Removed `RequestFsm` + - Removed `RingBridge` + - `GuzzleHttp\Subscriber\Cookie` is now provided by + `GuzzleHttp\Middleware::cookies` + - `GuzzleHttp\Subscriber\HttpError` is now provided by + `GuzzleHttp\Middleware::httpError` + - `GuzzleHttp\Subscriber\History` is now provided by + `GuzzleHttp\Middleware::history` + - `GuzzleHttp\Subscriber\Mock` is now provided by + `GuzzleHttp\Handler\MockHandler` + - `GuzzleHttp\Subscriber\Prepare` is now provided by + `GuzzleHttp\PrepareBodyMiddleware` + - `GuzzleHttp\Subscriber\Redirect` is now provided by + `GuzzleHttp\RedirectMiddleware` +- Guzzle now uses `Psr\Http\Message\UriInterface` (implements in + `GuzzleHttp\Psr7\Uri`) for URI support. `GuzzleHttp\Url` is now gone. +- Static functions in `GuzzleHttp\Utils` have been moved to namespaced + functions under the `GuzzleHttp` namespace. This requires either a Composer + based autoloader or you to include functions.php. +- `GuzzleHttp\ClientInterface::getDefaultOption` has been renamed to + `GuzzleHttp\ClientInterface::getConfig`. +- `GuzzleHttp\ClientInterface::setDefaultOption` has been removed. +- The `json` and `xml` methods of response objects has been removed. With the + migration to strictly adhering to PSR-7 as the interface for Guzzle messages, + adding methods to message interfaces would actually require Guzzle messages + to extend from PSR-7 messages rather then work with them directly. + +## Migrating to middleware + +The change to PSR-7 unfortunately required significant refactoring to Guzzle +due to the fact that PSR-7 messages are immutable. Guzzle 5 relied on an event +system from plugins. The event system relied on mutability of HTTP messages and +side effects in order to work. With immutable messages, you have to change your +workflow to become more about either returning a value (e.g., functional +middlewares) or setting a value on an object. Guzzle v6 has chosen the +functional middleware approach. + +Instead of using the event system to listen for things like the `before` event, +you now create a stack based middleware function that intercepts a request on +the way in and the promise of the response on the way out. This is a much +simpler and more predictable approach than the event system and works nicely +with PSR-7 middleware. Due to the use of promises, the middleware system is +also asynchronous. + +v5: + +```php +use GuzzleHttp\Event\BeforeEvent; +$client = new GuzzleHttp\Client(); +// Get the emitter and listen to the before event. +$client->getEmitter()->on('before', function (BeforeEvent $e) { + // Guzzle v5 events relied on mutation + $e->getRequest()->setHeader('X-Foo', 'Bar'); +}); +``` + +v6: + +In v6, you can modify the request before it is sent using the `mapRequest` +middleware. The idiomatic way in v6 to modify the request/response lifecycle is +to setup a handler middleware stack up front and inject the handler into a +client. + +```php +use GuzzleHttp\Middleware; +// Create a handler stack that has all of the default middlewares attached +$handler = GuzzleHttp\HandlerStack::create(); +// Push the handler onto the handler stack +$handler->push(Middleware::mapRequest(function (RequestInterface $request) { + // Notice that we have to return a request object + return $request->withHeader('X-Foo', 'Bar'); +})); +// Inject the handler into the client +$client = new GuzzleHttp\Client(['handler' => $handler]); +``` + +## POST Requests + +This version added the [`form_params`](http://guzzle.readthedocs.org/en/latest/request-options.html#form_params) +and `multipart` request options. `form_params` is an associative array of +strings or array of strings and is used to serialize an +`application/x-www-form-urlencoded` POST request. The +[`multipart`](http://guzzle.readthedocs.org/en/latest/request-options.html#multipart) +option is now used to send a multipart/form-data POST request. + +`GuzzleHttp\Post\PostFile` has been removed. Use the `multipart` option to add +POST files to a multipart/form-data request. + +The `body` option no longer accepts an array to send POST requests. Please use +`multipart` or `form_params` instead. + +The `base_url` option has been renamed to `base_uri`. + +4.x to 5.0 +---------- + +## Rewritten Adapter Layer + +Guzzle now uses [RingPHP](http://ringphp.readthedocs.org/en/latest) to send +HTTP requests. The `adapter` option in a `GuzzleHttp\Client` constructor +is still supported, but it has now been renamed to `handler`. Instead of +passing a `GuzzleHttp\Adapter\AdapterInterface`, you must now pass a PHP +`callable` that follows the RingPHP specification. + +## Removed Fluent Interfaces + +[Fluent interfaces were removed](https://ocramius.github.io/blog/fluent-interfaces-are-evil/) +from the following classes: + +- `GuzzleHttp\Collection` +- `GuzzleHttp\Url` +- `GuzzleHttp\Query` +- `GuzzleHttp\Post\PostBody` +- `GuzzleHttp\Cookie\SetCookie` + +## Removed functions.php + +Removed "functions.php", so that Guzzle is truly PSR-4 compliant. The following +functions can be used as replacements. + +- `GuzzleHttp\json_decode` -> `GuzzleHttp\Utils::jsonDecode` +- `GuzzleHttp\get_path` -> `GuzzleHttp\Utils::getPath` +- `GuzzleHttp\Utils::setPath` -> `GuzzleHttp\set_path` +- `GuzzleHttp\Pool::batch` -> `GuzzleHttp\batch`. This function is, however, + deprecated in favor of using `GuzzleHttp\Pool::batch()`. + +The "procedural" global client has been removed with no replacement (e.g., +`GuzzleHttp\get()`, `GuzzleHttp\post()`, etc.). Use a `GuzzleHttp\Client` +object as a replacement. + +## `throwImmediately` has been removed + +The concept of "throwImmediately" has been removed from exceptions and error +events. This control mechanism was used to stop a transfer of concurrent +requests from completing. This can now be handled by throwing the exception or +by cancelling a pool of requests or each outstanding future request +individually. + +## headers event has been removed + +Removed the "headers" event. This event was only useful for changing the +body a response once the headers of the response were known. You can implement +a similar behavior in a number of ways. One example might be to use a +FnStream that has access to the transaction being sent. For example, when the +first byte is written, you could check if the response headers match your +expectations, and if so, change the actual stream body that is being +written to. + +## Updates to HTTP Messages + +Removed the `asArray` parameter from +`GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header +value as an array, then use the newly added `getHeaderAsArray()` method of +`MessageInterface`. This change makes the Guzzle interfaces compatible with +the PSR-7 interfaces. + +3.x to 4.0 +---------- + +## Overarching changes: + +- Now requires PHP 5.4 or greater. +- No longer requires cURL to send requests. +- Guzzle no longer wraps every exception it throws. Only exceptions that are + recoverable are now wrapped by Guzzle. +- Various namespaces have been removed or renamed. +- No longer requiring the Symfony EventDispatcher. A custom event dispatcher + based on the Symfony EventDispatcher is + now utilized in `GuzzleHttp\Event\EmitterInterface` (resulting in significant + speed and functionality improvements). + +Changes per Guzzle 3.x namespace are described below. + +## Batch + +The `Guzzle\Batch` namespace has been removed. This is best left to +third-parties to implement on top of Guzzle's core HTTP library. + +## Cache + +The `Guzzle\Cache` namespace has been removed. (Todo: No suitable replacement +has been implemented yet, but hoping to utilize a PSR cache interface). + +## Common + +- Removed all of the wrapped exceptions. It's better to use the standard PHP + library for unrecoverable exceptions. +- `FromConfigInterface` has been removed. +- `Guzzle\Common\Version` has been removed. The VERSION constant can be found + at `GuzzleHttp\ClientInterface::VERSION`. + +### Collection + +- `getAll` has been removed. Use `toArray` to convert a collection to an array. +- `inject` has been removed. +- `keySearch` has been removed. +- `getPath` no longer supports wildcard expressions. Use something better like + JMESPath for this. +- `setPath` now supports appending to an existing array via the `[]` notation. + +### Events + +Guzzle no longer requires Symfony's EventDispatcher component. Guzzle now uses +`GuzzleHttp\Event\Emitter`. + +- `Symfony\Component\EventDispatcher\EventDispatcherInterface` is replaced by + `GuzzleHttp\Event\EmitterInterface`. +- `Symfony\Component\EventDispatcher\EventDispatcher` is replaced by + `GuzzleHttp\Event\Emitter`. +- `Symfony\Component\EventDispatcher\Event` is replaced by + `GuzzleHttp\Event\Event`, and Guzzle now has an EventInterface in + `GuzzleHttp\Event\EventInterface`. +- `AbstractHasDispatcher` has moved to a trait, `HasEmitterTrait`, and + `HasDispatcherInterface` has moved to `HasEmitterInterface`. Retrieving the + event emitter of a request, client, etc. now uses the `getEmitter` method + rather than the `getDispatcher` method. + +#### Emitter + +- Use the `once()` method to add a listener that automatically removes itself + the first time it is invoked. +- Use the `listeners()` method to retrieve a list of event listeners rather than + the `getListeners()` method. +- Use `emit()` instead of `dispatch()` to emit an event from an emitter. +- Use `attach()` instead of `addSubscriber()` and `detach()` instead of + `removeSubscriber()`. + +```php +$mock = new Mock(); +// 3.x +$request->getEventDispatcher()->addSubscriber($mock); +$request->getEventDispatcher()->removeSubscriber($mock); +// 4.x +$request->getEmitter()->attach($mock); +$request->getEmitter()->detach($mock); +``` + +Use the `on()` method to add a listener rather than the `addListener()` method. + +```php +// 3.x +$request->getEventDispatcher()->addListener('foo', function (Event $event) { /* ... */ } ); +// 4.x +$request->getEmitter()->on('foo', function (Event $event, $name) { /* ... */ } ); +``` + +## Http + +### General changes + +- The cacert.pem certificate has been moved to `src/cacert.pem`. +- Added the concept of adapters that are used to transfer requests over the + wire. +- Simplified the event system. +- Sending requests in parallel is still possible, but batching is no longer a + concept of the HTTP layer. Instead, you must use the `complete` and `error` + events to asynchronously manage parallel request transfers. +- `Guzzle\Http\Url` has moved to `GuzzleHttp\Url`. +- `Guzzle\Http\QueryString` has moved to `GuzzleHttp\Query`. +- QueryAggregators have been rewritten so that they are simply callable + functions. +- `GuzzleHttp\StaticClient` has been removed. Use the functions provided in + `functions.php` for an easy to use static client instance. +- Exceptions in `GuzzleHttp\Exception` have been updated to all extend from + `GuzzleHttp\Exception\TransferException`. + +### Client + +Calling methods like `get()`, `post()`, `head()`, etc. no longer create and +return a request, but rather creates a request, sends the request, and returns +the response. + +```php +// 3.0 +$request = $client->get('/'); +$response = $request->send(); + +// 4.0 +$response = $client->get('/'); + +// or, to mirror the previous behavior +$request = $client->createRequest('GET', '/'); +$response = $client->send($request); +``` + +`GuzzleHttp\ClientInterface` has changed. + +- The `send` method no longer accepts more than one request. Use `sendAll` to + send multiple requests in parallel. +- `setUserAgent()` has been removed. Use a default request option instead. You + could, for example, do something like: + `$client->setConfig('defaults/headers/User-Agent', 'Foo/Bar ' . $client::getDefaultUserAgent())`. +- `setSslVerification()` has been removed. Use default request options instead, + like `$client->setConfig('defaults/verify', true)`. + +`GuzzleHttp\Client` has changed. + +- The constructor now accepts only an associative array. You can include a + `base_url` string or array to use a URI template as the base URL of a client. + You can also specify a `defaults` key that is an associative array of default + request options. You can pass an `adapter` to use a custom adapter, + `batch_adapter` to use a custom adapter for sending requests in parallel, or + a `message_factory` to change the factory used to create HTTP requests and + responses. +- The client no longer emits a `client.create_request` event. +- Creating requests with a client no longer automatically utilize a URI + template. You must pass an array into a creational method (e.g., + `createRequest`, `get`, `put`, etc.) in order to expand a URI template. + +### Messages + +Messages no longer have references to their counterparts (i.e., a request no +longer has a reference to it's response, and a response no loger has a +reference to its request). This association is now managed through a +`GuzzleHttp\Adapter\TransactionInterface` object. You can get references to +these transaction objects using request events that are emitted over the +lifecycle of a request. + +#### Requests with a body + +- `GuzzleHttp\Message\EntityEnclosingRequest` and + `GuzzleHttp\Message\EntityEnclosingRequestInterface` have been removed. The + separation between requests that contain a body and requests that do not + contain a body has been removed, and now `GuzzleHttp\Message\RequestInterface` + handles both use cases. +- Any method that previously accepts a `GuzzleHttp\Response` object now accept a + `GuzzleHttp\Message\ResponseInterface`. +- `GuzzleHttp\Message\RequestFactoryInterface` has been renamed to + `GuzzleHttp\Message\MessageFactoryInterface`. This interface is used to create + both requests and responses and is implemented in + `GuzzleHttp\Message\MessageFactory`. +- POST field and file methods have been removed from the request object. You + must now use the methods made available to `GuzzleHttp\Post\PostBodyInterface` + to control the format of a POST body. Requests that are created using a + standard `GuzzleHttp\Message\MessageFactoryInterface` will automatically use + a `GuzzleHttp\Post\PostBody` body if the body was passed as an array or if + the method is POST and no body is provided. + +```php +$request = $client->createRequest('POST', '/'); +$request->getBody()->setField('foo', 'bar'); +$request->getBody()->addFile(new PostFile('file_key', fopen('/path/to/content', 'r'))); +``` + +#### Headers + +- `GuzzleHttp\Message\Header` has been removed. Header values are now simply + represented by an array of values or as a string. Header values are returned + as a string by default when retrieving a header value from a message. You can + pass an optional argument of `true` to retrieve a header value as an array + of strings instead of a single concatenated string. +- `GuzzleHttp\PostFile` and `GuzzleHttp\PostFileInterface` have been moved to + `GuzzleHttp\Post`. This interface has been simplified and now allows the + addition of arbitrary headers. +- Custom headers like `GuzzleHttp\Message\Header\Link` have been removed. Most + of the custom headers are now handled separately in specific + subscribers/plugins, and `GuzzleHttp\Message\HeaderValues::parseParams()` has + been updated to properly handle headers that contain parameters (like the + `Link` header). + +#### Responses + +- `GuzzleHttp\Message\Response::getInfo()` and + `GuzzleHttp\Message\Response::setInfo()` have been removed. Use the event + system to retrieve this type of information. +- `GuzzleHttp\Message\Response::getRawHeaders()` has been removed. +- `GuzzleHttp\Message\Response::getMessage()` has been removed. +- `GuzzleHttp\Message\Response::calculateAge()` and other cache specific + methods have moved to the CacheSubscriber. +- Header specific helper functions like `getContentMd5()` have been removed. + Just use `getHeader('Content-MD5')` instead. +- `GuzzleHttp\Message\Response::setRequest()` and + `GuzzleHttp\Message\Response::getRequest()` have been removed. Use the event + system to work with request and response objects as a transaction. +- `GuzzleHttp\Message\Response::getRedirectCount()` has been removed. Use the + Redirect subscriber instead. +- `GuzzleHttp\Message\Response::isSuccessful()` and other related methods have + been removed. Use `getStatusCode()` instead. + +#### Streaming responses + +Streaming requests can now be created by a client directly, returning a +`GuzzleHttp\Message\ResponseInterface` object that contains a body stream +referencing an open PHP HTTP stream. + +```php +// 3.0 +use Guzzle\Stream\PhpStreamRequestFactory; +$request = $client->get('/'); +$factory = new PhpStreamRequestFactory(); +$stream = $factory->fromRequest($request); +$data = $stream->read(1024); + +// 4.0 +$response = $client->get('/', ['stream' => true]); +// Read some data off of the stream in the response body +$data = $response->getBody()->read(1024); +``` + +#### Redirects + +The `configureRedirects()` method has been removed in favor of a +`allow_redirects` request option. + +```php +// Standard redirects with a default of a max of 5 redirects +$request = $client->createRequest('GET', '/', ['allow_redirects' => true]); + +// Strict redirects with a custom number of redirects +$request = $client->createRequest('GET', '/', [ + 'allow_redirects' => ['max' => 5, 'strict' => true] +]); +``` + +#### EntityBody + +EntityBody interfaces and classes have been removed or moved to +`GuzzleHttp\Stream`. All classes and interfaces that once required +`GuzzleHttp\EntityBodyInterface` now require +`GuzzleHttp\Stream\StreamInterface`. Creating a new body for a request no +longer uses `GuzzleHttp\EntityBody::factory` but now uses +`GuzzleHttp\Stream\Stream::factory` or even better: +`GuzzleHttp\Stream\create()`. + +- `Guzzle\Http\EntityBodyInterface` is now `GuzzleHttp\Stream\StreamInterface` +- `Guzzle\Http\EntityBody` is now `GuzzleHttp\Stream\Stream` +- `Guzzle\Http\CachingEntityBody` is now `GuzzleHttp\Stream\CachingStream` +- `Guzzle\Http\ReadLimitEntityBody` is now `GuzzleHttp\Stream\LimitStream` +- `Guzzle\Http\IoEmittyinEntityBody` has been removed. + +#### Request lifecycle events + +Requests previously submitted a large number of requests. The number of events +emitted over the lifecycle of a request has been significantly reduced to make +it easier to understand how to extend the behavior of a request. All events +emitted during the lifecycle of a request now emit a custom +`GuzzleHttp\Event\EventInterface` object that contains context providing +methods and a way in which to modify the transaction at that specific point in +time (e.g., intercept the request and set a response on the transaction). + +- `request.before_send` has been renamed to `before` and now emits a + `GuzzleHttp\Event\BeforeEvent` +- `request.complete` has been renamed to `complete` and now emits a + `GuzzleHttp\Event\CompleteEvent`. +- `request.sent` has been removed. Use `complete`. +- `request.success` has been removed. Use `complete`. +- `error` is now an event that emits a `GuzzleHttp\Event\ErrorEvent`. +- `request.exception` has been removed. Use `error`. +- `request.receive.status_line` has been removed. +- `curl.callback.progress` has been removed. Use a custom `StreamInterface` to + maintain a status update. +- `curl.callback.write` has been removed. Use a custom `StreamInterface` to + intercept writes. +- `curl.callback.read` has been removed. Use a custom `StreamInterface` to + intercept reads. + +`headers` is a new event that is emitted after the response headers of a +request have been received before the body of the response is downloaded. This +event emits a `GuzzleHttp\Event\HeadersEvent`. + +You can intercept a request and inject a response using the `intercept()` event +of a `GuzzleHttp\Event\BeforeEvent`, `GuzzleHttp\Event\CompleteEvent`, and +`GuzzleHttp\Event\ErrorEvent` event. + +See: http://docs.guzzlephp.org/en/latest/events.html + +## Inflection + +The `Guzzle\Inflection` namespace has been removed. This is not a core concern +of Guzzle. + +## Iterator + +The `Guzzle\Iterator` namespace has been removed. + +- `Guzzle\Iterator\AppendIterator`, `Guzzle\Iterator\ChunkedIterator`, and + `Guzzle\Iterator\MethodProxyIterator` are nice, but not a core requirement of + Guzzle itself. +- `Guzzle\Iterator\FilterIterator` is no longer needed because an equivalent + class is shipped with PHP 5.4. +- `Guzzle\Iterator\MapIterator` is not really needed when using PHP 5.5 because + it's easier to just wrap an iterator in a generator that maps values. + +For a replacement of these iterators, see https://github.com/nikic/iter + +## Log + +The LogPlugin has moved to https://github.com/guzzle/log-subscriber. The +`Guzzle\Log` namespace has been removed. Guzzle now relies on +`Psr\Log\LoggerInterface` for all logging. The MessageFormatter class has been +moved to `GuzzleHttp\Subscriber\Log\Formatter`. + +## Parser + +The `Guzzle\Parser` namespace has been removed. This was previously used to +make it possible to plug in custom parsers for cookies, messages, URI +templates, and URLs; however, this level of complexity is not needed in Guzzle +so it has been removed. + +- Cookie: Cookie parsing logic has been moved to + `GuzzleHttp\Cookie\SetCookie::fromString`. +- Message: Message parsing logic for both requests and responses has been moved + to `GuzzleHttp\Message\MessageFactory::fromMessage`. Message parsing is only + used in debugging or deserializing messages, so it doesn't make sense for + Guzzle as a library to add this level of complexity to parsing messages. +- UriTemplate: URI template parsing has been moved to + `GuzzleHttp\UriTemplate`. The Guzzle library will automatically use the PECL + URI template library if it is installed. +- Url: URL parsing is now performed in `GuzzleHttp\Url::fromString` (previously + it was `Guzzle\Http\Url::factory()`). If custom URL parsing is necessary, + then developers are free to subclass `GuzzleHttp\Url`. + +## Plugin + +The `Guzzle\Plugin` namespace has been renamed to `GuzzleHttp\Subscriber`. +Several plugins are shipping with the core Guzzle library under this namespace. + +- `GuzzleHttp\Subscriber\Cookie`: Replaces the old CookiePlugin. Cookie jar + code has moved to `GuzzleHttp\Cookie`. +- `GuzzleHttp\Subscriber\History`: Replaces the old HistoryPlugin. +- `GuzzleHttp\Subscriber\HttpError`: Throws errors when a bad HTTP response is + received. +- `GuzzleHttp\Subscriber\Mock`: Replaces the old MockPlugin. +- `GuzzleHttp\Subscriber\Prepare`: Prepares the body of a request just before + sending. This subscriber is attached to all requests by default. +- `GuzzleHttp\Subscriber\Redirect`: Replaces the RedirectPlugin. + +The following plugins have been removed (third-parties are free to re-implement +these if needed): + +- `GuzzleHttp\Plugin\Async` has been removed. +- `GuzzleHttp\Plugin\CurlAuth` has been removed. +- `GuzzleHttp\Plugin\ErrorResponse\ErrorResponsePlugin` has been removed. This + functionality should instead be implemented with event listeners that occur + after normal response parsing occurs in the guzzle/command package. + +The following plugins are not part of the core Guzzle package, but are provided +in separate repositories: + +- `Guzzle\Http\Plugin\BackoffPlugin` has been rewritten to be much simpler + to build custom retry policies using simple functions rather than various + chained classes. See: https://github.com/guzzle/retry-subscriber +- `Guzzle\Http\Plugin\Cache\CachePlugin` has moved to + https://github.com/guzzle/cache-subscriber +- `Guzzle\Http\Plugin\Log\LogPlugin` has moved to + https://github.com/guzzle/log-subscriber +- `Guzzle\Http\Plugin\Md5\Md5Plugin` has moved to + https://github.com/guzzle/message-integrity-subscriber +- `Guzzle\Http\Plugin\Mock\MockPlugin` has moved to + `GuzzleHttp\Subscriber\MockSubscriber`. +- `Guzzle\Http\Plugin\Oauth\OauthPlugin` has moved to + https://github.com/guzzle/oauth-subscriber + +## Service + +The service description layer of Guzzle has moved into two separate packages: + +- http://github.com/guzzle/command Provides a high level abstraction over web + services by representing web service operations using commands. +- http://github.com/guzzle/guzzle-services Provides an implementation of + guzzle/command that provides request serialization and response parsing using + Guzzle service descriptions. + +## Stream + +Stream have moved to a separate package available at +https://github.com/guzzle/streams. + +`Guzzle\Stream\StreamInterface` has been given a large update to cleanly take +on the responsibilities of `Guzzle\Http\EntityBody` and +`Guzzle\Http\EntityBodyInterface` now that they have been removed. The number +of methods implemented by the `StreamInterface` has been drastically reduced to +allow developers to more easily extend and decorate stream behavior. + +## Removed methods from StreamInterface + +- `getStream` and `setStream` have been removed to better encapsulate streams. +- `getMetadata` and `setMetadata` have been removed in favor of + `GuzzleHttp\Stream\MetadataStreamInterface`. +- `getWrapper`, `getWrapperData`, `getStreamType`, and `getUri` have all been + removed. This data is accessible when + using streams that implement `GuzzleHttp\Stream\MetadataStreamInterface`. +- `rewind` has been removed. Use `seek(0)` for a similar behavior. + +## Renamed methods + +- `detachStream` has been renamed to `detach`. +- `feof` has been renamed to `eof`. +- `ftell` has been renamed to `tell`. +- `readLine` has moved from an instance method to a static class method of + `GuzzleHttp\Stream\Stream`. + +## Metadata streams + +`GuzzleHttp\Stream\MetadataStreamInterface` has been added to denote streams +that contain additional metadata accessible via `getMetadata()`. +`GuzzleHttp\Stream\StreamInterface::getMetadata` and +`GuzzleHttp\Stream\StreamInterface::setMetadata` have been removed. + +## StreamRequestFactory + +The entire concept of the StreamRequestFactory has been removed. The way this +was used in Guzzle 3 broke the actual interface of sending streaming requests +(instead of getting back a Response, you got a StreamInterface). Streaming +PHP requests are now implemented through the `GuzzleHttp\Adapter\StreamAdapter`. + +3.6 to 3.7 +---------- + +### Deprecations + +- You can now enable E_USER_DEPRECATED warnings to see if you are using any deprecated methods.: + +```php +\Guzzle\Common\Version::$emitWarnings = true; +``` + +The following APIs and options have been marked as deprecated: + +- Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use `$request->getResponseBody()->isRepeatable()` instead. +- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +- Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. +- Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. +- Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated +- Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. +- Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. +- Marked `Guzzle\Common\Collection::inject()` as deprecated. +- Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use + `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` or + `$client->setDefaultOption('auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` + +3.7 introduces `request.options` as a parameter for a client configuration and as an optional argument to all creational +request methods. When paired with a client's configuration settings, these options allow you to specify default settings +for various aspects of a request. Because these options make other previous configuration options redundant, several +configuration options and methods of a client and AbstractCommand have been deprecated. + +- Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use `$client->getDefaultOption('headers')`. +- Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use `$client->setDefaultOption('headers/{header_name}', 'value')`. +- Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use `$client->setDefaultOption('params/{param_name}', 'value')` +- Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. These will work through Guzzle 4.0 + + $command = $client->getCommand('foo', array( + 'command.headers' => array('Test' => '123'), + 'command.response_body' => '/path/to/file' + )); + + // Should be changed to: + + $command = $client->getCommand('foo', array( + 'command.request_options' => array( + 'headers' => array('Test' => '123'), + 'save_as' => '/path/to/file' + ) + )); + +### Interface changes + +Additions and changes (you will need to update any implementations or subclasses you may have created): + +- Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: + createRequest, head, delete, put, patch, post, options, prepareRequest +- Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` +- Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` +- Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to + `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a + resource, string, or EntityBody into the $options parameter to specify the download location of the response. +- Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a + default `array()` +- Added `Guzzle\Stream\StreamInterface::isRepeatable` +- Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. + +The following methods were removed from interfaces. All of these methods are still available in the concrete classes +that implement them, but you should update your code to use alternative methods: + +- Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use + `$client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or + `$client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))` or + `$client->setDefaultOption('headers/{header_name}', 'value')`. or + `$client->setDefaultOption('headers', array('header_name' => 'value'))`. +- Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use `$client->getConfig()->getPath('request.options/headers')`. +- Removed `Guzzle\Http\ClientInterface::expandTemplate()`. This is an implementation detail. +- Removed `Guzzle\Http\ClientInterface::setRequestFactory()`. This is an implementation detail. +- Removed `Guzzle\Http\ClientInterface::getCurlMulti()`. This is a very specific implementation detail. +- Removed `Guzzle\Http\Message\RequestInterface::canCache`. Use the CachePlugin. +- Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect`. Use the HistoryPlugin. +- Removed `Guzzle\Http\Message\RequestInterface::isRedirect`. Use the HistoryPlugin. + +### Cache plugin breaking changes + +- CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a + CacheStorageInterface. These two objects and interface will be removed in a future version. +- Always setting X-cache headers on cached responses +- Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin +- `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface + $request, Response $response);` +- `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` +- `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` +- Added `CacheStorageInterface::purge($url)` +- `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin + $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, + CanCacheStrategyInterface $canCache = null)` +- Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` + +3.5 to 3.6 +---------- + +* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. +* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution +* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). + For example, setHeader() first removes the header using unset on a HeaderCollection and then calls addHeader(). + Keeping the Host header and URL host in sync is now handled by overriding the addHeader method in Request. +* Specific header implementations can be created for complex headers. When a message creates a header, it uses a + HeaderFactory which can map specific headers to specific header classes. There is now a Link header and + CacheControl header implementation. +* Moved getLinks() from Response to just be used on a Link header object. + +If you previously relied on Guzzle\Http\Message\Header::raw(), then you will need to update your code to use the +HeaderInterface (e.g. toArray(), getAll(), etc.). + +### Interface changes + +* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate +* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() +* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in + Guzzle\Http\Curl\RequestMediator +* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. +* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface +* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() + +### Removed deprecated functions + +* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() +* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). + +### Deprecations + +* The ability to case-insensitively search for header values +* Guzzle\Http\Message\Header::hasExactHeader +* Guzzle\Http\Message\Header::raw. Use getAll() +* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object + instead. + +### Other changes + +* All response header helper functions return a string rather than mixing Header objects and strings inconsistently +* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle + directly via interfaces +* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist + but are a no-op until removed. +* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a + `Guzzle\Service\Command\ArrayCommandInterface`. +* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response + on a request while the request is still being transferred +* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess + +3.3 to 3.4 +---------- + +Base URLs of a client now follow the rules of https://tools.ietf.org/html/rfc3986#section-5.2.2 when merging URLs. + +3.2 to 3.3 +---------- + +### Response::getEtag() quote stripping removed + +`Guzzle\Http\Message\Response::getEtag()` no longer strips quotes around the ETag response header + +### Removed `Guzzle\Http\Utils` + +The `Guzzle\Http\Utils` class was removed. This class was only used for testing. + +### Stream wrapper and type + +`Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getStreamType()` are no longer converted to lowercase. + +### curl.emit_io became emit_io + +Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using the +'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' + +3.1 to 3.2 +---------- + +### CurlMulti is no longer reused globally + +Before 3.2, the same CurlMulti object was reused globally for each client. This can cause issue where plugins added +to a single client can pollute requests dispatched from other clients. + +If you still wish to reuse the same CurlMulti object with each client, then you can add a listener to the +ServiceBuilder's `service_builder.create_client` event to inject a custom CurlMulti object into each client as it is +created. + +```php +$multi = new Guzzle\Http\Curl\CurlMulti(); +$builder = Guzzle\Service\Builder\ServiceBuilder::factory('/path/to/config.json'); +$builder->addListener('service_builder.create_client', function ($event) use ($multi) { + $event['client']->setCurlMulti($multi); +} +}); +``` + +### No default path + +URLs no longer have a default path value of '/' if no path was specified. + +Before: + +```php +$request = $client->get('http://www.foo.com'); +echo $request->getUrl(); +// >> http://www.foo.com/ +``` + +After: + +```php +$request = $client->get('http://www.foo.com'); +echo $request->getUrl(); +// >> http://www.foo.com +``` + +### Less verbose BadResponseException + +The exception message for `Guzzle\Http\Exception\BadResponseException` no longer contains the full HTTP request and +response information. You can, however, get access to the request and response object by calling `getRequest()` or +`getResponse()` on the exception object. + +### Query parameter aggregation + +Multi-valued query parameters are no longer aggregated using a callback function. `Guzzle\Http\Query` now has a +setAggregator() method that accepts a `Guzzle\Http\QueryAggregator\QueryAggregatorInterface` object. This object is +responsible for handling the aggregation of multi-valued query string variables into a flattened hash. + +2.8 to 3.x +---------- + +### Guzzle\Service\Inspector + +Change `\Guzzle\Service\Inspector::fromConfig` to `\Guzzle\Common\Collection::fromConfig` + +**Before** + +```php +use Guzzle\Service\Inspector; + +class YourClient extends \Guzzle\Service\Client +{ + public static function factory($config = array()) + { + $default = array(); + $required = array('base_url', 'username', 'api_key'); + $config = Inspector::fromConfig($config, $default, $required); + + $client = new self( + $config->get('base_url'), + $config->get('username'), + $config->get('api_key') + ); + $client->setConfig($config); + + $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); + + return $client; + } +``` + +**After** + +```php +use Guzzle\Common\Collection; + +class YourClient extends \Guzzle\Service\Client +{ + public static function factory($config = array()) + { + $default = array(); + $required = array('base_url', 'username', 'api_key'); + $config = Collection::fromConfig($config, $default, $required); + + $client = new self( + $config->get('base_url'), + $config->get('username'), + $config->get('api_key') + ); + $client->setConfig($config); + + $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); + + return $client; + } +``` + +### Convert XML Service Descriptions to JSON + +**Before** + +```xml + + + + + + Get a list of groups + + + Uses a search query to get a list of groups + + + + Create a group + + + + + Delete a group by ID + + + + + + + Update a group + + + + + + +``` + +**After** + +```json +{ + "name": "Zendesk REST API v2", + "apiVersion": "2012-12-31", + "description":"Provides access to Zendesk views, groups, tickets, ticket fields, and users", + "operations": { + "list_groups": { + "httpMethod":"GET", + "uri": "groups.json", + "summary": "Get a list of groups" + }, + "search_groups":{ + "httpMethod":"GET", + "uri": "search.json?query=\"{query} type:group\"", + "summary": "Uses a search query to get a list of groups", + "parameters":{ + "query":{ + "location": "uri", + "description":"Zendesk Search Query", + "type": "string", + "required": true + } + } + }, + "create_group": { + "httpMethod":"POST", + "uri": "groups.json", + "summary": "Create a group", + "parameters":{ + "data": { + "type": "array", + "location": "body", + "description":"Group JSON", + "filters": "json_encode", + "required": true + }, + "Content-Type":{ + "type": "string", + "location":"header", + "static": "application/json" + } + } + }, + "delete_group": { + "httpMethod":"DELETE", + "uri": "groups/{id}.json", + "summary": "Delete a group", + "parameters":{ + "id":{ + "location": "uri", + "description":"Group to delete by ID", + "type": "integer", + "required": true + } + } + }, + "get_group": { + "httpMethod":"GET", + "uri": "groups/{id}.json", + "summary": "Get a ticket", + "parameters":{ + "id":{ + "location": "uri", + "description":"Group to get by ID", + "type": "integer", + "required": true + } + } + }, + "update_group": { + "httpMethod":"PUT", + "uri": "groups/{id}.json", + "summary": "Update a group", + "parameters":{ + "id": { + "location": "uri", + "description":"Group to update by ID", + "type": "integer", + "required": true + }, + "data": { + "type": "array", + "location": "body", + "description":"Group JSON", + "filters": "json_encode", + "required": true + }, + "Content-Type":{ + "type": "string", + "location":"header", + "static": "application/json" + } + } + } +} +``` + +### Guzzle\Service\Description\ServiceDescription + +Commands are now called Operations + +**Before** + +```php +use Guzzle\Service\Description\ServiceDescription; + +$sd = new ServiceDescription(); +$sd->getCommands(); // @returns ApiCommandInterface[] +$sd->hasCommand($name); +$sd->getCommand($name); // @returns ApiCommandInterface|null +$sd->addCommand($command); // @param ApiCommandInterface $command +``` + +**After** + +```php +use Guzzle\Service\Description\ServiceDescription; + +$sd = new ServiceDescription(); +$sd->getOperations(); // @returns OperationInterface[] +$sd->hasOperation($name); +$sd->getOperation($name); // @returns OperationInterface|null +$sd->addOperation($operation); // @param OperationInterface $operation +``` + +### Guzzle\Common\Inflection\Inflector + +Namespace is now `Guzzle\Inflection\Inflector` + +### Guzzle\Http\Plugin + +Namespace is now `Guzzle\Plugin`. Many other changes occur within this namespace and are detailed in their own sections below. + +### Guzzle\Http\Plugin\LogPlugin and Guzzle\Common\Log + +Now `Guzzle\Plugin\Log\LogPlugin` and `Guzzle\Log` respectively. + +**Before** + +```php +use Guzzle\Common\Log\ClosureLogAdapter; +use Guzzle\Http\Plugin\LogPlugin; + +/** @var \Guzzle\Http\Client */ +$client; + +// $verbosity is an integer indicating desired message verbosity level +$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $verbosity = LogPlugin::LOG_VERBOSE); +``` + +**After** + +```php +use Guzzle\Log\ClosureLogAdapter; +use Guzzle\Log\MessageFormatter; +use Guzzle\Plugin\Log\LogPlugin; + +/** @var \Guzzle\Http\Client */ +$client; + +// $format is a string indicating desired message format -- @see MessageFormatter +$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $format = MessageFormatter::DEBUG_FORMAT); +``` + +### Guzzle\Http\Plugin\CurlAuthPlugin + +Now `Guzzle\Plugin\CurlAuth\CurlAuthPlugin`. + +### Guzzle\Http\Plugin\ExponentialBackoffPlugin + +Now `Guzzle\Plugin\Backoff\BackoffPlugin`, and other changes. + +**Before** + +```php +use Guzzle\Http\Plugin\ExponentialBackoffPlugin; + +$backoffPlugin = new ExponentialBackoffPlugin($maxRetries, array_merge( + ExponentialBackoffPlugin::getDefaultFailureCodes(), array(429) + )); + +$client->addSubscriber($backoffPlugin); +``` + +**After** + +```php +use Guzzle\Plugin\Backoff\BackoffPlugin; +use Guzzle\Plugin\Backoff\HttpBackoffStrategy; + +// Use convenient factory method instead -- see implementation for ideas of what +// you can do with chaining backoff strategies +$backoffPlugin = BackoffPlugin::getExponentialBackoff($maxRetries, array_merge( + HttpBackoffStrategy::getDefaultFailureCodes(), array(429) + )); +$client->addSubscriber($backoffPlugin); +``` + +### Known Issues + +#### [BUG] Accept-Encoding header behavior changed unintentionally. + +(See #217) (Fixed in 09daeb8c666fb44499a0646d655a8ae36456575e) + +In version 2.8 setting the `Accept-Encoding` header would set the CURLOPT_ENCODING option, which permitted cURL to +properly handle gzip/deflate compressed responses from the server. In versions affected by this bug this does not happen. +See issue #217 for a workaround, or use a version containing the fix. diff --git a/vendor/guzzlehttp/guzzle/composer.json b/vendor/guzzlehttp/guzzle/composer.json new file mode 100644 index 00000000..2549f78b --- /dev/null +++ b/vendor/guzzlehttp/guzzle/composer.json @@ -0,0 +1,98 @@ +{ + "name": "guzzlehttp/guzzle", + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "framework", + "http", + "rest", + "web service", + "curl", + "client", + "HTTP client", + "PSR-7", + "PSR-18" + ], + "license": "MIT", + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "require": { + "php": "^7.2.5 || ^8.0", + "ext-json": "*", + "guzzlehttp/promises": "^1.5", + "guzzlehttp/psr7": "^1.8.3 || ^2.1", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "ext-curl": "*", + "bamarni/composer-bin-plugin": "^1.4.1", + "php-http/client-integration-tests": "^3.0", + "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "config": { + "preferred-install": "dist", + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "7.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Tests\\": "tests/" + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/BodySummarizer.php b/vendor/guzzlehttp/guzzle/src/BodySummarizer.php new file mode 100644 index 00000000..6eca94ef --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/BodySummarizer.php @@ -0,0 +1,28 @@ +truncateAt = $truncateAt; + } + + /** + * Returns a summarized message body. + */ + public function summarize(MessageInterface $message): ?string + { + return $this->truncateAt === null + ? \GuzzleHttp\Psr7\Message::bodySummary($message) + : \GuzzleHttp\Psr7\Message::bodySummary($message, $this->truncateAt); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php b/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php new file mode 100644 index 00000000..3e02e036 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php @@ -0,0 +1,13 @@ + 'http://www.foo.com/1.0/', + * 'timeout' => 0, + * 'allow_redirects' => false, + * 'proxy' => '192.168.16.1:10' + * ]); + * + * Client configuration settings include the following options: + * + * - handler: (callable) Function that transfers HTTP requests over the + * wire. The function is called with a Psr7\Http\Message\RequestInterface + * and array of transfer options, and must return a + * GuzzleHttp\Promise\PromiseInterface that is fulfilled with a + * Psr7\Http\Message\ResponseInterface on success. + * If no handler is provided, a default handler will be created + * that enables all of the request options below by attaching all of the + * default middleware to the handler. + * - base_uri: (string|UriInterface) Base URI of the client that is merged + * into relative URIs. Can be a string or instance of UriInterface. + * - **: any request option + * + * @param array $config Client configuration settings. + * + * @see \GuzzleHttp\RequestOptions for a list of available request options. + */ + public function __construct(array $config = []) + { + if (!isset($config['handler'])) { + $config['handler'] = HandlerStack::create(); + } elseif (!\is_callable($config['handler'])) { + throw new InvalidArgumentException('handler must be a callable'); + } + + // Convert the base_uri to a UriInterface + if (isset($config['base_uri'])) { + $config['base_uri'] = Psr7\Utils::uriFor($config['base_uri']); + } + + $this->configureDefaults($config); + } + + /** + * @param string $method + * @param array $args + * + * @return PromiseInterface|ResponseInterface + * + * @deprecated Client::__call will be removed in guzzlehttp/guzzle:8.0. + */ + public function __call($method, $args) + { + if (\count($args) < 1) { + throw new InvalidArgumentException('Magic request methods require a URI and optional options array'); + } + + $uri = $args[0]; + $opts = $args[1] ?? []; + + return \substr($method, -5) === 'Async' + ? $this->requestAsync(\substr($method, 0, -5), $uri, $opts) + : $this->request($method, $uri, $opts); + } + + /** + * Asynchronously send an HTTP request. + * + * @param array $options Request options to apply to the given + * request and to the transfer. See \GuzzleHttp\RequestOptions. + */ + public function sendAsync(RequestInterface $request, array $options = []): PromiseInterface + { + // Merge the base URI into the request URI if needed. + $options = $this->prepareDefaults($options); + + return $this->transfer( + $request->withUri($this->buildUri($request->getUri(), $options), $request->hasHeader('Host')), + $options + ); + } + + /** + * Send an HTTP request. + * + * @param array $options Request options to apply to the given + * request and to the transfer. See \GuzzleHttp\RequestOptions. + * + * @throws GuzzleException + */ + public function send(RequestInterface $request, array $options = []): ResponseInterface + { + $options[RequestOptions::SYNCHRONOUS] = true; + return $this->sendAsync($request, $options)->wait(); + } + + /** + * The HttpClient PSR (PSR-18) specify this method. + * + * @inheritDoc + */ + public function sendRequest(RequestInterface $request): ResponseInterface + { + $options[RequestOptions::SYNCHRONOUS] = true; + $options[RequestOptions::ALLOW_REDIRECTS] = false; + $options[RequestOptions::HTTP_ERRORS] = false; + + return $this->sendAsync($request, $options)->wait(); + } + + /** + * Create and send an asynchronous HTTP request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string $method HTTP method + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. + */ + public function requestAsync(string $method, $uri = '', array $options = []): PromiseInterface + { + $options = $this->prepareDefaults($options); + // Remove request modifying parameter because it can be done up-front. + $headers = $options['headers'] ?? []; + $body = $options['body'] ?? null; + $version = $options['version'] ?? '1.1'; + // Merge the URI into the base URI. + $uri = $this->buildUri(Psr7\Utils::uriFor($uri), $options); + if (\is_array($body)) { + throw $this->invalidBody(); + } + $request = new Psr7\Request($method, $uri, $headers, $body, $version); + // Remove the option so that they are not doubly-applied. + unset($options['headers'], $options['body'], $options['version']); + + return $this->transfer($request, $options); + } + + /** + * Create and send an HTTP request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string $method HTTP method. + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. + * + * @throws GuzzleException + */ + public function request(string $method, $uri = '', array $options = []): ResponseInterface + { + $options[RequestOptions::SYNCHRONOUS] = true; + return $this->requestAsync($method, $uri, $options)->wait(); + } + + /** + * Get a client configuration option. + * + * These options include default request options of the client, a "handler" + * (if utilized by the concrete client), and a "base_uri" if utilized by + * the concrete client. + * + * @param string|null $option The config option to retrieve. + * + * @return mixed + * + * @deprecated Client::getConfig will be removed in guzzlehttp/guzzle:8.0. + */ + public function getConfig(?string $option = null) + { + return $option === null + ? $this->config + : ($this->config[$option] ?? null); + } + + private function buildUri(UriInterface $uri, array $config): UriInterface + { + if (isset($config['base_uri'])) { + $uri = Psr7\UriResolver::resolve(Psr7\Utils::uriFor($config['base_uri']), $uri); + } + + if (isset($config['idn_conversion']) && ($config['idn_conversion'] !== false)) { + $idnOptions = ($config['idn_conversion'] === true) ? \IDNA_DEFAULT : $config['idn_conversion']; + $uri = Utils::idnUriConvert($uri, $idnOptions); + } + + return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri; + } + + /** + * Configures the default options for a client. + */ + private function configureDefaults(array $config): void + { + $defaults = [ + 'allow_redirects' => RedirectMiddleware::$defaultSettings, + 'http_errors' => true, + 'decode_content' => true, + 'verify' => true, + 'cookies' => false, + 'idn_conversion' => false, + ]; + + // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set. + + // We can only trust the HTTP_PROXY environment variable in a CLI + // process due to the fact that PHP has no reliable mechanism to + // get environment variables that start with "HTTP_". + if (\PHP_SAPI === 'cli' && ($proxy = Utils::getenv('HTTP_PROXY'))) { + $defaults['proxy']['http'] = $proxy; + } + + if ($proxy = Utils::getenv('HTTPS_PROXY')) { + $defaults['proxy']['https'] = $proxy; + } + + if ($noProxy = Utils::getenv('NO_PROXY')) { + $cleanedNoProxy = \str_replace(' ', '', $noProxy); + $defaults['proxy']['no'] = \explode(',', $cleanedNoProxy); + } + + $this->config = $config + $defaults; + + if (!empty($config['cookies']) && $config['cookies'] === true) { + $this->config['cookies'] = new CookieJar(); + } + + // Add the default user-agent header. + if (!isset($this->config['headers'])) { + $this->config['headers'] = ['User-Agent' => Utils::defaultUserAgent()]; + } else { + // Add the User-Agent header if one was not already set. + foreach (\array_keys($this->config['headers']) as $name) { + if (\strtolower($name) === 'user-agent') { + return; + } + } + $this->config['headers']['User-Agent'] = Utils::defaultUserAgent(); + } + } + + /** + * Merges default options into the array. + * + * @param array $options Options to modify by reference + */ + private function prepareDefaults(array $options): array + { + $defaults = $this->config; + + if (!empty($defaults['headers'])) { + // Default headers are only added if they are not present. + $defaults['_conditional'] = $defaults['headers']; + unset($defaults['headers']); + } + + // Special handling for headers is required as they are added as + // conditional headers and as headers passed to a request ctor. + if (\array_key_exists('headers', $options)) { + // Allows default headers to be unset. + if ($options['headers'] === null) { + $defaults['_conditional'] = []; + unset($options['headers']); + } elseif (!\is_array($options['headers'])) { + throw new InvalidArgumentException('headers must be an array'); + } + } + + // Shallow merge defaults underneath options. + $result = $options + $defaults; + + // Remove null values. + foreach ($result as $k => $v) { + if ($v === null) { + unset($result[$k]); + } + } + + return $result; + } + + /** + * Transfers the given request and applies request options. + * + * The URI of the request is not modified and the request options are used + * as-is without merging in default options. + * + * @param array $options See \GuzzleHttp\RequestOptions. + */ + private function transfer(RequestInterface $request, array $options): PromiseInterface + { + $request = $this->applyOptions($request, $options); + /** @var HandlerStack $handler */ + $handler = $options['handler']; + + try { + return P\Create::promiseFor($handler($request, $options)); + } catch (\Exception $e) { + return P\Create::rejectionFor($e); + } + } + + /** + * Applies the array of request options to a request. + */ + private function applyOptions(RequestInterface $request, array &$options): RequestInterface + { + $modify = [ + 'set_headers' => [], + ]; + + if (isset($options['headers'])) { + if (array_keys($options['headers']) === range(0, count($options['headers']) - 1)) { + throw new InvalidArgumentException('The headers array must have header name as keys.'); + } + $modify['set_headers'] = $options['headers']; + unset($options['headers']); + } + + if (isset($options['form_params'])) { + if (isset($options['multipart'])) { + throw new InvalidArgumentException('You cannot use ' + . 'form_params and multipart at the same time. Use the ' + . 'form_params option if you want to send application/' + . 'x-www-form-urlencoded requests, and the multipart ' + . 'option to send multipart/form-data requests.'); + } + $options['body'] = \http_build_query($options['form_params'], '', '&'); + unset($options['form_params']); + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded'; + } + + if (isset($options['multipart'])) { + $options['body'] = new Psr7\MultipartStream($options['multipart']); + unset($options['multipart']); + } + + if (isset($options['json'])) { + $options['body'] = Utils::jsonEncode($options['json']); + unset($options['json']); + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'application/json'; + } + + if (!empty($options['decode_content']) + && $options['decode_content'] !== true + ) { + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\Utils::caselessRemove(['Accept-Encoding'], $options['_conditional']); + $modify['set_headers']['Accept-Encoding'] = $options['decode_content']; + } + + if (isset($options['body'])) { + if (\is_array($options['body'])) { + throw $this->invalidBody(); + } + $modify['body'] = Psr7\Utils::streamFor($options['body']); + unset($options['body']); + } + + if (!empty($options['auth']) && \is_array($options['auth'])) { + $value = $options['auth']; + $type = isset($value[2]) ? \strtolower($value[2]) : 'basic'; + switch ($type) { + case 'basic': + // Ensure that we don't have the header in different case and set the new value. + $modify['set_headers'] = Psr7\Utils::caselessRemove(['Authorization'], $modify['set_headers']); + $modify['set_headers']['Authorization'] = 'Basic ' + . \base64_encode("$value[0]:$value[1]"); + break; + case 'digest': + // @todo: Do not rely on curl + $options['curl'][\CURLOPT_HTTPAUTH] = \CURLAUTH_DIGEST; + $options['curl'][\CURLOPT_USERPWD] = "$value[0]:$value[1]"; + break; + case 'ntlm': + $options['curl'][\CURLOPT_HTTPAUTH] = \CURLAUTH_NTLM; + $options['curl'][\CURLOPT_USERPWD] = "$value[0]:$value[1]"; + break; + } + } + + if (isset($options['query'])) { + $value = $options['query']; + if (\is_array($value)) { + $value = \http_build_query($value, '', '&', \PHP_QUERY_RFC3986); + } + if (!\is_string($value)) { + throw new InvalidArgumentException('query must be a string or array'); + } + $modify['query'] = $value; + unset($options['query']); + } + + // Ensure that sink is not an invalid value. + if (isset($options['sink'])) { + // TODO: Add more sink validation? + if (\is_bool($options['sink'])) { + throw new InvalidArgumentException('sink must not be a boolean'); + } + } + + $request = Psr7\Utils::modifyRequest($request, $modify); + if ($request->getBody() instanceof Psr7\MultipartStream) { + // Use a multipart/form-data POST if a Content-Type is not set. + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'multipart/form-data; boundary=' + . $request->getBody()->getBoundary(); + } + + // Merge in conditional headers if they are not present. + if (isset($options['_conditional'])) { + // Build up the changes so it's in a single clone of the message. + $modify = []; + foreach ($options['_conditional'] as $k => $v) { + if (!$request->hasHeader($k)) { + $modify['set_headers'][$k] = $v; + } + } + $request = Psr7\Utils::modifyRequest($request, $modify); + // Don't pass this internal value along to middleware/handlers. + unset($options['_conditional']); + } + + return $request; + } + + /** + * Return an InvalidArgumentException with pre-set message. + */ + private function invalidBody(): InvalidArgumentException + { + return new InvalidArgumentException('Passing in the "body" request ' + . 'option as an array to send a request is not supported. ' + . 'Please use the "form_params" request option to send a ' + . 'application/x-www-form-urlencoded request, or the "multipart" ' + . 'request option to send a multipart/form-data request.'); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/vendor/guzzlehttp/guzzle/src/ClientInterface.php new file mode 100644 index 00000000..6aaee61a --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/ClientInterface.php @@ -0,0 +1,84 @@ +request('GET', $uri, $options); + } + + /** + * Create and send an HTTP HEAD request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + * + * @throws GuzzleException + */ + public function head($uri, array $options = []): ResponseInterface + { + return $this->request('HEAD', $uri, $options); + } + + /** + * Create and send an HTTP PUT request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + * + * @throws GuzzleException + */ + public function put($uri, array $options = []): ResponseInterface + { + return $this->request('PUT', $uri, $options); + } + + /** + * Create and send an HTTP POST request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + * + * @throws GuzzleException + */ + public function post($uri, array $options = []): ResponseInterface + { + return $this->request('POST', $uri, $options); + } + + /** + * Create and send an HTTP PATCH request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + * + * @throws GuzzleException + */ + public function patch($uri, array $options = []): ResponseInterface + { + return $this->request('PATCH', $uri, $options); + } + + /** + * Create and send an HTTP DELETE request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + * + * @throws GuzzleException + */ + public function delete($uri, array $options = []): ResponseInterface + { + return $this->request('DELETE', $uri, $options); + } + + /** + * Create and send an asynchronous HTTP request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string $method HTTP method + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + abstract public function requestAsync(string $method, $uri, array $options = []): PromiseInterface; + + /** + * Create and send an asynchronous HTTP GET request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + public function getAsync($uri, array $options = []): PromiseInterface + { + return $this->requestAsync('GET', $uri, $options); + } + + /** + * Create and send an asynchronous HTTP HEAD request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + public function headAsync($uri, array $options = []): PromiseInterface + { + return $this->requestAsync('HEAD', $uri, $options); + } + + /** + * Create and send an asynchronous HTTP PUT request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + public function putAsync($uri, array $options = []): PromiseInterface + { + return $this->requestAsync('PUT', $uri, $options); + } + + /** + * Create and send an asynchronous HTTP POST request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + public function postAsync($uri, array $options = []): PromiseInterface + { + return $this->requestAsync('POST', $uri, $options); + } + + /** + * Create and send an asynchronous HTTP PATCH request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + public function patchAsync($uri, array $options = []): PromiseInterface + { + return $this->requestAsync('PATCH', $uri, $options); + } + + /** + * Create and send an asynchronous HTTP DELETE request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. + */ + public function deleteAsync($uri, array $options = []): PromiseInterface + { + return $this->requestAsync('DELETE', $uri, $options); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php new file mode 100644 index 00000000..d6757c65 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php @@ -0,0 +1,313 @@ +strictMode = $strictMode; + + foreach ($cookieArray as $cookie) { + if (!($cookie instanceof SetCookie)) { + $cookie = new SetCookie($cookie); + } + $this->setCookie($cookie); + } + } + + /** + * Create a new Cookie jar from an associative array and domain. + * + * @param array $cookies Cookies to create the jar from + * @param string $domain Domain to set the cookies to + */ + public static function fromArray(array $cookies, string $domain): self + { + $cookieJar = new self(); + foreach ($cookies as $name => $value) { + $cookieJar->setCookie(new SetCookie([ + 'Domain' => $domain, + 'Name' => $name, + 'Value' => $value, + 'Discard' => true + ])); + } + + return $cookieJar; + } + + /** + * Evaluate if this cookie should be persisted to storage + * that survives between requests. + * + * @param SetCookie $cookie Being evaluated. + * @param bool $allowSessionCookies If we should persist session cookies + */ + public static function shouldPersist(SetCookie $cookie, bool $allowSessionCookies = false): bool + { + if ($cookie->getExpires() || $allowSessionCookies) { + if (!$cookie->getDiscard()) { + return true; + } + } + + return false; + } + + /** + * Finds and returns the cookie based on the name + * + * @param string $name cookie name to search for + * + * @return SetCookie|null cookie that was found or null if not found + */ + public function getCookieByName(string $name): ?SetCookie + { + foreach ($this->cookies as $cookie) { + if ($cookie->getName() !== null && \strcasecmp($cookie->getName(), $name) === 0) { + return $cookie; + } + } + + return null; + } + + /** + * @inheritDoc + */ + public function toArray(): array + { + return \array_map(static function (SetCookie $cookie): array { + return $cookie->toArray(); + }, $this->getIterator()->getArrayCopy()); + } + + /** + * @inheritDoc + */ + public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void + { + if (!$domain) { + $this->cookies = []; + return; + } elseif (!$path) { + $this->cookies = \array_filter( + $this->cookies, + static function (SetCookie $cookie) use ($domain): bool { + return !$cookie->matchesDomain($domain); + } + ); + } elseif (!$name) { + $this->cookies = \array_filter( + $this->cookies, + static function (SetCookie $cookie) use ($path, $domain): bool { + return !($cookie->matchesPath($path) && + $cookie->matchesDomain($domain)); + } + ); + } else { + $this->cookies = \array_filter( + $this->cookies, + static function (SetCookie $cookie) use ($path, $domain, $name) { + return !($cookie->getName() == $name && + $cookie->matchesPath($path) && + $cookie->matchesDomain($domain)); + } + ); + } + } + + /** + * @inheritDoc + */ + public function clearSessionCookies(): void + { + $this->cookies = \array_filter( + $this->cookies, + static function (SetCookie $cookie): bool { + return !$cookie->getDiscard() && $cookie->getExpires(); + } + ); + } + + /** + * @inheritDoc + */ + public function setCookie(SetCookie $cookie): bool + { + // If the name string is empty (but not 0), ignore the set-cookie + // string entirely. + $name = $cookie->getName(); + if (!$name && $name !== '0') { + return false; + } + + // Only allow cookies with set and valid domain, name, value + $result = $cookie->validate(); + if ($result !== true) { + if ($this->strictMode) { + throw new \RuntimeException('Invalid cookie: ' . $result); + } + $this->removeCookieIfEmpty($cookie); + return false; + } + + // Resolve conflicts with previously set cookies + foreach ($this->cookies as $i => $c) { + + // Two cookies are identical, when their path, and domain are + // identical. + if ($c->getPath() != $cookie->getPath() || + $c->getDomain() != $cookie->getDomain() || + $c->getName() != $cookie->getName() + ) { + continue; + } + + // The previously set cookie is a discard cookie and this one is + // not so allow the new cookie to be set + if (!$cookie->getDiscard() && $c->getDiscard()) { + unset($this->cookies[$i]); + continue; + } + + // If the new cookie's expiration is further into the future, then + // replace the old cookie + if ($cookie->getExpires() > $c->getExpires()) { + unset($this->cookies[$i]); + continue; + } + + // If the value has changed, we better change it + if ($cookie->getValue() !== $c->getValue()) { + unset($this->cookies[$i]); + continue; + } + + // The cookie exists, so no need to continue + return false; + } + + $this->cookies[] = $cookie; + + return true; + } + + public function count(): int + { + return \count($this->cookies); + } + + /** + * @return \ArrayIterator + */ + public function getIterator(): \ArrayIterator + { + return new \ArrayIterator(\array_values($this->cookies)); + } + + public function extractCookies(RequestInterface $request, ResponseInterface $response): void + { + if ($cookieHeader = $response->getHeader('Set-Cookie')) { + foreach ($cookieHeader as $cookie) { + $sc = SetCookie::fromString($cookie); + if (!$sc->getDomain()) { + $sc->setDomain($request->getUri()->getHost()); + } + if (0 !== \strpos($sc->getPath(), '/')) { + $sc->setPath($this->getCookiePathFromRequest($request)); + } + $this->setCookie($sc); + } + } + } + + /** + * Computes cookie path following RFC 6265 section 5.1.4 + * + * @link https://tools.ietf.org/html/rfc6265#section-5.1.4 + */ + private function getCookiePathFromRequest(RequestInterface $request): string + { + $uriPath = $request->getUri()->getPath(); + if ('' === $uriPath) { + return '/'; + } + if (0 !== \strpos($uriPath, '/')) { + return '/'; + } + if ('/' === $uriPath) { + return '/'; + } + $lastSlashPos = \strrpos($uriPath, '/'); + if (0 === $lastSlashPos || false === $lastSlashPos) { + return '/'; + } + + return \substr($uriPath, 0, $lastSlashPos); + } + + public function withCookieHeader(RequestInterface $request): RequestInterface + { + $values = []; + $uri = $request->getUri(); + $scheme = $uri->getScheme(); + $host = $uri->getHost(); + $path = $uri->getPath() ?: '/'; + + foreach ($this->cookies as $cookie) { + if ($cookie->matchesPath($path) && + $cookie->matchesDomain($host) && + !$cookie->isExpired() && + (!$cookie->getSecure() || $scheme === 'https') + ) { + $values[] = $cookie->getName() . '=' + . $cookie->getValue(); + } + } + + return $values + ? $request->withHeader('Cookie', \implode('; ', $values)) + : $request; + } + + /** + * If a cookie already exists and the server asks to set it again with a + * null value, the cookie must be deleted. + */ + private function removeCookieIfEmpty(SetCookie $cookie): void + { + $cookieValue = $cookie->getValue(); + if ($cookieValue === null || $cookieValue === '') { + $this->clear( + $cookie->getDomain(), + $cookie->getPath(), + $cookie->getName() + ); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php new file mode 100644 index 00000000..7df374b5 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php @@ -0,0 +1,79 @@ + + */ +interface CookieJarInterface extends \Countable, \IteratorAggregate +{ + /** + * Create a request with added cookie headers. + * + * If no matching cookies are found in the cookie jar, then no Cookie + * header is added to the request and the same request is returned. + * + * @param RequestInterface $request Request object to modify. + * + * @return RequestInterface returns the modified request. + */ + public function withCookieHeader(RequestInterface $request): RequestInterface; + + /** + * Extract cookies from an HTTP response and store them in the CookieJar. + * + * @param RequestInterface $request Request that was sent + * @param ResponseInterface $response Response that was received + */ + public function extractCookies(RequestInterface $request, ResponseInterface $response): void; + + /** + * Sets a cookie in the cookie jar. + * + * @param SetCookie $cookie Cookie to set. + * + * @return bool Returns true on success or false on failure + */ + public function setCookie(SetCookie $cookie): bool; + + /** + * Remove cookies currently held in the cookie jar. + * + * Invoking this method without arguments will empty the whole cookie jar. + * If given a $domain argument only cookies belonging to that domain will + * be removed. If given a $domain and $path argument, cookies belonging to + * the specified path within that domain are removed. If given all three + * arguments, then the cookie with the specified name, path and domain is + * removed. + * + * @param string|null $domain Clears cookies matching a domain + * @param string|null $path Clears cookies matching a domain and path + * @param string|null $name Clears cookies matching a domain, path, and name + */ + public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void; + + /** + * Discard all sessions cookies. + * + * Removes cookies that don't have an expire field or a have a discard + * field set to true. To be called when the user agent shuts down according + * to RFC 2965. + */ + public function clearSessionCookies(): void; + + /** + * Converts the cookie jar to an array. + */ + public function toArray(): array; +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php b/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php new file mode 100644 index 00000000..290236d5 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php @@ -0,0 +1,101 @@ +filename = $cookieFile; + $this->storeSessionCookies = $storeSessionCookies; + + if (\file_exists($cookieFile)) { + $this->load($cookieFile); + } + } + + /** + * Saves the file when shutting down + */ + public function __destruct() + { + $this->save($this->filename); + } + + /** + * Saves the cookies to a file. + * + * @param string $filename File to save + * + * @throws \RuntimeException if the file cannot be found or created + */ + public function save(string $filename): void + { + $json = []; + /** @var SetCookie $cookie */ + foreach ($this as $cookie) { + if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { + $json[] = $cookie->toArray(); + } + } + + $jsonStr = Utils::jsonEncode($json); + if (false === \file_put_contents($filename, $jsonStr, \LOCK_EX)) { + throw new \RuntimeException("Unable to save file {$filename}"); + } + } + + /** + * Load cookies from a JSON formatted file. + * + * Old cookies are kept unless overwritten by newly loaded ones. + * + * @param string $filename Cookie file to load. + * + * @throws \RuntimeException if the file cannot be loaded. + */ + public function load(string $filename): void + { + $json = \file_get_contents($filename); + if (false === $json) { + throw new \RuntimeException("Unable to load file {$filename}"); + } + if ($json === '') { + return; + } + + $data = Utils::jsonDecode($json, true); + if (\is_array($data)) { + foreach ($data as $cookie) { + $this->setCookie(new SetCookie($cookie)); + } + } elseif (\is_scalar($data) && !empty($data)) { + throw new \RuntimeException("Invalid cookie file: {$filename}"); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php b/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php new file mode 100644 index 00000000..5d51ca98 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php @@ -0,0 +1,77 @@ +sessionKey = $sessionKey; + $this->storeSessionCookies = $storeSessionCookies; + $this->load(); + } + + /** + * Saves cookies to session when shutting down + */ + public function __destruct() + { + $this->save(); + } + + /** + * Save cookies to the client session + */ + public function save(): void + { + $json = []; + /** @var SetCookie $cookie */ + foreach ($this as $cookie) { + if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { + $json[] = $cookie->toArray(); + } + } + + $_SESSION[$this->sessionKey] = \json_encode($json); + } + + /** + * Load the contents of the client session into the data array + */ + protected function load(): void + { + if (!isset($_SESSION[$this->sessionKey])) { + return; + } + $data = \json_decode($_SESSION[$this->sessionKey], true); + if (\is_array($data)) { + foreach ($data as $cookie) { + $this->setCookie(new SetCookie($cookie)); + } + } elseif (\strlen($data)) { + throw new \RuntimeException("Invalid cookie data"); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php b/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php new file mode 100644 index 00000000..7c04034d --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php @@ -0,0 +1,444 @@ + null, + 'Value' => null, + 'Domain' => null, + 'Path' => '/', + 'Max-Age' => null, + 'Expires' => null, + 'Secure' => false, + 'Discard' => false, + 'HttpOnly' => false + ]; + + /** + * @var array Cookie data + */ + private $data; + + /** + * Create a new SetCookie object from a string. + * + * @param string $cookie Set-Cookie header string + */ + public static function fromString(string $cookie): self + { + // Create the default return array + $data = self::$defaults; + // Explode the cookie string using a series of semicolons + $pieces = \array_filter(\array_map('trim', \explode(';', $cookie))); + // The name of the cookie (first kvp) must exist and include an equal sign. + if (!isset($pieces[0]) || \strpos($pieces[0], '=') === false) { + return new self($data); + } + + // Add the cookie pieces into the parsed data array + foreach ($pieces as $part) { + $cookieParts = \explode('=', $part, 2); + $key = \trim($cookieParts[0]); + $value = isset($cookieParts[1]) + ? \trim($cookieParts[1], " \n\r\t\0\x0B") + : true; + + // Only check for non-cookies when cookies have been found + if (!isset($data['Name'])) { + $data['Name'] = $key; + $data['Value'] = $value; + } else { + foreach (\array_keys(self::$defaults) as $search) { + if (!\strcasecmp($search, $key)) { + $data[$search] = $value; + continue 2; + } + } + $data[$key] = $value; + } + } + + return new self($data); + } + + /** + * @param array $data Array of cookie data provided by a Cookie parser + */ + public function __construct(array $data = []) + { + /** @var array|null $replaced will be null in case of replace error */ + $replaced = \array_replace(self::$defaults, $data); + if ($replaced === null) { + throw new \InvalidArgumentException('Unable to replace the default values for the Cookie.'); + } + + $this->data = $replaced; + // Extract the Expires value and turn it into a UNIX timestamp if needed + if (!$this->getExpires() && $this->getMaxAge()) { + // Calculate the Expires date + $this->setExpires(\time() + $this->getMaxAge()); + } elseif (null !== ($expires = $this->getExpires()) && !\is_numeric($expires)) { + $this->setExpires($expires); + } + } + + public function __toString() + { + $str = $this->data['Name'] . '=' . ($this->data['Value'] ?? '') . '; '; + foreach ($this->data as $k => $v) { + if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) { + if ($k === 'Expires') { + $str .= 'Expires=' . \gmdate('D, d M Y H:i:s \G\M\T', $v) . '; '; + } else { + $str .= ($v === true ? $k : "{$k}={$v}") . '; '; + } + } + } + + return \rtrim($str, '; '); + } + + public function toArray(): array + { + return $this->data; + } + + /** + * Get the cookie name. + * + * @return string + */ + public function getName() + { + return $this->data['Name']; + } + + /** + * Set the cookie name. + * + * @param string $name Cookie name + */ + public function setName($name): void + { + if (!is_string($name)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Name'] = (string) $name; + } + + /** + * Get the cookie value. + * + * @return string|null + */ + public function getValue() + { + return $this->data['Value']; + } + + /** + * Set the cookie value. + * + * @param string $value Cookie value + */ + public function setValue($value): void + { + if (!is_string($value)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Value'] = (string) $value; + } + + /** + * Get the domain. + * + * @return string|null + */ + public function getDomain() + { + return $this->data['Domain']; + } + + /** + * Set the domain of the cookie. + * + * @param string|null $domain + */ + public function setDomain($domain): void + { + if (!is_string($domain) && null !== $domain) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Domain'] = null === $domain ? null : (string) $domain; + } + + /** + * Get the path. + * + * @return string + */ + public function getPath() + { + return $this->data['Path']; + } + + /** + * Set the path of the cookie. + * + * @param string $path Path of the cookie + */ + public function setPath($path): void + { + if (!is_string($path)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Path'] = (string) $path; + } + + /** + * Maximum lifetime of the cookie in seconds. + * + * @return int|null + */ + public function getMaxAge() + { + return null === $this->data['Max-Age'] ? null : (int) $this->data['Max-Age']; + } + + /** + * Set the max-age of the cookie. + * + * @param int|null $maxAge Max age of the cookie in seconds + */ + public function setMaxAge($maxAge): void + { + if (!is_int($maxAge) && null !== $maxAge) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Max-Age'] = $maxAge === null ? null : (int) $maxAge; + } + + /** + * The UNIX timestamp when the cookie Expires. + * + * @return string|int|null + */ + public function getExpires() + { + return $this->data['Expires']; + } + + /** + * Set the unix timestamp for which the cookie will expire. + * + * @param int|string|null $timestamp Unix timestamp or any English textual datetime description. + */ + public function setExpires($timestamp): void + { + if (!is_int($timestamp) && !is_string($timestamp) && null !== $timestamp) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int, string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Expires'] = null === $timestamp ? null : (\is_numeric($timestamp) ? (int) $timestamp : \strtotime((string) $timestamp)); + } + + /** + * Get whether or not this is a secure cookie. + * + * @return bool + */ + public function getSecure() + { + return $this->data['Secure']; + } + + /** + * Set whether or not the cookie is secure. + * + * @param bool $secure Set to true or false if secure + */ + public function setSecure($secure): void + { + if (!is_bool($secure)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Secure'] = (bool) $secure; + } + + /** + * Get whether or not this is a session cookie. + * + * @return bool|null + */ + public function getDiscard() + { + return $this->data['Discard']; + } + + /** + * Set whether or not this is a session cookie. + * + * @param bool $discard Set to true or false if this is a session cookie + */ + public function setDiscard($discard): void + { + if (!is_bool($discard)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['Discard'] = (bool) $discard; + } + + /** + * Get whether or not this is an HTTP only cookie. + * + * @return bool + */ + public function getHttpOnly() + { + return $this->data['HttpOnly']; + } + + /** + * Set whether or not this is an HTTP only cookie. + * + * @param bool $httpOnly Set to true or false if this is HTTP only + */ + public function setHttpOnly($httpOnly): void + { + if (!is_bool($httpOnly)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->data['HttpOnly'] = (bool) $httpOnly; + } + + /** + * Check if the cookie matches a path value. + * + * A request-path path-matches a given cookie-path if at least one of + * the following conditions holds: + * + * - The cookie-path and the request-path are identical. + * - The cookie-path is a prefix of the request-path, and the last + * character of the cookie-path is %x2F ("/"). + * - The cookie-path is a prefix of the request-path, and the first + * character of the request-path that is not included in the cookie- + * path is a %x2F ("/") character. + * + * @param string $requestPath Path to check against + */ + public function matchesPath(string $requestPath): bool + { + $cookiePath = $this->getPath(); + + // Match on exact matches or when path is the default empty "/" + if ($cookiePath === '/' || $cookiePath == $requestPath) { + return true; + } + + // Ensure that the cookie-path is a prefix of the request path. + if (0 !== \strpos($requestPath, $cookiePath)) { + return false; + } + + // Match if the last character of the cookie-path is "/" + if (\substr($cookiePath, -1, 1) === '/') { + return true; + } + + // Match if the first character not included in cookie path is "/" + return \substr($requestPath, \strlen($cookiePath), 1) === '/'; + } + + /** + * Check if the cookie matches a domain value. + * + * @param string $domain Domain to check against + */ + public function matchesDomain(string $domain): bool + { + $cookieDomain = $this->getDomain(); + if (null === $cookieDomain) { + return true; + } + + // Remove the leading '.' as per spec in RFC 6265. + // https://tools.ietf.org/html/rfc6265#section-5.2.3 + $cookieDomain = \ltrim($cookieDomain, '.'); + + // Domain not set or exact match. + if (!$cookieDomain || !\strcasecmp($domain, $cookieDomain)) { + return true; + } + + // Matching the subdomain according to RFC 6265. + // https://tools.ietf.org/html/rfc6265#section-5.1.3 + if (\filter_var($domain, \FILTER_VALIDATE_IP)) { + return false; + } + + return (bool) \preg_match('/\.' . \preg_quote($cookieDomain, '/') . '$/', $domain); + } + + /** + * Check if the cookie is expired. + */ + public function isExpired(): bool + { + return $this->getExpires() !== null && \time() > $this->getExpires(); + } + + /** + * Check if the cookie is valid according to RFC 6265. + * + * @return bool|string Returns true if valid or an error message if invalid + */ + public function validate() + { + $name = $this->getName(); + if ($name === '') { + return 'The cookie name must not be empty'; + } + + // Check if any of the invalid characters are present in the cookie name + if (\preg_match( + '/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/', + $name + )) { + return 'Cookie name must not contain invalid characters: ASCII ' + . 'Control characters (0-31;127), space, tab and the ' + . 'following characters: ()<>@,;:\"/?={}'; + } + + // Value must not be null. 0 and empty string are valid. Empty strings + // are technically against RFC 6265, but known to happen in the wild. + $value = $this->getValue(); + if ($value === null) { + return 'The cookie value must not be empty'; + } + + // Domains must not be empty, but can be 0. "0" is not a valid internet + // domain, but may be used as server name in a private network. + $domain = $this->getDomain(); + if ($domain === null || $domain === '') { + return 'The cookie domain must not be empty'; + } + + return true; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php b/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php new file mode 100644 index 00000000..a80956c9 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php @@ -0,0 +1,39 @@ +request = $request; + $this->handlerContext = $handlerContext; + } + + /** + * Get the request that caused the exception + */ + public function getRequest(): RequestInterface + { + return $this->request; + } + + /** + * Get contextual information about the error from the underlying handler. + * + * The contents of this array will vary depending on which handler you are + * using. It may also be just an empty array. Relying on this data will + * couple you to a specific handler, but can give more debug information + * when needed. + */ + public function getHandlerContext(): array + { + return $this->handlerContext; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php b/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php new file mode 100644 index 00000000..fa3ed699 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php @@ -0,0 +1,9 @@ +getStatusCode() : 0; + parent::__construct($message, $code, $previous); + $this->request = $request; + $this->response = $response; + $this->handlerContext = $handlerContext; + } + + /** + * Wrap non-RequestExceptions with a RequestException + */ + public static function wrapException(RequestInterface $request, \Throwable $e): RequestException + { + return $e instanceof RequestException ? $e : new RequestException($e->getMessage(), $request, null, $e); + } + + /** + * Factory method to create a new exception with a normalized error message + * + * @param RequestInterface $request Request sent + * @param ResponseInterface $response Response received + * @param \Throwable|null $previous Previous exception + * @param array $handlerContext Optional handler context + * @param BodySummarizerInterface|null $bodySummarizer Optional body summarizer + */ + public static function create( + RequestInterface $request, + ResponseInterface $response = null, + \Throwable $previous = null, + array $handlerContext = [], + BodySummarizerInterface $bodySummarizer = null + ): self { + if (!$response) { + return new self( + 'Error completing request', + $request, + null, + $previous, + $handlerContext + ); + } + + $level = (int) \floor($response->getStatusCode() / 100); + if ($level === 4) { + $label = 'Client error'; + $className = ClientException::class; + } elseif ($level === 5) { + $label = 'Server error'; + $className = ServerException::class; + } else { + $label = 'Unsuccessful request'; + $className = __CLASS__; + } + + $uri = $request->getUri(); + $uri = static::obfuscateUri($uri); + + // Client Error: `GET /` resulted in a `404 Not Found` response: + // ... (truncated) + $message = \sprintf( + '%s: `%s %s` resulted in a `%s %s` response', + $label, + $request->getMethod(), + $uri->__toString(), + $response->getStatusCode(), + $response->getReasonPhrase() + ); + + $summary = ($bodySummarizer ?? new BodySummarizer())->summarize($response); + + if ($summary !== null) { + $message .= ":\n{$summary}\n"; + } + + return new $className($message, $request, $response, $previous, $handlerContext); + } + + /** + * Obfuscates URI if there is a username and a password present + */ + private static function obfuscateUri(UriInterface $uri): UriInterface + { + $userInfo = $uri->getUserInfo(); + + if (false !== ($pos = \strpos($userInfo, ':'))) { + return $uri->withUserInfo(\substr($userInfo, 0, $pos), '***'); + } + + return $uri; + } + + /** + * Get the request that caused the exception + */ + public function getRequest(): RequestInterface + { + return $this->request; + } + + /** + * Get the associated response + */ + public function getResponse(): ?ResponseInterface + { + return $this->response; + } + + /** + * Check if a response was received + */ + public function hasResponse(): bool + { + return $this->response !== null; + } + + /** + * Get contextual information about the error from the underlying handler. + * + * The contents of this array will vary depending on which handler you are + * using. It may also be just an empty array. Relying on this data will + * couple you to a specific handler, but can give more debug information + * when needed. + */ + public function getHandlerContext(): array + { + return $this->handlerContext; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php b/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php new file mode 100644 index 00000000..8055e067 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php @@ -0,0 +1,10 @@ +maxHandles = $maxHandles; + } + + public function create(RequestInterface $request, array $options): EasyHandle + { + if (isset($options['curl']['body_as_string'])) { + $options['_body_as_string'] = $options['curl']['body_as_string']; + unset($options['curl']['body_as_string']); + } + + $easy = new EasyHandle; + $easy->request = $request; + $easy->options = $options; + $conf = $this->getDefaultConf($easy); + $this->applyMethod($easy, $conf); + $this->applyHandlerOptions($easy, $conf); + $this->applyHeaders($easy, $conf); + unset($conf['_headers']); + + // Add handler options from the request configuration options + if (isset($options['curl'])) { + $conf = \array_replace($conf, $options['curl']); + } + + $conf[\CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy); + $easy->handle = $this->handles ? \array_pop($this->handles) : \curl_init(); + curl_setopt_array($easy->handle, $conf); + + return $easy; + } + + public function release(EasyHandle $easy): void + { + $resource = $easy->handle; + unset($easy->handle); + + if (\count($this->handles) >= $this->maxHandles) { + \curl_close($resource); + } else { + // Remove all callback functions as they can hold onto references + // and are not cleaned up by curl_reset. Using curl_setopt_array + // does not work for some reason, so removing each one + // individually. + \curl_setopt($resource, \CURLOPT_HEADERFUNCTION, null); + \curl_setopt($resource, \CURLOPT_READFUNCTION, null); + \curl_setopt($resource, \CURLOPT_WRITEFUNCTION, null); + \curl_setopt($resource, \CURLOPT_PROGRESSFUNCTION, null); + \curl_reset($resource); + $this->handles[] = $resource; + } + } + + /** + * Completes a cURL transaction, either returning a response promise or a + * rejected promise. + * + * @param callable(RequestInterface, array): PromiseInterface $handler + * @param CurlFactoryInterface $factory Dictates how the handle is released + */ + public static function finish(callable $handler, EasyHandle $easy, CurlFactoryInterface $factory): PromiseInterface + { + if (isset($easy->options['on_stats'])) { + self::invokeStats($easy); + } + + if (!$easy->response || $easy->errno) { + return self::finishError($handler, $easy, $factory); + } + + // Return the response if it is present and there is no error. + $factory->release($easy); + + // Rewind the body of the response if possible. + $body = $easy->response->getBody(); + if ($body->isSeekable()) { + $body->rewind(); + } + + return new FulfilledPromise($easy->response); + } + + private static function invokeStats(EasyHandle $easy): void + { + $curlStats = \curl_getinfo($easy->handle); + $curlStats['appconnect_time'] = \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME); + $stats = new TransferStats( + $easy->request, + $easy->response, + $curlStats['total_time'], + $easy->errno, + $curlStats + ); + ($easy->options['on_stats'])($stats); + } + + /** + * @param callable(RequestInterface, array): PromiseInterface $handler + */ + private static function finishError(callable $handler, EasyHandle $easy, CurlFactoryInterface $factory): PromiseInterface + { + // Get error information and release the handle to the factory. + $ctx = [ + 'errno' => $easy->errno, + 'error' => \curl_error($easy->handle), + 'appconnect_time' => \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME), + ] + \curl_getinfo($easy->handle); + $ctx[self::CURL_VERSION_STR] = \curl_version()['version']; + $factory->release($easy); + + // Retry when nothing is present or when curl failed to rewind. + if (empty($easy->options['_err_message']) && (!$easy->errno || $easy->errno == 65)) { + return self::retryFailedRewind($handler, $easy, $ctx); + } + + return self::createRejection($easy, $ctx); + } + + private static function createRejection(EasyHandle $easy, array $ctx): PromiseInterface + { + static $connectionErrors = [ + \CURLE_OPERATION_TIMEOUTED => true, + \CURLE_COULDNT_RESOLVE_HOST => true, + \CURLE_COULDNT_CONNECT => true, + \CURLE_SSL_CONNECT_ERROR => true, + \CURLE_GOT_NOTHING => true, + ]; + + if ($easy->createResponseException) { + return P\Create::rejectionFor( + new RequestException( + 'An error was encountered while creating the response', + $easy->request, + $easy->response, + $easy->createResponseException, + $ctx + ) + ); + } + + // If an exception was encountered during the onHeaders event, then + // return a rejected promise that wraps that exception. + if ($easy->onHeadersException) { + return P\Create::rejectionFor( + new RequestException( + 'An error was encountered during the on_headers event', + $easy->request, + $easy->response, + $easy->onHeadersException, + $ctx + ) + ); + } + + $message = \sprintf( + 'cURL error %s: %s (%s)', + $ctx['errno'], + $ctx['error'], + 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html' + ); + $uriString = (string) $easy->request->getUri(); + if ($uriString !== '' && false === \strpos($ctx['error'], $uriString)) { + $message .= \sprintf(' for %s', $uriString); + } + + // Create a connection exception if it was a specific error code. + $error = isset($connectionErrors[$easy->errno]) + ? new ConnectException($message, $easy->request, null, $ctx) + : new RequestException($message, $easy->request, $easy->response, null, $ctx); + + return P\Create::rejectionFor($error); + } + + /** + * @return array + */ + private function getDefaultConf(EasyHandle $easy): array + { + $conf = [ + '_headers' => $easy->request->getHeaders(), + \CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(), + \CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''), + \CURLOPT_RETURNTRANSFER => false, + \CURLOPT_HEADER => false, + \CURLOPT_CONNECTTIMEOUT => 150, + ]; + + if (\defined('CURLOPT_PROTOCOLS')) { + $conf[\CURLOPT_PROTOCOLS] = \CURLPROTO_HTTP | \CURLPROTO_HTTPS; + } + + $version = $easy->request->getProtocolVersion(); + if ($version == 1.1) { + $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_1; + } elseif ($version == 2.0) { + $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_2_0; + } else { + $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_0; + } + + return $conf; + } + + private function applyMethod(EasyHandle $easy, array &$conf): void + { + $body = $easy->request->getBody(); + $size = $body->getSize(); + + if ($size === null || $size > 0) { + $this->applyBody($easy->request, $easy->options, $conf); + return; + } + + $method = $easy->request->getMethod(); + if ($method === 'PUT' || $method === 'POST') { + // See https://tools.ietf.org/html/rfc7230#section-3.3.2 + if (!$easy->request->hasHeader('Content-Length')) { + $conf[\CURLOPT_HTTPHEADER][] = 'Content-Length: 0'; + } + } elseif ($method === 'HEAD') { + $conf[\CURLOPT_NOBODY] = true; + unset( + $conf[\CURLOPT_WRITEFUNCTION], + $conf[\CURLOPT_READFUNCTION], + $conf[\CURLOPT_FILE], + $conf[\CURLOPT_INFILE] + ); + } + } + + private function applyBody(RequestInterface $request, array $options, array &$conf): void + { + $size = $request->hasHeader('Content-Length') + ? (int) $request->getHeaderLine('Content-Length') + : null; + + // Send the body as a string if the size is less than 1MB OR if the + // [curl][body_as_string] request value is set. + if (($size !== null && $size < 1000000) || !empty($options['_body_as_string'])) { + $conf[\CURLOPT_POSTFIELDS] = (string) $request->getBody(); + // Don't duplicate the Content-Length header + $this->removeHeader('Content-Length', $conf); + $this->removeHeader('Transfer-Encoding', $conf); + } else { + $conf[\CURLOPT_UPLOAD] = true; + if ($size !== null) { + $conf[\CURLOPT_INFILESIZE] = $size; + $this->removeHeader('Content-Length', $conf); + } + $body = $request->getBody(); + if ($body->isSeekable()) { + $body->rewind(); + } + $conf[\CURLOPT_READFUNCTION] = static function ($ch, $fd, $length) use ($body) { + return $body->read($length); + }; + } + + // If the Expect header is not present, prevent curl from adding it + if (!$request->hasHeader('Expect')) { + $conf[\CURLOPT_HTTPHEADER][] = 'Expect:'; + } + + // cURL sometimes adds a content-type by default. Prevent this. + if (!$request->hasHeader('Content-Type')) { + $conf[\CURLOPT_HTTPHEADER][] = 'Content-Type:'; + } + } + + private function applyHeaders(EasyHandle $easy, array &$conf): void + { + foreach ($conf['_headers'] as $name => $values) { + foreach ($values as $value) { + $value = (string) $value; + if ($value === '') { + // cURL requires a special format for empty headers. + // See https://github.com/guzzle/guzzle/issues/1882 for more details. + $conf[\CURLOPT_HTTPHEADER][] = "$name;"; + } else { + $conf[\CURLOPT_HTTPHEADER][] = "$name: $value"; + } + } + } + + // Remove the Accept header if one was not set + if (!$easy->request->hasHeader('Accept')) { + $conf[\CURLOPT_HTTPHEADER][] = 'Accept:'; + } + } + + /** + * Remove a header from the options array. + * + * @param string $name Case-insensitive header to remove + * @param array $options Array of options to modify + */ + private function removeHeader(string $name, array &$options): void + { + foreach (\array_keys($options['_headers']) as $key) { + if (!\strcasecmp($key, $name)) { + unset($options['_headers'][$key]); + return; + } + } + } + + private function applyHandlerOptions(EasyHandle $easy, array &$conf): void + { + $options = $easy->options; + if (isset($options['verify'])) { + if ($options['verify'] === false) { + unset($conf[\CURLOPT_CAINFO]); + $conf[\CURLOPT_SSL_VERIFYHOST] = 0; + $conf[\CURLOPT_SSL_VERIFYPEER] = false; + } else { + $conf[\CURLOPT_SSL_VERIFYHOST] = 2; + $conf[\CURLOPT_SSL_VERIFYPEER] = true; + if (\is_string($options['verify'])) { + // Throw an error if the file/folder/link path is not valid or doesn't exist. + if (!\file_exists($options['verify'])) { + throw new \InvalidArgumentException("SSL CA bundle not found: {$options['verify']}"); + } + // If it's a directory or a link to a directory use CURLOPT_CAPATH. + // If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO. + if ( + \is_dir($options['verify']) || + ( + \is_link($options['verify']) === true && + ($verifyLink = \readlink($options['verify'])) !== false && + \is_dir($verifyLink) + ) + ) { + $conf[\CURLOPT_CAPATH] = $options['verify']; + } else { + $conf[\CURLOPT_CAINFO] = $options['verify']; + } + } + } + } + + if (!isset($options['curl'][\CURLOPT_ENCODING]) && !empty($options['decode_content'])) { + $accept = $easy->request->getHeaderLine('Accept-Encoding'); + if ($accept) { + $conf[\CURLOPT_ENCODING] = $accept; + } else { + // The empty string enables all available decoders and implicitly + // sets a matching 'Accept-Encoding' header. + $conf[\CURLOPT_ENCODING] = ''; + // But as the user did not specify any acceptable encodings we need + // to overwrite this implicit header with an empty one. + $conf[\CURLOPT_HTTPHEADER][] = 'Accept-Encoding:'; + } + } + + if (!isset($options['sink'])) { + // Use a default temp stream if no sink was set. + $options['sink'] = \GuzzleHttp\Psr7\Utils::tryFopen('php://temp', 'w+'); + } + $sink = $options['sink']; + if (!\is_string($sink)) { + $sink = \GuzzleHttp\Psr7\Utils::streamFor($sink); + } elseif (!\is_dir(\dirname($sink))) { + // Ensure that the directory exists before failing in curl. + throw new \RuntimeException(\sprintf('Directory %s does not exist for sink value of %s', \dirname($sink), $sink)); + } else { + $sink = new LazyOpenStream($sink, 'w+'); + } + $easy->sink = $sink; + $conf[\CURLOPT_WRITEFUNCTION] = static function ($ch, $write) use ($sink): int { + return $sink->write($write); + }; + + $timeoutRequiresNoSignal = false; + if (isset($options['timeout'])) { + $timeoutRequiresNoSignal |= $options['timeout'] < 1; + $conf[\CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000; + } + + // CURL default value is CURL_IPRESOLVE_WHATEVER + if (isset($options['force_ip_resolve'])) { + if ('v4' === $options['force_ip_resolve']) { + $conf[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V4; + } elseif ('v6' === $options['force_ip_resolve']) { + $conf[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V6; + } + } + + if (isset($options['connect_timeout'])) { + $timeoutRequiresNoSignal |= $options['connect_timeout'] < 1; + $conf[\CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000; + } + + if ($timeoutRequiresNoSignal && \strtoupper(\substr(\PHP_OS, 0, 3)) !== 'WIN') { + $conf[\CURLOPT_NOSIGNAL] = true; + } + + if (isset($options['proxy'])) { + if (!\is_array($options['proxy'])) { + $conf[\CURLOPT_PROXY] = $options['proxy']; + } else { + $scheme = $easy->request->getUri()->getScheme(); + if (isset($options['proxy'][$scheme])) { + $host = $easy->request->getUri()->getHost(); + if (!isset($options['proxy']['no']) || !Utils::isHostInNoProxy($host, $options['proxy']['no'])) { + $conf[\CURLOPT_PROXY] = $options['proxy'][$scheme]; + } + } + } + } + + if (isset($options['cert'])) { + $cert = $options['cert']; + if (\is_array($cert)) { + $conf[\CURLOPT_SSLCERTPASSWD] = $cert[1]; + $cert = $cert[0]; + } + if (!\file_exists($cert)) { + throw new \InvalidArgumentException("SSL certificate not found: {$cert}"); + } + # OpenSSL (versions 0.9.3 and later) also support "P12" for PKCS#12-encoded files. + # see https://curl.se/libcurl/c/CURLOPT_SSLCERTTYPE.html + $ext = pathinfo($cert, \PATHINFO_EXTENSION); + if (preg_match('#^(der|p12)$#i', $ext)) { + $conf[\CURLOPT_SSLCERTTYPE] = strtoupper($ext); + } + $conf[\CURLOPT_SSLCERT] = $cert; + } + + if (isset($options['ssl_key'])) { + if (\is_array($options['ssl_key'])) { + if (\count($options['ssl_key']) === 2) { + [$sslKey, $conf[\CURLOPT_SSLKEYPASSWD]] = $options['ssl_key']; + } else { + [$sslKey] = $options['ssl_key']; + } + } + + $sslKey = $sslKey ?? $options['ssl_key']; + + if (!\file_exists($sslKey)) { + throw new \InvalidArgumentException("SSL private key not found: {$sslKey}"); + } + $conf[\CURLOPT_SSLKEY] = $sslKey; + } + + if (isset($options['progress'])) { + $progress = $options['progress']; + if (!\is_callable($progress)) { + throw new \InvalidArgumentException('progress client option must be callable'); + } + $conf[\CURLOPT_NOPROGRESS] = false; + $conf[\CURLOPT_PROGRESSFUNCTION] = static function ($resource, int $downloadSize, int $downloaded, int $uploadSize, int $uploaded) use ($progress) { + $progress($downloadSize, $downloaded, $uploadSize, $uploaded); + }; + } + + if (!empty($options['debug'])) { + $conf[\CURLOPT_STDERR] = Utils::debugResource($options['debug']); + $conf[\CURLOPT_VERBOSE] = true; + } + } + + /** + * This function ensures that a response was set on a transaction. If one + * was not set, then the request is retried if possible. This error + * typically means you are sending a payload, curl encountered a + * "Connection died, retrying a fresh connect" error, tried to rewind the + * stream, and then encountered a "necessary data rewind wasn't possible" + * error, causing the request to be sent through curl_multi_info_read() + * without an error status. + * + * @param callable(RequestInterface, array): PromiseInterface $handler + */ + private static function retryFailedRewind(callable $handler, EasyHandle $easy, array $ctx): PromiseInterface + { + try { + // Only rewind if the body has been read from. + $body = $easy->request->getBody(); + if ($body->tell() > 0) { + $body->rewind(); + } + } catch (\RuntimeException $e) { + $ctx['error'] = 'The connection unexpectedly failed without ' + . 'providing an error. The request would have been retried, ' + . 'but attempting to rewind the request body failed. ' + . 'Exception: ' . $e; + return self::createRejection($easy, $ctx); + } + + // Retry no more than 3 times before giving up. + if (!isset($easy->options['_curl_retries'])) { + $easy->options['_curl_retries'] = 1; + } elseif ($easy->options['_curl_retries'] == 2) { + $ctx['error'] = 'The cURL request was retried 3 times ' + . 'and did not succeed. The most likely reason for the failure ' + . 'is that cURL was unable to rewind the body of the request ' + . 'and subsequent retries resulted in the same error. Turn on ' + . 'the debug option to see what went wrong. See ' + . 'https://bugs.php.net/bug.php?id=47204 for more information.'; + return self::createRejection($easy, $ctx); + } else { + $easy->options['_curl_retries']++; + } + + return $handler($easy->request, $easy->options); + } + + private function createHeaderFn(EasyHandle $easy): callable + { + if (isset($easy->options['on_headers'])) { + $onHeaders = $easy->options['on_headers']; + + if (!\is_callable($onHeaders)) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + } else { + $onHeaders = null; + } + + return static function ($ch, $h) use ( + $onHeaders, + $easy, + &$startingResponse + ) { + $value = \trim($h); + if ($value === '') { + $startingResponse = true; + try { + $easy->createResponse(); + } catch (\Exception $e) { + $easy->createResponseException = $e; + return -1; + } + if ($onHeaders !== null) { + try { + $onHeaders($easy->response); + } catch (\Exception $e) { + // Associate the exception with the handle and trigger + // a curl header write error by returning 0. + $easy->onHeadersException = $e; + return -1; + } + } + } elseif ($startingResponse) { + $startingResponse = false; + $easy->headers = [$value]; + } else { + $easy->headers[] = $value; + } + return \strlen($h); + }; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php new file mode 100644 index 00000000..fe57ed5d --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php @@ -0,0 +1,25 @@ +factory = $options['handle_factory'] + ?? new CurlFactory(3); + } + + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + if (isset($options['delay'])) { + \usleep($options['delay'] * 1000); + } + + $easy = $this->factory->create($request, $options); + \curl_exec($easy->handle); + $easy->errno = \curl_errno($easy->handle); + + return CurlFactory::finish($this, $easy, $this->factory); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php new file mode 100644 index 00000000..9e2e4703 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php @@ -0,0 +1,261 @@ + An array of delay times, indexed by handle id in `addRequest`. + * + * @see CurlMultiHandler::addRequest + */ + private $delays = []; + + /** + * @var array An associative array of CURLMOPT_* options and corresponding values for curl_multi_setopt() + */ + private $options = []; + + /** + * This handler accepts the following options: + * + * - handle_factory: An optional factory used to create curl handles + * - select_timeout: Optional timeout (in seconds) to block before timing + * out while selecting curl handles. Defaults to 1 second. + * - options: An associative array of CURLMOPT_* options and + * corresponding values for curl_multi_setopt() + */ + public function __construct(array $options = []) + { + $this->factory = $options['handle_factory'] ?? new CurlFactory(50); + + if (isset($options['select_timeout'])) { + $this->selectTimeout = $options['select_timeout']; + } elseif ($selectTimeout = Utils::getenv('GUZZLE_CURL_SELECT_TIMEOUT')) { + @trigger_error('Since guzzlehttp/guzzle 7.2.0: Using environment variable GUZZLE_CURL_SELECT_TIMEOUT is deprecated. Use option "select_timeout" instead.', \E_USER_DEPRECATED); + $this->selectTimeout = (int) $selectTimeout; + } else { + $this->selectTimeout = 1; + } + + $this->options = $options['options'] ?? []; + } + + /** + * @param string $name + * + * @return resource|\CurlMultiHandle + * + * @throws \BadMethodCallException when another field as `_mh` will be gotten + * @throws \RuntimeException when curl can not initialize a multi handle + */ + public function __get($name) + { + if ($name !== '_mh') { + throw new \BadMethodCallException("Can not get other property as '_mh'."); + } + + $multiHandle = \curl_multi_init(); + + if (false === $multiHandle) { + throw new \RuntimeException('Can not initialize curl multi handle.'); + } + + $this->_mh = $multiHandle; + + foreach ($this->options as $option => $value) { + // A warning is raised in case of a wrong option. + curl_multi_setopt($this->_mh, $option, $value); + } + + return $this->_mh; + } + + public function __destruct() + { + if (isset($this->_mh)) { + \curl_multi_close($this->_mh); + unset($this->_mh); + } + } + + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + $easy = $this->factory->create($request, $options); + $id = (int) $easy->handle; + + $promise = new Promise( + [$this, 'execute'], + function () use ($id) { + return $this->cancel($id); + } + ); + + $this->addRequest(['easy' => $easy, 'deferred' => $promise]); + + return $promise; + } + + /** + * Ticks the curl event loop. + */ + public function tick(): void + { + // Add any delayed handles if needed. + if ($this->delays) { + $currentTime = Utils::currentTime(); + foreach ($this->delays as $id => $delay) { + if ($currentTime >= $delay) { + unset($this->delays[$id]); + \curl_multi_add_handle( + $this->_mh, + $this->handles[$id]['easy']->handle + ); + } + } + } + + // Step through the task queue which may add additional requests. + P\Utils::queue()->run(); + + if ($this->active && \curl_multi_select($this->_mh, $this->selectTimeout) === -1) { + // Perform a usleep if a select returns -1. + // See: https://bugs.php.net/bug.php?id=61141 + \usleep(250); + } + + while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM); + + $this->processMessages(); + } + + /** + * Runs until all outstanding connections have completed. + */ + public function execute(): void + { + $queue = P\Utils::queue(); + + while ($this->handles || !$queue->isEmpty()) { + // If there are no transfers, then sleep for the next delay + if (!$this->active && $this->delays) { + \usleep($this->timeToNext()); + } + $this->tick(); + } + } + + private function addRequest(array $entry): void + { + $easy = $entry['easy']; + $id = (int) $easy->handle; + $this->handles[$id] = $entry; + if (empty($easy->options['delay'])) { + \curl_multi_add_handle($this->_mh, $easy->handle); + } else { + $this->delays[$id] = Utils::currentTime() + ($easy->options['delay'] / 1000); + } + } + + /** + * Cancels a handle from sending and removes references to it. + * + * @param int $id Handle ID to cancel and remove. + * + * @return bool True on success, false on failure. + */ + private function cancel($id): bool + { + if (!is_int($id)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an integer to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + // Cannot cancel if it has been processed. + if (!isset($this->handles[$id])) { + return false; + } + + $handle = $this->handles[$id]['easy']->handle; + unset($this->delays[$id], $this->handles[$id]); + \curl_multi_remove_handle($this->_mh, $handle); + \curl_close($handle); + + return true; + } + + private function processMessages(): void + { + while ($done = \curl_multi_info_read($this->_mh)) { + if ($done['msg'] !== \CURLMSG_DONE) { + // if it's not done, then it would be premature to remove the handle. ref https://github.com/guzzle/guzzle/pull/2892#issuecomment-945150216 + continue; + } + $id = (int) $done['handle']; + \curl_multi_remove_handle($this->_mh, $done['handle']); + + if (!isset($this->handles[$id])) { + // Probably was cancelled. + continue; + } + + $entry = $this->handles[$id]; + unset($this->handles[$id], $this->delays[$id]); + $entry['easy']->errno = $done['result']; + $entry['deferred']->resolve( + CurlFactory::finish($this, $entry['easy'], $this->factory) + ); + } + } + + private function timeToNext(): int + { + $currentTime = Utils::currentTime(); + $nextTime = \PHP_INT_MAX; + foreach ($this->delays as $time) { + if ($time < $nextTime) { + $nextTime = $time; + } + } + + return ((int) \max(0, $nextTime - $currentTime)) * 1000000; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php b/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php new file mode 100644 index 00000000..224344d7 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php @@ -0,0 +1,112 @@ +headers); + + $normalizedKeys = Utils::normalizeHeaderKeys($headers); + + if (!empty($this->options['decode_content']) && isset($normalizedKeys['content-encoding'])) { + $headers['x-encoded-content-encoding'] = $headers[$normalizedKeys['content-encoding']]; + unset($headers[$normalizedKeys['content-encoding']]); + if (isset($normalizedKeys['content-length'])) { + $headers['x-encoded-content-length'] = $headers[$normalizedKeys['content-length']]; + + $bodyLength = (int) $this->sink->getSize(); + if ($bodyLength) { + $headers[$normalizedKeys['content-length']] = $bodyLength; + } else { + unset($headers[$normalizedKeys['content-length']]); + } + } + } + + // Attach a response to the easy handle with the parsed headers. + $this->response = new Response( + $status, + $headers, + $this->sink, + $ver, + $reason + ); + } + + /** + * @param string $name + * + * @return void + * + * @throws \BadMethodCallException + */ + public function __get($name) + { + $msg = $name === 'handle' ? 'The EasyHandle has been released' : 'Invalid property: ' . $name; + throw new \BadMethodCallException($msg); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php b/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php new file mode 100644 index 00000000..a0988845 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php @@ -0,0 +1,42 @@ +|null $queue The parameters to be passed to the append function, as an indexed array. + * @param callable|null $onFulfilled Callback to invoke when the return value is fulfilled. + * @param callable|null $onRejected Callback to invoke when the return value is rejected. + */ + public function __construct(array $queue = null, callable $onFulfilled = null, callable $onRejected = null) + { + $this->onFulfilled = $onFulfilled; + $this->onRejected = $onRejected; + + if ($queue) { + // array_values included for BC + $this->append(...array_values($queue)); + } + } + + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + if (!$this->queue) { + throw new \OutOfBoundsException('Mock queue is empty'); + } + + if (isset($options['delay']) && \is_numeric($options['delay'])) { + \usleep((int) $options['delay'] * 1000); + } + + $this->lastRequest = $request; + $this->lastOptions = $options; + $response = \array_shift($this->queue); + + if (isset($options['on_headers'])) { + if (!\is_callable($options['on_headers'])) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + try { + $options['on_headers']($response); + } catch (\Exception $e) { + $msg = 'An error was encountered during the on_headers event'; + $response = new RequestException($msg, $request, $response, $e); + } + } + + if (\is_callable($response)) { + $response = $response($request, $options); + } + + $response = $response instanceof \Throwable + ? P\Create::rejectionFor($response) + : P\Create::promiseFor($response); + + return $response->then( + function (?ResponseInterface $value) use ($request, $options) { + $this->invokeStats($request, $options, $value); + if ($this->onFulfilled) { + ($this->onFulfilled)($value); + } + + if ($value !== null && isset($options['sink'])) { + $contents = (string) $value->getBody(); + $sink = $options['sink']; + + if (\is_resource($sink)) { + \fwrite($sink, $contents); + } elseif (\is_string($sink)) { + \file_put_contents($sink, $contents); + } elseif ($sink instanceof StreamInterface) { + $sink->write($contents); + } + } + + return $value; + }, + function ($reason) use ($request, $options) { + $this->invokeStats($request, $options, null, $reason); + if ($this->onRejected) { + ($this->onRejected)($reason); + } + return P\Create::rejectionFor($reason); + } + ); + } + + /** + * Adds one or more variadic requests, exceptions, callables, or promises + * to the queue. + * + * @param mixed ...$values + */ + public function append(...$values): void + { + foreach ($values as $value) { + if ($value instanceof ResponseInterface + || $value instanceof \Throwable + || $value instanceof PromiseInterface + || \is_callable($value) + ) { + $this->queue[] = $value; + } else { + throw new \TypeError('Expected a Response, Promise, Throwable or callable. Found ' . Utils::describeType($value)); + } + } + } + + /** + * Get the last received request. + */ + public function getLastRequest(): ?RequestInterface + { + return $this->lastRequest; + } + + /** + * Get the last received request options. + */ + public function getLastOptions(): array + { + return $this->lastOptions; + } + + /** + * Returns the number of remaining items in the queue. + */ + public function count(): int + { + return \count($this->queue); + } + + public function reset(): void + { + $this->queue = []; + } + + /** + * @param mixed $reason Promise or reason. + */ + private function invokeStats( + RequestInterface $request, + array $options, + ResponseInterface $response = null, + $reason = null + ): void { + if (isset($options['on_stats'])) { + $transferTime = $options['transfer_time'] ?? 0; + $stats = new TransferStats($request, $response, $transferTime, $reason); + ($options['on_stats'])($stats); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php b/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php new file mode 100644 index 00000000..f045b526 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php @@ -0,0 +1,51 @@ +withoutHeader('Expect'); + + // Append a content-length header if body size is zero to match + // cURL's behavior. + if (0 === $request->getBody()->getSize()) { + $request = $request->withHeader('Content-Length', '0'); + } + + return $this->createResponse( + $request, + $options, + $this->createStream($request, $options), + $startTime + ); + } catch (\InvalidArgumentException $e) { + throw $e; + } catch (\Exception $e) { + // Determine if the error was a networking error. + $message = $e->getMessage(); + // This list can probably get more comprehensive. + if (false !== \strpos($message, 'getaddrinfo') // DNS lookup failed + || false !== \strpos($message, 'Connection refused') + || false !== \strpos($message, "couldn't connect to host") // error on HHVM + || false !== \strpos($message, "connection attempt failed") + ) { + $e = new ConnectException($e->getMessage(), $request, $e); + } else { + $e = RequestException::wrapException($request, $e); + } + $this->invokeStats($options, $request, $startTime, null, $e); + + return P\Create::rejectionFor($e); + } + } + + private function invokeStats( + array $options, + RequestInterface $request, + ?float $startTime, + ResponseInterface $response = null, + \Throwable $error = null + ): void { + if (isset($options['on_stats'])) { + $stats = new TransferStats($request, $response, Utils::currentTime() - $startTime, $error, []); + ($options['on_stats'])($stats); + } + } + + /** + * @param resource $stream + */ + private function createResponse(RequestInterface $request, array $options, $stream, ?float $startTime): PromiseInterface + { + $hdrs = $this->lastHeaders; + $this->lastHeaders = []; + + try { + [$ver, $status, $reason, $headers] = HeaderProcessor::parseHeaders($hdrs); + } catch (\Exception $e) { + return P\Create::rejectionFor( + new RequestException('An error was encountered while creating the response', $request, null, $e) + ); + } + + [$stream, $headers] = $this->checkDecode($options, $headers, $stream); + $stream = Psr7\Utils::streamFor($stream); + $sink = $stream; + + if (\strcasecmp('HEAD', $request->getMethod())) { + $sink = $this->createSink($stream, $options); + } + + try { + $response = new Psr7\Response($status, $headers, $sink, $ver, $reason); + } catch (\Exception $e) { + return P\Create::rejectionFor( + new RequestException('An error was encountered while creating the response', $request, null, $e) + ); + } + + if (isset($options['on_headers'])) { + try { + $options['on_headers']($response); + } catch (\Exception $e) { + return P\Create::rejectionFor( + new RequestException('An error was encountered during the on_headers event', $request, $response, $e) + ); + } + } + + // Do not drain when the request is a HEAD request because they have + // no body. + if ($sink !== $stream) { + $this->drain($stream, $sink, $response->getHeaderLine('Content-Length')); + } + + $this->invokeStats($options, $request, $startTime, $response, null); + + return new FulfilledPromise($response); + } + + private function createSink(StreamInterface $stream, array $options): StreamInterface + { + if (!empty($options['stream'])) { + return $stream; + } + + $sink = $options['sink'] ?? Psr7\Utils::tryFopen('php://temp', 'r+'); + + return \is_string($sink) ? new Psr7\LazyOpenStream($sink, 'w+') : Psr7\Utils::streamFor($sink); + } + + /** + * @param resource $stream + */ + private function checkDecode(array $options, array $headers, $stream): array + { + // Automatically decode responses when instructed. + if (!empty($options['decode_content'])) { + $normalizedKeys = Utils::normalizeHeaderKeys($headers); + if (isset($normalizedKeys['content-encoding'])) { + $encoding = $headers[$normalizedKeys['content-encoding']]; + if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') { + $stream = new Psr7\InflateStream(Psr7\Utils::streamFor($stream)); + $headers['x-encoded-content-encoding'] = $headers[$normalizedKeys['content-encoding']]; + + // Remove content-encoding header + unset($headers[$normalizedKeys['content-encoding']]); + + // Fix content-length header + if (isset($normalizedKeys['content-length'])) { + $headers['x-encoded-content-length'] = $headers[$normalizedKeys['content-length']]; + $length = (int) $stream->getSize(); + if ($length === 0) { + unset($headers[$normalizedKeys['content-length']]); + } else { + $headers[$normalizedKeys['content-length']] = [$length]; + } + } + } + } + } + + return [$stream, $headers]; + } + + /** + * Drains the source stream into the "sink" client option. + * + * @param string $contentLength Header specifying the amount of + * data to read. + * + * @throws \RuntimeException when the sink option is invalid. + */ + private function drain(StreamInterface $source, StreamInterface $sink, string $contentLength): StreamInterface + { + // If a content-length header is provided, then stop reading once + // that number of bytes has been read. This can prevent infinitely + // reading from a stream when dealing with servers that do not honor + // Connection: Close headers. + Psr7\Utils::copyToStream( + $source, + $sink, + (\strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1 + ); + + $sink->seek(0); + $source->close(); + + return $sink; + } + + /** + * Create a resource and check to ensure it was created successfully + * + * @param callable $callback Callable that returns stream resource + * + * @return resource + * + * @throws \RuntimeException on error + */ + private function createResource(callable $callback) + { + $errors = []; + \set_error_handler(static function ($_, $msg, $file, $line) use (&$errors): bool { + $errors[] = [ + 'message' => $msg, + 'file' => $file, + 'line' => $line + ]; + return true; + }); + + try { + $resource = $callback(); + } finally { + \restore_error_handler(); + } + + if (!$resource) { + $message = 'Error creating resource: '; + foreach ($errors as $err) { + foreach ($err as $key => $value) { + $message .= "[$key] $value" . \PHP_EOL; + } + } + throw new \RuntimeException(\trim($message)); + } + + return $resource; + } + + /** + * @return resource + */ + private function createStream(RequestInterface $request, array $options) + { + static $methods; + if (!$methods) { + $methods = \array_flip(\get_class_methods(__CLASS__)); + } + + // HTTP/1.1 streams using the PHP stream wrapper require a + // Connection: close header + if ($request->getProtocolVersion() == '1.1' + && !$request->hasHeader('Connection') + ) { + $request = $request->withHeader('Connection', 'close'); + } + + // Ensure SSL is verified by default + if (!isset($options['verify'])) { + $options['verify'] = true; + } + + $params = []; + $context = $this->getDefaultContext($request); + + if (isset($options['on_headers']) && !\is_callable($options['on_headers'])) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + + if (!empty($options)) { + foreach ($options as $key => $value) { + $method = "add_{$key}"; + if (isset($methods[$method])) { + $this->{$method}($request, $context, $value, $params); + } + } + } + + if (isset($options['stream_context'])) { + if (!\is_array($options['stream_context'])) { + throw new \InvalidArgumentException('stream_context must be an array'); + } + $context = \array_replace_recursive($context, $options['stream_context']); + } + + // Microsoft NTLM authentication only supported with curl handler + if (isset($options['auth'][2]) && 'ntlm' === $options['auth'][2]) { + throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler'); + } + + $uri = $this->resolveHost($request, $options); + + $contextResource = $this->createResource( + static function () use ($context, $params) { + return \stream_context_create($context, $params); + } + ); + + return $this->createResource( + function () use ($uri, &$http_response_header, $contextResource, $context, $options, $request) { + $resource = @\fopen((string) $uri, 'r', false, $contextResource); + $this->lastHeaders = $http_response_header; + + if (false === $resource) { + throw new ConnectException(sprintf('Connection refused for URI %s', $uri), $request, null, $context); + } + + if (isset($options['read_timeout'])) { + $readTimeout = $options['read_timeout']; + $sec = (int) $readTimeout; + $usec = ($readTimeout - $sec) * 100000; + \stream_set_timeout($resource, $sec, $usec); + } + + return $resource; + } + ); + } + + private function resolveHost(RequestInterface $request, array $options): UriInterface + { + $uri = $request->getUri(); + + if (isset($options['force_ip_resolve']) && !\filter_var($uri->getHost(), \FILTER_VALIDATE_IP)) { + if ('v4' === $options['force_ip_resolve']) { + $records = \dns_get_record($uri->getHost(), \DNS_A); + if (false === $records || !isset($records[0]['ip'])) { + throw new ConnectException(\sprintf("Could not resolve IPv4 address for host '%s'", $uri->getHost()), $request); + } + return $uri->withHost($records[0]['ip']); + } + if ('v6' === $options['force_ip_resolve']) { + $records = \dns_get_record($uri->getHost(), \DNS_AAAA); + if (false === $records || !isset($records[0]['ipv6'])) { + throw new ConnectException(\sprintf("Could not resolve IPv6 address for host '%s'", $uri->getHost()), $request); + } + return $uri->withHost('[' . $records[0]['ipv6'] . ']'); + } + } + + return $uri; + } + + private function getDefaultContext(RequestInterface $request): array + { + $headers = ''; + foreach ($request->getHeaders() as $name => $value) { + foreach ($value as $val) { + $headers .= "$name: $val\r\n"; + } + } + + $context = [ + 'http' => [ + 'method' => $request->getMethod(), + 'header' => $headers, + 'protocol_version' => $request->getProtocolVersion(), + 'ignore_errors' => true, + 'follow_location' => 0, + ], + ]; + + $body = (string) $request->getBody(); + + if (!empty($body)) { + $context['http']['content'] = $body; + // Prevent the HTTP handler from adding a Content-Type header. + if (!$request->hasHeader('Content-Type')) { + $context['http']['header'] .= "Content-Type:\r\n"; + } + } + + $context['http']['header'] = \rtrim($context['http']['header']); + + return $context; + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_proxy(RequestInterface $request, array &$options, $value, array &$params): void + { + $uri = null; + + if (!\is_array($value)) { + $uri = $value; + } else { + $scheme = $request->getUri()->getScheme(); + if (isset($value[$scheme])) { + if (!isset($value['no']) || !Utils::isHostInNoProxy($request->getUri()->getHost(), $value['no'])) { + $uri = $value[$scheme]; + } + } + } + + if (!$uri) { + return; + } + + $parsed = $this->parse_proxy($uri); + $options['http']['proxy'] = $parsed['proxy']; + + if ($parsed['auth']) { + if (!isset($options['http']['header'])) { + $options['http']['header'] = []; + } + $options['http']['header'] .= "\r\nProxy-Authorization: {$parsed['auth']}"; + } + } + + /** + * Parses the given proxy URL to make it compatible with the format PHP's stream context expects. + */ + private function parse_proxy(string $url): array + { + $parsed = \parse_url($url); + + if ($parsed !== false && isset($parsed['scheme']) && $parsed['scheme'] === 'http') { + if (isset($parsed['host']) && isset($parsed['port'])) { + $auth = null; + if (isset($parsed['user']) && isset($parsed['pass'])) { + $auth = \base64_encode("{$parsed['user']}:{$parsed['pass']}"); + } + + return [ + 'proxy' => "tcp://{$parsed['host']}:{$parsed['port']}", + 'auth' => $auth ? "Basic {$auth}" : null, + ]; + } + } + + // Return proxy as-is. + return [ + 'proxy' => $url, + 'auth' => null, + ]; + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_timeout(RequestInterface $request, array &$options, $value, array &$params): void + { + if ($value > 0) { + $options['http']['timeout'] = $value; + } + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_verify(RequestInterface $request, array &$options, $value, array &$params): void + { + if ($value === false) { + $options['ssl']['verify_peer'] = false; + $options['ssl']['verify_peer_name'] = false; + + return; + } + + if (\is_string($value)) { + $options['ssl']['cafile'] = $value; + if (!\file_exists($value)) { + throw new \RuntimeException("SSL CA bundle not found: $value"); + } + } elseif ($value !== true) { + throw new \InvalidArgumentException('Invalid verify request option'); + } + + $options['ssl']['verify_peer'] = true; + $options['ssl']['verify_peer_name'] = true; + $options['ssl']['allow_self_signed'] = false; + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_cert(RequestInterface $request, array &$options, $value, array &$params): void + { + if (\is_array($value)) { + $options['ssl']['passphrase'] = $value[1]; + $value = $value[0]; + } + + if (!\file_exists($value)) { + throw new \RuntimeException("SSL certificate not found: {$value}"); + } + + $options['ssl']['local_cert'] = $value; + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_progress(RequestInterface $request, array &$options, $value, array &$params): void + { + self::addNotification( + $params, + static function ($code, $a, $b, $c, $transferred, $total) use ($value) { + if ($code == \STREAM_NOTIFY_PROGRESS) { + // The upload progress cannot be determined. Use 0 for cURL compatibility: + // https://curl.se/libcurl/c/CURLOPT_PROGRESSFUNCTION.html + $value($total, $transferred, 0, 0); + } + } + ); + } + + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_debug(RequestInterface $request, array &$options, $value, array &$params): void + { + if ($value === false) { + return; + } + + static $map = [ + \STREAM_NOTIFY_CONNECT => 'CONNECT', + \STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED', + \STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT', + \STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS', + \STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS', + \STREAM_NOTIFY_REDIRECTED => 'REDIRECTED', + \STREAM_NOTIFY_PROGRESS => 'PROGRESS', + \STREAM_NOTIFY_FAILURE => 'FAILURE', + \STREAM_NOTIFY_COMPLETED => 'COMPLETED', + \STREAM_NOTIFY_RESOLVE => 'RESOLVE', + ]; + static $args = ['severity', 'message', 'message_code', 'bytes_transferred', 'bytes_max']; + + $value = Utils::debugResource($value); + $ident = $request->getMethod() . ' ' . $request->getUri()->withFragment(''); + self::addNotification( + $params, + static function (int $code, ...$passed) use ($ident, $value, $map, $args): void { + \fprintf($value, '<%s> [%s] ', $ident, $map[$code]); + foreach (\array_filter($passed) as $i => $v) { + \fwrite($value, $args[$i] . ': "' . $v . '" '); + } + \fwrite($value, "\n"); + } + ); + } + + private static function addNotification(array &$params, callable $notify): void + { + // Wrap the existing function if needed. + if (!isset($params['notification'])) { + $params['notification'] = $notify; + } else { + $params['notification'] = self::callArray([ + $params['notification'], + $notify + ]); + } + } + + private static function callArray(array $functions): callable + { + return static function (...$args) use ($functions) { + foreach ($functions as $fn) { + $fn(...$args); + } + }; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/HandlerStack.php b/vendor/guzzlehttp/guzzle/src/HandlerStack.php new file mode 100644 index 00000000..e0a1d119 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/HandlerStack.php @@ -0,0 +1,275 @@ +push(Middleware::httpErrors(), 'http_errors'); + $stack->push(Middleware::redirect(), 'allow_redirects'); + $stack->push(Middleware::cookies(), 'cookies'); + $stack->push(Middleware::prepareBody(), 'prepare_body'); + + return $stack; + } + + /** + * @param (callable(RequestInterface, array): PromiseInterface)|null $handler Underlying HTTP handler. + */ + public function __construct(callable $handler = null) + { + $this->handler = $handler; + } + + /** + * Invokes the handler stack as a composed handler + * + * @return ResponseInterface|PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + $handler = $this->resolve(); + + return $handler($request, $options); + } + + /** + * Dumps a string representation of the stack. + * + * @return string + */ + public function __toString() + { + $depth = 0; + $stack = []; + + if ($this->handler !== null) { + $stack[] = "0) Handler: " . $this->debugCallable($this->handler); + } + + $result = ''; + foreach (\array_reverse($this->stack) as $tuple) { + $depth++; + $str = "{$depth}) Name: '{$tuple[1]}', "; + $str .= "Function: " . $this->debugCallable($tuple[0]); + $result = "> {$str}\n{$result}"; + $stack[] = $str; + } + + foreach (\array_keys($stack) as $k) { + $result .= "< {$stack[$k]}\n"; + } + + return $result; + } + + /** + * Set the HTTP handler that actually returns a promise. + * + * @param callable(RequestInterface, array): PromiseInterface $handler Accepts a request and array of options and + * returns a Promise. + */ + public function setHandler(callable $handler): void + { + $this->handler = $handler; + $this->cached = null; + } + + /** + * Returns true if the builder has a handler. + */ + public function hasHandler(): bool + { + return $this->handler !== null ; + } + + /** + * Unshift a middleware to the bottom of the stack. + * + * @param callable(callable): callable $middleware Middleware function + * @param string $name Name to register for this middleware. + */ + public function unshift(callable $middleware, ?string $name = null): void + { + \array_unshift($this->stack, [$middleware, $name]); + $this->cached = null; + } + + /** + * Push a middleware to the top of the stack. + * + * @param callable(callable): callable $middleware Middleware function + * @param string $name Name to register for this middleware. + */ + public function push(callable $middleware, string $name = ''): void + { + $this->stack[] = [$middleware, $name]; + $this->cached = null; + } + + /** + * Add a middleware before another middleware by name. + * + * @param string $findName Middleware to find + * @param callable(callable): callable $middleware Middleware function + * @param string $withName Name to register for this middleware. + */ + public function before(string $findName, callable $middleware, string $withName = ''): void + { + $this->splice($findName, $withName, $middleware, true); + } + + /** + * Add a middleware after another middleware by name. + * + * @param string $findName Middleware to find + * @param callable(callable): callable $middleware Middleware function + * @param string $withName Name to register for this middleware. + */ + public function after(string $findName, callable $middleware, string $withName = ''): void + { + $this->splice($findName, $withName, $middleware, false); + } + + /** + * Remove a middleware by instance or name from the stack. + * + * @param callable|string $remove Middleware to remove by instance or name. + */ + public function remove($remove): void + { + if (!is_string($remove) && !is_callable($remove)) { + trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a callable or string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); + } + + $this->cached = null; + $idx = \is_callable($remove) ? 0 : 1; + $this->stack = \array_values(\array_filter( + $this->stack, + static function ($tuple) use ($idx, $remove) { + return $tuple[$idx] !== $remove; + } + )); + } + + /** + * Compose the middleware and handler into a single callable function. + * + * @return callable(RequestInterface, array): PromiseInterface + */ + public function resolve(): callable + { + if ($this->cached === null) { + if (($prev = $this->handler) === null) { + throw new \LogicException('No handler has been specified'); + } + + foreach (\array_reverse($this->stack) as $fn) { + /** @var callable(RequestInterface, array): PromiseInterface $prev */ + $prev = $fn[0]($prev); + } + + $this->cached = $prev; + } + + return $this->cached; + } + + private function findByName(string $name): int + { + foreach ($this->stack as $k => $v) { + if ($v[1] === $name) { + return $k; + } + } + + throw new \InvalidArgumentException("Middleware not found: $name"); + } + + /** + * Splices a function into the middleware list at a specific position. + */ + private function splice(string $findName, string $withName, callable $middleware, bool $before): void + { + $this->cached = null; + $idx = $this->findByName($findName); + $tuple = [$middleware, $withName]; + + if ($before) { + if ($idx === 0) { + \array_unshift($this->stack, $tuple); + } else { + $replacement = [$tuple, $this->stack[$idx]]; + \array_splice($this->stack, $idx, 1, $replacement); + } + } elseif ($idx === \count($this->stack) - 1) { + $this->stack[] = $tuple; + } else { + $replacement = [$this->stack[$idx], $tuple]; + \array_splice($this->stack, $idx, 1, $replacement); + } + } + + /** + * Provides a debug string for a given callable. + * + * @param callable|string $fn Function to write as a string. + */ + private function debugCallable($fn): string + { + if (\is_string($fn)) { + return "callable({$fn})"; + } + + if (\is_array($fn)) { + return \is_string($fn[0]) + ? "callable({$fn[0]}::{$fn[1]})" + : "callable(['" . \get_class($fn[0]) . "', '{$fn[1]}'])"; + } + + /** @var object $fn */ + return 'callable(' . \spl_object_hash($fn) . ')'; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/MessageFormatter.php b/vendor/guzzlehttp/guzzle/src/MessageFormatter.php new file mode 100644 index 00000000..da499547 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/MessageFormatter.php @@ -0,0 +1,198 @@ +>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}"; + public const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}'; + + /** + * @var string Template used to format log messages + */ + private $template; + + /** + * @param string $template Log message template + */ + public function __construct(?string $template = self::CLF) + { + $this->template = $template ?: self::CLF; + } + + /** + * Returns a formatted message string. + * + * @param RequestInterface $request Request that was sent + * @param ResponseInterface|null $response Response that was received + * @param \Throwable|null $error Exception that was received + */ + public function format(RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $error = null): string + { + $cache = []; + + /** @var string */ + return \preg_replace_callback( + '/{\s*([A-Za-z_\-\.0-9]+)\s*}/', + function (array $matches) use ($request, $response, $error, &$cache) { + if (isset($cache[$matches[1]])) { + return $cache[$matches[1]]; + } + + $result = ''; + switch ($matches[1]) { + case 'request': + $result = Psr7\Message::toString($request); + break; + case 'response': + $result = $response ? Psr7\Message::toString($response) : ''; + break; + case 'req_headers': + $result = \trim($request->getMethod() + . ' ' . $request->getRequestTarget()) + . ' HTTP/' . $request->getProtocolVersion() . "\r\n" + . $this->headers($request); + break; + case 'res_headers': + $result = $response ? + \sprintf( + 'HTTP/%s %d %s', + $response->getProtocolVersion(), + $response->getStatusCode(), + $response->getReasonPhrase() + ) . "\r\n" . $this->headers($response) + : 'NULL'; + break; + case 'req_body': + $result = $request->getBody()->__toString(); + break; + case 'res_body': + if (!$response instanceof ResponseInterface) { + $result = 'NULL'; + break; + } + + $body = $response->getBody(); + + if (!$body->isSeekable()) { + $result = 'RESPONSE_NOT_LOGGEABLE'; + break; + } + + $result = $response->getBody()->__toString(); + break; + case 'ts': + case 'date_iso_8601': + $result = \gmdate('c'); + break; + case 'date_common_log': + $result = \date('d/M/Y:H:i:s O'); + break; + case 'method': + $result = $request->getMethod(); + break; + case 'version': + $result = $request->getProtocolVersion(); + break; + case 'uri': + case 'url': + $result = $request->getUri()->__toString(); + break; + case 'target': + $result = $request->getRequestTarget(); + break; + case 'req_version': + $result = $request->getProtocolVersion(); + break; + case 'res_version': + $result = $response + ? $response->getProtocolVersion() + : 'NULL'; + break; + case 'host': + $result = $request->getHeaderLine('Host'); + break; + case 'hostname': + $result = \gethostname(); + break; + case 'code': + $result = $response ? $response->getStatusCode() : 'NULL'; + break; + case 'phrase': + $result = $response ? $response->getReasonPhrase() : 'NULL'; + break; + case 'error': + $result = $error ? $error->getMessage() : 'NULL'; + break; + default: + // handle prefixed dynamic headers + if (\strpos($matches[1], 'req_header_') === 0) { + $result = $request->getHeaderLine(\substr($matches[1], 11)); + } elseif (\strpos($matches[1], 'res_header_') === 0) { + $result = $response + ? $response->getHeaderLine(\substr($matches[1], 11)) + : 'NULL'; + } + } + + $cache[$matches[1]] = $result; + return $result; + }, + $this->template + ); + } + + /** + * Get headers from message as string + */ + private function headers(MessageInterface $message): string + { + $result = ''; + foreach ($message->getHeaders() as $name => $values) { + $result .= $name . ': ' . \implode(', ', $values) . "\r\n"; + } + + return \trim($result); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php b/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php new file mode 100644 index 00000000..a39ac248 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php @@ -0,0 +1,18 @@ +withCookieHeader($request); + return $handler($request, $options) + ->then( + static function (ResponseInterface $response) use ($cookieJar, $request): ResponseInterface { + $cookieJar->extractCookies($request, $response); + return $response; + } + ); + }; + }; + } + + /** + * Middleware that throws exceptions for 4xx or 5xx responses when the + * "http_errors" request option is set to true. + * + * @param BodySummarizerInterface|null $bodySummarizer The body summarizer to use in exception messages. + * + * @return callable(callable): callable Returns a function that accepts the next handler. + */ + public static function httpErrors(BodySummarizerInterface $bodySummarizer = null): callable + { + return static function (callable $handler) use ($bodySummarizer): callable { + return static function ($request, array $options) use ($handler, $bodySummarizer) { + if (empty($options['http_errors'])) { + return $handler($request, $options); + } + return $handler($request, $options)->then( + static function (ResponseInterface $response) use ($request, $bodySummarizer) { + $code = $response->getStatusCode(); + if ($code < 400) { + return $response; + } + throw RequestException::create($request, $response, null, [], $bodySummarizer); + } + ); + }; + }; + } + + /** + * Middleware that pushes history data to an ArrayAccess container. + * + * @param array|\ArrayAccess $container Container to hold the history (by reference). + * + * @return callable(callable): callable Returns a function that accepts the next handler. + * + * @throws \InvalidArgumentException if container is not an array or ArrayAccess. + */ + public static function history(&$container): callable + { + if (!\is_array($container) && !$container instanceof \ArrayAccess) { + throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess'); + } + + return static function (callable $handler) use (&$container): callable { + return static function (RequestInterface $request, array $options) use ($handler, &$container) { + return $handler($request, $options)->then( + static function ($value) use ($request, &$container, $options) { + $container[] = [ + 'request' => $request, + 'response' => $value, + 'error' => null, + 'options' => $options + ]; + return $value; + }, + static function ($reason) use ($request, &$container, $options) { + $container[] = [ + 'request' => $request, + 'response' => null, + 'error' => $reason, + 'options' => $options + ]; + return P\Create::rejectionFor($reason); + } + ); + }; + }; + } + + /** + * Middleware that invokes a callback before and after sending a request. + * + * The provided listener cannot modify or alter the response. It simply + * "taps" into the chain to be notified before returning the promise. The + * before listener accepts a request and options array, and the after + * listener accepts a request, options array, and response promise. + * + * @param callable $before Function to invoke before forwarding the request. + * @param callable $after Function invoked after forwarding. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function tap(callable $before = null, callable $after = null): callable + { + return static function (callable $handler) use ($before, $after): callable { + return static function (RequestInterface $request, array $options) use ($handler, $before, $after) { + if ($before) { + $before($request, $options); + } + $response = $handler($request, $options); + if ($after) { + $after($request, $options, $response); + } + return $response; + }; + }; + } + + /** + * Middleware that handles request redirects. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function redirect(): callable + { + return static function (callable $handler): RedirectMiddleware { + return new RedirectMiddleware($handler); + }; + } + + /** + * Middleware that retries requests based on the boolean result of + * invoking the provided "decider" function. + * + * If no delay function is provided, a simple implementation of exponential + * backoff will be utilized. + * + * @param callable $decider Function that accepts the number of retries, + * a request, [response], and [exception] and + * returns true if the request is to be retried. + * @param callable $delay Function that accepts the number of retries and + * returns the number of milliseconds to delay. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function retry(callable $decider, callable $delay = null): callable + { + return static function (callable $handler) use ($decider, $delay): RetryMiddleware { + return new RetryMiddleware($decider, $handler, $delay); + }; + } + + /** + * Middleware that logs requests, responses, and errors using a message + * formatter. + * + * @phpstan-param \Psr\Log\LogLevel::* $logLevel Level at which to log requests. + * + * @param LoggerInterface $logger Logs messages. + * @param MessageFormatterInterface|MessageFormatter $formatter Formatter used to create message strings. + * @param string $logLevel Level at which to log requests. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function log(LoggerInterface $logger, $formatter, string $logLevel = 'info'): callable + { + // To be compatible with Guzzle 7.1.x we need to allow users to pass a MessageFormatter + if (!$formatter instanceof MessageFormatter && !$formatter instanceof MessageFormatterInterface) { + throw new \LogicException(sprintf('Argument 2 to %s::log() must be of type %s', self::class, MessageFormatterInterface::class)); + } + + return static function (callable $handler) use ($logger, $formatter, $logLevel): callable { + return static function (RequestInterface $request, array $options = []) use ($handler, $logger, $formatter, $logLevel) { + return $handler($request, $options)->then( + static function ($response) use ($logger, $request, $formatter, $logLevel): ResponseInterface { + $message = $formatter->format($request, $response); + $logger->log($logLevel, $message); + return $response; + }, + static function ($reason) use ($logger, $request, $formatter): PromiseInterface { + $response = $reason instanceof RequestException ? $reason->getResponse() : null; + $message = $formatter->format($request, $response, P\Create::exceptionFor($reason)); + $logger->error($message); + return P\Create::rejectionFor($reason); + } + ); + }; + }; + } + + /** + * This middleware adds a default content-type if possible, a default + * content-length or transfer-encoding header, and the expect header. + */ + public static function prepareBody(): callable + { + return static function (callable $handler): PrepareBodyMiddleware { + return new PrepareBodyMiddleware($handler); + }; + } + + /** + * Middleware that applies a map function to the request before passing to + * the next handler. + * + * @param callable $fn Function that accepts a RequestInterface and returns + * a RequestInterface. + */ + public static function mapRequest(callable $fn): callable + { + return static function (callable $handler) use ($fn): callable { + return static function (RequestInterface $request, array $options) use ($handler, $fn) { + return $handler($fn($request), $options); + }; + }; + } + + /** + * Middleware that applies a map function to the resolved promise's + * response. + * + * @param callable $fn Function that accepts a ResponseInterface and + * returns a ResponseInterface. + */ + public static function mapResponse(callable $fn): callable + { + return static function (callable $handler) use ($fn): callable { + return static function (RequestInterface $request, array $options) use ($handler, $fn) { + return $handler($request, $options)->then($fn); + }; + }; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Pool.php b/vendor/guzzlehttp/guzzle/src/Pool.php new file mode 100644 index 00000000..6277c61f --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Pool.php @@ -0,0 +1,125 @@ + $rfn) { + if ($rfn instanceof RequestInterface) { + yield $key => $client->sendAsync($rfn, $opts); + } elseif (\is_callable($rfn)) { + yield $key => $rfn($opts); + } else { + throw new \InvalidArgumentException('Each value yielded by the iterator must be a Psr7\Http\Message\RequestInterface or a callable that returns a promise that fulfills with a Psr7\Message\Http\ResponseInterface object.'); + } + } + }; + + $this->each = new EachPromise($requests(), $config); + } + + /** + * Get promise + */ + public function promise(): PromiseInterface + { + return $this->each->promise(); + } + + /** + * Sends multiple requests concurrently and returns an array of responses + * and exceptions that uses the same ordering as the provided requests. + * + * IMPORTANT: This method keeps every request and response in memory, and + * as such, is NOT recommended when sending a large number or an + * indeterminate number of requests concurrently. + * + * @param ClientInterface $client Client used to send the requests + * @param array|\Iterator $requests Requests to send concurrently. + * @param array $options Passes through the options available in + * {@see \GuzzleHttp\Pool::__construct} + * + * @return array Returns an array containing the response or an exception + * in the same order that the requests were sent. + * + * @throws \InvalidArgumentException if the event format is incorrect. + */ + public static function batch(ClientInterface $client, $requests, array $options = []): array + { + $res = []; + self::cmpCallback($options, 'fulfilled', $res); + self::cmpCallback($options, 'rejected', $res); + $pool = new static($client, $requests, $options); + $pool->promise()->wait(); + \ksort($res); + + return $res; + } + + /** + * Execute callback(s) + */ + private static function cmpCallback(array &$options, string $name, array &$results): void + { + if (!isset($options[$name])) { + $options[$name] = static function ($v, $k) use (&$results) { + $results[$k] = $v; + }; + } else { + $currentFn = $options[$name]; + $options[$name] = static function ($v, $k) use (&$results, $currentFn) { + $currentFn($v, $k); + $results[$k] = $v; + }; + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php b/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php new file mode 100644 index 00000000..7ca62833 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php @@ -0,0 +1,104 @@ +nextHandler = $nextHandler; + } + + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + $fn = $this->nextHandler; + + // Don't do anything if the request has no body. + if ($request->getBody()->getSize() === 0) { + return $fn($request, $options); + } + + $modify = []; + + // Add a default content-type if possible. + if (!$request->hasHeader('Content-Type')) { + if ($uri = $request->getBody()->getMetadata('uri')) { + if (is_string($uri) && $type = Psr7\MimeType::fromFilename($uri)) { + $modify['set_headers']['Content-Type'] = $type; + } + } + } + + // Add a default content-length or transfer-encoding header. + if (!$request->hasHeader('Content-Length') + && !$request->hasHeader('Transfer-Encoding') + ) { + $size = $request->getBody()->getSize(); + if ($size !== null) { + $modify['set_headers']['Content-Length'] = $size; + } else { + $modify['set_headers']['Transfer-Encoding'] = 'chunked'; + } + } + + // Add the expect header if needed. + $this->addExpectHeader($request, $options, $modify); + + return $fn(Psr7\Utils::modifyRequest($request, $modify), $options); + } + + /** + * Add expect header + */ + private function addExpectHeader(RequestInterface $request, array $options, array &$modify): void + { + // Determine if the Expect header should be used + if ($request->hasHeader('Expect')) { + return; + } + + $expect = $options['expect'] ?? null; + + // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0 + if ($expect === false || $request->getProtocolVersion() < 1.1) { + return; + } + + // The expect header is unconditionally enabled + if ($expect === true) { + $modify['set_headers']['Expect'] = '100-Continue'; + return; + } + + // By default, send the expect header when the payload is > 1mb + if ($expect === null) { + $expect = 1048576; + } + + // Always add if the body cannot be rewound, the size cannot be + // determined, or the size is greater than the cutoff threshold + $body = $request->getBody(); + $size = $body->getSize(); + + if ($size === null || $size >= (int) $expect || !$body->isSeekable()) { + $modify['set_headers']['Expect'] = '100-Continue'; + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php new file mode 100644 index 00000000..1dd38614 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php @@ -0,0 +1,216 @@ + 5, + 'protocols' => ['http', 'https'], + 'strict' => false, + 'referer' => false, + 'track_redirects' => false, + ]; + + /** + * @var callable(RequestInterface, array): PromiseInterface + */ + private $nextHandler; + + /** + * @param callable(RequestInterface, array): PromiseInterface $nextHandler Next handler to invoke. + */ + public function __construct(callable $nextHandler) + { + $this->nextHandler = $nextHandler; + } + + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + $fn = $this->nextHandler; + + if (empty($options['allow_redirects'])) { + return $fn($request, $options); + } + + if ($options['allow_redirects'] === true) { + $options['allow_redirects'] = self::$defaultSettings; + } elseif (!\is_array($options['allow_redirects'])) { + throw new \InvalidArgumentException('allow_redirects must be true, false, or array'); + } else { + // Merge the default settings with the provided settings + $options['allow_redirects'] += self::$defaultSettings; + } + + if (empty($options['allow_redirects']['max'])) { + return $fn($request, $options); + } + + return $fn($request, $options) + ->then(function (ResponseInterface $response) use ($request, $options) { + return $this->checkRedirect($request, $options, $response); + }); + } + + /** + * @return ResponseInterface|PromiseInterface + */ + public function checkRedirect(RequestInterface $request, array $options, ResponseInterface $response) + { + if (\strpos((string) $response->getStatusCode(), '3') !== 0 + || !$response->hasHeader('Location') + ) { + return $response; + } + + $this->guardMax($request, $response, $options); + $nextRequest = $this->modifyRequest($request, $options, $response); + + if (isset($options['allow_redirects']['on_redirect'])) { + ($options['allow_redirects']['on_redirect'])( + $request, + $response, + $nextRequest->getUri() + ); + } + + $promise = $this($nextRequest, $options); + + // Add headers to be able to track history of redirects. + if (!empty($options['allow_redirects']['track_redirects'])) { + return $this->withTracking( + $promise, + (string) $nextRequest->getUri(), + $response->getStatusCode() + ); + } + + return $promise; + } + + /** + * Enable tracking on promise. + */ + private function withTracking(PromiseInterface $promise, string $uri, int $statusCode): PromiseInterface + { + return $promise->then( + static function (ResponseInterface $response) use ($uri, $statusCode) { + // Note that we are pushing to the front of the list as this + // would be an earlier response than what is currently present + // in the history header. + $historyHeader = $response->getHeader(self::HISTORY_HEADER); + $statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER); + \array_unshift($historyHeader, $uri); + \array_unshift($statusHeader, (string) $statusCode); + + return $response->withHeader(self::HISTORY_HEADER, $historyHeader) + ->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader); + } + ); + } + + /** + * Check for too many redirects + * + * @throws TooManyRedirectsException Too many redirects. + */ + private function guardMax(RequestInterface $request, ResponseInterface $response, array &$options): void + { + $current = $options['__redirect_count'] + ?? 0; + $options['__redirect_count'] = $current + 1; + $max = $options['allow_redirects']['max']; + + if ($options['__redirect_count'] > $max) { + throw new TooManyRedirectsException("Will not follow more than {$max} redirects", $request, $response); + } + } + + public function modifyRequest(RequestInterface $request, array $options, ResponseInterface $response): RequestInterface + { + // Request modifications to apply. + $modify = []; + $protocols = $options['allow_redirects']['protocols']; + + // Use a GET request if this is an entity enclosing request and we are + // not forcing RFC compliance, but rather emulating what all browsers + // would do. + $statusCode = $response->getStatusCode(); + if ($statusCode == 303 || + ($statusCode <= 302 && !$options['allow_redirects']['strict']) + ) { + $safeMethods = ['GET', 'HEAD', 'OPTIONS']; + $requestMethod = $request->getMethod(); + + $modify['method'] = in_array($requestMethod, $safeMethods) ? $requestMethod : 'GET'; + $modify['body'] = ''; + } + + $uri = $this->redirectUri($request, $response, $protocols); + if (isset($options['idn_conversion']) && ($options['idn_conversion'] !== false)) { + $idnOptions = ($options['idn_conversion'] === true) ? \IDNA_DEFAULT : $options['idn_conversion']; + $uri = Utils::idnUriConvert($uri, $idnOptions); + } + + $modify['uri'] = $uri; + Psr7\Message::rewindBody($request); + + // Add the Referer header if it is told to do so and only + // add the header if we are not redirecting from https to http. + if ($options['allow_redirects']['referer'] + && $modify['uri']->getScheme() === $request->getUri()->getScheme() + ) { + $uri = $request->getUri()->withUserInfo(''); + $modify['set_headers']['Referer'] = (string) $uri; + } else { + $modify['remove_headers'][] = 'Referer'; + } + + // Remove Authorization header if host is different. + if ($request->getUri()->getHost() !== $modify['uri']->getHost()) { + $modify['remove_headers'][] = 'Authorization'; + } + + return Psr7\Utils::modifyRequest($request, $modify); + } + + /** + * Set the appropriate URL on the request based on the location header + */ + private function redirectUri(RequestInterface $request, ResponseInterface $response, array $protocols): UriInterface + { + $location = Psr7\UriResolver::resolve( + $request->getUri(), + new Psr7\Uri($response->getHeaderLine('Location')) + ); + + // Ensure that the redirect URI is allowed based on the protocols. + if (!\in_array($location->getScheme(), $protocols)) { + throw new BadResponseException(\sprintf('Redirect URI, %s, does not use one of the allowed redirect protocols: %s', $location, \implode(', ', $protocols)), $request, $response); + } + + return $location; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/RequestOptions.php b/vendor/guzzlehttp/guzzle/src/RequestOptions.php new file mode 100644 index 00000000..20b31bc2 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/RequestOptions.php @@ -0,0 +1,264 @@ +decider = $decider; + $this->nextHandler = $nextHandler; + $this->delay = $delay ?: __CLASS__ . '::exponentialDelay'; + } + + /** + * Default exponential backoff delay function. + * + * @return int milliseconds. + */ + public static function exponentialDelay(int $retries): int + { + return (int) \pow(2, $retries - 1) * 1000; + } + + public function __invoke(RequestInterface $request, array $options): PromiseInterface + { + if (!isset($options['retries'])) { + $options['retries'] = 0; + } + + $fn = $this->nextHandler; + return $fn($request, $options) + ->then( + $this->onFulfilled($request, $options), + $this->onRejected($request, $options) + ); + } + + /** + * Execute fulfilled closure + */ + private function onFulfilled(RequestInterface $request, array $options): callable + { + return function ($value) use ($request, $options) { + if (!($this->decider)( + $options['retries'], + $request, + $value, + null + )) { + return $value; + } + return $this->doRetry($request, $options, $value); + }; + } + + /** + * Execute rejected closure + */ + private function onRejected(RequestInterface $req, array $options): callable + { + return function ($reason) use ($req, $options) { + if (!($this->decider)( + $options['retries'], + $req, + null, + $reason + )) { + return P\Create::rejectionFor($reason); + } + return $this->doRetry($req, $options); + }; + } + + private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null): PromiseInterface + { + $options['delay'] = ($this->delay)(++$options['retries'], $response); + + return $this($request, $options); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/TransferStats.php b/vendor/guzzlehttp/guzzle/src/TransferStats.php new file mode 100644 index 00000000..93fa334c --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/TransferStats.php @@ -0,0 +1,133 @@ +request = $request; + $this->response = $response; + $this->transferTime = $transferTime; + $this->handlerErrorData = $handlerErrorData; + $this->handlerStats = $handlerStats; + } + + public function getRequest(): RequestInterface + { + return $this->request; + } + + /** + * Returns the response that was received (if any). + */ + public function getResponse(): ?ResponseInterface + { + return $this->response; + } + + /** + * Returns true if a response was received. + */ + public function hasResponse(): bool + { + return $this->response !== null; + } + + /** + * Gets handler specific error data. + * + * This might be an exception, a integer representing an error code, or + * anything else. Relying on this value assumes that you know what handler + * you are using. + * + * @return mixed + */ + public function getHandlerErrorData() + { + return $this->handlerErrorData; + } + + /** + * Get the effective URI the request was sent to. + */ + public function getEffectiveUri(): UriInterface + { + return $this->request->getUri(); + } + + /** + * Get the estimated time the request was being transferred by the handler. + * + * @return float|null Time in seconds. + */ + public function getTransferTime(): ?float + { + return $this->transferTime; + } + + /** + * Gets an array of all of the handler specific transfer data. + */ + public function getHandlerStats(): array + { + return $this->handlerStats; + } + + /** + * Get a specific handler statistic from the handler by name. + * + * @param string $stat Handler specific transfer stat to retrieve. + * + * @return mixed|null + */ + public function getHandlerStat(string $stat) + { + return $this->handlerStats[$stat] ?? null; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Utils.php b/vendor/guzzlehttp/guzzle/src/Utils.php new file mode 100644 index 00000000..91591da2 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Utils.php @@ -0,0 +1,382 @@ +getHost()) { + $asciiHost = self::idnToAsci($uri->getHost(), $options, $info); + if ($asciiHost === false) { + $errorBitSet = $info['errors'] ?? 0; + + $errorConstants = array_filter(array_keys(get_defined_constants()), static function (string $name): bool { + return substr($name, 0, 11) === 'IDNA_ERROR_'; + }); + + $errors = []; + foreach ($errorConstants as $errorConstant) { + if ($errorBitSet & constant($errorConstant)) { + $errors[] = $errorConstant; + } + } + + $errorMessage = 'IDN conversion failed'; + if ($errors) { + $errorMessage .= ' (errors: ' . implode(', ', $errors) . ')'; + } + + throw new InvalidArgumentException($errorMessage); + } + if ($uri->getHost() !== $asciiHost) { + // Replace URI only if the ASCII version is different + $uri = $uri->withHost($asciiHost); + } + } + + return $uri; + } + + /** + * @internal + */ + public static function getenv(string $name): ?string + { + if (isset($_SERVER[$name])) { + return (string) $_SERVER[$name]; + } + + if (\PHP_SAPI === 'cli' && ($value = \getenv($name)) !== false && $value !== null) { + return (string) $value; + } + + return null; + } + + /** + * @return string|false + */ + private static function idnToAsci(string $domain, int $options, ?array &$info = []) + { + if (\function_exists('idn_to_ascii') && \defined('INTL_IDNA_VARIANT_UTS46')) { + return \idn_to_ascii($domain, $options, \INTL_IDNA_VARIANT_UTS46, $info); + } + + throw new \Error('ext-idn or symfony/polyfill-intl-idn not loaded or too old'); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/functions.php b/vendor/guzzlehttp/guzzle/src/functions.php new file mode 100644 index 00000000..a70d2cbf --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/functions.php @@ -0,0 +1,167 @@ + +Copyright (c) 2015 Graham Campbell +Copyright (c) 2017 Tobias Schultze +Copyright (c) 2020 Tobias Nyholm + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/guzzlehttp/promises/Makefile b/vendor/guzzlehttp/promises/Makefile new file mode 100644 index 00000000..8d5b3ef9 --- /dev/null +++ b/vendor/guzzlehttp/promises/Makefile @@ -0,0 +1,13 @@ +all: clean test + +test: + vendor/bin/phpunit + +coverage: + vendor/bin/phpunit --coverage-html=artifacts/coverage + +view-coverage: + open artifacts/coverage/index.html + +clean: + rm -rf artifacts/* diff --git a/vendor/guzzlehttp/promises/README.md b/vendor/guzzlehttp/promises/README.md new file mode 100644 index 00000000..c175fec7 --- /dev/null +++ b/vendor/guzzlehttp/promises/README.md @@ -0,0 +1,547 @@ +# Guzzle Promises + +[Promises/A+](https://promisesaplus.com/) implementation that handles promise +chaining and resolution iteratively, allowing for "infinite" promise chaining +while keeping the stack size constant. Read [this blog post](https://blog.domenic.me/youre-missing-the-point-of-promises/) +for a general introduction to promises. + +- [Features](#features) +- [Quick start](#quick-start) +- [Synchronous wait](#synchronous-wait) +- [Cancellation](#cancellation) +- [API](#api) + - [Promise](#promise) + - [FulfilledPromise](#fulfilledpromise) + - [RejectedPromise](#rejectedpromise) +- [Promise interop](#promise-interop) +- [Implementation notes](#implementation-notes) + + +# Features + +- [Promises/A+](https://promisesaplus.com/) implementation. +- Promise resolution and chaining is handled iteratively, allowing for + "infinite" promise chaining. +- Promises have a synchronous `wait` method. +- Promises can be cancelled. +- Works with any object that has a `then` function. +- C# style async/await coroutine promises using + `GuzzleHttp\Promise\Coroutine::of()`. + + +# Quick start + +A *promise* represents the eventual result of an asynchronous operation. The +primary way of interacting with a promise is through its `then` method, which +registers callbacks to receive either a promise's eventual value or the reason +why the promise cannot be fulfilled. + + +## Callbacks + +Callbacks are registered with the `then` method by providing an optional +`$onFulfilled` followed by an optional `$onRejected` function. + + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise->then( + // $onFulfilled + function ($value) { + echo 'The promise was fulfilled.'; + }, + // $onRejected + function ($reason) { + echo 'The promise was rejected.'; + } +); +``` + +*Resolving* a promise means that you either fulfill a promise with a *value* or +reject a promise with a *reason*. Resolving a promises triggers callbacks +registered with the promises's `then` method. These callbacks are triggered +only once and in the order in which they were added. + + +## Resolving a promise + +Promises are fulfilled using the `resolve($value)` method. Resolving a promise +with any value other than a `GuzzleHttp\Promise\RejectedPromise` will trigger +all of the onFulfilled callbacks (resolving a promise with a rejected promise +will reject the promise and trigger the `$onRejected` callbacks). + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise + ->then(function ($value) { + // Return a value and don't break the chain + return "Hello, " . $value; + }) + // This then is executed after the first then and receives the value + // returned from the first then. + ->then(function ($value) { + echo $value; + }); + +// Resolving the promise triggers the $onFulfilled callbacks and outputs +// "Hello, reader." +$promise->resolve('reader.'); +``` + + +## Promise forwarding + +Promises can be chained one after the other. Each then in the chain is a new +promise. The return value of a promise is what's forwarded to the next +promise in the chain. Returning a promise in a `then` callback will cause the +subsequent promises in the chain to only be fulfilled when the returned promise +has been fulfilled. The next promise in the chain will be invoked with the +resolved value of the promise. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$nextPromise = new Promise(); + +$promise + ->then(function ($value) use ($nextPromise) { + echo $value; + return $nextPromise; + }) + ->then(function ($value) { + echo $value; + }); + +// Triggers the first callback and outputs "A" +$promise->resolve('A'); +// Triggers the second callback and outputs "B" +$nextPromise->resolve('B'); +``` + +## Promise rejection + +When a promise is rejected, the `$onRejected` callbacks are invoked with the +rejection reason. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise->then(null, function ($reason) { + echo $reason; +}); + +$promise->reject('Error!'); +// Outputs "Error!" +``` + +## Rejection forwarding + +If an exception is thrown in an `$onRejected` callback, subsequent +`$onRejected` callbacks are invoked with the thrown exception as the reason. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise->then(null, function ($reason) { + throw new Exception($reason); +})->then(null, function ($reason) { + assert($reason->getMessage() === 'Error!'); +}); + +$promise->reject('Error!'); +``` + +You can also forward a rejection down the promise chain by returning a +`GuzzleHttp\Promise\RejectedPromise` in either an `$onFulfilled` or +`$onRejected` callback. + +```php +use GuzzleHttp\Promise\Promise; +use GuzzleHttp\Promise\RejectedPromise; + +$promise = new Promise(); +$promise->then(null, function ($reason) { + return new RejectedPromise($reason); +})->then(null, function ($reason) { + assert($reason === 'Error!'); +}); + +$promise->reject('Error!'); +``` + +If an exception is not thrown in a `$onRejected` callback and the callback +does not return a rejected promise, downstream `$onFulfilled` callbacks are +invoked using the value returned from the `$onRejected` callback. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise + ->then(null, function ($reason) { + return "It's ok"; + }) + ->then(function ($value) { + assert($value === "It's ok"); + }); + +$promise->reject('Error!'); +``` + +# Synchronous wait + +You can synchronously force promises to complete using a promise's `wait` +method. When creating a promise, you can provide a wait function that is used +to synchronously force a promise to complete. When a wait function is invoked +it is expected to deliver a value to the promise or reject the promise. If the +wait function does not deliver a value, then an exception is thrown. The wait +function provided to a promise constructor is invoked when the `wait` function +of the promise is called. + +```php +$promise = new Promise(function () use (&$promise) { + $promise->resolve('foo'); +}); + +// Calling wait will return the value of the promise. +echo $promise->wait(); // outputs "foo" +``` + +If an exception is encountered while invoking the wait function of a promise, +the promise is rejected with the exception and the exception is thrown. + +```php +$promise = new Promise(function () use (&$promise) { + throw new Exception('foo'); +}); + +$promise->wait(); // throws the exception. +``` + +Calling `wait` on a promise that has been fulfilled will not trigger the wait +function. It will simply return the previously resolved value. + +```php +$promise = new Promise(function () { die('this is not called!'); }); +$promise->resolve('foo'); +echo $promise->wait(); // outputs "foo" +``` + +Calling `wait` on a promise that has been rejected will throw an exception. If +the rejection reason is an instance of `\Exception` the reason is thrown. +Otherwise, a `GuzzleHttp\Promise\RejectionException` is thrown and the reason +can be obtained by calling the `getReason` method of the exception. + +```php +$promise = new Promise(); +$promise->reject('foo'); +$promise->wait(); +``` + +> PHP Fatal error: Uncaught exception 'GuzzleHttp\Promise\RejectionException' with message 'The promise was rejected with value: foo' + + +## Unwrapping a promise + +When synchronously waiting on a promise, you are joining the state of the +promise into the current state of execution (i.e., return the value of the +promise if it was fulfilled or throw an exception if it was rejected). This is +called "unwrapping" the promise. Waiting on a promise will by default unwrap +the promise state. + +You can force a promise to resolve and *not* unwrap the state of the promise +by passing `false` to the first argument of the `wait` function: + +```php +$promise = new Promise(); +$promise->reject('foo'); +// This will not throw an exception. It simply ensures the promise has +// been resolved. +$promise->wait(false); +``` + +When unwrapping a promise, the resolved value of the promise will be waited +upon until the unwrapped value is not a promise. This means that if you resolve +promise A with a promise B and unwrap promise A, the value returned by the +wait function will be the value delivered to promise B. + +**Note**: when you do not unwrap the promise, no value is returned. + + +# Cancellation + +You can cancel a promise that has not yet been fulfilled using the `cancel()` +method of a promise. When creating a promise you can provide an optional +cancel function that when invoked cancels the action of computing a resolution +of the promise. + + +# API + + +## Promise + +When creating a promise object, you can provide an optional `$waitFn` and +`$cancelFn`. `$waitFn` is a function that is invoked with no arguments and is +expected to resolve the promise. `$cancelFn` is a function with no arguments +that is expected to cancel the computation of a promise. It is invoked when the +`cancel()` method of a promise is called. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise( + function () use (&$promise) { + $promise->resolve('waited'); + }, + function () { + // do something that will cancel the promise computation (e.g., close + // a socket, cancel a database query, etc...) + } +); + +assert('waited' === $promise->wait()); +``` + +A promise has the following methods: + +- `then(callable $onFulfilled, callable $onRejected) : PromiseInterface` + + Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler. + +- `otherwise(callable $onRejected) : PromiseInterface` + + Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled. + +- `wait($unwrap = true) : mixed` + + Synchronously waits on the promise to complete. + + `$unwrap` controls whether or not the value of the promise is returned for a + fulfilled promise or if an exception is thrown if the promise is rejected. + This is set to `true` by default. + +- `cancel()` + + Attempts to cancel the promise if possible. The promise being cancelled and + the parent most ancestor that has not yet been resolved will also be + cancelled. Any promises waiting on the cancelled promise to resolve will also + be cancelled. + +- `getState() : string` + + Returns the state of the promise. One of `pending`, `fulfilled`, or + `rejected`. + +- `resolve($value)` + + Fulfills the promise with the given `$value`. + +- `reject($reason)` + + Rejects the promise with the given `$reason`. + + +## FulfilledPromise + +A fulfilled promise can be created to represent a promise that has been +fulfilled. + +```php +use GuzzleHttp\Promise\FulfilledPromise; + +$promise = new FulfilledPromise('value'); + +// Fulfilled callbacks are immediately invoked. +$promise->then(function ($value) { + echo $value; +}); +``` + + +## RejectedPromise + +A rejected promise can be created to represent a promise that has been +rejected. + +```php +use GuzzleHttp\Promise\RejectedPromise; + +$promise = new RejectedPromise('Error'); + +// Rejected callbacks are immediately invoked. +$promise->then(null, function ($reason) { + echo $reason; +}); +``` + + +# Promise interop + +This library works with foreign promises that have a `then` method. This means +you can use Guzzle promises with [React promises](https://github.com/reactphp/promise) +for example. When a foreign promise is returned inside of a then method +callback, promise resolution will occur recursively. + +```php +// Create a React promise +$deferred = new React\Promise\Deferred(); +$reactPromise = $deferred->promise(); + +// Create a Guzzle promise that is fulfilled with a React promise. +$guzzlePromise = new GuzzleHttp\Promise\Promise(); +$guzzlePromise->then(function ($value) use ($reactPromise) { + // Do something something with the value... + // Return the React promise + return $reactPromise; +}); +``` + +Please note that wait and cancel chaining is no longer possible when forwarding +a foreign promise. You will need to wrap a third-party promise with a Guzzle +promise in order to utilize wait and cancel functions with foreign promises. + + +## Event Loop Integration + +In order to keep the stack size constant, Guzzle promises are resolved +asynchronously using a task queue. When waiting on promises synchronously, the +task queue will be automatically run to ensure that the blocking promise and +any forwarded promises are resolved. When using promises asynchronously in an +event loop, you will need to run the task queue on each tick of the loop. If +you do not run the task queue, then promises will not be resolved. + +You can run the task queue using the `run()` method of the global task queue +instance. + +```php +// Get the global task queue +$queue = GuzzleHttp\Promise\Utils::queue(); +$queue->run(); +``` + +For example, you could use Guzzle promises with React using a periodic timer: + +```php +$loop = React\EventLoop\Factory::create(); +$loop->addPeriodicTimer(0, [$queue, 'run']); +``` + +*TODO*: Perhaps adding a `futureTick()` on each tick would be faster? + + +# Implementation notes + + +## Promise resolution and chaining is handled iteratively + +By shuffling pending handlers from one owner to another, promises are +resolved iteratively, allowing for "infinite" then chaining. + +```php +then(function ($v) { + // The stack size remains constant (a good thing) + echo xdebug_get_stack_depth() . ', '; + return $v + 1; + }); +} + +$parent->resolve(0); +var_dump($p->wait()); // int(1000) + +``` + +When a promise is fulfilled or rejected with a non-promise value, the promise +then takes ownership of the handlers of each child promise and delivers values +down the chain without using recursion. + +When a promise is resolved with another promise, the original promise transfers +all of its pending handlers to the new promise. When the new promise is +eventually resolved, all of the pending handlers are delivered the forwarded +value. + + +## A promise is the deferred. + +Some promise libraries implement promises using a deferred object to represent +a computation and a promise object to represent the delivery of the result of +the computation. This is a nice separation of computation and delivery because +consumers of the promise cannot modify the value that will be eventually +delivered. + +One side effect of being able to implement promise resolution and chaining +iteratively is that you need to be able for one promise to reach into the state +of another promise to shuffle around ownership of handlers. In order to achieve +this without making the handlers of a promise publicly mutable, a promise is +also the deferred value, allowing promises of the same parent class to reach +into and modify the private properties of promises of the same type. While this +does allow consumers of the value to modify the resolution or rejection of the +deferred, it is a small price to pay for keeping the stack size constant. + +```php +$promise = new Promise(); +$promise->then(function ($value) { echo $value; }); +// The promise is the deferred value, so you can deliver a value to it. +$promise->resolve('foo'); +// prints "foo" +``` + + +## Upgrading from Function API + +A static API was first introduced in 1.4.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API will be removed in 2.0.0. A migration table has been provided here for your convenience: + +| Original Function | Replacement Method | +|----------------|----------------| +| `queue` | `Utils::queue` | +| `task` | `Utils::task` | +| `promise_for` | `Create::promiseFor` | +| `rejection_for` | `Create::rejectionFor` | +| `exception_for` | `Create::exceptionFor` | +| `iter_for` | `Create::iterFor` | +| `inspect` | `Utils::inspect` | +| `inspect_all` | `Utils::inspectAll` | +| `unwrap` | `Utils::unwrap` | +| `all` | `Utils::all` | +| `some` | `Utils::some` | +| `any` | `Utils::any` | +| `settle` | `Utils::settle` | +| `each` | `Each::of` | +| `each_limit` | `Each::ofLimit` | +| `each_limit_all` | `Each::ofLimitAll` | +| `!is_fulfilled` | `Is::pending` | +| `is_fulfilled` | `Is::fulfilled` | +| `is_rejected` | `Is::rejected` | +| `is_settled` | `Is::settled` | +| `coroutine` | `Coroutine::of` | + + +## Security + +If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/promises/security/policy) for more information. + +## License + +Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. + +## For Enterprise + +Available as part of the Tidelift Subscription + +The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-promises?utm_source=packagist-guzzlehttp-promises&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/vendor/guzzlehttp/promises/composer.json b/vendor/guzzlehttp/promises/composer.json new file mode 100644 index 00000000..c959fb32 --- /dev/null +++ b/vendor/guzzlehttp/promises/composer.json @@ -0,0 +1,58 @@ +{ + "name": "guzzlehttp/promises", + "description": "Guzzle promises library", + "keywords": ["promise"], + "license": "MIT", + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": ["src/functions_include.php"] + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Promise\\Tests\\": "tests/" + } + }, + "scripts": { + "test": "vendor/bin/simple-phpunit", + "test-ci": "vendor/bin/simple-phpunit --coverage-text" + }, + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "config": { + "preferred-install": "dist", + "sort-packages": true + } +} diff --git a/vendor/guzzlehttp/promises/src/AggregateException.php b/vendor/guzzlehttp/promises/src/AggregateException.php new file mode 100644 index 00000000..d2b5712b --- /dev/null +++ b/vendor/guzzlehttp/promises/src/AggregateException.php @@ -0,0 +1,17 @@ +then(function ($v) { echo $v; }); + * + * @param callable $generatorFn Generator function to wrap into a promise. + * + * @return Promise + * + * @link https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration + */ +final class Coroutine implements PromiseInterface +{ + /** + * @var PromiseInterface|null + */ + private $currentPromise; + + /** + * @var Generator + */ + private $generator; + + /** + * @var Promise + */ + private $result; + + public function __construct(callable $generatorFn) + { + $this->generator = $generatorFn(); + $this->result = new Promise(function () { + while (isset($this->currentPromise)) { + $this->currentPromise->wait(); + } + }); + try { + $this->nextCoroutine($this->generator->current()); + } catch (\Exception $exception) { + $this->result->reject($exception); + } catch (Throwable $throwable) { + $this->result->reject($throwable); + } + } + + /** + * Create a new coroutine. + * + * @return self + */ + public static function of(callable $generatorFn) + { + return new self($generatorFn); + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + return $this->result->then($onFulfilled, $onRejected); + } + + public function otherwise(callable $onRejected) + { + return $this->result->otherwise($onRejected); + } + + public function wait($unwrap = true) + { + return $this->result->wait($unwrap); + } + + public function getState() + { + return $this->result->getState(); + } + + public function resolve($value) + { + $this->result->resolve($value); + } + + public function reject($reason) + { + $this->result->reject($reason); + } + + public function cancel() + { + $this->currentPromise->cancel(); + $this->result->cancel(); + } + + private function nextCoroutine($yielded) + { + $this->currentPromise = Create::promiseFor($yielded) + ->then([$this, '_handleSuccess'], [$this, '_handleFailure']); + } + + /** + * @internal + */ + public function _handleSuccess($value) + { + unset($this->currentPromise); + try { + $next = $this->generator->send($value); + if ($this->generator->valid()) { + $this->nextCoroutine($next); + } else { + $this->result->resolve($value); + } + } catch (Exception $exception) { + $this->result->reject($exception); + } catch (Throwable $throwable) { + $this->result->reject($throwable); + } + } + + /** + * @internal + */ + public function _handleFailure($reason) + { + unset($this->currentPromise); + try { + $nextYield = $this->generator->throw(Create::exceptionFor($reason)); + // The throw was caught, so keep iterating on the coroutine + $this->nextCoroutine($nextYield); + } catch (Exception $exception) { + $this->result->reject($exception); + } catch (Throwable $throwable) { + $this->result->reject($throwable); + } + } +} diff --git a/vendor/guzzlehttp/promises/src/Create.php b/vendor/guzzlehttp/promises/src/Create.php new file mode 100644 index 00000000..8d038e9c --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Create.php @@ -0,0 +1,84 @@ +then([$promise, 'resolve'], [$promise, 'reject']); + return $promise; + } + + return new FulfilledPromise($value); + } + + /** + * Creates a rejected promise for a reason if the reason is not a promise. + * If the provided reason is a promise, then it is returned as-is. + * + * @param mixed $reason Promise or reason. + * + * @return PromiseInterface + */ + public static function rejectionFor($reason) + { + if ($reason instanceof PromiseInterface) { + return $reason; + } + + return new RejectedPromise($reason); + } + + /** + * Create an exception for a rejected promise value. + * + * @param mixed $reason + * + * @return \Exception|\Throwable + */ + public static function exceptionFor($reason) + { + if ($reason instanceof \Exception || $reason instanceof \Throwable) { + return $reason; + } + + return new RejectionException($reason); + } + + /** + * Returns an iterator for the given value. + * + * @param mixed $value + * + * @return \Iterator + */ + public static function iterFor($value) + { + if ($value instanceof \Iterator) { + return $value; + } + + if (is_array($value)) { + return new \ArrayIterator($value); + } + + return new \ArrayIterator([$value]); + } +} diff --git a/vendor/guzzlehttp/promises/src/Each.php b/vendor/guzzlehttp/promises/src/Each.php new file mode 100644 index 00000000..1dda3549 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Each.php @@ -0,0 +1,90 @@ + $onFulfilled, + 'rejected' => $onRejected + ]))->promise(); + } + + /** + * Like of, but only allows a certain number of outstanding promises at any + * given time. + * + * $concurrency may be an integer or a function that accepts the number of + * pending promises and returns a numeric concurrency limit value to allow + * for dynamic a concurrency size. + * + * @param mixed $iterable + * @param int|callable $concurrency + * @param callable $onFulfilled + * @param callable $onRejected + * + * @return PromiseInterface + */ + public static function ofLimit( + $iterable, + $concurrency, + callable $onFulfilled = null, + callable $onRejected = null + ) { + return (new EachPromise($iterable, [ + 'fulfilled' => $onFulfilled, + 'rejected' => $onRejected, + 'concurrency' => $concurrency + ]))->promise(); + } + + /** + * Like limit, but ensures that no promise in the given $iterable argument + * is rejected. If any promise is rejected, then the aggregate promise is + * rejected with the encountered rejection. + * + * @param mixed $iterable + * @param int|callable $concurrency + * @param callable $onFulfilled + * + * @return PromiseInterface + */ + public static function ofLimitAll( + $iterable, + $concurrency, + callable $onFulfilled = null + ) { + return each_limit( + $iterable, + $concurrency, + $onFulfilled, + function ($reason, $idx, PromiseInterface $aggregate) { + $aggregate->reject($reason); + } + ); + } +} diff --git a/vendor/guzzlehttp/promises/src/EachPromise.php b/vendor/guzzlehttp/promises/src/EachPromise.php new file mode 100644 index 00000000..38ecb59b --- /dev/null +++ b/vendor/guzzlehttp/promises/src/EachPromise.php @@ -0,0 +1,255 @@ +iterable = Create::iterFor($iterable); + + if (isset($config['concurrency'])) { + $this->concurrency = $config['concurrency']; + } + + if (isset($config['fulfilled'])) { + $this->onFulfilled = $config['fulfilled']; + } + + if (isset($config['rejected'])) { + $this->onRejected = $config['rejected']; + } + } + + /** @psalm-suppress InvalidNullableReturnType */ + public function promise() + { + if ($this->aggregate) { + return $this->aggregate; + } + + try { + $this->createPromise(); + /** @psalm-assert Promise $this->aggregate */ + $this->iterable->rewind(); + $this->refillPending(); + } catch (\Throwable $e) { + /** + * @psalm-suppress NullReference + * @phpstan-ignore-next-line + */ + $this->aggregate->reject($e); + } catch (\Exception $e) { + /** + * @psalm-suppress NullReference + * @phpstan-ignore-next-line + */ + $this->aggregate->reject($e); + } + + /** + * @psalm-suppress NullableReturnStatement + * @phpstan-ignore-next-line + */ + return $this->aggregate; + } + + private function createPromise() + { + $this->mutex = false; + $this->aggregate = new Promise(function () { + if ($this->checkIfFinished()) { + return; + } + reset($this->pending); + // Consume a potentially fluctuating list of promises while + // ensuring that indexes are maintained (precluding array_shift). + while ($promise = current($this->pending)) { + next($this->pending); + $promise->wait(); + if (Is::settled($this->aggregate)) { + return; + } + } + }); + + // Clear the references when the promise is resolved. + $clearFn = function () { + $this->iterable = $this->concurrency = $this->pending = null; + $this->onFulfilled = $this->onRejected = null; + $this->nextPendingIndex = 0; + }; + + $this->aggregate->then($clearFn, $clearFn); + } + + private function refillPending() + { + if (!$this->concurrency) { + // Add all pending promises. + while ($this->addPending() && $this->advanceIterator()); + return; + } + + // Add only up to N pending promises. + $concurrency = is_callable($this->concurrency) + ? call_user_func($this->concurrency, count($this->pending)) + : $this->concurrency; + $concurrency = max($concurrency - count($this->pending), 0); + // Concurrency may be set to 0 to disallow new promises. + if (!$concurrency) { + return; + } + // Add the first pending promise. + $this->addPending(); + // Note this is special handling for concurrency=1 so that we do + // not advance the iterator after adding the first promise. This + // helps work around issues with generators that might not have the + // next value to yield until promise callbacks are called. + while (--$concurrency + && $this->advanceIterator() + && $this->addPending()); + } + + private function addPending() + { + if (!$this->iterable || !$this->iterable->valid()) { + return false; + } + + $promise = Create::promiseFor($this->iterable->current()); + $key = $this->iterable->key(); + + // Iterable keys may not be unique, so we use a counter to + // guarantee uniqueness + $idx = $this->nextPendingIndex++; + + $this->pending[$idx] = $promise->then( + function ($value) use ($idx, $key) { + if ($this->onFulfilled) { + call_user_func( + $this->onFulfilled, + $value, + $key, + $this->aggregate + ); + } + $this->step($idx); + }, + function ($reason) use ($idx, $key) { + if ($this->onRejected) { + call_user_func( + $this->onRejected, + $reason, + $key, + $this->aggregate + ); + } + $this->step($idx); + } + ); + + return true; + } + + private function advanceIterator() + { + // Place a lock on the iterator so that we ensure to not recurse, + // preventing fatal generator errors. + if ($this->mutex) { + return false; + } + + $this->mutex = true; + + try { + $this->iterable->next(); + $this->mutex = false; + return true; + } catch (\Throwable $e) { + $this->aggregate->reject($e); + $this->mutex = false; + return false; + } catch (\Exception $e) { + $this->aggregate->reject($e); + $this->mutex = false; + return false; + } + } + + private function step($idx) + { + // If the promise was already resolved, then ignore this step. + if (Is::settled($this->aggregate)) { + return; + } + + unset($this->pending[$idx]); + + // Only refill pending promises if we are not locked, preventing the + // EachPromise to recursively invoke the provided iterator, which + // cause a fatal error: "Cannot resume an already running generator" + if ($this->advanceIterator() && !$this->checkIfFinished()) { + // Add more pending promises if possible. + $this->refillPending(); + } + } + + private function checkIfFinished() + { + if (!$this->pending && !$this->iterable->valid()) { + // Resolve the promise if there's nothing left to do. + $this->aggregate->resolve(null); + return true; + } + + return false; + } +} diff --git a/vendor/guzzlehttp/promises/src/FulfilledPromise.php b/vendor/guzzlehttp/promises/src/FulfilledPromise.php new file mode 100644 index 00000000..98f72a62 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/FulfilledPromise.php @@ -0,0 +1,84 @@ +value = $value; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + // Return itself if there is no onFulfilled function. + if (!$onFulfilled) { + return $this; + } + + $queue = Utils::queue(); + $p = new Promise([$queue, 'run']); + $value = $this->value; + $queue->add(static function () use ($p, $value, $onFulfilled) { + if (Is::pending($p)) { + try { + $p->resolve($onFulfilled($value)); + } catch (\Throwable $e) { + $p->reject($e); + } catch (\Exception $e) { + $p->reject($e); + } + } + }); + + return $p; + } + + public function otherwise(callable $onRejected) + { + return $this->then(null, $onRejected); + } + + public function wait($unwrap = true, $defaultDelivery = null) + { + return $unwrap ? $this->value : null; + } + + public function getState() + { + return self::FULFILLED; + } + + public function resolve($value) + { + if ($value !== $this->value) { + throw new \LogicException("Cannot resolve a fulfilled promise"); + } + } + + public function reject($reason) + { + throw new \LogicException("Cannot reject a fulfilled promise"); + } + + public function cancel() + { + // pass + } +} diff --git a/vendor/guzzlehttp/promises/src/Is.php b/vendor/guzzlehttp/promises/src/Is.php new file mode 100644 index 00000000..c3ed8d01 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Is.php @@ -0,0 +1,46 @@ +getState() === PromiseInterface::PENDING; + } + + /** + * Returns true if a promise is fulfilled or rejected. + * + * @return bool + */ + public static function settled(PromiseInterface $promise) + { + return $promise->getState() !== PromiseInterface::PENDING; + } + + /** + * Returns true if a promise is fulfilled. + * + * @return bool + */ + public static function fulfilled(PromiseInterface $promise) + { + return $promise->getState() === PromiseInterface::FULFILLED; + } + + /** + * Returns true if a promise is rejected. + * + * @return bool + */ + public static function rejected(PromiseInterface $promise) + { + return $promise->getState() === PromiseInterface::REJECTED; + } +} diff --git a/vendor/guzzlehttp/promises/src/Promise.php b/vendor/guzzlehttp/promises/src/Promise.php new file mode 100644 index 00000000..75939057 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Promise.php @@ -0,0 +1,278 @@ +waitFn = $waitFn; + $this->cancelFn = $cancelFn; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + if ($this->state === self::PENDING) { + $p = new Promise(null, [$this, 'cancel']); + $this->handlers[] = [$p, $onFulfilled, $onRejected]; + $p->waitList = $this->waitList; + $p->waitList[] = $this; + return $p; + } + + // Return a fulfilled promise and immediately invoke any callbacks. + if ($this->state === self::FULFILLED) { + $promise = Create::promiseFor($this->result); + return $onFulfilled ? $promise->then($onFulfilled) : $promise; + } + + // It's either cancelled or rejected, so return a rejected promise + // and immediately invoke any callbacks. + $rejection = Create::rejectionFor($this->result); + return $onRejected ? $rejection->then(null, $onRejected) : $rejection; + } + + public function otherwise(callable $onRejected) + { + return $this->then(null, $onRejected); + } + + public function wait($unwrap = true) + { + $this->waitIfPending(); + + if ($this->result instanceof PromiseInterface) { + return $this->result->wait($unwrap); + } + if ($unwrap) { + if ($this->state === self::FULFILLED) { + return $this->result; + } + // It's rejected so "unwrap" and throw an exception. + throw Create::exceptionFor($this->result); + } + } + + public function getState() + { + return $this->state; + } + + public function cancel() + { + if ($this->state !== self::PENDING) { + return; + } + + $this->waitFn = $this->waitList = null; + + if ($this->cancelFn) { + $fn = $this->cancelFn; + $this->cancelFn = null; + try { + $fn(); + } catch (\Throwable $e) { + $this->reject($e); + } catch (\Exception $e) { + $this->reject($e); + } + } + + // Reject the promise only if it wasn't rejected in a then callback. + /** @psalm-suppress RedundantCondition */ + if ($this->state === self::PENDING) { + $this->reject(new CancellationException('Promise has been cancelled')); + } + } + + public function resolve($value) + { + $this->settle(self::FULFILLED, $value); + } + + public function reject($reason) + { + $this->settle(self::REJECTED, $reason); + } + + private function settle($state, $value) + { + if ($this->state !== self::PENDING) { + // Ignore calls with the same resolution. + if ($state === $this->state && $value === $this->result) { + return; + } + throw $this->state === $state + ? new \LogicException("The promise is already {$state}.") + : new \LogicException("Cannot change a {$this->state} promise to {$state}"); + } + + if ($value === $this) { + throw new \LogicException('Cannot fulfill or reject a promise with itself'); + } + + // Clear out the state of the promise but stash the handlers. + $this->state = $state; + $this->result = $value; + $handlers = $this->handlers; + $this->handlers = null; + $this->waitList = $this->waitFn = null; + $this->cancelFn = null; + + if (!$handlers) { + return; + } + + // If the value was not a settled promise or a thenable, then resolve + // it in the task queue using the correct ID. + if (!is_object($value) || !method_exists($value, 'then')) { + $id = $state === self::FULFILLED ? 1 : 2; + // It's a success, so resolve the handlers in the queue. + Utils::queue()->add(static function () use ($id, $value, $handlers) { + foreach ($handlers as $handler) { + self::callHandler($id, $value, $handler); + } + }); + } elseif ($value instanceof Promise && Is::pending($value)) { + // We can just merge our handlers onto the next promise. + $value->handlers = array_merge($value->handlers, $handlers); + } else { + // Resolve the handlers when the forwarded promise is resolved. + $value->then( + static function ($value) use ($handlers) { + foreach ($handlers as $handler) { + self::callHandler(1, $value, $handler); + } + }, + static function ($reason) use ($handlers) { + foreach ($handlers as $handler) { + self::callHandler(2, $reason, $handler); + } + } + ); + } + } + + /** + * Call a stack of handlers using a specific callback index and value. + * + * @param int $index 1 (resolve) or 2 (reject). + * @param mixed $value Value to pass to the callback. + * @param array $handler Array of handler data (promise and callbacks). + */ + private static function callHandler($index, $value, array $handler) + { + /** @var PromiseInterface $promise */ + $promise = $handler[0]; + + // The promise may have been cancelled or resolved before placing + // this thunk in the queue. + if (Is::settled($promise)) { + return; + } + + try { + if (isset($handler[$index])) { + /* + * If $f throws an exception, then $handler will be in the exception + * stack trace. Since $handler contains a reference to the callable + * itself we get a circular reference. We clear the $handler + * here to avoid that memory leak. + */ + $f = $handler[$index]; + unset($handler); + $promise->resolve($f($value)); + } elseif ($index === 1) { + // Forward resolution values as-is. + $promise->resolve($value); + } else { + // Forward rejections down the chain. + $promise->reject($value); + } + } catch (\Throwable $reason) { + $promise->reject($reason); + } catch (\Exception $reason) { + $promise->reject($reason); + } + } + + private function waitIfPending() + { + if ($this->state !== self::PENDING) { + return; + } elseif ($this->waitFn) { + $this->invokeWaitFn(); + } elseif ($this->waitList) { + $this->invokeWaitList(); + } else { + // If there's no wait function, then reject the promise. + $this->reject('Cannot wait on a promise that has ' + . 'no internal wait function. You must provide a wait ' + . 'function when constructing the promise to be able to ' + . 'wait on a promise.'); + } + + Utils::queue()->run(); + + /** @psalm-suppress RedundantCondition */ + if ($this->state === self::PENDING) { + $this->reject('Invoking the wait callback did not resolve the promise'); + } + } + + private function invokeWaitFn() + { + try { + $wfn = $this->waitFn; + $this->waitFn = null; + $wfn(true); + } catch (\Exception $reason) { + if ($this->state === self::PENDING) { + // The promise has not been resolved yet, so reject the promise + // with the exception. + $this->reject($reason); + } else { + // The promise was already resolved, so there's a problem in + // the application. + throw $reason; + } + } + } + + private function invokeWaitList() + { + $waitList = $this->waitList; + $this->waitList = null; + + foreach ($waitList as $result) { + do { + $result->waitIfPending(); + $result = $result->result; + } while ($result instanceof Promise); + + if ($result instanceof PromiseInterface) { + $result->wait(false); + } + } + } +} diff --git a/vendor/guzzlehttp/promises/src/PromiseInterface.php b/vendor/guzzlehttp/promises/src/PromiseInterface.php new file mode 100644 index 00000000..e5983314 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/PromiseInterface.php @@ -0,0 +1,97 @@ +reason = $reason; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + // If there's no onRejected callback then just return self. + if (!$onRejected) { + return $this; + } + + $queue = Utils::queue(); + $reason = $this->reason; + $p = new Promise([$queue, 'run']); + $queue->add(static function () use ($p, $reason, $onRejected) { + if (Is::pending($p)) { + try { + // Return a resolved promise if onRejected does not throw. + $p->resolve($onRejected($reason)); + } catch (\Throwable $e) { + // onRejected threw, so return a rejected promise. + $p->reject($e); + } catch (\Exception $e) { + // onRejected threw, so return a rejected promise. + $p->reject($e); + } + } + }); + + return $p; + } + + public function otherwise(callable $onRejected) + { + return $this->then(null, $onRejected); + } + + public function wait($unwrap = true, $defaultDelivery = null) + { + if ($unwrap) { + throw Create::exceptionFor($this->reason); + } + + return null; + } + + public function getState() + { + return self::REJECTED; + } + + public function resolve($value) + { + throw new \LogicException("Cannot resolve a rejected promise"); + } + + public function reject($reason) + { + if ($reason !== $this->reason) { + throw new \LogicException("Cannot reject a rejected promise"); + } + } + + public function cancel() + { + // pass + } +} diff --git a/vendor/guzzlehttp/promises/src/RejectionException.php b/vendor/guzzlehttp/promises/src/RejectionException.php new file mode 100644 index 00000000..e2f13770 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/RejectionException.php @@ -0,0 +1,48 @@ +reason = $reason; + + $message = 'The promise was rejected'; + + if ($description) { + $message .= ' with reason: ' . $description; + } elseif (is_string($reason) + || (is_object($reason) && method_exists($reason, '__toString')) + ) { + $message .= ' with reason: ' . $this->reason; + } elseif ($reason instanceof \JsonSerializable) { + $message .= ' with reason: ' + . json_encode($this->reason, JSON_PRETTY_PRINT); + } + + parent::__construct($message); + } + + /** + * Returns the rejection reason. + * + * @return mixed + */ + public function getReason() + { + return $this->reason; + } +} diff --git a/vendor/guzzlehttp/promises/src/TaskQueue.php b/vendor/guzzlehttp/promises/src/TaskQueue.php new file mode 100644 index 00000000..f0fba2c5 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/TaskQueue.php @@ -0,0 +1,67 @@ +run(); + */ +class TaskQueue implements TaskQueueInterface +{ + private $enableShutdown = true; + private $queue = []; + + public function __construct($withShutdown = true) + { + if ($withShutdown) { + register_shutdown_function(function () { + if ($this->enableShutdown) { + // Only run the tasks if an E_ERROR didn't occur. + $err = error_get_last(); + if (!$err || ($err['type'] ^ E_ERROR)) { + $this->run(); + } + } + }); + } + } + + public function isEmpty() + { + return !$this->queue; + } + + public function add(callable $task) + { + $this->queue[] = $task; + } + + public function run() + { + while ($task = array_shift($this->queue)) { + /** @var callable $task */ + $task(); + } + } + + /** + * The task queue will be run and exhausted by default when the process + * exits IFF the exit is not the result of a PHP E_ERROR error. + * + * You can disable running the automatic shutdown of the queue by calling + * this function. If you disable the task queue shutdown process, then you + * MUST either run the task queue (as a result of running your event loop + * or manually using the run() method) or wait on each outstanding promise. + * + * Note: This shutdown will occur before any destructors are triggered. + */ + public function disableShutdown() + { + $this->enableShutdown = false; + } +} diff --git a/vendor/guzzlehttp/promises/src/TaskQueueInterface.php b/vendor/guzzlehttp/promises/src/TaskQueueInterface.php new file mode 100644 index 00000000..723d4d54 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/TaskQueueInterface.php @@ -0,0 +1,24 @@ + + * while ($eventLoop->isRunning()) { + * GuzzleHttp\Promise\Utils::queue()->run(); + * } + * + * + * @param TaskQueueInterface $assign Optionally specify a new queue instance. + * + * @return TaskQueueInterface + */ + public static function queue(TaskQueueInterface $assign = null) + { + static $queue; + + if ($assign) { + $queue = $assign; + } elseif (!$queue) { + $queue = new TaskQueue(); + } + + return $queue; + } + + /** + * Adds a function to run in the task queue when it is next `run()` and + * returns a promise that is fulfilled or rejected with the result. + * + * @param callable $task Task function to run. + * + * @return PromiseInterface + */ + public static function task(callable $task) + { + $queue = self::queue(); + $promise = new Promise([$queue, 'run']); + $queue->add(function () use ($task, $promise) { + try { + if (Is::pending($promise)) { + $promise->resolve($task()); + } + } catch (\Throwable $e) { + $promise->reject($e); + } catch (\Exception $e) { + $promise->reject($e); + } + }); + + return $promise; + } + + /** + * Synchronously waits on a promise to resolve and returns an inspection + * state array. + * + * Returns a state associative array containing a "state" key mapping to a + * valid promise state. If the state of the promise is "fulfilled", the + * array will contain a "value" key mapping to the fulfilled value of the + * promise. If the promise is rejected, the array will contain a "reason" + * key mapping to the rejection reason of the promise. + * + * @param PromiseInterface $promise Promise or value. + * + * @return array + */ + public static function inspect(PromiseInterface $promise) + { + try { + return [ + 'state' => PromiseInterface::FULFILLED, + 'value' => $promise->wait() + ]; + } catch (RejectionException $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()]; + } catch (\Throwable $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; + } catch (\Exception $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; + } + } + + /** + * Waits on all of the provided promises, but does not unwrap rejected + * promises as thrown exception. + * + * Returns an array of inspection state arrays. + * + * @see inspect for the inspection state array format. + * + * @param PromiseInterface[] $promises Traversable of promises to wait upon. + * + * @return array + */ + public static function inspectAll($promises) + { + $results = []; + foreach ($promises as $key => $promise) { + $results[$key] = inspect($promise); + } + + return $results; + } + + /** + * Waits on all of the provided promises and returns the fulfilled values. + * + * Returns an array that contains the value of each promise (in the same + * order the promises were provided). An exception is thrown if any of the + * promises are rejected. + * + * @param iterable $promises Iterable of PromiseInterface objects to wait on. + * + * @return array + * + * @throws \Exception on error + * @throws \Throwable on error in PHP >=7 + */ + public static function unwrap($promises) + { + $results = []; + foreach ($promises as $key => $promise) { + $results[$key] = $promise->wait(); + } + + return $results; + } + + /** + * Given an array of promises, return a promise that is fulfilled when all + * the items in the array are fulfilled. + * + * The promise's fulfillment value is an array with fulfillment values at + * respective positions to the original array. If any promise in the array + * rejects, the returned promise is rejected with the rejection reason. + * + * @param mixed $promises Promises or values. + * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution. + * + * @return PromiseInterface + */ + public static function all($promises, $recursive = false) + { + $results = []; + $promise = Each::of( + $promises, + function ($value, $idx) use (&$results) { + $results[$idx] = $value; + }, + function ($reason, $idx, Promise $aggregate) { + $aggregate->reject($reason); + } + )->then(function () use (&$results) { + ksort($results); + return $results; + }); + + if (true === $recursive) { + $promise = $promise->then(function ($results) use ($recursive, &$promises) { + foreach ($promises as $promise) { + if (Is::pending($promise)) { + return self::all($promises, $recursive); + } + } + return $results; + }); + } + + return $promise; + } + + /** + * Initiate a competitive race between multiple promises or values (values + * will become immediately fulfilled promises). + * + * When count amount of promises have been fulfilled, the returned promise + * is fulfilled with an array that contains the fulfillment values of the + * winners in order of resolution. + * + * This promise is rejected with a {@see AggregateException} if the number + * of fulfilled promises is less than the desired $count. + * + * @param int $count Total number of promises. + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + */ + public static function some($count, $promises) + { + $results = []; + $rejections = []; + + return Each::of( + $promises, + function ($value, $idx, PromiseInterface $p) use (&$results, $count) { + if (Is::settled($p)) { + return; + } + $results[$idx] = $value; + if (count($results) >= $count) { + $p->resolve(null); + } + }, + function ($reason) use (&$rejections) { + $rejections[] = $reason; + } + )->then( + function () use (&$results, &$rejections, $count) { + if (count($results) !== $count) { + throw new AggregateException( + 'Not enough promises to fulfill count', + $rejections + ); + } + ksort($results); + return array_values($results); + } + ); + } + + /** + * Like some(), with 1 as count. However, if the promise fulfills, the + * fulfillment value is not an array of 1 but the value directly. + * + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + */ + public static function any($promises) + { + return self::some(1, $promises)->then(function ($values) { + return $values[0]; + }); + } + + /** + * Returns a promise that is fulfilled when all of the provided promises have + * been fulfilled or rejected. + * + * The returned promise is fulfilled with an array of inspection state arrays. + * + * @see inspect for the inspection state array format. + * + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + */ + public static function settle($promises) + { + $results = []; + + return Each::of( + $promises, + function ($value, $idx) use (&$results) { + $results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value]; + }, + function ($reason, $idx) use (&$results) { + $results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason]; + } + )->then(function () use (&$results) { + ksort($results); + return $results; + }); + } +} diff --git a/vendor/guzzlehttp/promises/src/functions.php b/vendor/guzzlehttp/promises/src/functions.php new file mode 100644 index 00000000..c03d39d0 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/functions.php @@ -0,0 +1,363 @@ + + * while ($eventLoop->isRunning()) { + * GuzzleHttp\Promise\queue()->run(); + * } + * + * + * @param TaskQueueInterface $assign Optionally specify a new queue instance. + * + * @return TaskQueueInterface + * + * @deprecated queue will be removed in guzzlehttp/promises:2.0. Use Utils::queue instead. + */ +function queue(TaskQueueInterface $assign = null) +{ + return Utils::queue($assign); +} + +/** + * Adds a function to run in the task queue when it is next `run()` and returns + * a promise that is fulfilled or rejected with the result. + * + * @param callable $task Task function to run. + * + * @return PromiseInterface + * + * @deprecated task will be removed in guzzlehttp/promises:2.0. Use Utils::task instead. + */ +function task(callable $task) +{ + return Utils::task($task); +} + +/** + * Creates a promise for a value if the value is not a promise. + * + * @param mixed $value Promise or value. + * + * @return PromiseInterface + * + * @deprecated promise_for will be removed in guzzlehttp/promises:2.0. Use Create::promiseFor instead. + */ +function promise_for($value) +{ + return Create::promiseFor($value); +} + +/** + * Creates a rejected promise for a reason if the reason is not a promise. If + * the provided reason is a promise, then it is returned as-is. + * + * @param mixed $reason Promise or reason. + * + * @return PromiseInterface + * + * @deprecated rejection_for will be removed in guzzlehttp/promises:2.0. Use Create::rejectionFor instead. + */ +function rejection_for($reason) +{ + return Create::rejectionFor($reason); +} + +/** + * Create an exception for a rejected promise value. + * + * @param mixed $reason + * + * @return \Exception|\Throwable + * + * @deprecated exception_for will be removed in guzzlehttp/promises:2.0. Use Create::exceptionFor instead. + */ +function exception_for($reason) +{ + return Create::exceptionFor($reason); +} + +/** + * Returns an iterator for the given value. + * + * @param mixed $value + * + * @return \Iterator + * + * @deprecated iter_for will be removed in guzzlehttp/promises:2.0. Use Create::iterFor instead. + */ +function iter_for($value) +{ + return Create::iterFor($value); +} + +/** + * Synchronously waits on a promise to resolve and returns an inspection state + * array. + * + * Returns a state associative array containing a "state" key mapping to a + * valid promise state. If the state of the promise is "fulfilled", the array + * will contain a "value" key mapping to the fulfilled value of the promise. If + * the promise is rejected, the array will contain a "reason" key mapping to + * the rejection reason of the promise. + * + * @param PromiseInterface $promise Promise or value. + * + * @return array + * + * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspect instead. + */ +function inspect(PromiseInterface $promise) +{ + return Utils::inspect($promise); +} + +/** + * Waits on all of the provided promises, but does not unwrap rejected promises + * as thrown exception. + * + * Returns an array of inspection state arrays. + * + * @see inspect for the inspection state array format. + * + * @param PromiseInterface[] $promises Traversable of promises to wait upon. + * + * @return array + * + * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspectAll instead. + */ +function inspect_all($promises) +{ + return Utils::inspectAll($promises); +} + +/** + * Waits on all of the provided promises and returns the fulfilled values. + * + * Returns an array that contains the value of each promise (in the same order + * the promises were provided). An exception is thrown if any of the promises + * are rejected. + * + * @param iterable $promises Iterable of PromiseInterface objects to wait on. + * + * @return array + * + * @throws \Exception on error + * @throws \Throwable on error in PHP >=7 + * + * @deprecated unwrap will be removed in guzzlehttp/promises:2.0. Use Utils::unwrap instead. + */ +function unwrap($promises) +{ + return Utils::unwrap($promises); +} + +/** + * Given an array of promises, return a promise that is fulfilled when all the + * items in the array are fulfilled. + * + * The promise's fulfillment value is an array with fulfillment values at + * respective positions to the original array. If any promise in the array + * rejects, the returned promise is rejected with the rejection reason. + * + * @param mixed $promises Promises or values. + * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution. + * + * @return PromiseInterface + * + * @deprecated all will be removed in guzzlehttp/promises:2.0. Use Utils::all instead. + */ +function all($promises, $recursive = false) +{ + return Utils::all($promises, $recursive); +} + +/** + * Initiate a competitive race between multiple promises or values (values will + * become immediately fulfilled promises). + * + * When count amount of promises have been fulfilled, the returned promise is + * fulfilled with an array that contains the fulfillment values of the winners + * in order of resolution. + * + * This promise is rejected with a {@see AggregateException} if the number of + * fulfilled promises is less than the desired $count. + * + * @param int $count Total number of promises. + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + * + * @deprecated some will be removed in guzzlehttp/promises:2.0. Use Utils::some instead. + */ +function some($count, $promises) +{ + return Utils::some($count, $promises); +} + +/** + * Like some(), with 1 as count. However, if the promise fulfills, the + * fulfillment value is not an array of 1 but the value directly. + * + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + * + * @deprecated any will be removed in guzzlehttp/promises:2.0. Use Utils::any instead. + */ +function any($promises) +{ + return Utils::any($promises); +} + +/** + * Returns a promise that is fulfilled when all of the provided promises have + * been fulfilled or rejected. + * + * The returned promise is fulfilled with an array of inspection state arrays. + * + * @see inspect for the inspection state array format. + * + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + * + * @deprecated settle will be removed in guzzlehttp/promises:2.0. Use Utils::settle instead. + */ +function settle($promises) +{ + return Utils::settle($promises); +} + +/** + * Given an iterator that yields promises or values, returns a promise that is + * fulfilled with a null value when the iterator has been consumed or the + * aggregate promise has been fulfilled or rejected. + * + * $onFulfilled is a function that accepts the fulfilled value, iterator index, + * and the aggregate promise. The callback can invoke any necessary side + * effects and choose to resolve or reject the aggregate if needed. + * + * $onRejected is a function that accepts the rejection reason, iterator index, + * and the aggregate promise. The callback can invoke any necessary side + * effects and choose to resolve or reject the aggregate if needed. + * + * @param mixed $iterable Iterator or array to iterate over. + * @param callable $onFulfilled + * @param callable $onRejected + * + * @return PromiseInterface + * + * @deprecated each will be removed in guzzlehttp/promises:2.0. Use Each::of instead. + */ +function each( + $iterable, + callable $onFulfilled = null, + callable $onRejected = null +) { + return Each::of($iterable, $onFulfilled, $onRejected); +} + +/** + * Like each, but only allows a certain number of outstanding promises at any + * given time. + * + * $concurrency may be an integer or a function that accepts the number of + * pending promises and returns a numeric concurrency limit value to allow for + * dynamic a concurrency size. + * + * @param mixed $iterable + * @param int|callable $concurrency + * @param callable $onFulfilled + * @param callable $onRejected + * + * @return PromiseInterface + * + * @deprecated each_limit will be removed in guzzlehttp/promises:2.0. Use Each::ofLimit instead. + */ +function each_limit( + $iterable, + $concurrency, + callable $onFulfilled = null, + callable $onRejected = null +) { + return Each::ofLimit($iterable, $concurrency, $onFulfilled, $onRejected); +} + +/** + * Like each_limit, but ensures that no promise in the given $iterable argument + * is rejected. If any promise is rejected, then the aggregate promise is + * rejected with the encountered rejection. + * + * @param mixed $iterable + * @param int|callable $concurrency + * @param callable $onFulfilled + * + * @return PromiseInterface + * + * @deprecated each_limit_all will be removed in guzzlehttp/promises:2.0. Use Each::ofLimitAll instead. + */ +function each_limit_all( + $iterable, + $concurrency, + callable $onFulfilled = null +) { + return Each::ofLimitAll($iterable, $concurrency, $onFulfilled); +} + +/** + * Returns true if a promise is fulfilled. + * + * @return bool + * + * @deprecated is_fulfilled will be removed in guzzlehttp/promises:2.0. Use Is::fulfilled instead. + */ +function is_fulfilled(PromiseInterface $promise) +{ + return Is::fulfilled($promise); +} + +/** + * Returns true if a promise is rejected. + * + * @return bool + * + * @deprecated is_rejected will be removed in guzzlehttp/promises:2.0. Use Is::rejected instead. + */ +function is_rejected(PromiseInterface $promise) +{ + return Is::rejected($promise); +} + +/** + * Returns true if a promise is fulfilled or rejected. + * + * @return bool + * + * @deprecated is_settled will be removed in guzzlehttp/promises:2.0. Use Is::settled instead. + */ +function is_settled(PromiseInterface $promise) +{ + return Is::settled($promise); +} + +/** + * Create a new coroutine. + * + * @see Coroutine + * + * @return PromiseInterface + * + * @deprecated coroutine will be removed in guzzlehttp/promises:2.0. Use Coroutine::of instead. + */ +function coroutine(callable $generatorFn) +{ + return Coroutine::of($generatorFn); +} diff --git a/vendor/guzzlehttp/promises/src/functions_include.php b/vendor/guzzlehttp/promises/src/functions_include.php new file mode 100644 index 00000000..34cd1710 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/functions_include.php @@ -0,0 +1,6 @@ +withPath('foo')->withHost('example.com')` will throw an exception + because the path of a URI with an authority must start with a slash "/" or be empty + - `(new Uri())->withScheme('http')` will return `'http://localhost'` + +### Deprecated + +- `Uri::resolve` in favor of `UriResolver::resolve` +- `Uri::removeDotSegments` in favor of `UriResolver::removeDotSegments` + +### Fixed + +- `Stream::read` when length parameter <= 0. +- `copy_to_stream` reads bytes in chunks instead of `maxLen` into memory. +- `ServerRequest::getUriFromGlobals` when `Host` header contains port. +- Compatibility of URIs with `file` scheme and empty host. + + +## [1.3.1] - 2016-06-25 + +### Fixed + +- `Uri::__toString` for network path references, e.g. `//example.org`. +- Missing lowercase normalization for host. +- Handling of URI components in case they are `'0'` in a lot of places, + e.g. as a user info password. +- `Uri::withAddedHeader` to correctly merge headers with different case. +- Trimming of header values in `Uri::withAddedHeader`. Header values may + be surrounded by whitespace which should be ignored according to RFC 7230 + Section 3.2.4. This does not apply to header names. +- `Uri::withAddedHeader` with an array of header values. +- `Uri::resolve` when base path has no slash and handling of fragment. +- Handling of encoding in `Uri::with(out)QueryValue` so one can pass the + key/value both in encoded as well as decoded form to those methods. This is + consistent with withPath, withQuery etc. +- `ServerRequest::withoutAttribute` when attribute value is null. + + +## [1.3.0] - 2016-04-13 + +### Added + +- Remaining interfaces needed for full PSR7 compatibility + (ServerRequestInterface, UploadedFileInterface, etc.). +- Support for stream_for from scalars. + +### Changed + +- Can now extend Uri. + +### Fixed +- A bug in validating request methods by making it more permissive. + + +## [1.2.3] - 2016-02-18 + +### Fixed + +- Support in `GuzzleHttp\Psr7\CachingStream` for seeking forward on remote + streams, which can sometimes return fewer bytes than requested with `fread`. +- Handling of gzipped responses with FNAME headers. + + +## [1.2.2] - 2016-01-22 + +### Added + +- Support for URIs without any authority. +- Support for HTTP 451 'Unavailable For Legal Reasons.' +- Support for using '0' as a filename. +- Support for including non-standard ports in Host headers. + + +## [1.2.1] - 2015-11-02 + +### Changes + +- Now supporting negative offsets when seeking to SEEK_END. + + +## [1.2.0] - 2015-08-15 + +### Changed + +- Body as `"0"` is now properly added to a response. +- Now allowing forward seeking in CachingStream. +- Now properly parsing HTTP requests that contain proxy targets in + `parse_request`. +- functions.php is now conditionally required. +- user-info is no longer dropped when resolving URIs. + + +## [1.1.0] - 2015-06-24 + +### Changed + +- URIs can now be relative. +- `multipart/form-data` headers are now overridden case-insensitively. +- URI paths no longer encode the following characters because they are allowed + in URIs: "(", ")", "*", "!", "'" +- A port is no longer added to a URI when the scheme is missing and no port is + present. + + +## 1.0.0 - 2015-05-19 + +Initial release. + +Currently unsupported: + +- `Psr\Http\Message\ServerRequestInterface` +- `Psr\Http\Message\UploadedFileInterface` + + + +[1.6.0]: https://github.com/guzzle/psr7/compare/1.5.2...1.6.0 +[1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2 +[1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1 +[1.5.0]: https://github.com/guzzle/psr7/compare/1.4.2...1.5.0 +[1.4.2]: https://github.com/guzzle/psr7/compare/1.4.1...1.4.2 +[1.4.1]: https://github.com/guzzle/psr7/compare/1.4.0...1.4.1 +[1.4.0]: https://github.com/guzzle/psr7/compare/1.3.1...1.4.0 +[1.3.1]: https://github.com/guzzle/psr7/compare/1.3.0...1.3.1 +[1.3.0]: https://github.com/guzzle/psr7/compare/1.2.3...1.3.0 +[1.2.3]: https://github.com/guzzle/psr7/compare/1.2.2...1.2.3 +[1.2.2]: https://github.com/guzzle/psr7/compare/1.2.1...1.2.2 +[1.2.1]: https://github.com/guzzle/psr7/compare/1.2.0...1.2.1 +[1.2.0]: https://github.com/guzzle/psr7/compare/1.1.0...1.2.0 +[1.1.0]: https://github.com/guzzle/psr7/compare/1.0.0...1.1.0 diff --git a/vendor/guzzlehttp/psr7/LICENSE b/vendor/guzzlehttp/psr7/LICENSE new file mode 100644 index 00000000..51c7ec81 --- /dev/null +++ b/vendor/guzzlehttp/psr7/LICENSE @@ -0,0 +1,26 @@ +The MIT License (MIT) + +Copyright (c) 2015 Michael Dowling +Copyright (c) 2015 Márk Sági-Kazár +Copyright (c) 2015 Graham Campbell +Copyright (c) 2016 Tobias Schultze +Copyright (c) 2016 George Mponos +Copyright (c) 2018 Tobias Nyholm + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/guzzlehttp/psr7/README.md b/vendor/guzzlehttp/psr7/README.md new file mode 100644 index 00000000..ed81c927 --- /dev/null +++ b/vendor/guzzlehttp/psr7/README.md @@ -0,0 +1,823 @@ +# PSR-7 Message Implementation + +This repository contains a full [PSR-7](http://www.php-fig.org/psr/psr-7/) +message implementation, several stream decorators, and some helpful +functionality like query string parsing. + +![CI](https://github.com/guzzle/psr7/workflows/CI/badge.svg) +![Static analysis](https://github.com/guzzle/psr7/workflows/Static%20analysis/badge.svg) + + +# Stream implementation + +This package comes with a number of stream implementations and stream +decorators. + + +## AppendStream + +`GuzzleHttp\Psr7\AppendStream` + +Reads from multiple streams, one after the other. + +```php +use GuzzleHttp\Psr7; + +$a = Psr7\Utils::streamFor('abc, '); +$b = Psr7\Utils::streamFor('123.'); +$composed = new Psr7\AppendStream([$a, $b]); + +$composed->addStream(Psr7\Utils::streamFor(' Above all listen to me')); + +echo $composed; // abc, 123. Above all listen to me. +``` + + +## BufferStream + +`GuzzleHttp\Psr7\BufferStream` + +Provides a buffer stream that can be written to fill a buffer, and read +from to remove bytes from the buffer. + +This stream returns a "hwm" metadata value that tells upstream consumers +what the configured high water mark of the stream is, or the maximum +preferred size of the buffer. + +```php +use GuzzleHttp\Psr7; + +// When more than 1024 bytes are in the buffer, it will begin returning +// false to writes. This is an indication that writers should slow down. +$buffer = new Psr7\BufferStream(1024); +``` + + +## CachingStream + +The CachingStream is used to allow seeking over previously read bytes on +non-seekable streams. This can be useful when transferring a non-seekable +entity body fails due to needing to rewind the stream (for example, resulting +from a redirect). Data that is read from the remote stream will be buffered in +a PHP temp stream so that previously read bytes are cached first in memory, +then on disk. + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor(fopen('http://www.google.com', 'r')); +$stream = new Psr7\CachingStream($original); + +$stream->read(1024); +echo $stream->tell(); +// 1024 + +$stream->seek(0); +echo $stream->tell(); +// 0 +``` + + +## DroppingStream + +`GuzzleHttp\Psr7\DroppingStream` + +Stream decorator that begins dropping data once the size of the underlying +stream becomes too full. + +```php +use GuzzleHttp\Psr7; + +// Create an empty stream +$stream = Psr7\Utils::streamFor(); + +// Start dropping data when the stream has more than 10 bytes +$dropping = new Psr7\DroppingStream($stream, 10); + +$dropping->write('01234567890123456789'); +echo $stream; // 0123456789 +``` + + +## FnStream + +`GuzzleHttp\Psr7\FnStream` + +Compose stream implementations based on a hash of functions. + +Allows for easy testing and extension of a provided stream without needing +to create a concrete class for a simple extension point. + +```php + +use GuzzleHttp\Psr7; + +$stream = Psr7\Utils::streamFor('hi'); +$fnStream = Psr7\FnStream::decorate($stream, [ + 'rewind' => function () use ($stream) { + echo 'About to rewind - '; + $stream->rewind(); + echo 'rewound!'; + } +]); + +$fnStream->rewind(); +// Outputs: About to rewind - rewound! +``` + + +## InflateStream + +`GuzzleHttp\Psr7\InflateStream` + +Uses PHP's zlib.inflate filter to inflate zlib (HTTP deflate, RFC1950) or gzipped (RFC1952) content. + +This stream decorator converts the provided stream to a PHP stream resource, +then appends the zlib.inflate filter. The stream is then converted back +to a Guzzle stream resource to be used as a Guzzle stream. + + +## LazyOpenStream + +`GuzzleHttp\Psr7\LazyOpenStream` + +Lazily reads or writes to a file that is opened only after an IO operation +take place on the stream. + +```php +use GuzzleHttp\Psr7; + +$stream = new Psr7\LazyOpenStream('/path/to/file', 'r'); +// The file has not yet been opened... + +echo $stream->read(10); +// The file is opened and read from only when needed. +``` + + +## LimitStream + +`GuzzleHttp\Psr7\LimitStream` + +LimitStream can be used to read a subset or slice of an existing stream object. +This can be useful for breaking a large file into smaller pieces to be sent in +chunks (e.g. Amazon S3's multipart upload API). + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor(fopen('/tmp/test.txt', 'r+')); +echo $original->getSize(); +// >>> 1048576 + +// Limit the size of the body to 1024 bytes and start reading from byte 2048 +$stream = new Psr7\LimitStream($original, 1024, 2048); +echo $stream->getSize(); +// >>> 1024 +echo $stream->tell(); +// >>> 0 +``` + + +## MultipartStream + +`GuzzleHttp\Psr7\MultipartStream` + +Stream that when read returns bytes for a streaming multipart or +multipart/form-data stream. + + +## NoSeekStream + +`GuzzleHttp\Psr7\NoSeekStream` + +NoSeekStream wraps a stream and does not allow seeking. + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor('foo'); +$noSeek = new Psr7\NoSeekStream($original); + +echo $noSeek->read(3); +// foo +var_export($noSeek->isSeekable()); +// false +$noSeek->seek(0); +var_export($noSeek->read(3)); +// NULL +``` + + +## PumpStream + +`GuzzleHttp\Psr7\PumpStream` + +Provides a read only stream that pumps data from a PHP callable. + +When invoking the provided callable, the PumpStream will pass the amount of +data requested to read to the callable. The callable can choose to ignore +this value and return fewer or more bytes than requested. Any extra data +returned by the provided callable is buffered internally until drained using +the read() function of the PumpStream. The provided callable MUST return +false when there is no more data to read. + + +## Implementing stream decorators + +Creating a stream decorator is very easy thanks to the +`GuzzleHttp\Psr7\StreamDecoratorTrait`. This trait provides methods that +implement `Psr\Http\Message\StreamInterface` by proxying to an underlying +stream. Just `use` the `StreamDecoratorTrait` and implement your custom +methods. + +For example, let's say we wanted to call a specific function each time the last +byte is read from a stream. This could be implemented by overriding the +`read()` method. + +```php +use Psr\Http\Message\StreamInterface; +use GuzzleHttp\Psr7\StreamDecoratorTrait; + +class EofCallbackStream implements StreamInterface +{ + use StreamDecoratorTrait; + + private $callback; + + public function __construct(StreamInterface $stream, callable $cb) + { + $this->stream = $stream; + $this->callback = $cb; + } + + public function read($length) + { + $result = $this->stream->read($length); + + // Invoke the callback when EOF is hit. + if ($this->eof()) { + call_user_func($this->callback); + } + + return $result; + } +} +``` + +This decorator could be added to any existing stream and used like so: + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor('foo'); + +$eofStream = new EofCallbackStream($original, function () { + echo 'EOF!'; +}); + +$eofStream->read(2); +$eofStream->read(1); +// echoes "EOF!" +$eofStream->seek(0); +$eofStream->read(3); +// echoes "EOF!" +``` + + +## PHP StreamWrapper + +You can use the `GuzzleHttp\Psr7\StreamWrapper` class if you need to use a +PSR-7 stream as a PHP stream resource. + +Use the `GuzzleHttp\Psr7\StreamWrapper::getResource()` method to create a PHP +stream from a PSR-7 stream. + +```php +use GuzzleHttp\Psr7\StreamWrapper; + +$stream = GuzzleHttp\Psr7\Utils::streamFor('hello!'); +$resource = StreamWrapper::getResource($stream); +echo fread($resource, 6); // outputs hello! +``` + + +# Static API + +There are various static methods available under the `GuzzleHttp\Psr7` namespace. + + +## `GuzzleHttp\Psr7\Message::toString` + +`public static function toString(MessageInterface $message): string` + +Returns the string representation of an HTTP message. + +```php +$request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com'); +echo GuzzleHttp\Psr7\Message::toString($request); +``` + + +## `GuzzleHttp\Psr7\Message::bodySummary` + +`public static function bodySummary(MessageInterface $message, int $truncateAt = 120): string|null` + +Get a short summary of the message body. + +Will return `null` if the response is not printable. + + +## `GuzzleHttp\Psr7\Message::rewindBody` + +`public static function rewindBody(MessageInterface $message): void` + +Attempts to rewind a message body and throws an exception on failure. + +The body of the message will only be rewound if a call to `tell()` +returns a value other than `0`. + + +## `GuzzleHttp\Psr7\Message::parseMessage` + +`public static function parseMessage(string $message): array` + +Parses an HTTP message into an associative array. + +The array contains the "start-line" key containing the start line of +the message, "headers" key containing an associative array of header +array values, and a "body" key containing the body of the message. + + +## `GuzzleHttp\Psr7\Message::parseRequestUri` + +`public static function parseRequestUri(string $path, array $headers): string` + +Constructs a URI for an HTTP request message. + + +## `GuzzleHttp\Psr7\Message::parseRequest` + +`public static function parseRequest(string $message): Request` + +Parses a request message string into a request object. + + +## `GuzzleHttp\Psr7\Message::parseResponse` + +`public static function parseResponse(string $message): Response` + +Parses a response message string into a response object. + + +## `GuzzleHttp\Psr7\Header::parse` + +`public static function parse(string|array $header): array` + +Parse an array of header values containing ";" separated data into an +array of associative arrays representing the header key value pair data +of the header. When a parameter does not contain a value, but just +contains a key, this function will inject a key with a '' string value. + + +## `GuzzleHttp\Psr7\Header::normalize` + +`public static function normalize(string|array $header): array` + +Converts an array of header values that may contain comma separated +headers into an array of headers with no comma separated values. + + +## `GuzzleHttp\Psr7\Query::parse` + +`public static function parse(string $str, int|bool $urlEncoding = true): array` + +Parse a query string into an associative array. + +If multiple values are found for the same key, the value of that key +value pair will become an array. This function does not parse nested +PHP style arrays into an associative array (e.g., `foo[a]=1&foo[b]=2` +will be parsed into `['foo[a]' => '1', 'foo[b]' => '2'])`. + + +## `GuzzleHttp\Psr7\Query::build` + +`public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986): string` + +Build a query string from an array of key value pairs. + +This function can use the return value of `parse()` to build a query +string. This function does not modify the provided keys when an array is +encountered (like `http_build_query()` would). + + +## `GuzzleHttp\Psr7\Utils::caselessRemove` + +`public static function caselessRemove(iterable $keys, $keys, array $data): array` + +Remove the items given by the keys, case insensitively from the data. + + +## `GuzzleHttp\Psr7\Utils::copyToStream` + +`public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void` + +Copy the contents of a stream into another stream until the given number +of bytes have been read. + + +## `GuzzleHttp\Psr7\Utils::copyToString` + +`public static function copyToString(StreamInterface $stream, int $maxLen = -1): string` + +Copy the contents of a stream into a string until the given number of +bytes have been read. + + +## `GuzzleHttp\Psr7\Utils::hash` + +`public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string` + +Calculate a hash of a stream. + +This method reads the entire stream to calculate a rolling hash, based on +PHP's `hash_init` functions. + + +## `GuzzleHttp\Psr7\Utils::modifyRequest` + +`public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface` + +Clone and modify a request with the given changes. + +This method is useful for reducing the number of clones needed to mutate +a message. + +- method: (string) Changes the HTTP method. +- set_headers: (array) Sets the given headers. +- remove_headers: (array) Remove the given headers. +- body: (mixed) Sets the given body. +- uri: (UriInterface) Set the URI. +- query: (string) Set the query string value of the URI. +- version: (string) Set the protocol version. + + +## `GuzzleHttp\Psr7\Utils::readLine` + +`public static function readLine(StreamInterface $stream, int $maxLength = null): string` + +Read a line from the stream up to the maximum allowed buffer length. + + +## `GuzzleHttp\Psr7\Utils::streamFor` + +`public static function streamFor(resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource = '', array $options = []): StreamInterface` + +Create a new stream based on the input type. + +Options is an associative array that can contain the following keys: + +- metadata: Array of custom metadata. +- size: Size of the stream. + +This method accepts the following `$resource` types: + +- `Psr\Http\Message\StreamInterface`: Returns the value as-is. +- `string`: Creates a stream object that uses the given string as the contents. +- `resource`: Creates a stream object that wraps the given PHP stream resource. +- `Iterator`: If the provided value implements `Iterator`, then a read-only + stream object will be created that wraps the given iterable. Each time the + stream is read from, data from the iterator will fill a buffer and will be + continuously called until the buffer is equal to the requested read size. + Subsequent read calls will first read from the buffer and then call `next` + on the underlying iterator until it is exhausted. +- `object` with `__toString()`: If the object has the `__toString()` method, + the object will be cast to a string and then a stream will be returned that + uses the string value. +- `NULL`: When `null` is passed, an empty stream object is returned. +- `callable` When a callable is passed, a read-only stream object will be + created that invokes the given callable. The callable is invoked with the + number of suggested bytes to read. The callable can return any number of + bytes, but MUST return `false` when there is no more data to return. The + stream object that wraps the callable will invoke the callable until the + number of requested bytes are available. Any additional bytes will be + buffered and used in subsequent reads. + +```php +$stream = GuzzleHttp\Psr7\Utils::streamFor('foo'); +$stream = GuzzleHttp\Psr7\Utils::streamFor(fopen('/path/to/file', 'r')); + +$generator = function ($bytes) { + for ($i = 0; $i < $bytes; $i++) { + yield ' '; + } +} + +$stream = GuzzleHttp\Psr7\Utils::streamFor($generator(100)); +``` + + +## `GuzzleHttp\Psr7\Utils::tryFopen` + +`public static function tryFopen(string $filename, string $mode): resource` + +Safely opens a PHP stream resource using a filename. + +When fopen fails, PHP normally raises a warning. This function adds an +error handler that checks for errors and throws an exception instead. + + +## `GuzzleHttp\Psr7\Utils::uriFor` + +`public static function uriFor(string|UriInterface $uri): UriInterface` + +Returns a UriInterface for the given value. + +This function accepts a string or UriInterface and returns a +UriInterface for the given value. If the value is already a +UriInterface, it is returned as-is. + + +## `GuzzleHttp\Psr7\MimeType::fromFilename` + +`public static function fromFilename(string $filename): string|null` + +Determines the mimetype of a file by looking at its extension. + + +## `GuzzleHttp\Psr7\MimeType::fromExtension` + +`public static function fromExtension(string $extension): string|null` + +Maps a file extensions to a mimetype. + + +## Upgrading from Function API + +The static API was first introduced in 1.7.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API was removed in 2.0.0. A migration table has been provided here for your convenience: + +| Original Function | Replacement Method | +|----------------|----------------| +| `str` | `Message::toString` | +| `uri_for` | `Utils::uriFor` | +| `stream_for` | `Utils::streamFor` | +| `parse_header` | `Header::parse` | +| `normalize_header` | `Header::normalize` | +| `modify_request` | `Utils::modifyRequest` | +| `rewind_body` | `Message::rewindBody` | +| `try_fopen` | `Utils::tryFopen` | +| `copy_to_string` | `Utils::copyToString` | +| `copy_to_stream` | `Utils::copyToStream` | +| `hash` | `Utils::hash` | +| `readline` | `Utils::readLine` | +| `parse_request` | `Message::parseRequest` | +| `parse_response` | `Message::parseResponse` | +| `parse_query` | `Query::parse` | +| `build_query` | `Query::build` | +| `mimetype_from_filename` | `MimeType::fromFilename` | +| `mimetype_from_extension` | `MimeType::fromExtension` | +| `_parse_message` | `Message::parseMessage` | +| `_parse_request_uri` | `Message::parseRequestUri` | +| `get_message_body_summary` | `Message::bodySummary` | +| `_caseless_remove` | `Utils::caselessRemove` | + + +# Additional URI Methods + +Aside from the standard `Psr\Http\Message\UriInterface` implementation in form of the `GuzzleHttp\Psr7\Uri` class, +this library also provides additional functionality when working with URIs as static methods. + +## URI Types + +An instance of `Psr\Http\Message\UriInterface` can either be an absolute URI or a relative reference. +An absolute URI has a scheme. A relative reference is used to express a URI relative to another URI, +the base URI. Relative references can be divided into several forms according to +[RFC 3986 Section 4.2](https://tools.ietf.org/html/rfc3986#section-4.2): + +- network-path references, e.g. `//example.com/path` +- absolute-path references, e.g. `/path` +- relative-path references, e.g. `subpath` + +The following methods can be used to identify the type of the URI. + +### `GuzzleHttp\Psr7\Uri::isAbsolute` + +`public static function isAbsolute(UriInterface $uri): bool` + +Whether the URI is absolute, i.e. it has a scheme. + +### `GuzzleHttp\Psr7\Uri::isNetworkPathReference` + +`public static function isNetworkPathReference(UriInterface $uri): bool` + +Whether the URI is a network-path reference. A relative reference that begins with two slash characters is +termed an network-path reference. + +### `GuzzleHttp\Psr7\Uri::isAbsolutePathReference` + +`public static function isAbsolutePathReference(UriInterface $uri): bool` + +Whether the URI is a absolute-path reference. A relative reference that begins with a single slash character is +termed an absolute-path reference. + +### `GuzzleHttp\Psr7\Uri::isRelativePathReference` + +`public static function isRelativePathReference(UriInterface $uri): bool` + +Whether the URI is a relative-path reference. A relative reference that does not begin with a slash character is +termed a relative-path reference. + +### `GuzzleHttp\Psr7\Uri::isSameDocumentReference` + +`public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool` + +Whether the URI is a same-document reference. A same-document reference refers to a URI that is, aside from its +fragment component, identical to the base URI. When no base URI is given, only an empty URI reference +(apart from its fragment) is considered a same-document reference. + +## URI Components + +Additional methods to work with URI components. + +### `GuzzleHttp\Psr7\Uri::isDefaultPort` + +`public static function isDefaultPort(UriInterface $uri): bool` + +Whether the URI has the default port of the current scheme. `Psr\Http\Message\UriInterface::getPort` may return null +or the standard port. This method can be used independently of the implementation. + +### `GuzzleHttp\Psr7\Uri::composeComponents` + +`public static function composeComponents($scheme, $authority, $path, $query, $fragment): string` + +Composes a URI reference string from its various components according to +[RFC 3986 Section 5.3](https://tools.ietf.org/html/rfc3986#section-5.3). Usually this method does not need to be called +manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__toString`. + +### `GuzzleHttp\Psr7\Uri::fromParts` + +`public static function fromParts(array $parts): UriInterface` + +Creates a URI from a hash of [`parse_url`](http://php.net/manual/en/function.parse-url.php) components. + + +### `GuzzleHttp\Psr7\Uri::withQueryValue` + +`public static function withQueryValue(UriInterface $uri, $key, $value): UriInterface` + +Creates a new URI with a specific query string value. Any existing query string values that exactly match the +provided key are removed and replaced with the given key value pair. A value of null will set the query string +key without a value, e.g. "key" instead of "key=value". + +### `GuzzleHttp\Psr7\Uri::withQueryValues` + +`public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface` + +Creates a new URI with multiple query string values. It has the same behavior as `withQueryValue()` but for an +associative array of key => value. + +### `GuzzleHttp\Psr7\Uri::withoutQueryValue` + +`public static function withoutQueryValue(UriInterface $uri, $key): UriInterface` + +Creates a new URI with a specific query string value removed. Any existing query string values that exactly match the +provided key are removed. + +## Reference Resolution + +`GuzzleHttp\Psr7\UriResolver` provides methods to resolve a URI reference in the context of a base URI according +to [RFC 3986 Section 5](https://tools.ietf.org/html/rfc3986#section-5). This is for example also what web browsers +do when resolving a link in a website based on the current request URI. + +### `GuzzleHttp\Psr7\UriResolver::resolve` + +`public static function resolve(UriInterface $base, UriInterface $rel): UriInterface` + +Converts the relative URI into a new URI that is resolved against the base URI. + +### `GuzzleHttp\Psr7\UriResolver::removeDotSegments` + +`public static function removeDotSegments(string $path): string` + +Removes dot segments from a path and returns the new path according to +[RFC 3986 Section 5.2.4](https://tools.ietf.org/html/rfc3986#section-5.2.4). + +### `GuzzleHttp\Psr7\UriResolver::relativize` + +`public static function relativize(UriInterface $base, UriInterface $target): UriInterface` + +Returns the target URI as a relative reference from the base URI. This method is the counterpart to resolve(): + +```php +(string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) +``` + +One use-case is to use the current request URI as base URI and then generate relative links in your documents +to reduce the document size or offer self-contained downloadable document archives. + +```php +$base = new Uri('http://example.com/a/b/'); +echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. +echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. +echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. +echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. +``` + +## Normalization and Comparison + +`GuzzleHttp\Psr7\UriNormalizer` provides methods to normalize and compare URIs according to +[RFC 3986 Section 6](https://tools.ietf.org/html/rfc3986#section-6). + +### `GuzzleHttp\Psr7\UriNormalizer::normalize` + +`public static function normalize(UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS): UriInterface` + +Returns a normalized URI. The scheme and host component are already normalized to lowercase per PSR-7 UriInterface. +This methods adds additional normalizations that can be configured with the `$flags` parameter which is a bitmask +of normalizations to apply. The following normalizations are available: + +- `UriNormalizer::PRESERVING_NORMALIZATIONS` + + Default normalizations which only include the ones that preserve semantics. + +- `UriNormalizer::CAPITALIZE_PERCENT_ENCODING` + + All letters within a percent-encoding triplet (e.g., "%3A") are case-insensitive, and should be capitalized. + + Example: `http://example.org/a%c2%b1b` → `http://example.org/a%C2%B1b` + +- `UriNormalizer::DECODE_UNRESERVED_CHARACTERS` + + Decodes percent-encoded octets of unreserved characters. For consistency, percent-encoded octets in the ranges of + ALPHA (%41–%5A and %61–%7A), DIGIT (%30–%39), hyphen (%2D), period (%2E), underscore (%5F), or tilde (%7E) should + not be created by URI producers and, when found in a URI, should be decoded to their corresponding unreserved + characters by URI normalizers. + + Example: `http://example.org/%7Eusern%61me/` → `http://example.org/~username/` + +- `UriNormalizer::CONVERT_EMPTY_PATH` + + Converts the empty path to "/" for http and https URIs. + + Example: `http://example.org` → `http://example.org/` + +- `UriNormalizer::REMOVE_DEFAULT_HOST` + + Removes the default host of the given URI scheme from the URI. Only the "file" scheme defines the default host + "localhost". All of `file:/myfile`, `file:///myfile`, and `file://localhost/myfile` are equivalent according to + RFC 3986. + + Example: `file://localhost/myfile` → `file:///myfile` + +- `UriNormalizer::REMOVE_DEFAULT_PORT` + + Removes the default port of the given URI scheme from the URI. + + Example: `http://example.org:80/` → `http://example.org/` + +- `UriNormalizer::REMOVE_DOT_SEGMENTS` + + Removes unnecessary dot-segments. Dot-segments in relative-path references are not removed as it would + change the semantics of the URI reference. + + Example: `http://example.org/../a/b/../c/./d.html` → `http://example.org/a/c/d.html` + +- `UriNormalizer::REMOVE_DUPLICATE_SLASHES` + + Paths which include two or more adjacent slashes are converted to one. Webservers usually ignore duplicate slashes + and treat those URIs equivalent. But in theory those URIs do not need to be equivalent. So this normalization + may change the semantics. Encoded slashes (%2F) are not removed. + + Example: `http://example.org//foo///bar.html` → `http://example.org/foo/bar.html` + +- `UriNormalizer::SORT_QUERY_PARAMETERS` + + Sort query parameters with their values in alphabetical order. However, the order of parameters in a URI may be + significant (this is not defined by the standard). So this normalization is not safe and may change the semantics + of the URI. + + Example: `?lang=en&article=fred` → `?article=fred&lang=en` + +### `GuzzleHttp\Psr7\UriNormalizer::isEquivalent` + +`public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS): bool` + +Whether two URIs can be considered equivalent. Both URIs are normalized automatically before comparison with the given +`$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent. +This of course assumes they will be resolved against the same base URI. If this is not the case, determination of +equivalence or difference of relative references does not mean anything. + + +## Security + +If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/psr7/security/policy) for more information. + +## License + +Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. + +## For Enterprise + +Available as part of the Tidelift Subscription + +The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-psr7?utm_source=packagist-guzzlehttp-psr7&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/vendor/guzzlehttp/psr7/composer.json b/vendor/guzzlehttp/psr7/composer.json new file mode 100644 index 00000000..885aa1da --- /dev/null +++ b/vendor/guzzlehttp/psr7/composer.json @@ -0,0 +1,89 @@ +{ + "name": "guzzlehttp/psr7", + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "request", + "response", + "message", + "stream", + "http", + "uri", + "url", + "psr-7" + ], + "license": "MIT", + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Tests\\Psr7\\": "tests/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "config": { + "preferred-install": "dist", + "sort-packages": true + } +} diff --git a/vendor/guzzlehttp/psr7/src/AppendStream.php b/vendor/guzzlehttp/psr7/src/AppendStream.php new file mode 100644 index 00000000..967925f3 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/AppendStream.php @@ -0,0 +1,249 @@ +addStream($stream); + } + } + + public function __toString(): string + { + try { + $this->rewind(); + return $this->getContents(); + } catch (\Throwable $e) { + if (\PHP_VERSION_ID >= 70400) { + throw $e; + } + trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + return ''; + } + } + + /** + * Add a stream to the AppendStream + * + * @param StreamInterface $stream Stream to append. Must be readable. + * + * @throws \InvalidArgumentException if the stream is not readable + */ + public function addStream(StreamInterface $stream): void + { + if (!$stream->isReadable()) { + throw new \InvalidArgumentException('Each stream must be readable'); + } + + // The stream is only seekable if all streams are seekable + if (!$stream->isSeekable()) { + $this->seekable = false; + } + + $this->streams[] = $stream; + } + + public function getContents(): string + { + return Utils::copyToString($this); + } + + /** + * Closes each attached stream. + */ + public function close(): void + { + $this->pos = $this->current = 0; + $this->seekable = true; + + foreach ($this->streams as $stream) { + $stream->close(); + } + + $this->streams = []; + } + + /** + * Detaches each attached stream. + * + * Returns null as it's not clear which underlying stream resource to return. + */ + public function detach() + { + $this->pos = $this->current = 0; + $this->seekable = true; + + foreach ($this->streams as $stream) { + $stream->detach(); + } + + $this->streams = []; + + return null; + } + + public function tell(): int + { + return $this->pos; + } + + /** + * Tries to calculate the size by adding the size of each stream. + * + * If any of the streams do not return a valid number, then the size of the + * append stream cannot be determined and null is returned. + */ + public function getSize(): ?int + { + $size = 0; + + foreach ($this->streams as $stream) { + $s = $stream->getSize(); + if ($s === null) { + return null; + } + $size += $s; + } + + return $size; + } + + public function eof(): bool + { + return !$this->streams || + ($this->current >= count($this->streams) - 1 && + $this->streams[$this->current]->eof()); + } + + public function rewind(): void + { + $this->seek(0); + } + + /** + * Attempts to seek to the given position. Only supports SEEK_SET. + */ + public function seek($offset, $whence = SEEK_SET): void + { + if (!$this->seekable) { + throw new \RuntimeException('This AppendStream is not seekable'); + } elseif ($whence !== SEEK_SET) { + throw new \RuntimeException('The AppendStream can only seek with SEEK_SET'); + } + + $this->pos = $this->current = 0; + + // Rewind each stream + foreach ($this->streams as $i => $stream) { + try { + $stream->rewind(); + } catch (\Exception $e) { + throw new \RuntimeException('Unable to seek stream ' + . $i . ' of the AppendStream', 0, $e); + } + } + + // Seek to the actual position by reading from each stream + while ($this->pos < $offset && !$this->eof()) { + $result = $this->read(min(8096, $offset - $this->pos)); + if ($result === '') { + break; + } + } + } + + /** + * Reads from all of the appended streams until the length is met or EOF. + */ + public function read($length): string + { + $buffer = ''; + $total = count($this->streams) - 1; + $remaining = $length; + $progressToNext = false; + + while ($remaining > 0) { + + // Progress to the next stream if needed. + if ($progressToNext || $this->streams[$this->current]->eof()) { + $progressToNext = false; + if ($this->current === $total) { + break; + } + $this->current++; + } + + $result = $this->streams[$this->current]->read($remaining); + + if ($result === '') { + $progressToNext = true; + continue; + } + + $buffer .= $result; + $remaining = $length - strlen($buffer); + } + + $this->pos += strlen($buffer); + + return $buffer; + } + + public function isReadable(): bool + { + return true; + } + + public function isWritable(): bool + { + return false; + } + + public function isSeekable(): bool + { + return $this->seekable; + } + + public function write($string): int + { + throw new \RuntimeException('Cannot write to an AppendStream'); + } + + /** + * {@inheritdoc} + * + * @return mixed + */ + public function getMetadata($key = null) + { + return $key ? null : []; + } +} diff --git a/vendor/guzzlehttp/psr7/src/BufferStream.php b/vendor/guzzlehttp/psr7/src/BufferStream.php new file mode 100644 index 00000000..21be8c0a --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/BufferStream.php @@ -0,0 +1,149 @@ +hwm = $hwm; + } + + public function __toString(): string + { + return $this->getContents(); + } + + public function getContents(): string + { + $buffer = $this->buffer; + $this->buffer = ''; + + return $buffer; + } + + public function close(): void + { + $this->buffer = ''; + } + + public function detach() + { + $this->close(); + + return null; + } + + public function getSize(): ?int + { + return strlen($this->buffer); + } + + public function isReadable(): bool + { + return true; + } + + public function isWritable(): bool + { + return true; + } + + public function isSeekable(): bool + { + return false; + } + + public function rewind(): void + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET): void + { + throw new \RuntimeException('Cannot seek a BufferStream'); + } + + public function eof(): bool + { + return strlen($this->buffer) === 0; + } + + public function tell(): int + { + throw new \RuntimeException('Cannot determine the position of a BufferStream'); + } + + /** + * Reads data from the buffer. + */ + public function read($length): string + { + $currentLength = strlen($this->buffer); + + if ($length >= $currentLength) { + // No need to slice the buffer because we don't have enough data. + $result = $this->buffer; + $this->buffer = ''; + } else { + // Slice up the result to provide a subset of the buffer. + $result = substr($this->buffer, 0, $length); + $this->buffer = substr($this->buffer, $length); + } + + return $result; + } + + /** + * Writes data to the buffer. + */ + public function write($string): int + { + $this->buffer .= $string; + + if (strlen($this->buffer) >= $this->hwm) { + return 0; + } + + return strlen($string); + } + + /** + * {@inheritdoc} + * + * @return mixed + */ + public function getMetadata($key = null) + { + if ($key === 'hwm') { + return $this->hwm; + } + + return $key ? null : []; + } +} diff --git a/vendor/guzzlehttp/psr7/src/CachingStream.php b/vendor/guzzlehttp/psr7/src/CachingStream.php new file mode 100644 index 00000000..7a70ee94 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/CachingStream.php @@ -0,0 +1,148 @@ +remoteStream = $stream; + $this->stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+')); + } + + public function getSize(): ?int + { + $remoteSize = $this->remoteStream->getSize(); + + if (null === $remoteSize) { + return null; + } + + return max($this->stream->getSize(), $remoteSize); + } + + public function rewind(): void + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET): void + { + if ($whence === SEEK_SET) { + $byte = $offset; + } elseif ($whence === SEEK_CUR) { + $byte = $offset + $this->tell(); + } elseif ($whence === SEEK_END) { + $size = $this->remoteStream->getSize(); + if ($size === null) { + $size = $this->cacheEntireStream(); + } + $byte = $size + $offset; + } else { + throw new \InvalidArgumentException('Invalid whence'); + } + + $diff = $byte - $this->stream->getSize(); + + if ($diff > 0) { + // Read the remoteStream until we have read in at least the amount + // of bytes requested, or we reach the end of the file. + while ($diff > 0 && !$this->remoteStream->eof()) { + $this->read($diff); + $diff = $byte - $this->stream->getSize(); + } + } else { + // We can just do a normal seek since we've already seen this byte. + $this->stream->seek($byte); + } + } + + public function read($length): string + { + // Perform a regular read on any previously read data from the buffer + $data = $this->stream->read($length); + $remaining = $length - strlen($data); + + // More data was requested so read from the remote stream + if ($remaining) { + // If data was written to the buffer in a position that would have + // been filled from the remote stream, then we must skip bytes on + // the remote stream to emulate overwriting bytes from that + // position. This mimics the behavior of other PHP stream wrappers. + $remoteData = $this->remoteStream->read( + $remaining + $this->skipReadBytes + ); + + if ($this->skipReadBytes) { + $len = strlen($remoteData); + $remoteData = substr($remoteData, $this->skipReadBytes); + $this->skipReadBytes = max(0, $this->skipReadBytes - $len); + } + + $data .= $remoteData; + $this->stream->write($remoteData); + } + + return $data; + } + + public function write($string): int + { + // When appending to the end of the currently read stream, you'll want + // to skip bytes from being read from the remote stream to emulate + // other stream wrappers. Basically replacing bytes of data of a fixed + // length. + $overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell(); + if ($overflow > 0) { + $this->skipReadBytes += $overflow; + } + + return $this->stream->write($string); + } + + public function eof(): bool + { + return $this->stream->eof() && $this->remoteStream->eof(); + } + + /** + * Close both the remote stream and buffer stream + */ + public function close(): void + { + $this->remoteStream->close(); + $this->stream->close(); + } + + private function cacheEntireStream(): int + { + $target = new FnStream(['write' => 'strlen']); + Utils::copyToStream($this, $target); + + return $this->tell(); + } +} diff --git a/vendor/guzzlehttp/psr7/src/DroppingStream.php b/vendor/guzzlehttp/psr7/src/DroppingStream.php new file mode 100644 index 00000000..d78070ae --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/DroppingStream.php @@ -0,0 +1,46 @@ +stream = $stream; + $this->maxLength = $maxLength; + } + + public function write($string): int + { + $diff = $this->maxLength - $this->stream->getSize(); + + // Begin returning 0 when the underlying stream is too large. + if ($diff <= 0) { + return 0; + } + + // Write the stream or a subset of the stream if needed. + if (strlen($string) < $diff) { + return $this->stream->write($string); + } + + return $this->stream->write(substr($string, 0, $diff)); + } +} diff --git a/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php b/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php new file mode 100644 index 00000000..3a084779 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php @@ -0,0 +1,14 @@ + */ + private $methods; + + /** + * @param array $methods Hash of method name to a callable. + */ + public function __construct(array $methods) + { + $this->methods = $methods; + + // Create the functions on the class + foreach ($methods as $name => $fn) { + $this->{'_fn_' . $name} = $fn; + } + } + + /** + * Lazily determine which methods are not implemented. + * + * @throws \BadMethodCallException + */ + public function __get(string $name): void + { + throw new \BadMethodCallException(str_replace('_fn_', '', $name) + . '() is not implemented in the FnStream'); + } + + /** + * The close method is called on the underlying stream only if possible. + */ + public function __destruct() + { + if (isset($this->_fn_close)) { + call_user_func($this->_fn_close); + } + } + + /** + * An unserialize would allow the __destruct to run when the unserialized value goes out of scope. + * + * @throws \LogicException + */ + public function __wakeup(): void + { + throw new \LogicException('FnStream should never be unserialized'); + } + + /** + * Adds custom functionality to an underlying stream by intercepting + * specific method calls. + * + * @param StreamInterface $stream Stream to decorate + * @param array $methods Hash of method name to a closure + * + * @return FnStream + */ + public static function decorate(StreamInterface $stream, array $methods) + { + // If any of the required methods were not provided, then simply + // proxy to the decorated stream. + foreach (array_diff(self::SLOTS, array_keys($methods)) as $diff) { + /** @var callable $callable */ + $callable = [$stream, $diff]; + $methods[$diff] = $callable; + } + + return new self($methods); + } + + public function __toString(): string + { + try { + return call_user_func($this->_fn___toString); + } catch (\Throwable $e) { + if (\PHP_VERSION_ID >= 70400) { + throw $e; + } + trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + return ''; + } + } + + public function close(): void + { + call_user_func($this->_fn_close); + } + + public function detach() + { + return call_user_func($this->_fn_detach); + } + + public function getSize(): ?int + { + return call_user_func($this->_fn_getSize); + } + + public function tell(): int + { + return call_user_func($this->_fn_tell); + } + + public function eof(): bool + { + return call_user_func($this->_fn_eof); + } + + public function isSeekable(): bool + { + return call_user_func($this->_fn_isSeekable); + } + + public function rewind(): void + { + call_user_func($this->_fn_rewind); + } + + public function seek($offset, $whence = SEEK_SET): void + { + call_user_func($this->_fn_seek, $offset, $whence); + } + + public function isWritable(): bool + { + return call_user_func($this->_fn_isWritable); + } + + public function write($string): int + { + return call_user_func($this->_fn_write, $string); + } + + public function isReadable(): bool + { + return call_user_func($this->_fn_isReadable); + } + + public function read($length): string + { + return call_user_func($this->_fn_read, $length); + } + + public function getContents(): string + { + return call_user_func($this->_fn_getContents); + } + + /** + * {@inheritdoc} + * + * @return mixed + */ + public function getMetadata($key = null) + { + return call_user_func($this->_fn_getMetadata, $key); + } +} diff --git a/vendor/guzzlehttp/psr7/src/Header.php b/vendor/guzzlehttp/psr7/src/Header.php new file mode 100644 index 00000000..0e79a71a --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Header.php @@ -0,0 +1,69 @@ +]+>|[^=]+/', $kvp, $matches)) { + $m = $matches[0]; + if (isset($m[1])) { + $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed); + } else { + $part[] = trim($m[0], $trimmed); + } + } + } + if ($part) { + $params[] = $part; + } + } + + return $params; + } + + /** + * Converts an array of header values that may contain comma separated + * headers into an array of headers with no comma separated values. + * + * @param string|array $header Header to normalize. + */ + public static function normalize($header): array + { + if (!is_array($header)) { + return array_map('trim', explode(',', $header)); + } + + $result = []; + foreach ($header as $value) { + foreach ((array) $value as $v) { + if (strpos($v, ',') === false) { + $result[] = $v; + continue; + } + foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) { + $result[] = trim($vv); + } + } + } + + return $result; + } +} diff --git a/vendor/guzzlehttp/psr7/src/HttpFactory.php b/vendor/guzzlehttp/psr7/src/HttpFactory.php new file mode 100644 index 00000000..30be222f --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/HttpFactory.php @@ -0,0 +1,100 @@ +getSize(); + } + + return new UploadedFile($stream, $size, $error, $clientFilename, $clientMediaType); + } + + public function createStream(string $content = ''): StreamInterface + { + return Utils::streamFor($content); + } + + public function createStreamFromFile(string $file, string $mode = 'r'): StreamInterface + { + try { + $resource = Utils::tryFopen($file, $mode); + } catch (\RuntimeException $e) { + if ('' === $mode || false === \in_array($mode[0], ['r', 'w', 'a', 'x', 'c'], true)) { + throw new \InvalidArgumentException(sprintf('Invalid file opening mode "%s"', $mode), 0, $e); + } + + throw $e; + } + + return Utils::streamFor($resource); + } + + public function createStreamFromResource($resource): StreamInterface + { + return Utils::streamFor($resource); + } + + public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface + { + if (empty($method)) { + if (!empty($serverParams['REQUEST_METHOD'])) { + $method = $serverParams['REQUEST_METHOD']; + } else { + throw new \InvalidArgumentException('Cannot determine HTTP method'); + } + } + + return new ServerRequest($method, $uri, [], null, '1.1', $serverParams); + } + + public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface + { + return new Response($code, [], null, '1.1', $reasonPhrase); + } + + public function createRequest(string $method, $uri): RequestInterface + { + return new Request($method, $uri); + } + + public function createUri(string $uri = ''): UriInterface + { + return new Uri($uri); + } +} diff --git a/vendor/guzzlehttp/psr7/src/InflateStream.php b/vendor/guzzlehttp/psr7/src/InflateStream.php new file mode 100644 index 00000000..8e3cf171 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/InflateStream.php @@ -0,0 +1,34 @@ + 15 + 32]); + $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource)); + } +} diff --git a/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php new file mode 100644 index 00000000..6b604296 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php @@ -0,0 +1,40 @@ +filename = $filename; + $this->mode = $mode; + } + + /** + * Creates the underlying stream lazily when required. + */ + protected function createStream(): StreamInterface + { + return Utils::streamFor(Utils::tryFopen($this->filename, $this->mode)); + } +} diff --git a/vendor/guzzlehttp/psr7/src/LimitStream.php b/vendor/guzzlehttp/psr7/src/LimitStream.php new file mode 100644 index 00000000..9762d38a --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/LimitStream.php @@ -0,0 +1,154 @@ +stream = $stream; + $this->setLimit($limit); + $this->setOffset($offset); + } + + public function eof(): bool + { + // Always return true if the underlying stream is EOF + if ($this->stream->eof()) { + return true; + } + + // No limit and the underlying stream is not at EOF + if ($this->limit === -1) { + return false; + } + + return $this->stream->tell() >= $this->offset + $this->limit; + } + + /** + * Returns the size of the limited subset of data + */ + public function getSize(): ?int + { + if (null === ($length = $this->stream->getSize())) { + return null; + } elseif ($this->limit === -1) { + return $length - $this->offset; + } else { + return min($this->limit, $length - $this->offset); + } + } + + /** + * Allow for a bounded seek on the read limited stream + */ + public function seek($offset, $whence = SEEK_SET): void + { + if ($whence !== SEEK_SET || $offset < 0) { + throw new \RuntimeException(sprintf( + 'Cannot seek to offset %s with whence %s', + $offset, + $whence + )); + } + + $offset += $this->offset; + + if ($this->limit !== -1) { + if ($offset > $this->offset + $this->limit) { + $offset = $this->offset + $this->limit; + } + } + + $this->stream->seek($offset); + } + + /** + * Give a relative tell() + */ + public function tell(): int + { + return $this->stream->tell() - $this->offset; + } + + /** + * Set the offset to start limiting from + * + * @param int $offset Offset to seek to and begin byte limiting from + * + * @throws \RuntimeException if the stream cannot be seeked. + */ + public function setOffset(int $offset): void + { + $current = $this->stream->tell(); + + if ($current !== $offset) { + // If the stream cannot seek to the offset position, then read to it + if ($this->stream->isSeekable()) { + $this->stream->seek($offset); + } elseif ($current > $offset) { + throw new \RuntimeException("Could not seek to stream offset $offset"); + } else { + $this->stream->read($offset - $current); + } + } + + $this->offset = $offset; + } + + /** + * Set the limit of bytes that the decorator allows to be read from the + * stream. + * + * @param int $limit Number of bytes to allow to be read from the stream. + * Use -1 for no limit. + */ + public function setLimit(int $limit): void + { + $this->limit = $limit; + } + + public function read($length): string + { + if ($this->limit === -1) { + return $this->stream->read($length); + } + + // Check if the current position is less than the total allowed + // bytes + original offset + $remaining = ($this->offset + $this->limit) - $this->stream->tell(); + if ($remaining > 0) { + // Only return the amount of requested data, ensuring that the byte + // limit is not exceeded + return $this->stream->read(min($remaining, $length)); + } + + return ''; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Message.php b/vendor/guzzlehttp/psr7/src/Message.php new file mode 100644 index 00000000..9b825b30 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Message.php @@ -0,0 +1,242 @@ +getMethod() . ' ' + . $message->getRequestTarget()) + . ' HTTP/' . $message->getProtocolVersion(); + if (!$message->hasHeader('host')) { + $msg .= "\r\nHost: " . $message->getUri()->getHost(); + } + } elseif ($message instanceof ResponseInterface) { + $msg = 'HTTP/' . $message->getProtocolVersion() . ' ' + . $message->getStatusCode() . ' ' + . $message->getReasonPhrase(); + } else { + throw new \InvalidArgumentException('Unknown message type'); + } + + foreach ($message->getHeaders() as $name => $values) { + if (strtolower($name) === 'set-cookie') { + foreach ($values as $value) { + $msg .= "\r\n{$name}: " . $value; + } + } else { + $msg .= "\r\n{$name}: " . implode(', ', $values); + } + } + + return "{$msg}\r\n\r\n" . $message->getBody(); + } + + /** + * Get a short summary of the message body. + * + * Will return `null` if the response is not printable. + * + * @param MessageInterface $message The message to get the body summary + * @param int $truncateAt The maximum allowed size of the summary + */ + public static function bodySummary(MessageInterface $message, int $truncateAt = 120): ?string + { + $body = $message->getBody(); + + if (!$body->isSeekable() || !$body->isReadable()) { + return null; + } + + $size = $body->getSize(); + + if ($size === 0) { + return null; + } + + $summary = $body->read($truncateAt); + $body->rewind(); + + if ($size > $truncateAt) { + $summary .= ' (truncated...)'; + } + + // Matches any printable character, including unicode characters: + // letters, marks, numbers, punctuation, spacing, and separators. + if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary)) { + return null; + } + + return $summary; + } + + /** + * Attempts to rewind a message body and throws an exception on failure. + * + * The body of the message will only be rewound if a call to `tell()` + * returns a value other than `0`. + * + * @param MessageInterface $message Message to rewind + * + * @throws \RuntimeException + */ + public static function rewindBody(MessageInterface $message): void + { + $body = $message->getBody(); + + if ($body->tell()) { + $body->rewind(); + } + } + + /** + * Parses an HTTP message into an associative array. + * + * The array contains the "start-line" key containing the start line of + * the message, "headers" key containing an associative array of header + * array values, and a "body" key containing the body of the message. + * + * @param string $message HTTP request or response to parse. + */ + public static function parseMessage(string $message): array + { + if (!$message) { + throw new \InvalidArgumentException('Invalid message'); + } + + $message = ltrim($message, "\r\n"); + + $messageParts = preg_split("/\r?\n\r?\n/", $message, 2); + + if ($messageParts === false || count($messageParts) !== 2) { + throw new \InvalidArgumentException('Invalid message: Missing header delimiter'); + } + + [$rawHeaders, $body] = $messageParts; + $rawHeaders .= "\r\n"; // Put back the delimiter we split previously + $headerParts = preg_split("/\r?\n/", $rawHeaders, 2); + + if ($headerParts === false || count($headerParts) !== 2) { + throw new \InvalidArgumentException('Invalid message: Missing status line'); + } + + [$startLine, $rawHeaders] = $headerParts; + + if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') { + // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0 + $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders); + } + + /** @var array[] $headerLines */ + $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER); + + // If these aren't the same, then one line didn't match and there's an invalid header. + if ($count !== substr_count($rawHeaders, "\n")) { + // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4 + if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) { + throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding'); + } + + throw new \InvalidArgumentException('Invalid header syntax'); + } + + $headers = []; + + foreach ($headerLines as $headerLine) { + $headers[$headerLine[1]][] = $headerLine[2]; + } + + return [ + 'start-line' => $startLine, + 'headers' => $headers, + 'body' => $body, + ]; + } + + /** + * Constructs a URI for an HTTP request message. + * + * @param string $path Path from the start-line + * @param array $headers Array of headers (each value an array). + */ + public static function parseRequestUri(string $path, array $headers): string + { + $hostKey = array_filter(array_keys($headers), function ($k) { + return strtolower($k) === 'host'; + }); + + // If no host is found, then a full URI cannot be constructed. + if (!$hostKey) { + return $path; + } + + $host = $headers[reset($hostKey)][0]; + $scheme = substr($host, -4) === ':443' ? 'https' : 'http'; + + return $scheme . '://' . $host . '/' . ltrim($path, '/'); + } + + /** + * Parses a request message string into a request object. + * + * @param string $message Request message string. + */ + public static function parseRequest(string $message): RequestInterface + { + $data = self::parseMessage($message); + $matches = []; + if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) { + throw new \InvalidArgumentException('Invalid request string'); + } + $parts = explode(' ', $data['start-line'], 3); + $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1'; + + $request = new Request( + $parts[0], + $matches[1] === '/' ? self::parseRequestUri($parts[1], $data['headers']) : $parts[1], + $data['headers'], + $data['body'], + $version + ); + + return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]); + } + + /** + * Parses a response message string into a response object. + * + * @param string $message Response message string. + */ + public static function parseResponse(string $message): ResponseInterface + { + $data = self::parseMessage($message); + // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space + // between status-code and reason-phrase is required. But browsers accept + // responses without space and reason as well. + if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) { + throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']); + } + $parts = explode(' ', $data['start-line'], 3); + + return new Response( + (int) $parts[1], + $data['headers'], + $data['body'], + explode('/', $parts[0])[1], + $parts[2] ?? null + ); + } +} diff --git a/vendor/guzzlehttp/psr7/src/MessageTrait.php b/vendor/guzzlehttp/psr7/src/MessageTrait.php new file mode 100644 index 00000000..503c280b --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/MessageTrait.php @@ -0,0 +1,235 @@ + Map of all registered headers, as original name => array of values */ + private $headers = []; + + /** @var array Map of lowercase header name => original name at registration */ + private $headerNames = []; + + /** @var string */ + private $protocol = '1.1'; + + /** @var StreamInterface|null */ + private $stream; + + public function getProtocolVersion(): string + { + return $this->protocol; + } + + public function withProtocolVersion($version): MessageInterface + { + if ($this->protocol === $version) { + return $this; + } + + $new = clone $this; + $new->protocol = $version; + return $new; + } + + public function getHeaders(): array + { + return $this->headers; + } + + public function hasHeader($header): bool + { + return isset($this->headerNames[strtolower($header)]); + } + + public function getHeader($header): array + { + $header = strtolower($header); + + if (!isset($this->headerNames[$header])) { + return []; + } + + $header = $this->headerNames[$header]; + + return $this->headers[$header]; + } + + public function getHeaderLine($header): string + { + return implode(', ', $this->getHeader($header)); + } + + public function withHeader($header, $value): MessageInterface + { + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + unset($new->headers[$new->headerNames[$normalized]]); + } + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + + return $new; + } + + public function withAddedHeader($header, $value): MessageInterface + { + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $new->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + } + + return $new; + } + + public function withoutHeader($header): MessageInterface + { + $normalized = strtolower($header); + + if (!isset($this->headerNames[$normalized])) { + return $this; + } + + $header = $this->headerNames[$normalized]; + + $new = clone $this; + unset($new->headers[$header], $new->headerNames[$normalized]); + + return $new; + } + + public function getBody(): StreamInterface + { + if (!$this->stream) { + $this->stream = Utils::streamFor(''); + } + + return $this->stream; + } + + public function withBody(StreamInterface $body): MessageInterface + { + if ($body === $this->stream) { + return $this; + } + + $new = clone $this; + $new->stream = $body; + return $new; + } + + /** + * @param array $headers + */ + private function setHeaders(array $headers): void + { + $this->headerNames = $this->headers = []; + foreach ($headers as $header => $value) { + if (is_int($header)) { + // Numeric array keys are converted to int by PHP but having a header name '123' is not forbidden by the spec + // and also allowed in withHeader(). So we need to cast it to string again for the following assertion to pass. + $header = (string) $header; + } + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + if (isset($this->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $this->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $this->headerNames[$normalized] = $header; + $this->headers[$header] = $value; + } + } + } + + /** + * @param mixed $value + * + * @return string[] + */ + private function normalizeHeaderValue($value): array + { + if (!is_array($value)) { + return $this->trimHeaderValues([$value]); + } + + if (count($value) === 0) { + throw new \InvalidArgumentException('Header value can not be an empty array.'); + } + + return $this->trimHeaderValues($value); + } + + /** + * Trims whitespace from the header values. + * + * Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field. + * + * header-field = field-name ":" OWS field-value OWS + * OWS = *( SP / HTAB ) + * + * @param mixed[] $values Header values + * + * @return string[] Trimmed header values + * + * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 + */ + private function trimHeaderValues(array $values): array + { + return array_map(function ($value) { + if (!is_scalar($value) && null !== $value) { + throw new \InvalidArgumentException(sprintf( + 'Header value must be scalar or null but %s provided.', + is_object($value) ? get_class($value) : gettype($value) + )); + } + + return trim((string) $value, " \t"); + }, array_values($values)); + } + + /** + * @see https://tools.ietf.org/html/rfc7230#section-3.2 + * + * @param mixed $header + */ + private function assertHeader($header): void + { + if (!is_string($header)) { + throw new \InvalidArgumentException(sprintf( + 'Header name must be a string but %s provided.', + is_object($header) ? get_class($header) : gettype($header) + )); + } + + if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $header)) { + throw new \InvalidArgumentException( + sprintf( + '"%s" is not valid header name', + $header + ) + ); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/MimeType.php b/vendor/guzzlehttp/psr7/src/MimeType.php new file mode 100644 index 00000000..dfa94251 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/MimeType.php @@ -0,0 +1,130 @@ + 'video/3gpp', + '7z' => 'application/x-7z-compressed', + 'aac' => 'audio/x-aac', + 'ai' => 'application/postscript', + 'aif' => 'audio/x-aiff', + 'asc' => 'text/plain', + 'asf' => 'video/x-ms-asf', + 'atom' => 'application/atom+xml', + 'avi' => 'video/x-msvideo', + 'bmp' => 'image/bmp', + 'bz2' => 'application/x-bzip2', + 'cer' => 'application/pkix-cert', + 'crl' => 'application/pkix-crl', + 'crt' => 'application/x-x509-ca-cert', + 'css' => 'text/css', + 'csv' => 'text/csv', + 'cu' => 'application/cu-seeme', + 'deb' => 'application/x-debian-package', + 'doc' => 'application/msword', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'dvi' => 'application/x-dvi', + 'eot' => 'application/vnd.ms-fontobject', + 'eps' => 'application/postscript', + 'epub' => 'application/epub+zip', + 'etx' => 'text/x-setext', + 'flac' => 'audio/flac', + 'flv' => 'video/x-flv', + 'gif' => 'image/gif', + 'gz' => 'application/gzip', + 'htm' => 'text/html', + 'html' => 'text/html', + 'ico' => 'image/x-icon', + 'ics' => 'text/calendar', + 'ini' => 'text/plain', + 'iso' => 'application/x-iso9660-image', + 'jar' => 'application/java-archive', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'js' => 'text/javascript', + 'json' => 'application/json', + 'latex' => 'application/x-latex', + 'log' => 'text/plain', + 'm4a' => 'audio/mp4', + 'm4v' => 'video/mp4', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mov' => 'video/quicktime', + 'mkv' => 'video/x-matroska', + 'mp3' => 'audio/mpeg', + 'mp4' => 'video/mp4', + 'mp4a' => 'audio/mp4', + 'mp4v' => 'video/mp4', + 'mpe' => 'video/mpeg', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpg4' => 'video/mp4', + 'oga' => 'audio/ogg', + 'ogg' => 'audio/ogg', + 'ogv' => 'video/ogg', + 'ogx' => 'application/ogg', + 'pbm' => 'image/x-portable-bitmap', + 'pdf' => 'application/pdf', + 'pgm' => 'image/x-portable-graymap', + 'png' => 'image/png', + 'pnm' => 'image/x-portable-anymap', + 'ppm' => 'image/x-portable-pixmap', + 'ppt' => 'application/vnd.ms-powerpoint', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'ps' => 'application/postscript', + 'qt' => 'video/quicktime', + 'rar' => 'application/x-rar-compressed', + 'ras' => 'image/x-cmu-raster', + 'rss' => 'application/rss+xml', + 'rtf' => 'application/rtf', + 'sgm' => 'text/sgml', + 'sgml' => 'text/sgml', + 'svg' => 'image/svg+xml', + 'swf' => 'application/x-shockwave-flash', + 'tar' => 'application/x-tar', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'torrent' => 'application/x-bittorrent', + 'ttf' => 'application/x-font-ttf', + 'txt' => 'text/plain', + 'wav' => 'audio/x-wav', + 'webm' => 'video/webm', + 'webp' => 'image/webp', + 'wma' => 'audio/x-ms-wma', + 'wmv' => 'video/x-ms-wmv', + 'woff' => 'application/x-font-woff', + 'wsdl' => 'application/wsdl+xml', + 'xbm' => 'image/x-xbitmap', + 'xls' => 'application/vnd.ms-excel', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xml' => 'application/xml', + 'xpm' => 'image/x-xpixmap', + 'xwd' => 'image/x-xwindowdump', + 'yaml' => 'text/yaml', + 'yml' => 'text/yaml', + 'zip' => 'application/zip', + ]; + + /** + * Determines the mimetype of a file by looking at its extension. + */ + public static function fromFilename(string $filename): ?string + { + return self::fromExtension(pathinfo($filename, PATHINFO_EXTENSION)); + } + + /** + * Maps a file extensions to a mimetype. + * + * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types + */ + public static function fromExtension(string $extension): ?string + { + return self::MIME_TYPES[strtolower($extension)] ?? null; + } +} diff --git a/vendor/guzzlehttp/psr7/src/MultipartStream.php b/vendor/guzzlehttp/psr7/src/MultipartStream.php new file mode 100644 index 00000000..f76d7c61 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/MultipartStream.php @@ -0,0 +1,153 @@ +boundary = $boundary ?: sha1(uniqid('', true)); + $this->stream = $this->createStream($elements); + } + + public function getBoundary(): string + { + return $this->boundary; + } + + public function isWritable(): bool + { + return false; + } + + /** + * Get the headers needed before transferring the content of a POST file + * + * @param array $headers + */ + private function getHeaders(array $headers): string + { + $str = ''; + foreach ($headers as $key => $value) { + $str .= "{$key}: {$value}\r\n"; + } + + return "--{$this->boundary}\r\n" . trim($str) . "\r\n\r\n"; + } + + /** + * Create the aggregate stream that will be used to upload the POST data + */ + protected function createStream(array $elements = []): StreamInterface + { + $stream = new AppendStream(); + + foreach ($elements as $element) { + $this->addElement($stream, $element); + } + + // Add the trailing boundary with CRLF + $stream->addStream(Utils::streamFor("--{$this->boundary}--\r\n")); + + return $stream; + } + + private function addElement(AppendStream $stream, array $element): void + { + foreach (['contents', 'name'] as $key) { + if (!array_key_exists($key, $element)) { + throw new \InvalidArgumentException("A '{$key}' key is required"); + } + } + + $element['contents'] = Utils::streamFor($element['contents']); + + if (empty($element['filename'])) { + $uri = $element['contents']->getMetadata('uri'); + if (substr($uri, 0, 6) !== 'php://') { + $element['filename'] = $uri; + } + } + + [$body, $headers] = $this->createElement( + $element['name'], + $element['contents'], + $element['filename'] ?? null, + $element['headers'] ?? [] + ); + + $stream->addStream(Utils::streamFor($this->getHeaders($headers))); + $stream->addStream($body); + $stream->addStream(Utils::streamFor("\r\n")); + } + + private function createElement(string $name, StreamInterface $stream, ?string $filename, array $headers): array + { + // Set a default content-disposition header if one was no provided + $disposition = $this->getHeader($headers, 'content-disposition'); + if (!$disposition) { + $headers['Content-Disposition'] = ($filename === '0' || $filename) + ? sprintf( + 'form-data; name="%s"; filename="%s"', + $name, + basename($filename) + ) + : "form-data; name=\"{$name}\""; + } + + // Set a default content-length header if one was no provided + $length = $this->getHeader($headers, 'content-length'); + if (!$length) { + if ($length = $stream->getSize()) { + $headers['Content-Length'] = (string) $length; + } + } + + // Set a default Content-Type if one was not supplied + $type = $this->getHeader($headers, 'content-type'); + if (!$type && ($filename === '0' || $filename)) { + if ($type = MimeType::fromFilename($filename)) { + $headers['Content-Type'] = $type; + } + } + + return [$stream, $headers]; + } + + private function getHeader(array $headers, string $key) + { + $lowercaseHeader = strtolower($key); + foreach ($headers as $k => $v) { + if (strtolower($k) === $lowercaseHeader) { + return $v; + } + } + + return null; + } +} diff --git a/vendor/guzzlehttp/psr7/src/NoSeekStream.php b/vendor/guzzlehttp/psr7/src/NoSeekStream.php new file mode 100644 index 00000000..99e25b9e --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/NoSeekStream.php @@ -0,0 +1,25 @@ +source = $source; + $this->size = $options['size'] ?? null; + $this->metadata = $options['metadata'] ?? []; + $this->buffer = new BufferStream(); + } + + public function __toString(): string + { + try { + return Utils::copyToString($this); + } catch (\Throwable $e) { + if (\PHP_VERSION_ID >= 70400) { + throw $e; + } + trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + return ''; + } + } + + public function close(): void + { + $this->detach(); + } + + public function detach() + { + $this->tellPos = 0; + $this->source = null; + + return null; + } + + public function getSize(): ?int + { + return $this->size; + } + + public function tell(): int + { + return $this->tellPos; + } + + public function eof(): bool + { + return $this->source === null; + } + + public function isSeekable(): bool + { + return false; + } + + public function rewind(): void + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET): void + { + throw new \RuntimeException('Cannot seek a PumpStream'); + } + + public function isWritable(): bool + { + return false; + } + + public function write($string): int + { + throw new \RuntimeException('Cannot write to a PumpStream'); + } + + public function isReadable(): bool + { + return true; + } + + public function read($length): string + { + $data = $this->buffer->read($length); + $readLen = strlen($data); + $this->tellPos += $readLen; + $remaining = $length - $readLen; + + if ($remaining) { + $this->pump($remaining); + $data .= $this->buffer->read($remaining); + $this->tellPos += strlen($data) - $readLen; + } + + return $data; + } + + public function getContents(): string + { + $result = ''; + while (!$this->eof()) { + $result .= $this->read(1000000); + } + + return $result; + } + + /** + * {@inheritdoc} + * + * @return mixed + */ + public function getMetadata($key = null) + { + if (!$key) { + return $this->metadata; + } + + return $this->metadata[$key] ?? null; + } + + private function pump(int $length): void + { + if ($this->source) { + do { + $data = call_user_func($this->source, $length); + if ($data === false || $data === null) { + $this->source = null; + return; + } + $this->buffer->write($data); + $length -= strlen($data); + } while ($length > 0); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/Query.php b/vendor/guzzlehttp/psr7/src/Query.php new file mode 100644 index 00000000..4fd0ca96 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Query.php @@ -0,0 +1,113 @@ + '1', 'foo[b]' => '2'])`. + * + * @param string $str Query string to parse + * @param int|bool $urlEncoding How the query string is encoded + */ + public static function parse(string $str, $urlEncoding = true): array + { + $result = []; + + if ($str === '') { + return $result; + } + + if ($urlEncoding === true) { + $decoder = function ($value) { + return rawurldecode(str_replace('+', ' ', (string) $value)); + }; + } elseif ($urlEncoding === PHP_QUERY_RFC3986) { + $decoder = 'rawurldecode'; + } elseif ($urlEncoding === PHP_QUERY_RFC1738) { + $decoder = 'urldecode'; + } else { + $decoder = function ($str) { + return $str; + }; + } + + foreach (explode('&', $str) as $kvp) { + $parts = explode('=', $kvp, 2); + $key = $decoder($parts[0]); + $value = isset($parts[1]) ? $decoder($parts[1]) : null; + if (!isset($result[$key])) { + $result[$key] = $value; + } else { + if (!is_array($result[$key])) { + $result[$key] = [$result[$key]]; + } + $result[$key][] = $value; + } + } + + return $result; + } + + /** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + */ + public static function build(array $params, $encoding = PHP_QUERY_RFC3986): string + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder((string) $k); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? (int) $v : $v; + if ($v !== null) { + $qs .= '=' . $encoder((string) $v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? (int) $vv : $vv; + if ($vv !== null) { + $qs .= '=' . $encoder((string) $vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Request.php b/vendor/guzzlehttp/psr7/src/Request.php new file mode 100644 index 00000000..b17af66a --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Request.php @@ -0,0 +1,157 @@ + $headers Request headers + * @param string|resource|StreamInterface|null $body Request body + * @param string $version Protocol version + */ + public function __construct( + string $method, + $uri, + array $headers = [], + $body = null, + string $version = '1.1' + ) { + $this->assertMethod($method); + if (!($uri instanceof UriInterface)) { + $uri = new Uri($uri); + } + + $this->method = strtoupper($method); + $this->uri = $uri; + $this->setHeaders($headers); + $this->protocol = $version; + + if (!isset($this->headerNames['host'])) { + $this->updateHostFromUri(); + } + + if ($body !== '' && $body !== null) { + $this->stream = Utils::streamFor($body); + } + } + + public function getRequestTarget(): string + { + if ($this->requestTarget !== null) { + return $this->requestTarget; + } + + $target = $this->uri->getPath(); + if ($target === '') { + $target = '/'; + } + if ($this->uri->getQuery() != '') { + $target .= '?' . $this->uri->getQuery(); + } + + return $target; + } + + public function withRequestTarget($requestTarget): RequestInterface + { + if (preg_match('#\s#', $requestTarget)) { + throw new InvalidArgumentException( + 'Invalid request target provided; cannot contain whitespace' + ); + } + + $new = clone $this; + $new->requestTarget = $requestTarget; + return $new; + } + + public function getMethod(): string + { + return $this->method; + } + + public function withMethod($method): RequestInterface + { + $this->assertMethod($method); + $new = clone $this; + $new->method = strtoupper($method); + return $new; + } + + public function getUri(): UriInterface + { + return $this->uri; + } + + public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface + { + if ($uri === $this->uri) { + return $this; + } + + $new = clone $this; + $new->uri = $uri; + + if (!$preserveHost || !isset($this->headerNames['host'])) { + $new->updateHostFromUri(); + } + + return $new; + } + + private function updateHostFromUri(): void + { + $host = $this->uri->getHost(); + + if ($host == '') { + return; + } + + if (($port = $this->uri->getPort()) !== null) { + $host .= ':' . $port; + } + + if (isset($this->headerNames['host'])) { + $header = $this->headerNames['host']; + } else { + $header = 'Host'; + $this->headerNames['host'] = 'Host'; + } + // Ensure Host is the first header. + // See: http://tools.ietf.org/html/rfc7230#section-5.4 + $this->headers = [$header => [$host]] + $this->headers; + } + + /** + * @param mixed $method + */ + private function assertMethod($method): void + { + if (!is_string($method) || $method === '') { + throw new InvalidArgumentException('Method must be a non-empty string.'); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/Response.php b/vendor/guzzlehttp/psr7/src/Response.php new file mode 100644 index 00000000..4c6ee6f0 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Response.php @@ -0,0 +1,160 @@ + 'Continue', + 101 => 'Switching Protocols', + 102 => 'Processing', + 200 => 'OK', + 201 => 'Created', + 202 => 'Accepted', + 203 => 'Non-Authoritative Information', + 204 => 'No Content', + 205 => 'Reset Content', + 206 => 'Partial Content', + 207 => 'Multi-status', + 208 => 'Already Reported', + 300 => 'Multiple Choices', + 301 => 'Moved Permanently', + 302 => 'Found', + 303 => 'See Other', + 304 => 'Not Modified', + 305 => 'Use Proxy', + 306 => 'Switch Proxy', + 307 => 'Temporary Redirect', + 308 => 'Permanent Redirect', + 400 => 'Bad Request', + 401 => 'Unauthorized', + 402 => 'Payment Required', + 403 => 'Forbidden', + 404 => 'Not Found', + 405 => 'Method Not Allowed', + 406 => 'Not Acceptable', + 407 => 'Proxy Authentication Required', + 408 => 'Request Time-out', + 409 => 'Conflict', + 410 => 'Gone', + 411 => 'Length Required', + 412 => 'Precondition Failed', + 413 => 'Request Entity Too Large', + 414 => 'Request-URI Too Large', + 415 => 'Unsupported Media Type', + 416 => 'Requested range not satisfiable', + 417 => 'Expectation Failed', + 418 => 'I\'m a teapot', + 422 => 'Unprocessable Entity', + 423 => 'Locked', + 424 => 'Failed Dependency', + 425 => 'Unordered Collection', + 426 => 'Upgrade Required', + 428 => 'Precondition Required', + 429 => 'Too Many Requests', + 431 => 'Request Header Fields Too Large', + 451 => 'Unavailable For Legal Reasons', + 500 => 'Internal Server Error', + 501 => 'Not Implemented', + 502 => 'Bad Gateway', + 503 => 'Service Unavailable', + 504 => 'Gateway Time-out', + 505 => 'HTTP Version not supported', + 506 => 'Variant Also Negotiates', + 507 => 'Insufficient Storage', + 508 => 'Loop Detected', + 510 => 'Not Extended', + 511 => 'Network Authentication Required', + ]; + + /** @var string */ + private $reasonPhrase; + + /** @var int */ + private $statusCode; + + /** + * @param int $status Status code + * @param array $headers Response headers + * @param string|resource|StreamInterface|null $body Response body + * @param string $version Protocol version + * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) + */ + public function __construct( + int $status = 200, + array $headers = [], + $body = null, + string $version = '1.1', + string $reason = null + ) { + $this->assertStatusCodeRange($status); + + $this->statusCode = $status; + + if ($body !== '' && $body !== null) { + $this->stream = Utils::streamFor($body); + } + + $this->setHeaders($headers); + if ($reason == '' && isset(self::PHRASES[$this->statusCode])) { + $this->reasonPhrase = self::PHRASES[$this->statusCode]; + } else { + $this->reasonPhrase = (string) $reason; + } + + $this->protocol = $version; + } + + public function getStatusCode(): int + { + return $this->statusCode; + } + + public function getReasonPhrase(): string + { + return $this->reasonPhrase; + } + + public function withStatus($code, $reasonPhrase = ''): ResponseInterface + { + $this->assertStatusCodeIsInteger($code); + $code = (int) $code; + $this->assertStatusCodeRange($code); + + $new = clone $this; + $new->statusCode = $code; + if ($reasonPhrase == '' && isset(self::PHRASES[$new->statusCode])) { + $reasonPhrase = self::PHRASES[$new->statusCode]; + } + $new->reasonPhrase = (string) $reasonPhrase; + return $new; + } + + /** + * @param mixed $statusCode + */ + private function assertStatusCodeIsInteger($statusCode): void + { + if (filter_var($statusCode, FILTER_VALIDATE_INT) === false) { + throw new \InvalidArgumentException('Status code must be an integer value.'); + } + } + + private function assertStatusCodeRange(int $statusCode): void + { + if ($statusCode < 100 || $statusCode >= 600) { + throw new \InvalidArgumentException('Status code must be an integer value between 1xx and 5xx.'); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/Rfc7230.php b/vendor/guzzlehttp/psr7/src/Rfc7230.php new file mode 100644 index 00000000..30224018 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Rfc7230.php @@ -0,0 +1,23 @@ +@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m"; + public const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)"; +} diff --git a/vendor/guzzlehttp/psr7/src/ServerRequest.php b/vendor/guzzlehttp/psr7/src/ServerRequest.php new file mode 100644 index 00000000..6ae3f9be --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/ServerRequest.php @@ -0,0 +1,344 @@ + $headers Request headers + * @param string|resource|StreamInterface|null $body Request body + * @param string $version Protocol version + * @param array $serverParams Typically the $_SERVER superglobal + */ + public function __construct( + string $method, + $uri, + array $headers = [], + $body = null, + string $version = '1.1', + array $serverParams = [] + ) { + $this->serverParams = $serverParams; + + parent::__construct($method, $uri, $headers, $body, $version); + } + + /** + * Return an UploadedFile instance array. + * + * @param array $files A array which respect $_FILES structure + * + * @throws InvalidArgumentException for unrecognized values + */ + public static function normalizeFiles(array $files): array + { + $normalized = []; + + foreach ($files as $key => $value) { + if ($value instanceof UploadedFileInterface) { + $normalized[$key] = $value; + } elseif (is_array($value) && isset($value['tmp_name'])) { + $normalized[$key] = self::createUploadedFileFromSpec($value); + } elseif (is_array($value)) { + $normalized[$key] = self::normalizeFiles($value); + continue; + } else { + throw new InvalidArgumentException('Invalid value in files specification'); + } + } + + return $normalized; + } + + /** + * Create and return an UploadedFile instance from a $_FILES specification. + * + * If the specification represents an array of values, this method will + * delegate to normalizeNestedFileSpec() and return that return value. + * + * @param array $value $_FILES struct + * + * @return UploadedFileInterface|UploadedFileInterface[] + */ + private static function createUploadedFileFromSpec(array $value) + { + if (is_array($value['tmp_name'])) { + return self::normalizeNestedFileSpec($value); + } + + return new UploadedFile( + $value['tmp_name'], + (int) $value['size'], + (int) $value['error'], + $value['name'], + $value['type'] + ); + } + + /** + * Normalize an array of file specifications. + * + * Loops through all nested files and returns a normalized array of + * UploadedFileInterface instances. + * + * @return UploadedFileInterface[] + */ + private static function normalizeNestedFileSpec(array $files = []): array + { + $normalizedFiles = []; + + foreach (array_keys($files['tmp_name']) as $key) { + $spec = [ + 'tmp_name' => $files['tmp_name'][$key], + 'size' => $files['size'][$key], + 'error' => $files['error'][$key], + 'name' => $files['name'][$key], + 'type' => $files['type'][$key], + ]; + $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec); + } + + return $normalizedFiles; + } + + /** + * Return a ServerRequest populated with superglobals: + * $_GET + * $_POST + * $_COOKIE + * $_FILES + * $_SERVER + */ + public static function fromGlobals(): ServerRequestInterface + { + $method = $_SERVER['REQUEST_METHOD'] ?? 'GET'; + $headers = getallheaders(); + $uri = self::getUriFromGlobals(); + $body = new CachingStream(new LazyOpenStream('php://input', 'r+')); + $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1'; + + $serverRequest = new ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER); + + return $serverRequest + ->withCookieParams($_COOKIE) + ->withQueryParams($_GET) + ->withParsedBody($_POST) + ->withUploadedFiles(self::normalizeFiles($_FILES)); + } + + private static function extractHostAndPortFromAuthority(string $authority): array + { + $uri = 'http://' . $authority; + $parts = parse_url($uri); + if (false === $parts) { + return [null, null]; + } + + $host = $parts['host'] ?? null; + $port = $parts['port'] ?? null; + + return [$host, $port]; + } + + /** + * Get a Uri populated with values from $_SERVER. + */ + public static function getUriFromGlobals(): UriInterface + { + $uri = new Uri(''); + + $uri = $uri->withScheme(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http'); + + $hasPort = false; + if (isset($_SERVER['HTTP_HOST'])) { + [$host, $port] = self::extractHostAndPortFromAuthority($_SERVER['HTTP_HOST']); + if ($host !== null) { + $uri = $uri->withHost($host); + } + + if ($port !== null) { + $hasPort = true; + $uri = $uri->withPort($port); + } + } elseif (isset($_SERVER['SERVER_NAME'])) { + $uri = $uri->withHost($_SERVER['SERVER_NAME']); + } elseif (isset($_SERVER['SERVER_ADDR'])) { + $uri = $uri->withHost($_SERVER['SERVER_ADDR']); + } + + if (!$hasPort && isset($_SERVER['SERVER_PORT'])) { + $uri = $uri->withPort($_SERVER['SERVER_PORT']); + } + + $hasQuery = false; + if (isset($_SERVER['REQUEST_URI'])) { + $requestUriParts = explode('?', $_SERVER['REQUEST_URI'], 2); + $uri = $uri->withPath($requestUriParts[0]); + if (isset($requestUriParts[1])) { + $hasQuery = true; + $uri = $uri->withQuery($requestUriParts[1]); + } + } + + if (!$hasQuery && isset($_SERVER['QUERY_STRING'])) { + $uri = $uri->withQuery($_SERVER['QUERY_STRING']); + } + + return $uri; + } + + public function getServerParams(): array + { + return $this->serverParams; + } + + public function getUploadedFiles(): array + { + return $this->uploadedFiles; + } + + public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface + { + $new = clone $this; + $new->uploadedFiles = $uploadedFiles; + + return $new; + } + + public function getCookieParams(): array + { + return $this->cookieParams; + } + + public function withCookieParams(array $cookies): ServerRequestInterface + { + $new = clone $this; + $new->cookieParams = $cookies; + + return $new; + } + + public function getQueryParams(): array + { + return $this->queryParams; + } + + public function withQueryParams(array $query): ServerRequestInterface + { + $new = clone $this; + $new->queryParams = $query; + + return $new; + } + + /** + * {@inheritdoc} + * + * @return array|object|null + */ + public function getParsedBody() + { + return $this->parsedBody; + } + + public function withParsedBody($data): ServerRequestInterface + { + $new = clone $this; + $new->parsedBody = $data; + + return $new; + } + + public function getAttributes(): array + { + return $this->attributes; + } + + /** + * {@inheritdoc} + * + * @return mixed + */ + public function getAttribute($attribute, $default = null) + { + if (false === array_key_exists($attribute, $this->attributes)) { + return $default; + } + + return $this->attributes[$attribute]; + } + + public function withAttribute($attribute, $value): ServerRequestInterface + { + $new = clone $this; + $new->attributes[$attribute] = $value; + + return $new; + } + + public function withoutAttribute($attribute): ServerRequestInterface + { + if (false === array_key_exists($attribute, $this->attributes)) { + return $this; + } + + $new = clone $this; + unset($new->attributes[$attribute]); + + return $new; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Stream.php b/vendor/guzzlehttp/psr7/src/Stream.php new file mode 100644 index 00000000..d389427c --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Stream.php @@ -0,0 +1,279 @@ +size = $options['size']; + } + + $this->customMetadata = $options['metadata'] ?? []; + $this->stream = $stream; + $meta = stream_get_meta_data($this->stream); + $this->seekable = $meta['seekable']; + $this->readable = (bool)preg_match(self::READABLE_MODES, $meta['mode']); + $this->writable = (bool)preg_match(self::WRITABLE_MODES, $meta['mode']); + $this->uri = $this->getMetadata('uri'); + } + + /** + * Closes the stream when the destructed + */ + public function __destruct() + { + $this->close(); + } + + public function __toString(): string + { + try { + if ($this->isSeekable()) { + $this->seek(0); + } + return $this->getContents(); + } catch (\Throwable $e) { + if (\PHP_VERSION_ID >= 70400) { + throw $e; + } + trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + return ''; + } + } + + public function getContents(): string + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + $contents = stream_get_contents($this->stream); + + if ($contents === false) { + throw new \RuntimeException('Unable to read stream contents'); + } + + return $contents; + } + + public function close(): void + { + if (isset($this->stream)) { + if (is_resource($this->stream)) { + fclose($this->stream); + } + $this->detach(); + } + } + + public function detach() + { + if (!isset($this->stream)) { + return null; + } + + $result = $this->stream; + unset($this->stream); + $this->size = $this->uri = null; + $this->readable = $this->writable = $this->seekable = false; + + return $result; + } + + public function getSize(): ?int + { + if ($this->size !== null) { + return $this->size; + } + + if (!isset($this->stream)) { + return null; + } + + // Clear the stat cache if the stream has a URI + if ($this->uri) { + clearstatcache(true, $this->uri); + } + + $stats = fstat($this->stream); + if (is_array($stats) && isset($stats['size'])) { + $this->size = $stats['size']; + return $this->size; + } + + return null; + } + + public function isReadable(): bool + { + return $this->readable; + } + + public function isWritable(): bool + { + return $this->writable; + } + + public function isSeekable(): bool + { + return $this->seekable; + } + + public function eof(): bool + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + return feof($this->stream); + } + + public function tell(): int + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + $result = ftell($this->stream); + + if ($result === false) { + throw new \RuntimeException('Unable to determine stream position'); + } + + return $result; + } + + public function rewind(): void + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET): void + { + $whence = (int) $whence; + + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->seekable) { + throw new \RuntimeException('Stream is not seekable'); + } + if (fseek($this->stream, $offset, $whence) === -1) { + throw new \RuntimeException('Unable to seek to stream position ' + . $offset . ' with whence ' . var_export($whence, true)); + } + } + + public function read($length): string + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->readable) { + throw new \RuntimeException('Cannot read from non-readable stream'); + } + if ($length < 0) { + throw new \RuntimeException('Length parameter cannot be negative'); + } + + if (0 === $length) { + return ''; + } + + $string = fread($this->stream, $length); + if (false === $string) { + throw new \RuntimeException('Unable to read from stream'); + } + + return $string; + } + + public function write($string): int + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->writable) { + throw new \RuntimeException('Cannot write to a non-writable stream'); + } + + // We can't know the size after writing anything + $this->size = null; + $result = fwrite($this->stream, $string); + + if ($result === false) { + throw new \RuntimeException('Unable to write to stream'); + } + + return $result; + } + + /** + * {@inheritdoc} + * + * @return mixed + */ + public function getMetadata($key = null) + { + if (!isset($this->stream)) { + return $key ? null : []; + } elseif (!$key) { + return $this->customMetadata + stream_get_meta_data($this->stream); + } elseif (isset($this->customMetadata[$key])) { + return $this->customMetadata[$key]; + } + + $meta = stream_get_meta_data($this->stream); + + return $meta[$key] ?? null; + } +} diff --git a/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php new file mode 100644 index 00000000..56d4104d --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php @@ -0,0 +1,155 @@ +stream = $stream; + } + + /** + * Magic method used to create a new stream if streams are not added in + * the constructor of a decorator (e.g., LazyOpenStream). + * + * @return StreamInterface + */ + public function __get(string $name) + { + if ($name === 'stream') { + $this->stream = $this->createStream(); + return $this->stream; + } + + throw new \UnexpectedValueException("$name not found on class"); + } + + public function __toString(): string + { + try { + if ($this->isSeekable()) { + $this->seek(0); + } + return $this->getContents(); + } catch (\Throwable $e) { + if (\PHP_VERSION_ID >= 70400) { + throw $e; + } + trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + return ''; + } + } + + public function getContents(): string + { + return Utils::copyToString($this); + } + + /** + * Allow decorators to implement custom methods + * + * @return mixed + */ + public function __call(string $method, array $args) + { + /** @var callable $callable */ + $callable = [$this->stream, $method]; + $result = call_user_func_array($callable, $args); + + // Always return the wrapped object if the result is a return $this + return $result === $this->stream ? $this : $result; + } + + public function close(): void + { + $this->stream->close(); + } + + /** + * {@inheritdoc} + * + * @return mixed + */ + public function getMetadata($key = null) + { + return $this->stream->getMetadata($key); + } + + public function detach() + { + return $this->stream->detach(); + } + + public function getSize(): ?int + { + return $this->stream->getSize(); + } + + public function eof(): bool + { + return $this->stream->eof(); + } + + public function tell(): int + { + return $this->stream->tell(); + } + + public function isReadable(): bool + { + return $this->stream->isReadable(); + } + + public function isWritable(): bool + { + return $this->stream->isWritable(); + } + + public function isSeekable(): bool + { + return $this->stream->isSeekable(); + } + + public function rewind(): void + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET): void + { + $this->stream->seek($offset, $whence); + } + + public function read($length): string + { + return $this->stream->read($length); + } + + public function write($string): int + { + return $this->stream->write($string); + } + + /** + * Implement in subclasses to dynamically create streams when requested. + * + * @throws \BadMethodCallException + */ + protected function createStream(): StreamInterface + { + throw new \BadMethodCallException('Not implemented'); + } +} diff --git a/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/vendor/guzzlehttp/psr7/src/StreamWrapper.php new file mode 100644 index 00000000..2a934640 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/StreamWrapper.php @@ -0,0 +1,175 @@ +isReadable()) { + $mode = $stream->isWritable() ? 'r+' : 'r'; + } elseif ($stream->isWritable()) { + $mode = 'w'; + } else { + throw new \InvalidArgumentException('The stream must be readable, ' + . 'writable, or both.'); + } + + return fopen('guzzle://stream', $mode, false, self::createStreamContext($stream)); + } + + /** + * Creates a stream context that can be used to open a stream as a php stream resource. + * + * @return resource + */ + public static function createStreamContext(StreamInterface $stream) + { + return stream_context_create([ + 'guzzle' => ['stream' => $stream] + ]); + } + + /** + * Registers the stream wrapper if needed + */ + public static function register(): void + { + if (!in_array('guzzle', stream_get_wrappers())) { + stream_wrapper_register('guzzle', __CLASS__); + } + } + + public function stream_open(string $path, string $mode, int $options, string &$opened_path = null): bool + { + $options = stream_context_get_options($this->context); + + if (!isset($options['guzzle']['stream'])) { + return false; + } + + $this->mode = $mode; + $this->stream = $options['guzzle']['stream']; + + return true; + } + + public function stream_read(int $count): string + { + return $this->stream->read($count); + } + + public function stream_write(string $data): int + { + return $this->stream->write($data); + } + + public function stream_tell(): int + { + return $this->stream->tell(); + } + + public function stream_eof(): bool + { + return $this->stream->eof(); + } + + public function stream_seek(int $offset, int $whence): bool + { + $this->stream->seek($offset, $whence); + + return true; + } + + /** + * @return resource|false + */ + public function stream_cast(int $cast_as) + { + $stream = clone($this->stream); + $resource = $stream->detach(); + + return $resource ?? false; + } + + /** + * @return array + */ + public function stream_stat(): array + { + static $modeMap = [ + 'r' => 33060, + 'rb' => 33060, + 'r+' => 33206, + 'w' => 33188, + 'wb' => 33188 + ]; + + return [ + 'dev' => 0, + 'ino' => 0, + 'mode' => $modeMap[$this->mode], + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => $this->stream->getSize() ?: 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, + 'blksize' => 0, + 'blocks' => 0 + ]; + } + + /** + * @return array + */ + public function url_stat(string $path, int $flags): array + { + return [ + 'dev' => 0, + 'ino' => 0, + 'mode' => 0, + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, + 'blksize' => 0, + 'blocks' => 0 + ]; + } +} diff --git a/vendor/guzzlehttp/psr7/src/UploadedFile.php b/vendor/guzzlehttp/psr7/src/UploadedFile.php new file mode 100644 index 00000000..b1521bcf --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/UploadedFile.php @@ -0,0 +1,211 @@ +setError($errorStatus); + $this->size = $size; + $this->clientFilename = $clientFilename; + $this->clientMediaType = $clientMediaType; + + if ($this->isOk()) { + $this->setStreamOrFile($streamOrFile); + } + } + + /** + * Depending on the value set file or stream variable + * + * @param StreamInterface|string|resource $streamOrFile + * + * @throws InvalidArgumentException + */ + private function setStreamOrFile($streamOrFile): void + { + if (is_string($streamOrFile)) { + $this->file = $streamOrFile; + } elseif (is_resource($streamOrFile)) { + $this->stream = new Stream($streamOrFile); + } elseif ($streamOrFile instanceof StreamInterface) { + $this->stream = $streamOrFile; + } else { + throw new InvalidArgumentException( + 'Invalid stream or file provided for UploadedFile' + ); + } + } + + /** + * @throws InvalidArgumentException + */ + private function setError(int $error): void + { + if (false === in_array($error, UploadedFile::ERRORS, true)) { + throw new InvalidArgumentException( + 'Invalid error status for UploadedFile' + ); + } + + $this->error = $error; + } + + private function isStringNotEmpty($param): bool + { + return is_string($param) && false === empty($param); + } + + /** + * Return true if there is no upload error + */ + private function isOk(): bool + { + return $this->error === UPLOAD_ERR_OK; + } + + public function isMoved(): bool + { + return $this->moved; + } + + /** + * @throws RuntimeException if is moved or not ok + */ + private function validateActive(): void + { + if (false === $this->isOk()) { + throw new RuntimeException('Cannot retrieve stream due to upload error'); + } + + if ($this->isMoved()) { + throw new RuntimeException('Cannot retrieve stream after it has already been moved'); + } + } + + public function getStream(): StreamInterface + { + $this->validateActive(); + + if ($this->stream instanceof StreamInterface) { + return $this->stream; + } + + /** @var string $file */ + $file = $this->file; + + return new LazyOpenStream($file, 'r+'); + } + + public function moveTo($targetPath): void + { + $this->validateActive(); + + if (false === $this->isStringNotEmpty($targetPath)) { + throw new InvalidArgumentException( + 'Invalid path provided for move operation; must be a non-empty string' + ); + } + + if ($this->file) { + $this->moved = PHP_SAPI === 'cli' + ? rename($this->file, $targetPath) + : move_uploaded_file($this->file, $targetPath); + } else { + Utils::copyToStream( + $this->getStream(), + new LazyOpenStream($targetPath, 'w') + ); + + $this->moved = true; + } + + if (false === $this->moved) { + throw new RuntimeException( + sprintf('Uploaded file could not be moved to %s', $targetPath) + ); + } + } + + public function getSize(): ?int + { + return $this->size; + } + + public function getError(): int + { + return $this->error; + } + + public function getClientFilename(): ?string + { + return $this->clientFilename; + } + + public function getClientMediaType(): ?string + { + return $this->clientMediaType; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Uri.php b/vendor/guzzlehttp/psr7/src/Uri.php new file mode 100644 index 00000000..3898f783 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Uri.php @@ -0,0 +1,733 @@ + 80, + 'https' => 443, + 'ftp' => 21, + 'gopher' => 70, + 'nntp' => 119, + 'news' => 119, + 'telnet' => 23, + 'tn3270' => 23, + 'imap' => 143, + 'pop' => 110, + 'ldap' => 389, + ]; + + /** + * Unreserved characters for use in a regex. + * + * @link https://tools.ietf.org/html/rfc3986#section-2.3 + */ + private const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~'; + + /** + * Sub-delims for use in a regex. + * + * @link https://tools.ietf.org/html/rfc3986#section-2.2 + */ + private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;='; + private const QUERY_SEPARATORS_REPLACEMENT = ['=' => '%3D', '&' => '%26']; + + /** @var string Uri scheme. */ + private $scheme = ''; + + /** @var string Uri user info. */ + private $userInfo = ''; + + /** @var string Uri host. */ + private $host = ''; + + /** @var int|null Uri port. */ + private $port; + + /** @var string Uri path. */ + private $path = ''; + + /** @var string Uri query string. */ + private $query = ''; + + /** @var string Uri fragment. */ + private $fragment = ''; + + /** @var string|null String representation */ + private $composedComponents; + + public function __construct(string $uri = '') + { + if ($uri !== '') { + $parts = self::parse($uri); + if ($parts === false) { + throw new MalformedUriException("Unable to parse URI: $uri"); + } + $this->applyParts($parts); + } + } + /** + * UTF-8 aware \parse_url() replacement. + * + * The internal function produces broken output for non ASCII domain names + * (IDN) when used with locales other than "C". + * + * On the other hand, cURL understands IDN correctly only when UTF-8 locale + * is configured ("C.UTF-8", "en_US.UTF-8", etc.). + * + * @see https://bugs.php.net/bug.php?id=52923 + * @see https://www.php.net/manual/en/function.parse-url.php#114817 + * @see https://curl.haxx.se/libcurl/c/CURLOPT_URL.html#ENCODING + * + * @return array|false + */ + private static function parse(string $url) + { + // If IPv6 + $prefix = ''; + if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) { + /** @var array{0:string, 1:string, 2:string} $matches */ + $prefix = $matches[1]; + $url = $matches[2]; + } + + /** @var string */ + $encodedUrl = preg_replace_callback( + '%[^:/@?&=#]+%usD', + static function ($matches) { + return urlencode($matches[0]); + }, + $url + ); + + $result = parse_url($prefix . $encodedUrl); + + if ($result === false) { + return false; + } + + return array_map('urldecode', $result); + } + + public function __toString(): string + { + if ($this->composedComponents === null) { + $this->composedComponents = self::composeComponents( + $this->scheme, + $this->getAuthority(), + $this->path, + $this->query, + $this->fragment + ); + } + + return $this->composedComponents; + } + + /** + * Composes a URI reference string from its various components. + * + * Usually this method does not need to be called manually but instead is used indirectly via + * `Psr\Http\Message\UriInterface::__toString`. + * + * PSR-7 UriInterface treats an empty component the same as a missing component as + * getQuery(), getFragment() etc. always return a string. This explains the slight + * difference to RFC 3986 Section 5.3. + * + * Another adjustment is that the authority separator is added even when the authority is missing/empty + * for the "file" scheme. This is because PHP stream functions like `file_get_contents` only work with + * `file:///myfile` but not with `file:/myfile` although they are equivalent according to RFC 3986. But + * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to + * that format). + * + * @link https://tools.ietf.org/html/rfc3986#section-5.3 + */ + public static function composeComponents(?string $scheme, ?string $authority, string $path, ?string $query, ?string $fragment): string + { + $uri = ''; + + // weak type checks to also accept null until we can add scalar type hints + if ($scheme != '') { + $uri .= $scheme . ':'; + } + + if ($authority != ''|| $scheme === 'file') { + $uri .= '//' . $authority; + } + + $uri .= $path; + + if ($query != '') { + $uri .= '?' . $query; + } + + if ($fragment != '') { + $uri .= '#' . $fragment; + } + + return $uri; + } + + /** + * Whether the URI has the default port of the current scheme. + * + * `Psr\Http\Message\UriInterface::getPort` may return null or the standard port. This method can be used + * independently of the implementation. + */ + public static function isDefaultPort(UriInterface $uri): bool + { + return $uri->getPort() === null + || (isset(self::DEFAULT_PORTS[$uri->getScheme()]) && $uri->getPort() === self::DEFAULT_PORTS[$uri->getScheme()]); + } + + /** + * Whether the URI is absolute, i.e. it has a scheme. + * + * An instance of UriInterface can either be an absolute URI or a relative reference. This method returns true + * if it is the former. An absolute URI has a scheme. A relative reference is used to express a URI relative + * to another URI, the base URI. Relative references can be divided into several forms: + * - network-path references, e.g. '//example.com/path' + * - absolute-path references, e.g. '/path' + * - relative-path references, e.g. 'subpath' + * + * @see Uri::isNetworkPathReference + * @see Uri::isAbsolutePathReference + * @see Uri::isRelativePathReference + * @link https://tools.ietf.org/html/rfc3986#section-4 + */ + public static function isAbsolute(UriInterface $uri): bool + { + return $uri->getScheme() !== ''; + } + + /** + * Whether the URI is a network-path reference. + * + * A relative reference that begins with two slash characters is termed an network-path reference. + * + * @link https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isNetworkPathReference(UriInterface $uri): bool + { + return $uri->getScheme() === '' && $uri->getAuthority() !== ''; + } + + /** + * Whether the URI is a absolute-path reference. + * + * A relative reference that begins with a single slash character is termed an absolute-path reference. + * + * @link https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isAbsolutePathReference(UriInterface $uri): bool + { + return $uri->getScheme() === '' + && $uri->getAuthority() === '' + && isset($uri->getPath()[0]) + && $uri->getPath()[0] === '/'; + } + + /** + * Whether the URI is a relative-path reference. + * + * A relative reference that does not begin with a slash character is termed a relative-path reference. + * + * @link https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isRelativePathReference(UriInterface $uri): bool + { + return $uri->getScheme() === '' + && $uri->getAuthority() === '' + && (!isset($uri->getPath()[0]) || $uri->getPath()[0] !== '/'); + } + + /** + * Whether the URI is a same-document reference. + * + * A same-document reference refers to a URI that is, aside from its fragment + * component, identical to the base URI. When no base URI is given, only an empty + * URI reference (apart from its fragment) is considered a same-document reference. + * + * @param UriInterface $uri The URI to check + * @param UriInterface|null $base An optional base URI to compare against + * + * @link https://tools.ietf.org/html/rfc3986#section-4.4 + */ + public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool + { + if ($base !== null) { + $uri = UriResolver::resolve($base, $uri); + + return ($uri->getScheme() === $base->getScheme()) + && ($uri->getAuthority() === $base->getAuthority()) + && ($uri->getPath() === $base->getPath()) + && ($uri->getQuery() === $base->getQuery()); + } + + return $uri->getScheme() === '' && $uri->getAuthority() === '' && $uri->getPath() === '' && $uri->getQuery() === ''; + } + + /** + * Creates a new URI with a specific query string value removed. + * + * Any existing query string values that exactly match the provided key are + * removed. + * + * @param UriInterface $uri URI to use as a base. + * @param string $key Query string key to remove. + */ + public static function withoutQueryValue(UriInterface $uri, string $key): UriInterface + { + $result = self::getFilteredQueryString($uri, [$key]); + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a new URI with a specific query string value. + * + * Any existing query string values that exactly match the provided key are + * removed and replaced with the given key value pair. + * + * A value of null will set the query string key without a value, e.g. "key" + * instead of "key=value". + * + * @param UriInterface $uri URI to use as a base. + * @param string $key Key to set. + * @param string|null $value Value to set + */ + public static function withQueryValue(UriInterface $uri, string $key, ?string $value): UriInterface + { + $result = self::getFilteredQueryString($uri, [$key]); + + $result[] = self::generateQueryString($key, $value); + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a new URI with multiple specific query string values. + * + * It has the same behavior as withQueryValue() but for an associative array of key => value. + * + * @param UriInterface $uri URI to use as a base. + * @param array $keyValueArray Associative array of key and values + */ + public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface + { + $result = self::getFilteredQueryString($uri, array_keys($keyValueArray)); + + foreach ($keyValueArray as $key => $value) { + $result[] = self::generateQueryString((string) $key, $value !== null ? (string) $value : null); + } + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a URI from a hash of `parse_url` components. + * + * @link http://php.net/manual/en/function.parse-url.php + * + * @throws MalformedUriException If the components do not form a valid URI. + */ + public static function fromParts(array $parts): UriInterface + { + $uri = new self(); + $uri->applyParts($parts); + $uri->validateState(); + + return $uri; + } + + public function getScheme(): string + { + return $this->scheme; + } + + public function getAuthority(): string + { + $authority = $this->host; + if ($this->userInfo !== '') { + $authority = $this->userInfo . '@' . $authority; + } + + if ($this->port !== null) { + $authority .= ':' . $this->port; + } + + return $authority; + } + + public function getUserInfo(): string + { + return $this->userInfo; + } + + public function getHost(): string + { + return $this->host; + } + + public function getPort(): ?int + { + return $this->port; + } + + public function getPath(): string + { + return $this->path; + } + + public function getQuery(): string + { + return $this->query; + } + + public function getFragment(): string + { + return $this->fragment; + } + + public function withScheme($scheme): UriInterface + { + $scheme = $this->filterScheme($scheme); + + if ($this->scheme === $scheme) { + return $this; + } + + $new = clone $this; + $new->scheme = $scheme; + $new->composedComponents = null; + $new->removeDefaultPort(); + $new->validateState(); + + return $new; + } + + public function withUserInfo($user, $password = null): UriInterface + { + $info = $this->filterUserInfoComponent($user); + if ($password !== null) { + $info .= ':' . $this->filterUserInfoComponent($password); + } + + if ($this->userInfo === $info) { + return $this; + } + + $new = clone $this; + $new->userInfo = $info; + $new->composedComponents = null; + $new->validateState(); + + return $new; + } + + public function withHost($host): UriInterface + { + $host = $this->filterHost($host); + + if ($this->host === $host) { + return $this; + } + + $new = clone $this; + $new->host = $host; + $new->composedComponents = null; + $new->validateState(); + + return $new; + } + + public function withPort($port): UriInterface + { + $port = $this->filterPort($port); + + if ($this->port === $port) { + return $this; + } + + $new = clone $this; + $new->port = $port; + $new->composedComponents = null; + $new->removeDefaultPort(); + $new->validateState(); + + return $new; + } + + public function withPath($path): UriInterface + { + $path = $this->filterPath($path); + + if ($this->path === $path) { + return $this; + } + + $new = clone $this; + $new->path = $path; + $new->composedComponents = null; + $new->validateState(); + + return $new; + } + + public function withQuery($query): UriInterface + { + $query = $this->filterQueryAndFragment($query); + + if ($this->query === $query) { + return $this; + } + + $new = clone $this; + $new->query = $query; + $new->composedComponents = null; + + return $new; + } + + public function withFragment($fragment): UriInterface + { + $fragment = $this->filterQueryAndFragment($fragment); + + if ($this->fragment === $fragment) { + return $this; + } + + $new = clone $this; + $new->fragment = $fragment; + $new->composedComponents = null; + + return $new; + } + + /** + * Apply parse_url parts to a URI. + * + * @param array $parts Array of parse_url parts to apply. + */ + private function applyParts(array $parts): void + { + $this->scheme = isset($parts['scheme']) + ? $this->filterScheme($parts['scheme']) + : ''; + $this->userInfo = isset($parts['user']) + ? $this->filterUserInfoComponent($parts['user']) + : ''; + $this->host = isset($parts['host']) + ? $this->filterHost($parts['host']) + : ''; + $this->port = isset($parts['port']) + ? $this->filterPort($parts['port']) + : null; + $this->path = isset($parts['path']) + ? $this->filterPath($parts['path']) + : ''; + $this->query = isset($parts['query']) + ? $this->filterQueryAndFragment($parts['query']) + : ''; + $this->fragment = isset($parts['fragment']) + ? $this->filterQueryAndFragment($parts['fragment']) + : ''; + if (isset($parts['pass'])) { + $this->userInfo .= ':' . $this->filterUserInfoComponent($parts['pass']); + } + + $this->removeDefaultPort(); + } + + /** + * @param mixed $scheme + * + * @throws \InvalidArgumentException If the scheme is invalid. + */ + private function filterScheme($scheme): string + { + if (!is_string($scheme)) { + throw new \InvalidArgumentException('Scheme must be a string'); + } + + return \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); + } + + /** + * @param mixed $component + * + * @throws \InvalidArgumentException If the user info is invalid. + */ + private function filterUserInfoComponent($component): string + { + if (!is_string($component)) { + throw new \InvalidArgumentException('User info must be a string'); + } + + return preg_replace_callback( + '/(?:[^%' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . ']+|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $component + ); + } + + /** + * @param mixed $host + * + * @throws \InvalidArgumentException If the host is invalid. + */ + private function filterHost($host): string + { + if (!is_string($host)) { + throw new \InvalidArgumentException('Host must be a string'); + } + + return \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); + } + + /** + * @param mixed $port + * + * @throws \InvalidArgumentException If the port is invalid. + */ + private function filterPort($port): ?int + { + if ($port === null) { + return null; + } + + $port = (int) $port; + if (0 > $port || 0xffff < $port) { + throw new \InvalidArgumentException( + sprintf('Invalid port: %d. Must be between 0 and 65535', $port) + ); + } + + return $port; + } + + /** + * @param string[] $keys + * + * @return string[] + */ + private static function getFilteredQueryString(UriInterface $uri, array $keys): array + { + $current = $uri->getQuery(); + + if ($current === '') { + return []; + } + + $decodedKeys = array_map('rawurldecode', $keys); + + return array_filter(explode('&', $current), function ($part) use ($decodedKeys) { + return !in_array(rawurldecode(explode('=', $part)[0]), $decodedKeys, true); + }); + } + + private static function generateQueryString(string $key, ?string $value): string + { + // Query string separators ("=", "&") within the key or value need to be encoded + // (while preventing double-encoding) before setting the query string. All other + // chars that need percent-encoding will be encoded by withQuery(). + $queryString = strtr($key, self::QUERY_SEPARATORS_REPLACEMENT); + + if ($value !== null) { + $queryString .= '=' . strtr($value, self::QUERY_SEPARATORS_REPLACEMENT); + } + + return $queryString; + } + + private function removeDefaultPort(): void + { + if ($this->port !== null && self::isDefaultPort($this)) { + $this->port = null; + } + } + + /** + * Filters the path of a URI + * + * @param mixed $path + * + * @throws \InvalidArgumentException If the path is invalid. + */ + private function filterPath($path): string + { + if (!is_string($path)) { + throw new \InvalidArgumentException('Path must be a string'); + } + + return preg_replace_callback( + '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $path + ); + } + + /** + * Filters the query string or fragment of a URI. + * + * @param mixed $str + * + * @throws \InvalidArgumentException If the query or fragment is invalid. + */ + private function filterQueryAndFragment($str): string + { + if (!is_string($str)) { + throw new \InvalidArgumentException('Query and fragment must be a string'); + } + + return preg_replace_callback( + '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $str + ); + } + + private function rawurlencodeMatchZero(array $match): string + { + return rawurlencode($match[0]); + } + + private function validateState(): void + { + if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) { + $this->host = self::HTTP_DEFAULT_HOST; + } + + if ($this->getAuthority() === '') { + if (0 === strpos($this->path, '//')) { + throw new MalformedUriException('The path of a URI without an authority must not start with two slashes "//"'); + } + if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) { + throw new MalformedUriException('A relative URI must not have a path beginning with a segment containing a colon'); + } + } elseif (isset($this->path[0]) && $this->path[0] !== '/') { + throw new MalformedUriException('The path of a URI with an authority must start with a slash "/" or be empty'); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/vendor/guzzlehttp/psr7/src/UriNormalizer.php new file mode 100644 index 00000000..e12971ed --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/UriNormalizer.php @@ -0,0 +1,220 @@ +getPath() === '' && + ($uri->getScheme() === 'http' || $uri->getScheme() === 'https') + ) { + $uri = $uri->withPath('/'); + } + + if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'localhost') { + $uri = $uri->withHost(''); + } + + if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && Uri::isDefaultPort($uri)) { + $uri = $uri->withPort(null); + } + + if ($flags & self::REMOVE_DOT_SEGMENTS && !Uri::isRelativePathReference($uri)) { + $uri = $uri->withPath(UriResolver::removeDotSegments($uri->getPath())); + } + + if ($flags & self::REMOVE_DUPLICATE_SLASHES) { + $uri = $uri->withPath(preg_replace('#//++#', '/', $uri->getPath())); + } + + if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') { + $queryKeyValues = explode('&', $uri->getQuery()); + sort($queryKeyValues); + $uri = $uri->withQuery(implode('&', $queryKeyValues)); + } + + return $uri; + } + + /** + * Whether two URIs can be considered equivalent. + * + * Both URIs are normalized automatically before comparison with the given $normalizations bitmask. The method also + * accepts relative URI references and returns true when they are equivalent. This of course assumes they will be + * resolved against the same base URI. If this is not the case, determination of equivalence or difference of + * relative references does not mean anything. + * + * @param UriInterface $uri1 An URI to compare + * @param UriInterface $uri2 An URI to compare + * @param int $normalizations A bitmask of normalizations to apply, see constants + * + * @link https://tools.ietf.org/html/rfc3986#section-6.1 + */ + public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, int $normalizations = self::PRESERVING_NORMALIZATIONS): bool + { + return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations); + } + + private static function capitalizePercentEncoding(UriInterface $uri): UriInterface + { + $regex = '/(?:%[A-Fa-f0-9]{2})++/'; + + $callback = function (array $match) { + return strtoupper($match[0]); + }; + + return + $uri->withPath( + preg_replace_callback($regex, $callback, $uri->getPath()) + )->withQuery( + preg_replace_callback($regex, $callback, $uri->getQuery()) + ); + } + + private static function decodeUnreservedCharacters(UriInterface $uri): UriInterface + { + $regex = '/%(?:2D|2E|5F|7E|3[0-9]|[46][1-9A-F]|[57][0-9A])/i'; + + $callback = function (array $match) { + return rawurldecode($match[0]); + }; + + return + $uri->withPath( + preg_replace_callback($regex, $callback, $uri->getPath()) + )->withQuery( + preg_replace_callback($regex, $callback, $uri->getQuery()) + ); + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/vendor/guzzlehttp/psr7/src/UriResolver.php b/vendor/guzzlehttp/psr7/src/UriResolver.php new file mode 100644 index 00000000..426e5c9a --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/UriResolver.php @@ -0,0 +1,211 @@ +getScheme() != '') { + return $rel->withPath(self::removeDotSegments($rel->getPath())); + } + + if ($rel->getAuthority() != '') { + $targetAuthority = $rel->getAuthority(); + $targetPath = self::removeDotSegments($rel->getPath()); + $targetQuery = $rel->getQuery(); + } else { + $targetAuthority = $base->getAuthority(); + if ($rel->getPath() === '') { + $targetPath = $base->getPath(); + $targetQuery = $rel->getQuery() != '' ? $rel->getQuery() : $base->getQuery(); + } else { + if ($rel->getPath()[0] === '/') { + $targetPath = $rel->getPath(); + } else { + if ($targetAuthority != '' && $base->getPath() === '') { + $targetPath = '/' . $rel->getPath(); + } else { + $lastSlashPos = strrpos($base->getPath(), '/'); + if ($lastSlashPos === false) { + $targetPath = $rel->getPath(); + } else { + $targetPath = substr($base->getPath(), 0, $lastSlashPos + 1) . $rel->getPath(); + } + } + } + $targetPath = self::removeDotSegments($targetPath); + $targetQuery = $rel->getQuery(); + } + } + + return new Uri(Uri::composeComponents( + $base->getScheme(), + $targetAuthority, + $targetPath, + $targetQuery, + $rel->getFragment() + )); + } + + /** + * Returns the target URI as a relative reference from the base URI. + * + * This method is the counterpart to resolve(): + * + * (string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) + * + * One use-case is to use the current request URI as base URI and then generate relative links in your documents + * to reduce the document size or offer self-contained downloadable document archives. + * + * $base = new Uri('http://example.com/a/b/'); + * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. + * echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. + * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. + * echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. + * + * This method also accepts a target that is already relative and will try to relativize it further. Only a + * relative-path reference will be returned as-is. + * + * echo UriResolver::relativize($base, new Uri('/a/b/c')); // prints 'c' as well + */ + public static function relativize(UriInterface $base, UriInterface $target): UriInterface + { + if ($target->getScheme() !== '' && + ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '') + ) { + return $target; + } + + if (Uri::isRelativePathReference($target)) { + // As the target is already highly relative we return it as-is. It would be possible to resolve + // the target with `$target = self::resolve($base, $target);` and then try make it more relative + // by removing a duplicate query. But let's not do that automatically. + return $target; + } + + if ($target->getAuthority() !== '' && $base->getAuthority() !== $target->getAuthority()) { + return $target->withScheme(''); + } + + // We must remove the path before removing the authority because if the path starts with two slashes, the URI + // would turn invalid. And we also cannot set a relative path before removing the authority, as that is also + // invalid. + $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(null)->withHost(''); + + if ($base->getPath() !== $target->getPath()) { + return $emptyPathUri->withPath(self::getRelativePath($base, $target)); + } + + if ($base->getQuery() === $target->getQuery()) { + // Only the target fragment is left. And it must be returned even if base and target fragment are the same. + return $emptyPathUri->withQuery(''); + } + + // If the base URI has a query but the target has none, we cannot return an empty path reference as it would + // inherit the base query component when resolving. + if ($target->getQuery() === '') { + $segments = explode('/', $target->getPath()); + /** @var string $lastSegment */ + $lastSegment = end($segments); + + return $emptyPathUri->withPath($lastSegment === '' ? './' : $lastSegment); + } + + return $emptyPathUri; + } + + private static function getRelativePath(UriInterface $base, UriInterface $target): string + { + $sourceSegments = explode('/', $base->getPath()); + $targetSegments = explode('/', $target->getPath()); + array_pop($sourceSegments); + $targetLastSegment = array_pop($targetSegments); + foreach ($sourceSegments as $i => $segment) { + if (isset($targetSegments[$i]) && $segment === $targetSegments[$i]) { + unset($sourceSegments[$i], $targetSegments[$i]); + } else { + break; + } + } + $targetSegments[] = $targetLastSegment; + $relativePath = str_repeat('../', count($sourceSegments)) . implode('/', $targetSegments); + + // A reference to am empty last segment or an empty first sub-segment must be prefixed with "./". + // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used + // as the first segment of a relative-path reference, as it would be mistaken for a scheme name. + if ('' === $relativePath || false !== strpos(explode('/', $relativePath, 2)[0], ':')) { + $relativePath = "./$relativePath"; + } elseif ('/' === $relativePath[0]) { + if ($base->getAuthority() != '' && $base->getPath() === '') { + // In this case an extra slash is added by resolve() automatically. So we must not add one here. + $relativePath = ".$relativePath"; + } else { + $relativePath = "./$relativePath"; + } + } + + return $relativePath; + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/vendor/guzzlehttp/psr7/src/Utils.php b/vendor/guzzlehttp/psr7/src/Utils.php new file mode 100644 index 00000000..6cc04ee4 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Utils.php @@ -0,0 +1,412 @@ + $v) { + if (!is_string($k) || !in_array(strtolower($k), $keys)) { + $result[$k] = $v; + } + } + + return $result; + } + + /** + * Copy the contents of a stream into another stream until the given number + * of bytes have been read. + * + * @param StreamInterface $source Stream to read from + * @param StreamInterface $dest Stream to write to + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + * + * @throws \RuntimeException on error. + */ + public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void + { + $bufferSize = 8192; + + if ($maxLen === -1) { + while (!$source->eof()) { + if (!$dest->write($source->read($bufferSize))) { + break; + } + } + } else { + $remaining = $maxLen; + while ($remaining > 0 && !$source->eof()) { + $buf = $source->read(min($bufferSize, $remaining)); + $len = strlen($buf); + if (!$len) { + break; + } + $remaining -= $len; + $dest->write($buf); + } + } + } + + /** + * Copy the contents of a stream into a string until the given number of + * bytes have been read. + * + * @param StreamInterface $stream Stream to read + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + * + * @throws \RuntimeException on error. + */ + public static function copyToString(StreamInterface $stream, int $maxLen = -1): string + { + $buffer = ''; + + if ($maxLen === -1) { + while (!$stream->eof()) { + $buf = $stream->read(1048576); + if ($buf === '') { + break; + } + $buffer .= $buf; + } + return $buffer; + } + + $len = 0; + while (!$stream->eof() && $len < $maxLen) { + $buf = $stream->read($maxLen - $len); + if ($buf === '') { + break; + } + $buffer .= $buf; + $len = strlen($buffer); + } + + return $buffer; + } + + /** + * Calculate a hash of a stream. + * + * This method reads the entire stream to calculate a rolling hash, based + * on PHP's `hash_init` functions. + * + * @param StreamInterface $stream Stream to calculate the hash for + * @param string $algo Hash algorithm (e.g. md5, crc32, etc) + * @param bool $rawOutput Whether or not to use raw output + * + * @throws \RuntimeException on error. + */ + public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string + { + $pos = $stream->tell(); + + if ($pos > 0) { + $stream->rewind(); + } + + $ctx = hash_init($algo); + while (!$stream->eof()) { + hash_update($ctx, $stream->read(1048576)); + } + + $out = hash_final($ctx, (bool) $rawOutput); + $stream->seek($pos); + + return $out; + } + + /** + * Clone and modify a request with the given changes. + * + * This method is useful for reducing the number of clones needed to mutate + * a message. + * + * The changes can be one of: + * - method: (string) Changes the HTTP method. + * - set_headers: (array) Sets the given headers. + * - remove_headers: (array) Remove the given headers. + * - body: (mixed) Sets the given body. + * - uri: (UriInterface) Set the URI. + * - query: (string) Set the query string value of the URI. + * - version: (string) Set the protocol version. + * + * @param RequestInterface $request Request to clone and modify. + * @param array $changes Changes to apply. + */ + public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface + { + if (!$changes) { + return $request; + } + + $headers = $request->getHeaders(); + + if (!isset($changes['uri'])) { + $uri = $request->getUri(); + } else { + // Remove the host header if one is on the URI + if ($host = $changes['uri']->getHost()) { + $changes['set_headers']['Host'] = $host; + + if ($port = $changes['uri']->getPort()) { + $standardPorts = ['http' => 80, 'https' => 443]; + $scheme = $changes['uri']->getScheme(); + if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { + $changes['set_headers']['Host'] .= ':' . $port; + } + } + } + $uri = $changes['uri']; + } + + if (!empty($changes['remove_headers'])) { + $headers = self::caselessRemove($changes['remove_headers'], $headers); + } + + if (!empty($changes['set_headers'])) { + $headers = self::caselessRemove(array_keys($changes['set_headers']), $headers); + $headers = $changes['set_headers'] + $headers; + } + + if (isset($changes['query'])) { + $uri = $uri->withQuery($changes['query']); + } + + if ($request instanceof ServerRequestInterface) { + $new = (new ServerRequest( + $changes['method'] ?? $request->getMethod(), + $uri, + $headers, + $changes['body'] ?? $request->getBody(), + $changes['version'] ?? $request->getProtocolVersion(), + $request->getServerParams() + )) + ->withParsedBody($request->getParsedBody()) + ->withQueryParams($request->getQueryParams()) + ->withCookieParams($request->getCookieParams()) + ->withUploadedFiles($request->getUploadedFiles()); + + foreach ($request->getAttributes() as $key => $value) { + $new = $new->withAttribute($key, $value); + } + + return $new; + } + + return new Request( + $changes['method'] ?? $request->getMethod(), + $uri, + $headers, + $changes['body'] ?? $request->getBody(), + $changes['version'] ?? $request->getProtocolVersion() + ); + } + + /** + * Read a line from the stream up to the maximum allowed buffer length. + * + * @param StreamInterface $stream Stream to read from + * @param int|null $maxLength Maximum buffer length + */ + public static function readLine(StreamInterface $stream, ?int $maxLength = null): string + { + $buffer = ''; + $size = 0; + + while (!$stream->eof()) { + if ('' === ($byte = $stream->read(1))) { + return $buffer; + } + $buffer .= $byte; + // Break when a new line is found or the max length - 1 is reached + if ($byte === "\n" || ++$size === $maxLength - 1) { + break; + } + } + + return $buffer; + } + + /** + * Create a new stream based on the input type. + * + * Options is an associative array that can contain the following keys: + * - metadata: Array of custom metadata. + * - size: Size of the stream. + * + * This method accepts the following `$resource` types: + * - `Psr\Http\Message\StreamInterface`: Returns the value as-is. + * - `string`: Creates a stream object that uses the given string as the contents. + * - `resource`: Creates a stream object that wraps the given PHP stream resource. + * - `Iterator`: If the provided value implements `Iterator`, then a read-only + * stream object will be created that wraps the given iterable. Each time the + * stream is read from, data from the iterator will fill a buffer and will be + * continuously called until the buffer is equal to the requested read size. + * Subsequent read calls will first read from the buffer and then call `next` + * on the underlying iterator until it is exhausted. + * - `object` with `__toString()`: If the object has the `__toString()` method, + * the object will be cast to a string and then a stream will be returned that + * uses the string value. + * - `NULL`: When `null` is passed, an empty stream object is returned. + * - `callable` When a callable is passed, a read-only stream object will be + * created that invokes the given callable. The callable is invoked with the + * number of suggested bytes to read. The callable can return any number of + * bytes, but MUST return `false` when there is no more data to return. The + * stream object that wraps the callable will invoke the callable until the + * number of requested bytes are available. Any additional bytes will be + * buffered and used in subsequent reads. + * + * @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data + * @param array{size?: int, metadata?: array} $options Additional options + * + * @throws \InvalidArgumentException if the $resource arg is not valid. + */ + public static function streamFor($resource = '', array $options = []): StreamInterface + { + if (is_scalar($resource)) { + $stream = self::tryFopen('php://temp', 'r+'); + if ($resource !== '') { + fwrite($stream, (string) $resource); + fseek($stream, 0); + } + return new Stream($stream, $options); + } + + switch (gettype($resource)) { + case 'resource': + /* + * The 'php://input' is a special stream with quirks and inconsistencies. + * We avoid using that stream by reading it into php://temp + */ + + /** @var resource $resource */ + if ((\stream_get_meta_data($resource)['uri'] ?? '') === 'php://input') { + $stream = self::tryFopen('php://temp', 'w+'); + fwrite($stream, stream_get_contents($resource)); + fseek($stream, 0); + $resource = $stream; + } + return new Stream($resource, $options); + case 'object': + /** @var object $resource */ + if ($resource instanceof StreamInterface) { + return $resource; + } elseif ($resource instanceof \Iterator) { + return new PumpStream(function () use ($resource) { + if (!$resource->valid()) { + return false; + } + $result = $resource->current(); + $resource->next(); + return $result; + }, $options); + } elseif (method_exists($resource, '__toString')) { + return self::streamFor((string) $resource, $options); + } + break; + case 'NULL': + return new Stream(self::tryFopen('php://temp', 'r+'), $options); + } + + if (is_callable($resource)) { + return new PumpStream($resource, $options); + } + + throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource)); + } + + /** + * Safely opens a PHP stream resource using a filename. + * + * When fopen fails, PHP normally raises a warning. This function adds an + * error handler that checks for errors and throws an exception instead. + * + * @param string $filename File to open + * @param string $mode Mode used to open the file + * + * @return resource + * + * @throws \RuntimeException if the file cannot be opened + */ + public static function tryFopen(string $filename, string $mode) + { + $ex = null; + set_error_handler(static function (int $errno, string $errstr) use ($filename, $mode, &$ex): bool { + $ex = new \RuntimeException(sprintf( + 'Unable to open "%s" using mode "%s": %s', + $filename, + $mode, + $errstr + )); + + return true; + }); + + try { + /** @var resource $handle */ + $handle = fopen($filename, $mode); + } catch (\Throwable $e) { + $ex = new \RuntimeException(sprintf( + 'Unable to open "%s" using mode "%s": %s', + $filename, + $mode, + $e->getMessage() + ), 0, $e); + } + + restore_error_handler(); + + if ($ex) { + /** @var $ex \RuntimeException */ + throw $ex; + } + + return $handle; + } + + /** + * Returns a UriInterface for the given value. + * + * This function accepts a string or UriInterface and returns a + * UriInterface for the given value. If the value is already a + * UriInterface, it is returned as-is. + * + * @param string|UriInterface $uri + * + * @throws \InvalidArgumentException + */ + public static function uriFor($uri): UriInterface + { + if ($uri instanceof UriInterface) { + return $uri; + } + + if (is_string($uri)) { + return new Uri($uri); + } + + throw new \InvalidArgumentException('URI must be a string or UriInterface'); + } +} diff --git a/vendor/guzzlehttp/psr7/vendor-bin/php-cs-fixer/composer.json b/vendor/guzzlehttp/psr7/vendor-bin/php-cs-fixer/composer.json new file mode 100644 index 00000000..d69a683b --- /dev/null +++ b/vendor/guzzlehttp/psr7/vendor-bin/php-cs-fixer/composer.json @@ -0,0 +1,9 @@ +{ + "require": { + "php": "^7.2.5 || ^8.0", + "friendsofphp/php-cs-fixer": "3.2.1" + }, + "config": { + "preferred-install": "dist" + } +} diff --git a/vendor/guzzlehttp/psr7/vendor-bin/phpstan/composer.json b/vendor/guzzlehttp/psr7/vendor-bin/phpstan/composer.json new file mode 100644 index 00000000..bfbc7273 --- /dev/null +++ b/vendor/guzzlehttp/psr7/vendor-bin/phpstan/composer.json @@ -0,0 +1,10 @@ +{ + "require": { + "php": "^7.2.5 || ^8.0", + "phpstan/phpstan": "0.12.81", + "phpstan/phpstan-deprecation-rules": "0.12.6" + }, + "config": { + "preferred-install": "dist" + } +} diff --git a/vendor/guzzlehttp/psr7/vendor-bin/psalm/composer.json b/vendor/guzzlehttp/psr7/vendor-bin/psalm/composer.json new file mode 100644 index 00000000..535a0797 --- /dev/null +++ b/vendor/guzzlehttp/psr7/vendor-bin/psalm/composer.json @@ -0,0 +1,9 @@ +{ + "require": { + "php": "^7.2.5 || ^8.0", + "psalm/phar": "4.6.2" + }, + "config": { + "preferred-install": "dist" + } +} diff --git a/vendor/http-interop/http-factory-guzzle/.github/workflows/ci.yaml b/vendor/http-interop/http-factory-guzzle/.github/workflows/ci.yaml new file mode 100644 index 00000000..6d076b84 --- /dev/null +++ b/vendor/http-interop/http-factory-guzzle/.github/workflows/ci.yaml @@ -0,0 +1,60 @@ +name: CI + +on: + pull_request: + push: + branches: [ master ] + +jobs: + run: + runs-on: ubuntu-18.04 + strategy: + fail-fast: false + matrix: + php: + - '7.3' + - '7.4' + - '8.0' + minimum_versions: [false] + coverage: ['none'] + include: + - description: 'Minimum version' + php: '7.3' + minimum_versions: true + - description: 'Log Code Coverage' + php: '8.0' + coverage: 'xdebug' + + name: PHP ${{ matrix.php }} ${{ matrix.description }} + steps: + - name: Checkout + uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + path: ~/.composer/cache/files + key: ${{ matrix.php }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: ${{ matrix.coverage }} + + - name: Install dependencies + run: composer install + if: matrix.minimum_versions == false + + - name: Install dependencies (lowest versions) + run: composer update --no-interaction --prefer-lowest + if: matrix.minimum_versions == true + + - name: Run PHPUnit tests + run: vendor/bin/phpunit + + - name: Upload code coverage + uses: codecov/codecov-action@v2 + if: matrix.coverage == 'xdebug' + with: + file: './build/logs/clover.xml' + fail_ci_if_error: true diff --git a/vendor/http-interop/http-factory-guzzle/LICENSE b/vendor/http-interop/http-factory-guzzle/LICENSE new file mode 100644 index 00000000..efb5a196 --- /dev/null +++ b/vendor/http-interop/http-factory-guzzle/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Woody Gilk + +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/http-interop/http-factory-guzzle/README.md b/vendor/http-interop/http-factory-guzzle/README.md new file mode 100644 index 00000000..3e9197e4 --- /dev/null +++ b/vendor/http-interop/http-factory-guzzle/README.md @@ -0,0 +1,7 @@ +# HTTP Factory for Guzzle + +HTTP factory implemented for [Guzzle](https://github.com/guzzle/psr7). + +**NOTE:** `guzzlehttp/psr7` includes an HTTP factory implementation starting with +version 2.0. Please use the official factory if your project can use +`"guzzlehttp/psr7": "^2.0"`. diff --git a/vendor/http-interop/http-factory-guzzle/composer.json b/vendor/http-interop/http-factory-guzzle/composer.json new file mode 100644 index 00000000..6956435a --- /dev/null +++ b/vendor/http-interop/http-factory-guzzle/composer.json @@ -0,0 +1,37 @@ +{ + "name": "http-interop/http-factory-guzzle", + "description": "An HTTP Factory using Guzzle PSR7", + "keywords": [ + "psr-7", + "psr-17", + "http", + "factory" + ], + "license": "MIT", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "provide": { + "psr/http-factory-implementation": "^1.0" + }, + "require": { + "php": ">=7.3", + "psr/http-factory": "^1.0", + "guzzlehttp/psr7": "^1.7||^2.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^9.5" + }, + "autoload": { + "psr-4": { + "Http\\Factory\\Guzzle\\": "src/" + } + }, + "suggest": { + "guzzlehttp/psr7": "Includes an HTTP factory starting in version 2.0" + } +} diff --git a/vendor/http-interop/http-factory-guzzle/src/RequestFactory.php b/vendor/http-interop/http-factory-guzzle/src/RequestFactory.php new file mode 100644 index 00000000..1ab71ee7 --- /dev/null +++ b/vendor/http-interop/http-factory-guzzle/src/RequestFactory.php @@ -0,0 +1,15 @@ +createStreamFromResource(Utils::tryFopen($file, $mode)); + } + + public function createStreamFromResource($resource): StreamInterface + { + return new Stream($resource); + } +} diff --git a/vendor/http-interop/http-factory-guzzle/src/UploadedFileFactory.php b/vendor/http-interop/http-factory-guzzle/src/UploadedFileFactory.php new file mode 100644 index 00000000..d58375bb --- /dev/null +++ b/vendor/http-interop/http-factory-guzzle/src/UploadedFileFactory.php @@ -0,0 +1,25 @@ +getSize(); + } + + return new UploadedFile($stream, $size, $error, $clientFilename, $clientMediaType); + } +} diff --git a/vendor/http-interop/http-factory-guzzle/src/UriFactory.php b/vendor/http-interop/http-factory-guzzle/src/UriFactory.php new file mode 100644 index 00000000..3250986c --- /dev/null +++ b/vendor/http-interop/http-factory-guzzle/src/UriFactory.php @@ -0,0 +1,15 @@ += 7.2 +* A [PSR-17 implementation](https://packagist.org/providers/psr/http-factory-implementation) +* A [PSR-18 implementation](https://packagist.org/providers/psr/http-client-implementation) + +## Quick install + +Via [Composer](https://getcomposer.org). + +This command will get you up and running quickly with a Guzzle HTTP client. + +```bash +composer require knplabs/github-api:^3.0 guzzlehttp/guzzle:^7.0.1 http-interop/http-factory-guzzle:^1.0 +``` + +## Advanced install + +We are decoupled from any HTTP messaging client with help by [HTTPlug](https://httplug.io). + +### Using a different http client + +```bash +composer require knplabs/github-api:^3.0 symfony/http-client nyholm/psr7 +``` + +To set up the Github client with this HTTP client + +```php +use Github\Client; +use Symfony\Component\HttpClient\HttplugClient; + +$client = Client::createWithHttpClient(new HttplugClient()); +``` + +Read more about [using different clients in our docs](doc/customize.md). + +## Framework integrations + +### Laravel + +To integrate this library in laravel [Graham Campbell](https://github.com/GrahamCampbell) created [graham-campbell/github](https://github.com/GrahamCampbell/Laravel-GitHub). See the [installation instructions](https://github.com/GrahamCampbell/Laravel-GitHub#installation) to get started in laravel. + +## Basic usage of `php-github-api` client + +```php +api('user')->repositories('ornicar'); +``` + +From `$client` object, you have access to all available GitHub api endpoints. + +## Cache usage + +This example uses the PSR6 cache pool [redis-adapter](https://github.com/php-cache/redis-adapter). See http://www.php-cache.com/ for alternatives. + +```php +connect('127.0.0.1', 6379); +// Create a PSR6 cache pool +$pool = new RedisCachePool($client); + +$client = new \Github\Client(); +$client->addCache($pool); + +// Do some request + +// Stop using cache +$client->removeCache(); +``` + +Using cache, the client will get cached responses if resources haven't changed since last time, +**without** reaching the `X-Rate-Limit` [imposed by github](http://developer.github.com/v3/#rate-limiting). + + +## Documentation + +See the [`doc` directory](doc/) for more detailed documentation. + +## License + +`php-github-api` is licensed under the MIT License - see the LICENSE file for details + +## Maintainers + +Please read [this post](https://knplabs.com/en/blog/news-for-our-foss-projects-maintenance) first. + +This library is maintained by the following people (alphabetically sorted) : +- [@acrobat](https://github.com/acrobat) +- [@Nyholm](https://github.com/Nyholm) + +## Contributors + +- Thanks to [Thibault Duplessis aka. ornicar](https://github.com/ornicar) for his first version of this library. +- Thanks to [Joseph Bielawski aka. stloyd](https://github.com/stloyd) for his contributions and support. +- Thanks to [noloh](https://github.com/noloh) for his contribution on the Object API. +- Thanks to [bshaffer](https://github.com/bshaffer) for his contribution on the Repo API. +- Thanks to [Rolf van de Krol](https://github.com/rolfvandekrol) for his countless contributions. +- Thanks to [Nicolas Pastorino](https://github.com/jeanvoye) for his contribution on the Pull Request API. +- Thanks to [Edoardo Rivello](https://github.com/erivello) for his contribution on the Gists API. +- Thanks to [Miguel Piedrafita](https://github.com/m1guelpf) for his contribution to the v4 & Apps API. +- Thanks to [Emre DEGER](https://github.com/lexor) for his contribution to the Actions API. + +Thanks to GitHub for the high quality API and documentation. diff --git a/vendor/knplabs/github-api/UPGRADE-3.0.md b/vendor/knplabs/github-api/UPGRADE-3.0.md new file mode 100644 index 00000000..738343d6 --- /dev/null +++ b/vendor/knplabs/github-api/UPGRADE-3.0.md @@ -0,0 +1,21 @@ +## UPGRADE from 2.x to 3.0 + +### General + +* The `php-http/httplug` dependency requires is bumped to minimum ^2.1. +* A client implementing `psr/http-client-implementation` is required. + To upgrade your application (default install) switch from guzzle 6 to guzzle 7 (or replace `php-http/guzzle6-adapter` with any `psr/http-client-implementation`), see the install instructions in the [README file](README.md) +* All previous deprecated code in version 2 is removed. +* The following classes are now final + * `Github\HttpClient\Message\ResponseMediator` + * `Github\HttpClient\Plugin\Authentication` + * `Github\HttpClient\Plugin\GithubExceptionThrower` + * `Github\HttpClient\Plugin\History` + * `Github\HttpClient\Plugin\PathPrepend` + +### Authentication methods + +* `Github\Client::AUTH_URL_TOKEN` use `Github\Client::AUTH_ACCESS_TOKEN` instead. +* `Github\Client::AUTH_URL_CLIENT_ID` use `Github\Client::AUTH_CLIENT_ID` instead. +* `Github\Client::AUTH_HTTP_TOKEN` use `Github\Client::AUTH_ACCESS_TOKEN` instead. +* `Github\Client::AUTH_HTTP_PASSWORD` use `Github\Client::AUTH_ACCESS_TOKEN` instead. diff --git a/vendor/knplabs/github-api/UPGRADE-4.0.md b/vendor/knplabs/github-api/UPGRADE-4.0.md new file mode 100644 index 00000000..6ede78de --- /dev/null +++ b/vendor/knplabs/github-api/UPGRADE-4.0.md @@ -0,0 +1,11 @@ +## UPGRADE from 3.x to 4.0 + +### ResultPager + +* `\Github\ResultPagerInterface::postFetch` is deprecated, and the method will be removed from the ResultPager interface/class. + +### Authentication methods + +* `Github\Client::AUTH_CLIENT_ID` is deprecated, use `Github\AuthMethod::CLIENT_ID` instead. +* `Github\Client::AUTH_ACCESS_TOKEN` is deprecated, use `Github\AuthMethod::ACCESS_TOKEN` instead. +* `Github\Client::AUTH_JWT` is deprecated, use `Github\AuthMethod::JWT` instead. diff --git a/vendor/knplabs/github-api/composer.json b/vendor/knplabs/github-api/composer.json new file mode 100644 index 00000000..71924b18 --- /dev/null +++ b/vendor/knplabs/github-api/composer.json @@ -0,0 +1,58 @@ +{ + "name": "knplabs/github-api", + "type": "library", + "description": "GitHub API v3 client", + "homepage": "https://github.com/KnpLabs/php-github-api", + "keywords": ["github", "gh", "api", "gist"], + "license": "MIT", + "authors": [ + { + "name": "KnpLabs Team", + "homepage": "http://knplabs.com" + }, + { + "name": "Thibault Duplessis", + "email": "thibault.duplessis@gmail.com", + "homepage": "http://ornicar.github.com" + } + ], + "require": { + "php": "^7.2.5 || ^8.0", + "ext-json": "*", + "php-http/cache-plugin": "^1.7.1", + "php-http/client-common": "^2.3", + "php-http/discovery": "^1.12", + "php-http/httplug": "^2.2", + "php-http/multipart-stream-builder": "^1.1.2", + "psr/cache": "^1.0|^2.0", + "psr/http-client-implementation": "^1.0", + "psr/http-factory-implementation": "^1.0", + "psr/http-message": "^1.0", + "symfony/polyfill-php80": "^1.17", + "symfony/deprecation-contracts": "^2.2" + }, + "require-dev": { + "symfony/cache": "^5.1.8", + "guzzlehttp/psr7": "^1.7", + "http-interop/http-factory-guzzle": "^1.0", + "guzzlehttp/guzzle": "^7.2", + "php-http/mock-client": "^1.4.1", + "phpstan/phpstan": "^0.12.57", + "phpstan/extension-installer": "^1.0.5", + "phpstan/phpstan-deprecation-rules": "^0.12.5", + "phpunit/phpunit": "^8.5 || ^9.4", + "symfony/phpunit-bridge": "^5.2" + }, + "autoload": { + "psr-4": { "Github\\": "lib/Github/" } + }, + "autoload-dev": { + "psr-4": { "Github\\Tests\\": "test/Github/Tests/"} + }, + "extra": { + "branch-alias": { + "dev-2.x": "2.20.x-dev", + "dev-master": "3.4.x-dev" + } + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/AbstractApi.php b/vendor/knplabs/github-api/lib/Github/Api/AbstractApi.php new file mode 100644 index 00000000..71f71cce --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/AbstractApi.php @@ -0,0 +1,224 @@ + + * @author Graham Campbell + */ +abstract class AbstractApi +{ + /** + * The client instance. + * + * @var Client + */ + private $client; + + /** + * The per page parameter. It is used by the ResultPager. + * + * @var int|null + */ + private $perPage; + + /** + * Create a new API instance. + * + * @param Client $client + * + * @return void + */ + public function __construct(Client $client) + { + $this->client = $client; + } + + /** + * Get the client instance. + * + * @return Client + */ + protected function getClient(): Client + { + return $this->client; + } + + /** + * Get the API version. + * + * @return string + */ + protected function getApiVersion(): string + { + return $this->client->getApiVersion(); + } + + /** + * @return $this + */ + public function configure() + { + return $this; + } + + /** + * Send a GET request with query parameters. + * + * @param string $path Request path. + * @param array $parameters GET parameters. + * @param array $requestHeaders Request Headers. + * + * @return array|string + */ + protected function get(string $path, array $parameters = [], array $requestHeaders = []) + { + if (null !== $this->perPage && !isset($parameters['per_page'])) { + $parameters['per_page'] = $this->perPage; + } + + if (array_key_exists('ref', $parameters) && null === $parameters['ref']) { + unset($parameters['ref']); + } + + if (count($parameters) > 0) { + $path .= '?'.http_build_query($parameters, '', '&', PHP_QUERY_RFC3986); + } + + $response = $this->client->getHttpClient()->get($path, $requestHeaders); + + return ResponseMediator::getContent($response); + } + + /** + * Send a HEAD request with query parameters. + * + * @param string $path Request path. + * @param array $parameters HEAD parameters. + * @param array $requestHeaders Request headers. + * + * @return ResponseInterface + */ + protected function head(string $path, array $parameters = [], array $requestHeaders = []): ResponseInterface + { + if (array_key_exists('ref', $parameters) && null === $parameters['ref']) { + unset($parameters['ref']); + } + + return $this->client->getHttpClient()->head($path.'?'.http_build_query($parameters, '', '&', PHP_QUERY_RFC3986), $requestHeaders); + } + + /** + * Send a POST request with JSON-encoded parameters. + * + * @param string $path Request path. + * @param array $parameters POST parameters to be JSON encoded. + * @param array $requestHeaders Request headers. + * + * @return array|string + */ + protected function post(string $path, array $parameters = [], array $requestHeaders = []) + { + return $this->postRaw( + $path, + $this->createJsonBody($parameters), + $requestHeaders + ); + } + + /** + * Send a POST request with raw data. + * + * @param string $path Request path. + * @param string $body Request body. + * @param array $requestHeaders Request headers. + * + * @return array|string + */ + protected function postRaw(string $path, $body, array $requestHeaders = []) + { + $response = $this->client->getHttpClient()->post( + $path, + $requestHeaders, + $body + ); + + return ResponseMediator::getContent($response); + } + + /** + * Send a PATCH request with JSON-encoded parameters. + * + * @param string $path Request path. + * @param array $parameters POST parameters to be JSON encoded. + * @param array $requestHeaders Request headers. + * + * @return array|string + */ + protected function patch(string $path, array $parameters = [], array $requestHeaders = []) + { + $response = $this->client->getHttpClient()->patch( + $path, + $requestHeaders, + $this->createJsonBody($parameters) + ); + + return ResponseMediator::getContent($response); + } + + /** + * Send a PUT request with JSON-encoded parameters. + * + * @param string $path Request path. + * @param array $parameters POST parameters to be JSON encoded. + * @param array $requestHeaders Request headers. + * + * @return array|string + */ + protected function put(string $path, array $parameters = [], array $requestHeaders = []) + { + $response = $this->client->getHttpClient()->put( + $path, + $requestHeaders, + $this->createJsonBody($parameters) + ); + + return ResponseMediator::getContent($response); + } + + /** + * Send a DELETE request with JSON-encoded parameters. + * + * @param string $path Request path. + * @param array $parameters POST parameters to be JSON encoded. + * @param array $requestHeaders Request headers. + * + * @return array|string + */ + protected function delete(string $path, array $parameters = [], array $requestHeaders = []) + { + $response = $this->client->getHttpClient()->delete( + $path, + $requestHeaders, + $this->createJsonBody($parameters) + ); + + return ResponseMediator::getContent($response); + } + + /** + * Create a JSON encoded version of an array of parameters. + * + * @param array $parameters Request parameters + * + * @return string|null + */ + protected function createJsonBody(array $parameters): ?string + { + return (count($parameters) === 0) ? null : json_encode($parameters, empty($parameters) ? JSON_FORCE_OBJECT : 0); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/AcceptHeaderTrait.php b/vendor/knplabs/github-api/lib/Github/Api/AcceptHeaderTrait.php new file mode 100644 index 00000000..6a990a56 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/AcceptHeaderTrait.php @@ -0,0 +1,66 @@ + + */ +trait AcceptHeaderTrait +{ + /** @var string */ + protected $acceptHeaderValue; + + protected function get(string $path, array $parameters = [], array $requestHeaders = []) + { + return parent::get($path, $parameters, $this->mergeHeaders($requestHeaders)); + } + + protected function head(string $path, array $parameters = [], array $requestHeaders = []): ResponseInterface + { + return parent::head($path, $parameters, $this->mergeHeaders($requestHeaders)); + } + + protected function post(string $path, array $parameters = [], array $requestHeaders = []) + { + return parent::post($path, $parameters, $this->mergeHeaders($requestHeaders)); + } + + protected function postRaw(string $path, $body, array $requestHeaders = []) + { + return parent::postRaw($path, $body, $this->mergeHeaders($requestHeaders)); + } + + protected function patch(string $path, array $parameters = [], array $requestHeaders = []) + { + return parent::patch($path, $parameters, $this->mergeHeaders($requestHeaders)); + } + + protected function put(string $path, array $parameters = [], array $requestHeaders = []) + { + return parent::put($path, $parameters, $this->mergeHeaders($requestHeaders)); + } + + protected function delete(string $path, array $parameters = [], array $requestHeaders = []) + { + return parent::delete($path, $parameters, $this->mergeHeaders($requestHeaders)); + } + + /** + * Append a new accept header on all requests. + * + * @return array + */ + private function mergeHeaders(array $headers = []): array + { + $default = []; + if ($this->acceptHeaderValue) { + $default = ['Accept' => $this->acceptHeaderValue]; + } + + return array_merge($default, $headers); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Apps.php b/vendor/knplabs/github-api/lib/Github/Api/Apps.php new file mode 100644 index 00000000..9e9a4b6a --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Apps.php @@ -0,0 +1,201 @@ + + */ +class Apps extends AbstractApi +{ + use AcceptHeaderTrait; + + private function configurePreviewHeader() + { + $this->acceptHeaderValue = 'application/vnd.github.machine-man-preview+json'; + } + + /** + * Create an access token for an installation. + * + * @param int $installationId An integration installation id + * @param int $userId An optional user id on behalf of whom the + * token will be requested + * + * @link https://developer.github.com/v3/apps/#create-a-new-installation-token + * + * @return array token and token metadata + */ + public function createInstallationToken($installationId, $userId = null) + { + $parameters = []; + if ($userId) { + $parameters['user_id'] = $userId; + } + + $this->configurePreviewHeader(); + + return $this->post('/app/installations/'.$installationId.'/access_tokens', $parameters); + } + + /** + * Find all installations for the authenticated application. + * + * @link https://developer.github.com/v3/apps/#find-installations + * + * @return array + */ + public function findInstallations() + { + $this->configurePreviewHeader(); + + return $this->get('/app/installations'); + } + + /** + * Get an installation of the application. + * + * @link https://developer.github.com/v3/apps/#get-an-installation + * + * @param int $installationId An integration installation id + * + * @return array + */ + public function getInstallation($installationId) + { + $this->configurePreviewHeader(); + + return $this->get('/app/installations/'.$installationId); + } + + /** + * Get an installation of the application for an organization. + * + * @link https://developer.github.com/v3/apps/#get-an-organization-installation + * + * @param string $org An organization + * + * @return array + */ + public function getInstallationForOrganization($org) + { + $this->configurePreviewHeader(); + + return $this->get('/org/'.rawurldecode($org).'/installation'); + } + + /** + * Get an installation of the application for a repository. + * + * @link https://developer.github.com/v3/apps/#get-a-repository-installation + * + * @param string $owner the owner of a repository + * @param string $repo the name of the repository + * + * @return array + */ + public function getInstallationForRepo($owner, $repo) + { + $this->configurePreviewHeader(); + + return $this->get('/repos/'.rawurldecode($owner).'/'.rawurldecode($repo).'/installation'); + } + + /** + * Get an installation of the application for a user. + * + * @link https://developer.github.com/v3/apps/#get-a-user-installation + * + * @param string $username + * + * @return array + */ + public function getInstallationForUser($username) + { + $this->configurePreviewHeader(); + + return $this->get('/users/'.rawurldecode($username).'/installation'); + } + + /** + * Delete an installation of the application. + * + * @link https://developer.github.com/v3/apps/#delete-an-installation + * + * @param int $installationId An integration installation id + */ + public function removeInstallation($installationId) + { + $this->configurePreviewHeader(); + + $this->delete('/app/installations/'.$installationId); + } + + /** + * List repositories that are accessible to the authenticated installation. + * + * @link https://developer.github.com/v3/apps/installations/#list-repositories + * + * @param int $userId + * + * @return array + */ + public function listRepositories($userId = null) + { + $parameters = []; + if ($userId) { + $parameters['user_id'] = $userId; + } + + $this->configurePreviewHeader(); + + return $this->get('/installation/repositories', $parameters); + } + + /** + * Add a single repository to an installation. + * + * @link https://developer.github.com/v3/apps/installations/#add-repository-to-installation + * + * @param int $installationId + * @param int $repositoryId + * + * @return array + */ + public function addRepository($installationId, $repositoryId) + { + $this->configurePreviewHeader(); + + return $this->put('/installations/'.$installationId.'/repositories/'.$repositoryId); + } + + /** + * Remove a single repository from an installation. + * + * @link https://developer.github.com/v3/apps/installations/#remove-repository-from-installation + * + * @param int $installationId + * @param int $repositoryId + * + * @return array + */ + public function removeRepository($installationId, $repositoryId) + { + $this->configurePreviewHeader(); + + return $this->delete('/installations/'.$installationId.'/repositories/'.$repositoryId); + } + + /** + * Get the currently authenticated app. + * + * @link https://docs.github.com/en/rest/reference/apps#get-the-authenticated-app + * + * @return array + */ + public function getAuthenticatedApp() + { + return $this->get('/app'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Authorizations.php b/vendor/knplabs/github-api/lib/Github/Api/Authorizations.php new file mode 100644 index 00000000..6032c7fa --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Authorizations.php @@ -0,0 +1,65 @@ + + */ +class Authorizations extends AbstractApi +{ + /** + * Check an application token. + * + * @param string $clientId + * @param string|null $token + * + * @return array + */ + public function checkToken($clientId, $token = null) + { + return $this->post('/applications/'.rawurlencode($clientId).'/token', $token ? ['access_token' => $token] : []); + } + + /** + * Reset an application token. + * + * @param string $clientId + * @param string|null $token + * + * @return array + */ + public function resetToken($clientId, $token = null) + { + return $this->patch('/applications/'.rawurlencode($clientId).'/token', $token ? ['access_token' => $token] : []); + } + + /** + * Revoke an application token. + * + * @param string $clientId + * @param string|null $token + * + * @return void + */ + public function deleteToken($clientId, $token = null) + { + $this->delete('/applications/'.rawurlencode($clientId).'/token', $token ? ['access_token' => $token] : []); + } + + /** + * Revoke an application authorization. + * + * @param string $clientId + * @param string|null $token + * + * @return void + */ + public function deleteGrant($clientId, $token = null) + { + $this->delete('/applications/'.rawurlencode($clientId).'/grant', $token ? ['access_token' => $token] : []); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser.php b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser.php new file mode 100644 index 00000000..b5cbc89a --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser.php @@ -0,0 +1,193 @@ + + * @author Felipe Valtl de Mello + */ +class CurrentUser extends AbstractApi +{ + use AcceptHeaderTrait; + + public function show() + { + return $this->get('/user'); + } + + public function update(array $params) + { + return $this->patch('/user', $params); + } + + /** + * @return Emails + */ + public function emails() + { + return new Emails($this->getClient()); + } + + /** + * @return Followers + */ + public function follow() + { + return new Followers($this->getClient()); + } + + public function followers($page = 1) + { + return $this->get('/user/followers', [ + 'page' => $page, + ]); + } + + /** + * @link https://docs.github.com/en/rest/reference/issues#list-user-account-issues-assigned-to-the-authenticated-user + * + * @param array $params + * @param bool $includeOrgIssues + * + * @return array + */ + public function issues(array $params = [], $includeOrgIssues = true) + { + return $this->get($includeOrgIssues ? '/issues' : '/user/issues', array_merge(['page' => 1], $params)); + } + + /** + * @return PublicKeys + */ + public function keys() + { + return new PublicKeys($this->getClient()); + } + + /** + * @return Notifications + */ + public function notifications() + { + return new Notifications($this->getClient()); + } + + /** + * @return Memberships + */ + public function memberships() + { + return new Memberships($this->getClient()); + } + + /** + * @link https://docs.github.com/en/rest/reference/orgs#list-organizations-for-the-authenticated-user + * + * @return array + */ + public function organizations() + { + return $this->get('/user/orgs'); + } + + /** + * @link https://developer.github.com/v3/orgs/teams/#list-user-teams + * + * @return array + */ + public function teams() + { + return $this->get('/user/teams'); + } + + /** + * @link https://docs.github.com/en/rest/reference/repos#list-repositories-for-the-authenticated-user + * + * @param string $type role in the repository + * @param string $sort sort by + * @param string $direction direction of sort, asc or desc + * @param string $visibility visibility of repository + * @param string $affiliation relationship to repository + * + * @return array + */ + public function repositories($type = 'owner', $sort = 'full_name', $direction = 'asc', $visibility = null, $affiliation = null) + { + $params = [ + 'type' => $type, + 'sort' => $sort, + 'direction' => $direction, + ]; + + if (null !== $visibility) { + unset($params['type']); + $params['visibility'] = $visibility; + } + + if (null !== $affiliation) { + unset($params['type']); + $params['affiliation'] = $affiliation; + } + + return $this->get('/user/repos', $params); + } + + /** + * @return Watchers + */ + public function watchers() + { + return new Watchers($this->getClient()); + } + + /** + * @return Starring + */ + public function starring() + { + return new Starring($this->getClient()); + } + + /** + * @link https://docs.github.com/en/rest/reference/activity#list-repositories-watched-by-the-authenticated-user + */ + public function subscriptions() + { + return $this->get('/user/subscriptions'); + } + + /** + * @link https://docs.github.com/en/rest/reference/apps#list-app-installations-accessible-to-the-user-access-token + * + * @param array $params + */ + public function installations(array $params = []) + { + $this->acceptHeaderValue = 'application/vnd.github.machine-man-preview+json'; + + return $this->get('/user/installations', array_merge(['page' => 1], $params)); + } + + /** + * @link https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-user-access-token + * + * @param string $installationId the ID of the Installation + * @param array $params + */ + public function repositoriesByInstallation($installationId, array $params = []) + { + $this->acceptHeaderValue = 'application/vnd.github.machine-man-preview+json'; + + return $this->get(sprintf('/user/installations/%s/repositories', $installationId), array_merge(['page' => 1], $params)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Emails.php b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Emails.php new file mode 100644 index 00000000..23f2ab24 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Emails.php @@ -0,0 +1,94 @@ + + */ +class Emails extends AbstractApi +{ + /** + * List emails for the authenticated user. + * + * @link http://developer.github.com/v3/users/emails/ + * + * @return array + */ + public function all() + { + return $this->get('/user/emails'); + } + + /** + * List public email addresses for a user. + * + * @link https://developer.github.com/v3/users/emails/#list-public-email-addresses-for-a-user + * + * @return array + */ + public function allPublic() + { + return $this->get('/user/public_emails'); + } + + /** + * Adds one or more email for the authenticated user. + * + * @link http://developer.github.com/v3/users/emails/ + * + * @param string|array $emails + * + * @throws \Github\Exception\InvalidArgumentException + * + * @return array + */ + public function add($emails) + { + if (is_string($emails)) { + $emails = [$emails]; + } elseif (0 === count($emails)) { + throw new InvalidArgumentException('The user emails parameter should be a single email or an array of emails'); + } + + return $this->post('/user/emails', $emails); + } + + /** + * Removes one or more email for the authenticated user. + * + * @link http://developer.github.com/v3/users/emails/ + * + * @param string|array $emails + * + * @throws \Github\Exception\InvalidArgumentException + * + * @return array + */ + public function remove($emails) + { + if (is_string($emails)) { + $emails = [$emails]; + } elseif (0 === count($emails)) { + throw new InvalidArgumentException('The user emails parameter should be a single email or an array of emails'); + } + + return $this->delete('/user/emails', $emails); + } + + /** + * Toggle primary email visibility. + * + * @link https://developer.github.com/v3/users/emails/#toggle-primary-email-visibility + * + * @return array + */ + public function toggleVisibility() + { + return $this->patch('/user/email/visibility'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Followers.php b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Followers.php new file mode 100644 index 00000000..52a712ca --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Followers.php @@ -0,0 +1,71 @@ + + */ +class Followers extends AbstractApi +{ + /** + * List followed users by the authenticated user. + * + * @link http://developer.github.com/v3/repos/followers/ + * + * @param int $page + * + * @return array + */ + public function all($page = 1) + { + return $this->get('/user/following', [ + 'page' => $page, + ]); + } + + /** + * Check that the authenticated user follows a user. + * + * @link http://developer.github.com/v3/repos/followers/ + * + * @param string $username the username to follow + * + * @return array + */ + public function check($username) + { + return $this->get('/user/following/'.rawurlencode($username)); + } + + /** + * Make the authenticated user follow a user. + * + * @link http://developer.github.com/v3/repos/followers/ + * + * @param string $username the username to follow + * + * @return array + */ + public function follow($username) + { + return $this->put('/user/following/'.rawurlencode($username)); + } + + /** + * Make the authenticated user un-follow a user. + * + * @link http://developer.github.com/v3/repos/followers/ + * + * @param string $username the username to un-follow + * + * @return array + */ + public function unfollow($username) + { + return $this->delete('/user/following/'.rawurlencode($username)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Memberships.php b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Memberships.php new file mode 100644 index 00000000..da727397 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Memberships.php @@ -0,0 +1,48 @@ +get('/user/memberships/orgs'); + } + + /** + * Get your organization membership. + * + * @link https://developer.github.com/v3/orgs/members/#get-your-organization-membership + * + * @param string $organization + * + * @return array + */ + public function organization($organization) + { + return $this->get('/user/memberships/orgs/'.rawurlencode($organization)); + } + + /** + * Edit your organization membership. + * + * @link https://developer.github.com/v3/orgs/members/#edit-your-organization-membership + * + * @param string $organization + * + * @return array + */ + public function edit($organization) + { + return $this->patch('/user/memberships/orgs/'.rawurlencode($organization), ['state' => 'active']); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Notifications.php b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Notifications.php new file mode 100644 index 00000000..9f3f2ce7 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Notifications.php @@ -0,0 +1,145 @@ + + */ +class Notifications extends AbstractApi +{ + /** + * List all notifications for the authenticated user. + * + * @link http://developer.github.com/v3/activity/notifications/#list-your-notifications + * + * @param array $params + * + * @return array + */ + public function all(array $params = []) + { + return $this->get('/notifications', $params); + } + + /** + * List all notifications for the authenticated user in selected repository. + * + * @link http://developer.github.com/v3/activity/notifications/#list-your-notifications-in-a-repository + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * @param array $params + * + * @return array + */ + public function allInRepository($username, $repository, array $params = []) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/notifications', $params); + } + + /** + * Mark all notifications as read. + * + * @link http://developer.github.com/v3/activity/notifications/#mark-as-read + * + * @param array $params + * + * @return array + */ + public function markAsReadAll(array $params = []) + { + return $this->put('/notifications', $params); + } + + /** + * Mark all notifications for a repository as read. + * + * @link http://developer.github.com/v3/activity/notifications/#mark-notifications-as-read-in-a-repository + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * @param array $params + * + * @return array + */ + public function markAsReadInRepository($username, $repository, array $params = []) + { + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/notifications', $params); + } + + /** + * Mark a notification as read. + * + * @link http://developer.github.com/v3/activity/notifications/#mark-a-thread-as-read + * + * @param int $id the notification number + * @param array $params + * + * @return array + */ + public function markAsRead($id, array $params) + { + return $this->patch('/notifications/threads/'.$id, $params); + } + + /** + * Show a notification. + * + * @link http://developer.github.com/v3/activity/notifications/#view-a-single-thread + * + * @param int $id the notification number + * + * @return array + */ + public function show($id) + { + return $this->get('/notifications/threads/'.$id); + } + + /** + * Show a subscription. + * + * @link http://developer.github.com/v3/activity/notifications/#get-a-thread-subscription + * + * @param int $id the notification number + * + * @return array + */ + public function showSubscription($id) + { + return $this->get('/notifications/threads/'.$id.'/subscription'); + } + + /** + * Create a subscription. + * + * @link http://developer.github.com/v3/activity/notifications/#set-a-thread-subscription + * + * @param int $id the notification number + * @param array $params + * + * @return array + */ + public function createSubscription($id, array $params) + { + return $this->put('/notifications/threads/'.$id.'/subscription', $params); + } + + /** + * Delete a subscription. + * + * @link http://developer.github.com/v3/activity/notifications/#delete-a-thread-subscription + * + * @param int $id the notification number + * + * @return array + */ + public function removeSubscription($id) + { + return $this->delete('/notifications/threads/'.$id.'/subscription'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/PublicKeys.php b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/PublicKeys.php new file mode 100644 index 00000000..cb24dec9 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/PublicKeys.php @@ -0,0 +1,74 @@ + + */ +class PublicKeys extends AbstractApi +{ + /** + * List deploy keys for the authenticated user. + * + * @link https://developer.github.com/v3/users/keys/ + * + * @return array + */ + public function all() + { + return $this->get('/user/keys'); + } + + /** + * Shows deploy key for the authenticated user. + * + * @link https://developer.github.com/v3/users/keys/ + * + * @param int $id + * + * @return array + */ + public function show($id) + { + return $this->get('/user/keys/'.$id); + } + + /** + * Adds deploy key for the authenticated user. + * + * @link https://developer.github.com/v3/users/keys/ + * + * @param array $params + * + * @throws \Github\Exception\MissingArgumentException + * + * @return array + */ + public function create(array $params) + { + if (!isset($params['title'], $params['key'])) { + throw new MissingArgumentException(['title', 'key']); + } + + return $this->post('/user/keys', $params); + } + + /** + * Removes deploy key for the authenticated user. + * + * @link https://developer.github.com/v3/users/keys/ + * + * @param int $id + * + * @return array + */ + public function remove($id) + { + return $this->delete('/user/keys/'.$id); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Starring.php b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Starring.php new file mode 100644 index 00000000..ee2c5023 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Starring.php @@ -0,0 +1,97 @@ + + */ +class Starring extends AbstractApi +{ + use AcceptHeaderTrait; + + /** + * Configure the body type. + * + * @see https://developer.github.com/v3/activity/starring/#list-stargazers + * + * @param string $bodyType + * + * @return $this + */ + public function configure($bodyType = null) + { + if ('star' === $bodyType) { + $this->acceptHeaderValue = sprintf('application/vnd.github.%s.star+json', $this->getApiVersion()); + } + + return $this; + } + + /** + * List repositories starred by the authenticated user. + * + * @link https://developer.github.com/v3/activity/starring/ + * + * @param int $page + * @param int $perPage + * + * @return array + */ + public function all($page = 1, $perPage = 30) + { + return $this->get('/user/starred', [ + 'page' => $page, + 'per_page' => $perPage, + ]); + } + + /** + * Check that the authenticated user starres a repository. + * + * @link https://developer.github.com/v3/activity/starring/ + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * + * @return array + */ + public function check($username, $repository) + { + return $this->get('/user/starred/'.rawurlencode($username).'/'.rawurlencode($repository)); + } + + /** + * Make the authenticated user star a repository. + * + * @link https://developer.github.com/v3/activity/starring/ + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * + * @return array + */ + public function star($username, $repository) + { + return $this->put('/user/starred/'.rawurlencode($username).'/'.rawurlencode($repository)); + } + + /** + * Make the authenticated user unstar a repository. + * + * @link https://developer.github.com/v3/activity/starring + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * + * @return array + */ + public function unstar($username, $repository) + { + return $this->delete('/user/starred/'.rawurlencode($username).'/'.rawurlencode($repository)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Watchers.php b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Watchers.php new file mode 100644 index 00000000..1ef35972 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Watchers.php @@ -0,0 +1,75 @@ + + * @revised Felipe Valtl de Mello + */ +class Watchers extends AbstractApi +{ + /** + * List repositories watched by the authenticated user. + * + * @link https://developer.github.com/v3/activity/watching/ + * + * @param int $page + * + * @return array + */ + public function all($page = 1) + { + return $this->get('/user/subscriptions', [ + 'page' => $page, + ]); + } + + /** + * Check that the authenticated user watches a repository. + * + * @link https://developer.github.com/v3/activity/watching/ + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * + * @return array + */ + public function check($username, $repository) + { + return $this->get('/user/subscriptions/'.rawurlencode($username).'/'.rawurlencode($repository)); + } + + /** + * Make the authenticated user watch a repository. + * + * @link https://developer.github.com/v3/activity/watching/ + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * + * @return array + */ + public function watch($username, $repository) + { + return $this->put('/user/subscriptions/'.rawurlencode($username).'/'.rawurlencode($repository)); + } + + /** + * Make the authenticated user unwatch a repository. + * + * @link https://developer.github.com/v3/activity/watching/ + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * + * @return array + */ + public function unwatch($username, $repository) + { + return $this->delete('/user/subscriptions/'.rawurlencode($username).'/'.rawurlencode($repository)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Deployment.php b/vendor/knplabs/github-api/lib/Github/Api/Deployment.php new file mode 100644 index 00000000..f6127357 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Deployment.php @@ -0,0 +1,133 @@ +get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments', $params); + } + + /** + * Get a deployment in selected repository. + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * @param int $id the id of the deployment + * + * @return array + */ + public function show($username, $repository, $id) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.$id); + } + + /** + * Create a new deployment for the given username and repo. + * + * @link https://developer.github.com/v3/repos/deployments/#create-a-deployment + * + * Important: Once a deployment is created, it cannot be updated. Changes are indicated by creating new statuses. + * @see updateStatus + * + * @param string $username the username + * @param string $repository the repository + * @param array $params the new deployment data + * + * @throws MissingArgumentException + * + * @return array information about the deployment + */ + public function create($username, $repository, array $params) + { + if (!isset($params['ref'])) { + throw new MissingArgumentException(['ref']); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments', $params); + } + + /** + * Delete a deployment for the given username and repo. + * + * @link https://docs.github.com/en/rest/reference/repos#delete-a-deployment + * + * Important: Deployments can only be deleted when in inactive state + * @see updateStatus + * + * @return mixed null on success, array on error with 'message' + */ + public function remove(string $username, string $repository, int $id) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.$id); + } + + /** + * Updates a deployment by creating a new status update. + * + * @link https://developer.github.com/v3/repos/deployments/#create-a-deployment-status + * + * @param string $username the username + * @param string $repository the repository + * @param int $id the deployment number + * @param array $params The information about the deployment update. + * Must include a "state" field of pending, success, error, or failure. + * May also be given a target_url and description, see link for more details. + * + * @throws MissingArgumentException + * + * @return array information about the deployment + */ + public function updateStatus($username, $repository, $id, array $params) + { + if (!isset($params['state'])) { + throw new MissingArgumentException(['state']); + } + + // adjust media-type per github docs + // https://docs.github.com/en/rest/reference/repos#create-a-deployment-status + if ($params['state'] === 'inactive') { + $this->acceptHeaderValue = 'application/vnd.github.ant-man-preview+json'; + } + if ($params['state'] === 'in_progress' || $params['state'] === 'queued') { + $this->acceptHeaderValue = 'application/vnd.github.flash-preview+json'; + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.$id.'/statuses', $params); + } + + /** + * Gets all of the status updates tied to a given deployment. + * + * @param string $username the username + * @param string $repository the repository + * @param int $id the deployment identifier + * + * @return array the deployment statuses + */ + public function getStatuses($username, $repository, $id) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.$id.'/statuses'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Enterprise.php b/vendor/knplabs/github-api/lib/Github/Api/Enterprise.php new file mode 100644 index 00000000..b3daf95a --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Enterprise.php @@ -0,0 +1,51 @@ + + * @author Guillermo A. Fisher + */ +class Enterprise extends AbstractApi +{ + /** + * @return Stats + */ + public function stats() + { + return new Stats($this->getClient()); + } + + /** + * @return License + */ + public function license() + { + return new License($this->getClient()); + } + + /** + * @return ManagementConsole + */ + public function console() + { + return new ManagementConsole($this->getClient()); + } + + /** + * @return UserAdmin + */ + public function userAdmin() + { + return new UserAdmin($this->getClient()); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Enterprise/License.php b/vendor/knplabs/github-api/lib/Github/Api/Enterprise/License.php new file mode 100644 index 00000000..67e1c2a9 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Enterprise/License.php @@ -0,0 +1,20 @@ +get('/enterprise/settings/license'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Enterprise/ManagementConsole.php b/vendor/knplabs/github-api/lib/Github/Api/Enterprise/ManagementConsole.php new file mode 100644 index 00000000..f11c4764 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Enterprise/ManagementConsole.php @@ -0,0 +1,77 @@ +getWithLicenseHash('/setup/api/configcheck', $hash); + } + + /** + * Retrieves your installation’s settings. + * + * @link https://developer.github.com/v3/enterprise/management_console/#retrieve-settings + * + * @param string $hash md5 hash of your license + * + * @return array array of settings + */ + public function settings($hash) + { + return $this->getWithLicenseHash('/setup/api/settings', $hash); + } + + /** + * Checks your installation’s maintenance status. + * + * @link https://developer.github.com/v3/enterprise/management_console/#check-maintenance-status + * + * @param string $hash md5 hash of your license + * + * @return array array of maintenance status information + */ + public function maintenance($hash) + { + return $this->getWithLicenseHash('/setup/api/maintenance', $hash); + } + + /** + * Retrieves your installation’s authorized SSH keys. + * + * @link https://developer.github.com/v3/enterprise/management_console/#retrieve-authorized-ssh-keys + * + * @param string $hash md5 hash of your license + * + * @return array array of authorized keys + */ + public function keys($hash) + { + return $this->getWithLicenseHash('/setup/api/settings/authorized-keys', $hash); + } + + /** + * Sends an authenticated GET request. + * + * @param string $uri the request URI + * @param string $hash md5 hash of your license + * + * @return array|string + */ + protected function getWithLicenseHash($uri, $hash) + { + return $this->get($uri, ['license_md5' => rawurlencode($hash)]); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Enterprise/Stats.php b/vendor/knplabs/github-api/lib/Github/Api/Enterprise/Stats.php new file mode 100644 index 00000000..78ba4256 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Enterprise/Stats.php @@ -0,0 +1,128 @@ +show('issues'); + } + + /** + * Returns the number of active and inactive hooks. + * + * @return array array with totals of active and inactive hooks + */ + public function hooks() + { + return $this->show('hooks'); + } + + /** + * Returns the number of open and closed milestones. + * + * @return array array with totals of open and closed milestones + */ + public function milestones() + { + return $this->show('milestones'); + } + + /** + * Returns the number of organizations, teams, team members, and disabled organizations. + * + * @return array array with totals of organizations, teams, team members, and disabled organizations + */ + public function orgs() + { + return $this->show('orgs'); + } + + /** + * Returns the number of comments on issues, pull requests, commits, and gists. + * + * @return array array with totals of comments on issues, pull requests, commits, and gists + */ + public function comments() + { + return $this->show('comments'); + } + + /** + * Returns the number of GitHub Pages sites. + * + * @return array array with totals of GitHub Pages sites + */ + public function pages() + { + return $this->show('pages'); + } + + /** + * Returns the number of suspended and admin users. + * + * @return array array with totals of suspended and admin users + */ + public function users() + { + return $this->show('users'); + } + + /** + * Returns the number of private and public gists. + * + * @return array array with totals of private and public gists + */ + public function gists() + { + return $this->show('gists'); + } + + /** + * Returns the number of merged, mergeable, and unmergeable pull requests. + * + * @return array array with totals of merged, mergeable, and unmergeable pull requests + */ + public function pulls() + { + return $this->show('pulls'); + } + + /** + * Returns the number of organization-owned repositories, root repositories, forks, pushed commits, and wikis. + * + * @return array array with totals of organization-owned repositories, root repositories, forks, pushed commits, and wikis + */ + public function repos() + { + return $this->show('repos'); + } + + /** + * Returns all of the statistics. + * + * @return array array with all of the statistics + */ + public function all() + { + return $this->show('all'); + } + + /** + * @param string $type The type of statistics to show + * + * @return array + */ + public function show($type) + { + return $this->get('/enterprise/stats/'.rawurlencode($type)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Enterprise/UserAdmin.php b/vendor/knplabs/github-api/lib/Github/Api/Enterprise/UserAdmin.php new file mode 100644 index 00000000..0cd55a38 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Enterprise/UserAdmin.php @@ -0,0 +1,36 @@ +put('/users/'.rawurldecode($username).'/suspended', ['Content-Length' => 0]); + } + + /** + * Unsuspend a user. + * + * @link https://developer.github.com/v3/users/administration/#unsuspend-a-user + * + * @param string $username + * + * @return array + */ + public function unsuspend($username) + { + return $this->delete('/users/'.rawurldecode($username).'/suspended'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Gist/Comments.php b/vendor/knplabs/github-api/lib/Github/Api/Gist/Comments.php new file mode 100644 index 00000000..31587d94 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Gist/Comments.php @@ -0,0 +1,101 @@ + + */ +class Comments extends AbstractApi +{ + use AcceptHeaderTrait; + + /** + * Configure the body type. + * + * @link https://developer.github.com/v3/gists/comments/#custom-media-types + * + * @param string|null $bodyType + * + * @return $this + */ + public function configure($bodyType = null) + { + if (!in_array($bodyType, ['text', 'html', 'full'])) { + $bodyType = 'raw'; + } + + $this->acceptHeaderValue = sprintf('application/vnd.github.%s.%s+json', $this->getApiVersion(), $bodyType); + + return $this; + } + + /** + * Get all comments for a gist. + * + * @param string $gist + * + * @return array + */ + public function all($gist) + { + return $this->get('/gists/'.rawurlencode($gist).'/comments'); + } + + /** + * Get a comment of a gist. + * + * @param string $gist + * @param int $comment + * + * @return array + */ + public function show($gist, $comment) + { + return $this->get('/gists/'.rawurlencode($gist).'/comments/'.$comment); + } + + /** + * Create a comment for gist. + * + * @param string $gist + * @param string $body + * + * @return array + */ + public function create($gist, $body) + { + return $this->post('/gists/'.rawurlencode($gist).'/comments', ['body' => $body]); + } + + /** + * Create a comment for a gist. + * + * @param string $gist + * @param int $comment_id + * @param string $body + * + * @return array + */ + public function update($gist, $comment_id, $body) + { + return $this->patch('/gists/'.rawurlencode($gist).'/comments/'.$comment_id, ['body' => $body]); + } + + /** + * Delete a comment for a gist. + * + * @param string $gist + * @param int $comment + * + * @return array + */ + public function remove($gist, $comment) + { + return $this->delete('/gists/'.rawurlencode($gist).'/comments/'.$comment); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Gists.php b/vendor/knplabs/github-api/lib/Github/Api/Gists.php new file mode 100644 index 00000000..42bbdb9c --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Gists.php @@ -0,0 +1,182 @@ + + * @author Edoardo Rivello + */ +class Gists extends AbstractApi +{ + use AcceptHeaderTrait; + + /** + * Configure the body type. + * + * @link https://developer.github.com/v3/gists/#custom-media-types + * + * @param string|null $bodyType + * + * @return $this + */ + public function configure($bodyType = null) + { + if ('base64' !== $bodyType) { + $bodyType = 'raw'; + } + + $this->acceptHeaderValue = sprintf('application/vnd.github.%s.%s', $this->getApiVersion(), $bodyType); + + return $this; + } + + /** + * @param string|null $type + * + * @return array|string + */ + public function all($type = null) + { + if (!in_array($type, ['public', 'starred'])) { + return $this->get('/gists'); + } + + return $this->get('/gists/'.rawurlencode($type)); + } + + /** + * @param string $number + * + * @return array + */ + public function show($number) + { + return $this->get('/gists/'.rawurlencode($number)); + } + + /** + * Get a specific revision of a gist. + * + * @param string $number + * @param string $sha + * + * @link https://developer.github.com/v3/gists/#get-a-specific-revision-of-a-gist + * + * @return array + */ + public function revision($number, $sha) + { + return $this->get('/gists/'.rawurlencode($number).'/'.rawurlencode($sha)); + } + + public function create(array $params) + { + if (!isset($params['files']) || (!is_array($params['files']) || 0 === count($params['files']))) { + throw new MissingArgumentException('files'); + } + + $params['public'] = (bool) $params['public']; + + return $this->post('/gists', $params); + } + + /** + * @param string $id + * @param array $params + * + * @return array + */ + public function update($id, array $params) + { + return $this->patch('/gists/'.rawurlencode($id), $params); + } + + /** + * @param string $id + * + * @return array + */ + public function commits($id) + { + return $this->get('/gists/'.rawurlencode($id).'/commits'); + } + + /** + * @param string $id + * + * @return array + */ + public function fork($id) + { + return $this->post('/gists/'.rawurlencode($id).'/fork'); + } + + /** + * @param string $id + * + * @return array + */ + public function forks($id) + { + return $this->get('/gists/'.rawurlencode($id).'/forks'); + } + + /** + * @param string $id + * + * @return array + */ + public function remove($id) + { + return $this->delete('/gists/'.rawurlencode($id)); + } + + /** + * @param string $id + * + * @return array + */ + public function check($id) + { + return $this->get('/gists/'.rawurlencode($id).'/star'); + } + + /** + * @param string $id + * + * @return array + */ + public function star($id) + { + return $this->put('/gists/'.rawurlencode($id).'/star'); + } + + /** + * @param string $id + * + * @return array + */ + public function unstar($id) + { + return $this->delete('/gists/'.rawurlencode($id).'/star'); + } + + /** + * Get a gist's comments. + * + * @link http://developer.github.com/v3/gists/comments/ + * + * @return Comments + */ + public function comments() + { + return new Comments($this->getClient()); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/GitData.php b/vendor/knplabs/github-api/lib/Github/Api/GitData.php new file mode 100644 index 00000000..b7a9f48c --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/GitData.php @@ -0,0 +1,59 @@ + + */ +class GitData extends AbstractApi +{ + /** + * @return Blobs + */ + public function blobs() + { + return new Blobs($this->getClient()); + } + + /** + * @return Commits + */ + public function commits() + { + return new Commits($this->getClient()); + } + + /** + * @return References + */ + public function references() + { + return new References($this->getClient()); + } + + /** + * @return Tags + */ + public function tags() + { + return new Tags($this->getClient()); + } + + /** + * @return Trees + */ + public function trees() + { + return new Trees($this->getClient()); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/GitData/Blobs.php b/vendor/knplabs/github-api/lib/Github/Api/GitData/Blobs.php new file mode 100644 index 00000000..3b7357f3 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/GitData/Blobs.php @@ -0,0 +1,68 @@ + + * @author Tobias Nyholm + */ +class Blobs extends AbstractApi +{ + use AcceptHeaderTrait; + + /** + * Configure the Accept header depending on the blob type. + * + * @param string|null $bodyType + * + * @return $this + */ + public function configure($bodyType = null) + { + if ('raw' === $bodyType) { + $this->acceptHeaderValue = sprintf('application/vnd.github.%s.raw', $this->getApiVersion()); + } + + return $this; + } + + /** + * Show a blob of a sha for a repository. + * + * @param string $username + * @param string $repository + * @param string $sha + * + * @return array + */ + public function show($username, $repository, $sha) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/blobs/'.rawurlencode($sha)); + } + + /** + * Create a blob of a sha for a repository. + * + * @param string $username + * @param string $repository + * @param array $params + * + * @throws \Github\Exception\MissingArgumentException + * + * @return array + */ + public function create($username, $repository, array $params) + { + if (!isset($params['content'], $params['encoding'])) { + throw new MissingArgumentException(['content', 'encoding']); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/blobs', $params); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/GitData/Commits.php b/vendor/knplabs/github-api/lib/Github/Api/GitData/Commits.php new file mode 100644 index 00000000..4205931f --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/GitData/Commits.php @@ -0,0 +1,48 @@ + + */ +class Commits extends AbstractApi +{ + /** + * Show a commit for a repository. + * + * @param string $username + * @param string $repository + * @param string $sha + * + * @return array + */ + public function show($username, $repository, $sha) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/commits/'.rawurlencode($sha)); + } + + /** + * Create a commit for a repository. + * + * @param string $username + * @param string $repository + * @param array $params + * + * @throws \Github\Exception\MissingArgumentException + * + * @return array + */ + public function create($username, $repository, array $params) + { + if (!isset($params['message'], $params['tree'], $params['parents'])) { + throw new MissingArgumentException(['message', 'tree', 'parents']); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/commits', $params); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/GitData/References.php b/vendor/knplabs/github-api/lib/Github/Api/GitData/References.php new file mode 100644 index 00000000..d67cbe51 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/GitData/References.php @@ -0,0 +1,156 @@ + + */ +class References extends AbstractApi +{ + /** + * Get all references of a repository. + * + * @param string $username + * @param string $repository + * + * @return array + */ + public function all($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/refs'); + } + + /** + * Get all matching references for the supplied reference name. + * + * @param string $username + * @param string $repository + * @param string $reference + * + * @return array + */ + public function matching(string $username, string $repository, string $reference): array + { + $reference = $this->encodeReference($reference); + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/matching-refs/'.$reference); + } + + /** + * Get all branches of a repository. + * + * @param string $username + * @param string $repository + * + * @return array + */ + public function branches($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/refs/heads'); + } + + /** + * Get all tags of a repository. + * + * @param string $username + * @param string $repository + * + * @return array + */ + public function tags($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/refs/tags'); + } + + /** + * Show the reference of a repository. + * + * @param string $username + * @param string $repository + * @param string $reference + * + * @return array + */ + public function show($username, $repository, $reference) + { + $reference = $this->encodeReference($reference); + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/refs/'.$reference); + } + + /** + * Create a reference for a repository. + * + * @param string $username + * @param string $repository + * @param array $params + * + * @throws \Github\Exception\MissingArgumentException + * + * @return array + */ + public function create($username, $repository, array $params) + { + if (!isset($params['ref'], $params['sha'])) { + throw new MissingArgumentException(['ref', 'sha']); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/refs', $params); + } + + /** + * Update a reference for a repository. + * + * @param string $username + * @param string $repository + * @param string $reference + * @param array $params + * + * @throws \Github\Exception\MissingArgumentException + * + * @return array + */ + public function update($username, $repository, $reference, array $params) + { + if (!isset($params['sha'])) { + throw new MissingArgumentException('sha'); + } + + $reference = $this->encodeReference($reference); + + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/refs/'.$reference, $params); + } + + /** + * Delete a reference of a repository. + * + * @param string $username + * @param string $repository + * @param string $reference + * + * @return array + */ + public function remove($username, $repository, $reference) + { + $reference = $this->encodeReference($reference); + + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/refs/'.$reference); + } + + /** + * Encode the raw reference. + * + * @param string $rawReference + * + * @return string + */ + private function encodeReference($rawReference) + { + return implode('/', array_map('rawurlencode', explode('/', $rawReference))); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/GitData/Tags.php b/vendor/knplabs/github-api/lib/Github/Api/GitData/Tags.php new file mode 100644 index 00000000..11bf200a --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/GitData/Tags.php @@ -0,0 +1,65 @@ + + */ +class Tags extends AbstractApi +{ + /** + * Get all tags for a repository. + * + * @param string $username + * @param string $repository + * + * @return array + */ + public function all($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/refs/tags'); + } + + /** + * Get a tag for a repository. + * + * @param string $username + * @param string $repository + * @param string $sha + * + * @return array + */ + public function show($username, $repository, $sha) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/tags/'.rawurlencode($sha)); + } + + /** + * Create a tag for a repository. + * + * @param string $username + * @param string $repository + * @param array $params + * + * @throws \Github\Exception\MissingArgumentException + * + * @return array + */ + public function create($username, $repository, array $params) + { + if (!isset($params['tag'], $params['message'], $params['object'], $params['type'])) { + throw new MissingArgumentException(['tag', 'message', 'object', 'type']); + } + + if (isset($params['tagger']) && !isset($params['tagger']['name'], $params['tagger']['email'], $params['tagger']['date'])) { + throw new MissingArgumentException(['tagger.name', 'tagger.email', 'tagger.date']); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/tags', $params); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/GitData/Trees.php b/vendor/knplabs/github-api/lib/Github/Api/GitData/Trees.php new file mode 100644 index 00000000..939e8619 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/GitData/Trees.php @@ -0,0 +1,64 @@ + + */ +class Trees extends AbstractApi +{ + /** + * Get the tree for a repository. + * + * @param string $username + * @param string $repository + * @param string $sha + * @param bool $recursive + * + * @return array + */ + public function show($username, $repository, $sha, $recursive = false) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/trees/'.rawurlencode($sha), $recursive ? ['recursive' => 1] : []); + } + + /** + * Create tree for a repository. + * + * @param string $username + * @param string $repository + * @param array $params + * + * @throws \Github\Exception\MissingArgumentException + * + * @return array + */ + public function create($username, $repository, array $params) + { + if (!isset($params['tree']) || !is_array($params['tree'])) { + throw new MissingArgumentException('tree'); + } + + if (!isset($params['tree'][0])) { + $params['tree'] = [$params['tree']]; + } + + foreach ($params['tree'] as $key => $tree) { + if (!isset($tree['path'], $tree['mode'], $tree['type'])) { + throw new MissingArgumentException(["tree.$key.path", "tree.$key.mode", "tree.$key.type"]); + } + + // If `sha` is not set, `content` is required + if (!array_key_exists('sha', $tree) && !isset($tree['content'])) { + throw new MissingArgumentException("tree.$key.content"); + } + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/trees', $params); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/GraphQL.php b/vendor/knplabs/github-api/lib/Github/Api/GraphQL.php new file mode 100644 index 00000000..02499ad8 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/GraphQL.php @@ -0,0 +1,48 @@ + + */ +class GraphQL extends AbstractApi +{ + use AcceptHeaderTrait; + + /** + * @param string $query + * @param array $variables + * @param string $acceptHeaderValue + * + * @return array + */ + public function execute($query, array $variables = [], string $acceptHeaderValue = 'application/vnd.github.v4+json') + { + $this->acceptHeaderValue = $acceptHeaderValue; + $params = [ + 'query' => $query, + ]; + if (!empty($variables)) { + $params['variables'] = json_encode($variables); + } + + return $this->post('/graphql', $params); + } + + /** + * @param string $file + * @param array $variables + * + * @return array + */ + public function fromFile($file, array $variables = []) + { + return $this->execute(file_get_contents($file), $variables); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Issue.php b/vendor/knplabs/github-api/lib/Github/Api/Issue.php new file mode 100644 index 00000000..764f5e44 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Issue.php @@ -0,0 +1,241 @@ + + * @author Joseph Bielawski + */ +class Issue extends AbstractApi +{ + use AcceptHeaderTrait; + + /** + * Configure the body type. + * + * @link https://developer.github.com/v3/issues/#custom-media-types + * + * @param string|null $bodyType + * + * @return $this + */ + public function configure($bodyType = null) + { + if (!in_array($bodyType, ['text', 'html', 'full'])) { + $bodyType = 'raw'; + } + + $this->acceptHeaderValue = sprintf('application/vnd.github.%s.%s+json', $this->getApiVersion(), $bodyType); + + return $this; + } + + /** + * List issues by username, repo and state. + * + * @link http://developer.github.com/v3/issues/ + * + * @param string $username the username + * @param string $repository the repository + * @param array $params the additional parameters like milestone, assignees, labels, sort, direction + * + * @return array list of issues found + */ + public function all($username, $repository, array $params = []) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues', array_merge(['page' => 1], $params)); + } + + /** + * List issues by organization. + * + * @link http://developer.github.com/v3/issues/ + * + * @param string $organization the organization + * @param string $state the issue state, can be open or closed + * @param array $params the additional parameters like milestone, assignees, labels, sort, direction + * + * @return array list of issues found + */ + public function org($organization, $state, array $params = []) + { + if (!in_array($state, ['open', 'closed'])) { + $state = 'open'; + } + + return $this->get('/orgs/'.rawurlencode($organization).'/issues', array_merge(['page' => 1, 'state' => $state], $params)); + } + + /** + * Get extended information about an issue by its username, repo and number. + * + * @link http://developer.github.com/v3/issues/ + * + * @param string $username the username + * @param string $repository the repository + * @param int $id the issue number + * + * @return array information about the issue + */ + public function show($username, $repository, $id) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$id); + } + + /** + * Create a new issue for the given username and repo. + * The issue is assigned to the authenticated user. Requires authentication. + * + * @link http://developer.github.com/v3/issues/ + * + * @param string $username the username + * @param string $repository the repository + * @param array $params the new issue data + * + * @throws MissingArgumentException + * + * @return array information about the issue + */ + public function create($username, $repository, array $params) + { + if (!isset($params['title'])) { + throw new MissingArgumentException(['title']); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues', $params); + } + + /** + * Update issue information's by username, repo and issue number. Requires authentication. + * + * @link http://developer.github.com/v3/issues/ + * + * @param string $username the username + * @param string $repository the repository + * @param int $id the issue number + * @param array $params key=>value user attributes to update. + * key can be title or body + * + * @return array information about the issue + */ + public function update($username, $repository, $id, array $params) + { + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$id, $params); + } + + /** + * Lock an issue. Users with push access can lock an issue's conversation. + * + * @link https://developer.github.com/v3/issues/#lock-an-issue + * + * @param string $username + * @param string $repository + * @param int $id + * + * @return string + */ + public function lock($username, $repository, $id) + { + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$id.'/lock'); + } + + /** + * Unlock an issue. Users with push access can unlock an issue's conversation. + * + * @link https://developer.github.com/v3/issues/#lock-an-issue + * + * @param string $username + * @param string $repository + * @param int $id + * + * @return string + */ + public function unlock($username, $repository, $id) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$id.'/lock'); + } + + /** + * List an issue comments. + * + * @link http://developer.github.com/v3/issues/comments/ + * + * @return Comments + */ + public function comments() + { + return new Comments($this->getClient()); + } + + /** + * List all project events. + * + * @link http://developer.github.com/v3/issues/events/ + * + * @return Events + */ + public function events() + { + return new Events($this->getClient()); + } + + /** + * List all project labels. + * + * @link http://developer.github.com/v3/issues/labels/ + * + * @return Labels + */ + public function labels() + { + return new Labels($this->getClient()); + } + + /** + * List all project milestones. + * + * @link http://developer.github.com/v3/issues/milestones/ + * + * @return Milestones + */ + public function milestones() + { + return new Milestones($this->getClient()); + } + + /** + * List all assignees. + * + * @link https://developer.github.com/v3/issues/assignees/ + * + * @return Assignees + */ + public function assignees() + { + return new Assignees($this->getClient()); + } + + /** + * List all events. + * + * @link https://developer.github.com/v3/issues/timeline/ + * + * @return Timeline + */ + public function timeline() + { + return new Timeline($this->getClient()); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Issue/Assignees.php b/vendor/knplabs/github-api/lib/Github/Api/Issue/Assignees.php new file mode 100644 index 00000000..8ae86d1c --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Issue/Assignees.php @@ -0,0 +1,91 @@ +get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/assignees', $parameters); + } + + /** + * Check to see if a particular user is an assignee for a repository. + * + * @link https://developer.github.com/v3/issues/assignees/#check-assignee + * + * @param string $username + * @param string $repository + * @param string $assignee + * + * @return array + */ + public function check($username, $repository, $assignee) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/assignees/'.rawurlencode($assignee)); + } + + /** + * Add assignees to an Issue. + * + * @link https://developer.github.com/v3/issues/assignees/#add-assignees-to-an-issue + * + * @param string $username + * @param string $repository + * @param string $issue + * @param array $parameters + * + * @throws InvalidArgumentException + * @throws MissingArgumentException + * + * @return string + */ + public function add($username, $repository, $issue, array $parameters) + { + if (!isset($parameters['assignees'])) { + throw new MissingArgumentException('assignees'); + } + + if (!is_array($parameters['assignees'])) { + throw new InvalidArgumentException('The assignees parameter should be an array of assignees'); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/assignees', $parameters); + } + + /** + * Remove assignees from an Issue. + * + * @link https://developer.github.com/v3/issues/assignees/#remove-assignees-from-an-issue + * + * @param string $username + * @param string $repository + * @param string $issue + * @param array $parameters + * + * @throws MissingArgumentException + * + * @return string + */ + public function remove($username, $repository, $issue, array $parameters) + { + if (!isset($parameters['assignees'])) { + throw new MissingArgumentException('assignees'); + } + + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/assignees', $parameters); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Issue/Comments.php b/vendor/knplabs/github-api/lib/Github/Api/Issue/Comments.php new file mode 100644 index 00000000..b0fe8787 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Issue/Comments.php @@ -0,0 +1,133 @@ + + * @author Tobias Nyholm + */ +class Comments extends AbstractApi +{ + use AcceptHeaderTrait; + + /** + * Configure the body type. + * + * @link https://developer.github.com/v3/issues/comments/#custom-media-types + * + * @param string|null $bodyType + * + * @return $this + */ + public function configure($bodyType = null) + { + if (!in_array($bodyType, ['raw', 'text', 'html'])) { + $bodyType = 'full'; + } + + $this->acceptHeaderValue = sprintf('application/vnd.github.%s.%s+json', $this->getApiVersion(), $bodyType); + + return $this; + } + + /** + * Get all comments for an issue. + * + * @link https://developer.github.com/v3/issues/comments/#list-comments-on-an-issue + * + * @param string $username + * @param string $repository + * @param int $issue + * @param array $params + * + * @return array + */ + public function all($username, $repository, $issue, array $params = []) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/comments', $params); + } + + /** + * Get a comment for an issue. + * + * @link https://developer.github.com/v3/issues/comments/#get-a-single-comment + * + * @param string $username + * @param string $repository + * @param int $comment + * + * @return array + */ + public function show($username, $repository, $comment) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/comments/'.$comment); + } + + /** + * Create a comment for an issue. + * + * @link https://developer.github.com/v3/issues/comments/#create-a-comment + * + * @param string $username + * @param string $repository + * @param int $issue + * @param array $params + * + * @throws \Github\Exception\MissingArgumentException + * + * @return array + */ + public function create($username, $repository, $issue, array $params) + { + if (!isset($params['body'])) { + throw new MissingArgumentException('body'); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/comments', $params); + } + + /** + * Update a comment for an issue. + * + * @link https://developer.github.com/v3/issues/comments/#edit-a-comment + * + * @param string $username + * @param string $repository + * @param int $comment + * @param array $params + * + * @throws \Github\Exception\MissingArgumentException + * + * @return array + */ + public function update($username, $repository, $comment, array $params) + { + if (!isset($params['body'])) { + throw new MissingArgumentException('body'); + } + + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/comments/'.$comment, $params); + } + + /** + * Delete a comment for an issue. + * + * @link https://developer.github.com/v3/issues/comments/#delete-a-comment + * + * @param string $username + * @param string $repository + * @param int $comment + * + * @return array + */ + public function remove($username, $repository, $comment) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/comments/'.$comment); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Issue/Events.php b/vendor/knplabs/github-api/lib/Github/Api/Issue/Events.php new file mode 100644 index 00000000..a628b2c6 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Issue/Events.php @@ -0,0 +1,54 @@ + + */ +class Events extends AbstractApi +{ + /** + * Get all events for an issue. + * + * @link https://developer.github.com/v3/issues/events/#list-events-for-an-issue + * + * @param string $username + * @param string $repository + * @param int|null $issue + * @param int $page + * + * @return array + */ + public function all($username, $repository, $issue = null, $page = 1) + { + if (null !== $issue) { + $path = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/events'; + } else { + $path = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/events'; + } + + return $this->get($path, [ + 'page' => $page, + ]); + } + + /** + * Display an event for an issue. + * + * @link https://developer.github.com/v3/issues/events/#get-a-single-event + * + * @param string $username + * @param string $repository + * @param string $event + * + * @return array + */ + public function show($username, $repository, $event) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/events/'.rawurlencode($event)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Issue/Labels.php b/vendor/knplabs/github-api/lib/Github/Api/Issue/Labels.php new file mode 100644 index 00000000..d719578d --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Issue/Labels.php @@ -0,0 +1,192 @@ + + */ +class Labels extends AbstractApi +{ + /** + * Get all labels for a repository or the labels for a specific issue. + * + * @link https://developer.github.com/v3/issues/labels/#list-labels-on-an-issue + * + * @param string $username + * @param string $repository + * @param int|null $issue + * + * @return array + */ + public function all($username, $repository, $issue = null) + { + if ($issue === null) { + $path = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels'; + } else { + $path = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/labels'; + } + + return $this->get($path); + } + + /** + * Get a single label. + * + * @link https://developer.github.com/v3/issues/labels/#get-a-single-label + * + * @param string $username + * @param string $repository + * @param string $label + * + * @return array + */ + public function show($username, $repository, $label) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label)); + } + + /** + * Create a label for a repository. + * + * @link https://developer.github.com/v3/issues/labels/#create-a-label + * + * @param string $username + * @param string $repository + * @param array $params + * + * @throws \Github\Exception\MissingArgumentException + * + * @return array + */ + public function create($username, $repository, array $params) + { + if (!isset($params['name'])) { + throw new MissingArgumentException('name'); + } + if (!isset($params['color'])) { + $params['color'] = 'FFFFFF'; + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels', $params); + } + + /** + * Delete a label for a repository. + * + * @link https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue + * + * @param string $username + * @param string $repository + * @param string $label + * + * @return array + */ + public function deleteLabel($username, $repository, $label) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label)); + } + + /** + * Edit a label for a repository. + * + * @link https://developer.github.com/v3/issues/labels/#update-a-label + * + * @param string $username + * @param string $repository + * @param string $label + * @param string $newName + * @param string $color + * + * @return array + */ + public function update($username, $repository, $label, $newName, $color) + { + $params = [ + 'name' => $newName, + 'color' => $color, + ]; + + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label), $params); + } + + /** + * Add a label to an issue. + * + * @link https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue + * + * @param string $username + * @param string $repository + * @param int $issue + * @param string|array $labels + * + * @return array + * + * @thorws \Github\Exception\InvalidArgumentException + */ + public function add($username, $repository, $issue, $labels) + { + if (is_string($labels)) { + $labels = [$labels]; + } elseif (0 === count($labels)) { + throw new InvalidArgumentException('The labels parameter should be a single label or an array of labels'); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/labels', $labels); + } + + /** + * Replace labels for an issue. + * + * @link https://developer.github.com/v3/issues/labels/#replace-all-labels-for-an-issue + * + * @param string $username + * @param string $repository + * @param int $issue + * @param array $params + * + * @return array + */ + public function replace($username, $repository, $issue, array $params) + { + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/labels', $params); + } + + /** + * Remove a label for an issue. + * + * @link https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue + * + * @param string $username + * @param string $repository + * @param int $issue + * @param string $label + * + * @return array|string + */ + public function remove($username, $repository, $issue, $label) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/labels/'.rawurlencode($label)); + } + + /** + * Remove all labels from an issue. + * + * @link https://developer.github.com/v3/issues/labels/#replace-all-labels-for-an-issue + * + * @param string $username + * @param string $repository + * @param int $issue + * + * @return array|string + */ + public function clear($username, $repository, $issue) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/labels'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Issue/Milestones.php b/vendor/knplabs/github-api/lib/Github/Api/Issue/Milestones.php new file mode 100644 index 00000000..4cf2a3d5 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Issue/Milestones.php @@ -0,0 +1,139 @@ + + */ +class Milestones extends AbstractApi +{ + /** + * Get all milestones for a repository. + * + * @link https://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + * + * @param string $username + * @param string $repository + * @param array $params + * + * @return array + */ + public function all($username, $repository, array $params = []) + { + if (isset($params['state']) && !in_array($params['state'], ['open', 'closed', 'all'])) { + $params['state'] = 'open'; + } + if (isset($params['sort']) && !in_array($params['sort'], ['due_date', 'completeness'])) { + $params['sort'] = 'due_date'; + } + if (isset($params['direction']) && !in_array($params['direction'], ['asc', 'desc'])) { + $params['direction'] = 'asc'; + } + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones', array_merge([ + 'page' => 1, + 'state' => 'open', + 'sort' => 'due_date', + 'direction' => 'asc', + ], $params)); + } + + /** + * Get a milestone for a repository. + * + * @link https://developer.github.com/v3/issues/milestones/#get-a-single-milestone + * + * @param string $username + * @param string $repository + * @param int $id + * + * @return array + */ + public function show($username, $repository, $id) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones/'.$id); + } + + /** + * Create a milestone for a repository. + * + * @link https://developer.github.com/v3/issues/milestones/#create-a-milestone + * + * @param string $username + * @param string $repository + * @param array $params + * + * @throws \Github\Exception\MissingArgumentException + * + * @return array + */ + public function create($username, $repository, array $params) + { + if (!isset($params['title'])) { + throw new MissingArgumentException('title'); + } + if (isset($params['state']) && !in_array($params['state'], ['open', 'closed'])) { + $params['state'] = 'open'; + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones', $params); + } + + /** + * Update a milestone for a repository. + * + * @link https://developer.github.com/v3/issues/milestones/#update-a-milestone + * + * @param string $username + * @param string $repository + * @param int $id + * @param array $params + * + * @return array + */ + public function update($username, $repository, $id, array $params) + { + if (isset($params['state']) && !in_array($params['state'], ['open', 'closed'])) { + $params['state'] = 'open'; + } + + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones/'.$id, $params); + } + + /** + * Delete a milestone for a repository. + * + * @link https://developer.github.com/v3/issues/milestones/#delete-a-milestone + * + * @param string $username + * @param string $repository + * @param int $id + * + * @return array|string + */ + public function remove($username, $repository, $id) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones/'.$id); + } + + /** + * Get the labels of a milestone. + * + * @link https://developer.github.com/v3/issues/labels/#get-labels-for-every-issue-in-a-milestone + * + * @param string $username + * @param string $repository + * @param int $id + * + * @return array + */ + public function labels($username, $repository, $id) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones/'.$id.'/labels'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Issue/Timeline.php b/vendor/knplabs/github-api/lib/Github/Api/Issue/Timeline.php new file mode 100644 index 00000000..16ec4b06 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Issue/Timeline.php @@ -0,0 +1,34 @@ +acceptHeaderValue = 'application/vnd.github.mockingbird-preview'; + + return $this; + } + + /** + * Get all events for a specific issue. + * + * @link https://developer.github.com/v3/issues/timeline/#list-events-for-an-issue + * + * @param string $username + * @param string $repository + * @param int $issue + * + * @return array + */ + public function all($username, $repository, $issue) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/timeline'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Markdown.php b/vendor/knplabs/github-api/lib/Github/Api/Markdown.php new file mode 100644 index 00000000..977b1d04 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Markdown.php @@ -0,0 +1,49 @@ + + */ +class Markdown extends AbstractApi +{ + /** + * @param string $text + * @param string $mode + * @param string $context + * + * @return string + */ + public function render($text, $mode = 'markdown', $context = null) + { + if (!in_array($mode, ['gfm', 'markdown'])) { + $mode = 'markdown'; + } + + $params = [ + 'text' => $text, + 'mode' => $mode, + ]; + if (null !== $context && 'gfm' === $mode) { + $params['context'] = $context; + } + + return $this->post('/markdown', $params); + } + + /** + * @param string $file + * + * @return string + */ + public function renderRaw($file) + { + return $this->post('/markdown/raw', [ + 'file' => $file, + ]); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Meta.php b/vendor/knplabs/github-api/lib/Github/Api/Meta.php new file mode 100644 index 00000000..0ec81f65 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Meta.php @@ -0,0 +1,23 @@ + + */ +class Meta extends AbstractApi +{ + /** + * Get the ip address of the hook and git servers for the GitHub.com service. + * + * @return array Information about the service of GitHub.com + */ + public function service() + { + return $this->get('/meta'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/CodeOfConduct.php b/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/CodeOfConduct.php new file mode 100644 index 00000000..64bfaa8b --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/CodeOfConduct.php @@ -0,0 +1,44 @@ +acceptHeaderValue = 'application/vnd.github.scarlet-witch-preview+json'; + + return $this; + } + + /** + * List all codes of conduct. + * + * @link https://developer.github.com/v3/codes_of_conduct/#list-all-codes-of-conduct + * + * @return array + */ + public function all() + { + return $this->get('/codes_of_conduct'); + } + + /** + * Get an individual code of conduct. + * + * @link https://developer.github.com/v3/codes_of_conduct/#get-an-individual-code-of-conduct + * + * @param string $key + * + * @return array + */ + public function show($key) + { + return $this->get('/codes_of_conduct/'.rawurlencode($key)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Emojis.php b/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Emojis.php new file mode 100644 index 00000000..2a940f6d --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Emojis.php @@ -0,0 +1,20 @@ +get('/emojis'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Gitignore.php b/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Gitignore.php new file mode 100644 index 00000000..c5f03e7e --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Gitignore.php @@ -0,0 +1,34 @@ +get('/gitignore/templates'); + } + + /** + * Get a single template. + * + * @link https://developer.github.com/v3/gitignore/#get-a-single-template + * + * @param string $template + * + * @return array + */ + public function show($template) + { + return $this->get('/gitignore/templates/'.rawurlencode($template)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Licenses.php b/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Licenses.php new file mode 100644 index 00000000..f8e55782 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Licenses.php @@ -0,0 +1,34 @@ +get('/licenses'); + } + + /** + * Get an individual license by its license key. + * + * @link https://developer.github.com/v3/licenses/#get-an-individual-license + * + * @param string $license + * + * @return array + */ + public function show($license) + { + return $this->get('/licenses/'.rawurlencode($license)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Notification.php b/vendor/knplabs/github-api/lib/Github/Api/Notification.php new file mode 100644 index 00000000..e8c9b246 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Notification.php @@ -0,0 +1,91 @@ + + */ +class Notification extends AbstractApi +{ + /** + * Get a listing of notifications. + * + * @link https://developer.github.com/v3/activity/notifications/ + * + * @param bool $includingRead + * @param bool $participating + * @param DateTime|null $since + * @param DateTime|null $before + * + * @return array array of notifications + */ + public function all($includingRead = false, $participating = false, DateTime $since = null, DateTime $before = null) + { + $parameters = [ + 'all' => $includingRead, + 'participating' => $participating, + ]; + + if ($since !== null) { + $parameters['since'] = $since->format(DateTime::ISO8601); + } + + if ($before !== null) { + $parameters['before'] = $before->format(DateTime::ISO8601); + } + + return $this->get('/notifications', $parameters); + } + + /** + * Marks all notifications as read from the current date. + * + * Optionally give DateTime to mark as read before that date. + * + * @link https://developer.github.com/v3/activity/notifications/#mark-as-read + * + * @param DateTime|null $since + */ + public function markRead(DateTime $since = null) + { + $parameters = []; + + if ($since !== null) { + $parameters['last_read_at'] = $since->format(DateTime::ISO8601); + } + + $this->put('/notifications', $parameters); + } + + /** + * Mark a single thread as read using its ID. + * + * @link https://developer.github.com/v3/activity/notifications/#mark-a-thread-as-read + * + * @param int $id + */ + public function markThreadRead($id) + { + $this->patch('/notifications/threads/'.$id); + } + + /** + * Gets a single thread using its ID. + * + * @link https://developer.github.com/v3/activity/notifications/#view-a-single-thread + * + * @param int $id + */ + public function id($id) + { + return $this->get('/notifications/threads/'.$id); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Organization.php b/vendor/knplabs/github-api/lib/Github/Api/Organization.php new file mode 100644 index 00000000..d3e76466 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Organization.php @@ -0,0 +1,134 @@ + + * @author Joseph Bielawski + */ +class Organization extends AbstractApi +{ + /** + * @link https://developer.github.com/v3/orgs/#list-all-organizations + * + * @return array the organizations + */ + public function all($since = '') + { + return $this->get('/organizations?since='.rawurlencode($since)); + } + + /** + * Get extended information about an organization by its name. + * + * @link http://developer.github.com/v3/orgs/#get + * + * @param string $organization the organization to show + * + * @return array information about the organization + */ + public function show($organization) + { + return $this->get('/orgs/'.rawurlencode($organization)); + } + + public function update($organization, array $params) + { + return $this->patch('/orgs/'.rawurlencode($organization), $params); + } + + /** + * List all repositories across all the organizations that you can access. + * + * @link http://developer.github.com/v3/repos/#list-organization-repositories + * + * @param string $organization the user name + * @param string $type the type of repositories + * @param int $page the page + * @param string $sort sort by + * @param string $direction direction of sort, asc or desc + * + * @return array the repositories + */ + public function repositories($organization, $type = 'all', $page = 1, $sort = null, $direction = null) + { + $parameters = [ + 'type' => $type, + 'page' => $page, + ]; + + if ($sort !== null) { + $parameters['sort'] = $sort; + } + + if ($direction !== null) { + $parameters['direction'] = $direction; + } + + return $this->get('/orgs/'.rawurlencode($organization).'/repos', $parameters); + } + + /** + * @return Members + */ + public function members() + { + return new Members($this->getClient()); + } + + /** + * @return Hooks + */ + public function hooks() + { + return new Hooks($this->getClient()); + } + + /** + * @return Teams + */ + public function teams() + { + return new Teams($this->getClient()); + } + + /** + * @return Secrets + */ + public function secrets(): Secrets + { + return new Secrets($this->getClient()); + } + + /** + * @return OutsideCollaborators + */ + public function outsideCollaborators() + { + return new OutsideCollaborators($this->getClient()); + } + + /** + * @link http://developer.github.com/v3/issues/#list-issues + * + * @param string $organization + * @param array $params + * @param int $page + * + * @return array + */ + public function issues($organization, array $params = [], $page = 1) + { + return $this->get('/orgs/'.rawurlencode($organization).'/issues', array_merge(['page' => $page], $params)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Organization/Actions/Secrets.php b/vendor/knplabs/github-api/lib/Github/Api/Organization/Actions/Secrets.php new file mode 100644 index 00000000..819e2c46 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Organization/Actions/Secrets.php @@ -0,0 +1,144 @@ +get('/orgs/'.rawurlencode($organization).'/actions/secrets'); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#get-an-organization-secret + * + * @param string $organization + * @param string $secretName + * + * @return array|string + */ + public function show(string $organization, string $secretName) + { + return $this->get('/orgs/'.rawurlencode($organization).'/actions/secrets/'.rawurlencode($secretName)); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#create-or-update-an-organization-secret + * + * @param string $organization + * @param string $secretName + * @param array $parameters + * + * @return array|string + */ + public function create(string $organization, string $secretName, array $parameters = []) + { + return $this->put('/orgs/'.rawurlencode($organization).'/actions/secrets/'.rawurlencode($secretName), $parameters); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#create-or-update-an-organization-secret + * + * @param string $organization + * @param string $secretName + * @param array $parameters + * + * @return array|string + */ + public function update(string $organization, string $secretName, array $parameters = []) + { + return $this->put('/orgs/'.rawurlencode($organization).'/actions/secrets/'.rawurlencode($secretName), $parameters); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#delete-an-organization-secret + * + * @param string $organization + * @param string $secretName + * + * @return array|string + */ + public function remove(string $organization, string $secretName) + { + return $this->delete('/orgs/'.rawurlencode($organization).'/actions/secrets/'.rawurlencode($secretName)); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#list-selected-repositories-for-an-organization-secret + * + * @param string $organization + * @param string $secretName + * + * @return array|string + */ + public function selectedRepositories(string $organization, string $secretName) + { + return $this->get('/orgs/'.rawurlencode($organization).'/actions/secrets/'.rawurlencode($secretName).'/repositories'); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#set-selected-repositories-for-an-organization-secret + * + * @param string $organization + * @param string $secretName + * @param array $parameters + * + * @return array|string + */ + public function setSelectedRepositories(string $organization, string $secretName, array $parameters = []) + { + return $this->put('/orgs/'.rawurlencode($organization).'/actions/secrets/'.rawurlencode($secretName).'/repositories', $parameters); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#add-selected-repository-to-an-organization-secret + * + * @param string $organization + * @param string $repositoryId + * @param string $secretName + * + * @return array|string + */ + public function addSecret(string $organization, string $repositoryId, string $secretName) + { + return $this->put('/orgs/'.rawurlencode($organization).'/actions/secrets/'.rawurlencode($secretName).'/repositories/'.$repositoryId); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#remove-selected-repository-from-an-organization-secret + * + * @param string $organization + * @param string $repositoryId + * @param string $secretName + * + * @return array|string + */ + public function removeSecret(string $organization, string $repositoryId, string $secretName) + { + return $this->delete('/orgs/'.rawurlencode($organization).'/actions/secrets/'.rawurlencode($secretName).'/repositories/'.$repositoryId); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#get-an-organization-public-key + * + * @param string $organization + * + * @return array|string + */ + public function publicKey(string $organization) + { + return $this->get('/orgs/'.rawurlencode($organization).'/actions/secrets/public-key'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Organization/Hooks.php b/vendor/knplabs/github-api/lib/Github/Api/Organization/Hooks.php new file mode 100644 index 00000000..945cabc8 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Organization/Hooks.php @@ -0,0 +1,111 @@ +get('/orgs/'.rawurlencode($organization).'/hooks'); + } + + /** + * Get a single hook. + * + * @link https://developer.github.com/v3/orgs/hooks/#get-single-hook + * + * @param string $organization + * @param int $id + * + * @return array + */ + public function show($organization, $id) + { + return $this->get('/orgs/'.rawurlencode($organization).'/hooks/'.$id); + } + + /** + * Create a hook. + * + * @link https://developer.github.com/v3/orgs/hooks/#create-a-hook + * + * @param string $organization + * @param array $params + * + * @throws \Github\Exception\MissingArgumentException + * + * @return array + */ + public function create($organization, array $params) + { + if (!isset($params['name'], $params['config'])) { + throw new MissingArgumentException(['name', 'config']); + } + + return $this->post('/orgs/'.rawurlencode($organization).'/hooks', $params); + } + + /** + * Edit a hook. + * + * @link https://developer.github.com/v3/orgs/hooks/#edit-a-hook + * + * @param string $organization + * @param int $id + * @param array $params + * + * @throws \Github\Exception\MissingArgumentException + * + * @return array + */ + public function update($organization, $id, array $params) + { + if (!isset($params['config'])) { + throw new MissingArgumentException(['config']); + } + + return $this->patch('/orgs/'.rawurlencode($organization).'/hooks/'.$id, $params); + } + + /** + * Ping a hook. + * + * @link https://developer.github.com/v3/orgs/hooks/#ping-a-hook + * + * @param string $organization + * @param int $id + * + * @return array|string + */ + public function ping($organization, $id) + { + return $this->post('/orgs/'.rawurlencode($organization).'/hooks/'.$id.'/pings'); + } + + /** + * Delete a hook. + * + * @link https://developer.github.com/v3/orgs/hooks/#delete-a-hook + * + * @param string $organization + * @param int $id + * + * @return array|string + */ + public function remove($organization, $id) + { + return $this->delete('/orgs/'.rawurlencode($organization).'/hooks/'.$id); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Organization/Members.php b/vendor/knplabs/github-api/lib/Github/Api/Organization/Members.php new file mode 100644 index 00000000..023e3f8d --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Organization/Members.php @@ -0,0 +1,75 @@ + + */ +class Members extends AbstractApi +{ + public function all($organization, $type = null, $filter = 'all', $role = null) + { + $parameters = []; + $path = '/orgs/'.rawurlencode($organization).'/'; + if (null === $type) { + $path .= 'members'; + if (null !== $filter) { + $parameters['filter'] = $filter; + } + if (null !== $role) { + $parameters['role'] = $role; + } + } else { + $path .= 'public_members'; + } + + return $this->get($path, $parameters); + } + + public function show($organization, $username) + { + return $this->get('/orgs/'.rawurlencode($organization).'/members/'.rawurlencode($username)); + } + + public function member($organization, $username) + { + return $this->get('/orgs/'.rawurlencode($organization).'/memberships/'.rawurlencode($username)); + } + + public function check($organization, $username) + { + return $this->get('/orgs/'.rawurlencode($organization).'/public_members/'.rawurlencode($username)); + } + + public function publicize($organization, $username) + { + return $this->put('/orgs/'.rawurlencode($organization).'/public_members/'.rawurlencode($username)); + } + + public function conceal($organization, $username) + { + return $this->delete('/orgs/'.rawurlencode($organization).'/public_members/'.rawurlencode($username)); + } + + /* + * Add user to organization + */ + public function add($organization, $username, array $params = []) + { + return $this->put('/orgs/'.rawurlencode($organization).'/memberships/'.rawurlencode($username), $params); + } + + public function addMember($organization, $username) + { + return $this->add($organization, $username); + } + + public function remove($organization, $username) + { + return $this->delete('/orgs/'.rawurlencode($organization).'/members/'.rawurlencode($username)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Organization/OutsideCollaborators.php b/vendor/knplabs/github-api/lib/Github/Api/Organization/OutsideCollaborators.php new file mode 100644 index 00000000..958100a5 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Organization/OutsideCollaborators.php @@ -0,0 +1,52 @@ + + */ +class OutsideCollaborators extends AbstractApi +{ + /** + * @link https://developer.github.com/v3/orgs/outside_collaborators/#list-outside-collaborators-for-an-organization + * + * @param string $organization the organization + * @param array $params + * + * @return array the organizations + */ + public function all($organization, array $params = []) + { + return $this->get('/orgs/'.rawurlencode($organization).'/outside_collaborators', $params); + } + + /** + * @link https://developer.github.com/v3/orgs/outside_collaborators/#convert-an-organization-member-to-outside-collaborator + * + * @param string $organization the organization + * @param string $username the github username + * + * @return array + */ + public function convert($organization, $username) + { + return $this->put('/orgs/'.rawurlencode($organization).'/outside_collaborators/'.rawurldecode($username)); + } + + /** + * @link https://developer.github.com/v3/orgs/outside_collaborators/#remove-outside-collaborator-from-an-organization + * + * @param string $organization the organization + * @param string $username the username + * + * @return array + */ + public function remove($organization, $username) + { + return $this->delete('/orgs/'.rawurlencode($organization).'/outside_collaborators/'.rawurldecode($username)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Organization/Projects.php b/vendor/knplabs/github-api/lib/Github/Api/Organization/Projects.php new file mode 100644 index 00000000..2bb7196e --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Organization/Projects.php @@ -0,0 +1,23 @@ +get('/orgs/'.rawurlencode($organization).'/projects', array_merge(['page' => 1], $params)); + } + + public function create($organization, array $params) + { + if (!isset($params['name'])) { + throw new MissingArgumentException(['name']); + } + + return $this->post('/orgs/'.rawurlencode($organization).'/projects', $params); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Organization/Teams.php b/vendor/knplabs/github-api/lib/Github/Api/Organization/Teams.php new file mode 100644 index 00000000..3af63b73 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Organization/Teams.php @@ -0,0 +1,121 @@ + + */ +class Teams extends AbstractApi +{ + public function all($organization) + { + return $this->get('/orgs/'.rawurlencode($organization).'/teams'); + } + + public function create($organization, array $params) + { + if (!isset($params['name'])) { + throw new MissingArgumentException('name'); + } + if (isset($params['repo_names']) && !is_array($params['repo_names'])) { + $params['repo_names'] = [$params['repo_names']]; + } + if (isset($params['permission']) && !in_array($params['permission'], ['pull', 'push', 'admin'])) { + $params['permission'] = 'pull'; + } + + return $this->post('/orgs/'.rawurlencode($organization).'/teams', $params); + } + + /** + * @link https://developer.github.com/v3/teams/#list-teams + */ + public function show($team, $organization) + { + return $this->get('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team)); + } + + /** + * @link https://developer.github.com/v3/teams/#edit-team + */ + public function update($team, array $params, $organization) + { + if (!isset($params['name'])) { + throw new MissingArgumentException('name'); + } + if (isset($params['permission']) && !in_array($params['permission'], ['pull', 'push', 'admin'])) { + $params['permission'] = 'pull'; + } + + return $this->patch('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team), $params); + } + + /** + * @link https://developer.github.com/v3/teams/#delete-team + */ + public function remove($team, $organization) + { + return $this->delete('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team)); + } + + /** + * @link https://developer.github.com/v3/teams/members/#list-team-members + */ + public function members($team, $organization) + { + return $this->get('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/members'); + } + + /** + * @link https://developer.github.com/v3/teams/members/#get-team-membership + */ + public function check($team, $username, $organization) + { + return $this->get('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/memberships/'.rawurlencode($username)); + } + + /** + * @link https://developer.github.com/v3/teams/members/#add-or-update-team-membership + */ + public function addMember($team, $username, $organization) + { + return $this->put('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/memberships/'.rawurlencode($username)); + } + + /** + * @link https://developer.github.com/v3/teams/members/#remove-team-membership + */ + public function removeMember($team, $username, $organization) + { + return $this->delete('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/memberships/'.rawurlencode($username)); + } + + public function repositories($team) + { + return $this->get('/teams/'.rawurlencode($team).'/repos'); + } + + public function repository($team, $organization, $repository) + { + return $this->get('/teams/'.rawurlencode($team).'/repos/'.rawurlencode($organization).'/'.rawurlencode($repository)); + } + + public function addRepository($team, $organization, $repository, $params = []) + { + if (isset($params['permission']) && !in_array($params['permission'], ['pull', 'push', 'admin', 'maintain', 'triage'])) { + $params['permission'] = 'pull'; + } + + return $this->put('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/repos/'.rawurlencode($organization).'/'.rawurlencode($repository), $params); + } + + public function removeRepository($team, $organization, $repository) + { + return $this->delete('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/repos/'.rawurlencode($organization).'/'.rawurlencode($repository)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Project/AbstractProjectApi.php b/vendor/knplabs/github-api/lib/Github/Api/Project/AbstractProjectApi.php new file mode 100644 index 00000000..049d6756 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Project/AbstractProjectApi.php @@ -0,0 +1,45 @@ +acceptHeaderValue = 'application/vnd.github.inertia-preview+json'; + + return $this; + } + + public function show($id, array $params = []) + { + return $this->get('/projects/'.rawurlencode($id), array_merge(['page' => 1], $params)); + } + + public function update($id, array $params) + { + return $this->patch('/projects/'.rawurlencode($id), $params); + } + + public function deleteProject($id) + { + return $this->delete('/projects/'.rawurlencode($id)); + } + + public function columns() + { + return new Columns($this->getClient()); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Project/Cards.php b/vendor/knplabs/github-api/lib/Github/Api/Project/Cards.php new file mode 100644 index 00000000..0d670f93 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Project/Cards.php @@ -0,0 +1,60 @@ +acceptHeaderValue = 'application/vnd.github.inertia-preview+json'; + + return $this; + } + + public function all($columnId, array $params = []) + { + return $this->get('/projects/columns/'.rawurlencode($columnId).'/cards', array_merge(['page' => 1], $params)); + } + + public function show($id) + { + return $this->get('/projects/columns/cards/'.rawurlencode($id)); + } + + public function create($columnId, array $params) + { + return $this->post('/projects/columns/'.rawurlencode($columnId).'/cards', $params); + } + + public function update($id, array $params) + { + return $this->patch('/projects/columns/cards/'.rawurlencode($id), $params); + } + + public function deleteCard($id) + { + return $this->delete('/projects/columns/cards/'.rawurlencode($id)); + } + + public function move($id, array $params) + { + if (!isset($params['position'])) { + throw new MissingArgumentException(['position']); + } + + return $this->post('/projects/columns/cards/'.rawurlencode($id).'/moves', $params); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Project/Columns.php b/vendor/knplabs/github-api/lib/Github/Api/Project/Columns.php new file mode 100644 index 00000000..5146ac22 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Project/Columns.php @@ -0,0 +1,73 @@ +acceptHeaderValue = 'application/vnd.github.inertia-preview+json'; + + return $this; + } + + public function all($projectId, array $params = []) + { + return $this->get('/projects/'.rawurlencode($projectId).'/columns', array_merge(['page' => 1], $params)); + } + + public function show($id) + { + return $this->get('/projects/columns/'.rawurlencode($id)); + } + + public function create($projectId, array $params) + { + if (!isset($params['name'])) { + throw new MissingArgumentException(['name']); + } + + return $this->post('/projects/'.rawurlencode($projectId).'/columns', $params); + } + + public function update($id, array $params) + { + if (!isset($params['name'])) { + throw new MissingArgumentException(['name']); + } + + return $this->patch('/projects/columns/'.rawurlencode($id), $params); + } + + public function deleteColumn($id) + { + return $this->delete('/projects/columns/'.rawurlencode($id)); + } + + public function move($id, array $params) + { + if (!isset($params['position'])) { + throw new MissingArgumentException(['position']); + } + + return $this->post('/projects/columns/'.rawurlencode($id).'/moves', $params); + } + + public function cards() + { + return new Cards($this->getClient()); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/PullRequest.php b/vendor/knplabs/github-api/lib/Github/Api/PullRequest.php new file mode 100644 index 00000000..ce1c2b1d --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/PullRequest.php @@ -0,0 +1,198 @@ + + */ +class PullRequest extends AbstractApi +{ + use AcceptHeaderTrait; + + /** + * Configure the body type. + * + * @link https://developer.github.com/v3/pulls/#custom-media-types + * + * @param string|null $bodyType + * @param string|null $apiVersion + * + * @return $this + */ + public function configure($bodyType = null, $apiVersion = null) + { + if (null === $apiVersion) { + $apiVersion = $this->getApiVersion(); + } + + if (!in_array($bodyType, ['text', 'html', 'full', 'diff', 'patch'])) { + $bodyType = 'raw'; + } + + if (!in_array($bodyType, ['diff', 'patch'])) { + $bodyType .= '+json'; + } + + $this->acceptHeaderValue = sprintf('application/vnd.github.%s.%s', $apiVersion, $bodyType); + + return $this; + } + + /** + * Get a listing of a project's pull requests by the username, repository and (optionally) state. + * + * @link http://developer.github.com/v3/pulls/ + * + * @param string $username the username + * @param string $repository the repository + * @param array $parameters a list of extra parameters. + * + * @return array array of pull requests for the project + */ + public function all($username, $repository, array $parameters = []) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls', $parameters); + } + + /** + * Show all details of a pull request, including the discussions. + * + * @link http://developer.github.com/v3/pulls/ + * + * @param string $username the username + * @param string $repository the repository + * @param int $id the ID of the pull request for which details are retrieved + * + * @return array|string pull request details + */ + public function show($username, $repository, $id) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$id); + } + + public function commits($username, $repository, $id, array $parameters = []) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($id).'/commits', $parameters); + } + + public function files($username, $repository, $id, array $parameters = []) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($id).'/files', $parameters); + } + + /** + * All statuses which are the statuses of its head branch. + * + * @see http://developer.github.com/v3/pulls/ + * + * @param string $username the username + * @param string $repository the repository + * @param int $id the ID of the pull request for which statuses are retrieved + * + * @return array array of statuses for the project + */ + public function status($username, $repository, $id) + { + $link = $this->show($username, $repository, $id)['_links']['statuses']['href']; + + return $this->get($link); + } + + public function comments() + { + return new Comments($this->getClient()); + } + + public function reviews() + { + return new Review($this->getClient()); + } + + public function reviewRequests() + { + return new ReviewRequest($this->getClient()); + } + + /** + * Create a pull request. + * + * @link http://developer.github.com/v3/pulls/ + * + * @param string $username the username + * @param string $repository the repository + * @param array $params A String of the branch or commit SHA that you want your changes to be pulled to. + * A String of the branch or commit SHA of your changes. Typically this will be a branch. + * If the branch is in a fork of the original repository, specify the username first: + * "my-user:some-branch". The String title of the Pull Request. The String body of + * the Pull Request. The issue number. Used when title and body is not set. + * + * @throws MissingArgumentException + * + * @return array + */ + public function create($username, $repository, array $params) + { + // Two ways to create PR, using issue or title + if (!isset($params['issue']) && !isset($params['title'])) { + throw new MissingArgumentException(['issue', 'title']); + } + + if (!isset($params['base'], $params['head'])) { + throw new MissingArgumentException(['base', 'head']); + } + + // If `issue` is not sent, then `body` must be sent + if (!isset($params['issue']) && !isset($params['body'])) { + throw new MissingArgumentException(['issue', 'body']); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls', $params); + } + + public function update($username, $repository, $id, array $params) + { + if (isset($params['state']) && !in_array($params['state'], ['open', 'closed'])) { + $params['state'] = 'open'; + } + + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($id), $params); + } + + public function merged($username, $repository, $id) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($id).'/merge'); + } + + public function merge($username, $repository, $id, $message, $sha, $mergeMethod = 'merge', $title = null) + { + if (is_bool($mergeMethod)) { + $mergeMethod = $mergeMethod ? 'squash' : 'merge'; + } + + if (!in_array($mergeMethod, ['merge', 'squash', 'rebase'], true)) { + throw new InvalidArgumentException(sprintf('"$mergeMethod" must be one of ["merge", "squash", "rebase"] ("%s" given).', $mergeMethod)); + } + + $params = [ + 'commit_message' => $message, + 'sha' => $sha, + 'merge_method' => $mergeMethod, + ]; + + if (is_string($title)) { + $params['commit_title'] = $title; + } + + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($id).'/merge', $params); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/PullRequest/Comments.php b/vendor/knplabs/github-api/lib/Github/Api/PullRequest/Comments.php new file mode 100644 index 00000000..3ded9456 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/PullRequest/Comments.php @@ -0,0 +1,153 @@ + + */ +class Comments extends AbstractApi +{ + use AcceptHeaderTrait; + + /** + * Configure the body type. + * + * @link https://developer.github.com/v3/pulls/comments/#custom-media-types + * + * @param string|null $bodyType + * @param string|null $apiVersion + * + * @return $this + */ + public function configure($bodyType = null, $apiVersion = null) + { + if ($apiVersion !== 'squirrel-girl-preview') { + $apiVersion = $this->getApiVersion(); + } + + if (!in_array($bodyType, ['text', 'html', 'full'])) { + $bodyType = 'raw'; + } + + $this->acceptHeaderValue = sprintf('application/vnd.github.%s.%s+json', $apiVersion, $bodyType); + + return $this; + } + + /** + * Get a listing of a pull request's comments by the username, repository and pull request number + * or all repository comments by the username and repository. + * + * @link https://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request + * @link https://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + * + * @param string $username the username + * @param string $repository the repository + * @param int|null $pullRequest the pull request number + * @param array $params a list of extra parameters. + * + * @return array + */ + public function all($username, $repository, $pullRequest = null, array $params = []) + { + if (null !== $pullRequest) { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/comments'); + } + + $parameters = array_merge([ + 'page' => 1, + 'per_page' => 30, + ], $params); + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/comments', $parameters); + } + + /** + * Get a single pull request comment by the username, repository and comment id. + * + * @link https://developer.github.com/v3/pulls/comments/#get-a-single-comment + * + * @param string $username the username + * @param string $repository the repository + * @param int $comment the comment id + * + * @return array + */ + public function show($username, $repository, $comment) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/comments/'.$comment); + } + + /** + * Create a pull request comment by the username, repository and pull request number. + * + * @link https://developer.github.com/v3/pulls/comments/#create-a-comment + * + * @param string $username the username + * @param string $repository the repository + * @param int $pullRequest the pull request number + * @param array $params a list of extra parameters. + * + * @throws MissingArgumentException + * + * @return array + */ + public function create($username, $repository, $pullRequest, array $params) + { + if (!isset($params['body'])) { + throw new MissingArgumentException('body'); + } + + // If `in_reply_to` is set, other options are not necessary anymore + if (!isset($params['in_reply_to']) && !isset($params['commit_id'], $params['path'], $params['position'])) { + throw new MissingArgumentException(['commit_id', 'path', 'position']); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/comments', $params); + } + + /** + * Update a pull request comment by the username, repository and comment id. + * + * @link https://developer.github.com/v3/pulls/comments/#edit-a-comment + * + * @param string $username the username + * @param string $repository the repository + * @param int $comment the comment id + * @param array $params a list of extra parameters. + * + * @throws MissingArgumentException + * + * @return array + */ + public function update($username, $repository, $comment, array $params) + { + if (!isset($params['body'])) { + throw new MissingArgumentException('body'); + } + + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/comments/'.$comment, $params); + } + + /** + * Delete a pull request comment by the username, repository and comment id. + * + * @link https://developer.github.com/v3/pulls/comments/#delete-a-comment + * + * @param string $username the username + * @param string $repository the repository + * @param int $comment the comment id + * + * @return string + */ + public function remove($username, $repository, $comment) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/comments/'.$comment); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/PullRequest/Review.php b/vendor/knplabs/github-api/lib/Github/Api/PullRequest/Review.php new file mode 100644 index 00000000..ed586ddf --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/PullRequest/Review.php @@ -0,0 +1,211 @@ + + */ +class Review extends AbstractApi +{ + use AcceptHeaderTrait; + + public function configure() + { + trigger_deprecation('KnpLabs/php-github-api', '3.2', 'The "%s" is deprecated and will be removed.', __METHOD__); + + return $this; + } + + /** + * Get a listing of a pull request's reviews by the username, repository and pull request number. + * + * @link https://developer.github.com/v3/pulls/reviews/#list-reviews-on-a-pull-request + * + * @param string $username the username + * @param string $repository the repository + * @param int $pullRequest the pull request number + * @param array $params a list of extra parameters. + * + * @return array array of pull request reviews for the pull request + */ + public function all($username, $repository, $pullRequest, array $params = []) + { + if (!empty($params)) { + trigger_deprecation('KnpLabs/php-github-api', '3.2', 'The "$params" parameter is deprecated, to paginate the results use the "ResultPager" instead.'); + } + + $parameters = array_merge([ + 'page' => 1, + 'per_page' => 30, + ], $params); + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/reviews', $parameters); + } + + /** + * Get a single pull request review by the username, repository, pull request number and the review id. + * + * @link https://developer.github.com/v3/pulls/reviews/#get-a-single-review + * + * @param string $username the username + * @param string $repository the repository + * @param int $pullRequest the pull request number + * @param int $id the review id + * + * @return array the pull request review + */ + public function show($username, $repository, $pullRequest, $id) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/reviews/'.$id); + } + + /** + * Delete a single pull request review by the username, repository, pull request number and the review id. + * + * @link https://developer.github.com/v3/pulls/reviews/#delete-a-pending-review + * + * @param string $username the username + * @param string $repository the repository + * @param int $pullRequest the pull request number + * @param int $id the review id + * + * @return array|string + */ + public function remove($username, $repository, $pullRequest, $id) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/reviews/'.$id); + } + + /** + * Get comments for a single pull request review. + * + * @link https://developer.github.com/v3/pulls/reviews/#get-comments-for-a-single-review + * + * @param string $username the username + * @param string $repository the repository + * @param int $pullRequest the pull request number + * @param int $id the review id + * + * @return array|string + */ + public function comments($username, $repository, $pullRequest, $id) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/reviews/'.$id.'/comments'); + } + + /** + * Create a pull request review by the username, repository and pull request number. + * + * @link https://developer.github.com/v3/pulls/reviews/#create-a-pull-request-review + * + * @param string $username the username + * @param string $repository the repository + * @param int $pullRequest the pull request number + * @param array $params a list of extra parameters. + * + * @throws MissingArgumentException + * + * @return array the pull request review + */ + public function create($username, $repository, $pullRequest, array $params = []) + { + if (array_key_exists('event', $params) && !in_array($params['event'], ['APPROVE', 'REQUEST_CHANGES', 'COMMENT'], true)) { + throw new InvalidArgumentException(sprintf('"event" must be one of ["APPROVE", "REQUEST_CHANGES", "COMMENT"] ("%s" given).', $params['event'])); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/reviews', $params); + } + + /** + * Submit a pull request review by the username, repository, pull request number and the review id. + * + * @link https://developer.github.com/v3/pulls/reviews/#submit-a-pull-request-review + * + * @param string $username the username + * @param string $repository the repository + * @param int $pullRequest the pull request number + * @param int $id the review id + * @param array $params a list of extra parameters. + * + * @throws MissingArgumentException + * + * @return array the pull request review + */ + public function submit($username, $repository, $pullRequest, $id, array $params = []) + { + if (!isset($params['event'])) { + throw new MissingArgumentException('event'); + } + + if (!in_array($params['event'], ['APPROVE', 'REQUEST_CHANGES', 'COMMENT'], true)) { + throw new InvalidArgumentException(sprintf('"event" must be one of ["APPROVE", "REQUEST_CHANGES", "COMMENT"] ("%s" given).', $params['event'])); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/reviews/'.$id.'/events', $params); + } + + /** + * Dismiss a pull request review by the username, repository, pull request number and the review id. + * + * @link https://developer.github.com/v3/pulls/reviews/#dismiss-a-pull-request-review + * + * @param string $username the username + * @param string $repository the repository + * @param int $pullRequest the pull request number + * @param int $id the review id + * @param string $message a mandatory dismissal message + * + * @return array|string + */ + public function dismiss($username, $repository, $pullRequest, $id, $message) + { + if (!is_string($message)) { + throw new InvalidArgumentException(sprintf('"message" must be a valid string ("%s" given).', gettype($message))); + } + + if (empty($message)) { + throw new InvalidArgumentException('"message" is mandatory and cannot be empty'); + } + + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/reviews/'.$id.'/dismissals', [ + 'message' => $message, + ]); + } + + /** + * Update a pull request review by the username, repository, pull request number and the review id. + * + * @link https://developer.github.com/v3/pulls/reviews/#update-a-pull-request-review + * + * @param string $username the username + * @param string $repository the repository + * @param int $pullRequest the pull request number + * @param int $id the review id + * @param string $body a mandatory dismissal message + * + * @return array|string + */ + public function update($username, $repository, $pullRequest, $id, $body) + { + if (!is_string($body)) { + throw new InvalidArgumentException(sprintf('"body" must be a valid string ("%s" given).', gettype($body))); + } + + if (empty($body)) { + throw new InvalidArgumentException('"body" is mandatory and cannot be empty'); + } + + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/reviews/'.$id, [ + 'body' => $body, + ]); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/PullRequest/ReviewRequest.php b/vendor/knplabs/github-api/lib/Github/Api/PullRequest/ReviewRequest.php new file mode 100644 index 00000000..d95913cc --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/PullRequest/ReviewRequest.php @@ -0,0 +1,72 @@ +get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/requested_reviewers', $params); + } + + /** + * @link https://developer.github.com/v3/pulls/review_requests/#create-a-review-request + * + * @param string $username + * @param string $repository + * @param int $pullRequest + * @param array $reviewers + * @param array $teamReviewers + * + * @return string + */ + public function create($username, $repository, $pullRequest, array $reviewers = [], array $teamReviewers = []) + { + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/requested_reviewers', ['reviewers' => $reviewers, 'team_reviewers' => $teamReviewers]); + } + + /** + * @link https://developer.github.com/v3/pulls/review_requests/#delete-a-review-request + * + * @param string $username + * @param string $repository + * @param int $pullRequest + * @param array $reviewers + * @param array $teamReviewers + * + * @return string + */ + public function remove($username, $repository, $pullRequest, array $reviewers = [], array $teamReviewers = []) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/requested_reviewers', ['reviewers' => $reviewers, 'team_reviewers' => $teamReviewers]); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/RateLimit.php b/vendor/knplabs/github-api/lib/Github/Api/RateLimit.php new file mode 100644 index 00000000..10b8b5b3 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/RateLimit.php @@ -0,0 +1,70 @@ + + */ +class RateLimit extends AbstractApi +{ + /** + * @var RateLimitResource[] + */ + protected $resources = []; + + /** + * Gets the rate limit resource objects. + * + * @return RateLimitResource[] + */ + public function getResources() + { + $this->fetchLimits(); + + return $this->resources; + } + + /** + * Returns a rate limit resource object by the given name. + * + * @param string $name + * + * @return RateLimitResource|false + */ + public function getResource($name) + { + // Fetch once per instance + if (empty($this->resources)) { + $this->fetchLimits(); + } + + if (!isset($this->resources[$name])) { + return false; + } + + return $this->resources[$name]; + } + + /** + * Returns the data directly from the GitHub API endpoint. + * + * @return array + */ + protected function fetchLimits() + { + $result = $this->get('/rate_limit') ?: []; + + // Assemble Limit instances + foreach ($result['resources'] as $resourceName => $resource) { + $this->resources[$resourceName] = new RateLimitResource($resourceName, $resource); + } + + return $result; + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/RateLimit/RateLimitResource.php b/vendor/knplabs/github-api/lib/Github/Api/RateLimit/RateLimitResource.php new file mode 100644 index 00000000..661a4e52 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/RateLimit/RateLimitResource.php @@ -0,0 +1,73 @@ +name = $name; + $this->limit = $data['limit']; + $this->remaining = $data['remaining']; + $this->reset = $data['reset']; + } + + /** + * The name of the Limit, e.g. "core", "graphql", "search". + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The rate limit amount. + * + * @return int + */ + public function getLimit() + { + return $this->limit; + } + + /** + * Number of requests remaining in time period before hitting the rate limit. + * + * @return int + */ + public function getRemaining() + { + return $this->remaining; + } + + /** + * Timestamp for when the rate limit will be reset. + * + * @return int + */ + public function getReset() + { + return $this->reset; + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repo.php b/vendor/knplabs/github-api/lib/Github/Api/Repo.php new file mode 100644 index 00000000..4d8c012f --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repo.php @@ -0,0 +1,822 @@ + + * @author Thibault Duplessis + */ +class Repo extends AbstractApi +{ + use AcceptHeaderTrait; + + /** + * List all public repositories. + * + * @link https://developer.github.com/v3/repos/#list-all-public-repositories + * + * @param int|null $id The integer ID of the last Repository that you’ve seen. + * + * @return array list of users found + */ + public function all($id = null) + { + if (!is_int($id)) { + return $this->get('/repositories'); + } + + return $this->get('/repositories', ['since' => $id]); + } + + /** + * Get the last year of commit activity for a repository grouped by week. + * + * @link http://developer.github.com/v3/repos/statistics/#commit-activity + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * + * @return array commit activity grouped by week + */ + public function activity($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stats/commit_activity'); + } + + /** + * Get contributor commit statistics for a repository. + * + * @link http://developer.github.com/v3/repos/statistics/#contributors + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * + * @return array list of contributors and their commit statistics + */ + public function statistics($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stats/contributors'); + } + + /** + * Get a weekly aggregate of the number of additions and deletions pushed to a repository. + * + * @link http://developer.github.com/v3/repos/statistics/#code-frequency + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * + * @return array list of weeks and their commit statistics + */ + public function frequency($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stats/code_frequency'); + } + + /** + * Get the weekly commit count for the repository owner and everyone else. + * + * @link http://developer.github.com/v3/repos/statistics/#participation + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * + * @return array list of weekly commit count grouped by 'all' and 'owner' + */ + public function participation($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stats/participation'); + } + + /** + * List all repositories for an organization. + * + * @link http://developer.github.com/v3/repos/#list-organization-repositories + * + * @param string $organization the name of the organization + * @param array $params + * + * @return array list of organization repositories + */ + public function org($organization, array $params = []) + { + return $this->get('/orgs/'.$organization.'/repos', array_merge(['start_page' => 1], $params)); + } + + /** + * Get extended information about a repository by its username and repository name. + * + * @link http://developer.github.com/v3/repos/ + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * + * @return array information about the repository + */ + public function show($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository)); + } + + /** + * Get extended information about a repository by its id. + * Note: at time of writing this is an undocumented feature but GitHub support have advised that it can be relied on. + * + * @link http://developer.github.com/v3/repos/ + * @link https://github.com/piotrmurach/github/issues/283 + * @link https://github.com/piotrmurach/github/issues/282 + * + * @param int $id the id of the repository + * + * @return array information about the repository + */ + public function showById($id) + { + return $this->get('/repositories/'.$id); + } + + /** + * Create repository. + * + * @link http://developer.github.com/v3/repos/ + * + * @param string $name name of the repository + * @param string $description repository description + * @param string $homepage homepage url + * @param bool $public `true` for public, `false` for private + * @param string|null $organization username of organization if applicable + * @param bool $hasIssues `true` to enable issues for this repository, `false` to disable them + * @param bool $hasWiki `true` to enable the wiki for this repository, `false` to disable it + * @param bool $hasDownloads `true` to enable downloads for this repository, `false` to disable them + * @param int $teamId The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization. + * @param bool $autoInit `true` to create an initial commit with empty README, `false` for no initial commit + * @param bool $hasProjects `true` to enable projects for this repository or false to disable them. + * @param string|null $visibility + * + * @return array returns repository data + */ + public function create( + $name, + $description = '', + $homepage = '', + $public = true, + $organization = null, + $hasIssues = false, + $hasWiki = false, + $hasDownloads = false, + $teamId = null, + $autoInit = false, + $hasProjects = true, + $visibility = null + ) { + $path = null !== $organization ? '/orgs/'.$organization.'/repos' : '/user/repos'; + + $parameters = [ + 'name' => $name, + 'description' => $description, + 'homepage' => $homepage, + 'visibility' => $visibility ?? ($public ? 'public' : 'private'), + 'has_issues' => $hasIssues, + 'has_wiki' => $hasWiki, + 'has_downloads' => $hasDownloads, + 'auto_init' => $autoInit, + 'has_projects' => $hasProjects, + ]; + + if ($organization && $teamId) { + $parameters['team_id'] = $teamId; + } + + return $this->post($path, $parameters); + } + + /** + * Set information of a repository. + * + * @link http://developer.github.com/v3/repos/ + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * @param array $values the key => value pairs to post + * + * @return array information about the repository + */ + public function update($username, $repository, array $values) + { + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository), $values); + } + + /** + * Delete a repository. + * + * @link http://developer.github.com/v3/repos/ + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * + * @return mixed null on success, array on error with 'message' + */ + public function remove($username, $repository) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository)); + } + + /** + * Get the readme content for a repository by its username and repository name. + * + * @link http://developer.github.com/v3/repos/contents/#get-the-readme + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * @param string $format one of formats: "raw", "html", or "v3+json" + * @param string $dir The alternate path to look for a README file + * @param array $params additional query params like "ref" to fetch readme for branch/tag + * + * @return string|array the readme content + */ + public function readme($username, $repository, $format = 'raw', $dir = null, $params = []) + { + $path = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/readme'; + + if (null !== $dir) { + $path .= '/'.rawurlencode($dir); + } + + return $this->get($path, $params, [ + 'Accept' => "application/vnd.github.$format", + ]); + } + + /** + * Create a repository dispatch event. + * + * @link https://developer.github.com/v3/repos/#create-a-repository-dispatch-event + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * @param string $eventType A custom webhook event name + * + * @return mixed null on success, array on error with 'message' + */ + public function dispatch($username, $repository, $eventType, array $clientPayload) + { + return $this->post(\sprintf('/repos/%s/%s/dispatches', rawurlencode($username), rawurlencode($repository)), [ + 'event_type' => $eventType, + 'client_payload' => $clientPayload, + ]); + } + + /** + * Manage the collaborators of a repository. + * + * @link http://developer.github.com/v3/repos/collaborators/ + * + * @return Collaborators + */ + public function collaborators() + { + return new Collaborators($this->getClient()); + } + + /** + * Manage the comments of a repository. + * + * @link http://developer.github.com/v3/repos/comments/ + * + * @return Comments + */ + public function comments() + { + return new Comments($this->getClient()); + } + + /** + * Manage the commits of a repository. + * + * @link http://developer.github.com/v3/repos/commits/ + * + * @return Commits + */ + public function commits() + { + return new Commits($this->getClient()); + } + + /** + * @link https://docs.github.com/en/rest/reference/checks#check-runs + */ + public function checkRuns(): CheckRuns + { + return new CheckRuns($this->getClient()); + } + + /** + * @link https://docs.github.com/en/rest/reference/checks#check-suites + */ + public function checkSuites(): CheckSuites + { + return new CheckSuites($this->getClient()); + } + + /** + * @link https://developer.github.com/v3/actions/artifacts/#artifacts + */ + public function artifacts(): Artifacts + { + return new Artifacts($this->getClient()); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#workflows + */ + public function workflows(): Workflows + { + return new Workflows($this->getClient()); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#workflow-runs + */ + public function workflowRuns(): WorkflowRuns + { + return new WorkflowRuns($this->getClient()); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#workflow-jobs + */ + public function workflowJobs(): WorkflowJobs + { + return new WorkflowJobs($this->getClient()); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#self-hosted-runners + */ + public function selfHostedRunners(): SelfHostedRunners + { + return new SelfHostedRunners($this->getClient()); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#secrets + */ + public function secrets(): Secrets + { + return new Secrets($this->getClient()); + } + + /** + * Manage the content of a repository. + * + * @link http://developer.github.com/v3/repos/contents/ + * + * @return Contents + */ + public function contents() + { + return new Contents($this->getClient()); + } + + /** + * Manage the content of a repository. + * + * @link http://developer.github.com/v3/repos/downloads/ + * + * @return Downloads + */ + public function downloads() + { + return new Downloads($this->getClient()); + } + + /** + * Manage the releases of a repository (Currently Undocumented). + * + * @link http://developer.github.com/v3/repos/ + * + * @return Releases + */ + public function releases() + { + return new Releases($this->getClient()); + } + + /** + * Manage the deploy keys of a repository. + * + * @link http://developer.github.com/v3/repos/keys/ + * + * @return DeployKeys + */ + public function keys() + { + return new DeployKeys($this->getClient()); + } + + /** + * Manage the forks of a repository. + * + * @link http://developer.github.com/v3/repos/forks/ + * + * @return Forks + */ + public function forks() + { + return new Forks($this->getClient()); + } + + /** + * Manage the stargazers of a repository. + * + * @link https://developer.github.com/v3/activity/starring/#list-stargazers + * + * @return Stargazers + */ + public function stargazers() + { + return new Stargazers($this->getClient()); + } + + /** + * Manage the hooks of a repository. + * + * @link http://developer.github.com/v3/issues/jooks/ + * + * @return Hooks + */ + public function hooks() + { + return new Hooks($this->getClient()); + } + + /** + * Manage the labels of a repository. + * + * @link http://developer.github.com/v3/issues/labels/ + * + * @return Labels + */ + public function labels() + { + return new Labels($this->getClient()); + } + + /** + * Manage the statuses of a repository. + * + * @link http://developer.github.com/v3/repos/statuses/ + * + * @return Statuses + */ + public function statuses() + { + return new Statuses($this->getClient()); + } + + /** + * Get the branch(es) of a repository. + * + * @link http://developer.github.com/v3/repos/ + * + * @param string $username the username + * @param string $repository the name of the repository + * @param string $branch the name of the branch + * @param array $parameters parameters for the query string + * + * @return array list of the repository branches + */ + public function branches($username, $repository, $branch = null, array $parameters = []) + { + $url = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches'; + if (null !== $branch) { + $url .= '/'.rawurlencode($branch); + } + + return $this->get($url, $parameters); + } + + /** + * Manage the protection of a repository branch. + * + * @link https://developer.github.com/v3/repos/branches/#get-branch-protection + * + * @return Protection + */ + public function protection() + { + return new Protection($this->getClient()); + } + + /** + * Get the contributors of a repository. + * + * @link http://developer.github.com/v3/repos/ + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * @param bool $includingAnonymous by default, the list only shows GitHub users. + * You can include non-users too by setting this to true + * + * @return array list of the repo contributors + */ + public function contributors($username, $repository, $includingAnonymous = false) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/contributors', [ + 'anon' => $includingAnonymous ?: null, + ]); + } + + /** + * Get the language breakdown of a repository. + * + * @link http://developer.github.com/v3/repos/ + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * + * @return array list of the languages + */ + public function languages($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/languages'); + } + + /** + * Get the tags of a repository. + * + * @link http://developer.github.com/v3/repos/ + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * @param array $params the additional parameters like milestone, assignees, labels, sort, direction + * + * @return array list of the repository tags + */ + public function tags($username, $repository, array $params = []) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/tags', $params); + } + + /** + * Get the teams of a repository. + * + * @link http://developer.github.com/v3/repos/ + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * + * @return array list of the languages + */ + public function teams($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/teams'); + } + + /** + * @param string $username + * @param string $repository + * @param int $page + * + * @return array + */ + public function subscribers($username, $repository, $page = 1) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/subscribers', [ + 'page' => $page, + ]); + } + + /** + * Perform a merge. + * + * @link http://developer.github.com/v3/repos/merging/ + * + * @param string $username + * @param string $repository + * @param string $base The name of the base branch that the head will be merged into. + * @param string $head The head to merge. This can be a branch name or a commit SHA1. + * @param string $message Commit message to use for the merge commit. If omitted, a default message will be used. + * + * @return array|string + */ + public function merge($username, $repository, $base, $head, $message = null) + { + $parameters = [ + 'base' => $base, + 'head' => $head, + ]; + + if (is_string($message)) { + $parameters['commit_message'] = $message; + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/merges', $parameters); + } + + /** + * @param string $username + * @param string $repository + * @param array $parameters + * + * @return array + */ + public function milestones($username, $repository, array $parameters = []) + { + return $this->get('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/milestones', $parameters); + } + + /** + * @link https://docs.github.com/en/rest/reference/repos#enable-automated-security-fixes + * + * @param string $username + * @param string $repository + * + * @return array|string + */ + public function enableAutomatedSecurityFixes(string $username, string $repository) + { + $this->acceptHeaderValue = 'application/vnd.github.london-preview+json'; + + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/automated-security-fixes'); + } + + /** + * @link https://docs.github.com/en/rest/reference/repos#disable-automated-security-fixes + * + * @param string $username + * @param string $repository + * + * @return array|string + */ + public function disableAutomatedSecurityFixes(string $username, string $repository) + { + $this->acceptHeaderValue = 'application/vnd.github.london-preview+json'; + + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/automated-security-fixes'); + } + + public function projects() + { + return new Projects($this->getClient()); + } + + public function traffic() + { + return new Traffic($this->getClient()); + } + + public function pages() + { + return new Pages($this->getClient()); + } + + /** + * @param string $username + * @param string $repository + * @param int $page + * + * @return array|string + * + * @see https://developer.github.com/v3/activity/events/#list-repository-events + */ + public function events($username, $repository, $page = 1) + { + return $this->get('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/events', ['page' => $page]); + } + + /** + * Get the community profile metrics for a repository. + * + * @link https://developer.github.com/v3/repos/community/#retrieve-community-profile-metrics + * + * @param string $username + * @param string $repository + * + * @return array + */ + public function communityProfile($username, $repository) + { + //This api is in preview mode, so set the correct accept-header + $this->acceptHeaderValue = 'application/vnd.github.black-panther-preview+json'; + + return $this->get('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/community/profile'); + } + + /** + * Get the contents of a repository's code of conduct. + * + * @link https://developer.github.com/v3/codes_of_conduct/#get-the-contents-of-a-repositorys-code-of-conduct + * + * @param string $username + * @param string $repository + * + * @return array + */ + public function codeOfConduct($username, $repository) + { + //This api is in preview mode, so set the correct accept-header + $this->acceptHeaderValue = 'application/vnd.github.scarlet-witch-preview+json'; + + return $this->get('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/community/code_of_conduct'); + } + + /** + * List all topics for a repository. + * + * @link https://developer.github.com/v3/repos/#list-all-topics-for-a-repository + * + * @param string $username + * @param string $repository + * + * @return array + */ + public function topics($username, $repository) + { + //This api is in preview mode, so set the correct accept-header + $this->acceptHeaderValue = 'application/vnd.github.mercy-preview+json'; + + return $this->get('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/topics'); + } + + /** + * Replace all topics for a repository. + * + * @link https://developer.github.com/v3/repos/#replace-all-topics-for-a-repository + * + * @param string $username + * @param string $repository + * @param array $topics + * + * @return array + */ + public function replaceTopics($username, $repository, array $topics) + { + //This api is in preview mode, so set the correct accept-header + $this->acceptHeaderValue = 'application/vnd.github.mercy-preview+json'; + + return $this->put('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/topics', ['names' => $topics]); + } + + /** + * Transfer a repository. + * + * @link https://developer.github.com/v3/repos/#transfer-a-repository + * + * @param string $username + * @param string $repository + * @param string $newOwner + * @param array $teamId + * + * @return array + */ + public function transfer($username, $repository, $newOwner, $teamId = []) + { + return $this->post('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/transfer', ['new_owner' => $newOwner, 'team_id' => $teamId]); + } + + /** + * Create a repository using a template. + * + * @link https://developer.github.com/v3/repos/#create-a-repository-using-a-template + * + * @return array + */ + public function createFromTemplate(string $templateOwner, string $templateRepo, array $parameters = []) + { + //This api is in preview mode, so set the correct accept-header + $this->acceptHeaderValue = 'application/vnd.github.baptiste-preview+json'; + + return $this->post('/repos/'.rawurldecode($templateOwner).'/'.rawurldecode($templateRepo).'/generate', $parameters); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Artifacts.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Artifacts.php new file mode 100644 index 00000000..84f3b060 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Artifacts.php @@ -0,0 +1,82 @@ +get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/artifacts', $parameters); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#list-workflow-run-artifacts + * + * @param string $username + * @param string $repository + * @param int $runId + * + * @return array + */ + public function runArtifacts(string $username, string $repository, int $runId) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId.'/artifacts'); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#get-an-artifact + * + * @param string $username + * @param string $repository + * @param int $artifactId + * + * @return array + */ + public function show(string $username, string $repository, int $artifactId) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/artifacts/'.$artifactId); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#delete-an-artifact + * + * @param string $username + * @param string $repository + * @param int $artifactId + * + * @return array + */ + public function remove(string $username, string $repository, int $artifactId) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/artifacts/'.$artifactId); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#download-an-artifact + * + * @param string $username + * @param string $repository + * @param int $artifactId + * @param string $format + * + * @return array + */ + public function download(string $username, string $repository, int $artifactId, string $format = 'zip') + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/artifacts/'.$artifactId.'/'.$format); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Secrets.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Secrets.php new file mode 100644 index 00000000..2085a133 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Secrets.php @@ -0,0 +1,95 @@ +get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/secrets'); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#get-a-repository-secret + * + * @param string $username + * @param string $repository + * @param string $secretName + * + * @return array|string + */ + public function show(string $username, string $repository, string $secretName) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/secrets/'.rawurlencode($secretName)); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#create-or-update-a-repository-secret + * + * @param string $username + * @param string $repository + * @param string $secretName + * @param array $parameters + * + * @return array|string + */ + public function create(string $username, string $repository, string $secretName, array $parameters = []) + { + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/secrets/'.rawurlencode($secretName), $parameters); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#create-or-update-a-repository-secret + * + * @param string $username + * @param string $repository + * @param string $secretName + * @param array $parameters + * + * @return array|string + */ + public function update(string $username, string $repository, string $secretName, array $parameters = []) + { + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/secrets/'.rawurlencode($secretName), $parameters); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#delete-a-repository-secret + * + * @param string $username + * @param string $repository + * @param string $secretName + * + * @return array|string + */ + public function remove(string $username, string $repository, string $secretName) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/secrets/'.rawurlencode($secretName)); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#get-a-repository-public-key + * + * @param string $username + * @param string $repository + * + * @return array|string + */ + public function publicKey(string $username, string $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/secrets/public-key'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/SelfHostedRunners.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/SelfHostedRunners.php new file mode 100644 index 00000000..7eb1a9d4 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/SelfHostedRunners.php @@ -0,0 +1,65 @@ +get('/repos/'.rawurlencode($username).'/'.rawurldecode($repository).'/actions/runners'); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#get-a-self-hosted-runner-for-a-repository + * + * @param string $username + * @param string $repository + * @param int $runnerId + * + * @return array|string + */ + public function show(string $username, string $repository, int $runnerId) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurldecode($repository).'/actions/runners/'.$runnerId); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#delete-a-self-hosted-runner-from-a-repository + * + * @param string $username + * @param string $repository + * @param int $runnerId + * + * @return array|string + */ + public function remove(string $username, string $repository, int $runnerId) + { + return $this->delete('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/actions/runners/'.$runnerId); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#list-runner-applications-for-a-repository + * + * @param string $username + * @param string $repository + * + * @return array|string + */ + public function applications(string $username, string $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runners/downloads'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/WorkflowJobs.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/WorkflowJobs.php new file mode 100644 index 00000000..3167d3db --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/WorkflowJobs.php @@ -0,0 +1,54 @@ +get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId.'/jobs', $parameters); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#get-a-job-for-a-workflow-run + * + * @param string $username + * @param string $repository + * @param int $jobId + * + * @return array + */ + public function show(string $username, string $repository, int $jobId) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/jobs/'.$jobId); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#download-job-logs-for-a-workflow-run + * + * @param string $username + * @param string $repository + * @param int $jobId + * + * @return array + */ + public function downloadLogs(string $username, string $repository, int $jobId) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/jobs/'.$jobId.'/logs'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/WorkflowRuns.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/WorkflowRuns.php new file mode 100644 index 00000000..d6f95f1e --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/WorkflowRuns.php @@ -0,0 +1,155 @@ +get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs', $parameters); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#list-workflow-runs + * + * @param string $username + * @param string $repository + * @param string $workflow + * @param array $parameters + * + * @return array + */ + public function listRuns(string $username, string $repository, string $workflow, array $parameters = []) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/workflows/'.rawurlencode($workflow).'/runs', $parameters); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#get-a-workflow-run + * + * @param string $username + * @param string $repository + * @param int $runId + * @param array $parameters + * + * @return array + */ + public function show(string $username, string $repository, int $runId, array $parameters = []) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId, $parameters); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#delete-a-workflow-run + * + * @param string $username + * @param string $repository + * @param int $runId + * + * @return array|string + */ + public function remove(string $username, string $repository, int $runId) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#re-run-a-workflow + * + * @param string $username + * @param string $repository + * @param int $runId + * + * @return array + */ + public function rerun(string $username, string $repository, int $runId) + { + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId.'/rerun'); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#cancel-a-workflow-run + * + * @param string $username + * @param string $repository + * @param int $runId + * + * @return array + */ + public function cancel(string $username, string $repository, int $runId) + { + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId.'/cancel'); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#get-workflow-run-usage + * + * @param string $username + * @param string $repository + * @param int $runId + * + * @return array + */ + public function usage(string $username, string $repository, int $runId) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId.'/timing'); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#download-workflow-run-logs + * + * @param string $username + * @param string $repository + * @param int $runId + * + * @return array|string + */ + public function downloadLogs(string $username, string $repository, int $runId) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId.'/logs'); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#delete-workflow-run-logs + * + * @param string $username + * @param string $repository + * @param int $runId + * + * @return array|string + */ + public function deleteLogs(string $username, string $repository, int $runId) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId.'/logs'); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#approve-a-workflow-run-for-a-fork-pull-request + * + * @param string $username + * @param string $repository + * @param int $runId + * + * @return array|string + * + * @experimental This endpoint is currently in beta. + */ + public function approve(string $username, string $repository, int $runId) + { + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId.'/approve'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Workflows.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Workflows.php new file mode 100644 index 00000000..e425f9d2 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Workflows.php @@ -0,0 +1,82 @@ +get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/workflows', $parameters); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#get-a-workflow + * + * @param string $username + * @param string $repository + * @param string|int $workflow + * + * @return array + */ + public function show(string $username, string $repository, $workflow) + { + if (is_string($workflow)) { + $workflow = rawurlencode($workflow); + } + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/workflows/'.$workflow); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#get-workflow-usage + * + * @param string $username + * @param string $repository + * @param string|int $workflow + * + * @return array|string + */ + public function usage(string $username, string $repository, $workflow) + { + if (is_string($workflow)) { + $workflow = rawurlencode($workflow); + } + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/workflows/'.$workflow.'/timing'); + } + + /** + * @link https://docs.github.com/en/rest/reference/actions#create-a-workflow-dispatch-event + * + * @param string $username + * @param string $repository + * @param string|int $workflow + * @param string $ref + * @param array $inputs + * + * @return array|string empty + */ + public function dispatches(string $username, string $repository, $workflow, string $ref, array $inputs = null) + { + if (is_string($workflow)) { + $workflow = rawurlencode($workflow); + } + $parameters = array_filter(['ref' => $ref, 'inputs' => $inputs]); + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/workflows/'.$workflow.'/dispatches', $parameters); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Assets.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Assets.php new file mode 100644 index 00000000..043016e7 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Assets.php @@ -0,0 +1,123 @@ + + */ +class Assets extends AbstractApi +{ + use AcceptHeaderTrait; + + /** + * Get all release's assets in selected repository + * GET /repos/:owner/:repo/releases/:id/assets. + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * @param int $id the id of the release + * + * @return array + */ + public function all($username, $repository, $id) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.$id.'/assets'); + } + + /** + * Get an asset in selected repository's release + * GET /repos/:owner/:repo/releases/assets/:id. + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * @param int $id the id of the asset + * + * @return array|string + */ + public function show($username, $repository, $id, bool $returnBinaryContent = false) + { + if ($returnBinaryContent) { + $this->acceptHeaderValue = 'application/octet-stream'; + } + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/assets/'.$id); + } + + /** + * Create an asset for selected repository's release + * POST /repos/:owner/:repo/releases/:id/assets?name=:filename. + * + * Creating an asset requires support for server name indentification (SNI) + * so this must be supported by your PHP version. + * + * @see http://developer.github.com/v3/repos/releases/#upload-a-release-asset + * @see http://php.net/manual/en/openssl.constsni.php + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * @param int $id the id of the release + * @param string $name the filename for the asset + * @param string $contentType the content type for the asset + * @param string $content the content of the asset + * + * @throws MissingArgumentException + * @throws ErrorException + * + * @return array + */ + public function create($username, $repository, $id, $name, $contentType, $content) + { + if (!defined('OPENSSL_TLSEXT_SERVER_NAME') || OPENSSL_TLSEXT_SERVER_NAME == 0) { + throw new ErrorException('Asset upload support requires Server Name Indication. This is not supported by your PHP version. See https://www.php.net/manual/en/openssl.constsni.php.'); + } + + // Asset creation requires a separate endpoint, uploads.github.com. + // Change the base url for the HTTP client temporarily while we execute + // this request. + return $this->postRaw('https://uploads.github.com/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.$id.'/assets?name='.$name, $content, ['Content-Type' => $contentType]); + } + + /** + * Edit an asset in selected repository's release + * PATCH /repos/:owner/:repo/releases/assets/:id. + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * @param int $id the id of the asset + * @param array $params request parameters + * + * @throws MissingArgumentException + * + * @return array + */ + public function edit($username, $repository, $id, array $params) + { + if (!isset($params['name'])) { + throw new MissingArgumentException('name'); + } + + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/assets/'.$id, $params); + } + + /** + * Delete an asset in selected repository's release + * DELETE /repos/:owner/:repo/releases/assets/:id. + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * @param int $id the id of the asset + * + * @return array + */ + public function remove($username, $repository, $id) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/assets/'.$id); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Checks/CheckRuns.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Checks/CheckRuns.php new file mode 100644 index 00000000..37968a01 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Checks/CheckRuns.php @@ -0,0 +1,86 @@ +acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-runs', $params); + } + + /** + * @link https://docs.github.com/en/rest/reference/checks#get-a-check-run + * + * @return array + */ + public function show(string $username, string $repository, int $checkRunId) + { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-runs/'.$checkRunId); + } + + /** + * @link https://docs.github.com/en/rest/reference/checks#update-a-check-run + * + * @return array + */ + public function update(string $username, string $repository, int $checkRunId, array $params = []) + { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-runs/'.$checkRunId, $params); + } + + /** + * @link https://docs.github.com/en/rest/reference/checks#list-check-run-annotations + * + * @return array + */ + public function annotations(string $username, string $repository, int $checkRunId) + { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-runs/'.$checkRunId.'/annotations'); + } + + /** + * @link https://docs.github.com/en/rest/reference/checks#list-check-runs-in-a-check-suite + * + * @return array + */ + public function allForCheckSuite(string $username, string $repository, int $checkSuiteId, array $params = []) + { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites/'.$checkSuiteId.'/check-runs', $params); + } + + /** + * @link https://docs.github.com/en/rest/reference/checks#list-check-runs-for-a-git-reference + * + * @return array + */ + public function allForReference(string $username, string $repository, string $ref, array $params = []) + { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($ref).'/check-runs', $params); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Checks/CheckSuites.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Checks/CheckSuites.php new file mode 100644 index 00000000..40c83a56 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Checks/CheckSuites.php @@ -0,0 +1,74 @@ +acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites', $params); + } + + /** + * @link https://docs.github.com/en/rest/reference/checks#update-repository-preferences-for-check-suites + * + * @return array + */ + public function updatePreferences(string $username, string $repository, array $params = []) + { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites/preferences', $params); + } + + /** + * @link https://docs.github.com/en/rest/reference/checks#get-a-check-suite + * + * @return array + */ + public function getCheckSuite(string $username, string $repository, int $checkSuiteId) + { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites/'.$checkSuiteId); + } + + /** + * @link https://docs.github.com/en/rest/reference/checks#rerequest-a-check-suite + * + * @return array + */ + public function rerequest(string $username, string $repository, int $checkSuiteId) + { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites/'.$checkSuiteId.'/rerequest'); + } + + /** + * @link https://docs.github.com/en/rest/reference/checks#list-check-suites-for-a-git-reference + * + * @return array + */ + public function allForReference(string $username, string $repository, string $ref, array $params = []) + { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($ref).'/check-suites', $params); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Collaborators.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Collaborators.php new file mode 100644 index 00000000..5c61b9bf --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Collaborators.php @@ -0,0 +1,84 @@ + + */ +class Collaborators extends AbstractApi +{ + /** + * @link https://developer.github.com/v3/repos/collaborators/#list-collaborators + * + * @param string $username + * @param string $repository + * @param array $params + * + * @return array|string + */ + public function all($username, $repository, array $params = []) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators', $params); + } + + /** + * @link https://developer.github.com/v3/repos/collaborators/#check-if-a-user-is-a-collaborator + * + * @param string $username + * @param string $repository + * @param string $collaborator + * + * @return array|string + */ + public function check($username, $repository, $collaborator) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators/'.rawurlencode($collaborator)); + } + + /** + * @link https://developer.github.com/v3/repos/collaborators/#add-user-as-a-collaborator + * + * @param string $username + * @param string $repository + * @param string $collaborator + * @param array $params + * + * @return array|string + */ + public function add($username, $repository, $collaborator, array $params = []) + { + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators/'.rawurlencode($collaborator), $params); + } + + /** + * @link https://developer.github.com/v3/repos/collaborators/#remove-user-as-a-collaborator + * + * @param string $username + * @param string $repository + * @param string $collaborator + * + * @return array|string + */ + public function remove($username, $repository, $collaborator) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators/'.rawurlencode($collaborator)); + } + + /** + * @link https://developer.github.com/v3/repos/collaborators/#review-a-users-permission-level + * + * @param string $username + * @param string $repository + * @param string $collaborator + * + * @return array|string + */ + public function permission($username, $repository, $collaborator) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators/'.rawurlencode($collaborator).'/permission'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Comments.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Comments.php new file mode 100644 index 00000000..40eb2b53 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Comments.php @@ -0,0 +1,75 @@ + + * @author Tobias Nyholm + */ +class Comments extends AbstractApi +{ + use AcceptHeaderTrait; + + /** + * Configure the body type. + * + * @link https://developer.github.com/v3/repos/comments/#custom-media-types + * + * @param string|null $bodyType + * + * @return $this + */ + public function configure($bodyType = null) + { + if (!in_array($bodyType, ['raw', 'text', 'html'])) { + $bodyType = 'full'; + } + + $this->acceptHeaderValue = sprintf('application/vnd.github.%s.%s+json', $this->getApiVersion(), $bodyType); + + return $this; + } + + public function all($username, $repository, $sha = null) + { + if (null === $sha) { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments'); + } + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha).'/comments'); + } + + public function show($username, $repository, $comment) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments/'.rawurlencode($comment)); + } + + public function create($username, $repository, $sha, array $params) + { + if (!isset($params['body'])) { + throw new MissingArgumentException('body'); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha).'/comments', $params); + } + + public function update($username, $repository, $comment, array $params) + { + if (!isset($params['body'])) { + throw new MissingArgumentException('body'); + } + + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments/'.rawurlencode($comment), $params); + } + + public function remove($username, $repository, $comment) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments/'.rawurlencode($comment)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Commits.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Commits.php new file mode 100644 index 00000000..8195e4ba --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Commits.php @@ -0,0 +1,33 @@ + + */ +class Commits extends AbstractApi +{ + public function all($username, $repository, array $params) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits', $params); + } + + public function compare($username, $repository, $base, $head, $mediaType = null) + { + $headers = []; + if (null !== $mediaType) { + $headers['Accept'] = $mediaType; + } + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/compare/'.rawurlencode($base).'...'.rawurlencode($head), [], $headers); + } + + public function show($username, $repository, $sha) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Contents.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Contents.php new file mode 100644 index 00000000..bc78503b --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Contents.php @@ -0,0 +1,297 @@ + + */ +class Contents extends AbstractApi +{ + use AcceptHeaderTrait; + + /** + * Configure the body type. + * + * @link https://developer.github.com/v3/repo/contents/#custom-media-types + * + * @param string|null $bodyType + * + * @return $this + */ + public function configure($bodyType = null) + { + if (!in_array($bodyType, ['html', 'object'])) { + $bodyType = 'raw'; + } + + $this->acceptHeaderValue = sprintf('application/vnd.github.%s.%s', $this->getApiVersion(), $bodyType); + + return $this; + } + + /** + * Get content of README file in a repository. + * + * @link http://developer.github.com/v3/repos/contents/ + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * @param string|null $reference reference to a branch or commit + * + * @return array information for README file + */ + public function readme($username, $repository, $reference = null) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/readme', [ + 'ref' => $reference, + ]); + } + + /** + * Get contents of any file or directory in a repository. + * + * @link http://developer.github.com/v3/repos/contents/ + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * @param string|null $path path to file or directory + * @param string|null $reference reference to a branch or commit + * + * @return array|string information for file | information for each item in directory + */ + public function show($username, $repository, $path = null, $reference = null) + { + $url = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/contents'; + if (null !== $path) { + $url .= '/'.rawurlencode($path); + } + + return $this->get($url, [ + 'ref' => $reference, + ]); + } + + /** + * Creates a new file in a repository. + * + * @link http://developer.github.com/v3/repos/contents/#create-a-file + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * @param string $path path to file + * @param string $content contents of the new file + * @param string $message the commit message + * @param string|null $branch name of a branch + * @param null|array $committer information about the committer + * + * @throws MissingArgumentException + * + * @return array information about the new file + */ + public function create($username, $repository, $path, $content, $message, $branch = null, array $committer = null) + { + $url = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/contents/'.rawurlencode($path); + + $parameters = [ + 'content' => base64_encode($content), + 'message' => $message, + ]; + + if (null !== $branch) { + $parameters['branch'] = $branch; + } + + if (null !== $committer) { + if (!isset($committer['name'], $committer['email'])) { + throw new MissingArgumentException(['name', 'email']); + } + $parameters['committer'] = $committer; + } + + return $this->put($url, $parameters); + } + + /** + * Checks that a given path exists in a repository. + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * @param string $path path of file to check + * @param string|null $reference reference to a branch or commit + * + * @return bool + */ + public function exists($username, $repository, $path, $reference = null) + { + $url = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/contents'; + + if (null !== $path) { + $url .= '/'.rawurlencode($path); + } + + try { + $response = $this->head($url, [ + 'ref' => $reference, + ]); + + if ($response->getStatusCode() !== 200) { + return false; + } + } catch (TwoFactorAuthenticationRequiredException $ex) { + throw $ex; + } catch (\Exception $ex) { + return false; + } + + return true; + } + + /** + * Updates the contents of a file in a repository. + * + * @link http://developer.github.com/v3/repos/contents/#update-a-file + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * @param string $path path to file + * @param string $content contents of the new file + * @param string $message the commit message + * @param string $sha blob SHA of the file being replaced + * @param string|null $branch name of a branch + * @param null|array $committer information about the committer + * + * @throws MissingArgumentException + * + * @return array information about the updated file + */ + public function update($username, $repository, $path, $content, $message, $sha, $branch = null, array $committer = null) + { + $url = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/contents/'.rawurlencode($path); + + $parameters = [ + 'content' => base64_encode($content), + 'message' => $message, + 'sha' => $sha, + ]; + + if (null !== $branch) { + $parameters['branch'] = $branch; + } + + if (null !== $committer) { + if (!isset($committer['name'], $committer['email'])) { + throw new MissingArgumentException(['name', 'email']); + } + $parameters['committer'] = $committer; + } + + return $this->put($url, $parameters); + } + + /** + * Deletes a file from a repository. + * + * @link http://developer.github.com/v3/repos/contents/#delete-a-file + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * @param string $path path to file + * @param string $message the commit message + * @param string $sha blob SHA of the file being deleted + * @param string|null $branch name of a branch + * @param null|array $committer information about the committer + * + * @throws MissingArgumentException + * + * @return array information about the updated file + */ + public function rm($username, $repository, $path, $message, $sha, $branch = null, array $committer = null) + { + $url = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/contents/'.rawurlencode($path); + + $parameters = [ + 'message' => $message, + 'sha' => $sha, + ]; + + if (null !== $branch) { + $parameters['branch'] = $branch; + } + + if (null !== $committer) { + if (!isset($committer['name'], $committer['email'])) { + throw new MissingArgumentException(['name', 'email']); + } + $parameters['committer'] = $committer; + } + + return $this->delete($url, $parameters); + } + + /** + * Get content of archives in a repository. + * + * @link http://developer.github.com/v3/repos/contents/ + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * @param string $format format of archive: tarball or zipball + * @param string|null $reference reference to a branch or commit + * + * @return string repository archive binary data + */ + public function archive($username, $repository, $format, $reference = null) + { + if (!in_array($format, ['tarball', 'zipball'])) { + $format = 'tarball'; + } + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/'.rawurlencode($format). + ((null !== $reference) ? ('/'.rawurlencode($reference)) : '')); + } + + /** + * Get the contents of a file in a repository. + * + * @param string $username the user who owns the repository + * @param string $repository the name of the repository + * @param string $path path to file + * @param string|null $reference reference to a branch or commit + * + * @throws InvalidArgumentException If $path is not a file or if its encoding is different from base64 + * @throws ErrorException If $path doesn't include a 'content' index + * + * @return string|null content of file, or null in case of base64_decode failure + */ + public function download($username, $repository, $path, $reference = null) + { + $file = $this->show($username, $repository, $path, $reference); + + if (!isset($file['type']) || !in_array($file['type'], ['file', 'symlink'], true)) { + throw new InvalidArgumentException(sprintf('Path "%s" is not a file or a symlink to a file.', $path)); + } + + if (!isset($file['content'])) { + throw new ErrorException(sprintf('Unable to access "content" for file "%s" (possible keys: "%s").', $path, implode(', ', array_keys($file)))); + } + + if (!isset($file['encoding'])) { + throw new InvalidArgumentException(sprintf('Can\'t decode content of file "%s", as no encoding is defined.', $path)); + } + + if ('base64' !== $file['encoding']) { + throw new InvalidArgumentException(sprintf('Encoding "%s" of file "%s" is not supported.', $file['encoding'], $path)); + } + + return base64_decode($file['content']) ?: null; + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/DeployKeys.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/DeployKeys.php new file mode 100644 index 00000000..0e45ccb6 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/DeployKeys.php @@ -0,0 +1,49 @@ + + */ +class DeployKeys extends AbstractApi +{ + public function all($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/keys'); + } + + public function show($username, $repository, $id) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/keys/'.rawurlencode($id)); + } + + public function create($username, $repository, array $params) + { + if (!isset($params['title'], $params['key'])) { + throw new MissingArgumentException(['title', 'key']); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/keys', $params); + } + + public function update($username, $repository, $id, array $params) + { + if (!isset($params['title'], $params['key'])) { + throw new MissingArgumentException(['title', 'key']); + } + + $this->remove($username, $repository, $id); + + return $this->create($username, $repository, $params); + } + + public function remove($username, $repository, $id) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/keys/'.rawurlencode($id)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Downloads.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Downloads.php new file mode 100644 index 00000000..c959c615 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Downloads.php @@ -0,0 +1,60 @@ + + */ +class Downloads extends AbstractApi +{ + /** + * List downloads in selected repository. + * + * @link http://developer.github.com/v3/repos/downloads/#list-downloads-for-a-repository + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * + * @return array + */ + public function all($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/downloads'); + } + + /** + * Get a download in selected repository. + * + * @link http://developer.github.com/v3/repos/downloads/#get-a-single-download + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * @param int $id the id of the download file + * + * @return array + */ + public function show($username, $repository, $id) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/downloads/'.$id); + } + + /** + * Delete a download in selected repository. + * + * @link http://developer.github.com/v3/repos/downloads/#delete-a-download + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * @param int $id the id of the download file + * + * @return array + */ + public function remove($username, $repository, $id) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/downloads/'.$id); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Forks.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Forks.php new file mode 100644 index 00000000..961dc649 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Forks.php @@ -0,0 +1,27 @@ + + */ +class Forks extends AbstractApi +{ + public function all($username, $repository, array $params = []) + { + if (isset($params['sort']) && !in_array($params['sort'], ['newest', 'oldest', 'watchers'])) { + $params['sort'] = 'newest'; + } + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/forks', array_merge(['page' => 1], $params)); + } + + public function create($username, $repository, array $params = []) + { + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/forks', $params); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Hooks.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Hooks.php new file mode 100644 index 00000000..be87e014 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Hooks.php @@ -0,0 +1,57 @@ + + */ +class Hooks extends AbstractApi +{ + public function all($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks'); + } + + public function show($username, $repository, $id) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks/'.rawurlencode($id)); + } + + public function create($username, $repository, array $params) + { + if (!isset($params['name'], $params['config'])) { + throw new MissingArgumentException(['name', 'config']); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks', $params); + } + + public function update($username, $repository, $id, array $params) + { + if (!isset($params['config'])) { + throw new MissingArgumentException(['config']); + } + + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks/'.rawurlencode($id), $params); + } + + public function ping($username, $repository, $id) + { + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks/'.rawurlencode($id).'/pings'); + } + + public function test($username, $repository, $id) + { + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks/'.rawurlencode($id).'/tests'); + } + + public function remove($username, $repository, $id) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks/'.rawurlencode($id)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Labels.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Labels.php new file mode 100644 index 00000000..28ca4d53 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Labels.php @@ -0,0 +1,43 @@ + + */ +class Labels extends AbstractApi +{ + public function all($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels'); + } + + public function show($username, $repository, $label) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label)); + } + + public function create($username, $repository, array $params) + { + if (!isset($params['name'], $params['color'])) { + throw new MissingArgumentException(['name', 'color']); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels', $params); + } + + public function update($username, $repository, $label, array $params) + { + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label), $params); + } + + public function remove($username, $repository, $label) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Pages.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Pages.php new file mode 100644 index 00000000..b641cb95 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Pages.php @@ -0,0 +1,60 @@ + + */ +class Pages extends AbstractApi +{ + use AcceptHeaderTrait; + + public function show($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages'); + } + + public function enable($username, $repository, array $params = []) + { + $this->acceptHeaderValue = 'application/vnd.github.switcheroo-preview+json'; + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages', $params); + } + + public function disable($username, $repository) + { + $this->acceptHeaderValue = 'application/vnd.github.switcheroo-preview+json'; + + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages'); + } + + public function update($username, $repository, array $params = []) + { + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages', $params); + } + + public function requestBuild($username, $repository) + { + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages/builds'); + } + + public function builds($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages/builds'); + } + + public function showLatestBuild($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages/builds/latest'); + } + + public function showBuild($username, $repository, $id) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages/builds/'.rawurlencode($id)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Projects.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Projects.php new file mode 100644 index 00000000..9db29f55 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Projects.php @@ -0,0 +1,23 @@ +get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/projects', array_merge(['page' => 1], $params)); + } + + public function create($username, $repository, array $params) + { + if (!isset($params['name'])) { + throw new MissingArgumentException(['name']); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/projects', $params); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Protection.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Protection.php new file mode 100644 index 00000000..b559557a --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Protection.php @@ -0,0 +1,440 @@ + + */ +class Protection extends AbstractApi +{ + use AcceptHeaderTrait; + + /** + * Retrieves configured protection for the provided branch. + * + * @link https://developer.github.com/v3/repos/branches/#get-branch-protection + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * + * @return array The branch protection information + */ + public function show($username, $repository, $branch) + { + // Preview endpoint + $this->acceptHeaderValue = 'application/vnd.github.luke-cage-preview+json'; + + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection'); + } + + /** + * Updates the repo's branch protection. + * + * @link https://developer.github.com/v3/repos/branches/#update-branch-protection + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * @param array $params The branch protection information + * + * @return array The updated branch protection information + */ + public function update($username, $repository, $branch, array $params = []) + { + // Preview endpoint + $this->acceptHeaderValue = 'application/vnd.github.luke-cage-preview+json'; + + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection', $params); + } + + /** + * Remove the repo's branch protection. + * + * @link https://developer.github.com/v3/repos/branches/#remove-branch-protection + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + */ + public function remove($username, $repository, $branch) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection'); + } + + /** + * Get required status checks of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#get-required-status-checks-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * + * @return array The required status checks information + */ + public function showStatusChecks($username, $repository, $branch) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_status_checks'); + } + + /** + * Update required status checks of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#update-required-status-checks-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * @param array $params The branch status checks information + * + * @return array The updated branch status checks information + */ + public function updateStatusChecks($username, $repository, $branch, array $params = []) + { + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_status_checks', $params); + } + + /** + * Remove required status checks of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#remove-required-status-checks-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + */ + public function removeStatusChecks($username, $repository, $branch) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_status_checks'); + } + + /** + * List required status checks contexts of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#list-required-status-checks-contexts-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * + * @return array The required status checks contexts information + */ + public function showStatusChecksContexts($username, $repository, $branch) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_status_checks/contexts'); + } + + /** + * Replace required status checks contexts of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#replace-required-status-checks-contexts-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * @param array $params The branch status checks contexts information + * + * @return array The new branch status checks contexts information + */ + public function replaceStatusChecksContexts($username, $repository, $branch, array $params = []) + { + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_status_checks/contexts', $params); + } + + /** + * Add required status checks contexts of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#add-required-status-checks-contexts-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * @param array $params The branch status checks contexts information + * + * @return array The updated branch status checks contexts information + */ + public function addStatusChecksContexts($username, $repository, $branch, array $params = []) + { + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_status_checks/contexts', $params); + } + + /** + * Remove required status checks contexts of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#remove-required-status-checks-contexts-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * @param array $params The branch status checks contexts information + * + * @return array The updated branch status checks contexts information + */ + public function removeStatusChecksContexts($username, $repository, $branch, array $params = []) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_status_checks/contexts', $params); + } + + /** + * Get pull request review enforcement of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#get-pull-request-review-enforcement-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * + * @return array The pull request review enforcement information + */ + public function showPullRequestReviewEnforcement($username, $repository, $branch) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_pull_request_reviews'); + } + + /** + * Update pull request review enforcement of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#update-pull-request-review-enforcement-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * @param array $params The branch status checks information + * + * @return array The updated branch status checks information + */ + public function updatePullRequestReviewEnforcement($username, $repository, $branch, array $params = []) + { + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_pull_request_reviews', $params); + } + + /** + * Remove pull request review enforcement of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#remove-pull-request-review-enforcement-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + */ + public function removePullRequestReviewEnforcement($username, $repository, $branch) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_pull_request_reviews'); + } + + /** + * Get admin enforcement of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#get-admin-enforcement-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * + * @return array The admin enforcement information + */ + public function showAdminEnforcement($username, $repository, $branch) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/enforce_admins'); + } + + /** + * Add admin enforcement of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#add-admin-enforcement-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * + * @return array The updated admin enforcement information + */ + public function addAdminEnforcement($username, $repository, $branch) + { + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/enforce_admins'); + } + + /** + * Remove admin enforcement of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#remove-admin-enforcement-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + */ + public function removeAdminEnforcement($username, $repository, $branch) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/enforce_admins'); + } + + /** + * Get restrictions of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#get-restrictions-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * + * @return array The branch restrictions information + */ + public function showRestrictions($username, $repository, $branch) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions'); + } + + /** + * Remove restrictions of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#remove-restrictions-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + */ + public function removeRestrictions($username, $repository, $branch) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions'); + } + + /** + * List team restrictions of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#list-team-restrictions-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * + * @return array The branch team restrictions information + */ + public function showTeamRestrictions($username, $repository, $branch) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions/teams'); + } + + /** + * Replace team restrictions of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#replace-team-restrictions-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * @param array $params The list of team slugs with push access + * + * @return array The new branch team restrictions information + */ + public function replaceTeamRestrictions($username, $repository, $branch, array $params = []) + { + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions/teams', $params); + } + + /** + * Add team restrictions of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#add-team-restrictions-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * @param array $params The list of team slugs with push access + * + * @return array The branch team restrictions information + */ + public function addTeamRestrictions($username, $repository, $branch, array $params = []) + { + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions/teams', $params); + } + + /** + * Remove team restrictions of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#remove-team-restrictions-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * @param array $params The list of team slugs with push access + * + * @return array The updated branch team restrictions information + */ + public function removeTeamRestrictions($username, $repository, $branch, array $params = []) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions/teams', $params); + } + + /** + * List user restrictions of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#list-user-restrictions-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * + * @return array The branch user restrictions information + */ + public function showUserRestrictions($username, $repository, $branch) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions/users'); + } + + /** + * Replace user restrictions of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#replace-user-restrictions-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * @param array $params The list of user logins with push access + * + * @return array The new branch user restrictions information + */ + public function replaceUserRestrictions($username, $repository, $branch, array $params = []) + { + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions/users', $params); + } + + /** + * Add user restrictions of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#add-user-restrictions-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * @param array $params The list of user logins with push access + * + * @return array The branch user restrictions information + */ + public function addUserRestrictions($username, $repository, $branch, array $params = []) + { + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions/users', $params); + } + + /** + * Remove user restrictions of protected branch. + * + * @link https://developer.github.com/v3/repos/branches/#remove-user-restrictions-of-protected-branch + * + * @param string $username The user who owns the repository + * @param string $repository The name of the repo + * @param string $branch The name of the branch + * @param array $params The list of user logins with push access + * + * @return array The updated branch user restrictions information + */ + public function removeUserRestrictions($username, $repository, $branch, array $params = []) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions/users', $params); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Releases.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Releases.php new file mode 100644 index 00000000..10dfe09d --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Releases.php @@ -0,0 +1,127 @@ + + * @author Evgeniy Guseletov + */ +class Releases extends AbstractApi +{ + /** + * Get the latest release. + * + * @param string $username + * @param string $repository + * + * @return array + */ + public function latest($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/latest'); + } + + /** + * List releases for a tag. + * + * @param string $username + * @param string $repository + * @param string $tag + * + * @return array + */ + public function tag($username, $repository, $tag) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/tags/'.rawurlencode($tag)); + } + + /** + * List releases in selected repository. + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * @param array $params the additional parameters like milestone, assignees, labels, sort, direction + * + * @return array + */ + public function all($username, $repository, array $params = []) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases', $params); + } + + /** + * Get a release in selected repository. + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * @param int $id the id of the release + * + * @return array + */ + public function show($username, $repository, $id) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.$id); + } + + /** + * Create new release in selected repository. + * + * @param string $username + * @param string $repository + * @param array $params + * + * @throws MissingArgumentException + * + * @return array + */ + public function create($username, $repository, array $params) + { + if (!isset($params['tag_name'])) { + throw new MissingArgumentException('tag_name'); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases', $params); + } + + /** + * Edit release in selected repository. + * + * @param string $username + * @param string $repository + * @param int $id + * @param array $params + * + * @return array + */ + public function edit($username, $repository, $id, array $params) + { + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.$id, $params); + } + + /** + * Delete a release in selected repository (Not thoroughly tested!). + * + * @param string $username the user who owns the repo + * @param string $repository the name of the repo + * @param int $id the id of the release + * + * @return array + */ + public function remove($username, $repository, $id) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.$id); + } + + /** + * @return Assets + */ + public function assets() + { + return new Assets($this->getClient()); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Stargazers.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Stargazers.php new file mode 100644 index 00000000..bef73b9a --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Stargazers.php @@ -0,0 +1,40 @@ + + * @author Tobias Nyholm + */ +class Stargazers extends AbstractApi +{ + use AcceptHeaderTrait; + + /** + * Configure the body type. + * + * @see https://developer.github.com/v3/activity/starring/#alternative-response-with-star-creation-timestamps + * + * @param string $bodyType + * + * @return $this + */ + public function configure($bodyType = null) + { + if ('star' === $bodyType) { + $this->acceptHeaderValue = sprintf('application/vnd.github.%s.star+json', $this->getApiVersion()); + } + + return $this; + } + + public function all($username, $repository) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stargazers'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Statuses.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Statuses.php new file mode 100644 index 00000000..c62f4edd --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Statuses.php @@ -0,0 +1,63 @@ + + */ +class Statuses extends AbstractApi +{ + /** + * @link http://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-sha + * + * @param string $username + * @param string $repository + * @param string $sha + * + * @return array + */ + public function show($username, $repository, $sha) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha).'/statuses'); + } + + /** + * @link https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref + * + * @param string $username + * @param string $repository + * @param string $sha + * + * @return array + */ + public function combined($username, $repository, $sha) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha).'/status'); + } + + /** + * @link http://developer.github.com/v3/repos/statuses/#create-a-status + * + * @param string $username + * @param string $repository + * @param string $sha + * @param array $params + * + * @throws MissingArgumentException + * + * @return array + */ + public function create($username, $repository, $sha, array $params = []) + { + if (!isset($params['state'])) { + throw new MissingArgumentException('state'); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/statuses/'.rawurlencode($sha), $params); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Traffic.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Traffic.php new file mode 100644 index 00000000..d5b550c8 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Repository/Traffic.php @@ -0,0 +1,67 @@ + + */ +class Traffic extends AbstractApi +{ + /** + * @link https://developer.github.com/v3/repos/traffic/#list-referrers + * + * @param string $owner + * @param string $repository + * + * @return array + */ + public function referers($owner, $repository) + { + return $this->get('/repos/'.rawurlencode($owner).'/'.rawurlencode($repository).'/traffic/popular/referrers'); + } + + /** + * @link https://developer.github.com/v3/repos/traffic/#list-paths + * + * @param string $owner + * @param string $repository + * + * @return array + */ + public function paths($owner, $repository) + { + return $this->get('/repos/'.rawurlencode($owner).'/'.rawurlencode($repository).'/traffic/popular/paths'); + } + + /** + * @link https://developer.github.com/v3/repos/traffic/#views + * + * @param string $owner + * @param string $repository + * @param string $per + * + * @return array + */ + public function views($owner, $repository, $per = 'day') + { + return $this->get('/repos/'.rawurlencode($owner).'/'.rawurlencode($repository).'/traffic/views?per='.rawurlencode($per)); + } + + /** + * @link https://developer.github.com/v3/repos/traffic/#clones + * + * @param string $owner + * @param string $repository + * @param string $per + * + * @return array + */ + public function clones($owner, $repository, $per = 'day') + { + return $this->get('/repos/'.rawurlencode($owner).'/'.rawurlencode($repository).'/traffic/clones?per='.rawurlencode($per)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Search.php b/vendor/knplabs/github-api/lib/Github/Api/Search.php new file mode 100644 index 00000000..96a51ea6 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/Search.php @@ -0,0 +1,130 @@ + + */ +class Search extends AbstractApi +{ + use AcceptHeaderTrait; + + /** + * Search repositories by filter (q). + * + * @link https://developer.github.com/v3/search/#search-repositories + * + * @param string $q the filter + * @param string $sort the sort field + * @param string $order asc/desc + * + * @return array list of repositories found + */ + public function repositories($q, $sort = 'updated', $order = 'desc') + { + return $this->get('/search/repositories', ['q' => $q, 'sort' => $sort, 'order' => $order]); + } + + /** + * Search issues by filter (q). + * + * @link https://developer.github.com/v3/search/#search-issues + * + * @param string $q the filter + * @param string $sort the sort field + * @param string $order asc/desc + * + * @return array list of issues found + */ + public function issues($q, $sort = 'updated', $order = 'desc') + { + return $this->get('/search/issues', ['q' => $q, 'sort' => $sort, 'order' => $order]); + } + + /** + * Search code by filter (q). + * + * @link https://developer.github.com/v3/search/#search-code + * + * @param string $q the filter + * @param string $sort the sort field + * @param string $order asc/desc + * + * @return array list of code found + */ + public function code($q, $sort = 'updated', $order = 'desc') + { + return $this->get('/search/code', ['q' => $q, 'sort' => $sort, 'order' => $order]); + } + + /** + * Search code by filter (q), but will return additional data to highlight + * the matched results. + * + * @link https://docs.github.com/en/rest/reference/search#text-match-metadata + * + * @return array list of code found + */ + public function codeWithMatch(string $q, string $sort = 'updated', string $order = 'desc'): array + { + $this->acceptHeaderValue = 'application/vnd.github.v3.text-match+json'; + + return $this->code($q, $sort, $order); + } + + /** + * Search users by filter (q). + * + * @link https://developer.github.com/v3/search/#search-users + * + * @param string $q the filter + * @param string $sort the sort field + * @param string $order asc/desc + * + * @return array list of users found + */ + public function users($q, $sort = 'updated', $order = 'desc') + { + return $this->get('/search/users', ['q' => $q, 'sort' => $sort, 'order' => $order]); + } + + /** + * Search commits by filter (q). + * + * @link https://developer.github.com/v3/search/#search-commits + * + * @param string $q the filter + * @param string $sort the sort field + * @param string $order sort order. asc/desc + * + * @return array + */ + public function commits($q, $sort = null, $order = 'desc') + { + // This api is in preview mode, so set the correct accept-header + $this->acceptHeaderValue = 'application/vnd.github.cloak-preview'; + + return $this->get('/search/commits', ['q' => $q, 'sort' => $sort, 'order' => $order]); + } + + /** + * Search topics by filter (q). + * + * @link https://developer.github.com/v3/search/#search-topics + * + * @param string $q the filter + * + * @return array + */ + public function topics($q) + { + // This api is in preview mode, so set the correct accept-header + $this->acceptHeaderValue = 'application/vnd.github.mercy-preview+json'; + + return $this->get('/search/topics', ['q' => $q]); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Api/User.php b/vendor/knplabs/github-api/lib/Github/Api/User.php new file mode 100644 index 00000000..c1ccc89e --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Api/User.php @@ -0,0 +1,249 @@ + + * @author Thibault Duplessis + */ +class User extends AbstractApi +{ + /** + * Request all users. + * + * @link https://developer.github.com/v3/users/#get-all-users + * + * @param int|null $id ID of the last user that you've seen + * + * @return array list of users found + */ + public function all($id = null) + { + if (!is_int($id)) { + return $this->get('/users'); + } + + return $this->get('/users', ['since' => $id]); + } + + /** + * Get extended information about a user by its username. + * + * @link http://developer.github.com/v3/users/ + * + * @param string $username the username to show + * + * @return array information about the user + */ + public function show($username) + { + return $this->get('/users/'.rawurlencode($username)); + } + + /** + * Get extended information about a user by its id. + * Note: at time of writing this is an undocumented feature but GitHub support have advised that it can be relied on. + * + * @link http://developer.github.com/v3/users/ + * + * @param int $id the id of the user to show + * + * @return array information about the user + */ + public function showById($id) + { + return $this->get('/user/'.$id); + } + + /** + * Get extended information about a user by its username. + * + * @link https://developer.github.com/v3/orgs/ + * + * @param string $username the username to show + * + * @return array information about organizations that user belongs to + */ + public function organizations($username) + { + return $this->get('/users/'.rawurlencode($username).'/orgs'); + } + + /** + * Get user organizations. + * + * @link https://developer.github.com/v3/orgs/#list-your-organizations + * + * @return array information about organizations that authenticated user belongs to + */ + public function orgs() + { + return $this->get('/user/orgs'); + } + + /** + * Request the users that a specific user is following. + * + * @link http://developer.github.com/v3/users/followers/ + * + * @param string $username the username + * @param array $parameters parameters for the query string + * @param array $requestHeaders additional headers to set in the request + * + * @return array list of followed users + */ + public function following($username, array $parameters = [], array $requestHeaders = []) + { + return $this->get('/users/'.rawurlencode($username).'/following', $parameters, $requestHeaders); + } + + /** + * Request the users following a specific user. + * + * @link http://developer.github.com/v3/users/followers/ + * + * @param string $username the username + * @param array $parameters parameters for the query string + * @param array $requestHeaders additional headers to set in the request + * + * @return array list of following users + */ + public function followers($username, array $parameters = [], array $requestHeaders = []) + { + return $this->get('/users/'.rawurlencode($username).'/followers', $parameters, $requestHeaders); + } + + /** + * Request starred repositories that a specific user has starred. + * + * @link http://developer.github.com/v3/activity/starring/ + * + * @param string $username the username + * @param int $page the page number of the paginated result set + * @param int $perPage the number of results per page + * @param string $sort sort by (possible values: created, updated) + * @param string $direction direction of sort (possible values: asc, desc) + * + * @return array list of starred repositories + */ + public function starred($username, $page = 1, $perPage = 30, $sort = 'created', $direction = 'desc') + { + return $this->get('/users/'.rawurlencode($username).'/starred', [ + 'page' => $page, + 'per_page' => $perPage, + 'sort' => $sort, + 'direction' => $direction, + ]); + } + + /** + * Request the repository that a specific user is watching. + * + * @link http://developer.github.com/v3/activity/watching/ + * + * @param string $username the username + * + * @return array list of watched repositories + */ + public function subscriptions($username) + { + return $this->get('/users/'.rawurlencode($username).'/subscriptions'); + } + + /** + * List public repositories for the specified user. + * + * @link https://developer.github.com/v3/repos/#list-user-repositories + * + * @param string $username the username + * @param string $type role in the repository + * @param string $sort sort by + * @param string $direction direction of sort, asc or desc + * @param string $visibility visibility of repository + * @param string $affiliation relationship to repository + * + * @return array list of the user repositories + */ + public function repositories($username, $type = 'owner', $sort = 'full_name', $direction = 'asc', $visibility = 'all', $affiliation = 'owner,collaborator,organization_member') + { + return $this->get('/users/'.rawurlencode($username).'/repos', [ + 'type' => $type, + 'sort' => $sort, + 'direction' => $direction, + 'visibility' => $visibility, + 'affiliation' => $affiliation, + ]); + } + + /** + * List repositories that are accessible to the authenticated user. + * + * @link https://developer.github.com/v3/repos/#list-your-repositories + * + * @param array $params visibility, affiliation, type, sort, direction + * + * @return array list of the user repositories + */ + public function myRepositories(array $params = []) + { + return $this->get('/user/repos', $params); + } + + /** + * Get the public gists for a user. + * + * @link http://developer.github.com/v3/gists/ + * + * @param string $username the username + * + * @return array list of the user gists + */ + public function gists($username) + { + return $this->get('/users/'.rawurlencode($username).'/gists'); + } + + /** + * Get the public keys for a user. + * + * @link http://developer.github.com/v3/users/keys/#list-public-keys-for-a-user + * + * @param string $username the username + * + * @return array list of the user public keys + */ + public function keys($username) + { + return $this->get('/users/'.rawurlencode($username).'/keys'); + } + + /** + * List events performed by a user. + * + * @link http://developer.github.com/v3/activity/events/#list-public-events-performed-by-a-user + * + * @param string $username + * + * @return array + */ + public function publicEvents($username) + { + return $this->get('/users/'.rawurlencode($username).'/events/public'); + } + + /** + * List events performed by an authenticated user. + * + * @link https://docs.github.com/en/rest/reference/activity#list-events-for-the-authenticated-user + * + * @return array + */ + public function events(string $username) + { + return $this->get('/users/'.rawurlencode($username).'/events'); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/AuthMethod.php b/vendor/knplabs/github-api/lib/Github/AuthMethod.php new file mode 100644 index 00000000..4a390699 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/AuthMethod.php @@ -0,0 +1,30 @@ + + * + * Website: http://github.com/KnpLabs/php-github-api + */ +class Client +{ + /** + * Authenticate using a client_id/client_secret combination. + * + * @var string + * + * @deprecated Use the AuthMethod const + */ + const AUTH_CLIENT_ID = AuthMethod::CLIENT_ID; + + /** + * Authenticate using a GitHub access token. + * + * @var string + * + * @deprecated Use the AuthMethod const + */ + const AUTH_ACCESS_TOKEN = AuthMethod::ACCESS_TOKEN; + + /** + * Constant for authentication method. + * + * Indicates JSON Web Token authentication required for GitHub apps access + * to the API. + * + * @var string + * + * @deprecated Use the AuthMethod const + */ + const AUTH_JWT = AuthMethod::JWT; + + /** + * @var string + */ + private $apiVersion; + + /** + * @var Builder + */ + private $httpClientBuilder; + + /** + * @var History + */ + private $responseHistory; + + /** + * Instantiate a new GitHub client. + * + * @param Builder|null $httpClientBuilder + * @param string|null $apiVersion + * @param string|null $enterpriseUrl + */ + public function __construct(Builder $httpClientBuilder = null, $apiVersion = null, $enterpriseUrl = null) + { + $this->responseHistory = new History(); + $this->httpClientBuilder = $builder = $httpClientBuilder ?? new Builder(); + $this->apiVersion = $apiVersion ?: 'v3'; + + $builder->addPlugin(new GithubExceptionThrower()); + $builder->addPlugin(new Plugin\HistoryPlugin($this->responseHistory)); + $builder->addPlugin(new Plugin\RedirectPlugin()); + $builder->addPlugin(new Plugin\AddHostPlugin(Psr17FactoryDiscovery::findUriFactory()->createUri('https://api.github.com'))); + $builder->addPlugin(new Plugin\HeaderDefaultsPlugin([ + 'User-Agent' => 'php-github-api (http://github.com/KnpLabs/php-github-api)', + 'Accept' => sprintf('application/vnd.github.%s+json', $this->apiVersion), + ])); + + if ($enterpriseUrl) { + $this->setEnterpriseUrl($enterpriseUrl); + } + } + + /** + * Create a Github\Client using a HTTP client. + * + * @param ClientInterface $httpClient + * + * @return Client + */ + public static function createWithHttpClient(ClientInterface $httpClient): self + { + $builder = new Builder($httpClient); + + return new self($builder); + } + + /** + * @param string $name + * + * @throws InvalidArgumentException + * + * @return AbstractApi + */ + public function api($name): AbstractApi + { + switch ($name) { + case 'me': + case 'current_user': + case 'currentUser': + $api = new Api\CurrentUser($this); + break; + case 'codeOfConduct': + $api = new Api\Miscellaneous\CodeOfConduct($this); + break; + + case 'deployment': + case 'deployments': + $api = new Api\Deployment($this); + break; + + case 'ent': + case 'enterprise': + $api = new Api\Enterprise($this); + break; + + case 'emojis': + $api = new Api\Miscellaneous\Emojis($this); + break; + + case 'git': + case 'git_data': + case 'gitData': + $api = new Api\GitData($this); + break; + + case 'gist': + case 'gists': + $api = new Api\Gists($this); + break; + + case 'gitignore': + $api = new Api\Miscellaneous\Gitignore($this); + break; + + case 'apps': + $api = new Api\Apps($this); + break; + + case 'issue': + case 'issues': + $api = new Api\Issue($this); + break; + + case 'markdown': + $api = new Api\Markdown($this); + break; + + case 'licenses': + $api = new Api\Miscellaneous\Licenses($this); + break; + + case 'notification': + case 'notifications': + $api = new Api\Notification($this); + break; + + case 'organization': + case 'organizations': + $api = new Api\Organization($this); + break; + + case 'org_project': + case 'orgProject': + case 'org_projects': + case 'orgProjects': + case 'organization_project': + case 'organizationProject': + case 'organization_projects': + case 'organizationProjects': + $api = new Api\Organization\Projects($this); + break; + + case 'pr': + case 'pulls': + case 'pullRequest': + case 'pull_request': + case 'pullRequests': + case 'pull_requests': + $api = new Api\PullRequest($this); + break; + + case 'rateLimit': + case 'rate_limit': + $api = new Api\RateLimit($this); + break; + + case 'repo': + case 'repos': + case 'repository': + case 'repositories': + $api = new Api\Repo($this); + break; + + case 'search': + $api = new Api\Search($this); + break; + + case 'team': + case 'teams': + $api = new Api\Organization\Teams($this); + break; + + case 'member': + case 'members': + $api = new Api\Organization\Members($this); + break; + + case 'user': + case 'users': + $api = new Api\User($this); + break; + + case 'authorization': + case 'authorizations': + $api = new Api\Authorizations($this); + break; + + case 'meta': + $api = new Api\Meta($this); + break; + + case 'graphql': + $api = new Api\GraphQL($this); + break; + + case 'outsideCollaborators': + case 'outside_collaborators': + $api = new Api\Organization\OutsideCollaborators($this); + break; + + default: + throw new InvalidArgumentException(sprintf('Undefined api instance called: "%s"', $name)); + } + + return $api; + } + + /** + * Authenticate a user for all next requests. + * + * @param string $tokenOrLogin GitHub private token/username/client ID + * @param string|null $password GitHub password/secret (optionally can contain $authMethod) + * @param string|null $authMethod One of the AUTH_* class constants + * + * @throws InvalidArgumentException If no authentication method was given + * + * @return void + */ + public function authenticate($tokenOrLogin, $password = null, $authMethod = null): void + { + if (null === $authMethod && (AuthMethod::JWT === $password || AuthMethod::ACCESS_TOKEN === $password)) { + $authMethod = $password; + $password = null; + } + + if (null === $authMethod) { + throw new InvalidArgumentException('You need to specify authentication method!'); + } + + $this->getHttpClientBuilder()->removePlugin(Authentication::class); + $this->getHttpClientBuilder()->addPlugin(new Authentication($tokenOrLogin, $password, $authMethod)); + } + + /** + * Sets the URL of your GitHub Enterprise instance. + * + * @param string $enterpriseUrl URL of the API in the form of http(s)://hostname + * + * @return void + */ + private function setEnterpriseUrl($enterpriseUrl): void + { + $builder = $this->getHttpClientBuilder(); + $builder->removePlugin(Plugin\AddHostPlugin::class); + $builder->removePlugin(PathPrepend::class); + + $builder->addPlugin(new Plugin\AddHostPlugin(Psr17FactoryDiscovery::findUriFactory()->createUri($enterpriseUrl))); + $builder->addPlugin(new PathPrepend(sprintf('/api/%s', $this->getApiVersion()))); + } + + /** + * @return string + */ + public function getApiVersion(): string + { + return $this->apiVersion; + } + + /** + * Add a cache plugin to cache responses locally. + * + * @param CacheItemPoolInterface $cachePool + * @param array $config + * + * @return void + */ + public function addCache(CacheItemPoolInterface $cachePool, array $config = []): void + { + $this->getHttpClientBuilder()->addCache($cachePool, $config); + } + + /** + * Remove the cache plugin. + * + * @return void + */ + public function removeCache(): void + { + $this->getHttpClientBuilder()->removeCache(); + } + + /** + * @param string $name + * @param array $args + * + * @return AbstractApi + */ + public function __call($name, $args): AbstractApi + { + try { + return $this->api($name); + } catch (InvalidArgumentException $e) { + throw new BadMethodCallException(sprintf('Undefined method called: "%s"', $name)); + } + } + + /** + * @return null|\Psr\Http\Message\ResponseInterface + */ + public function getLastResponse(): ?ResponseInterface + { + return $this->responseHistory->getLastResponse(); + } + + /** + * @return HttpMethodsClientInterface + */ + public function getHttpClient(): HttpMethodsClientInterface + { + return $this->getHttpClientBuilder()->getHttpClient(); + } + + /** + * @return Builder + */ + protected function getHttpClientBuilder(): Builder + { + return $this->httpClientBuilder; + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Exception/ApiLimitExceedException.php b/vendor/knplabs/github-api/lib/Github/Exception/ApiLimitExceedException.php new file mode 100644 index 00000000..5c1dd4d8 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Exception/ApiLimitExceedException.php @@ -0,0 +1,46 @@ + + */ +class ApiLimitExceedException extends RuntimeException +{ + /** @var int */ + private $limit; + /** @var int */ + private $reset; + + /** + * @param int $limit + * @param int $reset + * @param int $code + * @param Throwable|null $previous + */ + public function __construct(int $limit = 5000, int $reset = 1800, int $code = 0, Throwable $previous = null) + { + $this->limit = (int) $limit; + $this->reset = (int) $reset; + + parent::__construct(sprintf('You have reached GitHub hourly limit! Actual limit is: %d', $limit), $code, $previous); + } + + /** + * @return int + */ + public function getLimit(): int + { + return $this->limit; + } + + /** + * @return int + */ + public function getResetTime(): int + { + return $this->reset; + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Exception/BadMethodCallException.php b/vendor/knplabs/github-api/lib/Github/Exception/BadMethodCallException.php new file mode 100644 index 00000000..22753d08 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Exception/BadMethodCallException.php @@ -0,0 +1,10 @@ + + */ +class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface +{ +} diff --git a/vendor/knplabs/github-api/lib/Github/Exception/ErrorException.php b/vendor/knplabs/github-api/lib/Github/Exception/ErrorException.php new file mode 100644 index 00000000..b569f730 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Exception/ErrorException.php @@ -0,0 +1,10 @@ + + */ +class ErrorException extends \ErrorException implements ExceptionInterface +{ +} diff --git a/vendor/knplabs/github-api/lib/Github/Exception/ExceptionInterface.php b/vendor/knplabs/github-api/lib/Github/Exception/ExceptionInterface.php new file mode 100644 index 00000000..87e6d2f7 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Exception/ExceptionInterface.php @@ -0,0 +1,9 @@ + + */ +class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface +{ +} diff --git a/vendor/knplabs/github-api/lib/Github/Exception/MissingArgumentException.php b/vendor/knplabs/github-api/lib/Github/Exception/MissingArgumentException.php new file mode 100644 index 00000000..4cd3aeca --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Exception/MissingArgumentException.php @@ -0,0 +1,25 @@ + + */ +class MissingArgumentException extends ErrorException +{ + /** + * @param string|array $required + * @param int $code + * @param Throwable|null $previous + */ + public function __construct($required, int $code = 0, Throwable $previous = null) + { + if (is_string($required)) { + $required = [$required]; + } + + parent::__construct(sprintf('One or more of required ("%s") parameters is missing!', implode('", "', $required)), $code, 1, __FILE__, __LINE__, $previous); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Exception/RuntimeException.php b/vendor/knplabs/github-api/lib/Github/Exception/RuntimeException.php new file mode 100644 index 00000000..827632e9 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Exception/RuntimeException.php @@ -0,0 +1,10 @@ + + */ +class RuntimeException extends \RuntimeException implements ExceptionInterface +{ +} diff --git a/vendor/knplabs/github-api/lib/Github/Exception/SsoRequiredException.php b/vendor/knplabs/github-api/lib/Github/Exception/SsoRequiredException.php new file mode 100644 index 00000000..1725270a --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Exception/SsoRequiredException.php @@ -0,0 +1,31 @@ +url = $url; + + parent::__construct('Resource protected by organization SAML enforcement. You must grant your personal token access to this organization.', $code, $previous); + } + + /** + * @return string + */ + public function getUrl() + { + return $this->url; + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Exception/TwoFactorAuthenticationRequiredException.php b/vendor/knplabs/github-api/lib/Github/Exception/TwoFactorAuthenticationRequiredException.php new file mode 100644 index 00000000..c57e67b8 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Exception/TwoFactorAuthenticationRequiredException.php @@ -0,0 +1,30 @@ +type = $type; + parent::__construct('Two factor authentication is enabled on this account', $code, $previous); + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } +} diff --git a/vendor/knplabs/github-api/lib/Github/Exception/ValidationFailedException.php b/vendor/knplabs/github-api/lib/Github/Exception/ValidationFailedException.php new file mode 100644 index 00000000..c689e2d6 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/Exception/ValidationFailedException.php @@ -0,0 +1,12 @@ + + */ +class ValidationFailedException extends ErrorException +{ +} diff --git a/vendor/knplabs/github-api/lib/Github/HttpClient/Builder.php b/vendor/knplabs/github-api/lib/Github/HttpClient/Builder.php new file mode 100644 index 00000000..a8713de1 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/HttpClient/Builder.php @@ -0,0 +1,214 @@ + + */ +class Builder +{ + /** + * The object that sends HTTP messages. + * + * @var ClientInterface + */ + private $httpClient; + + /** + * A HTTP client with all our plugins. + * + * @var HttpMethodsClientInterface + */ + private $pluginClient; + + /** + * @var RequestFactoryInterface + */ + private $requestFactory; + + /** + * @var StreamFactoryInterface + */ + private $streamFactory; + + /** + * True if we should create a new Plugin client at next request. + * + * @var bool + */ + private $httpClientModified = true; + + /** + * @var Plugin[] + */ + private $plugins = []; + + /** + * This plugin is special treated because it has to be the very last plugin. + * + * @var Plugin\CachePlugin|null + */ + private $cachePlugin; + + /** + * Http headers. + * + * @var array + */ + private $headers = []; + + /** + * @param ClientInterface|null $httpClient + * @param RequestFactoryInterface|null $requestFactory + * @param StreamFactoryInterface|null $streamFactory + */ + public function __construct( + ClientInterface $httpClient = null, + RequestFactoryInterface $requestFactory = null, + StreamFactoryInterface $streamFactory = null + ) { + $this->httpClient = $httpClient ?? Psr18ClientDiscovery::find(); + $this->requestFactory = $requestFactory ?? Psr17FactoryDiscovery::findRequestFactory(); + $this->streamFactory = $streamFactory ?? Psr17FactoryDiscovery::findStreamFactory(); + } + + /** + * @return HttpMethodsClientInterface + */ + public function getHttpClient(): HttpMethodsClientInterface + { + if ($this->httpClientModified) { + $this->httpClientModified = false; + + $plugins = $this->plugins; + if ($this->cachePlugin) { + $plugins[] = $this->cachePlugin; + } + + $this->pluginClient = new HttpMethodsClient( + (new PluginClientFactory())->createClient($this->httpClient, $plugins), + $this->requestFactory, + $this->streamFactory + ); + } + + return $this->pluginClient; + } + + /** + * Add a new plugin to the end of the plugin chain. + * + * @param Plugin $plugin + * + * @return void + */ + public function addPlugin(Plugin $plugin): void + { + $this->plugins[] = $plugin; + $this->httpClientModified = true; + } + + /** + * Remove a plugin by its fully qualified class name (FQCN). + * + * @param string $fqcn + * + * @return void + */ + public function removePlugin(string $fqcn): void + { + foreach ($this->plugins as $idx => $plugin) { + if ($plugin instanceof $fqcn) { + unset($this->plugins[$idx]); + $this->httpClientModified = true; + } + } + } + + /** + * Clears used headers. + * + * @return void + */ + public function clearHeaders(): void + { + $this->headers = []; + + $this->removePlugin(Plugin\HeaderAppendPlugin::class); + $this->addPlugin(new Plugin\HeaderAppendPlugin($this->headers)); + } + + /** + * @param array $headers + * + * @return void + */ + public function addHeaders(array $headers): void + { + $this->headers = array_merge($this->headers, $headers); + + $this->removePlugin(Plugin\HeaderAppendPlugin::class); + $this->addPlugin(new Plugin\HeaderAppendPlugin($this->headers)); + } + + /** + * @param string $header + * @param string $headerValue + * + * @return void + */ + public function addHeaderValue(string $header, string $headerValue): void + { + if (!isset($this->headers[$header])) { + $this->headers[$header] = $headerValue; + } else { + $this->headers[$header] = array_merge((array) $this->headers[$header], [$headerValue]); + } + + $this->removePlugin(Plugin\HeaderAppendPlugin::class); + $this->addPlugin(new Plugin\HeaderAppendPlugin($this->headers)); + } + + /** + * Add a cache plugin to cache responses locally. + * + * @param CacheItemPoolInterface $cachePool + * @param array $config + * + * @return void + */ + public function addCache(CacheItemPoolInterface $cachePool, array $config = []): void + { + if (!isset($config['cache_key_generator'])) { + $config['cache_key_generator'] = new HeaderCacheKeyGenerator(['Authorization', 'Cookie', 'Accept', 'Content-type']); + } + $this->cachePlugin = Plugin\CachePlugin::clientCache($cachePool, $this->streamFactory, $config); + $this->httpClientModified = true; + } + + /** + * Remove the cache plugin. + * + * @return void + */ + public function removeCache(): void + { + $this->cachePlugin = null; + $this->httpClientModified = true; + } +} diff --git a/vendor/knplabs/github-api/lib/Github/HttpClient/Message/ResponseMediator.php b/vendor/knplabs/github-api/lib/Github/HttpClient/Message/ResponseMediator.php new file mode 100644 index 00000000..a72ccef7 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/HttpClient/Message/ResponseMediator.php @@ -0,0 +1,90 @@ +getBody()->__toString(); + if (strpos($response->getHeaderLine('Content-Type'), 'application/json') === 0) { + $content = json_decode($body, true); + if (JSON_ERROR_NONE === json_last_error()) { + return $content; + } + } + + return $body; + } + + /** + * @param ResponseInterface $response + * + * @return array + */ + public static function getPagination(ResponseInterface $response): array + { + $header = self::getHeader($response, 'Link'); + + if (null === $header) { + return []; + } + + $pagination = []; + foreach (explode(',', $header) as $link) { + preg_match('/<(.*)>; rel="(.*)"/i', trim($link, ','), $match); + + /** @var string[] $match */ + if (3 === count($match)) { + $pagination[$match[2]] = $match[1]; + } + } + + return $pagination; + } + + /** + * @param ResponseInterface $response + * + * @return string|null + */ + public static function getApiLimit(ResponseInterface $response): ?string + { + $remainingCallsHeader = self::getHeader($response, 'X-RateLimit-Remaining'); + + if (null === $remainingCallsHeader) { + return null; + } + + $remainingCalls = (int) $remainingCallsHeader; + + if (1 > $remainingCalls) { + throw new ApiLimitExceedException($remainingCalls); + } + + return $remainingCallsHeader; + } + + /** + * Get the value for a single header. + * + * @param ResponseInterface $response + * @param string $name + * + * @return string|null + */ + public static function getHeader(ResponseInterface $response, string $name): ?string + { + $headers = $response->getHeader($name); + + return array_shift($headers); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/Authentication.php b/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/Authentication.php new file mode 100644 index 00000000..91ed9caa --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/Authentication.php @@ -0,0 +1,71 @@ + + */ +final class Authentication implements Plugin +{ + /** + * @var string + */ + private $tokenOrLogin; + + /** + * @var string|null + */ + private $password; + + /** + * @var string|null + */ + private $method; + + /** + * @param string $tokenOrLogin GitHub private token/username/client ID + * @param string|null $password GitHub password/secret (optionally can contain $method) + * @param string|null $method One of the AUTH_* class constants + */ + public function __construct(string $tokenOrLogin, ?string $password, ?string $method) + { + $this->tokenOrLogin = $tokenOrLogin; + $this->password = $password; + $this->method = $method; + } + + /** + * @return Promise + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + $request = $request->withHeader( + 'Authorization', + $this->getAuthorizationHeader() + ); + + return $next($request); + } + + private function getAuthorizationHeader(): string + { + switch ($this->method) { + case AuthMethod::CLIENT_ID: + return sprintf('Basic %s', base64_encode($this->tokenOrLogin.':'.$this->password)); + case AuthMethod::ACCESS_TOKEN: + return sprintf('token %s', $this->tokenOrLogin); + case AuthMethod::JWT: + return sprintf('Bearer %s', $this->tokenOrLogin); + default: + throw new RuntimeException(sprintf('%s not yet implemented', $this->method)); + } + } +} diff --git a/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/GithubExceptionThrower.php b/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/GithubExceptionThrower.php new file mode 100644 index 00000000..4603f629 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/GithubExceptionThrower.php @@ -0,0 +1,160 @@ + + * @author Tobias Nyholm + */ +final class GithubExceptionThrower implements Plugin +{ + /** + * @return Promise + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + return $next($request)->then(function (ResponseInterface $response) use ($request) { + if ($response->getStatusCode() < 400 || $response->getStatusCode() > 600) { + $this->checkGraphqlErrors($response); + + return $response; + } + + // If error: + $remaining = ResponseMediator::getHeader($response, 'X-RateLimit-Remaining'); + if ((429 === $response->getStatusCode()) && null !== $remaining && 1 > $remaining && 'rate_limit' !== substr($request->getRequestTarget(), 1, 10)) { + $limit = (int) ResponseMediator::getHeader($response, 'X-RateLimit-Limit'); + $reset = (int) ResponseMediator::getHeader($response, 'X-RateLimit-Reset'); + + throw new ApiLimitExceedException($limit, $reset); + } + + if ((401 === $response->getStatusCode()) && $response->hasHeader('X-GitHub-OTP') && 0 === strpos((string) ResponseMediator::getHeader($response, 'X-GitHub-OTP'), 'required;')) { + $type = substr((string) ResponseMediator::getHeader($response, 'X-GitHub-OTP'), 9); + + throw new TwoFactorAuthenticationRequiredException($type); + } + + $content = ResponseMediator::getContent($response); + if (is_array($content) && isset($content['message'])) { + if (400 === $response->getStatusCode()) { + throw new ErrorException(sprintf('%s (%s)', $content['message'], $response->getReasonPhrase()), 400); + } + + if (422 === $response->getStatusCode() && isset($content['errors'])) { + $errors = []; + foreach ($content['errors'] as $error) { + switch ($error['code'] ?? null) { + case 'missing': + $errors[] = sprintf('The %s %s does not exist, for resource "%s"', $error['field'], $error['value'], $error['resource']); + break; + + case 'missing_field': + $errors[] = sprintf('Field "%s" is missing, for resource "%s"', $error['field'], $error['resource']); + break; + + case 'invalid': + if (isset($error['message'])) { + $errors[] = sprintf('Field "%s" is invalid, for resource "%s": "%s"', $error['field'], $error['resource'], $error['message']); + } else { + $errors[] = sprintf('Field "%s" is invalid, for resource "%s"', $error['field'], $error['resource']); + } + break; + + case 'already_exists': + $errors[] = sprintf('Field "%s" already exists, for resource "%s"', $error['field'], $error['resource']); + break; + + default: + if (is_string($error)) { + $errors[] = $error; + + break; + } + + if (isset($error['message'])) { + $errors[] = $error['message']; + } + break; + + } + } + + throw new ValidationFailedException( + $errors ? 'Validation Failed: '.implode(', ', $errors) : 'Validation Failed', + 422 + ); + } + } + + if (502 == $response->getStatusCode() && isset($content['errors']) && is_array($content['errors'])) { + $errors = []; + foreach ($content['errors'] as $error) { + if (isset($error['message'])) { + $errors[] = $error['message']; + } + } + + throw new RuntimeException(implode(', ', $errors), 502); + } + + if ((403 === $response->getStatusCode()) && $response->hasHeader('X-GitHub-SSO') && 0 === strpos((string) ResponseMediator::getHeader($response, 'X-GitHub-SSO'), 'required;')) { + // The header will look something like this: + // required; url=https://github.com/orgs/octodocs-test/sso?authorization_request=AZSCKtL4U8yX1H3sCQIVnVgmjmon5fWxks5YrqhJgah0b2tlbl9pZM4EuMz4 + // So we strip out the first 14 characters, leaving only the URL. + // @see https://developer.github.com/v3/auth/#authenticating-for-saml-sso + $url = substr((string) ResponseMediator::getHeader($response, 'X-GitHub-SSO'), 14); + + throw new SsoRequiredException($url); + } + + throw new RuntimeException(isset($content['message']) ? $content['message'] : $content, $response->getStatusCode()); + }); + } + + /** + * The graphql api doesn't return a 5xx http status for errors. Instead it returns a 200 with an error body. + * + * @throws RuntimeException + */ + private function checkGraphqlErrors(ResponseInterface $response): void + { + if ($response->getStatusCode() !== 200) { + return; + } + + $content = ResponseMediator::getContent($response); + if (!is_array($content)) { + return; + } + + if (!isset($content['errors']) || !is_array($content['errors'])) { + return; + } + + $errors = []; + foreach ($content['errors'] as $error) { + if (isset($error['message'])) { + $errors[] = $error['message']; + } + } + + if (empty($errors)) { + return; + } + + throw new RuntimeException(implode(', ', $errors)); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/History.php b/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/History.php new file mode 100644 index 00000000..341c288a --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/History.php @@ -0,0 +1,44 @@ + + */ +final class History implements Journal +{ + /** + * @var ResponseInterface|null + */ + private $lastResponse; + + /** + * @return ResponseInterface|null + */ + public function getLastResponse(): ?ResponseInterface + { + return $this->lastResponse; + } + + /** + * @return void + */ + public function addSuccess(RequestInterface $request, ResponseInterface $response): void + { + $this->lastResponse = $response; + } + + /** + * @return void + */ + public function addFailure(RequestInterface $request, ClientExceptionInterface $exception): void + { + } +} diff --git a/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/PathPrepend.php b/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/PathPrepend.php new file mode 100644 index 00000000..c1077299 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/PathPrepend.php @@ -0,0 +1,46 @@ + + */ +final class PathPrepend implements Plugin +{ + /** + * @var string + */ + private $path; + + /** + * @param string $path + */ + public function __construct(string $path) + { + $this->path = $path; + } + + /** + * @param RequestInterface $request + * @param callable $next + * @param callable $first + * + * @return Promise + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + $currentPath = $request->getUri()->getPath(); + if (strpos($currentPath, $this->path) !== 0) { + $uri = $request->getUri()->withPath($this->path.$currentPath); + $request = $request->withUri($uri); + } + + return $next($request); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/ResultPager.php b/vendor/knplabs/github-api/lib/Github/ResultPager.php new file mode 100644 index 00000000..cfd1d605 --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/ResultPager.php @@ -0,0 +1,212 @@ + + * @author Mitchel Verschoof + * @author Graham Campbell + */ +class ResultPager implements ResultPagerInterface +{ + /** + * The default number of entries to request per page. + * + * @var int + */ + private const PER_PAGE = 100; + + /** + * The client to use for pagination. + * + * @var Client + */ + private $client; + + /** + * The number of entries to request per page. + * + * @var int + */ + private $perPage; + + /** + * The pagination result from the API. + * + * @var array + */ + private $pagination; + + /** + * Create a new result pager instance. + * + * Example code: + * + * $client = new \Github\Client(); + * $api = $client->api('someApi'); + * $pager = new \Github\ResultPager($client); + * + * @param Client $client + * @param int|null $perPage + * + * @return void + */ + public function __construct(Client $client, int $perPage = null) + { + if (null !== $perPage && ($perPage < 1 || $perPage > 100)) { + throw new ValueError(sprintf('%s::__construct(): Argument #2 ($perPage) must be between 1 and 100, or null', self::class)); + } + + $this->client = $client; + $this->perPage = $perPage ?? self::PER_PAGE; + $this->pagination = []; + } + + /** + * {@inheritdoc} + */ + public function fetch(AbstractApi $api, string $method, array $parameters = []): array + { + $paginatorPerPage = $this->perPage; + $closure = Closure::bind(function (AbstractApi $api) use ($paginatorPerPage) { + $clone = clone $api; + $clone->perPage = $paginatorPerPage; + + return $clone; + }, null, AbstractApi::class); + + $api = $closure($api); + $result = $api->$method(...$parameters); + + $this->postFetch(true); + + return $result; + } + + /** + * {@inheritdoc} + */ + public function fetchAll(AbstractApi $api, string $method, array $parameters = []): array + { + return iterator_to_array($this->fetchAllLazy($api, $method, $parameters)); + } + + /** + * {@inheritdoc} + */ + public function fetchAllLazy(AbstractApi $api, string $method, array $parameters = []): Generator + { + $result = $this->fetch($api, $method, $parameters); + + foreach ($result['items'] ?? $result as $key => $item) { + if (is_string($key)) { + yield $key => $item; + } else { + yield $item; + } + } + + while ($this->hasNext()) { + $result = $this->fetchNext(); + + foreach ($result['items'] ?? $result as $key => $item) { + if (is_string($key)) { + yield $key => $item; + } else { + yield $item; + } + } + } + } + + /** + * {@inheritdoc} + */ + public function postFetch(/* $skipDeprecation = false */): void + { + if (func_num_args() === 0 || (func_num_args() > 0 && false === func_get_arg(0))) { + trigger_deprecation('KnpLabs/php-github-api', '3.2', 'The "%s" method is deprecated and will be removed.', __METHOD__); + } + + $this->setPagination(); + } + + /** + * {@inheritdoc} + */ + public function hasNext(): bool + { + return isset($this->pagination['next']); + } + + /** + * {@inheritdoc} + */ + public function fetchNext(): array + { + return $this->get('next'); + } + + /** + * {@inheritdoc} + */ + public function hasPrevious(): bool + { + return isset($this->pagination['prev']); + } + + /** + * {@inheritdoc} + */ + public function fetchPrevious(): array + { + return $this->get('prev'); + } + + /** + * {@inheritdoc} + */ + public function fetchFirst(): array + { + return $this->get('first'); + } + + /** + * {@inheritdoc} + */ + public function fetchLast(): array + { + return $this->get('last'); + } + + /** + * @param string $key + * + * @return array + */ + protected function get(string $key): array + { + if (!isset($this->pagination[$key])) { + return []; + } + + $result = $this->client->getHttpClient()->get($this->pagination[$key]); + + $this->postFetch(true); + + return ResponseMediator::getContent($result); + } + + private function setPagination(): void + { + $this->pagination = ResponseMediator::getPagination($this->client->getLastResponse()); + } +} diff --git a/vendor/knplabs/github-api/lib/Github/ResultPagerInterface.php b/vendor/knplabs/github-api/lib/Github/ResultPagerInterface.php new file mode 100644 index 00000000..bf7618ee --- /dev/null +++ b/vendor/knplabs/github-api/lib/Github/ResultPagerInterface.php @@ -0,0 +1,104 @@ + + * @author Mitchel Verschoof + * @author Graham Campbell + */ +interface ResultPagerInterface +{ + /** + * Fetch a single result (page) from an api call. + * + * @param AbstractApi $api the Api instance + * @param string $method the method name to call on the Api instance + * @param array $parameters the method parameters in an array + * + * @return array returns the result of the Api::$method() call + */ + public function fetch(AbstractApi $api, string $method, array $parameters = []): array; + + /** + * Fetch all results (pages) from an api call. + * + * Use with care - there is no maximum. + * + * @param AbstractApi $api the Api instance + * @param string $method the method name to call on the Api instance + * @param array $parameters the method parameters in an array + * + * @return array returns a merge of the results of the Api::$method() call + */ + public function fetchAll(AbstractApi $api, string $method, array $parameters = []): array; + + /** + * Lazily fetch all results (pages) from an api call. + * + * Use with care - there is no maximum. + * + * @param AbstractApi $api the Api instance + * @param string $method the method name to call on the Api instance + * @param array $parameters the method parameters in an array + * + * @return \Generator returns a merge of the results of the Api::$method() call + */ + public function fetchAllLazy(AbstractApi $api, string $method, array $parameters = []): Generator; + + /** + * Method that performs the actual work to refresh the pagination property. + * + * @deprecated since 3.2 and will be removed in 4.0. + * + * @return void + */ + public function postFetch(): void; + + /** + * Check to determine the availability of a next page. + * + * @return bool + */ + public function hasNext(): bool; + + /** + * Check to determine the availability of a previous page. + * + * @return bool + */ + public function hasPrevious(): bool; + + /** + * Fetch the next page. + * + * @return array + */ + public function fetchNext(): array; + + /** + * Fetch the previous page. + * + * @return array + */ + public function fetchPrevious(): array; + + /** + * Fetch the first page. + * + * @return array + */ + public function fetchFirst(): array; + + /** + * Fetch the last page. + * + * @return array + */ + public function fetchLast(): array; +} diff --git a/vendor/knplabs/github-api/phpstan.neon.dist b/vendor/knplabs/github-api/phpstan.neon.dist new file mode 100644 index 00000000..9e84171f --- /dev/null +++ b/vendor/knplabs/github-api/phpstan.neon.dist @@ -0,0 +1,15 @@ +parameters: + checkMissingIterableValueType: false + + level: 6 + paths: + - lib + + ignoreErrors: + # Ignore typehint errors on api classes + - + message: '#Method (.*) with no typehint specified\.#' + path: lib/Github/Api + - + message: '#Method (.*) has no return typehint specified\.#' + path: lib/Github/Api diff --git a/vendor/ml/iri/ML/IRI/.gitignore b/vendor/ml/iri/ML/IRI/.gitignore new file mode 100644 index 00000000..b73b1173 --- /dev/null +++ b/vendor/ml/iri/ML/IRI/.gitignore @@ -0,0 +1,3 @@ + + +/Test/report \ No newline at end of file diff --git a/vendor/ml/iri/ML/IRI/.travis.yml b/vendor/ml/iri/ML/IRI/.travis.yml new file mode 100644 index 00000000..3b46828e --- /dev/null +++ b/vendor/ml/iri/ML/IRI/.travis.yml @@ -0,0 +1,7 @@ +language: php + +php: + - 5.3 + - 5.4 + - 5.5 + - hhvm diff --git a/vendor/ml/iri/ML/IRI/IRI.php b/vendor/ml/iri/ML/IRI/IRI.php new file mode 100644 index 00000000..d1bcdc2f --- /dev/null +++ b/vendor/ml/iri/ML/IRI/IRI.php @@ -0,0 +1,601 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\IRI; + +/** + * IRI represents an IRI as per RFC3987. + * + * @author Markus Lanthaler + * + * @link http://tools.ietf.org/html/rfc3987 RFC3987 + */ +class IRI +{ + /** + * The scheme + * + * @var string|null + */ + private $scheme = null; + + /** + * The user information + * + * @var string|null + */ + private $userinfo = null; + + /** + * The host + * + * @var string|null + */ + private $host = null; + + /** + * The port + * + * @var string|null + */ + private $port = null; + + /** + * The path + * + * @var string + */ + private $path = ''; + + /** + * The query component + * + * @var string|null + */ + private $query = null; + + /** + * The fragment identifier + * + * @var string|null + */ + private $fragment = null; + + + /** + * Constructor + * + * @param null|string|IRI $iri The IRI. + * + * @throws \InvalidArgumentException If an invalid IRI is passed. + * + * @api + */ + public function __construct($iri = null) + { + if (null === $iri) { + return; + } elseif (is_string($iri)) { + $this->parse($iri); + } elseif ($iri instanceof IRI) { + $this->scheme = $iri->scheme; + $this->userinfo = $iri->userinfo; + $this->host = $iri->host; + $this->port = $iri->port; + $this->path = $iri->path; + $this->query = $iri->query; + $this->fragment = $iri->fragment; + } else { + throw new \InvalidArgumentException( + 'Expecting a string or an IRI, got ' . + (is_object($iri) ? get_class($iri) : gettype($iri)) + ); + } + } + + /** + * Get the scheme + * + * @return string|null Returns the scheme or null if not set. + */ + public function getScheme() + { + return $this->scheme; + } + + /** + * Get the authority + * + * @return string|null Returns the authority or null if not set. + */ + public function getAuthority() + { + $authority = null; + + if (null !== $this->host) { + + if (null !== $this->userinfo) { + $authority .= $this->userinfo . '@'; + } + $authority .= $this->host; + if (null !== $this->port) { + $authority .= ':' . $this->port; + } + } + + return $authority; + } + + /** + * Get the user information + * + * @return string|null Returns the user information or null if not set. + */ + public function getUserInfo() + { + return $this->userinfo; + } + + /** + * Get the host + * + * @return string|null Returns the host or null if not set. + */ + public function getHost() + { + return $this->host; + } + + /** + * Get the port + * + * @return string|null Returns the port or null if not set. + */ + public function getPort() + { + return $this->port; + } + + /** + * Get the path + * + * @return string Returns the path which might be empty. + */ + public function getPath() + { + return $this->path; + } + + /** + * Get the query component + * + * @return string|null Returns the query component or null if not set. + */ + public function getQuery() + { + return $this->query; + } + + /** + * Get the fragment identifier + * + * @return string|null Returns the fragment identifier or null if not set. + */ + public function getFragment() + { + return $this->fragment; + } + + /** + * Find out whether the IRI is absolute + * + * @return bool Returns true if the IRI is absolute, false otherwise. + * + * @api + */ + public function isAbsolute() + { + return (null !== $this->scheme); + } + + /** + * Get as absolute IRI, i.e., without fragment identifier + * + * @return IRI The absolute IRI, i.e., without fragment identifier + * + * @throws \UnexpectedValueException If the IRI is a relative IRI. + * + * @link http://tools.ietf.org/html/rfc3987#section-2.2 RFC3987 absolute-IRI + * + * @api + */ + public function getAbsoluteIri() + { + if (false === $this->isAbsolute()) { + throw new \UnexpectedValueException('Cannot get the absolute IRI of a relative IRI.'); + } + + $absolute = clone $this; + $absolute->fragment = null; + + return $absolute; + } + + /** + * Check whether the passed IRI is equal + * + * @param IRI|string $iri IRI to compare to this instance. + * + * @return bool Returns true if the two IRIs are equal, false otherwise. + * + * @api + */ + public function equals($iri) + { + // Make sure both instances are strings + return ($this->__toString() === (string)$iri); + } + + /** + * Resolve a (relative) IRI reference against this IRI + * + * @param IRI|string $reference The (relative) IRI reference that should + * be resolved against this IRI. + * + * @return IRI The resolved IRI. + * + * @throws \InvalidArgumentException If an invalid IRI is passed. + * + * @link http://tools.ietf.org/html/rfc3986#section-5.2 + * + * @api + */ + public function resolve($reference) + { + $reference = new IRI($reference); + + $scheme = null; + $authority = null; + $path = ''; + $query = null; + $fragment = null; + + // The Transform References algorithm as specified by RFC3986 + // see: http://tools.ietf.org/html/rfc3986#section-5.2.2 + if ($reference->scheme) { + $scheme = $reference->scheme; + $authority = $reference->getAuthority(); + $path = self::removeDotSegments($reference->path); + $query = $reference->query; + } else { + if (null !== $reference->getAuthority()) { + $authority = $reference->getAuthority(); + $path = self::removeDotSegments($reference->path); + $query = $reference->query; + } else { + if (0 === strlen($reference->path)) { + $path = $this->path; + if (null !== $reference->query) { + $query = $reference->query; + } else { + $query = $this->query; + } + } else { + if ('/' === $reference->path[0]) { + $path = self::removeDotSegments($reference->path); + } else { + // T.path = merge(Base.path, R.path); + if ((null !== $this->getAuthority()) && ('' === $this->path)) { + $path = '/' . $reference->path; + } else { + if (false !== ($end = strrpos($this->path, '/'))) { + $path = substr($this->path, 0, $end + 1); + } + $path .= $reference->path; + } + $path = self::removeDotSegments($path); + } + $query = $reference->query; + } + + $authority = $this->getAuthority(); + } + $scheme = $this->scheme; + } + + $fragment = $reference->fragment; + + + // The Component Recomposition algorithm as specified by RFC3986 + // see: http://tools.ietf.org/html/rfc3986#section-5.3 + $result = ''; + + if ($scheme) { + $result = $scheme . ':'; + } + + if (null !== $authority) { + $result .= '//' . $authority; + } + + $result .= $path; + + if (null !== $query) { + $result .= '?' . $query; + } + + if (null !== $fragment) { + $result .= '#' . $fragment; + } + + return new IRI($result); + } + + /** + * Transform this IRI to a IRI reference relative to the passed base IRI + * + * @param IRI|string $base The (relative) IRI reference that should be + * be used as base IRI. + * @param bool Defines whether schema-relative IRIs such + * as `//example.com` should be created (`true`) + * or not (`false`). + * + * @return IRI The IRI reference relative to the passed base IRI. + * + * @throws \InvalidArgumentException If an invalid IRI is passed. + * + * @api + */ + public function relativeTo($base, $schemaRelative = false) + { + if (false === ($base instanceof IRI)) { + $base = new IRI($base); + } + $relative = clone $this; + + // Compare scheme + if ($relative->scheme !== $base->scheme) { + return $relative; + } + + // Compare authority + if ($relative->getAuthority() !== $base->getAuthority()) { + if (true === $schemaRelative) { + $relative->scheme = null; + } + + return $relative; + } + $relative->scheme = null; + $relative->host = null; + $relative->userinfo = null; + $relative->port = null; + + // Compare path + $baseSegments = explode('/', $base->path); + $relativeSegments = explode('/', $relative->path); + $len = min(count($baseSegments), count($relativeSegments)) - 1; // do not move beyond last segment + + $pos = 0; + + while (($baseSegments[$pos] === $relativeSegments[$pos]) && ($pos < $len)) { + $pos++; + } + + $relative->path = ''; + $numBaseSegments = count($baseSegments) - $pos - 1; + if ($numBaseSegments > 0) { + $relative->path .= str_repeat('../', $numBaseSegments); + } + + if (($baseSegments[$pos] !== $relativeSegments[$pos]) || + ((null === $relative->query) && (null === $relative->fragment))) { + // if the two paths differ or if there's neither a query component nor a fragment, + // we need to consider this IRI's path + + if (($relative->path === '') && (false !== strpos($relativeSegments[$pos], ':'))) { + // if the first path segment contains a colon, we need to + // prepend a ./ to distinguish it from an absolute IRI + $relative->path .= './'; + } + + $relative->path .= implode('/', array_slice($relativeSegments, $pos)); + + // .. and ensure that the resulting path isn't empty + if (($relative->path === '')) { + $relative->path .= './'; + } + } + + if ($relative->query !== $base->query) { + return $relative; + } + + if (null !== $relative->fragment) { + $relative->query = null; + } + + return $relative; + } + + /** + * Convert an IRI to a relative IRI reference using this IRI as base + * + * This method provides a more convenient interface than the + * {@link IRI::relativeTo()} method if the base IRI stays the same while + * the IRIs to convert to relative IRI references change. + * + * @param string|IRI $iri The IRI to convert to a relative reference + * @param bool Defines whether schema-relative IRIs such + * as `//example.com` should be created (`true`) + * or not (`false`). + * + * @throws \InvalidArgumentException If an invalid IRI is passed. + * + * @see \ML\IRI\IRI::relativeTo() + * + * @return IRI The relative IRI reference + */ + public function baseFor($iri, $schemaRelative = false) + { + if (false === ($iri instanceof IRI)) { + $iri = new IRI($iri); + } + + return $iri->relativeTo($this, $schemaRelative); + } + + /** + * Get a string representation of this IRI object + * + * @return string A string representation of this IRI instance. + * + * @api + */ + public function __toString() + { + $result = ''; + + if ($this->scheme) { + $result .= $this->scheme . ':'; + } + + if (null !== ($authority = $this->getAuthority())) { + $result .= '//' . $authority; + } + + $result .= $this->path; + + if (null !== $this->query) { + $result .= '?' . $this->query; + } + + if (null !== $this->fragment) { + $result .= '#' . $this->fragment; + } + + return $result; + } + + /** + * Parse an IRI into it's components + * + * This is done according to + * {@link http://tools.ietf.org/html/rfc3986#section-3.1 RFC3986}. + * + * @param string $iri The IRI to parse. + */ + protected function parse($iri) + { + // Parse IRI by using the regular expression as specified by + // http://tools.ietf.org/html/rfc3986#appendix-B + $regex = '|^((?P[^:/?#]+):)?' . + '((?P//)(?P[^/?#]*))?(?P[^?#]*)' . + '((?P\?)(?P[^#]*))?(#(?P.*))?|'; + preg_match($regex, $iri, $match); + + // Extract scheme + if (false === empty($match['scheme'])) { + $this->scheme = $match['scheme']; + } + + // Parse authority (http://tools.ietf.org/html/rfc3986#section-3.2) + if ('//' === $match['doubleslash']) { + if (0 === strlen($match['authority'])) { + $this->host = ''; + } else { + $authority = $match['authority']; + + // Split authority into userinfo and host + // (use last @ to ignore unescaped @ symbols) + if (false !== ($pos = strrpos($authority, '@'))) { + $this->userinfo = substr($authority, 0, $pos); + $authority = substr($authority, $pos + 1); + } + + // Split authority into host and port + $hostEnd = 0; + if (('[' === $authority[0]) && (false !== ($pos = strpos($authority, ']')))) { + $hostEnd = $pos; + } + + if ((false !== ($pos = strrpos($authority, ':'))) && ($pos > $hostEnd)) { + $this->host = substr($authority, 0, $pos); + $this->port = substr($authority, $pos + 1); + } else { + $this->host = $authority; + } + } + } + + // Extract path (http://tools.ietf.org/html/rfc3986#section-3.3) + // The path is always present but might be empty + $this->path = $match['path']; + + // Extract query (http://tools.ietf.org/html/rfc3986#section-3.4) + if (false === empty($match['querydef'])) { + $this->query = $match['query']; + } + + // Extract fragment (http://tools.ietf.org/html/rfc3986#section-3.5) + if (isset($match['fragment'])) { + $this->fragment = $match['fragment']; + } + } + + /** + * Remove dot-segments + * + * This method removes the special "." and ".." complete path segments + * from an IRI. + * + * @param string $input The IRI from which dot segments should be removed. + * + * @return string The IRI with all dot-segments removed. + * + * @link http://tools.ietf.org/html/rfc3986#section-5.2.4 + */ + private static function removeDotSegments($input) + { + $output = ''; + + while (strlen($input) > 0) { + if (('../' === substr($input, 0, 3)) || ('./' === substr($input, 0, 2))) { + $input = substr($input, strpos($input, '/')); + } elseif ('/./' === substr($input, 0, 3)) { + $input = substr($input, 2); + } elseif ('/.' === $input) { + $input = '/'; + } elseif (('/../' === substr($input, 0, 4)) || ('/..' === $input)) { + if ($input == '/..') { + $input = '/'; + } else { + $input = substr($input, 3); + } + + if (false !== ($end = strrpos($output, '/'))) { + $output = substr($output, 0, $end); + } else { + $output = ''; + } + } elseif (('..' === $input) || ('.' === $input)) { + $input = ''; + } else { + if (false === ($end = strpos($input, '/', 1))) { + $output .= $input; + $input = ''; + } else { + $output .= substr($input, 0, $end); + $input = substr($input, $end); + } + } + } + return $output; + } +} diff --git a/vendor/ml/iri/ML/IRI/LICENSE b/vendor/ml/iri/ML/IRI/LICENSE new file mode 100644 index 00000000..ec64dbb2 --- /dev/null +++ b/vendor/ml/iri/ML/IRI/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012-2013 Markus Lanthaler + +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/ml/iri/ML/IRI/README.md b/vendor/ml/iri/ML/IRI/README.md new file mode 100644 index 00000000..32bb3044 --- /dev/null +++ b/vendor/ml/iri/ML/IRI/README.md @@ -0,0 +1,47 @@ +IRI +============== + +This is a simple PHP class to ease IRI handling. Currently it just supports +parsing of IRIs and relative IRI resolution. In the future I will extend it +to support validation and normalization and perhaps also support for IRI +templates. + +With more than 700 tests, this class is extensively unit tested: +[![Build Status](https://secure.travis-ci.org/lanthaler/IRI.png?branch=master)](http://travis-ci.org/lanthaler/IRI) + + +Installation +------------ + +The easiest way to use IRI is to integrate it as a dependency in your project's +[composer.json](http://getcomposer.org/doc/00-intro.md) file: + +```json +{ + "require": { + "ml/iri": "1.*" + } +} +``` + +Installing is then a matter of running composer + + php composer.phar install + +... and including Composer's autoloader to your project + +```php +require('vendor/autoload.php'); +``` + + +Of course you can also just download an [archive](https://github.com/lanthaler/IRI/downloads) +from Github. + + +Credits +------------ + +Most test cases come either directly from the [URI specification](http://tools.ietf.org/html/rfc3986), +from [Graham Klyne's](http://www.ninebynine.org/Software/HaskellUtils/Network/URITestDescriptions.html), +or [Tim Berners-Lee's](http://dig.csail.mit.edu/2005/ajar/ajaw/test/uri-test-doc.html) test suite. diff --git a/vendor/ml/iri/ML/IRI/Test/IriTest.php b/vendor/ml/iri/ML/IRI/Test/IriTest.php new file mode 100644 index 00000000..83ae742a --- /dev/null +++ b/vendor/ml/iri/ML/IRI/Test/IriTest.php @@ -0,0 +1,1078 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\IRI\Test; + +use ML\IRI\IRI; + +/** + * The IRI test suite. + * + * @author Markus Lanthaler + */ +class IriTest extends \PHPUnit_Framework_TestCase +{ + /** + * Test parsing + * + * This test checks whether decomposing IRIs in their subcomponents works. + * + * @param string $iri The IRI to decompose. + * @param string|null $scheme The scheme. + * @param string|null $userinfo The user information. + * @param string|null $host The host. + * @param string|null $port The port. + * @param string|null $path The path. + * @param string|null $query The query component. + * @param string|null $fragment The fragment identifier. + * + * @dataProvider decompositionProvider + */ + public function testDecomposition($iri, $scheme, $userinfo, $host, $port, $path, $query, $fragment) + { + $iri = new IRI($iri); + $test = new IRI($iri); // test copy-constructor + + $this->assertEquals($scheme, $test->getScheme(), 'Scheme of ' . $iri); + $this->assertEquals($userinfo, $test->getUserInfo(), 'User info of ' . $iri); + $this->assertEquals($host, $test->getHost(), 'Host of ' . $iri); + $this->assertEquals($port, $test->getPort(), 'Port of ' . $iri); + $this->assertEquals($path, $test->getPath(), 'Path of ' . $iri); + $this->assertEquals($query, $test->getQuery(), 'Query component of ' . $iri); + $this->assertEquals($fragment, $test->getFragment(), 'Fragment of ' . $iri); + $this->assertEquals($iri, $test->__toString(), 'Recomposition of ' . $iri); + $this->assertTrue($test->equals($iri), 'Test equality of parsed ' . $iri); + } + + /** + * Decomposition test cases + * + * These test cases were taken from the + * {@link http://tools.ietf.org/html/rfc3986#section-1.1.2 URI specification} + * and from {@link http://www.ninebynine.org/Software/HaskellUtils/Network/URITestDescriptions.html}. + * + * @return array The decomposition test cases. + */ + public function decompositionProvider() + { + return array( //$iri, $scheme, $userinfo, $host, $port, $path, $query, $fragment + // http://tools.ietf.org/html/rfc3986#section-1.1.2 + array('ftp://ftp.is.co.za/rfc/rfc1808.txt', 'ftp', null, 'ftp.is.co.za', null, '/rfc/rfc1808.txt', null, null), + array('http://www.ietf.org/rfc/rfc2396.txt#frag', 'http', null, 'www.ietf.org', null, '/rfc/rfc2396.txt', null, 'frag'), + array('ldap://[2001:db8::7]/c=GB?objectClass?one', 'ldap', null, '[2001:db8::7]', null, '/c=GB', 'objectClass?one', null), + array('mailto:John.Doe@example.com', 'mailto', null, null, null, 'John.Doe@example.com', null, null), + array('news:comp.infosystems.www.servers.unix', 'news', null, null, null, 'comp.infosystems.www.servers.unix', null, null), + array('tel:+1-816-555-1212', 'tel', null, null, null, '+1-816-555-1212', null, null), + array('telnet://192.0.2.16:80/', 'telnet', null, '192.0.2.16', '80', '/', null, null), + array('urn:oasis:names:specification:docbook:dtd:xml:4.1.2', 'urn', null, null, null, 'oasis:names:specification:docbook:dtd:xml:4.1.2', null, null), + // http://www.ninebynine.org/Software/HaskellUtils/Network/URITestDescriptions.html + array('http://user:pass@example.org:99/aaa/bbb?qqq#fff', 'http', 'user:pass', 'example.org', '99', '/aaa/bbb' , 'qqq', 'fff'), + // INVALID IRI array('http://user:pass@example.org:99aaa/bbb'), + array('http://user:pass@example.org:99?aaa/bbb', 'http', 'user:pass', 'example.org', '99', '', 'aaa/bbb', null), + array('http://user:pass@example.org:99#aaa/bbb', 'http', 'user:pass', 'example.org', '99' , '', null, 'aaa/bbb'), + array('http://example.com?query', 'http', null, 'example.com', null, '', 'query', null) + ); + } + + /** + * Test whether parsing invalid values leads to an exception + * + * @expectedException InvalidArgumentException + */ + public function testParseInvalidValue() + { + new IRI(2); + } + + /** + * Test whether an IRI is an absolute IRI or a relative one + * + * @param string $iri The IRI to test. + * @param bool $isAbsolute True if the IRI is absolute, false otherwise. + * + * @dataProvider isAbsoluteProvider + */ + public function testIsAbsolute($iri, $isAbsolute) + { + $iri = new IRI($iri); + $this->assertEquals($isAbsolute, $iri->isAbsolute()); + } + + + /** + * Absolute/relative IRI test cases + * + * These tests were taken from the + * {@link http://tools.ietf.org/html/rfc3986#section-5.4 URI specification} and from + * {@link http://www.ninebynine.org/Software/HaskellUtils/Network/URITestDescriptions.html}. + * + * @return array The absolute/relative IRI test cases. + */ + public function isAbsoluteProvider() + { + return array( + // http://tools.ietf.org/html/rfc3986#section-5.4 + array('http:g', true), + array('g:h', true), + array('g', false), + array('./g', false), + array('g/', false), + array('/g', false), + array('//g', false), + array('?y', false), + array('g?y', false), + array('#s', false), + array('g#s', false), + array('g?y#s', false), + array(';x', false), + array('g;x', false), + array('g;x?y#s', false), + array('', false), + array('.', false), + array('./', false), + array('..', false), + array('../', false), + array('../g', false), + array('../..', false), + array('../../', false), + array('../../g', false), + array('../../../g', false), + array('../../../../g', false), + array('/./g', false), + array('/../g', false), + array('g.', false), + array('.g', false), + array('g..', false), + array('..g', false), + array('./../g', false), + array('./g/.', false), + array('g/./h', false), + array('g/../h', false), + array('g;x=1/./y', false), + array('g;x=1/../y', false), + array('g?y/./x', false), + array('g?y/../x', false), + array('g#s/./x', false), + array('g#s/../x', false), + // http://www.ninebynine.org/Software/HaskellUtils/Network/URITestDescriptions.html + array('http://example.org/aaa/bbb#ccc', true), + array('mailto:local@domain.org', true), + array('mailto:local@domain.org#frag', true), + array('HTTP://EXAMPLE.ORG/AAA/BBB#CCC', true), + array('http://example.org/aaa%2fbbb#ccc', true), + array('http://example.org/aaa%2Fbbb#ccc', true), + array('http://example.org:80/aaa/bbb#ccc', true), + array('http://example.org:/aaa/bbb#ccc', true), + array('http://example.org./aaa/bbb#ccc', true), + array('http://example.123./aaa/bbb#ccc', true), + array('http://example.org', true), + array('http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html', true), + array('http://[1080:0:0:0:8:800:200C:417A]/index.html', true), + array('http://[3ffe:2a00:100:7031::1]', true), + array('http://[1080::8:800:200C:417A]/foo', true), + array('http://[::192.9.5.5]/ipng', true), + array('http://[::FFFF:129.144.52.38]:80/index.html', true), + array('http://[2010:836B:4179::836B:4179]', true), + array('http://example/Andrȷ', true), + array('file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/', true), + array('http://46229EFFE16A9BD60B9F1BE88B2DB047ADDED785/demo.mp3', true), + array('//example.org/aaa/bbb#ccc', false), + array('/aaa/bbb#ccc', false), + array('bbb#ccc', false), + array('#ccc', false), + array('#', false), + array('/', false), + array('%2F', false), + array('aaa%2Fbbb', false), + array('//[2010:836B:4179::836B:4179]', false), + array("A'C", false), + array('A$C', false), + array('A@C', false), + array('"A,C"', false) + ); + } + + /** + * Test conversion to absolute IRI, i.e., removal of the fragment + */ + public function testGetAbsoluteIri() + { + $iri = new IRI('http://example.org/aaa%2fbbb#ccc'); + $this->assertEquals('http://example.org/aaa%2fbbb', (string) $iri->getAbsoluteIri()); + + $iri = new IRI('http://example.org/iri#with-fragment/looking/like/a/path?and&query'); + $this->assertEquals('http://example.org/iri', (string) $iri->getAbsoluteIri()); + } + + /** + * Test conversion to absolute IRI for a relative IRI + * + * @expectedException UnexpectedValueException + */ + public function testGetAbsoluteIriOnRelativeIri() + { + $iri = new IRI('/relative#with-fragment'); + $iri->getAbsoluteIri(); + } + + /** + * Test relative reference resolution + * + * @param string $base The base IRI. + * @param string $reference The reference to resolve. + * @param string $expected The expected absolute IRI. + * + * @dataProvider referenceResolutionProvider + */ + public function testReferenceResolution($base, $reference, $expected) + { + $base = new IRI($base); + $this->assertEquals($expected, (string)$base->resolve($reference)); + } + + /** + * Reference resolution test cases + * + * These test cases were taken from the + * {@link http://tools.ietf.org/html/rfc3986#section-5.4 URI specification}, + * from {@link http://www.w3.org/2004/04/uri-rel-test.html}, + * {@link http://dig.csail.mit.edu/2005/ajar/ajaw/test/uri-test-doc.html}, + * {@link http://www.ninebynine.org/Software/HaskellUtils/Network/URITestDescriptions.html}, + * and {@link http://greenbytes.de/tech/tc/uris/}. + * + * @return array The reference resolution test cases. + */ + public function referenceResolutionProvider() + { + return array( // $base, $relative, $absolute + array('', '../a/b', '/a/b'), + array('', '/.', '/'), + array(null, '', ''), + array('', null, ''), + array(null, null, ''), + // http://tools.ietf.org/html/rfc3986#section-5.4 + array('http://a/b/c/d;p?q', 'g:h', 'g:h'), + array('http://a/b/c/d;p?q', 'g', 'http://a/b/c/g'), + array('http://a/b/c/d;p?q', './g', 'http://a/b/c/g'), + array('http://a/b/c/d;p?q', 'g/', 'http://a/b/c/g/'), + array('http://a/b/c/d;p?q', '/g', 'http://a/g'), + array('http://a/b/c/d;p?q', '//g', 'http://g'), + array('http://a/b/c/d;p?q', '?y', 'http://a/b/c/d;p?y'), + array('http://a/b/c/d;p?q', 'g?y', 'http://a/b/c/g?y'), + array('http://a/b/c/d;p?q', '#s', 'http://a/b/c/d;p?q#s'), + array('http://a/b/c/d;p?q', 'g#s', 'http://a/b/c/g#s'), + array('http://a/b/c/d;p?q', 'g?y#s', 'http://a/b/c/g?y#s'), + array('http://a/b/c/d;p?q', ';x', 'http://a/b/c/;x'), + array('http://a/b/c/d;p?q', 'g;x', 'http://a/b/c/g;x'), + array('http://a/b/c/d;p?q', 'g;x?y#s', 'http://a/b/c/g;x?y#s'), + array('http://a/b/c/d;p?q', '', 'http://a/b/c/d;p?q'), + array('http://a/b/c/d;p?q', '.', 'http://a/b/c/'), + array('http://a/b/c/d;p?q', './', 'http://a/b/c/'), + array('http://a/b/c/d;p?q', '..', 'http://a/b/'), + array('http://a/b/c/d;p?q', '../', 'http://a/b/'), + array('http://a/b/c/d;p?q', '../g', 'http://a/b/g'), + array('http://a/b/c/d;p?q', '../..', 'http://a/'), + array('http://a/b/c/d;p?q', '../../', 'http://a/'), + array('http://a/b/c/d;p?q', '../../g', 'http://a/g'), + array('http://a/b/c/d;p?q', '../../../g', 'http://a/g'), + array('http://a/b/c/d;p?q', '../../../../g', 'http://a/g'), + array('http://a/b/c/d;p?q', '/./g', 'http://a/g'), + array('http://a/b/c/d;p?q', '/../g', 'http://a/g'), + array('http://a/b/c/d;p?q', 'g.', 'http://a/b/c/g.'), + array('http://a/b/c/d;p?q', '.g', 'http://a/b/c/.g'), + array('http://a/b/c/d;p?q', 'g..', 'http://a/b/c/g..'), + array('http://a/b/c/d;p?q', '..g', 'http://a/b/c/..g'), + array('http://a/b/c/d;p?q', './../g', 'http://a/b/g'), + array('http://a/b/c/d;p?q', './g/.', 'http://a/b/c/g/'), + array('http://a/b/c/d;p?q', 'g/./h', 'http://a/b/c/g/h'), + array('http://a/b/c/d;p?q', 'g/../h', 'http://a/b/c/h'), + array('http://a/b/c/d;p?q', 'g;x=1/./y', 'http://a/b/c/g;x=1/y'), + array('http://a/b/c/d;p?q', 'g;x=1/../y', 'http://a/b/c/y'), + array('http://a/b/c/d;p?q', 'g?y/./x', 'http://a/b/c/g?y/./x'), + array('http://a/b/c/d;p?q', 'g?y/../x', 'http://a/b/c/g?y/../x'), + array('http://a/b/c/d;p?q', 'g#s/./x', 'http://a/b/c/g#s/./x'), + array('http://a/b/c/d;p?q', 'g#s/../x', 'http://a/b/c/g#s/../x'), + array('http://a/b/c/d;p?q', 'http:g', 'http:g'), + // http://www.w3.org/2004/04/uri-rel-test.html + array('http://a/b/c/d;p?q', './g:h', 'http://a/b/c/g:h'), + // http://dig.csail.mit.edu/2005/ajar/ajaw/test/uri-test-doc.html}, + // http://www.ninebynine.org/Software/HaskellUtils/Network/URITestDescriptions.html}. + array('foo:xyz', 'bar:abc', 'bar:abc'), + array('http://example/x/y/z', '../abc', 'http://example/x/abc'), + array('http://example2/x/y/z', '//example/x/abc', 'http://example/x/abc'), + array('http://example2/x/y/z', 'http://example/x/abc', 'http://example/x/abc'), + array('http://ex/x/y/z', '../r', 'http://ex/x/r'), + array('http://ex/x/y/z', '/r', 'http://ex/r'), + array('http://ex/x/y/z', 'q/r', 'http://ex/x/y/q/r'), + array('http://ex/x/y', 'q/r#s', 'http://ex/x/q/r#s'), + array('http://ex/x/y', 'q/r#s/t', 'http://ex/x/q/r#s/t'), + array('http://ex/x/y', 'ftp://ex/x/q/r', 'ftp://ex/x/q/r'), + array('http://ex/x/y', '', 'http://ex/x/y'), + array('http://ex/x/y/', '', 'http://ex/x/y/'), + array('http://ex/x/y/pdq', '', 'http://ex/x/y/pdq'), + array('http://ex/x/y/', 'z/', 'http://ex/x/y/z/'), + array('file:/swap/test/animal.rdf', '#Animal', 'file:/swap/test/animal.rdf#Animal'), + array('file:/e/x/y/z', '../abc', 'file:/e/x/abc'), + array('file:/example2/x/y/z', '/example/x/abc', 'file:/example/x/abc'), + array('file:/ex/x/y/z', '../r', 'file:/ex/x/r'), + array('file:/ex/x/y/z', '/r', 'file:/r'), + array('file:/ex/x/y', 'q/r', 'file:/ex/x/q/r'), + array('file:/ex/x/y', 'q/r#s', 'file:/ex/x/q/r#s'), + array('file:/ex/x/y', 'q/r#', 'file:/ex/x/q/r#'), + array('file:/ex/x/y', 'q/r#s/t', 'file:/ex/x/q/r#s/t'), + array('file:/ex/x/y', 'ftp://ex/x/q/r', 'ftp://ex/x/q/r'), + array('file:/ex/x/y', '', 'file:/ex/x/y'), + array('file:/ex/x/y/', '', 'file:/ex/x/y/'), + array('file:/ex/x/y/pdq', '', 'file:/ex/x/y/pdq'), + array('file:/ex/x/y/', 'z/', 'file:/ex/x/y/z/'), + array('file:/devel/WWW/2000/10/swap/test/reluri-1.n3', '//meetings.example.com/cal#m1', 'file://meetings.example.com/cal#m1'), + array('file:/home/connolly/w3ccvs/WWW/2000/10/swap/test/reluri-1.n3', '//meetings.example.com/cal#m1', 'file://meetings.example.com/cal#m1'), + array('file:/some/dir/foo', './#blort', 'file:/some/dir/#blort'), + array('file:/some/dir/foo', './#', 'file:/some/dir/#'), + array('http://ex/x/y', './q:r', 'http://ex/x/q:r'), + array('http://ex/x/y', './p=q:r', 'http://ex/x/p=q:r'), + array('http://ex/x/y?pp/qq', '?pp/rr', 'http://ex/x/y?pp/rr'), + array('http://ex/x/y?pp/qq', 'y/z', 'http://ex/x/y/z'), + array('mailto:local', 'local/qual@domain.org#frag', 'mailto:local/qual@domain.org#frag'), + array('mailto:local/qual1@domain1.org', 'more/qual2@domain2.org#frag', 'mailto:local/more/qual2@domain2.org#frag'), + array('http://ex/x/z?q', 'y?q', 'http://ex/x/y?q'), + array('http://ex?p', '/x/y?q', 'http://ex/x/y?q'), + array('foo:a/b', 'c/d', 'foo:a/c/d'), + array('foo:a/b', '/c/d', 'foo:/c/d'), + array('foo:a/b?c#d', '', 'foo:a/b?c'), + array('foo:a', 'b/c', 'foo:b/c'), + array('foo:/a/y/z', '../b/c', 'foo:/a/b/c'), + // TODO Check this test, shouldn't the result be foo:/b/c? array('foo:a', './b/c', 'foo:b/c'), + array('foo:a', '/./b/c', 'foo:/b/c'), + array('foo://a//b/c', '../../d', 'foo://a/d'), + array('foo:a', '.', 'foo:'), + array('foo:a', '..', 'foo:'), + array('http://example/x/y%2Fz', 'abc', 'http://example/x/abc'), + array('http://example/a/x/y/z', '../../x%2Fabc', 'http://example/a/x%2Fabc'), + array('http://example/a/x/y%2Fz', '../x%2Fabc', 'http://example/a/x%2Fabc'), + array('http://example/x%2Fy/z', 'abc', 'http://example/x%2Fy/abc'), + array('http://ex/x/y', 'q%3Ar', 'http://ex/x/q%3Ar'), + array('http://example/x/y%2Fz', '/x%2Fabc', 'http://example/x%2Fabc'), + array('http://example/x/y/z', '/x%2Fabc', 'http://example/x%2Fabc'), + array('http://example/x/y%2Fz', '/x%2Fabc', 'http://example/x%2Fabc'), + array('ftp://example/x/y', 'http://example/a/b/../../c', 'http://example/c'), + array('ftp://example/x/y', 'http://example/a/b/c/../../', 'http://example/a/'), + array('ftp://example/x/y', 'http://example/a/b/c/./', 'http://example/a/b/c/'), + array('ftp://example/x/y', 'http://example/a/b/c/.././', 'http://example/a/b/'), + array('ftp://example/x/y', 'http://example/a/b/c/d/../../../../e', 'http://example/e'), + array('ftp://example/x/y', 'http://example/a/b/c/d/../.././../../e', 'http://example/e'), + array('mailto:local1@domain1?query1', 'local2@domain2', 'mailto:local2@domain2'), + array('mailto:local1@domain1', 'local2@domain2?query2', 'mailto:local2@domain2?query2'), + array('mailto:local1@domain1?query1', 'local2@domain2?query2', 'mailto:local2@domain2?query2'), + array('mailto:local@domain?query1', '?query2', 'mailto:local@domain?query2'), + array('mailto:?query1', 'local@domain?query2', 'mailto:local@domain?query2'), + array('mailto:local@domain?query1', '?query2', 'mailto:local@domain?query2'), + array('foo:bar', 'http://example/a/b?c/../d', 'http://example/a/b?c/../d'), + array('foo:bar', 'http://example/a/b#c/../d', 'http://example/a/b#c/../d'), + array('http://example.org/base/uri', 'this', 'http://example.org/base/this'), // Fixed absolute from http:this + array('http://example.org/base/uri', 'http:this', 'http:this'), + array('http:base', 'http:this', 'http:this'), + array('f:/a', './/g', 'f://g'), + array('f://example.org/base/a', 'b/c//d/e', 'f://example.org/base/b/c//d/e'), + array('mid:m@example.ord/c@example.org', 'm2@example.ord/c2@example.org', 'mid:m@example.ord/m2@example.ord/c2@example.org'), + array('file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/', 'mini1.xml', 'file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/mini1.xml'), + array('foo:a/y/z', '../b/c', 'foo:a/b/c'), + array('http://ex', '/x/y?q', 'http://ex/x/y?q'), + array('http://ex', 'x/y?q', 'http://ex/x/y?q'), + array('http://ex?p', '/x/y?q', 'http://ex/x/y?q'), + array('http://ex?p', 'x/y?q', 'http://ex/x/y?q'), + array('http://ex#f', '/x/y?q', 'http://ex/x/y?q'), + array('http://ex#f', 'x/y?q', 'http://ex/x/y?q'), + array('http://ex?p', '/x/y#g', 'http://ex/x/y#g'), + array('http://ex?p', 'x/y#g', 'http://ex/x/y#g'), + array('http://ex', '/', 'http://ex/'), + array('http://ex', './', 'http://ex/'), + array('http://ex', '/a/b', 'http://ex/a/b'), + array('http://ex/a/b', './', 'http://ex/a/'), + array('mailto:local/option@domain.org?notaquery#frag', 'more@domain', 'mailto:local/more@domain'), + array('mailto:local/option@domain.org?notaquery#frag', '#newfrag', 'mailto:local/option@domain.org?notaquery#newfrag'), + array('mailto:local/option@domain.org?notaquery#frag', 'l1/q1@domain', 'mailto:local/l1/q1@domain'), + array('mailto:local1@domain1?query1', 'mailto:local2@domain2', 'mailto:local2@domain2'), + array('mailto:local1@domain1', 'mailto:local2@domain2?query2', 'mailto:local2@domain2?query2'), + array('mailto:local1@domain1?query1', 'mailto:local2@domain2?query2', 'mailto:local2@domain2?query2'), + array('mailto:local@domain?query1', 'mailto:local@domain?query2', 'mailto:local@domain?query2'), + array('mailto:?query1', 'mailto:local@domain?query2', 'mailto:local@domain?query2'), + array('mailto:local@domain?query1', '?query2', 'mailto:local@domain?query2'), + array('info:name/1234/../567', 'name/9876/../543', 'info:name/name/543'), + array('info:/name/1234/../567', 'name/9876/../543', 'info:/name/name/543'), + array('http://ex/x/y', 'q/r', 'http://ex/x/q/r'), + array('file:/devel/WWW/2000/10/swap/test/reluri-1.n3', 'file://meetings.example.com/cal#m1', 'file://meetings.example.com/cal#m1'), + array('file:/home/connolly/w3ccvs/WWW/2000/10/swap/test/reluri-1.n3', 'file://meetings.example.com/cal#m1', 'file://meetings.example.com/cal#m1'), + array('http://example/x/abc.efg', './', 'http://example/x/'), + array('http://www.w3.org/People/Berners-Lee/card.rdf', '../../2002/01/tr-automation/tr.rdf', 'http://www.w3.org/2002/01/tr-automation/tr.rdf'), + array('http://example.com/', '.', 'http://example.com/'), + array('http://example.com/.meta.n3', '.meta.n3', 'http://example.com/.meta.n3'), + // http://greenbytes.de/tech/tc/uris/ + array('data:text/plain;charset=iso-8859-7,%be%fg%be', 'http://a/b/c/d;p?q', 'http://a/b/c/d;p?q'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', 'g:h', 'g:h'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '', 'data:text/plain;charset=iso-8859-7,%be%fg%be'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', 'g', 'data:text/g'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', './g', 'data:text/g'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', 'g/', 'data:text/g/'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '/g', 'data:/g'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '//g', 'data://g'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '?y', 'data:text/plain;charset=iso-8859-7,%be%fg%be?y'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', 'g?y', 'data:text/g?y'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '#s', 'data:text/plain;charset=iso-8859-7,%be%fg%be#s'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', 'g#s', 'data:text/g#s'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', 'g?y#s', 'data:text/g?y#s'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', ';x', 'data:text/;x'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', 'g;x', 'data:text/g;x'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', 'g;x?y#s', 'data:text/g;x?y#s'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '', 'data:text/plain;charset=iso-8859-7,%be%fg%be'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '.', 'data:text/'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', './', 'data:text/'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '..', 'data:/'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '../', 'data:/'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '../g', 'data:/g'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '../..', 'data:/'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '../../', 'data:/'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '../../g', 'data:/g'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '../../../g', 'data:/g'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '../../../../g', 'data:/g'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '/./g', 'data:/g'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '/../g', 'data:/g'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', 'g.', 'data:text/g.'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '.g', 'data:text/.g'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', 'g..', 'data:text/g..'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', '..g', 'data:text/..g'), + array('http://a/b/c/d;p?q', 'data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAwAAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFzByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSpa/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJlZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uisF81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PHhhx4dbgYKAAA7', 'data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAwAAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFzByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSpa/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJlZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uisF81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PHhhx4dbgYKAAA7'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', 'data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAwAAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFzByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSpa/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJlZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uisF81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PHhhx4dbgYKAAA7', 'data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAwAAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFzByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSpa/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJlZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uisF81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PHhhx4dbgYKAAA7'), + array('http://a/b/c/d;p?q', 'data:text/plain;charset=iso-8859-7,%be%fg%be', 'data:text/plain;charset=iso-8859-7,%be%fg%be'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', 'data:text/plain;charset=iso-8859-7,%be%fg%be', 'data:text/plain;charset=iso-8859-7,%be%fg%be'), + array('http://a/b/c/d;p?q', 'http://www.example.org/Dürst', 'http://www.example.org/Dürst'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', 'http://www.example.org/Dürst', 'http://www.example.org/Dürst'), + array('http://a/b/c/d;p?q', 'http://www.example.org/foo bar/qux<>?\^`{|}', 'http://www.example.org/foo bar/qux<>?\^`{|}'), + array('data:text/plain;charset=iso-8859-7,%be%fg%be', 'http://www.example.org/foo bar/qux<>?\^`{|}', 'http://www.example.org/foo bar/qux<>?\^`{|}'), + array('http://example.com/b;bar', ';foo', 'http://example.com/;foo'), + array('http://1.example.org/path1/file1.ext', 'http://2.example.org#frag2', 'http://2.example.org#frag2'), + array('http://example.org/a/b', '?x', 'http://example.org/a/b?x'), + array('http://example.org/foo/bar', 'http:test', 'http:test'), + array('http://www.example.com/#', 'hello, world', 'http://www.example.com/hello, world'), + array('http://www.example.com/#', '%c2%a9', 'http://www.example.com/%c2%a9'), + array('http://www.example.com/#', '%41%a', 'http://www.example.com/%41%a'), + array('http://www.example.com/#', 'asdf#qwer', 'http://www.example.com/asdf#qwer'), + array('http://www.example.com/#', '#asdf', 'http://www.example.com/#asdf'), + array('http://www.example.com/foo/bar', 'file:c:\\\\foo\\\\bar.html', 'file:c:\\\\foo\\\\bar.html'), + array('http://www.example.com/foo/bar', 'File:c|////foo\\\\bar.html', 'File:c|////foo\\\\bar.html'), + array('http://www.example.com/foo/bar', 'file:', 'file:'), + array('http://www.example.com/foo/bar', 'file:UNChost/path', 'file:UNChost/path'), + array('http://www.example.com/foo/bar', 'c:\\\\foo\\\\bar', 'c:\\\\foo\\\\bar'), + array('http://www.example.com/foo/bar', 'C|/foo/bar', 'http://www.example.com/foo/C|/foo/bar'), + array('http://www.example.com/foo/bar', '/C|\\\\foo\\\\bar', 'http://www.example.com/C|\\\\foo\\\\bar'), + array('http://www.example.com/foo/bar', '//C|/foo/bar', 'http://C|/foo/bar'), + array('http://www.example.com/foo/bar', '//server/file', 'http://server/file'), + array('http://www.example.com/foo/bar', '\\\\\\\\server\\\\file', 'http://www.example.com/foo/\\\\\\\\server\\\\file'), + array('http://www.example.com/foo/bar', '/\\\\server/file', 'http://www.example.com/\\\\server/file'), + array('http://www.example.com/foo/bar', 'file:c:foo/bar.html', 'file:c:foo/bar.html'), + array('http://www.example.com/foo/bar', 'file:/\\\\/\\\\C:\\\\\\\\//foo\\\\bar.html', 'file:/\\\\/\\\\C:\\\\\\\\//foo\\\\bar.html'), + array('http://www.example.com/foo/bar', 'file:///foo/bar.txt', 'file:///foo/bar.txt'), + array('http://www.example.com/foo/bar', 'FILE:/\\\\/\\\\7:\\\\\\\\//foo\\\\bar.html', 'FILE:/\\\\/\\\\7:\\\\\\\\//foo\\\\bar.html'), + array('http://www.example.com/foo/bar', 'file:filer/home\\\\me', 'file:filer/home\\\\me'), + array('http://www.example.com/foo/bar', 'file:///C:/foo/../../../bar.html', 'file:///bar.html'), + array('http://www.example.com/foo/bar', 'file:///C:/asdf#\\%c2', 'file:///C:/asdf#\\%c2'), + array('http://www.example.com/foo/bar', 'file:///home/me', 'file:///home/me'), + array('http://www.example.com/foo/bar', 'file:c:\\\\foo\\\\bar.html', 'file:c:\\\\foo\\\\bar.html'), + array('http://www.example.com/foo/bar', 'file:c|//foo\\\\bar.html', 'file:c|//foo\\\\bar.html'), + array('http://www.example.com/foo/bar', '//', 'http://'), + array('http://www.example.com/foo/bar', '///', 'http:///'), + array('http://www.example.com/foo/bar', '///test', 'http:///test'), + array('http://www.example.com/foo/bar', 'file://test', 'file://test'), + array('http://www.example.com/foo/bar', 'file://localhost/', 'file://localhost/'), + array('http://www.example.com/foo/bar', 'file://localhost/test', 'file://localhost/test'), + array('file:///tmp/mock/path', 'file:c:\\\\foo\\\\bar.html', 'file:c:\\\\foo\\\\bar.html'), + array('file:///tmp/mock/path', 'File:c|////foo\\\\bar.html', 'File:c|////foo\\\\bar.html'), + array('file:///tmp/mock/path', 'file:', 'file:'), + array('file:///tmp/mock/path', 'file:UNChost/path', 'file:UNChost/path'), + array('file:///tmp/mock/path', 'c:\\\\foo\\\\bar', 'c:\\\\foo\\\\bar'), + array('file:///tmp/mock/path', 'C|/foo/bar', 'file:///tmp/mock/C|/foo/bar'), + array('file:///tmp/mock/path', '/C|\\\\foo\\\\bar', 'file:///C|\\\\foo\\\\bar'), + array('file:///tmp/mock/path', '//C|/foo/bar', 'file://C|/foo/bar'), + array('file:///tmp/mock/path', '//server/file', 'file://server/file'), + array('file:///tmp/mock/path', '\\\\\\\\server\\\\file', 'file:///tmp/mock/\\\\\\\\server\\\\file'), + array('file:///tmp/mock/path', '/\\\\server/file', 'file:///\\\\server/file'), + array('file:///tmp/mock/path', 'file:c:foo/bar.html', 'file:c:foo/bar.html'), + array('file:///tmp/mock/path', 'file:/\\\\/\\\\C:\\\\\\\\//foo\\\\bar.html', 'file:/\\\\/\\\\C:\\\\\\\\//foo\\\\bar.html'), + array('file:///tmp/mock/path', 'file:///foo/bar.txt', 'file:///foo/bar.txt'), + array('file:///tmp/mock/path', 'FILE:/\\\\/\\\\7:\\\\\\\\//foo\\\\bar.html', 'FILE:/\\\\/\\\\7:\\\\\\\\//foo\\\\bar.html'), + array('file:///tmp/mock/path', 'file:filer/home\\\\me', 'file:filer/home\\\\me'), + array('file:///tmp/mock/path', 'file:///C:/foo/../../../bar.html', 'file:///bar.html'), + array('file:///tmp/mock/path', 'file:///C:/asdf#\\%c2', 'file:///C:/asdf#\\%c2'), + array('file:///tmp/mock/path', 'file:///home/me', 'file:///home/me'), + array('file:///tmp/mock/path', 'file:c:\\\\foo\\\\bar.html', 'file:c:\\\\foo\\\\bar.html'), + array('file:///tmp/mock/path', 'file:c|//foo\\\\bar.html', 'file:c|//foo\\\\bar.html'), + array('file:///tmp/mock/path', '//', 'file://'), + array('file:///tmp/mock/path', '///', 'file:///'), + array('file:///tmp/mock/path', '///test', 'file:///test'), + array('file:///tmp/mock/path', 'file://test', 'file://test'), + array('file:///tmp/mock/path', 'file://localhost/', 'file://localhost/'), + array('file:///tmp/mock/path', 'file://localhost/test', 'file://localhost/test'), + array('http://', 'GoOgLe.CoM', 'http:///GoOgLe.CoM'), + array('http://', 'Goo%20 goo%7C|.com', 'http:///Goo%20 goo%7C|.com'), + array('http://', '%ef%b7%90zyx.com', 'http:///%ef%b7%90zyx.com'), + array('http://', '%ef%bc%85%ef%bc%94%ef%bc%91.com', 'http:///%ef%bc%85%ef%bc%94%ef%bc%91.com'), + array('http://', '%ef%bc%85%ef%bc%90%ef%bc%90.com', 'http:///%ef%bc%85%ef%bc%90%ef%bc%90.com'), + array('http://', '%zz%66%a', 'http:///%zz%66%a'), + array('http://', '%25', 'http:///%25'), + array('http://', 'hello%00', 'http:///hello%00'), + array('http://', '%30%78%63%30%2e%30%32%35%30.01', 'http:///%30%78%63%30%2e%30%32%35%30.01'), + array('http://', '%30%78%63%30%2e%30%32%35%30.01%2e', 'http:///%30%78%63%30%2e%30%32%35%30.01%2e'), + array('http://', '%3g%78%63%30%2e%30%32%35%30%2E.01', 'http:///%3g%78%63%30%2e%30%32%35%30%2E.01'), + array('http://', '192.168.0.1 hello', 'http:///192.168.0.1 hello'), + array('http://', '192.168.0.257', 'http:///192.168.0.257'), + array('http://', '[google.com]', 'http:///[google.com]'), + array('http://', 'go\\@ogle.com', 'http:///go\\@ogle.com'), + array('http://', 'go/@ogle.com', 'http:///go/@ogle.com'), + array('http://', 'www.lookout.net::==80::==443::', 'www.lookout.net::==80::==443::'), + array('http://', 'www.lookout.net::80::443', 'www.lookout.net::80::443'), + array('http://', '\\\\', 'http:///\\\\'), + array('http://', '\\\\\\/', 'http:///\\\\\\/'), + array('http://', '\\\\./', 'http:///\\\\./'), + array('http://', '//:@/', 'http://:@/'), + array('http://', '\\google.com/foo', 'http:///\\google.com/foo'), + array('http://', '\\\\google.com/foo', 'http:///\\\\google.com/foo'), + array('http://', '//asdf@/', 'http://asdf@/'), + array('http://', '//:81', 'http://:81'), + array('http://', '://', 'http:///://'), + array('http://', 'c:', 'c:'), + array('http://', 'xxxx:', 'xxxx:'), + array('http://', '.:.', '.:'), + array('http://', '////@google.com/', 'http:////@google.com/'), + array('http://', '@google.com', 'http:///@google.com'), + array('http://', 'gOoGle.com', 'http:///gOoGle.com'), + array('http://', '-foo.bar.com', 'http:///-foo.bar.com'), + array('http://', 'foo-.bar.com', 'http:///foo-.bar.com'), + array('http://', 'ab--cd.com', 'http:///ab--cd.com'), + array('http://', 'xn--0.com', 'http:///xn--0.com'), + array('http://', '.', 'http:///'), + array('http://', '192.168.0.1', 'http:///192.168.0.1'), + array('http://', '0300.0250.00.01', 'http:///0300.0250.00.01'), + array('http://', '0xC0.0Xa8.0x0.0x1', 'http:///0xC0.0Xa8.0x0.0x1'), + array('http://', '192.168.9.com', 'http:///192.168.9.com'), + array('http://', '19a.168.0.1', 'http:///19a.168.0.1'), + array('http://', '0308.0250.00.01', 'http:///0308.0250.00.01'), + array('http://', '0xCG.0xA8.0x0.0x1', 'http:///0xCG.0xA8.0x0.0x1'), + array('http://', '192', 'http:///192'), + array('http://', '0xC0a80001', 'http:///0xC0a80001'), + array('http://', '030052000001', 'http:///030052000001'), + array('http://', '000030052000001', 'http:///000030052000001'), + array('http://', '192.168', 'http:///192.168'), + array('http://', '192.0x00A80001', 'http:///192.0x00A80001'), + array('http://', '0xc0.052000001', 'http:///0xc0.052000001'), + array('http://', '192.168.1', 'http:///192.168.1'), + array('http://', '192.168.0.0.1', 'http:///192.168.0.0.1'), + array('http://', '192.168.0.1.', 'http:///192.168.0.1.'), + array('http://', '192.168.0.1. hello', 'http:///192.168.0.1. hello'), + array('http://', '192.168.0.1..', 'http:///192.168.0.1..'), + array('http://', '192.168..1', 'http:///192.168..1'), + array('http://', '0x100.0', 'http:///0x100.0'), + array('http://', '0x100.0.0', 'http:///0x100.0.0'), + array('http://', '0x100.0.0.0', 'http:///0x100.0.0.0'), + array('http://', '0.0x100.0.0', 'http:///0.0x100.0.0'), + array('http://', '0.0.0x100.0', 'http:///0.0.0x100.0'), + array('http://', '0.0.0.0x100', 'http:///0.0.0.0x100'), + array('http://', '0.0.0x10000', 'http:///0.0.0x10000'), + array('http://', '0.0x1000000', 'http:///0.0x1000000'), + array('http://', '0x100000000', 'http:///0x100000000'), + array('http://', '0xFF.0', 'http:///0xFF.0'), + array('http://', '0xFF.0.0', 'http:///0xFF.0.0'), + array('http://', '0xFF.0.0.0', 'http:///0xFF.0.0.0'), + array('http://', '0.0xFF.0.0', 'http:///0.0xFF.0.0'), + array('http://', '0.0.0xFF.0', 'http:///0.0.0xFF.0'), + array('http://', '0.0.0.0xFF', 'http:///0.0.0.0xFF'), + array('http://', '0.0.0xFFFF', 'http:///0.0.0xFFFF'), + array('http://', '0.0xFFFFFF', 'http:///0.0xFFFFFF'), + array('http://', '0xFFFFFFFF', 'http:///0xFFFFFFFF'), + array('http://', '276.256.0xf1a2.077777', 'http:///276.256.0xf1a2.077777'), + array('http://', '192.168.0.257', 'http:///192.168.0.257'), + array('http://', '192.168.0xa20001', 'http:///192.168.0xa20001'), + array('http://', '192.015052000001', 'http:///192.015052000001'), + array('http://', '0X12C0a80001', 'http:///0X12C0a80001'), + array('http://', '276.1.2', 'http:///276.1.2'), + array('http://', '192.168.0.1 hello', 'http:///192.168.0.1 hello'), + array('http://', '0000000000000300.0x00000000000000fF.00000000000000001', 'http:///0000000000000300.0x00000000000000fF.00000000000000001'), + array('http://', '0000000000000300.0xffffffffFFFFFFFF.3022415481470977', 'http:///0000000000000300.0xffffffffFFFFFFFF.3022415481470977'), + array('http://', '00000000000000000001', 'http:///00000000000000000001'), + array('http://', '0000000000000000100000000000000001', 'http:///0000000000000000100000000000000001'), + array('http://', '0.0.0.000000000000000000z', 'http:///0.0.0.000000000000000000z'), + array('http://', '0.0.0.100000000000000000z', 'http:///0.0.0.100000000000000000z'), + array('http://', '0.00.0x.0x0', 'http:///0.00.0x.0x0'), + array('http://', '[', 'http:///['), + array('http://', '[:', '[:'), + array('http://', ']', 'http:///]'), + array('http://', ':]', 'http:///:]'), + array('http://', '[]', 'http:///[]'), + array('http://', '[:]', '[:]'), + array('http://', '2001:db8::1', '2001:db8::1'), + array('http://', '[2001:db8::1', '[2001:db8::1'), + array('http://', '2001:db8::1]', '2001:db8::1]'), + array('http://', '[::]', '[::]'), + array('http://', '[::1]', '[::1]'), + array('http://', '[1::]', '[1::]'), + array('http://', '[::192.168.0.1]', '[::192.168.0.1]'), + array('http://', '[::ffff:192.168.0.1]', '[::ffff:192.168.0.1]'), + array('http://', '[000:01:02:003:004:5:6:007]', '[000:01:02:003:004:5:6:007]'), + array('http://', '[A:b:c:DE:fF:0:1:aC]', '[A:b:c:DE:fF:0:1:aC]'), + array('http://', '[1:0:0:2::3:0]', '[1:0:0:2::3:0]'), + array('http://', '[1::2:0:0:3:0]', '[1::2:0:0:3:0]'), + array('http://', '[::eeee:192.168.0.1]', '[::eeee:192.168.0.1]'), + array('http://', '[2001::192.168.0.1]', '[2001::192.168.0.1]'), + array('http://', '[1:2:192.168.0.1:5:6]', '[1:2:192.168.0.1:5:6]'), + array('http://', '[::ffff:192.1.2]', '[::ffff:192.1.2]'), + array('http://', '[::ffff:0xC0.0Xa8.0x0.0x1]', '[::ffff:0xC0.0Xa8.0x0.0x1]'), + array('http://', '[0:0::0:0:8]', '[0:0::0:0:8]'), + array('http://', '[2001:db8::1]', '[2001:db8::1]'), + array('http://', '[2001::db8::1]', '[2001::db8::1]'), + array('http://', '[2001:db8:::1]', '[2001:db8:::1]'), + array('http://', '[:::]', '[:::]'), + array('http://', '[2001::.com]', '[2001::.com]'), + array('http://', '[::192.168.0.0.1]', '[::192.168.0.0.1]'), + array('http://', '[::ffff:192.168.0.0.1]', '[::ffff:192.168.0.0.1]'), + array('http://', '[1:2:3:4:5:6:7:8:9]', '[1:2:3:4:5:6:7:8:9]'), + array('http://', '[0:0:0:0:0:0:0:192.168.0.1]', '[0:0:0:0:0:0:0:192.168.0.1]'), + array('http://', '[1:2:3:4:5:6::192.168.0.1]', '[1:2:3:4:5:6::192.168.0.1]'), + array('http://', '[1:2:3:4:5:6::8]', '[1:2:3:4:5:6::8]'), + array('http://', '[1:2:3:4:5:6:7:8:]', '[1:2:3:4:5:6:7:8:]'), + array('http://', '[1:2:3:4:5:6:192.168.0.1:]', '[1:2:3:4:5:6:192.168.0.1:]'), + array('http://', '[-1:2:3:4:5:6:7:8]', '[-1:2:3:4:5:6:7:8]'), + array('http://', '[1::%1]', '[1::%1]'), + array('http://', '[1::%eth0]', '[1::%eth0]'), + array('http://', '[1::%]', '[1::%]'), + array('http://', '[%]', 'http:///[%]'), + array('http://', '[::%:]', '[::%:]'), + array('http://', '[:0:0::0:0:8]', '[:0:0::0:0:8]'), + array('http://', '[0:0::0:0:8:]', '[0:0::0:0:8:]'), + array('http://', '[:0:0::0:0:8:]', '[:0:0::0:0:8:]'), + array('http://', '[::192.168..1]', '[::192.168..1]'), + array('http://', '[::1 hello]', '[::1 hello]'), + array('mailto:', 'addr1', 'mailto:addr1'), + array('mailto:', 'addr1@foo.com', 'mailto:addr1@foo.com'), + array('mailto:', 'addr1 \\t', 'mailto:addr1 \\t'), + array('mailto:', 'addr1?to=jon', 'mailto:addr1?to=jon'), + array('mailto:', 'addr1,addr2', 'mailto:addr1,addr2'), + array('mailto:', 'addr1, addr2', 'mailto:addr1, addr2'), + array('mailto:', 'addr1%2caddr2', 'mailto:addr1%2caddr2'), + array('mailto:', 'addr1?', 'mailto:addr1?'), + array('http://www.example.com', '/././foo', 'http://www.example.com/foo'), + array('http://www.example.com', '/./.foo', 'http://www.example.com/.foo'), + array('http://www.example.com', '/foo/.', 'http://www.example.com/foo/'), + array('http://www.example.com', '/foo/./', 'http://www.example.com/foo/'), + array('http://www.example.com', '/foo/bar/..', 'http://www.example.com/foo/'), + array('http://www.example.com', '/foo/bar/../', 'http://www.example.com/foo/'), + array('http://www.example.com', '/foo/..bar', 'http://www.example.com/foo/..bar'), + array('http://www.example.com', '/foo/bar/../ton', 'http://www.example.com/foo/ton'), + array('http://www.example.com', '/foo/bar/../ton/../../a', 'http://www.example.com/a'), + array('http://www.example.com', '/foo/../../..', 'http://www.example.com/'), + array('http://www.example.com', '/foo/../../../ton', 'http://www.example.com/ton'), + array('http://www.example.com', '/foo/%2e', 'http://www.example.com/foo/%2e'), + array('http://www.example.com', '/foo/%2e%2', 'http://www.example.com/foo/%2e%2'), + array('http://www.example.com', '/foo/%2e./%2e%2e/.%2e/%2e.bar', 'http://www.example.com/foo/%2e./%2e%2e/.%2e/%2e.bar'), + array('http://www.example.com', '////../..', 'http:///'), + array('http://www.example.com', '/foo/bar//../..', 'http://www.example.com/foo/'), + array('http://www.example.com', '/foo/bar//..', 'http://www.example.com/foo/bar/'), + array('http://www.example.com', '/foo/bar/..', 'http://www.example.com/foo/'), + array('http://www.example.com', '/foo', 'http://www.example.com/foo'), + array('http://www.example.com', '/%20foo', 'http://www.example.com/%20foo'), + array('http://www.example.com', '/foo%', 'http://www.example.com/foo%'), + array('http://www.example.com', '/foo%2', 'http://www.example.com/foo%2'), + array('http://www.example.com', '/foo%2zbar', 'http://www.example.com/foo%2zbar'), + array('http://www.example.com', '/foo%41%7a', 'http://www.example.com/foo%41%7a'), + array('http://www.example.com', '/foo%00%51', 'http://www.example.com/foo%00%51'), + array('http://www.example.com', '/(%28:%3A%29)', 'http://www.example.com/(%28:%3A%29)'), + array('http://www.example.com', '/%3A%3a%3C%3c', 'http://www.example.com/%3A%3a%3C%3c'), + array('http://www.example.com', '/foo\\tbar', 'http://www.example.com/foo\\tbar'), + array('http://www.example.com', '\\\\foo\\\\bar', 'http://www.example.com/\\\\foo\\\\bar'), + array('http://www.example.com', '/%7Ffp3%3Eju%3Dduvgw%3Dd', 'http://www.example.com/%7Ffp3%3Eju%3Dduvgw%3Dd'), + array('http://www.example.com', '/@asdf%40', 'http://www.example.com/@asdf%40'), + array('http://www.example.com:', 'as df', 'http://www.example.com:/as df'), + array('http://www.example.com:', '-2', 'http://www.example.com:/-2'), + array('http://www.example.com:', '80', 'http://www.example.com:/80'), + array('http://www.example.com:', '8080', 'http://www.example.com:/8080'), + array('http://www.example.com:', '', 'http://www.example.com:'), + array('http://www.example.com/?', 'foo=bar', 'http://www.example.com/foo=bar'), + array('http://www.example.com/?', 'as?df', 'http://www.example.com/as?df'), + array('http://www.example.com/?', '\\%02hello%7f bye', 'http://www.example.com/\\%02hello%7f bye'), + array('http://www.example.com/?', '%40%41123', 'http://www.example.com/%40%41123'), + array('http://www.example.com/?', 'q=<asdf>', 'http://www.example.com/q=<asdf>'), + array('http://www.example.com/?', 'q=\\"asdf\\"', 'http://www.example.com/q=\\"asdf\\"'), + array('http://host/a', '\\\\\\\\Another\\\\path', 'http://host/\\\\\\\\Another\\\\path'), + array('http://host/a', '/c:\\\\foo', 'http://host/c:\\\\foo'), + array('http://host/a', '//c:\\\\foo', 'http://c:\\\\foo'), + array('file:///C:/foo', 'http://host/', 'http://host/'), + array('file:///C:/foo', 'bar', 'file:///C:/bar'), + array('file:///C:/foo', '../../../bar.html', 'file:///bar.html'), + array('file:///C:/foo', '/../bar.html', 'file:///bar.html'), + array('http://host/a', '\\\\\\\\another\\\\path', 'http://host/\\\\\\\\another\\\\path'), + array('file:///C:/something', '//c:/foo', 'file://c:/foo'), + array('file:///C:/something', '//localhost/c:/foo', 'file://localhost/c:/foo'), + array('file:///C:/foo', 'c:', 'c:'), + array('file:///C:/foo', 'c:/foo', 'c:/foo'), + array('http://host/a', 'c:\\\\foo', 'c:\\\\foo'), + array('file:///C:/foo', '/z:/bar', 'file:///z:/bar'), + array('file:///C:/foo', '/bar', 'file:///bar'), + array('file://localhost/C:/foo', '/bar', 'file://localhost/bar'), + array('file:///C:/foo/com/', '/bar', 'file:///bar'), + array('file:///C:/something', '//somehost/path', 'file://somehost/path'), + array('file:///C:/something', '/\\\\//somehost/path', 'file:///\\\\//somehost/path'), + array('http://host/a', 'http://another/', 'http://another/'), + array('http://host/a', 'http:////another/', 'http:////another/'), + array('http://foo/bar', '', 'http://foo/bar'), + array('http://foo/bar#ref', '', 'http://foo/bar'), + array('http://foo/bar#', '', 'http://foo/bar'), + array('http://foo/bar', ' another ', 'http://foo/ another '), + array('http://foo/bar', ' . ', 'http://foo/ . '), + array('http://foo/bar', ' \\t', 'http://foo/ \\t'), + array('http://host/a', 'http:path', 'http:path'), + array('http://host/a/', 'http:path', 'http:path'), + array('http://host/a', 'http:/path', 'http:/path'), + array('http://host/a', 'HTTP:/path', 'HTTP:/path'), + array('http://host/a', 'https:host2', 'https:host2'), + array('http://host/a', 'htto:/host2', 'htto:/host2'), + array('http://host/a', '/b/c/d', 'http://host/b/c/d'), + array('http://host/a', '\\\\b\\\\c\\\\d', 'http://host/\\\\b\\\\c\\\\d'), + array('http://host/a', '/b/../c', 'http://host/c'), + array('http://host/a?b#c', '/b/../c', 'http://host/c'), + array('http://host/a', '\\\\b/../c?x#y', 'http://host/c?x#y'), + array('http://host/a?b#c', '/b/../c?x#y', 'http://host/c?x#y'), + array('http://host/a', 'b', 'http://host/b'), + array('http://host/a', 'bc/de', 'http://host/bc/de'), + array('http://host/a/', 'bc/de?query#ref', 'http://host/a/bc/de?query#ref'), + array('http://host/a/', '.', 'http://host/a/'), + array('http://host/a/', '..', 'http://host/'), + array('http://host/a/', './..', 'http://host/'), + array('http://host/a/', '../.', 'http://host/'), + array('http://host/a/', '././.', 'http://host/a/'), + array('http://host/a?query#ref', '../../../foo', 'http://host/foo'), + array('http://host/a', '?foo=bar', 'http://host/a?foo=bar'), + array('http://host/a?x=y#z', '?', 'http://host/a?'), + array('http://host/a?x=y#z', '?foo=bar#com', 'http://host/a?foo=bar#com'), + array('http://host/a', '#ref', 'http://host/a#ref'), + array('http://host/a#b', '#', 'http://host/a#'), + array('http://host/a?foo=bar#hello', '#bye', 'http://host/a?foo=bar#bye'), + array('data:foobar', 'baz.html', 'data:baz.html'), + array('data:foobar', 'data:baz', 'data:baz'), + array('data:foobar', 'data:/base', 'data:/base'), + array('data:foobar', 'http://host/', 'http://host/'), + array('data:foobar', 'http:host', 'http:host'), + array('http://foo/bar', './asd:fgh', 'http://foo/asd:fgh'), + array('http://foo/bar', ':foo', 'http://foo/:foo'), + array('http://foo/bar', ' hello world', 'http://foo/ hello world'), + array('data:asdf', ':foo', 'data::foo'), + array('http://host/a', ';foo', 'http://host/;foo'), + array('http://host/a;', ';foo', 'http://host/;foo'), + array('http://host/a', ';/../bar', 'http://host/bar'), + array('http://host/a', '//another', 'http://another'), + array('http://host/a', '//another/path?query#ref', 'http://another/path?query#ref'), + array('http://host/a', '///another/path', 'http:///another/path'), + array('http://host/a', '//Another\\\\path', 'http://Another\\\\path'), + array('http://host/a', '//', 'http://'), + array('http://host/a', '\\\\/another/path', 'http://host/\\\\/another/path'), + array('http://host/a', '/\\\\Another\\\\path', 'http://host/\\\\Another\\\\path'), + array('data:text/plain,baseURL', 'http://user:pass@foo:21/bar;par?b#c', 'http://user:pass@foo:21/bar;par?b#c'), + array('data:text/plain,baseURL', 'http:foo.com', 'http:foo.com'), + array('data:text/plain,baseURL', ' foo.com ', 'data:text/ foo.com '), + array('data:text/plain,baseURL', 'http://f:21/ b ? d # e ', 'http://f:21/ b ? d # e '), + array('data:text/plain,baseURL', 'http://f:/c', 'http://f:/c'), + array('data:text/plain,baseURL', 'http://f:0/c', 'http://f:0/c'), + array('data:text/plain,baseURL', 'http://f:00000000000000/c', 'http://f:00000000000000/c'), + array('data:text/plain,baseURL', 'http://f:00000000000000000000080/c', 'http://f:00000000000000000000080/c'), + array('data:text/plain,baseURL', 'http://f:b/c', 'http://f:b/c'), + array('data:text/plain,baseURL', 'http://f: /c', 'http://f: /c'), + array('data:text/plain,baseURL', 'http://f:fifty-two/c', 'http://f:fifty-two/c'), + array('data:text/plain,baseURL', 'http://f:999999/c', 'http://f:999999/c'), + array('data:text/plain,baseURL', 'http://f: 21 / b ? d # e ', 'http://f: 21 / b ? d # e '), + array('data:text/plain,baseURL', '', 'data:text/plain,baseURL'), + array('data:text/plain,baseURL', ':foo.com/', 'data:text/:foo.com/'), + array('data:text/plain,baseURL', ':foo.com\\\\', 'data:text/:foo.com\\\\'), + array('data:text/plain,baseURL', ':', 'data:text/:'), + array('data:text/plain,baseURL', ':a', 'data:text/:a'), + array('data:text/plain,baseURL', ':/', 'data:text/:/'), + array('data:text/plain,baseURL', ':\\\\', 'data:text/:\\\\'), + array('data:text/plain,baseURL', ':#', 'data:text/:#'), + array('data:text/plain,baseURL', '#', 'data:text/plain,baseURL#'), + array('data:text/plain,baseURL', '#/', 'data:text/plain,baseURL#/'), + array('data:text/plain,baseURL', '#\\\\', 'data:text/plain,baseURL#\\\\'), + array('data:text/plain,baseURL', '#;?', 'data:text/plain,baseURL#;?'), + array('data:text/plain,baseURL', '?', 'data:text/plain,baseURL?'), + array('data:text/plain,baseURL', '/', 'data:/'), + array('data:text/plain,baseURL', ':23', 'data:text/:23'), + array('data:text/plain,baseURL', '/:23', 'data:/:23'), + array('data:text/plain,baseURL', '//', 'data://'), + array('data:text/plain,baseURL', '::', 'data:text/::'), + array('data:text/plain,baseURL', '::23', 'data:text/::23'), + array('data:text/plain,baseURL', 'foo://', 'foo://'), + array('data:text/plain,baseURL', 'http://a:b@c:29/d', 'http://a:b@c:29/d'), + array('data:text/plain,baseURL', 'http::@c:29', 'http::@c:29'), + array('data:text/plain,baseURL', 'http://&a:foo(b]c@d:2/', 'http://&a:foo(b]c@d:2/'), + array('data:text/plain,baseURL', 'http://::@c@d:2', 'http://::@c@d:2'), + array('data:text/plain,baseURL', 'http://foo.com:b@d/', 'http://foo.com:b@d/'), + array('data:text/plain,baseURL', 'http://foo.com/\\\\@', 'http://foo.com/\\\\@'), + array('data:text/plain,baseURL', 'http:\\\\\\\\foo.com\\\\', 'http:\\\\\\\\foo.com\\\\'), + array('data:text/plain,baseURL', 'http:\\\\\\\\a\\\\b:c\\\\d@foo.com\\\\', 'http:\\\\\\\\a\\\\b:c\\\\d@foo.com\\\\'), + array('data:text/plain,baseURL', 'foo:/', 'foo:/'), + array('data:text/plain,baseURL', 'foo:/bar.com/', 'foo:/bar.com/'), + array('data:text/plain,baseURL', 'foo://///////', 'foo://///////'), + array('data:text/plain,baseURL', 'foo://///////bar.com/', 'foo://///////bar.com/'), + array('data:text/plain,baseURL', 'foo:////://///', 'foo:////://///'), + array('data:text/plain,baseURL', 'c:/foo', 'c:/foo'), + array('data:text/plain,baseURL', '//foo/bar', 'data://foo/bar'), + array('data:text/plain,baseURL', 'http://foo/path;a??e#f#g', 'http://foo/path;a??e#f#g'), + array('data:text/plain,baseURL', 'http://foo/abcd?efgh?ijkl', 'http://foo/abcd?efgh?ijkl'), + array('data:text/plain,baseURL', 'http://foo/abcd#foo?bar', 'http://foo/abcd#foo?bar'), + array('data:text/plain,baseURL', '[61:24:74]:98', '[61:24:74]:98'), + array('data:text/plain,baseURL', 'http://[61:27]:98', 'http://[61:27]:98'), + array('data:text/plain,baseURL', 'http:[61:27]/:foo', 'http:[61:27]/:foo'), + array('data:text/plain,baseURL', 'http://[1::2]:3:4', 'http://[1::2]:3:4'), + array('data:text/plain,baseURL', 'http://2001::1', 'http://2001::1'), + array('data:text/plain,baseURL', 'http://[2001::1', 'http://[2001::1'), + array('data:text/plain,baseURL', 'http://2001::1]', 'http://2001::1]'), + array('data:text/plain,baseURL', 'http://2001::1]:80', 'http://2001::1]:80'), + array('data:text/plain,baseURL', 'http://[2001::1]', 'http://[2001::1]'), + array('data:text/plain,baseURL', 'http://[2001::1]:80', 'http://[2001::1]:80'), + array('data:text/plain,baseURL', 'http://[[::]]', 'http://[[::]]'), + array('http://www.example.com/foo/bar', 'http://user:pass@foo:21/bar;par?b#c', 'http://user:pass@foo:21/bar;par?b#c'), + array('http://www.example.com/foo/bar', 'http:foo.com', 'http:foo.com'), + array('http://www.example.com/foo/bar', ' foo.com ', 'http://www.example.com/foo/ foo.com '), + array('http://www.example.com/foo/bar', 'http://f:21/ b ? d # e ', 'http://f:21/ b ? d # e '), + array('http://www.example.com/foo/bar', 'http://f:/c', 'http://f:/c'), + array('http://www.example.com/foo/bar', 'http://f:0/c', 'http://f:0/c'), + array('http://www.example.com/foo/bar', 'http://f:00000000000000/c', 'http://f:00000000000000/c'), + array('http://www.example.com/foo/bar', 'http://f:00000000000000000000080/c', 'http://f:00000000000000000000080/c'), + array('http://www.example.com/foo/bar', 'http://f:b/c', 'http://f:b/c'), + array('http://www.example.com/foo/bar', 'http://f: /c', 'http://f: /c'), + array('http://www.example.com/foo/bar', 'http://f:fifty-two/c', 'http://f:fifty-two/c'), + array('http://www.example.com/foo/bar', 'http://f:999999/c', 'http://f:999999/c'), + array('http://www.example.com/foo/bar', 'http://f: 21 / b ? d # e ', 'http://f: 21 / b ? d # e '), + array('http://www.example.com/foo/bar', '', 'http://www.example.com/foo/bar'), + array('http://www.example.com/foo/bar', ':foo.com/', 'http://www.example.com/foo/:foo.com/'), + array('http://www.example.com/foo/bar', ':foo.com\\\\', 'http://www.example.com/foo/:foo.com\\\\'), + array('http://www.example.com/foo/bar', ':', 'http://www.example.com/foo/:'), + array('http://www.example.com/foo/bar', ':a', 'http://www.example.com/foo/:a'), + array('http://www.example.com/foo/bar', ':/', 'http://www.example.com/foo/:/'), + array('http://www.example.com/foo/bar', ':\\\\', 'http://www.example.com/foo/:\\\\'), + array('http://www.example.com/foo/bar', ':#', 'http://www.example.com/foo/:#'), + array('http://www.example.com/foo/bar', '#', 'http://www.example.com/foo/bar#'), + array('http://www.example.com/foo/bar', '#/', 'http://www.example.com/foo/bar#/'), + array('http://www.example.com/foo/bar', '#\\\\', 'http://www.example.com/foo/bar#\\\\'), + array('http://www.example.com/foo/bar', '#;?', 'http://www.example.com/foo/bar#;?'), + array('http://www.example.com/foo/bar', '?', 'http://www.example.com/foo/bar?'), + array('http://www.example.com/foo/bar', '/', 'http://www.example.com/'), + array('http://www.example.com/foo/bar', ':23', 'http://www.example.com/foo/:23'), + array('http://www.example.com/foo/bar', '/:23', 'http://www.example.com/:23'), + array('http://www.example.com/foo/bar', '//', 'http://'), + array('http://www.example.com/foo/bar', '::', 'http://www.example.com/foo/::'), + array('http://www.example.com/foo/bar', '::23', 'http://www.example.com/foo/::23'), + array('http://www.example.com/foo/bar', 'foo://', 'foo://'), + array('http://www.example.com/foo/bar', 'http://a:b@c:29/d', 'http://a:b@c:29/d'), + array('http://www.example.com/foo/bar', 'http::@c:29', 'http::@c:29'), + array('http://www.example.com/foo/bar', 'http://&a:foo(b]c@d:2/', 'http://&a:foo(b]c@d:2/'), + array('http://www.example.com/foo/bar', 'http://::@c@d:2', 'http://::@c@d:2'), + array('http://www.example.com/foo/bar', 'http://foo.com:b@d/', 'http://foo.com:b@d/'), + array('http://www.example.com/foo/bar', 'http://foo.com/\\\\@', 'http://foo.com/\\\\@'), + array('http://www.example.com/foo/bar', 'http:\\\\\\\\foo.com\\\\', 'http:\\\\\\\\foo.com\\\\'), + array('http://www.example.com/foo/bar', 'http:\\\\\\\\a\\\\b:c\\\\d@foo.com\\\\', 'http:\\\\\\\\a\\\\b:c\\\\d@foo.com\\\\'), + array('http://www.example.com/foo/bar', 'foo:/', 'foo:/'), + array('http://www.example.com/foo/bar', 'foo:/bar.com/', 'foo:/bar.com/'), + array('http://www.example.com/foo/bar', 'foo://///////', 'foo://///////'), + array('http://www.example.com/foo/bar', 'foo://///////bar.com/', 'foo://///////bar.com/'), + array('http://www.example.com/foo/bar', 'foo:////://///', 'foo:////://///'), + array('http://www.example.com/foo/bar', 'c:/foo', 'c:/foo'), + array('http://www.example.com/foo/bar', '//foo/bar', 'http://foo/bar'), + array('http://www.example.com/foo/bar', 'http://foo/path;a??e#f#g', 'http://foo/path;a??e#f#g'), + array('http://www.example.com/foo/bar', 'http://foo/abcd?efgh?ijkl', 'http://foo/abcd?efgh?ijkl'), + array('http://www.example.com/foo/bar', 'http://foo/abcd#foo?bar', 'http://foo/abcd#foo?bar'), + array('http://www.example.com/foo/bar', '[61:24:74]:98', '[61:24:74]:98'), + array('http://www.example.com/foo/bar', 'http://[61:27]:98', 'http://[61:27]:98'), + array('http://www.example.com/foo/bar', 'http:[61:27]/:foo', 'http:[61:27]/:foo'), + array('http://www.example.com/foo/bar', 'http://[1::2]:3:4', 'http://[1::2]:3:4'), + array('http://www.example.com/foo/bar', 'http://2001::1', 'http://2001::1'), + array('http://www.example.com/foo/bar', 'http://[2001::1', 'http://[2001::1'), + array('http://www.example.com/foo/bar', 'http://2001::1]', 'http://2001::1]'), + array('http://www.example.com/foo/bar', 'http://2001::1]:80', 'http://2001::1]:80'), + array('http://www.example.com/foo/bar', 'http://[2001::1]', 'http://[2001::1]'), + array('http://www.example.com/foo/bar', 'http://[2001::1]:80', 'http://[2001::1]:80'), + array('http://www.example.com/foo/bar', 'http://[[::]]', 'http://[[::]]'), + array('http://example.org/foo/bar', 'http://example.com/', 'http://example.com/'), + array('http://example.org/foo/bar', 'http://example.com/', 'http://example.com/'), + array('http://example.org/foo/bar', '/', 'http://example.org/'), + array('http://iris.test.ing/', '?value= foo bar', 'http://iris.test.ing/?value= foo bar'), + array('http://user%40', 'example.com', 'http://user%40/example.com'), + array('http://user%3Ainfo%40', 'example.com', 'http://user%3Ainfo%40/example.com'), + array('http://user@', 'example.com', 'http://user@/example.com'), + array('http://user:info@', 'example.com', 'http://user:info@/example.com') + ); + } + + /** + * Test conversion to relative IRI reference + * + * @param string $iri The reference IRI to convert to a + * relative reference. + * @param string $base The base IRI. + * @param bool $schemaRelative Should schema-relative IRIs be created? + * @param string $expected The expected IRI reference. + * + * @dataProvider relativizeProvider + */ + public function testRelativize($iri, $base, $schemaRelative, $expected) + { + $iri = new IRI($iri); + $this->assertEquals($expected, (string)$iri->relativeTo($base, $schemaRelative)); + + $base = new IRI($base); + $this->assertEquals($expected, (string)$base->baseFor((string)$iri, $schemaRelative)); + } + + /** + * Conversion to relative IRI reference test cases + * + * These test cases are adaptations of the tests in + * {@link http://dig.csail.mit.edu/2005/ajar/ajaw/test/uri-test-doc.html}. + * + * @return array The test cases. + */ + public function relativizeProvider() + { + return array( // $iri, $base, $schemaRelative, $expected + array('http://ex/x/y/z', 'http://ex/x/y/z', false, 'z'), + array('https://example.com/x/y/z', 'http://example.com/x/y/z', false, 'https://example.com/x/y/z'), + array('http://example.com/x/y/z/', 'http://example.com/x/y/z/', false, './'), + array('http://example.com/x/y/z/?query', 'http://example.com/x/y/z/', false, '?query'), + array('http://example.com/x/y/z/#fragment', 'http://example.com/x/y/z/', false, '#fragment'), + array('http://example.com/x/y/z', 'http://example.com/x/y/z', false, 'z'), + array('http://example.com/x/y/z?query', 'http://example.com/x/y/z', false, '?query'), + array('http://example.com/x/y/z#fragment', 'http://example.com/x/y/z', false, '#fragment'), + array('http://example.com/x/y/z:a', 'http://example.com/x/y/', false, './z:a'), + array('http://example.com/x/y/z', 'http://example.com/x/y', false, 'y/z'), + array('http://example.com/x/y/z', 'http://example.com/a/b/c', false, '../../x/y/z'), + array('http://example.com/x/y/z?query', 'http://example.com/a/b/c', false, '../../x/y/z?query'), + array('http://example.com/x/y/z#fragment', 'http://example.com/a/b/c', false, '../../x/y/z#fragment'), + array('http://example.com/x/y/z?query#fragment', 'http://example.com/a/b/c', false, '../../x/y/z?query#fragment'), + array('http://example.org/x/y/z', 'http://example.com/a/b/c', false, 'http://example.org/x/y/z'), + array('http://example.org/x/y/z', 'http://example.com/a/b/c', true, '//example.org/x/y/z'), + array('http://example/x/abc', 'http://example/x/y/z', false, '../abc'), + array('file:/ex/x/q/r#s', 'file:/ex/x/y', false, 'q/r#s'), + array('http://ex/x/y', null, false, 'http://ex/x/y'), + array('http://example.com/a', 'http://example.com/a/', false, '../a'), + array('http://example.com/a', 'http://example.com/a/b', false, '../a'), + array('http://example.com/a/b/c?query', 'http://example.com/a/b/c?query', false, '?query'), + array('http://ex/r', 'http://ex/x/y/z', false, '../../r'), + // http://dig.csail.mit.edu/2005/ajar/ajaw/test/uri-test-doc.html + array('bar:abc', 'foo:xyz', false, 'bar:abc'), + array('http://example/x/abc', 'http://example/x/y/z', false, '../abc'), + array('http://example/x/abc', 'http://example2/x/y/z', false, 'http://example/x/abc'), + array('http://example/x/abc', 'http://example2/x/y/z', true, '//example/x/abc'), + array('http://ex/x/r', 'http://ex/x/y/z', false, '../r'), + array('http://ex/x/q/r', 'http://ex/x/y', false, 'q/r'), + array('http://ex/x/q/r#s', 'http://ex/x/y', false, 'q/r#s'), + array('http://ex/x/q/r#s/t', 'http://ex/x/y', false, 'q/r#s/t'), + array('ftp://ex/x/q/r', 'http://ex/x/y', false, 'ftp://ex/x/q/r'), + array('http://ex/x/y/z/', 'http://ex/x/y', false, 'y/z/'), + array('file:/swap/test/animal.rdf#Animal', 'file:/swap/test/animal.rdf', false, '#Animal'), + array('file:/e/x/abc', 'file:/e/x/y/z', false, '../abc'), + array('file:/example/x/abc', 'file:/example2/x/y/z', false, '../../../example/x/abc'), + array('file:/ex/x/r', 'file:/ex/x/y/z', false, '../r'), + array('file:/r', 'file:/ex/x/y/z', false, '../../../r'), + array('file:/ex/x/q/r', 'file:/ex/x/y/z', false, '../q/r'), + array('file:/ex/x/q/r#s', 'file:/ex/x/y', false, 'q/r#s'), + array('file:/ex/x/q/r#', 'file:/ex/x/y', false, 'q/r#'), + array('file:/ex/x/q/r#s/t', 'file:/ex/x/y', false, 'q/r#s/t'), + array('ftp://ex/x/q/r', 'file:/ex/x/y', false, 'ftp://ex/x/q/r'), + array('file:/ex/x/y/z/', 'file:/ex/x/y/', false, 'z/'), + array('file://meetings.example.com/cal#m1', 'file:/devel/WWW/2000/10/swap/test/reluri-1.n3', false, 'file://meetings.example.com/cal#m1'), + array('file://meetings.example.com/cal#m1', 'file:/devel/WWW/2000/10/swap/test/reluri-1.n3', true, '//meetings.example.com/cal#m1'), + array('file://meetings.example.com/cal#m1', 'file:/home/connolly/w3ccvs/WWW/2000/10/swap/test/reluri-1.n3', false, 'file://meetings.example.com/cal#m1'), + array('file://meetings.example.com/cal#m1', 'file:/home/connolly/w3ccvs/WWW/2000/10/swap/test/reluri-1.n3', true, '//meetings.example.com/cal#m1'), + array('file:/some/dir/#blort', 'file:/some/dir/foo', false, './#blort'), + array('file:/some/dir/#', 'file:/some/dir/foo', false, './#'), + array('http://example/x/abc', 'http://example/x/y%2Fz', false, 'abc'), + array('http://example/x%2Fabc', 'http://example/x/y/z', false, '../../x%2Fabc'), + array('http://example/x%2Fabc', 'http://example/x/y%2Fz', false, '../x%2Fabc'), + array('http://example/x%2Fy/abc', 'http://example/x%2Fy/z', false, 'abc'), + array('http://example/x/', 'http://example/x/abc.efg', false, './'), // ??? + array('http://www.w3.org/2002/01/tr-automation/tr.rdf', 'http://www.w3.org/People/Berners-Lee/card.rdf', false, '../../2002/01/tr-automation/tr.rdf'), + ); + } + + /** + * Invalid IRI test cases + * + * These test cases were taken from + * {@link http://www.ninebynine.org/Software/HaskellUtils/Network/URITestDescriptions.html}. + * + * @return array The invalid IRI test cases. + */ + public function invalidIriProvider() + { + return array( + array('[2010:836B:4179::836B:4179]'), + array('http://foo.org:80Path/More'), + array('::'), + array(' '), // is this an invalid IRI?? + array('%'), + array('A%Z'), + array('%ZZ'), + array('%AZ'), + array('A C'), + array('A\C"'), + array('A`C'), + array('AC'), + array('A^C'), + array('A\\C'), + array('A{C'), + array('A|C'), + array('A}C'), + array('A[C'), + array('A]C'), + array('A[**]C'), + array('http://[xyz]/'), + array('http://]/'), + array('http://example.org/[2010:836B:4179::836B:4179]'), + array('http://example.org/abc#[2010:836B:4179::836B:4179]'), + array('http://example.org/xxx/[qwerty]#a[b]'), + array('http://example.org/xxx/qwerty#a#b'), + array('http://user:pass@example.org:99aaa/bbb') + ); + } + + /** + * Normalization test cases + * + * These test cases were taken from + * {@link http://www.ninebynine.org/Software/HaskellUtils/Network/URITestDescriptions.html}. + * + * @return array The normalization test cases. + */ + public function normalizationProvider() + { + return array( + // Case normalization; cf. RFC3986 section 6.2.2.1 (NOTE: authority case normalization is not performed) + array('HTTP://EXAMPLE.com/Root/%2a?%2b#%2c', 'http://EXAMPLE.com/Root/%2A?%2B#%2C'), + // Encoding normalization; cf. RFC3986 section 6.2.2.2 + array('HTTP://EXAMPLE.com/Root/%7eMe/', 'HTTP://EXAMPLE.com/Root/~Me/'), + array('foo:%40%41%5a%5b%60%61%7a%7b%2f%30%39%3a%2d%2e%5f%7e', 'foo:%40AZ%5b%60az%7b%2f09%3a-._~'), + array('foo:%3a%2f%3f%23%5b%5d%40', 'foo:%3a%2f%3f%23%5b%5d%40'), + // Path segment normalization; cf. RFC3986 section 6.2.2.3 + array('http://example/a/b/../../c', 'http://example/c'), + array('http://example/a/b/c/../../', 'http://example/a/'), + array('http://example/a/b/c/./', 'http://example/a/b/c/'), + array('http://example/a/b/c/.././', 'http://example/a/b/'), + array('http://example/a/b/c/d/../../../../e', 'http://example/e'), + array('http://example/a/b/c/d/../.././../../e', 'http://example/e'), + array('http://example/a/b/../.././../../e', 'http://example/e'), + array('foo:a/b/../.././../../e', 'foo:e') + ); + } +} diff --git a/vendor/ml/iri/ML/IRI/Test/bootstrap.php b/vendor/ml/iri/ML/IRI/Test/bootstrap.php new file mode 100644 index 00000000..ef2301bb --- /dev/null +++ b/vendor/ml/iri/ML/IRI/Test/bootstrap.php @@ -0,0 +1,12 @@ +=5.3.0", + "lib-pcre": ">=4.0" + }, + "autoload": { + "psr-0": { "ML\\IRI": "" } + }, + "target-dir": "ML/IRI" +} diff --git a/vendor/ml/iri/ML/IRI/phpunit.xml.dist b/vendor/ml/iri/ML/IRI/phpunit.xml.dist new file mode 100644 index 00000000..efab2c4a --- /dev/null +++ b/vendor/ml/iri/ML/IRI/phpunit.xml.dist @@ -0,0 +1,32 @@ + + + + + + ./Test/ + + + + + + ./ + + ./Test + + + + + + + + + diff --git a/vendor/ml/json-ld/.gitignore b/vendor/ml/json-ld/.gitignore new file mode 100644 index 00000000..777eafd3 --- /dev/null +++ b/vendor/ml/json-ld/.gitignore @@ -0,0 +1,4 @@ +/vendor +/composer.lock +/phpunit.xml +/earl-report.jsonld diff --git a/vendor/ml/json-ld/.travis.yml b/vendor/ml/json-ld/.travis.yml new file mode 100644 index 00000000..451c2d67 --- /dev/null +++ b/vendor/ml/json-ld/.travis.yml @@ -0,0 +1,23 @@ +language: php + +php: + - 7.0 + - 7.1 + - 7.2 + - 7.3 + - 7.4 + +matrix: + fast_finish: true + include: + - php: 5.3 + dist: precise + - php: 5.4 + dist: trusty + - php: 5.5 + dist: trusty + - php: 5.6 + dist: trusty + +before_script: + - composer install diff --git a/vendor/ml/json-ld/DefaultDocumentFactory.php b/vendor/ml/json-ld/DefaultDocumentFactory.php new file mode 100644 index 00000000..50a33e46 --- /dev/null +++ b/vendor/ml/json-ld/DefaultDocumentFactory.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +/** + * DefaultDocumentFactory creates new Documents + * + * @see Document + * + * @author Markus Lanthaler + */ +class DefaultDocumentFactory implements DocumentFactoryInterface +{ + /** + * {@inheritdoc} + */ + public function createDocument($iri = null) + { + return new Document($iri); + } +} diff --git a/vendor/ml/json-ld/Document.php b/vendor/ml/json-ld/Document.php new file mode 100644 index 00000000..4cfb4035 --- /dev/null +++ b/vendor/ml/json-ld/Document.php @@ -0,0 +1,206 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +use stdClass as JsonObject; +use ML\IRI\IRI; + +/** + * A Document represents a JSON-LD document. + * + * Named graphs are not supported yet. + * + * @author Markus Lanthaler + */ +class Document implements DocumentInterface, JsonLdSerializable +{ + /** + * @var IRI The document's IRI + */ + protected $iri = null; + + /** + * @var GraphInterface The default graph + */ + protected $defaultGraph = null; + + /** + * @var array An associative array holding all named graphs in the document + */ + protected $namedGraphs = array(); + + /** + * Parses a JSON-LD document and returns it as a Document + * + * The document can be supplied directly as a string or by passing a + * file path or an IRI. + * + * Usage: + * + * $document = Document::load('document.jsonld'); + * + * + * Please note that currently all data is merged into the + * default graph, named graphs are not supported yet! + * + * It is possible to configure the processing by setting the options + * parameter accordingly. Available options are: + * + * - base The base IRI of the input document. + * + * @param string|array|JsonObject $document The JSON-LD document to process. + * @param null|array|JsonObject $options Options to configure the processing. + * + * @return Document The parsed JSON-LD document. + * + * @throws ParseException If the JSON-LD input document is invalid. + */ + public static function load($document, $options = null) + { + return JsonLD::getDocument($document, $options); + } + + /** + * Constructor + * + * @param null|string|IRI $iri The document's IRI + */ + public function __construct($iri = null) + { + $this->iri = new IRI($iri); + $this->defaultGraph = new Graph($this); + } + + /** + * {@inheritdoc} + */ + public function setIri($iri) + { + $this->iri = new IRI($iri); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getIri($asObject = false) + { + return ($asObject) ? $this->iri : (string) $this->iri; + } + + /** + * {@inheritdoc} + */ + public function createGraph($name) + { + $name = (string) $this->iri->resolve($name); + + if (isset($this->namedGraphs[$name])) { + return $this->namedGraphs[$name]; + } + + return $this->namedGraphs[$name] = new Graph($this, $name); + } + + /** + * {@inheritdoc} + */ + public function getGraph($name = null) + { + if (null === $name) { + return $this->defaultGraph; + } + + $name = (string) $this->iri->resolve($name); + + return isset($this->namedGraphs[$name]) + ? $this->namedGraphs[$name] + : null; + } + + /** + * {@inheritdoc} + */ + public function getGraphNames() + { + return array_keys($this->namedGraphs); + } + + /** + * {@inheritdoc} + */ + public function containsGraph($name) + { + $name = (string) $this->iri->resolve($name); + + return isset($this->namedGraphs[$name]); + } + + /** + * {@inheritdoc} + */ + public function removeGraph($graph = null) + { + // The default graph can't be "removed", it can just be reset + if (null === $graph) { + $this->defaultGraph = new Graph($this); + + return $this; + } + + + if ($graph instanceof GraphInterface) { + foreach ($this->namedGraphs as $n => $g) { + if ($g === $graph) { + $name = $n; + break; + } + } + } else { + $name = (string) $this->iri->resolve($graph); + } + + if (isset($this->namedGraphs[$name])) { + if ($this->namedGraphs[$name]->getDocument() === $this) { + $this->namedGraphs[$name]->removeFromDocument(); + } + + unset($this->namedGraphs[$name]); + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function toJsonLd($useNativeTypes = true) + { + $defGraph = $this->defaultGraph->toJsonLd($useNativeTypes); + + if (0 === count($this->namedGraphs)) { + return $defGraph; + } + + foreach ($this->namedGraphs as $graphName => $graph) { + $namedGraph = new JsonObject(); + $namedGraph->{'@id'} = $graphName; + $namedGraph->{'@graph'} = $graph->toJsonLd($useNativeTypes); + + $defGraph[] = $namedGraph; + } + + $document = new JsonObject(); + $document->{'@graph'} = $defGraph; + + return array($document); + } +} diff --git a/vendor/ml/json-ld/DocumentFactoryInterface.php b/vendor/ml/json-ld/DocumentFactoryInterface.php new file mode 100644 index 00000000..1452ce19 --- /dev/null +++ b/vendor/ml/json-ld/DocumentFactoryInterface.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +/** + * Interface for factories to create DocumentInterface objects + * + * @see DocumentInterface + * + * @author Markus Lanthaler + */ +interface DocumentFactoryInterface +{ + /** + * Creates a new document + * + * @param null|string $iri The document's IRI. + * + * @return DocumentInterface The document. + */ + public function createDocument($iri = null); +} diff --git a/vendor/ml/json-ld/DocumentInterface.php b/vendor/ml/json-ld/DocumentInterface.php new file mode 100644 index 00000000..965fb1d9 --- /dev/null +++ b/vendor/ml/json-ld/DocumentInterface.php @@ -0,0 +1,89 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +use ML\IRI\IRI; + +/** + * JSON-LD document interface + * + * @author Markus Lanthaler + */ +interface DocumentInterface +{ + /** + * Set the document's IRI + * + * @param string|IRI The IRI. + * + * @return self + */ + public function setIri($iri); + + /** + * Get the document's IRI + * + * @param boolean $asObject If set to true, the return value will be an + * {@link IRI} object; otherwise a string. + * + * @return string|IRI The document's IRI (might be empty). + */ + public function getIri($asObject = false); + + /** + * Creates a new graph which is linked to this document + * + * If there exists already a graph with the passed name in the document, + * that graph will be returned instead of creating a new one. + * + * @param string|IRI $name The graph's name. + * + * @return GraphInterface The newly created graph. + */ + public function createGraph($name); + + /** + * Get a graph by name + * + * @param null|string $name The name of the graph to retrieve. If null + * is passed, the default will be returned. + * + * @return GraphInterface|null Returns the graph if found; null otherwise. + */ + public function getGraph($name = null); + + /** + * Get graph names + * + * @return string[] Returns the names of all graphs in the document. + */ + public function getGraphNames(); + + /** + * Check whether the document contains a graph with the specified name + * + * @param string $name The graph name. + * + * @return bool Returns true if the document contains a graph with the + * specified name; false otherwise. + */ + public function containsGraph($name); + + /** + * Removes a graph from the document + * + * @param null|string|GraphInterface $graph The graph (or its name) to + * remove. If null is passed, + * the default will be reset. + * + * @return self + */ + public function removeGraph($graph = null); +} diff --git a/vendor/ml/json-ld/DocumentLoaderInterface.php b/vendor/ml/json-ld/DocumentLoaderInterface.php new file mode 100644 index 00000000..cf6f78b8 --- /dev/null +++ b/vendor/ml/json-ld/DocumentLoaderInterface.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +use ML\JsonLD\Exception\JsonLdException; + +/** + * Interface for (remote) document loaders + * + * @author Markus Lanthaler + */ +interface DocumentLoaderInterface +{ + /** + * Load a (remote) document or context + * + * @param string $url The URL or path of the document to load. + * + * @return RemoteDocument The loaded document. + * + * @throws JsonLdException + */ + public function loadDocument($url); +} diff --git a/vendor/ml/json-ld/Exception/InvalidQuadException.php b/vendor/ml/json-ld/Exception/InvalidQuadException.php new file mode 100644 index 00000000..9d9db9c0 --- /dev/null +++ b/vendor/ml/json-ld/Exception/InvalidQuadException.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD\Exception; + +use ML\JsonLD\Quad; + +/** + * Exception that is thrown when an invalid quad is detected. + * + * @author Markus Lanthaler + */ +class InvalidQuadException extends \RuntimeException +{ + /** + * The quad that triggered this exception + * + * @var Quad + */ + private $quad; + + /** + * Constructor. + * + * @param string $message The error message + * @param Quad $quad The quad + * @param null|\Exception $previous The previous exception + */ + public function __construct($message, $quad, \Exception $previous = null) + { + $this->quad = $quad; + + parent::__construct($this->message, 0, $previous); + } + + /** + * Gets the quad + * + * @return Quad The quad. + */ + public function getQuad() + { + return $this->quad; + } + + /** + * Sets the quad + * + * @param Quad $quad The quad. + */ + public function setQuad($quad) + { + $this->quad = $quad; + } +} diff --git a/vendor/ml/json-ld/Exception/JsonLdException.php b/vendor/ml/json-ld/Exception/JsonLdException.php new file mode 100644 index 00000000..66383011 --- /dev/null +++ b/vendor/ml/json-ld/Exception/JsonLdException.php @@ -0,0 +1,307 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD\Exception; + +use ML\JsonLD\JsonLD; + +/** + * Exception class thrown when an error occurs during parsing. + * + * @author Markus Lanthaler + */ +class JsonLdException extends \RuntimeException +{ + /** + * An unspecified error code (none was standardized yet) + */ + const UNSPECIFIED = 'unknown'; + + /** + * The document could not be loaded or parsed as JSON. + */ + const LOADING_DOCUMENT_FAILED = "loading document failed"; + + /** + * A list of lists was detected. List of lists are not supported in + * this version of JSON-LD due to the algorithmic complexity. + */ + const LIST_OF_LISTS = "list of lists"; + + /** + * An @index member was encountered whose value was not a string. + */ + const INVALID_INDEX_VALUE = "invalid @index value"; + + /** + * Multiple conflicting indexes have been found for the same node. + */ + const CONFLICTING_INDEXES = "conflicting indexes"; + + /** + * An @id member was encountered whose value was not a string. + */ + const INVALID_ID_VALUE = "invalid @id value"; + + /** + * In invalid local context was detected. + */ + const INVALID_LOCAL_CONTEXT = "invalid local context"; + + /** + * Multiple HTTP Link Headers [RFC5988] using th + * http://www.w3.org/ns/json-ld#context link relation have been detected. + */ + const MULTIPLE_CONTEXT_LINK_HEADERS = "multiple context link headers"; + + /** + * There was a problem encountered loading a remote context. + */ + const LOADING_REMOTE_CONTEXT_FAILED = "loading remote context failed"; + + /** + * No valid context document has been found for a referenced, + * remote context. + */ + const INVALID_REMOTE_CONTEXT = "invalid remote context"; + + /** + * A cycle in remote context inclusions has been detected. + */ + const RECURSIVE_CONTEXT_INCLUSION = "recursive context inclusion"; + + /** + * An invalid base IRI has been detected, i.e., it is neither an + * absolute IRI nor null. + */ + const INVALID_BASE_IRI = "invalid base IRI"; + + /** + * An invalid vocabulary mapping has been detected, i.e., it is + * neither an absolute IRI nor null. + */ + const INVALID_VOCAB_MAPPING = "invalid vocab mapping"; + + /** + * The value of the default language is not a string or null and + * thus invalid. + */ + const INVALID_DEFAULT_LANGUAGE = "invalid default language"; + + /** + * A keyword redefinition has been detected. + */ + const KEYWORD_REDEFINITION = "keyword redefinition"; + + /** + * An invalid term definition has been detected. + */ + const INVALID_TERM_DEFINITION = "invalid term definition"; + + /** + * An invalid reverse property definition has been detected. + */ + const INVALID_REVERSE_PROPERTY = "invalid reverse property"; + + /** + * IRI mapping A local context contains a term that has an invalid + * or missing IRI mapping. + */ + const INVALID_IRI_MAPPING = "invalid IRI mapping"; + + /** + * IRI mapping A cycle in IRI mappings has been detected. + */ + const CYCLIC_IRI_MAPPING = "cyclic IRI mapping"; + + /** + * An invalid keyword alias definition has been encountered. + */ + const INVALID_KEYWORD_ALIAS = "invalid keyword alias"; + + /** + * An @type member in a term definition was encountered whose value + * could not be expanded to an absolute IRI. + */ + const INVALID_TYPE_MAPPING = "invalid type mapping"; + + /** + * An @language member in a term definition was encountered whose + * value was neither a string nor null and thus invalid. + */ + const INVALID_LANGUAGE_MAPPING = "invalid language mapping"; + + /** + * Two properties which expand to the same keyword have been detected. + * This might occur if a keyword and an alias thereof are used at the + * same time. + */ + const COLLIDING_KEYWORDS = "colliding keywords"; + + /** + * An @container member was encountered whose value was not one of + * the following strings: @list, @set, or @index. + */ + const INVALID_CONTAINER_MAPPING = "invalid container mapping"; + + /** + * An invalid value for an @type member has been detected, i.e., the + * value was neither a string nor an array of strings. + */ + const INVALID_TYPE_VALUE = "invalid type value"; + + /** + * A value object with disallowed members has been detected. + */ + const INVALID_VALUE_OBJECT = "invalid value object"; + + /** + * An invalid value for the @value member of a value object has been + * detected, i.e., it is neither a scalar nor null. + */ + const INVALID_VALUE_OBJECT_VALUE = "invalid value object value"; + + /** + * A language-tagged string with an invalid language value was detected. + */ + const INVALID_LANGUAGE_TAGGED_STRING = "invalid language-tagged string"; + + /** + * A number, true, or false with an associated language tag was detected. + */ + const INVALID_LANGUAGE_TAGGED_VALUE = "invalid language-tagged value"; + + /** + * A typed value with an invalid type was detected. + */ + const INVALID_TYPED_VALUE = "invalid typed value"; + + /** + * A set object or list object with disallowed members has been detected. + */ + const INVALID_SET_OR_LIST_OBJECT = "invalid set or list object"; + + /** + * An invalid value in a language map has been detected. It has to be + * a string or an array of strings. + */ + const INVALID_LANGUAGE_MAP_VALUE = "invalid language map value"; + + /** + * The compacted document contains a list of lists as multiple lists + * have been compacted to the same term. + */ + const COMPACTION_TO_LIST_OF_LISTS = "compaction to list of lists"; + + /** + * An invalid reverse property map has been detected. No keywords apart + * from @context are allowed in reverse property maps. + */ + const INVALID_REVERSE_PROPERTY_MAP = "invalid reverse property map"; + + /** + * An invalid value for an @reverse member has been detected, i.e., the + * value was not a JSON object. + */ + const INVALID_REVERSE_VALUE = "invalid @reverse value"; + + /** + * An invalid value for a reverse property has been detected. The value + * of an inverse property must be a node object. + */ + const INVALID_REVERSE_PROPERTY_VALUE = "invalid reverse property value"; + + /** + * The JSON-LD snippet that triggered the error + * + * @var null|string + */ + private $snippet; + + /** + * The document that triggered the error + * + * @var null|string + */ + private $document; + + /** + * The raw error message (containing place-holders) + * + * @var string + */ + private $rawMessage; + + /** + * Constructor. + * + * @param string $code The error code + * @param null|string $message The error message + * @param null|mixed $snippet The code snippet + * @param null|string $document The document that triggered the error + * @param null|\Exception $previous The previous exception + */ + public function __construct($code, $message = null, $snippet = null, $document = null, \Exception $previous = null) + { + $this->code = $code; + $this->document = $document; + $this->snippet = ($snippet) ? JsonLD::toString($snippet) : $snippet; + $this->rawMessage = $message; + + $this->updateMessage(); + + parent::__construct($this->message, 0, $previous); + } + + /** + * Gets the snippet of code near the error. + * + * @return null|string The snippet of code + */ + public function getSnippet() + { + return $this->snippet; + } + + /** + * Gets the document that triggered the error + * + * @return null|string The document that triggered the error + */ + public function getParsedFile() + { + return $this->document; + } + + /** + * Updates the exception message by including the file name if available. + */ + private function updateMessage() + { + $this->message = $this->rawMessage; + + $dot = false; + if ('.' === substr($this->message, -1)) { + $this->message = substr($this->message, 0, -1); + $dot = true; + } + + if (null !== $this->document) { + $this->message .= sprintf(' in %s', $this->document); + } + + if ($this->snippet) { + $this->message .= sprintf(' (near %s)', $this->snippet); + } + + if ($dot) { + $this->message .= '.'; + } + } +} diff --git a/vendor/ml/json-ld/FileGetContentsLoader.php b/vendor/ml/json-ld/FileGetContentsLoader.php new file mode 100644 index 00000000..42deee46 --- /dev/null +++ b/vendor/ml/json-ld/FileGetContentsLoader.php @@ -0,0 +1,197 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +use ML\JsonLD\Exception\JsonLdException; +use ML\IRI\IRI; + +/** + * The FileGetContentsLoader loads remote documents by calling file_get_contents + * + * @author Markus Lanthaler + */ +class FileGetContentsLoader implements DocumentLoaderInterface +{ + /** + * {@inheritdoc} + */ + public function loadDocument($url) + { + // if input looks like a file, try to retrieve it + $input = trim($url); + if (false === (isset($input[0]) && ("{" === $input[0]) || ("[" === $input[0]))) { + $remoteDocument = new RemoteDocument($url); + + $streamContextOptions = array( + 'method' => 'GET', + 'header' => "Accept: application/ld+json, application/json; q=0.9, */*; q=0.1\r\n" + . "User-Agent: lanthaler JsonLD\r\n", + 'timeout' => Processor::REMOTE_TIMEOUT + ); + + $context = stream_context_create(array( + 'http' => $streamContextOptions, + 'https' => $streamContextOptions + )); + + $httpHeadersOffset = 0; + + stream_context_set_params($context, array('notification' => + function ($code, $severity, $msg, $msgCode, $bytesTx, $bytesMax) use ( + &$remoteDocument, &$http_response_header, &$httpHeadersOffset + ) { + if ($code === STREAM_NOTIFY_MIME_TYPE_IS) { + $remoteDocument->mediaType = $msg; + } elseif ($code === STREAM_NOTIFY_REDIRECTED) { + $remoteDocument->documentUrl = $msg; + $remoteDocument->mediaType = null; + + $httpHeadersOffset = isset($http_response_header) ? count($http_response_header) : 0; + } + } + )); + + if (false === ($input = @file_get_contents($url, false, $context))) { + throw new JsonLdException( + JsonLdException::LOADING_DOCUMENT_FAILED, + sprintf('Unable to load the remote document "%s".', $url), + $http_response_header + ); + } + + // Extract HTTP Link headers + $linkHeaderValues = array(); + if (is_array($http_response_header)) { + for ($i = count($http_response_header) - 1; $i > $httpHeadersOffset; $i--) { + if (0 === substr_compare($http_response_header[$i], 'Link:', 0, 5, true)) { + $value = substr($http_response_header[$i], 5); + $linkHeaderValues[] = $value; + } + } + } + + $linkHeaderValues = $this->parseLinkHeaders($linkHeaderValues, new IRI($url)); + + $contextLinkHeaders = array_filter($linkHeaderValues, function ($link) { + return (isset($link['rel']) + && in_array('http://www.w3.org/ns/json-ld#context', explode(' ', $link['rel']))); + }); + + if (count($contextLinkHeaders) === 1) { + $remoteDocument->contextUrl = $contextLinkHeaders[0]['uri']; + } elseif (count($contextLinkHeaders) > 1) { + throw new JsonLdException( + JsonLdException::MULTIPLE_CONTEXT_LINK_HEADERS, + 'Found multiple contexts in HTTP Link headers', + $http_response_header + ); + } + + // If we got a media type, we verify it + if ($remoteDocument->mediaType) { + // Drop any media type parameters such as profiles + if (false !== ($pos = strpos($remoteDocument->mediaType, ';'))) { + $remoteDocument->mediaType = substr($remoteDocument->mediaType, 0, $pos); + } + + $remoteDocument->mediaType = trim($remoteDocument->mediaType); + + if ('application/ld+json' === $remoteDocument->mediaType) { + $remoteDocument->contextUrl = null; + } else { + // If the Media type was not as expected, check to see if the desired content type + // is being offered in a Link header (this is what schema.org now does). + $altLinkHeaders = array_filter($linkHeaderValues, function ($link) { + return (isset($link['rel']) && isset($link['type']) + && ($link['rel'] === 'alternate') && ($link['type'] === 'application/ld+json')); + }); + + // The spec states 'A response MUST NOT contain more than one HTTP Link Header + // using the alternate link relation with type="application/ld+json"' + if (count($altLinkHeaders) === 1) { + return $this->loadDocument($altLinkHeaders[0]['uri']); + } elseif (count($altLinkHeaders) > 1) { + throw new JsonLdException( + JsonLdException::LOADING_DOCUMENT_FAILED, + 'Received multiple alternate link headers' + ); + } + + if (('application/json' !== $remoteDocument->mediaType) && + (0 !== substr_compare($remoteDocument->mediaType, '+json', -5))) { + throw new JsonLdException( + JsonLdException::LOADING_DOCUMENT_FAILED, + 'Invalid media type', + $remoteDocument->mediaType + ); + } + } + } + + $remoteDocument->document = Processor::parse($input); + + return $remoteDocument; + } + + return new RemoteDocument($url, Processor::parse($input)); + } + + /** + * Parse HTTP Link headers + * + * @param array $values An array of HTTP Link headers. + * @param IRI $baseIri The document's URL (used to expand relative URLs to absolutes). + * + * @return array A structured representation of the Link header values. + * + * @internal Do not use this method directly, it's only temporarily accessible for testing. + */ + public function parseLinkHeaders(array $values, IRI $baseIri) + { + // Separate multiple links contained in a single header value + for ($i = 0, $total = count($values); $i < $total; $i++) { + if (strpos($values[$i], ',') !== false) { + foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $values[$i]) as $v) { + $values[] = trim($v); + } + unset($values[$i]); + } + } + + $contexts = $matches = array(); + $trimWhitespaceCallback = function ($str) { + return trim($str, "\"' \n\t"); + }; + + // Split the header in key-value pairs + $result = array(); + + foreach ($values as $val) { + $part = array(); + + foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) { + preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches); + $pieces = array_map($trimWhitespaceCallback, $matches[0]); + + if (count($pieces) > 1) { + $part[$pieces[0]] = $pieces[1]; + } elseif (count($pieces) === 1) { + $part['uri'] = (string) $baseIri->resolve(trim($pieces[0], '<> ')); + } + } + + if (!empty($part)) { + $result[] = $part; + } + } + + return $result; + } +} diff --git a/vendor/ml/json-ld/Graph.php b/vendor/ml/json-ld/Graph.php new file mode 100644 index 00000000..9dc11042 --- /dev/null +++ b/vendor/ml/json-ld/Graph.php @@ -0,0 +1,273 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +use ML\IRI\IRI; + +/** + * A Graph represents a JSON-LD graph. + * + * @author Markus Lanthaler + */ +class Graph implements GraphInterface, JsonLdSerializable +{ + /** + * @var DocumentInterface The document this graph belongs to. + */ + private $document; + + /** + * @var array An associative array holding all nodes in the graph + */ + protected $nodes = array(); + + /** + * A term map containing terms/prefixes mapped to IRIs. This is similar + * to a JSON-LD context but ignores all definitions except the IRI. + * + * @var array + */ + protected $termMap = array(); + + /** + * @var int Blank node counter + */ + private $blankNodeCounter = 0; + + /** + * Constructor + * + * @param null|DocumentInterface $document The document the graph belongs to. + */ + public function __construct(DocumentInterface $document = null) + { + $this->document = $document; + } + + /** + * {@inheritdoc} + */ + public function createNode($id = null, $preserveBnodeId = false) + { + if (!is_string($id) || (!$preserveBnodeId && ('_:' === substr($id, 0, 2)))) { + $id = $this->createBlankNodeId(); + } else { + $id = (string) $this->resolveIri($id); + if (isset($this->nodes[$id])) { + return $this->nodes[$id]; + } + } + + return $this->nodes[$id] = new Node($this, $id); + } + + /** + * {@inheritdoc} + */ + public function removeNode(NodeInterface $node) + { + if ($node->getGraph() === $this) { + $node->removeFromGraph(); + } + + $id = $node->getId(); + + if (!$node->isBlankNode()) { + $id = (string) $this->resolveIri($id); + } + + unset($this->nodes[$id]); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getNodes() + { + return array_values($this->nodes); + } + + /** + * {@inheritdoc} + */ + public function getNode($id) + { + if (!((strlen($id) >= 2) && ('_:' === substr($id, 0, 2)))) { + $id = (string) $this->resolveIri($id); + } + + return isset($this->nodes[$id]) + ? $this->nodes[$id] + : null; + } + + /** + * {@inheritdoc} + */ + public function getNodesByType($type) + { + if (is_string($type)) { + if (null === ($type = $this->getNode($type))) { + return array(); + } + } + + return $type->getNodesWithThisType(); + } + + /** + * {@inheritdoc} + */ + public function containsNode($id) + { + $node = $id; + + if ($node instanceof Node) { + $id = $node->getId(); + } + + if ((null === $id) || !is_string($id)) { + return false; + } + + if ((strlen($id) >= 2) && ('_:' === substr($id, 0, 2))) { + if (isset($this->nodes[$id]) && ($node === $this->nodes[$id])) { + return true; + } + + return false; + } + + $id = (string) $this->resolveIri($id); + + return isset($this->nodes[$id]); + } + + /** + * {@inheritdoc} + */ + public function getDocument() + { + return $this->document; + } + + /** + * {@inheritdoc} + */ + public function removeFromDocument() + { + $doc = $this->document; + $this->document = null; + + $doc->removeGraph($this); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function merge(GraphInterface $graph) + { + $nodes = $graph->getNodes(); + $bnodeMap = array(); + + foreach ($nodes as $node) { + if ($node->isBlankNode()) { + if (false === isset($bnodeMap[$node->getId()])) { + $bnodeMap[$node->getId()] = $this->createNode(); + } + $n = $bnodeMap[$node->getId()]; + } else { + $n = $this->createNode($node->getId()); + } + + foreach ($node->getProperties() as $property => $values) { + if (false === is_array($values)) { + $values = array($values); + } + + foreach ($values as $val) { + if ($val instanceof NodeInterface) { + // If the value is another node, we just need to + // create a reference to the corresponding node + // in this graph. The properties will be merged + // in the outer loop + if ($val->isBlankNode()) { + if (false === isset($bnodeMap[$val->getId()])) { + $bnodeMap[$val->getId()] = $this->createNode(); + } + $val = $bnodeMap[$val->getId()]; + } else { + $val = $this->createNode($val->getId()); + } + } elseif (is_object($val)) { + // Clone typed values and language-tagged strings + $val = clone $val; + } + + $n->addPropertyValue($property, $val); + } + } + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function toJsonLd($useNativeTypes = true) + { + // Bring nodes into a deterministic order + $nodes = $this->nodes; + ksort($nodes); + $nodes = array_values($nodes); + + $serializeNode = function ($node) use ($useNativeTypes) { + return $node->toJsonLd($useNativeTypes); + }; + + return array_map($serializeNode, $nodes); + } + + /** + * Create a new blank node identifier unique to the document. + * + * @return string The new blank node identifier. + */ + protected function createBlankNodeId() + { + return '_:b' . $this->blankNodeCounter++; + } + + /** + * Resolves an IRI against the document's IRI + * + * If the graph isn't attached to a document or the document's IRI is + * not set, the IRI is returned as-is. + * + * @param string|IRI $iri The (relative) IRI to resolve + * + * @return IRI The resolved IRI. + */ + protected function resolveIri($iri) + { + if (null === $this->document) { + $base = new IRI(); + } else { + $base = $this->document->getIri(true); + } + + return $base->resolve($iri); + } +} diff --git a/vendor/ml/json-ld/GraphInterface.php b/vendor/ml/json-ld/GraphInterface.php new file mode 100644 index 00000000..6f448ab4 --- /dev/null +++ b/vendor/ml/json-ld/GraphInterface.php @@ -0,0 +1,117 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +/** + * JSON-LD graph interface + * + * @author Markus Lanthaler + */ +interface GraphInterface +{ + /** + * Creates a new node which is linked to this document + * + * If a blank node identifier or an invalid ID is passed, the ID will be + * ignored and a new blank node identifier unique to the document is + * created for the node. + * + * If there exists already a node with the passed ID in the document, + * that node will be returned instead of creating a new one. + * + * @param null|string $id The ID of the node. + * @param bool $preserveBnodeId If set to false, blank nodes are + * relabeled to avoid collisions; + * otherwise the blank node identifier + * is preserved. + * + * @return Node The newly created node. + */ + public function createNode($id = null, $preserveBnodeId = false); + + /** + * Removes a node from the document + * + * This will also eliminate all references to the node within the + * document. + * + * @param NodeInterface $node The node to remove from the document. + * + * @return self + */ + public function removeNode(NodeInterface $node); + + /** + * Get all nodes + * + * @return Node[] Returns an array containing all nodes defined in the + * document. + */ + public function getNodes(); + + /** + * Get a node by ID + * + * @param string $id The ID of the node to retrieve. + * + * @return Node|null Returns the node if found; null otherwise. + */ + public function getNode($id); + + /** + * Get nodes by type + * + * @param string|Node $type The type + * + * @return Node[] Returns an array containing all nodes of the specified + * type in the document. + */ + public function getNodesByType($type); + + /** + * Check whether the document already contains a node with the + * specified ID + * + * @param string|Node $id The node ID to check. Blank node identifiers + * will always return false except a node instance + * which is part of the document will be passed + * instead of a string. + * + * @return bool Returns true if the document contains a node with the + * specified ID; false otherwise. + */ + public function containsNode($id); + + /** + * Get the document the node belongs to + * + * @return null|DocumentInterface Returns the document the node belongs + * to or null if the node doesn't belong + * to any document. + */ + public function getDocument(); + + /** + * Removes the graph from the document + * + * @return self + */ + public function removeFromDocument(); + + /** + * Merges the specified graph into the current graph + * + * @param GraphInterface $graph The graph that should be merged into the + * current graph. + * + * @return self + */ + public function merge(GraphInterface $graph); +} diff --git a/vendor/ml/json-ld/JsonLD.php b/vendor/ml/json-ld/JsonLD.php new file mode 100644 index 00000000..c259b6cb --- /dev/null +++ b/vendor/ml/json-ld/JsonLD.php @@ -0,0 +1,692 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +use stdClass as JsonObject; +use ML\JsonLD\Exception\JsonLdException; +use ML\JsonLD\Exception\InvalidQuadException; +use ML\IRI\IRI; + +/** + * JsonLD + * + * JsonLD implements the algorithms defined by the + * {@link http://www.w3.org/TR/json-ld-api/ JSON-LD 1.0 API and Processing Algorithms specification}. + * Its interface is, apart from the usage of Promises, exactly the same as the one + * defined by the specification. + * + * Furthermore, it implements an enhanced version of the + * {@link http://json-ld.org/spec/latest/json-ld-framing/ JSON-LD Framing 1.0 draft} + * and an object-oriented interface to access and manipulate JSON-LD documents. + * + * @api + * + * @author Markus Lanthaler + */ +class JsonLD +{ + /** Identifier for the default graph */ + const DEFAULT_GRAPH = '@default'; + + /** Identifier for the merged graph */ + const MERGED_GRAPH = '@merged'; + + private static $documentLoader = null; + + /** + * Load and parse a JSON-LD document + * + * The document can be supplied directly as string, by passing a file + * path, or by passing a URL. + * + * Usage: + * + * $document = JsonLD::getDocument('document.jsonld'); + * print_r($document->getGraphNames()); + * + * It is possible to configure the processing by setting the options + * parameter accordingly. Available options are: + * + *
+ *
base
+ *
The base IRI of the input document.
+ * + *
expandContext
+ *
An optional context to use additionally to the context embedded + * in input when expanding the input.
+ * + *
documentFactory
+ *
The document factory.
+ * + *
documentLoader
+ *
The document loader.
+ *
+ * + * The options parameter might be passed as associative array or as + * object. + * + * @param string|JsonObject|array $input The JSON-LD document to process. + * @param null|array|JsonObject $options Options to configure the processing. + * + * @return Document The parsed JSON-LD document. + * + * @throws JsonLdException + * + * @api + */ + public static function getDocument($input, $options = null) + { + $options = self::mergeOptions($options); + + $input = self::expand($input, $options); + + $processor = new Processor($options); + + return $processor->getDocument($input); + } + + /** + * Expand a JSON-LD document + * + * The document can be supplied directly as string, by passing a file + * path, or by passing a URL. + * + * Usage: + * + * $expanded = JsonLD::expand('document.jsonld'); + * print_r($expanded); + * + * It is possible to configure the expansion process by setting the options + * parameter accordingly. Available options are: + * + *
+ *
base
+ *
The base IRI of the input document.
+ * + *
expandContext
+ *
An optional context to use additionally to the context embedded + * in input when expanding the input.
+ * + *
documentLoader
+ *
The document loader.
+ *
+ * + * The options parameter might be passed as associative array or as + * object. + * + * @param string|JsonObject|array $input The JSON-LD document to expand. + * @param null|array|JsonObject $options Options to configure the expansion + * process. + * + * @return array The expanded JSON-LD document. + * + * @throws JsonLdException + * + * @api + */ + public static function expand($input, $options = null) + { + $options = self::mergeOptions($options); + + $processor = new Processor($options); + $activectx = array('@base' => null); + + if (is_string($input)) { + $remoteDocument = $options->documentLoader->loadDocument($input); + + $input = $remoteDocument->document; + $activectx['@base'] = new IRI($remoteDocument->documentUrl); + + if (null !== $remoteDocument->contextUrl) { + $processor->processContext($remoteDocument->contextUrl, $activectx); + } + } + + if ($options->base) { + $activectx['@base'] = $options->base; + } + + if (null !== $options->expandContext) { + $processor->processContext($options->expandContext, $activectx); + } + + $processor->expand($input, $activectx); + + // optimize away default graph (@graph as the only property at the top-level object) + if (is_object($input) && property_exists($input, '@graph') && (1 === count(get_object_vars($input)))) { + $input = $input->{'@graph'}; + } + + if (false === is_array($input)) { + $input = (null === $input) ? array() : array($input); + } + + return $input; + } + + /** + * Compact a JSON-LD document according a supplied context + * + * Both the document and the context can be supplied directly as string, + * by passing a file path, or by passing a URL. + * + * Usage: + * + * $compacted = JsonLD::compact('document.jsonld', 'context.jsonld'); + * print_r($compacted); + * + * It is possible to configure the compaction process by setting the + * options parameter accordingly. Available options are: + * + *
+ *
base
+ *
The base IRI of the input document.
+ * + *
expandContext
+ *
An optional context to use additionally to the context embedded + * in input when expanding the input.
+ * + *
optimize
+ *
If set to true, the processor is free to optimize the result to + * produce an even compacter representation than the algorithm + * described by the official JSON-LD specification.
+ * + *
compactArrays
+ *
If set to true, arrays holding just one element are compacted + * to scalars, otherwise the arrays are kept as arrays.
+ * + *
documentLoader
+ *
The document loader.
+ *
+ * + * The options parameter might be passed as associative array or as + * object. + * + * @param string|JsonObject|array $input The JSON-LD document to + * compact. + * @param null|string|JsonObject|array $context The context. + * @param null|array|JsonObject $options Options to configure the + * compaction process. + * + * @return JsonObject The compacted JSON-LD document. + * + * @throws JsonLdException + * + * @api + */ + public static function compact($input, $context = null, $options = null) + { + $options = self::mergeOptions($options); + + $expanded = self::expand($input, $options); + + return self::doCompact($expanded, $context, $options); + } + + /** + * Compact a JSON-LD document according a supplied context + * + * In contrast to {@link compact()}, this method assumes that the input + * has already been expanded. + * + * @param array $input The JSON-LD document to + * compact. + * @param null|string|JsonObject|array $context The context. + * @param JsonObject $options Options to configure the + * compaction process. + * @param bool $alwaysGraph If set to true, the resulting + * document will always explicitly + * contain the default graph at + * the top-level. + * + * @return JsonObject The compacted JSON-LD document. + * + * @throws JsonLdException + */ + private static function doCompact($input, $context, $options, $alwaysGraph = false) + { + if (is_string($context)) { + $context = $options->documentLoader->loadDocument($context)->document; + } + + if (is_object($context) && property_exists($context, '@context')) { + $context = $context->{'@context'}; + } + + if (is_object($context) && (0 === count(get_object_vars($context)))) { + $context = null; + } elseif (is_array($context) && (0 === count($context))) { + $context = null; + } + + $activectx = array('@base' => $options->base); + $processor = new Processor($options); + + $processor->processContext($context, $activectx); + $inversectx = $processor->createInverseContext($activectx); + + $processor->compact($input, $activectx, $inversectx); + + $compactedDocument = new JsonObject(); + if (null !== $context) { + $compactedDocument->{'@context'} = $context; + } + + if ((false === is_array($input)) || (0 === count($input))) { + if (false === $alwaysGraph) { + $compactedDocument = (object) ((array) $compactedDocument + (array) $input); + + return $compactedDocument; + } + + if (false === is_array($input)) { + $input = array($input); + } + } + + $graphKeyword = (isset($inversectx['@graph']['term'])) + ? $inversectx['@graph']['term'] + : '@graph'; + + $compactedDocument->{$graphKeyword} = $input; + + return $compactedDocument; + } + + /** + * Flatten a JSON-LD document + * + * Both the document and the context can be supplied directly as string, + * by passing a file path, or by passing a URL. + * + * Usage: + * + * $flattened = JsonLD::flatten('document.jsonld'); + * print_r($flattened); + * + * It is possible to configure the flattening process by setting the options + * parameter accordingly. Available options are: + * + *
+ *
base
+ *
The base IRI of the input document.
+ * + *
expandContext
+ *
An optional context to use additionally to the context embedded + * in input when expanding the input.
+ * + *
graph
+ *
The graph whose flattened representation should be returned. + * The default graph is identified by {@link DEFAULT_GRAPH} and the + * merged dataset graph by {@link MERGED_GRAPH}. If null is + * passed, all graphs will be returned.
+ * + *
documentLoader
+ *
The document loader.
+ *
+ * + * The options parameter might be passed as associative array or as + * object. + * + * @param string|JsonObject|array $input The JSON-LD document to flatten. + * @param null|string|JsonObject|array $context The context to compact the + * flattened document. If + * null is passed, the + * result will not be compacted. + * @param null|array|JsonObject $options Options to configure the + * flattening process. + * + * @return JsonObject The flattened JSON-LD document. + * + * @throws JsonLdException + * + * @api + */ + public static function flatten($input, $context = null, $options = null) + { + $options = self::mergeOptions($options); + + $input = self::expand($input, $options); + + $processor = new Processor($options); + $flattened = $processor->flatten($input); + + if (null === $context) { + return $flattened; + } + + return self::doCompact($flattened, $context, $options, true); + } + + /** + * Convert a JSON-LD document to RDF quads + * + * The document can be supplied directly as string, by passing a file + * path, or by passing a URL. + * + * Usage: + * + * $quads = JsonLD::toRdf('document.jsonld'); + * print_r($quads); + * + * It is possible to configure the extraction process by setting the options + * parameter accordingly. Available options are: + * + *
+ *
base
+ *
The base IRI of the input document.
+ * + *
expandContext
+ *
An optional context to use additionally to the context embedded + * in input when expanding the input.
+ * + *
documentLoader
+ *
The document loader.
+ *
+ * + * The options parameter might be passed as associative array or as + * object. + * + * @param string|JsonObject|array $input The JSON-LD document to expand. + * @param null|array|JsonObject $options Options to configure the expansion + * process. + * + * @return Quad[] The extracted quads. + * + * @throws JsonLdException + * + * @api + */ + public static function toRdf($input, $options = null) + { + $options = self::mergeOptions($options); + + $expanded = self::expand($input, $options); + + $processor = new Processor($options); + + return $processor->toRdf($expanded); + } + + /** + * Convert an array of RDF quads to a JSON-LD document + * + * Usage: + * + * $document = JsonLD::fromRdf($quads); + * print(JsonLD::toString($document, true)); + * + * It is possible to configure the conversion process by setting the options + * parameter accordingly. Available options are: + * + *
+ *
base
+ *
The base IRI of the input document.
+ * + *
useNativeTypes
+ *
If set to true, native types are used for xsd:integer, + * xsd:double, and xsd:boolean; otherwise, + * typed strings will be used instead.
+ * + *
useRdfType
+ *
If set to true, rdf:type will be used instead of @type + * + *
documentLoader
+ *
The document loader.
+ *
+ * + * The options parameter might be passed as associative array or as + * object. + * + * @param Quad[] $quads Array of quads. + * @param null|array|JsonObject $options Options to configure the expansion + * process. + * + * @return array The JSON-LD document in expanded form. + * + * @throws InvalidQuadException If an invalid quad was detected. + * @throws JsonLdException If converting the quads to a JSON-LD document failed. + * + * @api + */ + public static function fromRdf(array $quads, $options = null) + { + $options = self::mergeOptions($options); + + $processor = new Processor($options); + + return $processor->fromRdf($quads); + } + + /** + * Frame a JSON-LD document according a supplied frame + * + * Both the document and the frame can be supplied directly as string, + * by passing a file path, or by passing a URL. + * + * Usage: + * + * $result = JsonLD::frame('document.jsonld', 'frame.jsonldf'); + * print_r($compacted); + * + * It is possible to configure the framing process by setting the options + * parameter accordingly. Available options are: + * + *
+ *
base
+ *
The base IRI of the input document.
+ * + *
expandContext
+ *
An optional context to use additionally to the context embedded + * in input when expanding the input.
+ * + *
optimize
+ *
If set to true, the processor is free to optimize the result to + * produce an even compacter representation than the algorithm + * described by the official JSON-LD specification.
+ * + *
compactArrays
+ *
If set to true, arrays holding just one element are compacted + * to scalars, otherwise the arrays are kept as arrays.
+ * + *
documentLoader
+ *
The document loader.
+ *
+ * + * The options parameter might be passed as associative array or as + * object. + * + * @param string|JsonObject|array $input The JSON-LD document to compact. + * @param string|JsonObject $frame The frame. + * @param null|array|JsonObject $options Options to configure the framing + * process. + * + * @return JsonObject The framed JSON-LD document. + * + * @throws JsonLdException + * + * @api + */ + public static function frame($input, $frame, $options = null) + { + $options = self::mergeOptions($options); + + $input = self::expand($input, $options); + $frame = (is_string($frame)) + ? $options->documentLoader->loadDocument($frame)->document + : $frame; + + if (false === is_object($frame)) { + throw new JsonLdException( + JsonLdException::UNSPECIFIED, + 'Invalid frame detected. It must be an object.', + $frame + ); + } + + $processor = new Processor($options); + + // Store the frame's context as $frame gets modified + $frameContext = new JsonObject(); + if (property_exists($frame, '@context')) { + $frameContext->{'@context'} = $frame->{'@context'}; + } + + // Expand the frame + $processor->expand($frame, array(), null, true); + + // and optimize away default graph (@graph as the only property at the top-level object) + if (is_object($frame) && property_exists($frame, '@graph') && (1 === count(get_object_vars($frame)))) { + $frame = $frame->{'@graph'}; + } + + if (false === is_array($frame)) { + $frame = array($frame); + } + + // Frame the input document + $result = $processor->frame($input, $frame); + + // Compact the result using the frame's active context + return self::doCompact($result, $frameContext, $options, true); + } + + /** + * Convert the PHP structure returned by the various processing methods + * to a string + * + * Usage: + * + * $compacted = JsonLD::compact('document.jsonld', 'context.jsonld'); + * $prettyString = JsonLD::toString($compacted, true); + * print($prettyString); + * + * @param mixed $value The value to convert. + * @param bool $pretty Use whitespace in returned string to format it + * (this just works in PHP >=5.4)? + * + * @return string + */ + public static function toString($value, $pretty = false) + { + $options = 0; + + if (PHP_VERSION_ID >= 50400) { + $options |= JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; + + if ($pretty) { + $options |= JSON_PRETTY_PRINT; + } + + return json_encode($value, $options); + } else { + $result = json_encode($value); + $result = str_replace('\\/', '/', $result); // unescape slahes + + // unescape unicode + return preg_replace_callback( + '/\\\\u([a-f0-9]{4})/', + function ($match) { + return iconv('UCS-4LE', 'UTF-8', pack('V', hexdec($match[1]))); + }, + $result + ); + } + } + + /** + * Merge the passed options with the options' default values. + * + * @param null|array|JsonObject $options The options. + * + * @return JsonObject The merged options. + */ + private static function mergeOptions($options) + { + $result = (object) array( + 'base' => null, + 'expandContext' => null, + 'compactArrays' => true, + 'optimize' => false, + 'graph' => null, + 'useNativeTypes' => false, + 'useRdfType' => false, + 'produceGeneralizedRdf' => false, + 'documentFactory' => null, + 'documentLoader' => new FileGetContentsLoader() + ); + + if (is_array($options) || is_object($options)) { + $options = (object) $options; + if (isset($options->{'base'})) { + if (is_string($options->{'base'})) { + $result->base = new IRI($options->{'base'}); + } elseif (($options->{'base'} instanceof IRI) && $options->{'base'}->isAbsolute()) { + $result->base = clone $options->{'base'}; + } else { + throw new \InvalidArgumentException('The "base" option must be set to null or an absolute IRI.'); + } + } + if (property_exists($options, 'compactArrays') && is_bool($options->compactArrays)) { + $result->compactArrays = $options->compactArrays; + } + if (property_exists($options, 'optimize') && is_bool($options->optimize)) { + $result->optimize = $options->optimize; + } + if (property_exists($options, 'graph') && is_string($options->graph)) { + $result->graph = $options->graph; + } + if (property_exists($options, 'useNativeTypes') && is_bool($options->useNativeTypes)) { + $result->useNativeTypes = $options->useNativeTypes; + } + if (property_exists($options, 'useRdfType') && is_bool($options->useRdfType)) { + $result->useRdfType = $options->useRdfType; + } + if (property_exists($options, 'produceGeneralizedRdf') && is_bool($options->produceGeneralizedRdf)) { + $result->produceGeneralizedRdf = $options->produceGeneralizedRdf; + } + if (property_exists($options, 'documentFactory') && + ($options->documentFactory instanceof DocumentFactoryInterface)) { + $result->documentFactory = $options->documentFactory; + } + if (property_exists($options, 'documentLoader') && + ($options->documentLoader instanceof DocumentLoaderInterface)) { + $result->documentLoader = $options->documentLoader; + } elseif (null !== self::$documentLoader) { + $result->documentLoader = self::$documentLoader; + } + if (property_exists($options, 'expandContext')) { + if (is_string($options->expandContext)) { + $result->expandContext = $result->documentLoader->loadDocument($options->expandContext)->document; + } elseif (is_object($options->expandContext)) { + $result->expandContext = $options->expandContext; + } + if (is_object($result->expandContext) && property_exists($result->expandContext, '@context')) { + $result->expandContext = $result->expandContext->{'@context'}; + } + } + } + + return $result; + } + + /** + * Set the default document loader. + * + * It can be overridden in individual operations by setting the + * `documentLoader` option. + * + * @param DocumentLoaderInterface $documentLoader + */ + public static function setDefaultDocumentLoader(DocumentLoaderInterface $documentLoader) + { + self::$documentLoader = $documentLoader; + } +} diff --git a/vendor/ml/json-ld/JsonLdSerializable.php b/vendor/ml/json-ld/JsonLdSerializable.php new file mode 100644 index 00000000..ba1f3662 --- /dev/null +++ b/vendor/ml/json-ld/JsonLdSerializable.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +/** + * The JsonLdSerializable interface + * + * Objects implementing JsonLdSerializable can be serialized to JSON-LD. + * + * @author Markus Lanthaler + */ +interface JsonLdSerializable +{ + /** + * Convert to expanded and flattened JSON-LD + * + * The result can then be serialized to JSON-LD by {@see JsonLD::toString()}. + * + * @param boolean $useNativeTypes If set to true, native types are used + * for xsd:integer, xsd:double, and + * xsd:boolean, otherwise typed strings + * will be used instead. + * + * @return mixed Returns data which can be serialized by + * {@see JsonLD::toString()} (which is a value of any type + * other than a resource) to expanded JSON-LD. + * + * @see JsonLD::toString() + */ + public function toJsonLd($useNativeTypes = true); +} diff --git a/vendor/ml/json-ld/LICENSE b/vendor/ml/json-ld/LICENSE new file mode 100644 index 00000000..34bdeb01 --- /dev/null +++ b/vendor/ml/json-ld/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012-2016 Markus Lanthaler + +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/ml/json-ld/LanguageTaggedString.php b/vendor/ml/json-ld/LanguageTaggedString.php new file mode 100644 index 00000000..d3407d21 --- /dev/null +++ b/vendor/ml/json-ld/LanguageTaggedString.php @@ -0,0 +1,95 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +use stdClass as JsonObject; + +/** + * A LanguageTaggedString is a string which is tagged with a language. + * + * @author Markus Lanthaler + */ +final class LanguageTaggedString extends Value +{ + /** + * The language code associated with the string. Language codes are tags + * according to {@link http://tools.ietf.org/html/bcp47 BCP47}. + * + * @var string + */ + private $language; + + /** + * Constructor + * + * @param string $value The string's value. + * @param string $language The string's language. + */ + public function __construct($value, $language) + { + $this->setValue($value); + $this->setLanguage($language); + } + + /** + * Set the language + * + * @param string $language The language. + * + * @return self + * + * @throws \InvalidArgumentException If the language is not a string. No + * further checks are currently done. + */ + public function setLanguage($language) + { + if (!is_string($language)) { + throw new \InvalidArgumentException('language must be a string.'); + } + + $this->language = $language; + + return $this; + } + + /** + * Get the language + * + * @return string The language. + */ + public function getLanguage() + { + return $this->language; + } + + /** + * {@inheritdoc} + */ + public function toJsonLd($useNativeTypes = true) + { + $result = new JsonObject(); + $result->{'@value'} = $this->value; + $result->{'@language'} = $this->language; + + return $result; + } + + /** + * {@inheritdoc} + */ + public function equals($other) + { + if (get_class($this) !== get_class($other)) { + return false; + } + + return ($this->value === $other->value) && ($this->language === $other->language); + } +} diff --git a/vendor/ml/json-ld/NQuads.php b/vendor/ml/json-ld/NQuads.php new file mode 100644 index 00000000..4b24b0fd --- /dev/null +++ b/vendor/ml/json-ld/NQuads.php @@ -0,0 +1,173 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +use ML\JsonLD\Exception\InvalidQuadException; +use ML\IRI\IRI; + +/** + * NQuads serializes quads to the NQuads format + * + * @author Markus Lanthaler + */ +class NQuads implements QuadSerializerInterface, QuadParserInterface +{ + /** + * {@inheritdoc} + */ + public function serialize(array $quads) + { + $result = ''; + foreach ($quads as $quad) { + $result .= ('_' === $quad->getSubject()->getScheme()) + ? $quad->getSubject() + : '<' . $quad->getSubject() . '>'; + $result .= ' '; + + $result .= ('_' === $quad->getProperty()->getScheme()) + ? $quad->getProperty() + : '<' . $quad->getProperty() . '>'; + $result .= ' '; + + if ($quad->getObject() instanceof IRI) { + $result .= ('_' === $quad->getObject()->getScheme()) + ? $quad->getObject() + : '<' . $quad->getObject() . '>'; + } else { + $result .= '"' . str_replace( + array("\n", '"'), + array('\n', '\"'), + $quad->getObject()->getValue()) . '"'; + $result .= ($quad->getObject() instanceof TypedValue) + ? (RdfConstants::XSD_STRING === $quad->getObject()->getType()) + ? '' + : '^^<' . $quad->getObject()->getType() . '>' + : '@' . $quad->getObject()->getLanguage(); + } + $result .= ' '; + + if ($quad->getGraph()) { + $result .= ('_' === $quad->getGraph()->getScheme()) + ? $quad->getGraph() : + '<' . $quad->getGraph() . '>'; + $result .= ' '; + } + $result .= ".\n"; + } + + return $result; + } + + /** + * {@inheritdoc} + * + * This method is heavily based on DigitalBazaar's implementation used + * in their {@link https://github.com/digitalbazaar/php-json-ld php-json-ld}. + * + * @throws InvalidQuadException If an invalid quad that can't be parsed is + * encountered. + */ + public function parse($input) + { + // define partial regexes + $iri = '(?:<([^>]*)>)'; + $bnode = '(_:(?:[A-Za-z0-9]+))'; + $plain = '"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"'; + $datatype = "\\^\\^$iri"; + $language = '(?:@([a-z]+(?:-[a-z0-9]+)*))'; + $literal = "(?:$plain(?:$datatype|$language)?)"; + $ws = '[ \\t]'; + $comment = "#.*"; + + $subject = "(?:$iri|$bnode)$ws+"; + $property = "$iri$ws+"; + $object = "(?:$iri|$bnode|$literal)"; + $graph = "$ws+(?:$iri|$bnode)"; + + // full regexes + $eoln = '/(?:(\r\n)|[\n\r])/'; + $quadRegex = "/^$ws*$subject$property$object$graph?$ws*.$ws*$/"; + $ignoreRegex = "/^$ws*(?:$comment)?$/"; + + // build RDF statements + $statements = array(); + + // split N-Quad input into lines + $lines = preg_split($eoln, $input); + $line_number = 0; + + foreach ($lines as $line) { + $line_number++; + + // skip empty lines + if (preg_match($ignoreRegex, $line)) { + continue; + } + + // parse quad + if (!preg_match($quadRegex, $line, $match)) { + throw new InvalidQuadException( + sprintf( + 'Error while parsing N-Quads. Invalid quad in line %d: %s', + $line_number, + $line + ), + $line + ); + } + + // get subject + if ($match[1] !== '') { + $subject = new IRI($match[1]); + } else { + $subject = new IRI($match[2]); + } + + // get property + $property = new IRI($match[3]); + + // get object + if ($match[4] !== '') { + $object = new IRI($match[4]); // IRI + } elseif ($match[5] !== '') { + $object = new IRI($match[5]); // bnode + } else { + $unescaped = str_replace( + array('\"', '\t', '\n', '\r', '\\\\'), + array('"', "\t", "\n", "\r", '\\'), + $match[6] + ); + + if (isset($match[7]) && $match[7] !== '') { + $object = new TypedValue($unescaped, $match[7]); + } elseif (isset($match[8]) && $match[8] !== '') { + $object = new LanguageTaggedString($unescaped, $match[8]); + } else { + $object = new TypedValue($unescaped, RdfConstants::XSD_STRING); + } + } + + // get graph + $graph = null; + if (isset($match[9]) && $match[9] !== '') { + $graph = new IRI($match[9]); + } elseif (isset($match[10]) && $match[10] !== '') { + $graph = new IRI($match[10]); + } + + $quad = new Quad($subject, $property, $object, $graph); + + // TODO Make sure that quads are unique?? + $statements[] = $quad; + } + + return $statements; + } +} diff --git a/vendor/ml/json-ld/Node.php b/vendor/ml/json-ld/Node.php new file mode 100644 index 00000000..2af17ff6 --- /dev/null +++ b/vendor/ml/json-ld/Node.php @@ -0,0 +1,509 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +use stdClass as JsonObject; + +/** + * A Node represents a node in a JSON-LD graph. + * + * @author Markus Lanthaler + */ +class Node implements NodeInterface, JsonLdSerializable +{ + /** The @type constant. */ + const TYPE = '@type'; + + /** + * @var GraphInterface The graph the node belongs to. + */ + private $graph; + + /** + * @var string The ID of the node + */ + private $id; + + /** + * @var array An associative array holding all properties of the node except it's ID + */ + private $properties = array(); + + /** + * An associative array holding all reverse properties of this node, i.e., + * a pointers to all nodes that link to this node. + * + * @var array + */ + private $revProperties = array(); + + /** + * Constructor + * + * @param GraphInterface $graph The graph the node belongs to. + * @param null|string $id The ID of the node. + */ + public function __construct(GraphInterface $graph, $id = null) + { + $this->graph = $graph; + $this->id = $id; + } + + /** + * {@inheritdoc} + */ + public function getId() + { + return $this->id; + } + + /** + * {@inheritdoc} + */ + public function setType($type) + { + if ((null !== $type) && !($type instanceof NodeInterface)) { + if (is_array($type)) { + foreach ($type as $val) { + if ((null !== $val) && !($val instanceof NodeInterface)) { + throw new \InvalidArgumentException('type must be null, a Node, or an array of Nodes'); + } + } + } else { + throw new \InvalidArgumentException('type must be null, a Node, or an array of Nodes'); + } + } + + $this->setProperty(self::TYPE, $type); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addType(NodeInterface $type) + { + $this->addPropertyValue(self::TYPE, $type); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function removeType(NodeInterface $type) + { + $this->removePropertyValue(self::TYPE, $type); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getType() + { + return $this->getProperty(self::TYPE); + } + + /** + * {@inheritdoc} + */ + public function getNodesWithThisType() + { + if (null === ($nodes = $this->getReverseProperty(self::TYPE))) { + return array(); + } + + return (is_array($nodes)) ? $nodes : array($nodes); + } + + /** + * {@inheritdoc} + */ + public function getGraph() + { + return $this->graph; + } + + /** + * {@inheritdoc} + */ + public function removeFromGraph() + { + // Remove other node's properties and reverse properties pointing to + // this node + foreach ($this->revProperties as $property => $nodes) { + foreach ($nodes as $node) { + $node->removePropertyValue($property, $this); + } + } + + foreach ($this->properties as $property => $values) { + if (!is_array($values)) { + $values = array($values); + } + + foreach ($values as $value) { + if ($value instanceof NodeInterface) { + $this->removePropertyValue($property, $value); + } + } + } + + $g = $this->graph; + $this->graph = null; + + $g->removeNode($this); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function isBlankNode() + { + return ((null === $this->id) || ('_:' === substr($this->id, 0, 2))); + } + + /** + * {@inheritdoc} + */ + public function setProperty($property, $value) + { + if (null === $value) { + $this->removeProperty($property); + } else { + $this->doMergeIntoProperty((string) $property, array(), $value); + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addPropertyValue($property, $value) + { + $existing = (isset($this->properties[(string) $property])) + ? $this->properties[(string) $property] + : array(); + + if (!is_array($existing)) { + $existing = array($existing); + } + + $this->doMergeIntoProperty((string) $property, $existing, $value); + + return $this; + } + + /** + * Merge a value into a set of existing values. + * + * @param string $property The name of the property. + * @param array $existingValues The existing values. + * @param mixed $value The value to merge into the existing + * values. This MUST NOT be an array. + * + * @throws \InvalidArgumentException If value is an array or an object + * which is neither a language-tagged + * string nor a typed value or a node. + */ + private function doMergeIntoProperty($property, $existingValues, $value) + { + // TODO: Handle lists! + + if (null === $value) { + return; + } + + if (!$this->isValidPropertyValue($value)) { + throw new \InvalidArgumentException( + 'value must be a scalar, a node, a language-tagged string, or a typed value' + ); + } + + $normalizedValue = $this->normalizePropertyValue($value); + + foreach ($existingValues as $existing) { + if ($this->equalValues($existing, $normalizedValue)) { + return; + } + } + + $existingValues[] = $normalizedValue; + + if (1 === count($existingValues)) { + $existingValues = $existingValues[0]; + } + + $this->properties[$property] = $existingValues; + + if ($normalizedValue instanceof NodeInterface) { + $value->addReverseProperty($property, $this); + } + } + + /** + * {@inheritdoc} + */ + public function removeProperty($property) + { + if (!isset($this->properties[(string) $property])) { + return $this; + } + + $values = is_array($this->properties[(string) $property]) + ? $this->properties[(string) $property] + : array($this->properties[(string) $property]); + + foreach ($values as $value) { + if ($value instanceof NodeInterface) { + $value->removeReverseProperty((string) $property, $this); + } + } + + unset($this->properties[(string) $property]); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function removePropertyValue($property, $value) + { + if (!$this->isValidPropertyValue($value) || !isset($this->properties[(string) $property])) { + return $this; + } + + $normalizedValue = $this->normalizePropertyValue($value); + + $values =& $this->properties[(string) $property]; + + if (!is_array($this->properties[(string) $property])) { + $values = array($values); + } + + for ($i = 0, $length = count($values); $i < $length; $i++) { + if ($this->equalValues($values[$i], $normalizedValue)) { + if ($normalizedValue instanceof NodeInterface) { + $normalizedValue->removeReverseProperty((string) $property, $this); + } + + unset($values[$i]); + break; + } + } + + if (0 === count($values)) { + unset($this->properties[(string) $property]); + + return $this; + } + + $this->properties[(string) $property] = array_values($values); // re-index the array + + if (1 === count($this->properties[(string) $property])) { + $this->properties[(string) $property] = $this->properties[(string) $property][0]; + } + } + + /** + * {@inheritdoc} + */ + public function getProperties() + { + return $this->properties; + } + + /** + * {@inheritdoc} + */ + public function getProperty($property) + { + return (isset($this->properties[(string) $property])) + ? $this->properties[(string) $property] + : null; + } + + /** + * {@inheritdoc} + */ + public function getReverseProperties() + { + $result = array(); + foreach ($this->revProperties as $key => $nodes) { + $result[$key] = array_values($nodes); + } + + return $result; + } + + /** + * {@inheritdoc} + */ + public function getReverseProperty($property) + { + if (!isset($this->revProperties[(string) $property])) { + return null; + } + + $result = array_values($this->revProperties[(string) $property]); + + return (1 === count($result)) + ? $result[0] + : $result; + } + + /** + * {@inheritdoc} + */ + public function equals(NodeInterface $other) + { + return $this === $other; + } + + /** + * {@inheritdoc} + */ + public function toJsonLd($useNativeTypes = true) + { + $node = new \stdClass(); + + // Only label blank nodes if other nodes point to it + if ((false === $this->isBlankNode()) || (count($this->getReverseProperties()) > 0)) { + $node->{'@id'} = $this->getId(); + } + + $properties = $this->getProperties(); + + foreach ($properties as $prop => $values) { + if (false === is_array($values)) { + $values = array($values); + } + + if (self::TYPE === $prop) { + $node->{'@type'} = array(); + foreach ($values as $val) { + $node->{'@type'}[] = $val->getId(); + } + + continue; + } + + $node->{$prop} = array(); + + foreach ($values as $value) { + if ($value instanceof NodeInterface) { + $ref = new \stdClass(); + $ref->{'@id'} = $value->getId(); + $node->{$prop}[] = $ref; + } elseif (is_object($value)) { // language-tagged string or typed value + $node->{$prop}[] = $value->toJsonLd($useNativeTypes); + } else { + $val = new JsonObject(); + $val->{'@value'} = $value; + $node->{$prop}[] = $val; + } + } + + } + + return $node; + } + + /** + * Add a reverse property. + * + * @param string $property The name of the property. + * @param NodeInterface $node The node which has a property pointing + * to this node instance. + */ + protected function addReverseProperty($property, NodeInterface $node) + { + $this->revProperties[$property][$node->getId()] = $node; + } + + /** + * Remove a reverse property. + * + * @param string $property The name of the property. + * @param NodeInterface $node The node which has a property pointing + * to this node instance. + */ + protected function removeReverseProperty($property, NodeInterface $node) + { + unset($this->revProperties[$property][$node->getId()]); + + if (0 === count($this->revProperties[$property])) { + unset($this->revProperties[$property]); + } + } + + /** + * Checks whether a value is a valid property value. + * + * @param mixed $value The value to check. + * + * @return bool Returns true if the value is a valid property value; + * false otherwise. + */ + protected function isValidPropertyValue($value) + { + return (is_scalar($value) || + (is_object($value) && + ((($value instanceof NodeInterface) && ($value->getGraph() === $this->graph)) || + ($value instanceof Value)))); + } + + /** + * Normalizes a property value by converting scalars to Value objects. + * + * @param mixed $value The value to normalize. + * + * @return NodeInterface|Value The normalized value. + */ + protected function normalizePropertyValue($value) + { + if (false === is_scalar($value)) { + return $value; + } + + return Value::fromJsonLd((object) array('@value' => $value)); + } + + /** + * Checks whether the two specified values are the same. + * + * Scalars and nodes are checked for identity, value objects for + * equality. + * + * @param mixed $value1 Value 1. + * @param mixed $value2 Value 2. + * + * @return bool Returns true if the two values are equals; otherwise false. + */ + protected function equalValues($value1, $value2) + { + if (gettype($value1) !== gettype($value2)) { + return false; + } + + if (is_object($value1) && ($value1 instanceof Value)) { + return $value1->equals($value2); + } + + return ($value1 === $value2); + } +} diff --git a/vendor/ml/json-ld/NodeInterface.php b/vendor/ml/json-ld/NodeInterface.php new file mode 100644 index 00000000..70919947 --- /dev/null +++ b/vendor/ml/json-ld/NodeInterface.php @@ -0,0 +1,218 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +/** + * A generic interface for nodes in a JSON-LD graph. + * + * @author Markus Lanthaler + */ +interface NodeInterface +{ + /** + * Get ID + * + * @return string|null The ID of the node or null. + */ + public function getId(); + + /** + * Set the node type + * + * @param null|NodeInterface|array[NodeInterface] The type(s) of this node. + * + * @return self + * + * @throws \InvalidArgumentException If type is not null, a Node or an + * array of Nodes. + */ + public function setType($type); + + /** + * Add a type to this node + * + * @param NodeInterface The type to add. + * + * @return self + */ + public function addType(NodeInterface $type); + + /** + * Remove a type from this node + * + * @param NodeInterface The type to remove. + * + * @return self + */ + public function removeType(NodeInterface $type); + + /** + * Get node type + * + * @return null|NodeInterface|NodeInterface[] Returns the type(s) of this node. + */ + public function getType(); + + /** + * Get the nodes which have this node as their type + * + * This will return all nodes that link to this Node instance via the + * @type (rdf:type) property. + * + * @return NodeInterface[] Returns the node(s) having this node as their + * type. + */ + public function getNodesWithThisType(); + + /** + * Get the graph the node belongs to + * + * @return null|GraphInterface Returns the graph the node belongs to or + * null if the node doesn't belong to any graph. + */ + public function getGraph(); + + /** + * Removes the node from the graph + * + * This will also remove all references to and from other nodes in this + * node's graph. + * + * @return self + */ + public function removeFromGraph(); + + /** + * Is this node a blank node + * + * A blank node is a node whose identifier has just local meaning. It has + * therefore a node identifier with the prefix _: or no + * identifier at all. + * + * @return bool Returns true if the node is a blank node, otherwise false. + */ + public function isBlankNode(); + + /** + * Set a property of the node + * + * If the value is or contains a reference to a node which is not part + * of the graph, the referenced node will added to the graph as well. + * If the referenced node is already part of another graph a copy of the + * node will be created and added to the graph. + * + * @param string $property The name of the property. + * @param mixed $value The value of the property. This MUST NOT be + * an array. Use null to remove the property. + * + * @return self + * + * @throws \InvalidArgumentException If value is an array or an object + * which is neither a language-tagged + * string nor a typed value or a node. + */ + public function setProperty($property, $value); + + /** + * Adds a value to a property of the node + * + * If the value already exists, it won't be added again, i.e., there + * won't be any duplicate property values. + * + * If the value is or contains a reference to a node which is not part + * of the graph, the referenced node will added to the graph as well. + * If the referenced node is already part of another graph a copy of the + * node will be created and added to the graph. + * + * @param string $property The name of the property. + * @param mixed $value The value of the property. This MUST NOT be + * an array. + * + * @return self + * + * @throws \InvalidArgumentException If value is an array or an object + * which is neither a language-tagged + * string nor a typed value or a node. + */ + public function addPropertyValue($property, $value); + + /** + * Removes a property and all it's values + * + * @param string $property The name of the property to remove. + * + * @return self + */ + public function removeProperty($property); + + /** + * Removes a property value + * + * @param string $property The name of the property. + * @param mixed $value The value of the property. This MUST NOT be + * an array. + * + * @return self + */ + public function removePropertyValue($property, $value); + + /** + * Get the properties of this node + * + * @return array Returns an associative array containing all properties + * of this node. The key is the property name whereas the + * value is the property's value. + */ + public function getProperties(); + + /** + * Get the value of a property + * + * @param string $property The name of the property. + * + * @return mixed Returns the value of the property or null if the + * property doesn't exist. + */ + public function getProperty($property); + + /** + * Get the reverse properties of this node + * + * @return array Returns an associative array containing all reverse + * properties of this node. The key is the property name + * whereas the value is an array of nodes linking to this + * instance via that property. + */ + public function getReverseProperties(); + + /** + * Get the nodes of a reverse property + * + * This will return all nodes that link to this Node instance via the + * specified property. + * + * @param string $property The name of the reverse property. + * + * @return null|NodeInterface|NodeInterface[] Returns the node(s) pointing + * to this instance via the specified + * property or null if no such node exists. + */ + public function getReverseProperty($property); + + /** + * Compares this node object to the specified value. + * + * @param mixed $other The value this instance should be compared to. + * + * @return bool Returns true if the passed value is the same as this + * instance; false otherwise. + */ + public function equals(NodeInterface $other); +} diff --git a/vendor/ml/json-ld/Processor.php b/vendor/ml/json-ld/Processor.php new file mode 100644 index 00000000..1c1ff3e1 --- /dev/null +++ b/vendor/ml/json-ld/Processor.php @@ -0,0 +1,2973 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +use stdClass as JsonObject; +use ML\JsonLD\Exception\JsonLdException; +use ML\JsonLD\Exception\InvalidQuadException; +use ML\IRI\IRI; + +/** + * Processor processes JSON-LD documents as specified by the JSON-LD + * specification. + * + * @author Markus Lanthaler + */ +class Processor +{ + /** Timeout for retrieving remote documents in seconds */ + const REMOTE_TIMEOUT = 10; + + /** Maximum number of recursion that are allowed to resolve an IRI */ + const CONTEXT_MAX_IRI_RECURSIONS = 10; + + /** + * @var array A list of all defined keywords + */ + private static $keywords = array('@context', '@id', '@value', '@language', '@type', + '@container', '@list', '@set', '@graph', '@reverse', + '@base', '@vocab', '@index', '@null'); + // TODO Introduce @null supported just for framing + + /** + * @var array Framing options keywords + */ + private static $framingKeywords = array('@explicit', '@default', '@embed', + //'@omitDefault', // TODO Is this really needed? + '@embedChildren'); // TODO How should this be called? + // TODO Add @preserve, @null?? Update spec keyword list + + /** + * @var IRI The base IRI + */ + private $baseIri = null; + + /** + * Compact arrays with just one element to a scalar + * + * If set to true, arrays holding just one element are compacted to + * scalars, otherwise the arrays are kept as arrays. + * + * @var bool + */ + private $compactArrays; + + /** + * Optimize compacted output + * + * If set to true, the processor is free to optimize the result to produce + * an even compacter representation than the algorithm described by the + * official JSON-LD specification. + * + * @var bool + */ + private $optimize; + + /** + * Use native types when converting from RDF + * + * If set to true, the processor will try to convert datatyped literals + * to native types instead of using the expanded object form when + * converting from RDF. xsd:boolean values will be converted to booleans + * whereas xsd:integer and xsd:double values will be converted to numbers. + * + * @var bool + */ + private $useNativeTypes; + + /** + * Use rdf:type instead of \@type when converting from RDF + * + * If set to true, the JSON-LD processor will use the expanded rdf:type + * IRI as the property instead of \@type when converting from RDF. + * + * @var bool + */ + private $useRdfType; + + /** + * Produce generalized RDF + * + * Unless set to true, triples/quads with a blank node predicate are + * dropped when converting to RDF. + * + * @var bool + */ + private $generalizedRdf; + + /** + * @var array Blank node map + */ + private $blankNodeMap = array(); + + /** + * @var integer Blank node counter + */ + private $blankNodeCounter = 0; + + /** + * @var DocumentFactoryInterface The factory to create new documents + */ + private $documentFactory = null; + + /** + * @var DocumentLoaderInterface The document loader + */ + private $documentLoader = null; + + /** + * Constructor + * + * The options parameter must be passed and all off the following properties + * have to be set: + * + *
+ *
base
+ *
The base IRI.
+ * + *
compactArrays
+ *
If set to true, arrays holding just one element are compacted + * to scalars, otherwise the arrays are kept as arrays.
+ * + *
optimize
+ *
If set to true, the processor is free to optimize the result to + * produce an even compacter representation than the algorithm + * described by the official JSON-LD specification.
+ * + *
useNativeTypes
+ *
If set to true, the processor will try to convert datatyped + * literals to native types instead of using the expanded object form + * when converting from RDF. xsd:boolean values will be + * converted to booleans whereas xsd:integer and + * xsd:double values will be converted to numbers.
+ * + *
useRdfType
+ *
If set to true, the JSON-LD processor will use the expanded + * rdf:type IRI as the property instead of @type + * when converting from RDF.
+ *
+ * + * @param JsonObject $options Options to configure the various algorithms. + */ + public function __construct($options) + { + $this->baseIri = new IRI($options->base); + $this->compactArrays = (bool) $options->compactArrays; + $this->optimize = (bool) $options->optimize; + $this->useNativeTypes = (bool) $options->useNativeTypes; + $this->useRdfType = (bool) $options->useRdfType; + $this->generalizedRdf = (bool) $options->produceGeneralizedRdf; + $this->documentFactory = $options->documentFactory; + $this->documentLoader = $options->documentLoader; + } + + /** + * Parses a JSON-LD document to a PHP value + * + * @param string $document A JSON-LD document. + * + * @return mixed A PHP value. + * + * @throws JsonLdException If the JSON-LD document is not valid. + */ + public static function parse($document) + { + if (function_exists('mb_detect_encoding') && + (false === mb_detect_encoding($document, 'UTF-8', true))) { + throw new JsonLdException( + JsonLdException::LOADING_DOCUMENT_FAILED, + 'The JSON-LD document does not appear to be valid UTF-8.' + ); + } + + $data = json_decode($document, false, 512); + + switch (json_last_error()) { + case JSON_ERROR_NONE: + break; // no error + case JSON_ERROR_DEPTH: + throw new JsonLdException( + JsonLdException::LOADING_DOCUMENT_FAILED, + 'The maximum stack depth has been exceeded.' + ); + case JSON_ERROR_STATE_MISMATCH: + throw new JsonLdException( + JsonLdException::LOADING_DOCUMENT_FAILED, + 'Invalid or malformed JSON.' + ); + case JSON_ERROR_CTRL_CHAR: + throw new JsonLdException( + JsonLdException::LOADING_DOCUMENT_FAILED, + 'Control character error (possibly incorrectly encoded).' + ); + case JSON_ERROR_SYNTAX: + throw new JsonLdException( + JsonLdException::LOADING_DOCUMENT_FAILED, + 'Syntax error, malformed JSON.' + ); + case JSON_ERROR_UTF8: + throw new JsonLdException( + JsonLdException::LOADING_DOCUMENT_FAILED, + 'Malformed UTF-8 characters (possibly incorrectly encoded).' + ); + default: + throw new JsonLdException( + JsonLdException::LOADING_DOCUMENT_FAILED, + 'Unknown error while parsing JSON.' + ); + } + + return (empty($data)) ? null : $data; + } + + /** + * Parses a JSON-LD document and returns it as a Document + * + * @param array|JsonObject $input The JSON-LD document to process. + * + * @return Document The parsed JSON-LD document. + * + * @throws JsonLdException If the JSON-LD input document is invalid. + */ + public function getDocument($input) + { + $nodeMap = new JsonObject(); + $nodeMap->{'-' . JsonLD::DEFAULT_GRAPH} = new JsonObject(); + $this->generateNodeMap($nodeMap, $input); + + // We need to keep track of blank nodes as they are renamed when + // inserted into the Document + $nodes = array(); + + if (null === $this->documentFactory) { + $this->documentFactory = new DefaultDocumentFactory(); + } + + $document = $this->documentFactory->createDocument($this->baseIri); + + foreach ($nodeMap as $graphName => &$nodes) { + $graphName = substr($graphName, 1); + if (JsonLD::DEFAULT_GRAPH === $graphName) { + $graph = $document->getGraph(); + } else { + $graph = $document->createGraph($graphName); + } + + foreach ($nodes as $id => &$item) { + $node = $graph->createNode($item->{'@id'}, true); + unset($item->{'@id'}); + + // Process node type as it needs to be handled differently than + // other properties + // TODO Could this be avoided by enforcing rdf:type instead of @type? + if (property_exists($item, '@type')) { + foreach ($item->{'@type'} as $type) { + $node->addType($graph->createNode($type), true); + } + unset($item->{'@type'}); + } + + foreach ($item as $property => $values) { + foreach ($values as $value) { + if (property_exists($value, '@value')) { + $node->addPropertyValue($property, Value::fromJsonLd($value)); + } elseif (property_exists($value, '@id')) { + $node->addPropertyValue( + $property, + $graph->createNode($value->{'@id'}, true) + ); + } else { + // TODO Handle lists + throw new \Exception('Lists are not supported by getDocument() yet'); + } + } + } + } + } + + + unset($nodeMap); + + return $document; + } + + /** + * Expands a JSON-LD document + * + * @param mixed $element A JSON-LD element to be expanded. + * @param array $activectx The active context. + * @param null|string $activeprty The active property. + * @param boolean $frame True if a frame is being expanded, otherwise false. + * + * @return mixed The expanded document. + * + * @throws JsonLdException + */ + public function expand(&$element, $activectx = array(), $activeprty = null, $frame = false) + { + if (is_scalar($element)) { + + if ((null === $activeprty) || ('@graph' === $activeprty)) { + $element = null; + } else { + $element = $this->expandValue($element, $activectx, $activeprty); + } + + return; + } + + if (null === $element) { + return; + } + + if (is_array($element)) { + $result = array(); + foreach ($element as &$item) { + $this->expand($item, $activectx, $activeprty, $frame); + + // Check for lists of lists + if (('@list' === $this->getPropertyDefinition($activectx, $activeprty, '@container')) || + ('@list' === $activeprty)) { + if (is_array($item) || (is_object($item) && property_exists($item, '@list'))) { + throw new JsonLdException( + JsonLdException::LIST_OF_LISTS, + "List of lists detected in property \"$activeprty\".", + $element + ); + } + } + + if (is_array($item)) { + $result = array_merge($result, $item); + } elseif (null !== $item) { + $result[] = $item; + } + } + + $element = $result; + + return; + } + + // Otherwise it's an object. Process its local context if available + if (property_exists($element, '@context')) { + $this->processContext($element->{'@context'}, $activectx); + unset($element->{'@context'}); + } + + $properties = get_object_vars($element); + ksort($properties); + + $element = new JsonObject(); + + foreach ($properties as $property => $value) { + $expProperty = $this->expandIri($property, $activectx, false, true); + + // Make sure to keep framing keywords if a frame is being expanded + if ($frame && in_array($expProperty, self::$framingKeywords)) { + // and that the default value is expanded + if ('@default' === $expProperty) { + $this->expand($value, $activectx, $activeprty, $frame); + } + + self::setProperty($element, $expProperty, $value, JsonLdException::COLLIDING_KEYWORDS); + continue; + } + + if (in_array($expProperty, self::$keywords)) { + if ('@reverse' === $activeprty) { + throw new JsonLdException( + JsonLdException::INVALID_REVERSE_PROPERTY_MAP, + 'No keywords or keyword aliases are allowed in @reverse-maps, found ' . $expProperty + ); + } + $this->expandKeywordValue($element, $activeprty, $expProperty, $value, $activectx, $frame); + + continue; + } elseif (false === strpos($expProperty, ':')) { + // the expanded property is neither a keyword nor an IRI + continue; + } + + $propertyContainer = $this->getPropertyDefinition($activectx, $property, '@container'); + + if (is_object($value) && in_array($propertyContainer, array('@language', '@index'))) { + $result = array(); + + $value = (array) $value; // makes it easier to order the key-value pairs + ksort($value); + + if ('@language' === $propertyContainer) { + foreach ($value as $key => $val) { + // TODO Make sure key is a valid language tag + + if (false === is_array($val)) { + $val = array($val); + } + + foreach ($val as $item) { + if (false === is_string($item)) { + throw new JsonLdException( + JsonLdException::INVALID_LANGUAGE_MAP_VALUE, + "Detected invalid value in $property->$key: it must be a string as it " . + "is part of a language map.", + $item + ); + } + + $result[] = (object) array( + '@value' => $item, + '@language' => strtolower($key) + ); + } + } + } else { + // @container: @index + foreach ($value as $key => $val) { + if (false === is_array($val)) { + $val = array($val); + } + + $this->expand($val, $activectx, $property, $frame); + + foreach ($val as $item) { + if (false === property_exists($item, '@index')) { + $item->{'@index'} = $key; + } + + $result[] = $item; + } + } + } + + $value = $result; + } else { + $this->expand($value, $activectx, $property, $frame); + } + + // Remove properties with null values + if (null === $value) { + continue; + } + + // If property has an @list container and value is not yet an + // expanded @list-object, transform it to one + if (('@list' === $propertyContainer) && + ((false === is_object($value) || (false === property_exists($value, '@list'))))) { + if (false === is_array($value)) { + $value = array($value); + } + + $obj = new JsonObject(); + $obj->{'@list'} = $value; + $value = $obj; + } + + $target = $element; + if ($this->getPropertyDefinition($activectx, $property, '@reverse')) { + if (false === property_exists($target, '@reverse')) { + $target->{'@reverse'} = new JsonObject(); + } + $target = $target->{'@reverse'}; + + if (false === is_array($value)) { + $value = array($value); + } + + foreach ($value as $val) { + if (property_exists($val, '@value') || property_exists($val, '@list')) { + throw new JsonLdException( + JsonLdException::INVALID_REVERSE_PROPERTY_VALUE, + 'Detected invalid value in @reverse-map (only nodes are allowed', + $val + ); + } + } + } + + self::mergeIntoProperty($target, $expProperty, $value, true); + } + + // All properties have been processed. Make sure the result is valid + // and optimize it where possible + $numProps = count(get_object_vars($element)); + + // Remove free-floating nodes + if ((false === $frame) && ((null === $activeprty) || ('@graph' === $activeprty)) && + (((0 === $numProps) || property_exists($element, '@value') || property_exists($element, '@list') || + ((1 === $numProps) && property_exists($element, '@id'))))) { + + $element = null; + return; + } + + // Indexes are allowed everywhere + if (property_exists($element, '@index')) { + $numProps--; + } + + if (property_exists($element, '@value')) { + $numProps--; // @value + if (property_exists($element, '@language')) { + if (false === $frame) { + if (false === is_string($element->{'@language'})) { + throw new JsonLdException( + JsonLdException::INVALID_LANGUAGE_TAGGED_STRING, + 'Invalid value for @language detected (must be a string).', + $element + ); + } + + if (false === is_string($element->{'@value'})) { + throw new JsonLdException( + JsonLdException::INVALID_LANGUAGE_TAGGED_VALUE, + 'Only strings can be language tagged.', + $element + ); + } + } + + $numProps--; + } elseif (property_exists($element, '@type')) { + if ((false === $frame) && ((false === is_string($element->{'@type'})) || + (false === strpos($element->{'@type'}, ':')) || + ('_:' === substr($element->{'@type'}, 0, 2)))) { + throw new JsonLdException( + JsonLdException::INVALID_TYPED_VALUE, + 'Invalid value for @type detected (must be an IRI).', + $element + ); + } + + $numProps--; + } + + if ($numProps > 0) { + throw new JsonLdException( + JsonLdException::INVALID_VALUE_OBJECT, + 'Detected an invalid @value object.', + $element + ); + } elseif (null === $element->{'@value'}) { + // object has just an @value property that is null, can be replaced with that value + $element = $element->{'@value'}; + } + + return; + } + + // Not an @value object, make sure @type is an array + if (property_exists($element, '@type') && (false === is_array($element->{'@type'}))) { + $element->{'@type'} = array($element->{'@type'}); + } + if (($numProps > 1) && ((property_exists($element, '@list') || property_exists($element, '@set')))) { + throw new JsonLdException( + JsonLdException::INVALID_SET_OR_LIST_OBJECT, + 'An object with a @list or @set property can\'t contain other properties.', + $element + ); + } elseif (property_exists($element, '@set')) { + // @set objects can be optimized away as they are just syntactic sugar + $element = $element->{'@set'}; + } elseif (($numProps === 1) && (false === $frame) && property_exists($element, '@language')) { + // if there's just @language and nothing else and we are not expanding a frame, drop whole object + $element = null; + } + } + + /** + * Expands the value of a keyword + * + * @param JsonObject $element The object this property-value pair is part of. + * @param string $activeprty The active property. + * @param string $keyword The keyword whose value is being expanded. + * @param mixed $value The value to expand. + * @param array $activectx The active context. + * @param boolean $frame True if a frame is being expanded, otherwise false. + * + * @throws JsonLdException + */ + private function expandKeywordValue(&$element, $activeprty, $keyword, $value, $activectx, $frame) + { + // Ignore all null values except for @value as in that case it is + // needed to determine what @type means + if ((null === $value) && ('@value' !== $keyword)) { + return; + } + + if ('@id' === $keyword) { + if (false === is_string($value)) { + throw new JsonLdException( + JsonLdException::INVALID_ID_VALUE, + 'Invalid value for @id detected (must be a string).', + $element + ); + } + + $value = $this->expandIri($value, $activectx, true); + self::setProperty($element, $keyword, $value, JsonLdException::COLLIDING_KEYWORDS); + + return; + } + + if ('@type' === $keyword) { + if (is_string($value)) { + $value = $this->expandIri($value, $activectx, true, true); + self::setProperty($element, $keyword, $value, JsonLdException::COLLIDING_KEYWORDS); + + return; + } + + if (false === is_array($value)) { + $value = array($value); + } + + $result = array(); + + foreach ($value as $item) { + if (is_string($item)) { + $result[] = $this->expandIri($item, $activectx, true, true); + } else { + if (false === $frame) { + throw new JsonLdException( + JsonLdException::INVALID_TYPE_VALUE, + "Invalid value for $keyword detected.", + $value + ); + } + + self::mergeIntoProperty($element, $keyword, $item); + } + } + + // Don't keep empty arrays + if (count($result) >= 1) { + self::mergeIntoProperty($element, $keyword, $result, true); + } + } + + if (('@value' === $keyword)) { + if (false === $frame) { + if ((null !== $value) && (false === is_scalar($value))) { + // we need to preserve @value: null to distinguish values form nodes + throw new JsonLdException( + JsonLdException::INVALID_VALUE_OBJECT_VALUE, + "Invalid value for @value detected (must be a scalar).", + $value + ); + } + } elseif (false === is_array($value)) { + $value = array($value); + } + + self::setProperty($element, $keyword, $value, JsonLdException::COLLIDING_KEYWORDS); + + return; + } + + if (('@language' === $keyword) || ('@index' === $keyword)) { + if (false === $frame) { + if (false === is_string($value)) { + throw ('@language' === $keyword) + ? new JsonLdException( + JsonLdException::INVALID_LANGUAGE_TAGGED_STRING, + '@language must be a string', + $value + ) + : new JsonLdException( + JsonLdException::INVALID_INDEX_VALUE, + '@index must be a string', + $value + ); + } + } elseif (false === is_array($value)) { + $value = array($value); + } + + self::setProperty($element, $keyword, $value, JsonLdException::COLLIDING_KEYWORDS); + + return; + } + + // TODO Optimize the following code, there's a lot of repetition, only the $activeprty param is changing + if ('@list' === $keyword) { + if ((null === $activeprty) || ('@graph' === $activeprty)) { + return; + } + + $this->expand($value, $activectx, $activeprty, $frame); + + if (false === is_array($value)) { + $value = array($value); + } + + foreach ($value as $val) { + if (is_object($val) && property_exists($val, '@list')) { + throw new JsonLdException(JsonLdException::LIST_OF_LISTS, 'List of lists detected.', $element); + } + } + + self::mergeIntoProperty($element, $keyword, $value, true); + + return; + } + + if ('@set' === $keyword) { + $this->expand($value, $activectx, $activeprty, $frame); + self::mergeIntoProperty($element, $keyword, $value, true); + + return; + } + + if ('@reverse' === $keyword) { + if (false === is_object($value)) { + throw new JsonLdException( + JsonLdException::INVALID_REVERSE_VALUE, + 'Detected invalid value for @reverse (must be an object).', + $value + ); + } + + $this->expand($value, $activectx, $keyword, $frame); + + // Do not create @reverse-containers inside @reverse containers + if (property_exists($value, $keyword)) { + foreach (get_object_vars($value->{$keyword}) as $prop => $val) { + self::mergeIntoProperty($element, $prop, $val, true); + } + + unset($value->{$keyword}); + } + + $value = get_object_vars($value); + + if ((count($value) > 0) && (false === property_exists($element, $keyword))) { + $element->{$keyword} = new JsonObject(); + } + + foreach ($value as $prop => $val) { + foreach ($val as $v) { + if (property_exists($v, '@value') || property_exists($v, '@list')) { + throw new JsonLdException( + JsonLdException::INVALID_REVERSE_PROPERTY_VALUE, + 'Detected invalid value in @reverse-map (only nodes are allowed', + $v + ); + } + self::mergeIntoProperty($element->{$keyword}, $prop, $v, true); + } + } + + return; + } + + if ('@graph' === $keyword) { + $this->expand($value, $activectx, $keyword, $frame); + self::mergeIntoProperty($element, $keyword, $value, true); + + return; + } + } + + /** + * Expands a scalar value + * + * @param mixed $value The value to expand. + * @param array $activectx The active context. + * @param string $activeprty The active property. + * + * @return JsonObject The expanded value. + */ + private function expandValue($value, $activectx, $activeprty) + { + $def = $this->getPropertyDefinition($activectx, $activeprty); + + $result = new JsonObject(); + + if ('@id' === $def['@type']) { + $result->{'@id'} = $this->expandIri($value, $activectx, true); + } elseif ('@vocab' === $def['@type']) { + $result->{'@id'} = $this->expandIri($value, $activectx, true, true); + } else { + $result->{'@value'} = $value; + + if (isset($def['@type'])) { + $result->{'@type'} = $def['@type']; + } elseif (isset($def['@language']) && is_string($result->{'@value'})) { + $result->{'@language'} = $def['@language']; + } + } + + return $result; + } + + /** + * Expands a JSON-LD IRI value (term, compact IRI, IRI) to an absolute + * IRI and relabels blank nodes + * + * @param mixed $value The value to be expanded to an absolute IRI. + * @param array $activectx The active context. + * @param bool $relativeIri Specifies whether $value should be treated as + * relative IRI against the base IRI or not. + * @param bool $vocabRelative Specifies whether $value is relative to @vocab + * if set or not. + * @param null|JsonObject $localctx If the IRI is being expanded as part of context + * processing, the current local context has to be + * passed as well. + * @param array $path A path of already processed terms to detect + * circular dependencies + * + * @return string The expanded IRI. + */ + private function expandIri( + $value, + $activectx, + $relativeIri = false, + $vocabRelative = false, + $localctx = null, + $path = array() + ) { + if ((null === $value) || in_array($value, self::$keywords)) { + return $value; + } + + if ($localctx) { + if (in_array($value, $path)) { + throw new JsonLdException( + JsonLdException::CYCLIC_IRI_MAPPING, + 'Cycle in context definition detected: ' . join(' -> ', $path) . ' -> ' . $path[0], + $localctx + ); + } else { + $path[] = $value; + + if (count($path) >= self::CONTEXT_MAX_IRI_RECURSIONS) { + throw new JsonLdException( + JsonLdException::UNSPECIFIED, + 'Too many recursions in term definition: ' . join(' -> ', $path) . ' -> ' . $path[0], + $localctx + ); + } + } + + if (isset($localctx->{$value})) { + $nested = null; + + if (is_string($localctx->{$value})) { + $nested = $localctx->{$value}; + } elseif (isset($localctx->{$value}->{'@id'})) { + $nested = $localctx->{$value}->{'@id'}; + } + + if ($nested && (end($path) !== $nested)) { + return $this->expandIri($nested, $activectx, false, true, $localctx, $path); + } + } + } + + // Terms apply only for vocab-relative IRIs + if ((true === $vocabRelative) && array_key_exists($value, $activectx)) { + return $activectx[$value]['@id']; + } + + if (false !== strpos($value, ':')) { + list($prefix, $suffix) = explode(':', $value, 2); + + if (('_' === $prefix) || ('//' === substr($suffix, 0, 2))) { + // Safety measure to prevent reassigned of, e.g., http:// + // the "_" prefix is reserved for blank nodes and can't be expanded + return $value; + } + + if ($localctx) { + $prefix = $this->expandIri($prefix, $activectx, false, true, $localctx, $path); + + // If prefix contains a colon, we have successfully expanded it + if (false !== strpos($prefix, ':')) { + return $prefix . $suffix; + } + } elseif (array_key_exists($prefix, $activectx)) { + // compact IRI + return $activectx[$prefix]['@id'] . $suffix; + } + } else { + if ($vocabRelative && array_key_exists('@vocab', $activectx)) { + return $activectx['@vocab'] . $value; + } elseif (($relativeIri) && (null !== $activectx['@base'])) { + return (string) $activectx['@base']->resolve($value); + } + } + + // can't expand it, return as is + return $value; + } + + /** + * Compacts a JSON-LD document + * + * Attention: This method must be called with an expanded element, + * otherwise it might not work. + * + * @param mixed $element A JSON-LD element to be compacted. + * @param array $activectx The active context. + * @param array $inversectx The inverse context. + * @param null|string $activeprty The active property. + * + * @return mixed The compacted JSON-LD document. + */ + public function compact(&$element, $activectx = array(), $inversectx = array(), $activeprty = null) + { + if (is_array($element)) { + $result = array(); + foreach ($element as &$item) { + $this->compact($item, $activectx, $inversectx, $activeprty); + if (null !== $item) { + $result[] = $item; + } + } + + if ($this->compactArrays && (1 === count($result))) { + $element = $result[0]; + } else { + $element = $result; + } + + return; + } + + if (false === is_object($element)) { + // element is already in compact form, nothing else to do + return; + } + + if (property_exists($element, '@value') || property_exists($element, '@id')) { + $def = $this->getPropertyDefinition($activectx, $activeprty); + $element = $this->compactValue($element, $def, $activectx, $inversectx); + + if (false === is_object($element)) { + return; + } + } + + // Otherwise, compact all properties + $properties = get_object_vars($element); + ksort($properties); + + $inReverse = ('@reverse' === $activeprty); + $element = new JsonObject(); + + foreach ($properties as $property => $value) { + if (in_array($property, self::$keywords)) { + if ('@id' === $property) { + $value = $this->compactIri($value, $activectx, $inversectx); + } elseif ('@type' === $property) { + if (is_string($value)) { + $value = $this->compactIri($value, $activectx, $inversectx, null, true); + } else { + foreach ($value as &$iri) { + $iri = $this->compactIri($iri, $activectx, $inversectx, null, true); + } + + if ($this->compactArrays && (1 === count($value))) { + $value = $value[0]; + } + } + } elseif (('@graph' === $property) || ('@list' === $property)) { + $this->compact($value, $activectx, $inversectx, $property); + + if (false === is_array($value)) { + $value = array($value); + } + } elseif ('@reverse' === $property) { + $this->compact($value, $activectx, $inversectx, $property); + + // Move reverse properties out of the map into element + foreach (get_object_vars($value) as $prop => $val) { + if ($this->getPropertyDefinition($activectx, $prop, '@reverse')) { + $alwaysArray = ('@set' === $this->getPropertyDefinition($activectx, $prop, '@container')); + self::mergeIntoProperty($element, $prop, $val, $alwaysArray); + unset($value->{$prop}); + } + } + + if (0 === count(get_object_vars($value))) { + continue; // no properties left in the @reverse-map + } + } + + // Get the keyword alias from the inverse context if available + $activeprty = (isset($inversectx[$property]['term'])) + ? $inversectx[$property]['term'] + : $property; + + self::setProperty($element, $activeprty, $value, JsonLdException::COLLIDING_KEYWORDS); + + // ... continue with next property + continue; + } + + // handle @null-objects as used in framing + if (is_object($value) && property_exists($value, '@null')) { + $activeprty = $this->compactIri($property, $activectx, $inversectx, null, true, $inReverse); + + if (false === property_exists($element, $activeprty)) { + $element->{$activeprty} = null; + } + + continue; + } + + // Make sure that empty arrays are preserved + if (0 === count($value)) { + $activeprty = $this->compactIri($property, $activectx, $inversectx, null, true, $inReverse); + + self::mergeIntoProperty($element, $activeprty, $value); + + // ... continue with next property + continue; + } + + // Compact every item in value separately as they could map to different terms + foreach ($value as $item) { + $activeprty = $this->compactIri($property, $activectx, $inversectx, $item, true, $inReverse); + $def = $this->getPropertyDefinition($activectx, $activeprty); + + if (in_array($def['@container'], array('@language', '@index'))) { + if (false === property_exists($element, $activeprty)) { + $element->{$activeprty} = new JsonObject(); + } + + $def[$def['@container']] = $item->{$def['@container']}; + $item = $this->compactValue($item, $def, $activectx, $inversectx); + + $this->compact($item, $activectx, $inversectx, $activeprty); + + self::mergeIntoProperty($element->{$activeprty}, $def[$def['@container']], $item); + + continue; + } + + if (is_object($item)) { + if (property_exists($item, '@list')) { + $this->compact($item->{'@list'}, $activectx, $inversectx, $activeprty); + + if (false === is_array($item->{'@list'})) { + $item->{'@list'} = array($item->{'@list'}); + } + + if ('@list' === $def['@container']) { + // a term can just hold one list if it has a @list container + // (we don't support lists of lists) + self::setProperty( + $element, + $activeprty, + $item->{'@list'}, + JsonLdException::COMPACTION_TO_LIST_OF_LISTS + ); + + continue; // ... continue with next value + } else { + $result = new JsonObject(); + + $alias = $this->compactIri('@list', $activectx, $inversectx, null, true); + $result->{$alias} = $item->{'@list'}; + + if (isset($item->{'@index'})) { + $alias = $this->compactIri('@index', $activectx, $inversectx, null, true); + $result->{$alias} = $item->{'@index'}; + } + + $item = $result; + } + } else { + $this->compact($item, $activectx, $inversectx, $activeprty); + } + } + + // Merge value back into resulting object making sure that value is always + // an array if a container is set or compactArrays is set to false + $asArray = ((false === $this->compactArrays) || (false === $def['compactArrays'])); + + self::mergeIntoProperty($element, $activeprty, $item, $asArray); + } + } + } + + /** + * Compacts a value + * + * The passed property definition must be an associative array + * containing the following data: + * + * + * @type => type IRI or null + * @language => language code or null + * @index => index string or null + * @container => the container: @set, @list, @language, or @index + * + * + * @param mixed $value The value to compact (arrays are not allowed!). + * @param array $definition The active property's definition. + * @param array $activectx The active context. + * @param array $inversectx The inverse context. + * + * @return mixed The compacted value. + */ + private function compactValue($value, $definition, $activectx, $inversectx) + { + if ('@index' === $definition['@container']) { + unset($value->{'@index'}); + } + + $numProperties = count(get_object_vars($value)); + + // @id object + if (property_exists($value, '@id')) { + if (1 === $numProperties) { + if ('@id' === $definition['@type']) { + return $this->compactIri($value->{'@id'}, $activectx, $inversectx); + } + + if ('@vocab' === $definition['@type']) { + return $this->compactIri($value->{'@id'}, $activectx, $inversectx, null, true); + } + } + + return $value; + } + + // @value object + $criterion = (isset($value->{'@type'})) ? '@type' : null; + $criterion = (isset($value->{'@language'})) ? '@language' : $criterion; + + if (null !== $criterion) { + if ((2 === $numProperties) && ($value->{$criterion} === $definition[$criterion])) { + return $value->{'@value'}; + } + + return $value; + } + + // the object has neither a @type nor a @language property + // check the active property's definition + if (is_string($value->{'@value'}) && (null !== $definition['@language'])) { + // if the property is language tagged or there's a default language, + // we can't compact the value if it is a string + return $value; + } + + // we can compact the value + return (1 === $numProperties) ? $value->{'@value'} : $value; + } + + /** + * Compacts an absolute IRI (or aliases a keyword) + * + * If the IRI couldn't be compacted, the IRI is returned as is. + * + * @param mixed $iri The IRI to be compacted. + * @param array $activectx The active context. + * @param array $inversectx The inverse context. + * @param mixed $value The value of the property to compact. + * @param bool $vocabRelative If `true` is passed, this method tries + * to convert the IRI to an IRI relative to + * `@vocab`; otherwise, that fall back + * mechanism is disabled. + * @param bool $reverse Is the IRI used within a @reverse container? + * + * @return string Returns the compacted IRI on success; otherwise the + * IRI is returned as is. + */ + private function compactIri($iri, $activectx, $inversectx, $value = null, $vocabRelative = false, $reverse = false) + { + if ((true === $vocabRelative) && array_key_exists($iri, $inversectx)) { + if (null !== $value) { + $valueProfile = $this->getValueProfile($value, $inversectx); + + $container = ('@list' === $valueProfile['@container']) + ? array('@list', '@null') + : array($valueProfile['@container'], '@set', '@null'); + + if (null === $valueProfile['typeLang']) { + $typeOrLang = array('@null'); + $typeOrLangValue = array('@null'); + } else { + $typeOrLang = array($valueProfile['typeLang'], '@null'); + $typeOrLangValue = array(); + + if (true === $reverse) { + $typeOrLangValue[] = '@reverse'; + } + + if (('@type' === $valueProfile['typeLang']) && ('@id' === $valueProfile['typeLangValue'])) { + array_push($typeOrLangValue, '@id', '@vocab', '@null'); + } elseif (('@type' === $valueProfile['typeLang']) && + ('@vocab' === $valueProfile['typeLangValue'])) { + array_push($typeOrLangValue, '@vocab', '@id', '@null'); + } else { + $typeOrLangValue = array($valueProfile['typeLangValue'], '@null'); + } + } + + $result = $this->queryInverseContext($inversectx[$iri], $container, $typeOrLang, $typeOrLangValue); + + if (null !== $result) { + return $result; + } + } elseif (isset($inversectx[$iri]['term'])) { + return $inversectx[$iri]['term']; + } + } + + // Compact using @vocab + if ($vocabRelative && isset($activectx['@vocab']) && (0 === strpos($iri, $activectx['@vocab'])) && + (false !== ($vocabIri = substr($iri, strlen($activectx['@vocab'])))) && + (false === isset($activectx[$vocabIri]))) { + return $vocabIri; + } + + // Try to compact to a compact IRI + foreach ($inversectx as $termIri => $def) { + $termIriLen = strlen($termIri); + + if (isset($def['term']) && (0 === strncmp($iri, $termIri, $termIriLen))) { + $compactIri = substr($iri, $termIriLen); + + if (false !== $compactIri && '' !== $compactIri) { + $compactIri = $def['term'] . ':' . $compactIri; + + if (false === isset($activectx[$compactIri]) || + ((false === $vocabRelative) && ($iri === $activectx[$compactIri]['@id']))) { + return $compactIri; + } + } + } + } + + // Last resort, convert to a relative IRI + if ((false === $vocabRelative) && (null !== $activectx['@base'])) { + return (string) $activectx['@base']->baseFor($iri); + } + + // IRI couldn't be compacted, return as is + return $iri; + } + + /** + * Verifies whether two JSON-LD subtrees are equal not + * + * Please note that two unlabeled blank nodes will never be equal by + * definition. + * + * @param mixed $a The first subtree. + * @param mixed $b The second subree. + * + * @return bool Returns true if the two subtrees are equal; otherwise + * false. + */ + private static function subtreeEquals($a, $b) + { + if (gettype($a) !== gettype($b)) { + return false; + } + + if (is_scalar($a)) { + return ($a === $b); + } + + if (is_array($a)) { + $len = count($a); + + if ($len !== count($b)) { + return false; + } + + // TODO Ignore order for sets? + for ($i = 0; $i < $len; $i++) { + if (false === self::subtreeEquals($a[$i], $b[$i])) { + return false; + } + } + + return true; + } + + if (!property_exists($a, '@id') && + !property_exists($a, '@value') && + !property_exists($a, '@list')) { + // Blank nodes can never match as they can't be identified + return false; + } + + $properties = array_keys(get_object_vars($a)); + + if (count($properties) !== count(get_object_vars($b))) { + return false; + } + + foreach ($properties as $property) { + if ((false === property_exists($b, $property)) || + (false === self::subtreeEquals($a->{$property}, $b->{$property}))) { + return false; + } + } + + return true; + } + + /** + * Calculates a value profile + * + * A value profile represent the schema of the value ignoring the + * concrete value. It is an associative array containing the following + * keys-value pairs: + * + * * `@container`: the container, defaults to `@set` + * * `typeLang`: is set to `@type` for typed values or `@language` for + * (language-tagged) strings; for all other values it is set to + * `null` + * * `typeLangValue`: set to the type of a typed value or the language + * of a language-tagged string (`@null` for all other strings); for + * all other values it is set to `null` + * + * @param JsonObject $value The value. + * @param array $inversectx The inverse context. + * + * @return array The value profile. + */ + private function getValueProfile(JsonObject $value, $inversectx) + { + $valueProfile = array( + '@container' => '@set', + 'typeLang' => '@type', + 'typeLangValue' => '@id' + ); + + if (property_exists($value, '@index')) { + $valueProfile['@container'] = '@index'; + } + + if (property_exists($value, '@id')) { + if (isset($inversectx[$value->{'@id'}]['term'])) { + $valueProfile['typeLangValue'] = '@vocab'; + } else { + $valueProfile['typeLangValue'] = '@id'; + } + + return $valueProfile; + } + + if (property_exists($value, '@value')) { + if (property_exists($value, '@type')) { + $valueProfile['typeLang'] = '@type'; + $valueProfile['typeLangValue'] = $value->{'@type'}; + } elseif (property_exists($value, '@language')) { + $valueProfile['typeLang'] = '@language'; + $valueProfile['typeLangValue'] = $value->{'@language'}; + + if (false === property_exists($value, '@index')) { + $valueProfile['@container'] = '@language'; + } + } else { + $valueProfile['typeLang'] = '@language'; + $valueProfile['typeLangValue'] = '@null'; + } + + return $valueProfile; + } + + if (property_exists($value, '@list')) { + $len = count($value->{'@list'}); + + if ($len > 0) { + $valueProfile = $this->getValueProfile($value->{'@list'}[0], $inversectx); + } + + if (false === property_exists($value, '@index')) { + $valueProfile['@container'] = '@list'; + } + + + for ($i = $len - 1; $i > 0; $i--) { + $profile = $this->getValueProfile($value->{'@list'}[$i], $inversectx); + + if (($valueProfile['typeLang'] !== $profile['typeLang']) || + ($valueProfile['typeLangValue'] !== $profile['typeLangValue'])) { + $valueProfile['typeLang'] = null; + $valueProfile['typeLangValue'] = null; + + return $valueProfile; + } + } + } + + return $valueProfile; + } + + /** + * Queries the inverse context to find the term for a given query + * path (= value profile) + * + * @param array $inversectx The inverse context (or a subtree thereof) + * @param string[] $containers + * @param string[] $typeOrLangs + * @param string[] $typeOrLangValues + * + * @return null|string The best matching term or null if none was found. + */ + private function queryInverseContext($inversectx, $containers, $typeOrLangs, $typeOrLangValues) + { + foreach ($containers as $container) { + foreach ($typeOrLangs as $typeOrLang) { + foreach ($typeOrLangValues as $typeOrLangValue) { + if (isset($inversectx[$container][$typeOrLang][$typeOrLangValue])) { + return $inversectx[$container][$typeOrLang][$typeOrLangValue]; + } + } + } + } + + return null; + } + + /** + * Returns a property's definition + * + * The result will be in the form + * + * + * array('@type' => type or null, + * '@language' => language or null, + * '@container' => container or null, + * 'isKeyword' => true or false) + * + * + * If `$only` is set, only the value of that key of the array + * above will be returned. + * + * @param array $activectx The active context. + * @param string $property The property. + * @param null|string $only If set, only this element of the + * definition will be returned. + * + * @return array|string|null Returns either the property's definition or + * null if not found. + */ + private function getPropertyDefinition($activectx, $property, $only = null) + { + $result = array( + '@reverse' => false, + '@type' => null, + '@language' => (isset($activectx['@language'])) + ? $activectx['@language'] + : null, + '@index' => null, + '@container' => null, + 'isKeyword' => false, + 'compactArrays' => true + ); + + if (in_array($property, self::$keywords)) { + $result['@type'] = (('@id' === $property) || ('@type' === $property)) + ? '@id' + : null; + $result['@language'] = null; + $result['isKeyword'] = true; + $result['compactArrays'] = (bool) (('@list' !== $property) && ('@graph' !== $property)); + } else { + $def = (isset($activectx[$property])) ? $activectx[$property] : null; + + if (null !== $def) { + $result['@id'] = $def['@id']; + $result['@reverse'] = $def['@reverse']; + + if (isset($def['@type'])) { + $result['@type'] = $def['@type']; + $result['@language'] = null; + } elseif (array_key_exists('@language', $def)) { // could be null + $result['@language'] = $def['@language']; + } + + if (isset($def['@container'])) { + $result['@container'] = $def['@container']; + + if (('@list' === $def['@container']) || ('@set' === $def['@container'])) { + $result['compactArrays'] = false; + } + } + } + } + + if ($only) { + return (isset($result[$only])) ? $result[$only] : null; + } + + return $result; + } + + /** + * Processes a local context to update the active context + * + * @param mixed $loclctx The local context. + * @param array $activectx The active context. + * @param array $remotectxs The already included remote contexts. + * + * @throws JsonLdException + */ + public function processContext($loclctx, &$activectx, $remotectxs = array()) + { + if (is_object($loclctx)) { + $loclctx = clone $loclctx; + } + + if (false === is_array($loclctx)) { + $loclctx = array($loclctx); + } + + foreach ($loclctx as $context) { + if (null === $context) { + $activectx = array('@base' => $this->baseIri); + } elseif (is_object($context)) { + // make sure we don't modify the passed context + $context = clone $context; + + if (property_exists($context, '@base')) { + if (count($remotectxs) > 0) { + // do nothing, @base is ignored in a remote context + } elseif (null === $context->{'@base'}) { + $activectx['@base'] = null; + } elseif (false === is_string($context->{'@base'})) { + throw new JsonLdException( + JsonLdException::INVALID_BASE_IRI, + 'The value of @base must be an IRI or null.', + $context + ); + } else { + $base = new IRI($context->{'@base'}); + if (false === $base->isAbsolute()) { + if (null === $activectx['@base']) { + throw new JsonLdException( + JsonLdException::INVALID_BASE_IRI, + 'The relative base IRI cannot be resolved to an absolute IRI.', + $context + ); + } + + $activectx['@base'] = $activectx['@base']->resolve($base); + } else { + $activectx['@base'] = $base; + } + } + + unset($context->{'@base'}); + } + + if (property_exists($context, '@vocab')) { + if (null === $context->{'@vocab'}) { + unset($activectx['@vocab']); + } elseif ((false === is_string($context->{'@vocab'})) || + (false === strpos($context->{'@vocab'}, ':'))) { + throw new JsonLdException( + JsonLdException::INVALID_VOCAB_MAPPING, + 'The value of @vocab must be an absolute IRI or null.invalid vocab mapping, ', + $context + ); + } else { + $activectx['@vocab'] = $context->{'@vocab'}; + } + + unset($context->{'@vocab'}); + } + + if (property_exists($context, '@language')) { + if ((null !== $context->{'@language'}) && (false === is_string($context->{'@language'}))) { + throw new JsonLdException( + JsonLdException::INVALID_DEFAULT_LANGUAGE, + 'The value of @language must be a string.', + $context + ); + } + + $activectx['@language'] = $context->{'@language'}; + unset($context->{'@language'}); + } + + foreach ($context as $key => $value) { + unset($context->{$key}); + unset($activectx[$key]); + + if (in_array($key, self::$keywords)) { + throw new JsonLdException(JsonLdException::KEYWORD_REDEFINITION, null, $key); + } + + if ((null === $value) || is_string($value)) { + $value = (object) array('@id' => $value); + } elseif (is_object($value)) { + $value = clone $value; // make sure we don't modify context entries + } else { + throw new JsonLdException(JsonLdException::INVALID_TERM_DEFINITION); + } + + if (property_exists($value, '@reverse')) { + if (property_exists($value, '@id')) { + throw new JsonLdException( + JsonLdException::INVALID_REVERSE_PROPERTY, + "Invalid term definition using both @reverse and @id detected", + $value + ); + } + + if (property_exists($value, '@container') && + ('@index' !== $value->{'@container'}) && + ('@set' !== $value->{'@container'})) { + throw new JsonLdException( + JsonLdException::INVALID_REVERSE_PROPERTY, + "Terms using the @reverse feature support only @set- and @index-containers.", + $value + ); + } + + $value->{'@id'} = $value->{'@reverse'}; + $value->{'@reverse'} = true; + } else { + $value->{'@reverse'} = false; + } + + if (property_exists($value, '@id')) { + if ((null !== $value->{'@id'}) && (false === is_string($value->{'@id'}))) { + throw new JsonLdException(JsonLdException::INVALID_IRI_MAPPING, null, $value->{'@id'}); + } + + $path = array(); + if ($key !== $value->{'@id'}) { + $path[] = $key; + } + + $expanded = $this->expandIri($value->{'@id'}, $activectx, false, true, $context, $path); + + if ($value->{'@reverse'} && (false === strpos($expanded, ':'))) { + throw new JsonLdException( + JsonLdException::INVALID_IRI_MAPPING, + "Reverse properties must expand to absolute IRIs, \"$key\" expands to \"$expanded\"." + ); + } elseif ('@context' === $expanded) { + throw new JsonLdException( + JsonLdException::INVALID_KEYWORD_ALIAS, + 'Aliases for @context are not supported', + $value + ); + } + } else { + $expanded = $this->expandIri($key, $activectx, false, true, $context); + } + + + if ((null === $expanded) || in_array($expanded, self::$keywords)) { + // if it's an aliased keyword or the IRI is null, we ignore all other properties + // TODO Should we throw an exception if there are other properties? + $activectx[$key] = array('@id' => $expanded, '@reverse' => false); + + continue; + } elseif (false === strpos($expanded, ':')) { + throw new JsonLdException( + JsonLdException::INVALID_IRI_MAPPING, + "Failed to expand \"$key\" to an absolute IRI.", + $loclctx + ); + } + + $activectx[$key] = array('@id' => $expanded, '@reverse' => $value->{'@reverse'}); + + if (isset($value->{'@type'})) { + if (false === is_string($value->{'@type'})) { + throw new JsonLdException(JsonLdException::INVALID_TYPE_MAPPING); + } + + $expanded = $this->expandIri($value->{'@type'}, $activectx, false, true, $context); + + if (('@id' !== $expanded) && ('@vocab' !== $expanded) && + ((false === strpos($expanded, ':') || (0 === strpos($expanded, '_:'))))) { + throw new JsonLdException( + JsonLdException::INVALID_TYPE_MAPPING, + "Failed to expand $expanded to an absolute IRI.", + $loclctx + ); + } + + $activectx[$key]['@type'] = $expanded; + } elseif (property_exists($value, '@language')) { + if ((false === is_string($value->{'@language'})) && (null !== $value->{'@language'})) { + throw new JsonLdException( + JsonLdException::INVALID_LANGUAGE_MAPPING, + 'The value of @language must be a string or null.', + $value + ); + } + + // Note the else. Language tagging applies just to term without type coercion + $activectx[$key]['@language'] = $value->{'@language'}; + } + + if (isset($value->{'@container'})) { + if (in_array($value->{'@container'}, array('@list', '@set', '@language', '@index'))) { + $activectx[$key]['@container'] = $value->{'@container'}; + } else { + throw new JsonLdException( + JsonLdException::INVALID_CONTAINER_MAPPING, + 'A container mapping of ' . $value->{'@container'} . ' is not supported.' + ); + } + } + } + } elseif (is_string($context)) { + $remoteContext = new IRI($context); + if ($remoteContext->isAbsolute()) { + $remoteContext = (string) $remoteContext; + } elseif (null === $activectx['@base']) { + throw new JsonLdException( + JsonLdException::INVALID_BASE_IRI, + 'Can not resolve the relative URL of the remote context as no base has been set: ' . $remoteContext + ); + } else { + $remoteContext = (string) $activectx['@base']->resolve($context); + } + if (in_array($remoteContext, $remotectxs)) { + throw new JsonLdException( + JsonLdException::RECURSIVE_CONTEXT_INCLUSION, + 'Recursive inclusion of remote context: ' . join(' -> ', $remotectxs) . ' -> ' . $remoteContext + ); + } + $remotectxs[] = $remoteContext; + + try { + $remoteContext = $this->loadDocument($remoteContext); + } catch (JsonLdException $e) { + throw new JsonLdException( + JsonLdException::LOADING_REMOTE_CONTEXT_FAILED, + "Loading $remoteContext failed", + null, + null, + $e + ); + } + + if (is_object($remoteContext) && property_exists($remoteContext, '@context')) { + // TODO Use the context's IRI as base IRI when processing remote contexts (ISSUE-24) + $this->processContext($remoteContext->{'@context'}, $activectx, $remotectxs); + } else { + throw new JsonLdException( + JsonLdException::INVALID_REMOTE_CONTEXT, + 'Remote context "' . $context . '" is invalid.', + $remoteContext + ); + } + } else { + throw new JsonLdException(JsonLdException::INVALID_LOCAL_CONTEXT); + } + } + } + + /** + * Load a JSON-LD document + * + * The document can be supplied directly as string, by passing a file + * path, or by passing a URL. + * + * @param null|string|array|JsonObject $input The JSON-LD document or a path + * or URL pointing to one. + * + * @return mixed The loaded JSON-LD document + * + * @throws JsonLdException + */ + private function loadDocument($input) + { + if (false === is_string($input)) { + // Return as is - it has already been parsed + return $input; + } + + $document = $this->documentLoader->loadDocument($input); + + return $document->document; + } + + /** + * Creates an inverse context to simplify IRI compaction + * + * The inverse context is a multidimensional array that has the + * following shape: + * + * + * [container|@null|term] + * [@type|@language][typeIRI|languageCode] + * [@null][@null] + * [term|propGen] + * [ array of terms ] + * + * + * @param array $activectx The active context. + * + * @return array The inverse context. + */ + public function createInverseContext($activectx) + { + $inverseContext = array(); + + $defaultLanguage = isset($activectx['@language']) ? $activectx['@language'] : '@null'; + $propertyGenerators = isset($activectx['@propertyGenerators']) ? $activectx['@propertyGenerators'] : array(); + + unset($activectx['@base']); + unset($activectx['@vocab']); + unset($activectx['@language']); + unset($activectx['@propertyGenerators']); + + $activectx = array_merge($activectx, $propertyGenerators); + unset($propertyGenerators); + + uksort($activectx, array($this, 'sortTerms')); + + // Put every IRI of each term into the inverse context + foreach ($activectx as $term => $def) { + if (null === $def['@id']) { + // this is necessary since some terms can be decoupled from @vocab + continue; + } + + $container = (isset($def['@container'])) ? $def['@container'] : '@null'; + $iri = $def['@id']; + + if (false === isset($inverseContext[$iri]['term']) && (false === $def['@reverse'])) { + $inverseContext[$iri]['term'] = $term; + } + + $typeOrLang = '@null'; + $typeLangValue = '@null'; + + if (true === $def['@reverse']) { + $typeOrLang = '@type'; + $typeLangValue = '@reverse'; + } elseif (isset($def['@type'])) { + $typeOrLang = '@type'; + $typeLangValue = $def['@type']; + } elseif (array_key_exists('@language', $def)) { // can be null + $typeOrLang = '@language'; + $typeLangValue = (null === $def['@language']) ? '@null' : $def['@language']; + } else { + // Every untyped term is implicitly set to the default language + if (false === isset($inverseContext[$iri][$container]['@language'][$defaultLanguage])) { + $inverseContext[$iri][$container]['@language'][$defaultLanguage] = $term; + } + } + + if (false === isset($inverseContext[$iri][$container][$typeOrLang][$typeLangValue])) { + $inverseContext[$iri][$container][$typeOrLang][$typeLangValue] = $term; + } + } + + // Sort the whole inverse context in reverse order, the longest IRI comes first + uksort($inverseContext, array($this, 'sortTerms')); + $inverseContext = array_reverse($inverseContext); + + return $inverseContext; + } + + /** + * Creates a node map of an expanded JSON-LD document + * + * All keys in the node map are prefixed with "-" to support empty strings. + * + * @param JsonObject $nodeMap The object holding the node map. + * @param JsonObject|JsonObject[] $element An expanded JSON-LD element to + * be put into the node map + * @param string $activegraph The graph currently being processed. + * @param null|string $activeid The node currently being processed. + * @param null|string $activeprty The property currently being processed. + * @param null|JsonObject $list The list object if a list is being + * processed. + */ + private function generateNodeMap( + &$nodeMap, + $element, + $activegraph = JsonLD::DEFAULT_GRAPH, + $activeid = null, + $activeprty = null, + &$list = null + ) { + if (is_array($element)) { + foreach ($element as $item) { + $this->generateNodeMap($nodeMap, $item, $activegraph, $activeid, $activeprty, $list); + } + + return; + } + + // Relabel blank nodes in @type and add a node to the current graph + if (property_exists($element, '@type')) { + $types = null; + + if (is_array($element->{'@type'})) { + $types = &$element->{'@type'}; + } else { + $types = array(&$element->{'@type'}); + } + + foreach ($types as &$type) { + if (0 === strncmp($type, '_:', 2)) { + $type = $this->getBlankNodeId($type); + } + } + } + + if (property_exists($element, '@value')) { + // Handle value objects + if (null === $list) { + $this->mergeIntoProperty( + $nodeMap->{'-' . $activegraph}->{'-' . $activeid}, + $activeprty, + $element, + true, + true + ); + } else { + $this->mergeIntoProperty($list, '@list', $element, true, false); + } + } elseif (property_exists($element, '@list')) { + // lists + $result = new JsonObject(); + $result->{'@list'} = array(); + + $this->generateNodeMap($nodeMap, $element->{'@list'}, $activegraph, $activeid, $activeprty, $result); + $this->mergeIntoProperty( + $nodeMap->{'-' . $activegraph}->{'-' . $activeid}, + $activeprty, + $result, + true, + false + ); + } else { + // and node objects + if (false === property_exists($element, '@id')) { + $id = $this->getBlankNodeId(); + } elseif (0 === strncmp($element->{'@id'}, '_:', 2)) { + $id = $this->getBlankNodeId($element->{'@id'}); + } else { + $id = $element->{'@id'}; + } + unset($element->{'@id'}); + + // Create node in node map if it doesn't exist yet + if (false === property_exists($nodeMap->{'-' . $activegraph}, '-' . $id)) { + $node = new JsonObject(); + $node->{'@id'} = $id; + $nodeMap->{'-' . $activegraph}->{'-' . $id} = $node; + } else { + $node = $nodeMap->{'-' . $activegraph}->{'-' . $id}; + } + + // Add reference to active property + if (is_object($activeid)) { + $this->mergeIntoProperty($node, $activeprty, $activeid, true, true); + } elseif (null !== $activeprty) { + $reference = new JsonObject(); + $reference->{'@id'} = $id; + + if (null === $list) { + $this->mergeIntoProperty( + $nodeMap->{'-' . $activegraph}->{'-' . $activeid}, + $activeprty, + $reference, + true, + true + ); + } else { + $this->mergeIntoProperty($list, '@list', $reference, true, false); + } + } + + if (property_exists($element, '@type')) { + $this->mergeIntoProperty($node, '@type', $element->{'@type'}, true, true); + unset($element->{'@type'}); + } + + if (property_exists($element, '@index')) { + $this->setProperty( + $node, + '@index', + $element->{'@index'}, + JsonLdException::CONFLICTING_INDEXES + ); + unset($element->{'@index'}); + } + + if (property_exists($element, '@reverse')) { + $reference = array('@id' => $id); + + // First, add the reverse property to all nodes pointing to this node and then + // add them to the node mape + foreach (get_object_vars($element->{'@reverse'}) as $property => $value) { + foreach ($value as $val) { + $this->generateNodeMap($nodeMap, $val, $activegraph, (object) $reference, $property); + } + } + + unset($element->{'@reverse'}); + } + + // This node also represent a named graph, process it + if (property_exists($element, '@graph')) { + if (JsonLD::MERGED_GRAPH !== $activegraph) { + if (false === property_exists($nodeMap, '-' . $id)) { + $nodeMap->{'-' . $id} = new JsonObject(); + } + + $this->generateNodeMap($nodeMap, $element->{'@graph'}, $id); + } else { + $this->generateNodeMap($nodeMap, $element->{'@graph'}, JsonLD::MERGED_GRAPH); + } + + unset($element->{'@graph'}); + } + + // Process all other properties in order + $properties = get_object_vars($element); + ksort($properties); + + foreach ($properties as $property => $value) { + if (0 === strncmp($property, '_:', 2)) { + $property = $this->getBlankNodeId($property); + } + + if (false === property_exists($node, $property)) { + $node->{$property} = array(); + } + + $this->generateNodeMap($nodeMap, $value, $activegraph, $id, $property); + } + } + } + + /** + * Generate a new blank node identifier + * + * If an identifier is passed, a new blank node identifier is generated + * for it and stored for subsequent use. Calling the method with the same + * identifier (except null) will thus always return the same blank node + * identifier. + * + * @param null|string $id If available, existing blank node identifier. + * + * @return string Returns a blank node identifier. + */ + private function getBlankNodeId($id = null) + { + if ((null !== $id) && isset($this->blankNodeMap[$id])) { + return $this->blankNodeMap[$id]; + } + + $bnode = '_:b' . $this->blankNodeCounter++; + $this->blankNodeMap[$id] = $bnode; + + return $bnode; + } + + /** + * Flattens a JSON-LD document + * + * @param mixed $element A JSON-LD element to be flattened. + * + * @return array An array representing the flattened element. + */ + public function flatten($element) + { + $nodeMap = new JsonObject(); + $nodeMap->{'-' . JsonLD::DEFAULT_GRAPH} = new JsonObject(); + + $this->generateNodeMap($nodeMap, $element); + + $defaultGraph = $nodeMap->{'-' . JsonLD::DEFAULT_GRAPH}; + unset($nodeMap->{'-' . JsonLD::DEFAULT_GRAPH}); + + // Store named graphs in the @graph property of the node representing + // the graph in the default graph + foreach ($nodeMap as $graphName => $graph) { + if (!isset($defaultGraph->{$graphName})) { + $defaultGraph->{$graphName} = new JsonObject(); + $defaultGraph->{$graphName}->{'@id'} = substr($graphName, 1); + } + + $graph = (array) $graph; + ksort($graph); + $defaultGraph->{$graphName}->{'@graph'} = array_values( + array_filter($graph, array($this, 'hasNodeProperties')) + ); + } + + $defaultGraph = (array) $defaultGraph; + ksort($defaultGraph); + + return array_values( + array_filter($defaultGraph, array($this, 'hasNodeProperties')) + ); + } + + /** + * Converts an expanded JSON-LD document to RDF quads + * + * The result is an array of Quads. + * + * @param array $document The expanded JSON-LD document to be transformed into quads. + * + * @return Quad[] The extracted quads. + */ + public function toRdf(array $document) + { + $nodeMap = new JsonObject(); + $nodeMap->{'-' . JsonLD::DEFAULT_GRAPH} = new JsonObject(); + + $this->generateNodeMap($nodeMap, $document); + + $result = array(); + + foreach ($nodeMap as $graphName => $graph) { + $graphName = substr($graphName, 1); + if (JsonLD::DEFAULT_GRAPH === $graphName) { + $activegraph = null; + } else { + $activegraph = new IRI($graphName); + + if (false === $activegraph->isAbsolute()) { + continue; + } + } + + foreach ($graph as $subject => $node) { + $activesubj = new IRI(substr($subject, 1)); + + if (false === $activesubj->isAbsolute()) { + continue; + } + + foreach ($node as $property => $values) { + if ('@id' === $property) { + continue; + } elseif ('@type' === $property) { + $activeprty = new IRI(RdfConstants::RDF_TYPE); + foreach ($values as $value) { + $result[] = new Quad($activesubj, $activeprty, new IRI($value), $activegraph); + } + + continue; + } elseif ('@' === $property[0]) { + continue; + } + + // Exclude triples/quads with a blank node predicate if generalized RDF isn't enabled + if ((0 === strncmp($property, '_:', 2)) && (false === $this->generalizedRdf)) { + continue; + } + + $activeprty = new IRI($property); + if (false === $activeprty->isAbsolute()) { + continue; + } + + foreach ($values as $value) { + if (property_exists($value, '@list')) { + $quads = array(); + $head = $this->listToRdf($value->{'@list'}, $quads, $activegraph); + + $result[] = new Quad($activesubj, $activeprty, $head, $activegraph); + foreach ($quads as $quad) { + $result[] = $quad; + } + } else { + $object = $this->elementToRdf($value); + + if (null === $object) { + continue; + } + + $result[] = new Quad($activesubj, $activeprty, $object, $activegraph); + } + } + } + } + } + + return $result; + } + + /** + * Converts a JSON-LD element to a RDF Quad object + * + * @param JsonObject $element The element to be converted. + * + * @return IRI|TypedValue|LanguageTagged|null The converted element to be used as Quad object. + */ + private function elementToRdf(JsonObject $element) + { + if (property_exists($element, '@value')) { + return Value::fromJsonLd($element); + } + + $iri = new IRI($element->{'@id'}); + + return $iri->isAbsolute() ? $iri : null; + } + + /** + * Converts a JSON-LD list to a linked RDF list (quads) + * + * @param array $entries The list entries + * @param array $quads The array to be used to hold the linked list + * @param null|IRI $graph The graph to be used in the constructed Quads + * + * @return IRI Returns the IRI of the head of the list + */ + private function listToRdf(array $entries, array &$quads, IRI $graph = null) + { + if (0 === count($entries)) { + return new IRI(RdfConstants::RDF_NIL); + } + + $head = new IRI($this->getBlankNodeId()); + $quads[] = new Quad($head, new IRI(RdfConstants::RDF_FIRST), $this->elementToRdf($entries[0]), $graph); + + $bnode = $head; + for ($i = 1, $len = count($entries); $i < $len; $i++) { + $next = new IRI($this->getBlankNodeId()); + + $quads[] = new Quad($bnode, new IRI(RdfConstants::RDF_REST), $next, $graph); + + $object = $this->elementToRdf($entries[$i]); + if (null !== $object) { + $quads[] = new Quad($next, new IRI(RdfConstants::RDF_FIRST), $object, $graph); + } + + $bnode = $next; + } + + $quads[] = new Quad($bnode, new IRI(RdfConstants::RDF_REST), new IRI(RdfConstants::RDF_NIL), $graph); + + return $head; + } + + /** + * Converts an array of RDF quads to a JSON-LD document + * + * The resulting JSON-LD document will be in expanded form. + * + * @param Quad[] $quads The quads to convert + * + * @return array The JSON-LD document. + * + * @throws InvalidQuadException If the quad is invalid. + */ + public function fromRdf(array $quads) + { + $graphs = new JsonObject(); + $graphs->{JsonLD::DEFAULT_GRAPH} = new JsonObject(); + $usages = new JsonObject(); + + foreach ($quads as $quad) { + $graphName = JsonLD::DEFAULT_GRAPH; + + if ($quad->getGraph()) { + $graphName = (string) $quad->getGraph(); + + // Add a reference to this graph to the default graph if it + // doesn't exist yet + if (false === isset($graphs->{JsonLD::DEFAULT_GRAPH}->{$graphName})) { + $graphs->{JsonLD::DEFAULT_GRAPH}->{$graphName} = + self::objectToJsonLd($quad->getGraph()); + } + } + + if (false === isset($graphs->{$graphName})) { + $graphs->{$graphName} = new JsonObject(); + } + $graph = $graphs->{$graphName}; + + // Subjects and properties are always IRIs (blank nodes are IRIs + // as well): convert them to a string representation + $subject = (string) $quad->getSubject(); + $property = (string) $quad->getProperty(); + $object = $quad->getObject(); + + // All nodes are stored in the node map + if (false === isset($graph->{$subject})) { + $graph->{$subject} = self::objectToJsonLd($quad->getSubject()); + } + $node = $graph->{$subject}; + + // ... as are all objects that are IRIs or blank nodes + if (($object instanceof IRI) && (false === isset($graph->{(string) $object}))) { + $graph->{(string) $object} = self::objectToJsonLd($object); + } + + if (($property === RdfConstants::RDF_TYPE) && (false === $this->useRdfType) && + ($object instanceof IRI)) { + self::mergeIntoProperty($node, '@type', (string) $object, true, true); + } else { + $value = self::objectToJsonLd($object, $this->useNativeTypes); + + self::mergeIntoProperty($node, $property, $value, true, true); + + // If the object is an IRI or blank node it might be the + // beginning of a list. Store a reference to its usage so + // that we can replace it with a list object later + if ($object instanceof IRI) { + $objectStr = (string) $object; + + // Usages of rdf:nil are stored per graph, while... + if (RdfConstants::RDF_NIL == $objectStr) { + $graph->{$objectStr}->usages[] = array( + 'node' => $node, + 'prop' => $property, + 'value' => $value); + // references to other nodes are stored globally (blank nodes could be shared across graphs) + } else { + if (!isset($usages->{$objectStr})) { + $usages->{$objectStr} = array(); + } + + // Make sure that the same triple isn't counted multiple times + // TODO Making $usages->{$objectStr} a set would make this code simpler + $graphSubjectProperty = $graphName . '|' . $subject . '|' . $property; + if (false === isset($usages->{$objectStr}[$graphSubjectProperty])) { + $usages->{$objectStr}[$graphSubjectProperty] = array( + 'graph' => $graphName, + 'node' => $node, + 'prop' => $property, + 'value' => $value); + } + } + } + } + } + + // Transform linked lists to @list objects + $this->createListObjects($graphs, $usages); + + // Generate the resulting document starting with the default graph + $document = array(); + + $nodes = get_object_vars($graphs->{JsonLD::DEFAULT_GRAPH}); + ksort($nodes); + + foreach ($nodes as $id => $node) { + // is it a named graph? + if (isset($graphs->{$id})) { + $node->{'@graph'} = array(); + + $graphNodes = get_object_vars($graphs->{$id}); + ksort($graphNodes); + + foreach ($graphNodes as $graphNodeId => $graphNode) { + // Only add the node when it has properties other than @id + if (count(get_object_vars($graphNode)) > 1) { + $node->{'@graph'}[] = $graphNode; + } + } + } + + if (count(get_object_vars($node)) > 1) { + $document[] = $node; + } + } + + return $document; + } + + /** + * Reconstruct @list arrays from linked list structures + * + * @param JsonObject $graphs The graph map + * @param JsonObject $usages The global node usage map + */ + private function createListObjects($graphs, $usages) + { + foreach ($graphs as $graph) { + if (false === isset($graph->{RdfConstants::RDF_NIL})) { + continue; + } + + $nil = $graph->{RdfConstants::RDF_NIL}; + + foreach ($nil->usages as $usage) { + $u = $usage; + + $node = $u['node']; + $prop = $u['prop']; + $head = $u['value']; + + $list = array(); + $listNodes = array(); + + while ((RdfConstants::RDF_REST === $prop) && + (1 === count($usages->{$node->{'@id'}})) && + property_exists($node, RdfConstants::RDF_FIRST) && + property_exists($node, RdfConstants::RDF_REST) && + (1 === count($node->{RdfConstants::RDF_FIRST})) && + (1 === count($node->{RdfConstants::RDF_REST})) && + ((3 === count(get_object_vars($node))) || // only @id, rdf:first & rdf:next + ((4 === count(get_object_vars($node))) && // or an additional rdf:type = rdf:List + property_exists($node, '@type') && + ($node->{'@type'} === array(RdfConstants::RDF_LIST))) + ) + ) { + $list[] = reset($node->{RdfConstants::RDF_FIRST}); + $listNodes[] = $node->{'@id'}; + + + $u = reset($usages->{$node->{'@id'}}); + $node = $u['node']; + $prop = $u['prop']; + $head = $u['value']; + + if (0 !== strncmp($node->{'@id'}, '_:', 2)) { + break; + } + }; + + // The list is nested in another list + if (RdfConstants::RDF_FIRST === $prop) { + // If it is empty, we can't do anything but keep the rdf:nil node + if (RdfConstants::RDF_NIL === $head->{'@id'}) { + continue; + } + + // ... otherwise we keep the head and convert the rest to @list + $head = $graph->{$head->{'@id'}}; + $head = reset($head->{RdfConstants::RDF_REST}); + + array_pop($list); + array_pop($listNodes); + } + + unset($head->{'@id'}); + $head->{'@list'} = array_reverse($list); + + foreach ($listNodes as $node) { + unset($graph->{$node}); + } + } + + unset($nil->usages); + } + } + + /** + * Frames a JSON-LD document according a supplied frame + * + * @param array|JsonObject $element A JSON-LD element to be framed. + * @param mixed $frame The frame. + * + * @return array $result The framed element in expanded form. + * + * @throws JsonLdException + */ + public function frame($element, $frame) + { + if ((false === is_array($frame)) || (1 !== count($frame)) || (false === is_object($frame[0]))) { + throw new JsonLdException( + JsonLdException::UNSPECIFIED, + 'The frame is invalid. It must be a single object.', + $frame + ); + } + + $frame = $frame[0]; + + $options = new JsonObject(); + $options->{'@embed'} = true; + $options->{'@embedChildren'} = true; // TODO Change this as soon as the tests haven been updated + + foreach (self::$framingKeywords as $keyword) { + if (property_exists($frame, $keyword)) { + $options->{$keyword} = $frame->{$keyword}; + unset($frame->{$keyword}); + } elseif (false === property_exists($options, $keyword)) { + $options->{$keyword} = false; + } + } + + $procOptions = new JsonObject(); + $procOptions->base = (string) $this->baseIri; // TODO Check which base IRI to use + $procOptions->compactArrays = $this->compactArrays; + $procOptions->optimize = $this->optimize; + $procOptions->useNativeTypes = $this->useNativeTypes; + $procOptions->useRdfType = $this->useRdfType; + $procOptions->produceGeneralizedRdf = $this->generalizedRdf; + $procOptions->documentFactory = $this->documentFactory; + $procOptions->documentLoader = $this->documentLoader; + + $processor = new Processor($procOptions); + + $graph = JsonLD::MERGED_GRAPH; + if (property_exists($frame, '@graph')) { + $graph = JsonLD::DEFAULT_GRAPH; + } + + $nodeMap = new JsonObject(); + $nodeMap->{'-' . $graph} = new JsonObject(); + $processor->generateNodeMap($nodeMap, $element, $graph); + + // Sort the node map to ensure a deterministic output + // TODO Move this to a separate function as basically the same is done in flatten()? + $nodeMap = (array) $nodeMap; + foreach ($nodeMap as &$nodes) { + $nodes = (array) $nodes; + ksort($nodes); + $nodes = (object) $nodes; + } + $nodeMap = (object) $nodeMap; + + unset($processor); + + $result = array(); + + foreach ($nodeMap->{'-' . $graph} as $node) { + $this->nodeMatchesFrame($node, $frame, $options, $nodeMap, $graph, $result); + } + + return $result; + } + + /** + * Checks whether a node matches a frame or not. + * + * @param JsonObject $node The node. + * @param null|JsonObject $frame The frame. + * @param JsonObject $options The current framing options. + * @param JsonObject $nodeMap The node map. + * @param string $graph The currently used graph. + * @param array $parent The parent to which matching results should be added. + * @param array $path The path of already processed nodes. + * + * @return bool Returns true if the node matches the frame, otherwise false. + */ + private function nodeMatchesFrame($node, $frame, $options, $nodeMap, $graph, &$parent, $path = array()) + { + // TODO How should lists be handled? Is the @list required in the frame (current behavior) or not? + // https://github.com/json-ld/json-ld.org/issues/110 + // TODO Add support for '@omitDefault'? + $filter = null; + if (null !== $frame) { + $filter = get_object_vars($frame); + } + + $result = new JsonObject(); + + // Make sure that @id is always in the result if the node matches the filter + if (property_exists($node, '@id')) { + $result->{'@id'} = $node->{'@id'}; + + if ((null === $filter) && in_array($node->{'@id'}, $path)) { + $parent[] = $result; + + return true; + } + + $path[] = $node->{'@id'}; + } + + // If no filter is specified, simply return the passed node - {} is a wildcard + if ((null === $filter) || (0 === count($filter))) { + // TODO What effect should @explicit have with a wildcard match? + if (is_object($node)) { + if ((true === $options->{'@embed'}) || (false === property_exists($node, '@id'))) { + $this->addMissingNodeProperties($node, $options, $nodeMap, $graph, $result, $path); + } + + $parent[] = $result; + } else { + $parent[] = $node; + } + + return true; + } + + foreach ($filter as $property => $validValues) { + if (is_array($validValues) && (0 === count($validValues))) { + if (property_exists($node, $property) || + (('@graph' === $property) && isset($result->{'@id'}) && + property_exists($nodeMap, $result->{'@id'}))) { + return false; // [] says that the property must not exist but it does + } + + continue; + } + + // If the property does not exist or is empty + if ((false === property_exists($node, $property)) || (is_array($node->{$property}) && 0 === count($node->{$property}))) { + // first check if it's @graph and whether the referenced graph exists + if ('@graph' === $property) { + if (isset($result->{'@id'}) && property_exists($nodeMap, $result->{'@id'})) { + $result->{'@graph'} = array(); + $match = false; + + foreach ($nodeMap->{'-' . $result->{'@id'}} as $item) { + foreach ($validValues as $validValue) { + $match |= $this->nodeMatchesFrame( + $item, + $validValue, + $options, + $nodeMap, + $result->{'@id'}, + $result->{'@graph'} + ); + } + } + + if (false === $match) { + return false; + } else { + continue; // with next property + } + } else { + // the referenced graph doesn't exist + return false; + } + } + + // otherwise, look if we have a default value for it + if (false === is_array($validValues)) { + $validValues = array($validValues); + } + + $defaultFound = false; + foreach ($validValues as $validValue) { + if (is_object($validValue) && property_exists($validValue, '@default')) { + if (null === $validValue->{'@default'}) { + $result->{$property} = new JsonObject(); + $result->{$property}->{'@null'} = true; + } else { + $result->{$property} = (is_array($validValue->{'@default'})) + ? $validValue->{'@default'} + : array($validValue->{'@default'}); + } + $defaultFound = true; + break; + } + } + + if (true === $defaultFound) { + continue; + } + + return false; // required property does not exist and no default value was found + } + + // Check whether the values of the property match the filter + $match = false; + $result->{$property} = array(); + + if (false === is_array($validValues)) { + if ($node->{$property} === $validValues) { + $result->{$property} = $node->{$property}; + continue; + } else { + return false; + } + } + + foreach ($validValues as $validValue) { + if (is_object($validValue)) { + // Extract framing options from subframe ($validValue is a subframe) + $validValue = clone $validValue; + $newOptions = clone $options; + unset($newOptions->{'@default'}); + + foreach (self::$framingKeywords as $keyword) { + if (property_exists($validValue, $keyword)) { + $newOptions->{$keyword} = $validValue->{$keyword}; + unset($validValue->{$keyword}); + } + } + + $nodeValues = $node->{$property}; + if (false === is_array($nodeValues)) { + $nodeValues = array($nodeValues); + } + + foreach ($nodeValues as $value) { + if (is_object($value) && property_exists($value, '@id')) { + $match |= $this->nodeMatchesFrame( + $nodeMap->{'-' . $graph}->{'-' . $value->{'@id'}}, + $validValue, + $newOptions, + $nodeMap, + $graph, + $result->{$property}, + $path + ); + } else { + $match |= $this->nodeMatchesFrame( + $value, + $validValue, + $newOptions, + $nodeMap, + $graph, + $result->{$property}, + $path + ); + } + } + } elseif (is_array($validValue)) { + throw new JsonLdException( + JsonLdException::UNSPECIFIED, + "Invalid frame detected. Property \"$property\" must not be an array of arrays.", + $frame + ); + } else { + // This will just catch non-expanded IRIs for @id and @type + $nodeValues = $node->{$property}; + if (false === is_array($nodeValues)) { + $nodeValues = array($nodeValues); + } + + if (in_array($validValue, $nodeValues)) { + $match = true; + $result->{$property} = $node->{$property}; + } + } + } + + if (false === $match) { + return false; + } + } + + // Discard subtree if this object should not be embedded + if ((false === $options->{'@embed'}) && property_exists($node, '@id')) { + $result = new JsonObject(); + $result->{'@id'} = $node->{'@id'}; + $parent[] = $result; + + return true; + } + + // all properties matched the filter, add the properties of the + // node which haven't been added yet + if (false === $options->{'@explicit'}) { + $this->addMissingNodeProperties($node, $options, $nodeMap, $graph, $result, $path); + } + + $parent[] = $result; + + return true; + } + + /** + * Adds all properties from node to result if they haven't been added yet + * + * @param JsonObject $node The node whose properties should processed. + * @param JsonObject $options The current framing options. + * @param JsonObject $nodeMap The node map. + * @param string $graph The currently used graph. + * @param JsonObject $result The object to which the properties should be added. + * @param array $path The path of already processed nodes. + */ + private function addMissingNodeProperties($node, $options, $nodeMap, $graph, &$result, $path) + { + foreach ($node as $property => $value) { + if (property_exists($result, $property)) { + continue; // property has already been added + } + + if (true === $options->{'@embedChildren'}) { + if (false === is_array($value)) { + $result->{$property} = unserialize(serialize($value)); // create a deep-copy + continue; + } + + $result->{$property} = array(); + foreach ($value as $item) { + if (is_object($item)) { + if (property_exists($item, '@id')) { + $item = $nodeMap->{'-' . $graph}->{'-' . $item->{'@id'}}; + } + + $this->nodeMatchesFrame($item, null, $options, $nodeMap, $graph, $result->{$property}, $path); + } else { + $result->{$property}[] = $item; + } + } + + } else { + // TODO Perform deep object copy?? + $result->{$property} = unserialize(serialize($value)); // create a deep-copy + } + } + } + + /** + * Adds a property to an object if it doesn't exist yet + * + * If the property already exists, an exception is thrown as otherwise + * the existing value would be lost. + * + * @param JsonObject $object The object. + * @param string $property The name of the property. + * @param mixed $value The value of the property. + * + * @throws JsonLdException If the property exists already JSON-LD. + */ + private static function setProperty(&$object, $property, $value, $errorCode = null) + { + if (property_exists($object, $property) && + (false === self::subtreeEquals($object->{$property}, $value))) { + + if ($errorCode) { + throw new JsonLdException( + $errorCode, + "Object already contains a property \"$property\".", + $object + ); + } + + throw new JsonLdException( + JsonLdException::UNSPECIFIED, + "Object already contains a property \"$property\".", + $object + ); + } + + $object->{$property} = $value; + } + + /** + * Merges a value into a property of an object + * + * @param JsonObject $object The object. + * @param string $property The name of the property to which the value + * should be merged into. + * @param mixed $value The value to merge into the property. + * @param bool $alwaysArray If set to true, the resulting property will + * always be an array. + * @param bool $unique If set to true, the value is only added if + * it doesn't exist yet. + */ + private static function mergeIntoProperty(&$object, $property, $value, $alwaysArray = false, $unique = false) + { + // No need to add a null value + if (null === $value) { + return; + } + + if (is_array($value)) { + // Make sure empty arrays are created since we preserve them in expansion + if ((0 === count($value)) && (false === property_exists($object, $property))) { + $object->{$property} = array(); + } + + foreach ($value as $val) { + static::mergeIntoProperty($object, $property, $val, $alwaysArray, $unique); + } + + return; + } + + if (property_exists($object, $property)) { + if (false === is_array($object->{$property})) { + $object->{$property} = array($object->{$property}); + } + + if ($unique) { + foreach ($object->{$property} as $item) { + if (self::subtreeEquals($item, $value)) { + return; + } + } + } + + $object->{$property}[] = $value; + } else { + $object->{$property} = ($alwaysArray) ? array($value) : $value; + } + } + + /** + * Compares two values by their length and then lexicographically + * + * If two strings have different lengths, the shorter one will be + * considered less than the other. If they have the same length, they + * are compared lexicographically. + * + * @param mixed $a Value A. + * @param mixed $b Value B. + * + * @return int If value A is shorter than value B, -1 will be returned; if it's + * longer 1 will be returned. If both values have the same length + * and value A is considered lexicographically less, -1 will be + * returned, if they are equal 0 will be returned, otherwise 1 + * will be returned. + */ + private static function sortTerms($a, $b) + { + $lenA = strlen($a); + $lenB = strlen($b); + + if ($lenA < $lenB) { + return -1; + } elseif ($lenA === $lenB) { + return strcmp($a, $b); + } else { + return 1; + } + } + + /** + * Converts an object to a JSON-LD representation + * + * Only {@link IRI IRIs}, {@link LanguageTaggedString language-tagged strings}, + * and {@link TypedValue typed values} are converted by this method. All + * other objects are returned as-is. + * + * @param JsonObject $object The object to convert. + * @param boolean $useNativeTypes If set to true, native types are used + * for xsd:integer, xsd:double, and + * xsd:boolean, otherwise typed strings + * will be used instead. + * + * @return mixed The JSON-LD representation of the object. + */ + private static function objectToJsonLd($object, $useNativeTypes = true) + { + if ($object instanceof IRI) { + $result = new JsonObject(); + $result->{'@id'} = (string) $object; + + return $result; + } elseif ($object instanceof Value) { + return $object->toJsonLd($useNativeTypes); + } + + return $object; + } + + /** + * Checks whether a node has properties and not just an @id + * + * This is used to filter nodes consisting just of an @id-member when + * flattening and converting from RDF. + * + * @param JsonObject $node The node + * + * @return boolean True if the node has properties (other than @id), + * false otherwise. + */ + private function hasNodeProperties($node) + { + return (count(get_object_vars($node)) > 1); + } +} diff --git a/vendor/ml/json-ld/Quad.php b/vendor/ml/json-ld/Quad.php new file mode 100644 index 00000000..af6e134c --- /dev/null +++ b/vendor/ml/json-ld/Quad.php @@ -0,0 +1,152 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +use ML\IRI\IRI; + +/** + * A quad + * + * @author Markus Lanthaler + */ +class Quad +{ + /** + * The subject + * + * @var IRI + */ + private $subject; + + /** + * The property or predicate + * + * @var IRI + */ + private $property; + + /** + * The object + * + * @var Value|IRI + */ + private $object; + + /** + * The graph + * + * @var IRI + */ + private $graph; + + /** + * Constructor + * + * @param IRI $subject The subject. + * @param IRI $property The property. + * @param Value|IRI $object The object. + * @param null|IRI $graph The graph. + * + * @throws InvalidArgumentException If the object parameter has a wrong type + */ + public function __construct(IRI $subject, IRI $property, $object, IRI $graph = null) + { + $this->subject = $subject; + $this->property = $property; + $this->setObject($object); // use setter which checks the type + $this->graph = $graph; + } + + /** + * Set the subject + * + * @param IRI $subject The subject + */ + public function setSubject(IRI $subject) + { + $this->subject = $subject; + } + + /** + * Get the subject + * + * @return IRI The subject + */ + public function getSubject() + { + return $this->subject; + } + + /** + * Set the property + * + * @param IRI $property The property + */ + public function setProperty(IRI $property) + { + $this->property = $property; + } + + /** + * Get the property + * + * @return IRI The property + */ + public function getProperty() + { + return $this->property; + } + + /** + * Set the object + * + * @param IRI|Value $object The object + * + * @throws InvalidArgumentException If object is of wrong type. + */ + public function setObject($object) + { + if (!($object instanceof IRI) && !($object instanceof Value)) { + throw new \InvalidArgumentException('Object must be an IRI or Value object'); + } + + $this->object = $object; + } + + /** + * Get the object + * + * @return IRI|Value The object + */ + public function getObject() + { + return $this->object; + } + + /** + * Set the graph + * + * @param null|IRI $graph The graph + */ + public function setGraph(IRI $graph = null) + { + $this->graph = $graph; + } + + /** + * Get the graph + * + * @return IRI The graph + */ + public function getGraph() + { + return $this->graph; + } +} diff --git a/vendor/ml/json-ld/QuadParserInterface.php b/vendor/ml/json-ld/QuadParserInterface.php new file mode 100644 index 00000000..6f9bbea3 --- /dev/null +++ b/vendor/ml/json-ld/QuadParserInterface.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +/** + * Quad parser interface + * + * @author Markus Lanthaler + */ +interface QuadParserInterface +{ + /** + * Parses quads + * + * @param string $input The serialized quads to parse. + * + * @return Quad[] An array of extracted quads. + */ + public function parse($input); +} diff --git a/vendor/ml/json-ld/QuadSerializerInterface.php b/vendor/ml/json-ld/QuadSerializerInterface.php new file mode 100644 index 00000000..34cc439b --- /dev/null +++ b/vendor/ml/json-ld/QuadSerializerInterface.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +/** + * Quad serializer interface + * + * @author Markus Lanthaler + */ +interface QuadSerializerInterface +{ + /** + * Serializes quads to a string. + * + * @param Quad[] $quads Array of quads to be serialized. + * + * @return string The serialized quads. + */ + public function serialize(array $quads); +} diff --git a/vendor/ml/json-ld/README.md b/vendor/ml/json-ld/README.md new file mode 100644 index 00000000..f90d5b18 --- /dev/null +++ b/vendor/ml/json-ld/README.md @@ -0,0 +1,104 @@ +JsonLD [![Build Status](https://secure.travis-ci.org/lanthaler/JsonLD.png?branch=master)](http://travis-ci.org/lanthaler/JsonLD) +============== + +JsonLD is a fully conforming [JSON-LD](http://www.w3.org/TR/json-ld/) +processor written in PHP. It is extensively tested and passes the +[official JSON-LD test suite](https://github.com/json-ld/tests). + +There's an [online playground](http://www.markus-lanthaler.com/jsonld/playground/) +where you can evaluate the processor's basic functionality. + +Additionally to the features defined by the [JSON-LD API specification](http://www.w3.org/TR/json-ld-api/), +JsonLD supports [framing](http://json-ld.org/spec/latest/json-ld-framing/) +(including [value matching](https://github.com/json-ld/json-ld.org/issues/110), +[deep-filtering](https://github.com/json-ld/json-ld.org/issues/110), +[aggressive re-embedding](https://github.com/json-ld/json-ld.org/issues/119), and +[named graphs](https://github.com/json-ld/json-ld.org/issues/118)) and an experimental +[object-oriented interface for JSON-LD documents](https://github.com/lanthaler/JsonLD/issues/15). + + +Installation +------------ + +The easiest way to install `JsonLD` is by requiring it with [Composer](https://getcomposer.org/). + +``` +composer require ml/json-ld +``` + +... and including Composer's autoloader to your project + +```php +require('vendor/autoload.php'); +``` + +Of course, you can also download JsonLD as +[ZIP archive](https://github.com/lanthaler/JsonLD/releases) from Github. + +JsonLD requires PHP 5.3 or later. + + +Usage +------------ + +The library supports the official [JSON-LD API](http://www.w3.org/TR/json-ld-api/) as +well as a object-oriented interface for JSON-LD documents (not fully implemented yet, +see [issue #15](https://github.com/lanthaler/JsonLD/issues/15) for details). + +All classes are extensively documented. Please have a look at the source code. + +```php +// Official JSON-LD API +$expanded = JsonLD::expand('document.jsonld'); +$compacted = JsonLD::compact('document.jsonld', 'context.jsonld'); +$framed = JsonLD::frame('document.jsonld', 'frame.jsonld'); +$flattened = JsonLD::flatten('document.jsonld'); +$quads = JsonLD::toRdf('document.jsonld'); + +// Output the expanded document (pretty print) +print JsonLD::toString($expanded, true); + +// Serialize the quads as N-Quads +$nquads = new NQuads(); +$serialized = $nquads->serialize($quads); +print $serialized; + +// And parse them again to a JSON-LD document +$quads = $nquads->parse($serialized); +$document = JsonLD::fromRdf($quads); + +print JsonLD::toString($document, true); + +// Node-centric API +$doc = JsonLD::getDocument('document.jsonld'); + +// get the default graph +$graph = $doc->getGraph(); + +// get all nodes in the graph +$nodes = $graph->getNodes(); + +// retrieve a node by ID +$node = $graph->getNode('http://example.com/node1'); + +// get a property +$node->getProperty('http://example.com/vocab/name'); + +// add a new blank node to the graph +$newNode = $graph->createNode(); + +// link the new blank node to the existing node +$node->addPropertyValue('http://example.com/vocab/link', $newNode); + +// even reverse properties are supported; this returns $newNode +$node->getReverseProperty('http://example.com/vocab/link'); + +// serialize the graph and convert it to a string +$serialized = JsonLD::toString($graph->toJsonLd()); +``` + + +Commercial Support +------------ + +Commercial support is available on request. diff --git a/vendor/ml/json-ld/RdfConstants.php b/vendor/ml/json-ld/RdfConstants.php new file mode 100644 index 00000000..edeec01c --- /dev/null +++ b/vendor/ml/json-ld/RdfConstants.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +/** + * Some RDF constants. + * + * @author Markus Lanthaler + */ +abstract class RdfConstants +{ + const RDF_TYPE = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'; + const RDF_LIST = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#List'; + const RDF_FIRST = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first'; + const RDF_REST = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest'; + const RDF_NIL = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'; + const XSD_INTEGER = 'http://www.w3.org/2001/XMLSchema#integer'; + const XSD_DOUBLE = 'http://www.w3.org/2001/XMLSchema#double'; + const XSD_BOOLEAN = 'http://www.w3.org/2001/XMLSchema#boolean'; + const XSD_STRING = 'http://www.w3.org/2001/XMLSchema#string'; +} diff --git a/vendor/ml/json-ld/RemoteDocument.php b/vendor/ml/json-ld/RemoteDocument.php new file mode 100644 index 00000000..9be1286f --- /dev/null +++ b/vendor/ml/json-ld/RemoteDocument.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +/** + * RemoteDocument + * + * @author Markus Lanthaler + */ +class RemoteDocument +{ + /** + * @var string The URL of the loaded document. + */ + public $documentUrl; + + /** + * @var string The document's media type + */ + public $mediaType; + + /** + * @var mixed The retrieved document. This can either be the raw payload + * or the already parsed document. + */ + public $document; + + /** + * @var string|null The value of the context Link header if available; + * otherwise null. + */ + public $contextUrl; + + /** + * Constructor + * + * @param null|string $documentUrl The final URL of the loaded document. + * @param mixed $document The retrieved document (parsed or raw). + * @param null|string $mediaType The document's media type. + * @param null|string $contextUrl The value of the context Link header + * if available; otherwise null. + */ + public function __construct($documentUrl = null, $document = null, $mediaType = null, $contextUrl = null) + { + $this->documentUrl = $documentUrl; + $this->document = $document; + $this->mediaType = $mediaType; + $this->contextUrl = $contextUrl; + } +} diff --git a/vendor/ml/json-ld/Test/DocumentTest.php b/vendor/ml/json-ld/Test/DocumentTest.php new file mode 100644 index 00000000..72115d2a --- /dev/null +++ b/vendor/ml/json-ld/Test/DocumentTest.php @@ -0,0 +1,100 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD\Test; + +use ML\JsonLD\JsonLD; +use ML\JsonLD\Document; + +/** + * Test the parsing of a JSON-LD document into a Document. + * + * @author Markus Lanthaler + */ +class DocumentTest extends \PHPUnit_Framework_TestCase +{ + /** + * The document instance being used throughout the tests. + * + * @var Document + */ + protected $document; + + /** + * Create the document to test. + */ + protected function setUp() + { + $this->document = JsonLD::getDocument( + dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR . 'dataset.jsonld', + array('base' => 'http://example.com/dataset.jsonld') + ); + } + + + /** + * Tests whether all nodes are returned and blank nodes are renamed accordingly. + */ + public function testGetIri() + { + $this->assertEquals( + 'http://example.com/dataset.jsonld', + $this->document->getIri() + ); + } + + /** + * Tests whether all nodes are interlinked correctly. + */ + public function testGetGraphNames() + { + // The blank node graph name _:_:graphBn gets relabeled to _:b0 during node map generation + $this->assertEquals( + array('_:b0', 'http://example.com/named-graph'), + $this->document->getGraphNames() + ); + } + + /** + * Tests whether all nodes also have the correct reverse links. + */ + public function testContainsGraph() + { + $this->assertTrue( + $this->document->containsGraph('/named-graph'), + 'Relative IRI' + ); + $this->assertTrue( + $this->document->containsGraph('http://example.com/named-graph'), + 'Absolute IRI' + ); + $this->assertTrue( + $this->document->containsGraph('_:b0'), + 'Blank node identifier' + ); + + $this->assertFalse( + $this->document->containsGraph('http://example.org/not-here'), + 'Non-existent graph' + ); + } + + /** + * Tests isBlankNode() + */ + public function testRemoveGraph() + { + $this->document->removeGraph('/named-graph'); + + $this->assertFalse( + $this->document->containsGraph('/named-graph'), + 'Is the removed graph still there?' + ); + } +} diff --git a/vendor/ml/json-ld/Test/EarlReportGenerator.php b/vendor/ml/json-ld/Test/EarlReportGenerator.php new file mode 100644 index 00000000..6ba34b5a --- /dev/null +++ b/vendor/ml/json-ld/Test/EarlReportGenerator.php @@ -0,0 +1,273 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD\Test; + +/** + * EarlReportGenerator + * + * A test listener to create an EARL report. It can be configured uses + * the following configuration + * + * + * + * + * + * + * ... + * + * + * ... + * + * + * ... + * + * + * ... + * + * + * ... + * + * + * ... + * + * + * ... + * + * + * ... + * + * + * ... + * + * + * ... + * + * + * + * + * + * + * @author Markus Lanthaler + */ +class EarlReportGenerator extends \PHPUnit_Util_Printer implements \PHPUnit_Framework_TestListener +{ + /** + * @var string + */ + protected $testTypeOfInterest = 'ML\\JsonLD\\Test\\W3CTestSuiteTest'; + + /** + * @var array Lookup table for EARL statuses + */ + protected $earlStatuses; + + /** + * @var array Options + */ + protected $options; + + /** + * @var array Collected EARL assertions + */ + protected $assertions; + + /** + * Constructor + * + * @param array $options Configuration options + */ + public function __construct(array $options = array()) + { + $reqOptions = array( + 'target', + 'project-name', + 'project-url', + 'project-homepage', + 'license-url', + 'project-description', + 'programming-language', + 'developer-name', + 'developer-url', + 'developer-homepage' + ); + + foreach ($reqOptions as $option) { + if (false === isset($options[$option])) { + throw new \InvalidArgumentException( + sprintf('The "%s" option is not set', $option) + ); + } + } + + $this->options = $options; + + $this->earlStatuses = array( + \PHPUnit_Runner_BaseTestRunner::STATUS_PASSED => 'earl:passed', + \PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED => 'earl:untested', + \PHPUnit_Runner_BaseTestRunner::STATUS_INCOMPLETE => 'earl:cantTell', + \PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE => 'earl:failed', + \PHPUnit_Runner_BaseTestRunner::STATUS_ERROR => 'earl:failed' + ); + + $this->assertions = array(); + + parent::__construct($options['target']); + } + + /** + * A test ended. + * + * @param \PHPUnit_Framework_Test $test + * @param float $time + */ + public function endTest(\PHPUnit_Framework_Test $test, $time) + { + if (false === ($test instanceof $this->testTypeOfInterest)) { + return; + } + + $assertion = array( + '@type' => 'earl:Assertion', + 'earl:assertedBy' => $this->options['developer-url'], + 'earl:mode' => 'earl:automatic', + 'earl:test' => $test->getTestId(), + 'earl:result' => array( + '@type' => 'earl:TestResult', + 'earl:outcome' => $this->earlStatuses[$test->getStatus()], + 'dc:date' => date('c') + ) + ); + + $this->assertions[] = $assertion; + } + + + /** + * @inheritdoc + */ + public function flush() + { + if (0 === $this->assertions) { + return; + } + + $report = array( + '@context' => array( + 'doap' => 'http://usefulinc.com/ns/doap#', + 'foaf' => 'http://xmlns.com/foaf/0.1/', + 'dc' => 'http://purl.org/dc/terms/', + 'earl' => 'http://www.w3.org/ns/earl#', + 'xsd' => 'http://www.w3.org/2001/XMLSchema#', + 'doap:homepage' => array('@type' => '@id'), + 'doap:license' => array('@type' => '@id'), + 'dc:creator' => array('@type' => '@id'), + 'foaf:homepage' => array('@type' => '@id'), + 'subjectOf' => array('@reverse' => 'earl:subject'), + 'earl:assertedBy' => array('@type' => '@id'), + 'earl:mode' => array('@type' => '@id'), + 'earl:test' => array('@type' => '@id'), + 'earl:outcome' => array('@type' => '@id'), + 'dc:date' => array('@type' => 'xsd:date') + ), + '@id' => $this->options['project-url'], + '@type' => array('doap:Project', 'earl:TestSubject', 'earl:Software'), + 'doap:name' => $this->options['project-name'], + 'dc:title' => $this->options['project-name'], + 'doap:homepage' => $this->options['project-homepage'], + 'doap:license' => $this->options['license-url'], + 'doap:description' => $this->options['project-description'], + 'doap:programming-language' => $this->options['programming-language'], + 'doap:developer' => array( + '@id' => $this->options['developer-url'], + '@type' => array('foaf:Person', 'earl:Assertor'), + 'foaf:name' => $this->options['developer-name'], + 'foaf:homepage' => $this->options['developer-homepage'] + ), + 'dc:creator' => $this->options['developer-url'], + 'dc:date' => array( + '@value' => date('Y-m-d'), + '@type' => 'xsd:date' + ), + 'subjectOf' => $this->assertions + ); + + $options = 0; + + if (PHP_VERSION_ID >= 50400) { + $options |= JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT; + $report = json_encode($report, $options); + } else { + $report = json_encode($report); + $report = str_replace('\\/', '/', $report); // unescape slahes + + // unescape unicode + $report = preg_replace_callback( + '/\\\\u([a-f0-9]{4})/', + function ($match) { + return iconv('UCS-4LE', 'UTF-8', pack('V', hexdec($match[1]))); + }, + $report + ); + } + + $this->write($report); + + parent::flush(); + } + + /** + * @inheritdoc + */ + public function startTestSuite(\PHPUnit_Framework_TestSuite $suite) + { + } + + /** + * @inheritdoc + */ + public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) + { + } + + /** + * @inheritdoc + */ + public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time) + { + } + + /** + * @inheritdoc + */ + public function addFailure(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e, $time) + { + } + + /** + * @inheritdoc + */ + public function addIncompleteTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) + { + } + + /** + * @inheritdoc + */ + public function addSkippedTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) + { + } + + /** + * @inheritdoc + */ + public function startTest(\PHPUnit_Framework_Test $test) + { + } +} diff --git a/vendor/ml/json-ld/Test/FileGetContentsLoaderTest.php b/vendor/ml/json-ld/Test/FileGetContentsLoaderTest.php new file mode 100644 index 00000000..f99f1ce9 --- /dev/null +++ b/vendor/ml/json-ld/Test/FileGetContentsLoaderTest.php @@ -0,0 +1,99 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD\Test; + +use ML\IRI\IRI; +use ML\JsonLD\FileGetContentsLoader; + +/** + * Test the parsing of a JSON-LD document into a Document. + */ +class FileGetContentsLoaderTest extends \PHPUnit_Framework_TestCase +{ + + protected $iri; + + protected $loader; + + public function setUp() + { + parent::setUp(); + + $this->iri = new IRI('https://www.foobar.com'); + $this->loader = new FileGetContentsLoader; + } + + public function tearDown() + { + unset($iri); + unset($this->loader); + + parent::tearDown(); + } + + public function testParseLinkHeadersExactsValues() + { + $headers = array( + '; param1=foo; param2="bar";', + ); + + $parsed = $this->loader->parseLinkHeaders($headers, $this->iri); + + $this->assertEquals('https://www.foobar.com', $parsed[0]['uri']); + $this->assertEquals('foo', $parsed[0]['param1']); + $this->assertEquals('bar', $parsed[0]['param2']); + } + + public function testParseLinkHeadersTrimsValues() + { + $headers = array( + '< https://www.foobar.com >; param1= foo ; param2=" bar ";', + ); + + $parsed = $this->loader->parseLinkHeaders($headers, $this->iri); + + $this->assertEquals('https://www.foobar.com', $parsed[0]['uri']); + $this->assertEquals('foo', $parsed[0]['param1']); + $this->assertEquals('bar', $parsed[0]['param2']); + } + + public function testParseLinkHeadersWithMultipleHeaders() + { + $headers = array( + '; param1=foo; param2=bar;', + '; param1=fizz; param2=buzz;', + ); + + $parsed = $this->loader->parseLinkHeaders($headers, $this->iri); + + $this->assertCount(2, $parsed); + } + + public function testParseLinkHeadersWithMultipleLinks() + { + $headers = array( + '; param1=foo; param2=bar;, ' + . '; param1=fizz; param2=buzz;' + ); + + $parsed = $this->loader->parseLinkHeaders($headers, $this->iri); + + $this->assertCount(2, $parsed); + $this->assertEquals('https://www.foobar.com', $parsed[0]['uri']); + $this->assertEquals('https://www.fizzbuzz.net', $parsed[1]['uri']); + } + + public function testParseLinkHeadersConvertsRelativeLinksToAbsolute() + { + $headers = array(';'); + $parsed = $this->loader->parseLinkHeaders($headers, $this->iri); + $this->assertEquals('https://www.foobar.com/foo/bar', $parsed[0]['uri']); + } +} diff --git a/vendor/ml/json-ld/Test/Fixtures/dataset.jsonld b/vendor/ml/json-ld/Test/Fixtures/dataset.jsonld new file mode 100644 index 00000000..d876810e --- /dev/null +++ b/vendor/ml/json-ld/Test/Fixtures/dataset.jsonld @@ -0,0 +1,36 @@ +{ + "@context": { + "@vocab": "http://example.com/vocab#", + "references": { "@type": "@id" } + }, + "@graph": [ + { + "@id": "/node1", + "references": [ "_:graphBn", "/named-graph" ] + }, + { + "@id": "_:graphBn", + "@graph": [ + { + "@id": "_:graphBn/node1", + "name": "_:graphBn/node1", + "references": [ "_:bnode", "/node1", "/named-graph/node1" ] + } + ] + }, + { + "@id": "/named-graph", + "@graph": [ + { + "@id": "/named-graph/node1", + "name": "/named-graph/node1", + "references": [ "_:bnode", "/node1", "_:graphBn/node1" ] + } + ] + }, + { + "@id": "_:bnode", + "name": "_:bnode" + } + ] +} diff --git a/vendor/ml/json-ld/Test/Fixtures/sample-compacted.jsonld b/vendor/ml/json-ld/Test/Fixtures/sample-compacted.jsonld new file mode 100644 index 00000000..828b2daa --- /dev/null +++ b/vendor/ml/json-ld/Test/Fixtures/sample-compacted.jsonld @@ -0,0 +1,24 @@ +{ + "@context": { + "t1": "http://example.com/t1", + "t2": "http://example.com/t2", + "term1": "http://example.com/term1", + "term2": "http://example.com/term2", + "term3": "http://example.com/term3", + "term4": "http://example.com/term4", + "term5": "http://example.com/term5" + }, + "@id": "http://example.com/id1", + "@type": "t1", + "term1": "v1", + "term2": { "@value": "v2", "@type": "t2" }, + "term3": { "@value": "v3", "@language": "en" }, + "term4": 4, + "term5": [ 50, 51 ], + "http://example.com/term6": [ + { "@value": "1", "@type": "t1" }, + { "@value": "2", "@type": "t2" }, + { "@value": "3", "@language": "en" }, + { "@value": "4", "@language": "de" } + ] +} diff --git a/vendor/ml/json-ld/Test/Fixtures/sample-context.jsonld b/vendor/ml/json-ld/Test/Fixtures/sample-context.jsonld new file mode 100644 index 00000000..79129cb2 --- /dev/null +++ b/vendor/ml/json-ld/Test/Fixtures/sample-context.jsonld @@ -0,0 +1,11 @@ +{ + "@context": { + "t1": "http://example.com/t1", + "t2": "http://example.com/t2", + "term1": "http://example.com/term1", + "term2": "http://example.com/term2", + "term3": "http://example.com/term3", + "term4": "http://example.com/term4", + "term5": "http://example.com/term5" + } +} diff --git a/vendor/ml/json-ld/Test/Fixtures/sample-expanded.jsonld b/vendor/ml/json-ld/Test/Fixtures/sample-expanded.jsonld new file mode 100644 index 00000000..7daa7853 --- /dev/null +++ b/vendor/ml/json-ld/Test/Fixtures/sample-expanded.jsonld @@ -0,0 +1,20 @@ +[ + { + "@id": "http://example.com/id1", + "@type": [ "http://example.com/t1" ], + "http://example.com/term1": [ {"@value": "v1"} ], + "http://example.com/term2": [ {"@value": "v2", "@type": "http://example.com/t2"} ], + "http://example.com/term3": [ {"@value": "v3", "@language": "en"} ], + "http://example.com/term4": [ {"@value": 4} ], + "http://example.com/term5": [ + { "@value": 50 }, + { "@value": 51 } + ], + "http://example.com/term6": [ + { "@value": "1", "@type": "http://example.com/t1" }, + { "@value": "2", "@type": "http://example.com/t2" }, + { "@value": "3", "@language": "en" }, + { "@value": "4", "@language": "de" } + ] + } +] diff --git a/vendor/ml/json-ld/Test/Fixtures/sample-flattened.jsonld b/vendor/ml/json-ld/Test/Fixtures/sample-flattened.jsonld new file mode 100644 index 00000000..bfe8d630 --- /dev/null +++ b/vendor/ml/json-ld/Test/Fixtures/sample-flattened.jsonld @@ -0,0 +1,34 @@ +{ + "@context": { + "t1": "http://example.com/t1", + "t2": "http://example.com/t2", + "term1": "http://example.com/term1", + "term2": "http://example.com/term2", + "term3": "http://example.com/term3", + "term4": "http://example.com/term4", + "term5": "http://example.com/term5" + }, + "@graph": [ + { + "@id": "http://example.com/id1", + "@type": "t1", + "term1": "v1", + "term2": { + "@type": "t2", + "@value": "v2" + }, + "term3": { + "@language": "en", + "@value": "v3" + }, + "term4": 4, + "term5": [ 50, 51 ], + "http://example.com/term6": [ + { "@value": "1", "@type": "t1" }, + { "@value": "2", "@type": "t2" }, + { "@value": "3", "@language": "en" }, + { "@value": "4", "@language": "de" } + ] + } + ] +} diff --git a/vendor/ml/json-ld/Test/Fixtures/sample-in.jsonld b/vendor/ml/json-ld/Test/Fixtures/sample-in.jsonld new file mode 100644 index 00000000..dec8fd7a --- /dev/null +++ b/vendor/ml/json-ld/Test/Fixtures/sample-in.jsonld @@ -0,0 +1,22 @@ +{ + "@context": { + "t1": "http://example.com/t1", + "t2": "http://example.com/t2", + "term1": "http://example.com/term1", + "term3": "http://example.com/term3", + "term5": "http://example.com/term5" + }, + "@id": "http://example.com/id1", + "@type": "t1", + "term1": "v1", + "http://example.com/term2": { "@value": "v2", "@type": "t2" }, + "term3": { "@value": "v3", "@language": "en" }, + "http://example.com/term4": 4, + "term5": [ 50, 51 ], + "http://example.com/term6": [ + { "@value": "1", "@type": "t1" }, + { "@value": "2", "@type": "t2" }, + { "@value": "3", "@language": "en" }, + { "@value": "4", "@language": "de" } + ] +} diff --git a/vendor/ml/json-ld/Test/Fixtures/sample-serialized-document.jsonld b/vendor/ml/json-ld/Test/Fixtures/sample-serialized-document.jsonld new file mode 100644 index 00000000..bdb40082 --- /dev/null +++ b/vendor/ml/json-ld/Test/Fixtures/sample-serialized-document.jsonld @@ -0,0 +1,23 @@ +[ + { + "@id": "http://example.com/id1", + "@type": [ "http://example.com/t1" ], + "http://example.com/term1": [ {"@value": "v1"} ], + "http://example.com/term2": [ {"@value": "v2", "@type": "http://example.com/t2"} ], + "http://example.com/term3": [ {"@value": "v3", "@language": "en"} ], + "http://example.com/term4": [ {"@value": 4} ], + "http://example.com/term5": [ + {"@value": 50 }, + {"@value": 51 } + ], + "http://example.com/term6": [ + { "@value": "1", "@type": "http://example.com/t1" }, + { "@value": "2", "@type": "http://example.com/t2" }, + { "@value": "3", "@language": "en" }, + { "@value": "4", "@language": "de" } + ] + }, + { + "@id": "http://example.com/t1" + } +] diff --git a/vendor/ml/json-ld/Test/GraphTest.php b/vendor/ml/json-ld/Test/GraphTest.php new file mode 100644 index 00000000..8e452abd --- /dev/null +++ b/vendor/ml/json-ld/Test/GraphTest.php @@ -0,0 +1,915 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD\Test; + +use ML\JsonLD\Document; +use ML\JsonLD\FileGetContentsLoader; +use ML\JsonLD\Graph; +use ML\JsonLD\GraphInterface; +use ML\JsonLD\Node; +use ML\JsonLD\LanguageTaggedString; +use ML\JsonLD\TypedValue; +use ML\JsonLD\RdfConstants; + +/** + * Test the parsing of a JSON-LD document into a Graph. + * + * @author Markus Lanthaler + */ +class GraphTest extends \PHPUnit_Framework_TestCase +{ + /** + * The graph instance being used throughout the tests. + * + * @var GraphInterface + */ + protected $graph; + + /** + * The document loader used to parse expected values. + */ + protected $documentLoader; + + /** + * Create the graph to test. + */ + protected function setUp() + { + $json = << 'http://example.com/node/index.jsonld')); + $this->graph = $doc->getGraph(); + $this->documentLoader = new FileGetContentsLoader(); + } + + + /** + * Tests whether all nodes are returned and blank nodes are renamed accordingly. + */ + public function testGetNodes() + { + $nodeIds = array( + 'http://example.com/node/1', + 'http://example.com/node/2', + 'http://example.com/node/3', + '_:b0', + '_:b1', + '_:b2', + '_:b3', + 'http://vocab.com/type/node', + 'http://vocab.com/type/nodeWithAliases' + ); + + $nodes = $this->graph->getNodes(); + $this->assertCount(count($nodeIds), $nodes); + + foreach ($nodes as $node) { + // Is the node's ID valid? + $this->assertContains($node->getId(), $nodeIds, 'Found unexpected node ID: ' . $node->getId()); + + // Is the node of the right type? + $this->assertInstanceOf('ML\JsonLD\Node', $node); + + // Does the graph return the same instance? + $n = $this->graph->getNode($node->getId()); + $this->assertSame($node, $n, 'same instance'); + $this->assertTrue($node->equals($n), 'equals'); + $this->assertSame($this->graph, $n->getGraph(), 'linked to graph'); + } + } + + /** + * Tests whether all nodes are interlinked correctly. + */ + public function testNodeRelationships() + { + $node1 = $this->graph->getNode('http://example.com/node/1'); + $node2 = $this->graph->getNode('http://example.com/node/2'); + $node3 = $this->graph->getNode('http://example.com/node/3'); + + $node1_1 = $this->graph->getNode('_:b0'); + $node2_1 = $this->graph->getNode('_:b1'); + $node2_2 = $this->graph->getNode('_:b2'); + $node3_1 = $this->graph->getNode('_:b3'); + + $nodeType = $this->graph->getNode('http://vocab.com/type/node'); + $nodeWithAliasesType = $this->graph->getNode('http://vocab.com/type/nodeWithAliases'); + + $this->assertSame($node2, $node1->getProperty('http://vocab.com/link'), 'n1 -link-> n2'); + $this->assertSame($node1_1, $node1->getProperty('http://vocab.com/contains'), 'n1 -contains-> n1.1'); + $this->assertSame($nodeType, $node1->getType(), 'n1 type'); + + $this->assertSame($node3, $node2->getProperty('http://vocab.com/link'), 'n2 -link-> n3'); + $values = $node2->getProperty('http://vocab.com/contains'); + $this->assertCount(2, $values, 'n2 -contains-> 2 nodes'); + $this->assertSame($node2_1, $values[0], 'n2 -contains-> n2.1'); + $this->assertSame($node2_2, $values[1], 'n2 -contains-> n2.1'); + $this->assertSame($nodeWithAliasesType, $node2->getType(), 'n2 type'); + + $this->assertSame($node1, $node3->getProperty('http://vocab.com/link'), 'n3 -link-> n1'); + $this->assertSame($node3_1, $node3->getProperty('http://vocab.com/contains'), 'n3 -contains-> n3.1'); + $this->assertSame($nodeType, $node3->getType(), 'n3 type'); + } + + /** + * Tests whether all nodes also have the correct reverse links. + */ + public function testNodeReverseRelationships() + { + $node1 = $this->graph->getNode('http://example.com/node/1'); + $node2 = $this->graph->getNode('http://example.com/node/2'); + $node3 = $this->graph->getNode('http://example.com/node/3'); + + $node1_1 = $this->graph->getNode('_:b0'); + $node2_1 = $this->graph->getNode('_:b1'); + $node2_2 = $this->graph->getNode('_:b2'); + $node3_1 = $this->graph->getNode('_:b3'); + + $nodeType = $this->graph->getNode('http://vocab.com/type/node'); + $nodeWithAliasesType = $this->graph->getNode('http://vocab.com/type/nodeWithAliases'); + + $this->assertSame($node1, $node2->getReverseProperty('http://vocab.com/link'), 'n2 <-link- n1'); + $this->assertSame($node1, $node1_1->getReverseProperty('http://vocab.com/contains'), 'n1.1 <-contains- n1'); + + $this->assertSame($node2, $node3->getReverseProperty('http://vocab.com/link'), 'n3 <-link- n2'); + $this->assertSame($node2, $node2_1->getReverseProperty('http://vocab.com/contains'), 'n2.1 <-contains- n2'); + $this->assertSame($node2, $node2_2->getReverseProperty('http://vocab.com/contains'), 'n2.1 <-contains- n2'); + + $this->assertSame($node3, $node1->getReverseProperty('http://vocab.com/link'), 'n1 <-link- n3'); + $this->assertSame($node3, $node3_1->getReverseProperty('http://vocab.com/contains'), 'n3.1 <-contains- n3'); + + $this->assertSame(array($node1, $node3), $nodeType->getReverseProperty(Node::TYPE), 'n1+n3 <-type- nodeType'); + $this->assertSame(array($node2), $nodeWithAliasesType->getNodesWithThisType(), 'n2 <-type- nodeWithAliases'); + } + + /** + * Tests isBlankNode() + */ + public function testNodeIsBlankNode() + { + $this->assertFalse($this->graph->getNode('http://example.com/node/1')->isBlankNode(), 'n1'); + $this->assertFalse($this->graph->getNode('http://example.com/node/2')->isBlankNode(), 'n2'); + $this->assertFalse($this->graph->getNode('http://example.com/node/3')->isBlankNode(), 'n3'); + + $this->assertTrue($this->graph->getNode('_:b0')->isBlankNode(), '_:b0'); + $this->assertTrue($this->graph->getNode('_:b1')->isBlankNode(), '_:b1'); + $this->assertTrue($this->graph->getNode('_:b2')->isBlankNode(), '_:b2'); + $this->assertTrue($this->graph->getNode('_:b3')->isBlankNode(), '_:b3'); + + $node = $this->graph->createNode(); + $this->assertTrue($node->isBlankNode(), 'new node without ID'); + + $node = $this->graph->createNode('_:fljdf'); + $this->assertTrue($node->isBlankNode(), 'new node blank node ID'); + + $node = $this->graph->createNode('http://www.example.com/node/new'); + $this->assertFalse($node->isBlankNode(), 'new node with ID'); + } + + /** + * Tests if reverse node relationships are updated when a property is updated. + */ + public function testNodeReverseRelationshipsUpdated() + { + $node1 = $this->graph->getNode('http://example.com/node/1'); + $node1_1 = $this->graph->getNode('_:b0'); + $node2 = $this->graph->getNode('http://example.com/node/2'); + $node3 = $this->graph->getNode('http://example.com/node/3'); + + $nodeType = $this->graph->getNode('http://vocab.com/type/node'); + $nodeWithAliasesType = $this->graph->getNode('http://vocab.com/type/nodeWithAliases'); + + $revProperties = $node2->getReverseProperties(); + $this->assertCount(1, $revProperties, 'Check number of node2\'s reverse properties'); + $this->assertSame( + array('http://vocab.com/link' => array($node1)), + $revProperties, + 'Check node2\'s reverse properties' + ); + + $node1->setProperty('http://vocab.com/link', null); + $this->assertNull($node1->getProperty('http://vocab.com/link'), 'n1 -link-> n2 removed'); + + $node1->removePropertyValue('http://vocab.com/contains', $node1_1); + $this->assertNull($node1->getProperty('http://vocab.com/contains'), 'n1 -contains-> n1.1 removed'); + + $this->assertNull($node2->getReverseProperty('http://vocab.com/link'), 'n2 <-link- n1 removed'); + $this->assertNull($node1_1->getReverseProperty('http://vocab.com/contains'), 'n1.1 <-contains- n1 removed'); + + $expectedProperties = array( + Node::TYPE => $this->graph->getNode('http://vocab.com/type/node'), + 'http://vocab.com/name' => new TypedValue('1', RdfConstants::XSD_STRING) + ); + $properties = $node1->getProperties(); + $this->assertCount(2, $properties, 'Check number of properties'); + $this->assertEquals($expectedProperties, $properties, 'Check properties'); + + $this->assertSame(array($node1, $node3), $nodeType->getNodesWithThisType(), 'n1+n3 <-type- nodeType'); + $this->assertSame($node2, $nodeWithAliasesType->getReverseProperty(Node::TYPE), 'n2 <-type- nodeWithAliases'); + + $node1->setType(null); + $node2->removeType($nodeWithAliasesType); + + $this->assertSame($node3, $nodeType->getReverseProperty(Node::TYPE), 'n3 <-type- nodeType'); + $this->assertSame(array(), $nodeWithAliasesType->getNodesWithThisType(), 'nodeWithAliases removed from n2'); + } + + /** + * Tests the removal of nodes from the graph. + */ + public function testNodeRemoval() + { + // Remove node 1 + $node1 = $this->graph->getNode('/node/1'); + $node1_1 = $this->graph->getNode('_:b0'); + $node2 = $this->graph->getNode('http://example.com/node/2'); + + $this->assertTrue($this->graph->containsNode('http://example.com/node/1'), 'node 1 in graph?'); + + $this->assertSame( + array('http://vocab.com/link' => array($node1)), + $node2->getReverseProperties(), + 'Check node2\'s reverse properties' + ); + + $this->assertSame( + array('http://vocab.com/contains' => array($node1)), + $node1_1->getReverseProperties(), + 'Check node1.1\'s reverse properties' + ); + + $node1->removeFromGraph(); + + $this->assertSame(array(), $node2->getReverseProperties(), 'n2 reverse properties'); + $this->assertNull($node2->getReverseProperty('http://vocab.com/link'), 'n2 <-link- n1 removed'); + + $this->assertSame(array(), $node1_1->getReverseProperties(), 'n1.1 reverse properties'); + $this->assertNull($node1_1->getReverseProperty('http://vocab.com/contains'), 'n1.1 <-contains- n1 removed'); + + $this->assertFalse($this->graph->containsNode('/node/1'), 'node 1 still in graph?'); + $this->assertNull($node1->getGraph(), 'node 1\'s graph reset?'); + + // Remove node 2 + $node2 = $this->graph->getNode('http://example.com/node/2'); + $node2_1 = $this->graph->getNode('_:b1'); + $node2_2 = $this->graph->getNode('_:b2'); + $node3 = $this->graph->getNode('/node/3'); + + $this->assertTrue($this->graph->containsNode('/node/2'), 'node 2 in graph?'); + + $this->assertSame( + array('http://vocab.com/link' => array($node2)), + $node3->getReverseProperties(), + 'Check node3\'s reverse properties' + ); + + $this->assertSame( + array('http://vocab.com/contains' => array($node2)), + $node2_1->getReverseProperties(), + 'Check node2.1\'s reverse properties' + ); + + $this->assertSame( + array('http://vocab.com/contains' => array($node2)), + $node2_2->getReverseProperties(), + 'Check node2.2\'s reverse properties' + ); + + $this->graph->removeNode($node2); + + $this->assertSame(array(), $node3->getReverseProperties(), 'n3 reverse properties'); + $this->assertNull($node3->getReverseProperty('http://vocab.com/link'), 'n3 <-link- n2 removed'); + + $this->assertSame(array(), $node2_1->getReverseProperties(), 'n2.1 reverse properties'); + $this->assertNull($node2_1->getReverseProperty('http://vocab.com/contains'), 'n2.1 <-contains- n2 removed'); + + $this->assertSame(array(), $node2_2->getReverseProperties(), 'n2.2 reverse properties'); + $this->assertNull($node2_2->getReverseProperty('http://vocab.com/contains'), 'n2.2 <-contains- n2 removed'); + + $this->assertFalse($this->graph->containsNode('./2'), 'node 2 still in graph?'); + } + + /** + * Tests the removal of node types from the graph. + */ + public function testNodeTypeRemoval() + { + // Remove nodeType + $node1 = $this->graph->getNode('http://example.com/node/1'); + $node3 = $this->graph->getNode('/node/3'); + $nodeType = $this->graph->getNode('http://vocab.com/type/node'); + + $this->assertTrue($this->graph->containsNode('http://vocab.com/type/node'), 'node type in graph?'); + + $this->assertSame($nodeType, $node1->getType(), 'n1 type'); + $this->assertSame($nodeType, $node3->getType(), 'n3 type'); + + $this->assertSame( + array(Node::TYPE => array($node1, $node3)), + $nodeType->getReverseProperties(), + 'Check node type\'s reverse properties' + ); + + $this->graph->removeNode($nodeType); + + $this->assertSame(array(), $nodeType->getReverseProperties(), 'node type\'s reverse properties'); + $this->assertSame(array(), $nodeType->getNodesWithThisType(), 'n1+n3 <-type- node type removed'); + + $this->assertNull($node1->getType(), 'n1 type removed'); + $this->assertNull($node3->getType(), 'n3 type removed'); + + $this->assertFalse($this->graph->containsNode('http://vocab.com/type/node'), 'node type still in graph?'); + } + + /** + * Tests if adding a value maintains uniqueness + */ + public function testNodePropertyUniqueness() + { + // Null + $node = $this->graph->getNode('http://example.com/node/1'); + $this->assertNull($node->getProperty('http://example.com/node/1'), 'inexistent'); + + $node->addPropertyValue('http://vocab.com/inexistent', null); + $this->assertNull($node->getProperty('http://example.com/node/1'), 'inexistent + null'); + + $node->removeProperty('http://vocab.com/inexistent'); + $node->removePropertyValue('http://vocab.com/inexistent', null); + $this->assertNull($node->getProperty('http://example.com/node/1'), 'inexistent removed'); + + // Scalars + $node = $this->graph->getNode('http://example.com/node/1'); + + $initialNameValue = $node->getProperty('http://vocab.com/name'); + + $this->assertEquals( + new TypedValue('1', RdfConstants::XSD_STRING), + $node->getProperty('http://vocab.com/name'), + 'name: initial value' + ); + + $node->addPropertyValue('http://vocab.com/name', '1'); + $node->addPropertyValue('http://vocab.com/name', null); + $this->assertSame($initialNameValue, $node->getProperty('http://vocab.com/name'), 'name: still same'); + + $node->addPropertyValue('http://vocab.com/name', 1); + $this->assertEquals( + array($initialNameValue, new TypedValue('1', RdfConstants::XSD_INTEGER)), + $node->getProperty('http://vocab.com/name'), + 'name: new value' + ); + + $node->removePropertyValue('http://vocab.com/name', 1); + $this->assertSame($initialNameValue, $node->getProperty('http://vocab.com/name'), 'name: removed new value'); + + // Language-tagged strings + $node = $this->graph->getNode('http://example.com/node/2'); + $value = $node->getProperty('http://vocab.com/lang'); + + $this->assertInstanceOf('ML\JsonLD\LanguageTaggedString', $value, 'lang: initial value type'); + $this->assertEquals('language-tagged string', $value->getValue(), 'lang: initial value'); + $this->assertEquals('en', $value->getLanguage(), 'lang: initial language'); + + $sameLangValue = new LanguageTaggedString('language-tagged string', 'en'); + $this->assertTrue($value->equals($sameLangValue), 'lang: equals same'); + + $newLangValue1 = new LanguageTaggedString('language-tagged string', 'de'); + $this->assertFalse($value->equals($newLangValue1), 'lang: equals new1'); + + $newLangValue2 = new LanguageTaggedString('other language-tagged string', 'en'); + $this->assertFalse($value->equals($newLangValue2), 'lang: equals new2'); + + $node->addPropertyValue('http://vocab.com/lang', $sameLangValue); + $this->assertSame($value, $node->getProperty('http://vocab.com/lang'), 'lang: still same'); + + $node->addPropertyValue('http://vocab.com/lang', $newLangValue1); + $node->addPropertyValue('http://vocab.com/lang', $newLangValue2); + + $value = $node->getProperty('http://vocab.com/lang'); + $this->assertCount(3, $value, 'lang: count values added'); + + $this->assertTrue($sameLangValue->equals($value[0]), 'lang: check values 1'); + $this->assertTrue($newLangValue1->equals($value[1]), 'lang: check values 2'); + $this->assertTrue($newLangValue2->equals($value[2]), 'lang: check values 3'); + + $node->removePropertyValue('http://vocab.com/lang', $newLangValue1); + $value = $node->getProperty('http://vocab.com/lang'); + $this->assertCount(2, $value, 'lang: count value 1 removed again'); + + $this->assertTrue($sameLangValue->equals($value[0]), 'lang: check values 1 (2)'); + $this->assertTrue($newLangValue2->equals($value[1]), 'lang: check values 2 (2)'); + + // Typed values + $node = $this->graph->getNode('http://example.com/node/2'); + $value = $node->getProperty('http://vocab.com/typed'); + + $this->assertInstanceOf('ML\JsonLD\TypedValue', $value, 'typed: initial value class'); + $this->assertEquals('typed value', $value->getValue(), 'typed: initial value'); + $this->assertEquals('http://vocab.com/type/datatype', $value->getType(), 'typed: initial value type'); + + $sameTypedValue = new TypedValue('typed value', 'http://vocab.com/type/datatype'); + $this->assertTrue($value->equals($sameTypedValue), 'typed: equals same'); + + $newTypedValue1 = new TypedValue('typed value', 'http://vocab.com/otherType'); + $this->assertFalse($value->equals($newTypedValue1), 'typed: equals new1'); + + $newTypedValue2 = new TypedValue('other typed value', 'http://vocab.com/type/datatype'); + $this->assertFalse($value->equals($newTypedValue2), 'typed: equals new2'); + + $node->addPropertyValue('http://vocab.com/typed', $sameTypedValue); + $this->assertSame($value, $node->getProperty('http://vocab.com/typed'), 'typed: still same'); + + $node->addPropertyValue('http://vocab.com/typed', $newTypedValue1); + $node->addPropertyValue('http://vocab.com/typed', $newTypedValue2); + + $value = $node->getProperty('http://vocab.com/typed'); + $this->assertCount(3, $value, 'typed: count values added'); + + $this->assertTrue($sameTypedValue->equals($value[0]), 'typed: check values 1'); + $this->assertTrue($newTypedValue1->equals($value[1]), 'typed: check values 2'); + $this->assertTrue($newTypedValue2->equals($value[2]), 'typed: check values 3'); + + $node->removePropertyValue('http://vocab.com/typed', $newTypedValue1); + $value = $node->getProperty('http://vocab.com/typed'); + $this->assertCount(2, $value, 'typed: count value 1 removed again'); + + $this->assertTrue($sameTypedValue->equals($value[0]), 'typed: check values 1 (2)'); + $this->assertTrue($newTypedValue2->equals($value[1]), 'typed: check values 2 (2)'); + + // Nodes + $node = $this->graph->getNode('http://example.com/node/3'); + $node1 = $this->graph->getNode('http://example.com/node/1'); + + $value = $node->getProperty('http://vocab.com/link'); + + $this->assertInstanceOf('ML\JsonLD\Node', $value, 'node: initial value class'); + $this->assertSame($node1, $value, 'node: initial node'); + + $newNode1 = $this->graph->createNode(); + $this->assertTrue($this->graph->containsNode($newNode1), 'node: new1 in graph'); + + $newNode2 = $this->graph->createNode('http://example.com/node/new/2'); + $this->assertTrue($this->graph->containsNode($newNode2), 'node: new2 in graph'); + + $node->addPropertyValue('http://vocab.com/link', $node1); + $this->assertSame($node1, $node->getProperty('http://vocab.com/link'), 'node: still same'); + + $node->addPropertyValue('http://vocab.com/link', $newNode1); + $node->addPropertyValue('http://vocab.com/link', $newNode2); + + $value = $node->getProperty('http://vocab.com/link'); + $this->assertCount(3, $value, 'node: count values added'); + + $this->assertSame($node1, $value[0], 'node: check values 1'); + $this->assertSame($newNode1, $value[1], 'node: check values 2'); + $this->assertSame($newNode2, $value[2], 'node: check values 3'); + + $node->removePropertyValue('http://vocab.com/link', $newNode1); + $value = $node->getProperty('http://vocab.com/link'); + $this->assertCount(2, $value, 'typed: count new node 1 removed again'); + + $this->assertTrue($node1->equals($value[0]), 'node: check values 1 (2)'); + $this->assertTrue($newNode2->equals($value[1]), 'node: check values 2 (2)'); + + // Node types + $node1 = $this->graph->getNode('http://example.com/node/1'); + $nodeType = $this->graph->getNode('http://vocab.com/type/node'); + $nodeWithAliasesType = $this->graph->getNode('http://vocab.com/type/nodeWithAliases'); + + $this->assertSame($nodeType, $node1->getType(), 'type: n1 initial type'); + + $newType1 = $this->graph->createNode(); + $this->assertTrue($this->graph->containsNode($newNode1), 'type: new1 in graph'); + + $node1->addType($nodeType); + $this->assertSame($nodeType, $node1->getType(), 'type: n1 type still same'); + + $node1->addType($nodeWithAliasesType); + $node1->addType($newType1); + + $value = $node1->getType(); + $this->assertCount(3, $value, 'type: count values added'); + + $this->assertSame($nodeType, $value[0], 'type: check values 1'); + $this->assertSame($nodeWithAliasesType, $value[1], 'type: check values 2'); + $this->assertSame($newType1, $value[2], 'type: check values 3'); + + $node1->removeType($nodeWithAliasesType); + $value = $node1->getType(); + $this->assertCount(2, $value, 'typed: count nodeWithAliasesType removed again'); + + $this->assertTrue($nodeType->equals($value[0]), 'type: check values 1 (2)'); + $this->assertTrue($newType1->equals($value[1]), 'type: check values 2 (2)'); + + } + + /** + * Tests whether it is possible to add invalid values + * + * @expectedException InvalidArgumentException + */ + public function testAddInvalidPropertyValue() + { + $graph = new Graph(); + $newNode = $graph->createNode(); + + $node1 = $this->graph->getNode('http://example.com/node/1'); + $node1->addPropertyValue('http://vocab.com/link', $newNode); + } + + /** + * Tests whether it is possible to set the node's type to an invalid + * value + * + * @expectedException InvalidArgumentException + */ + public function testSetInvalidTypeValue() + { + $node1 = $this->graph->getNode('http://example.com/node/1'); + $node1->setType('http://vocab.com/type/aTypeAsString'); + } + + /** + * Tests whether it is possible to set the node's type to an invalid + * value when an array is used. + * + * @expectedException InvalidArgumentException + */ + public function testSetInvalidTypeArray() + { + $types = array( + $this->graph->getNode('http://vocab.com/type/nodeWithAliases'), + 'http://vocab.com/type/aTypeAsString' + ); + + $node1 = $this->graph->getNode('http://example.com/node/1'); + + $node1->setType($types); + } + + /** + * Tests whether it is possible to add an type which is not part of the + * graph + * + * @expectedException InvalidArgumentException + */ + public function testAddTypeNotInGraph() + { + $graph = new Graph(); + $newType = $graph->createNode(); + + $node1 = $this->graph->getNode('http://example.com/node/1'); + $node1->addType($newType); + } + + /** + * Tests whether nodes are contained in the graph + */ + public function testContains() + { + $node1 = $this->graph->getNode('http://example.com/node/1'); + $nodeb_0 = $this->graph->getNode('_:b0'); + + $this->assertTrue($this->graph->containsNode($node1), 'node1 obj'); + $this->assertTrue($this->graph->containsNode('http://example.com/node/1'), 'node1 IRI'); + $this->assertFalse($this->graph->containsNode('http://example.com/node/X'), 'inexistent IRI'); + $this->assertTrue($this->graph->containsNode($nodeb_0), '_:b0'); + $this->assertFalse($this->graph->containsNode('_:b0'), '_:b0 IRI'); + $this->assertFalse($this->graph->containsNode(new TypedValue('val', 'http://example.com/type')), 'typed value'); + } + + /** + * Tests whether creating an existing node returns the instance of that node + */ + public function testCreateExistingNode() + { + $node1 = $this->graph->getNode('http://example.com/node/1'); + $nodeType = $this->graph->getNode('http://vocab.com/type/node'); + + $this->assertSame($node1, $this->graph->createNode('http://example.com/node/1')); + $this->assertSame($nodeType, $this->graph->createNode('http://vocab.com/type/node')); + } + + /** + * Tests the merging of two graphs + */ + public function testMerge() + { + $this->markTestSkipped("Merging graphs doesn't work yet as blank nodes are not relabeled properly"); + + $json = << 'http://example.com/node/index.jsonld'))->getGraph(); + + // Merge graph2 into graph + $this->graph->merge($graph2); + + $nodeIds = array( + 'http://example.com/node/1', + 'http://example.com/node/2', + 'http://example.com/node/3', + 'http://example.com/node/4', + '_:b0', + '_:b1', + '_:b2', + '_:b3', + '_:b4', + 'http://vocab.com/type/node', + 'http://vocab.com/type/nodeWithAliases' + ); + + $nodes = $this->graph->getNodes(); + $this->assertCount(count($nodeIds), $nodes); + + foreach ($nodes as $node) { + // Is the node's ID valid? + $this->assertContains($node->getId(), $nodeIds, 'Found unexpected node ID: ' . $node->getId()); + + // Is the node of the right type? + $this->assertInstanceOf('ML\JsonLD\Node', $node); + + // Does the graph return the same instance? + $n = $this->graph->getNode($node->getId()); + $this->assertSame($node, $n, 'same instance'); + $this->assertTrue($node->equals($n), 'equals'); + $this->assertSame($this->graph, $n->getGraph(), 'linked to graph'); + + // It must not share node objects with graph 2 + $this->assertNotSame($node, $graph2->getNode($node->getId()), 'shared instance between graph and graph 2'); + } + + // Check that the properties have been updated as well + $node1 = $this->graph->getNode('http://example.com/node/1'); + $node2 = $this->graph->getNode('http://example.com/node/2'); + $node3 = $this->graph->getNode('http://example.com/node/3'); + $node4 = $this->graph->getNode('http://example.com/node/4'); + + $this->assertEquals( + new TypedValue('1', RdfConstants::XSD_STRING), + $node1->getProperty('http://vocab.com/name'), + 'n1->name' + ); + $this->assertSame($node2, $node1->getProperty('http://vocab.com/link'), 'n1 -link-> n2'); + $this->assertCount(2, $node1->getProperty('http://vocab.com/contains'), 'n1 -contains-> 2 blank nodes'); + + $this->assertEquals( + array( + new TypedValue('2', RdfConstants::XSD_STRING), + new TypedValue('and a different name in graph 2', RdfConstants::XSD_STRING) + ), + $node2->getProperty('http://vocab.com/name'), + 'n2->name' + ); + + $this->assertSame(array($node3, $node4), $node2->getProperty('http://vocab.com/link'), 'n2 -link-> n3 & n4'); + $this->assertEquals( + new TypedValue('this was added in graph 2', RdfConstants::XSD_STRING), + $node2->getProperty('http://vocab.com/newFromGraph2'), + 'n2->newFromGraph2' + ); + + $this->assertEquals( + new TypedValue('node 4 from graph 2', RdfConstants::XSD_STRING), + $node4->getProperty('http://vocab.com/name'), + 'n4->name' + ); + + // Verify that graph 2 wasn't changed + $nodeIds = array( + 'http://example.com/node/1', + 'http://example.com/node/2', + '_:b0', // ex:contains: { ex:nested } + 'http://example.com/node/4', + 'http://vocab.com/type/node' + ); + + $nodes = $graph2->getNodes(); + $this->assertCount(count($nodeIds), $nodes); + + foreach ($nodes as $node) { + // Is the node's ID valid? + $this->assertContains($node->getId(), $nodeIds, 'Found unexpected node ID in graph 2: ' . $node->getId()); + + // Is the node of the right type? + $this->assertInstanceOf('ML\JsonLD\Node', $node); + + // Does the graph return the same instance? + $n = $graph2->getNode($node->getId()); + $this->assertSame($node, $n, 'same instance (graph 2)'); + $this->assertTrue($node->equals($n), 'equals (graph 2)'); + $this->assertSame($graph2, $n->getGraph(), 'linked to graph (graph 2)'); + } + } + + /** + * Tests the serialization of nodes + */ + public function testSerializeNode() + { + $expected = $this->documentLoader->loadDocument( + '{ + "@id": "http://example.com/node/1", + "@type": [ "http://vocab.com/type/node" ], + "http://vocab.com/name": [ { "@value": "1" } ], + "http://vocab.com/link": [ { "@id": "http://example.com/node/2" } ], + "http://vocab.com/contains": [ { "@id": "_:b0" } ] + }' + ); + $expected = $expected->document; + + $node1 = $this->graph->getNode('http://example.com/node/1'); + $this->assertEquals($expected, $node1->toJsonLd(), 'Serialize node 1'); + } + + /** + * Tests the serialization of graphs + */ + public function testSerializeGraph() + { + // This is the expanded and flattened version of the test document + // (the blank node labels have been renamed from _:t... to _:b...) + $expected = $this->documentLoader->loadDocument( + '[{ + "@id": "_:b0", + "http://vocab.com/nested": [{ + "@value": "1.1" + }] + }, { + "@id": "_:b1", + "http://vocab.com/nested": [{ + "@value": "2.1" + }] + }, { + "@id": "_:b2", + "http://vocab.com/nested": [{ + "@value": "2.2" + }] + }, { + "@id": "_:b3", + "http://vocab.com/nested": [{ + "@value": "3.1" + }] + }, { + "@id": "http://example.com/node/1", + "@type": ["http://vocab.com/type/node"], + "http://vocab.com/contains": [{ + "@id": "_:b0" + }], + "http://vocab.com/link": [{ + "@id": "http://example.com/node/2" + }], + "http://vocab.com/name": [{ + "@value": "1" + }] + }, { + "@id": "http://example.com/node/2", + "@type": ["http://vocab.com/type/nodeWithAliases"], + "http://vocab.com/aliases": [{ + "@value": "node2" + }, { + "@value": 2, + "@type": "http://www.w3.org/2001/XMLSchema#integer" + }], + "http://vocab.com/contains": [{ + "@id": "_:b1" + }, { + "@id": "_:b2" + }], + "http://vocab.com/lang": [{ + "@language": "en", + "@value": "language-tagged string" + }], + "http://vocab.com/link": [{ + "@id": "http://example.com/node/3" + }], + "http://vocab.com/name": [{ + "@value": "2" + }], + "http://vocab.com/typed": [{ + "@type": "http://vocab.com/type/datatype", + "@value": "typed value" + }] + }, { + "@id": "http://example.com/node/3", + "@type": ["http://vocab.com/type/node"], + "http://vocab.com/contains": [{ + "@id": "_:b3" + }], + "http://vocab.com/lang": [{ + "@language": "en", + "@value": "language-tagged string: en" + }, { + "@language": "de", + "@value": "language-tagged string: de" + }], + "http://vocab.com/link": [{ + "@id": "http://example.com/node/1" + }], + "http://vocab.com/name": [{ + "@value": "3" + }], + "http://vocab.com/typed": [{ + "@type": "http://vocab.com/type/datatype", + "@value": "typed value" + }, { + "@language": "ex:/type/otherDataType", + "@value": "typed value" + }, { + "@language": "ex:/type/datatype", + "@value": "typed value" + }] + }, { + "@id": "http://vocab.com/type/node" + }, { + "@id": "http://vocab.com/type/nodeWithAliases" + }]' + ); + $expected = $expected->document; + + $this->assertEquals($expected, $this->graph->toJsonLd(false), 'Serialize graph'); + } +} diff --git a/vendor/ml/json-ld/Test/JsonLDApiTest.php b/vendor/ml/json-ld/Test/JsonLDApiTest.php new file mode 100644 index 00000000..dcb7dbfe --- /dev/null +++ b/vendor/ml/json-ld/Test/JsonLDApiTest.php @@ -0,0 +1,132 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD\Test; + +use ML\JsonLD\JsonLD; + +/** + * Tests JsonLD's API + * + * @author Markus Lanthaler + */ +class JsonLDApiTest extends JsonTestCase +{ + /** + * Tests the expansion API + * + * @group expansion + */ + public function testExpansion() + { + $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR; + $expected = json_decode(file_get_contents($path . 'sample-expanded.jsonld')); + + $input = $path . 'sample-in.jsonld'; + $this->assertJsonEquals($expected, JsonLD::expand($input), 'Passing the file path'); + + $input = file_get_contents($input); + $this->assertJsonEquals($expected, JsonLD::expand($input), 'Passing the raw input (string)'); + + $input = json_decode($input); + $this->assertJsonEquals($expected, JsonLD::expand($input), 'Passing the parsed object'); + } + + /** + * Tests the compaction API + * + * @group compaction + */ + public function testCompaction() + { + $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR; + $expected = json_decode(file_get_contents($path . 'sample-compacted.jsonld')); + + $input = $path . 'sample-in.jsonld'; + $context = $path . 'sample-context.jsonld'; + $this->assertJsonEquals($expected, JsonLD::compact($input, $context), 'Passing the file path'); + + $input = file_get_contents($input); + $context = file_get_contents($context); + $this->assertJsonEquals($expected, JsonLD::compact($input, $context), 'Passing the raw input (string)'); + + $input = json_decode($input); + $context = json_decode($context); + $this->assertJsonEquals($expected, JsonLD::compact($input, $context), 'Passing the parsed object'); + } + + /** + * Tests the flattening API + * + * @group flattening + */ + public function testFlatten() + { + $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR; + $expected = json_decode(file_get_contents($path . 'sample-flattened.jsonld')); + + $input = $path . 'sample-in.jsonld'; + $context = $path . 'sample-context.jsonld'; + $this->assertJsonEquals($expected, JsonLD::flatten($input, $context), 'Passing the file path'); + + $input = file_get_contents($input); + $context = file_get_contents($context); + $this->assertJsonEquals($expected, JsonLD::flatten($input, $context), 'Passing the raw input (string)'); + + $input = json_decode($input); + $context = json_decode($context); + $this->assertJsonEquals($expected, JsonLD::flatten($input, $context), 'Passing the parsed object'); + } + + /** + * Tests the framing API + * + * This test intentionally uses the same fixtures as the flattening tests. + * + * @group framing + */ + public function testFrame() + { + $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR; + $expected = json_decode(file_get_contents($path . 'sample-flattened.jsonld')); + + $input = $path . 'sample-in.jsonld'; + $context = $path . 'sample-context.jsonld'; + $this->assertJsonEquals($expected, JsonLD::frame($input, $context), 'Passing the file path'); + + $input = file_get_contents($input); + $context = file_get_contents($context); + $this->assertJsonEquals($expected, JsonLD::frame($input, $context), 'Passing the raw input (string)'); + + $input = json_decode($input); + $context = json_decode($context); + $this->assertJsonEquals($expected, JsonLD::frame($input, $context), 'Passing the parsed object'); + } + + /** + * Tests the document API + * + * This test intentionally uses the same fixtures as the flattening tests. + */ + public function testGetDocument() + { + + $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR; + $expected = json_decode(file_get_contents($path . 'sample-serialized-document.jsonld')); + + $input = $path . 'sample-in.jsonld'; + $this->assertJsonEquals($expected, JsonLD::getDocument($input)->toJsonLd(), 'Passing the file path'); + + $input = file_get_contents($input); + $this->assertJsonEquals($expected, JsonLD::getDocument($input)->toJsonLd(), 'Passing the raw input (string)'); + + $input = json_decode($input); + $this->assertJsonEquals($expected, JsonLD::getDocument($input)->toJsonLd(), 'Passing the parsed object'); + } +} diff --git a/vendor/ml/json-ld/Test/JsonTestCase.php b/vendor/ml/json-ld/Test/JsonTestCase.php new file mode 100644 index 00000000..8e8d0bd3 --- /dev/null +++ b/vendor/ml/json-ld/Test/JsonTestCase.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD\Test; + +/** + * A JSON Test Case + * + * This class extends {@link \PHPUnit_Framework_TestCase} with an assertion + * to compare JSON. + * + * @author Markus Lanthaler + */ +abstract class JsonTestCase extends \PHPUnit_Framework_TestCase +{ + /** + * Asserts that two JSON structures are equal. + * + * @param object|array $expected + * @param object|array $actual + * @param string $message + */ + public static function assertJsonEquals($expected, $actual, $message = '') + { + $expected = self::normalizeJson($expected); + $actual = self::normalizeJson($actual); + + self::assertEquals($expected, $actual, $message); + } + + /** + * Brings the keys of objects to a deterministic order to enable + * comparison of JSON structures + * + * @param mixed $element The element to normalize. + * + * @return mixed The same data with all object keys ordered in a + * deterministic way. + */ + private static function normalizeJson($element) + { + if (is_array($element)) { + foreach ($element as &$item) { + $item = self::normalizeJson($item); + } + } elseif (is_object($element)) { + $element = (array) $element; + ksort($element); + $element = (object) $element; + + foreach ($element as &$item) { + $item = self::normalizeJson($item); + } + } + + return $element; + } +} diff --git a/vendor/ml/json-ld/Test/NQuadsTest.php b/vendor/ml/json-ld/Test/NQuadsTest.php new file mode 100644 index 00000000..097b9d55 --- /dev/null +++ b/vendor/ml/json-ld/Test/NQuadsTest.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD\Test; + +use ML\JsonLD\JsonLD; +use ML\JsonLD\NQuads; + +/** + * Tests NQuads + * + * @author Markus Lanthaler + */ +class NQuadsTest extends \PHPUnit_Framework_TestCase +{ + /** + * Tests the expansion API + * + * @expectedException \ML\JsonLD\Exception\InvalidQuadException + */ + public function testInvalidParse() + { + $nquads = new NQuads(); + $nquads->parse('Invalid NQuads file'); + } + + /** + * Tests escaping + */ + public function testEscaping() + { + $doc = ''; + $doc .= ' '; + $doc .= ' "String with line-break \n and quote (\")" .'; + $doc .= "\n"; + + $nquads = new NQuads(); + $parsed = JsonLD::fromRdf($nquads->parse($doc)); + $serialized = $nquads->serialize(JsonLD::toRdf($parsed)); + + $this->assertSame($doc, $serialized); + } +} diff --git a/vendor/ml/json-ld/Test/TestManifestIterator.php b/vendor/ml/json-ld/Test/TestManifestIterator.php new file mode 100644 index 00000000..79272cc4 --- /dev/null +++ b/vendor/ml/json-ld/Test/TestManifestIterator.php @@ -0,0 +1,120 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD\Test; + +/** + * TestManifestIterator reads a test manifest and returns the contained test + * definitions. + * + * @author Markus Lanthaler + */ +class TestManifestIterator implements \Iterator +{ + /** The current position. */ + private $key = 0; + + /** The test directory. */ + private $directory; + + /** The test manifest. */ + private $manifest; + + /** The URL of the test manifest. */ + private $url; + + /** The total number of tests. */ + private $numberTests = 0; + + /** + * Constructor + * + * @param string $file The manifest's filename. + * @param string $url The manifest's URL. + */ + public function __construct($file, $url) + { + if (file_exists($file)) { + $this->manifest = json_decode(file_get_contents($file)); + $this->numberTests = count($this->manifest->{'sequence'}); + $this->url = $url; + $this->directory = dirname($file) . DIRECTORY_SEPARATOR; + } + } + + /** + * Rewinds the TestManifestIterator to the first element. + */ + public function rewind() + { + $this->key = 0; + } + + /** + * Checks if current position is valid. + * + * @return bool True if the current position is valid; otherwise, false. + */ + public function valid() + { + return ($this->key < $this->numberTests); + } + + /** + * Returns the key of the current element. + * + * @return string The key of the current element + */ + public function key() + { + return $this->url . $this->manifest->{'sequence'}[$this->key]->{'@id'}; + } + + /** + * Returns the current element. + * + * @return array Returns an array containing the name of the test and the + * test definition object. + */ + public function current() + { + $test = $this->manifest->{'sequence'}[$this->key]; + $options = isset($test->{'option'}) + ? clone $test->{'option'} // cloning because we are modifying it + : new \stdClass(); + + if (false === property_exists($options, 'base')) { + if (property_exists($this->manifest, 'baseIri')) { + $options->base = $this->manifest->{'baseIri'} . $test->{'input'}; + } else { + $options->base = $test->{'input'}; + } + } + + if (isset($options->{'expandContext'}) && (false === strpos($options->{'expandContext'}, ':'))) { + $options->{'expandContext'} = $this->directory . $options->{'expandContext'}; + } + + $test = array( + 'name' => $test->{'name'}, + 'test' => $test, + 'options' => $options + ); + + return $test; + } + + /** + * Moves forward to next element. + */ + public function next() + { + $this->key++; + } +} diff --git a/vendor/ml/json-ld/Test/ValueTest.php b/vendor/ml/json-ld/Test/ValueTest.php new file mode 100644 index 00000000..d4f5a00a --- /dev/null +++ b/vendor/ml/json-ld/Test/ValueTest.php @@ -0,0 +1,138 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD\Test; + +use ML\JsonLD\LanguageTaggedString; +use ML\JsonLD\TypedValue; + +/** + * Test LanguageTaggedString and TypedValue + * + * @author Markus Lanthaler + */ +class ValueTest extends \PHPUnit_Framework_TestCase +{ + /** + * Tests LanguageTaggedString + */ + public function testLanguageTaggedString() + { + $string1 = new LanguageTaggedString('', ''); + $this->assertSame('', $string1->getValue(), 'string1 value'); + $this->assertSame('', $string1->getLanguage(), 'string1 language'); + + $string2 = new LanguageTaggedString('wert', 'de'); + $this->assertSame('wert', $string2->getValue(), 'string2 value'); + $this->assertSame('de', $string2->getLanguage(), 'string2 language'); + + $string3 = new LanguageTaggedString('value', 'en'); + $this->assertSame('value', $string3->getValue(), 'string3 value'); + $this->assertSame('en', $string3->getLanguage(), 'string3 language'); + } + + /** + * Tests LanguageTaggedString with an invalid value + * + * @expectedException \InvalidArgumentException + */ + public function testLanguageTaggedStringInvalidValue() + { + $string1 = new LanguageTaggedString('value', 'language'); + $string1->setValue(1); + } + + /** + * Tests LanguageTaggedString with an invalid language + * + * @expectedException \InvalidArgumentException + */ + public function testLanguageTaggedStringInvalidLanguage() + { + $string1 = new LanguageTaggedString('value', 'language'); + $string1->setLanguage(null); + } + + /** + * Tests TypedValue + */ + public function testTypedValue() + { + $value1 = new TypedValue('', ''); + $this->assertSame('', $value1->getValue(), 'string1 value'); + $this->assertSame('', $value1->getType(), 'string1 type'); + + $value2 = new TypedValue('wert', 'http://example.com/type1'); + $this->assertSame('wert', $value2->getValue(), 'string2 value'); + $this->assertSame('http://example.com/type1', $value2->getType(), 'string2 type'); + + $value3 = new TypedValue('value', 'http://example.com/type2'); + $this->assertSame('value', $value3->getValue(), 'string3 value'); + $this->assertSame('http://example.com/type2', $value3->getType(), 'string3 type'); + } + + /** + * Tests TypedValue with an invalid value + * + * @expectedException \InvalidArgumentException + */ + public function testTypedValueInvalidValue() + { + $value1 = new LanguageTaggedString('value', 'language'); + $value1->setValue(1); + } + + /** + * Tests TypedValue with an invalid type + * + * @expectedException \InvalidArgumentException + */ + public function testTypedValueInvalidLanguage() + { + $value1 = new TypedValue('value', 'http://example.com/type'); + $value1->setType(1); + } + + /** + * Tests TypedValue with an invalid type + */ + public function testEquals() + { + $string1a = new LanguageTaggedString('value', 'en'); + $string1b = new LanguageTaggedString('value', 'en'); + $string2 = new LanguageTaggedString('value', 'de'); + $string3 = new LanguageTaggedString('wert', 'en'); + + $this->assertTrue($string1a->equals($string1b), 's1a == s1b?'); + $this->assertFalse($string1a->equals($string2), 's1a == s2?'); + $this->assertFalse($string1a->equals($string3), 's1a == s3?'); + $this->assertFalse($string1b->equals($string2), 's1b == s2?'); + $this->assertFalse($string1b->equals($string3), 's1b == s3?'); + $this->assertFalse($string2->equals($string3), 's2 == s3?'); + + + $typed1a = new TypedValue('value', 'http://example.com/type1'); + $typed1b = new TypedValue('value', 'http://example.com/type1'); + $typed2 = new TypedValue('value', 'http://example.com/type2'); + $typed3 = new TypedValue('wert', 'http://example.com/type1'); + + $this->assertTrue($typed1a->equals($typed1b), 't1a == t1b?'); + $this->assertFalse($typed1a->equals($typed2), 't1a == t2?'); + $this->assertFalse($typed1a->equals($typed3), 't1a == t3?'); + $this->assertFalse($typed1b->equals($typed2), 't1b == t2?'); + $this->assertFalse($typed1b->equals($typed3), 't1b == t3?'); + $this->assertFalse($typed2->equals($typed3), 't2 == t3?'); + + $string4 = new LanguageTaggedString('', ''); + $typed4 = new TypedValue('', ''); + + $this->assertFalse($string4->equals($typed4), 's4 == t4'); + $this->assertFalse($typed4->equals($string4), 's4 == t4'); + } +} diff --git a/vendor/ml/json-ld/Test/W3CTestSuiteTest.php b/vendor/ml/json-ld/Test/W3CTestSuiteTest.php new file mode 100644 index 00000000..fdfcb6ab --- /dev/null +++ b/vendor/ml/json-ld/Test/W3CTestSuiteTest.php @@ -0,0 +1,368 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD\Test; + +use ML\JsonLD\JsonLD; +use ML\JsonLD\NQuads; +use ML\JsonLD\Test\TestManifestIterator; + +/** + * The official W3C JSON-LD test suite. + * + * @link http://www.w3.org/2013/json-ld-tests/ Official W3C JSON-LD test suite + * + * @author Markus Lanthaler + */ +class W3CTestSuiteTest extends JsonTestCase +{ + /** + * The base directory from which the test manifests, input, and output + * files should be read. + */ + private $basedir; + + /** + * The URL corresponding to the base directory + */ + private $baseurl = 'http://json-ld.org/test-suite/tests/'; + + /** + * @var string The test's ID. + */ + private $id; + + /** + * Constructs a test case with the given name. + * + * @param null|string $name + * @param array $data + * @param string $dataName + */ + public function __construct($name = null, array $data = array(), $dataName = '') + { + $this->id = $dataName; + + parent::__construct($name, $data, $dataName); + $this->basedir = dirname(__FILE__) . '/../vendor/json-ld/tests/'; + } + + /** + * Returns the test identifier. + * + * @return string The test identifier + */ + public function getTestId() + { + return $this->id; + } + + /** + * Tests expansion. + * + * @param string $name The test name. + * @param object $test The test definition. + * @param object $options The options to configure the algorithms. + * + * @group expansion + * @dataProvider expansionProvider + */ + public function testExpansion($name, $test, $options) + { + $expected = json_decode(file_get_contents($this->basedir . $test->{'expect'})); + $result = JsonLD::expand($this->basedir . $test->{'input'}, $options); + + $this->assertJsonEquals($expected, $result); + } + + /** + * Provides expansion test cases. + */ + public function expansionProvider() + { + return new TestManifestIterator( + $this->basedir . 'expand-manifest.jsonld', + $this->baseurl . 'expand-manifest.jsonld' + ); + } + + /** + * Tests compaction. + * + * @param string $name The test name. + * @param object $test The test definition. + * @param object $options The options to configure the algorithms. + * + * @group compaction + * @dataProvider compactionProvider + */ + public function testCompaction($name, $test, $options) + { + $expected = json_decode(file_get_contents($this->basedir . $test->{'expect'})); + $result = JsonLD::compact( + $this->basedir . $test->{'input'}, + $this->basedir . $test->{'context'}, + $options + ); + + $this->assertJsonEquals($expected, $result); + } + + + /** + * Provides compaction test cases. + */ + public function compactionProvider() + { + return new TestManifestIterator( + $this->basedir . 'compact-manifest.jsonld', + $this->baseurl . 'compact-manifest.jsonld' + ); + } + + /** + * Tests flattening. + * + * @param string $name The test name. + * @param object $test The test definition. + * @param object $options The options to configure the algorithms. + * + * @group flattening + * @dataProvider flattenProvider + */ + public function testFlatten($name, $test, $options) + { + $expected = json_decode(file_get_contents($this->basedir . $test->{'expect'})); + $context = (isset($test->{'context'})) + ? $this->basedir . $test->{'context'} + : null; + + $result = JsonLD::flatten($this->basedir . $test->{'input'}, $context, $options); + + $this->assertJsonEquals($expected, $result); + } + + /** + * Provides flattening test cases. + */ + public function flattenProvider() + { + return new TestManifestIterator( + $this->basedir . 'flatten-manifest.jsonld', + $this->baseurl . 'flatten-manifest.jsonld' + ); + } + + /** + * Tests remote document loading. + * + * @param string $name The test name. + * @param object $test The test definition. + * @param object $options The options to configure the algorithms. + * + * @group remote + * @dataProvider remoteDocumentLoadingProvider + */ + public function testRemoteDocumentLoading($name, $test, $options) + { + if (in_array('jld:NegativeEvaluationTest', $test->{'@type'})) { + $this->setExpectedException('ML\JsonLD\Exception\JsonLdException', null, $test->{'expect'}); + } else { + $expected = json_decode($this->replaceBaseUrl(file_get_contents($this->basedir . $test->{'expect'}))); + } + + unset($options->base); + + $result = JsonLD::expand($this->replaceBaseUrl($this->baseurl . $test->{'input'}), $options); + + if (isset($expected)) { + $this->assertJsonEquals($expected, $result); + } + } + + /** + * Provides remote document loading test cases. + */ + public function remoteDocumentLoadingProvider() + { + return new TestManifestIterator( + $this->basedir . 'remote-doc-manifest.jsonld', + $this->baseurl . 'remote-doc-manifest.jsonld' + ); + } + + /** + * Replaces the base URL 'http://json-ld.org/' with 'https://json-ld.org:443/'. + * + * The test location of the test suite has been changed as the site has been + * updated to use HTTPS everywhere. + * + * @param string $input The input string. + * + * @return string The input string with all occurrences of the old base URL replaced with the new HTTPS-based one. + */ + private function replaceBaseUrl($input) { + return str_replace('http://json-ld.org/', 'https://json-ld.org:443/', $input); + } + + /** + * Tests errors (uses flattening). + * + * @param string $name The test name. + * @param object $test The test definition. + * @param object $options The options to configure the algorithms. + * + * @group errors + * @dataProvider errorProvider + */ + public function testError($name, $test, $options) + { + $this->setExpectedException('ML\JsonLD\Exception\JsonLdException', null, $test->{'expect'}); + + JsonLD::flatten( + $this->basedir . $test->{'input'}, + (isset($test->{'context'})) ? $this->basedir . $test->{'context'} : null, + $options + ); + } + + /** + * Provides error test cases. + */ + public function errorProvider() + { + return new TestManifestIterator( + $this->basedir . 'error-manifest.jsonld', + $this->baseurl . 'error-manifest.jsonld' + ); + } + + /** + * Tests framing. + * + * @param string $name The test name. + * @param object $test The test definition. + * @param object $options The options to configure the algorithms. + * + * @group framing + * @dataProvider framingProvider + */ + public function testFraming($name, $test, $options) + { + $ignoredTests = array( + 'frame-0005-in.jsonld', + 'frame-0009-in.jsonld', + 'frame-0010-in.jsonld', + 'frame-0012-in.jsonld', + 'frame-0013-in.jsonld', + 'frame-0023-in.jsonld', + 'frame-0024-in.jsonld', + 'frame-0027-in.jsonld', + 'frame-0028-in.jsonld', + 'frame-0029-in.jsonld', + 'frame-0030-in.jsonld' + ); + + if (in_array($test->{'input'}, $ignoredTests)) { + $this->markTestSkipped( + 'This implementation uses deep value matching and aggressive re-embedding. See ISSUE-110 and ISSUE-119.' + ); + } + + $expected = json_decode(file_get_contents($this->basedir . $test->{'expect'})); + $result = JsonLD::frame( + $this->basedir . $test->{'input'}, + $this->basedir . $test->{'frame'}, + $options + ); + + $this->assertJsonEquals($expected, $result); + } + + /** + * Provides framing test cases. + */ + public function framingProvider() + { + return new TestManifestIterator( + $this->basedir . 'frame-manifest.jsonld', + $this->baseurl . 'frame-manifest.jsonld' + ); + } + + /** + * Tests conversion to RDF quads. + * + * @param string $name The test name. + * @param object $test The test definition. + * @param object $options The options to configure the algorithms. + * + * @group toRdf + * @dataProvider toRdfProvider + */ + public function testToRdf($name, $test, $options) + { + $expected = trim(file_get_contents($this->basedir . $test->{'expect'})); + $quads = JsonLD::toRdf($this->basedir . $test->{'input'}, $options); + + $serializer = new NQuads(); + $result = $serializer->serialize($quads); + + // Sort quads (the expected quads are already sorted) + $result = explode("\n", trim($result)); + sort($result); + $result = implode("\n", $result); + + $this->assertEquals($expected, $result); + } + + /** + * Provides conversion to RDF quads test cases. + */ + public function toRdfProvider() + { + return new TestManifestIterator( + $this->basedir . 'toRdf-manifest.jsonld', + $this->baseurl . 'toRdf-manifest.jsonld' + ); + } + + /** + * Tests conversion from quads. + * + * @param string $name The test name. + * @param object $test The test definition. + * @param object $options The options to configure the algorithms. + * + * @group fromRdf + * @dataProvider fromRdfProvider + */ + public function testFromRdf($name, $test, $options) + { + $expected = json_decode(file_get_contents($this->basedir . $test->{'expect'})); + + $parser = new NQuads(); + $quads = $parser->parse(file_get_contents($this->basedir . $test->{'input'})); + + $result = JsonLD::fromRdf($quads, $options); + + $this->assertEquals($expected, $result); + } + + /** + * Provides conversion to quads test cases. + */ + public function fromRdfProvider() + { + return new TestManifestIterator( + $this->basedir . 'fromRdf-manifest.jsonld', + $this->baseurl . 'fromRdf-manifest.jsonld' + ); + } +} diff --git a/vendor/ml/json-ld/Test/bootstrap.php b/vendor/ml/json-ld/Test/bootstrap.php new file mode 100644 index 00000000..977c8242 --- /dev/null +++ b/vendor/ml/json-ld/Test/bootstrap.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +use stdClass as JsonObject; + +/** + * A typed value represents a value with an associated type. + * + * @author Markus Lanthaler + */ +final class TypedValue extends Value +{ + /** + * The type of the value in the form of an IRI. + * + * @var string + */ + private $type; + + /** + * Constructor + * + * @param string $value The value. + * @param string $type The type. + */ + public function __construct($value, $type) + { + $this->setValue($value); + $this->setType($type); + } + + /** + * Set the type + * + * For the sake of simplicity, the type is currently just a Node + * identifier in the form of a string and not a Node reference. + * This might be changed in the future. + * + * @param string $type The type. + * + * @return self + * + * @throws \InvalidArgumentException If the type is not a string. No + * further checks are currently done. + */ + public function setType($type) + { + if (!is_string($type)) { + throw new \InvalidArgumentException('type must be a string.'); + } + + $this->type = $type; + + return $this; + } + + /** + * Get the type + * + * For the sake of simplicity, the type is currently just a Node + * identifier in the form of a string and not a Node reference. + * This might be changed in the future. + * + * @return string The type. + */ + public function getType() + { + return $this->type; + } + + /** + * {@inheritdoc} + */ + public function toJsonLd($useNativeTypes = true) + { + $result = new JsonObject(); + + if (RdfConstants::XSD_STRING === $this->type) { + $result->{'@value'} = $this->value; + + return $result; + } + + if (true === $useNativeTypes) { + if (RdfConstants::XSD_BOOLEAN === $this->type) { + if ('true' === $this->value) { + $result->{'@value'} = true; + + return $result; + } elseif ('false' === $this->value) { + $result->{'@value'} = false; + + return $result; + } + + } elseif (RdfConstants::XSD_INTEGER === $this->type) { + if (preg_match('/^[\+|-]?\d+$/', trim($this->value))) { + $result->{'@value'} = intval($this->value); + + return $result; + } + } elseif (RdfConstants::XSD_DOUBLE === $this->type) { + // TODO Need to handle +/-INF and NaN as well? + if (preg_match('/^[\+|-]?\d+(?:\.\d*)?(?:[eE][\+|-]?\d+)?$/', trim($this->value))) { + $result->{'@value'} = floatval($this->value); + + return $result; + } + // TODO Need to preserve doubles without fraction for round-tripping?? + } + } + + $result->{'@value'} = $this->value; + $result->{'@type'} = $this->type; + + return $result; + } + + /** + * {@inheritdoc} + */ + public function equals($other) + { + if (get_class($this) !== get_class($other)) { + return false; + } + + return ($this->value === $other->value) && ($this->type === $other->type); + + } +} diff --git a/vendor/ml/json-ld/Value.php b/vendor/ml/json-ld/Value.php new file mode 100644 index 00000000..0839f64e --- /dev/null +++ b/vendor/ml/json-ld/Value.php @@ -0,0 +1,123 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ML\JsonLD; + +use stdClass as JsonObject; + +/** + * Value is the abstract base class used for typed values and + * language-tagged strings. + * + * @author Markus Lanthaler + */ +abstract class Value implements JsonLdSerializable +{ + /** + * The value in the form of a string + * + * @var string + */ + protected $value; + + /** + * Set the value + * + * @param string $value The value. + * + * @return self + * + * @throws \InvalidArgumentException If the value is not a string. + */ + public function setValue($value) + { + if (!is_string($value)) { + throw new \InvalidArgumentException('value must be a string.'); + } + + $this->value = $value; + + return $this; + } + + /** + * Get the value + * + * @return string The value. + */ + public function getValue() + { + return $this->value; + } + + /** + * Create a LanguageTaggedString or TypedValue from a JSON-LD element + * + * If the passed value element can't be transformed to a language-tagged + * string or a typed value false is returned. + * + * @param JsonObject $element The JSON-LD element + * + * @return false|LanguageTaggedString|TypedValue The parsed object + */ + public static function fromJsonLd(JsonObject $element) + { + if (false === property_exists($element, '@value')) { + return false; + } + + $value = $element->{'@value'}; + $type = (property_exists($element, '@type')) + ? $element->{'@type'} + : null; + $language = (property_exists($element, '@language')) + ? $element->{'@language'} + : null; + + if (is_int($value) || is_float($value)) { + if (($value != (int) $value) || (RdfConstants::XSD_DOUBLE === $type)) { + $value = preg_replace('/(0{0,14})E(\+?)/', 'E', sprintf('%1.15E', $value)); + + if ((null === $type) && (null === $language)) { + return new TypedValue($value, RdfConstants::XSD_DOUBLE); + } + } else { + $value = sprintf('%d', $value); + if ((null === $type) && (null === $language)) { + return new TypedValue($value, RdfConstants::XSD_INTEGER); + } + } + } elseif (is_bool($value)) { + $value = ($value) ? 'true' : 'false'; + + if ((null === $type) && (null === $language)) { + return new TypedValue($value, RdfConstants::XSD_BOOLEAN); + } + } elseif (false === is_string($value)) { + return false; + } + + // @type gets precedence + if ((null === $type) && (null !== $language)) { + return new LanguageTaggedString($value, $language); + } + + return new TypedValue($value, (null === $type) ? RdfConstants::XSD_STRING : $type); + } + + /** + * Compares this instance to the specified value. + * + * @param mixed $other The value this instance should be compared to. + * + * @return bool Returns true if the passed value is the same as this + * instance; false otherwise. + */ + abstract public function equals($other); +} diff --git a/vendor/ml/json-ld/composer.json b/vendor/ml/json-ld/composer.json new file mode 100644 index 00000000..d362c7c3 --- /dev/null +++ b/vendor/ml/json-ld/composer.json @@ -0,0 +1,30 @@ +{ + "name": "ml/json-ld", + "type": "library", + "description": "JSON-LD Processor for PHP", + "keywords": [ "JSON-LD", "jsonld" ], + "homepage": "http://www.markus-lanthaler.com", + "license": "MIT", + "authors": [ + { + "name": "Markus Lanthaler", + "email": "mail@markus-lanthaler.com", + "homepage": "http://www.markus-lanthaler.com", + "role": "Developer" + } + ], + "require": { + "php": ">=5.3.0", + "ext-json": "*", + "ml/iri": "^1.1.1" + }, + "require-dev": { + "json-ld/tests": "1.0", + "phpunit/phpunit": "^4" + }, + "autoload": { + "psr-4": { + "ML\\JsonLD\\": "" + } + } +} diff --git a/vendor/ml/json-ld/phpunit.xml.dist b/vendor/ml/json-ld/phpunit.xml.dist new file mode 100644 index 00000000..1a96be6d --- /dev/null +++ b/vendor/ml/json-ld/phpunit.xml.dist @@ -0,0 +1,74 @@ + + + + + + ./Test/ + + + + + + ./ + + ./Test + ./vendor + + + + + + + + + + + diff --git a/vendor/oscarotero/html-parser/.travis.yml b/vendor/oscarotero/html-parser/.travis.yml new file mode 100644 index 00000000..97969841 --- /dev/null +++ b/vendor/oscarotero/html-parser/.travis.yml @@ -0,0 +1,16 @@ +language: php +sudo: false + +matrix: + include: + - php: 7.2 + - php: 7.4 + - php: nightly + env: + - COMPOSER_ARG="--ignore-platform-reqs" + +before_install: + - composer install $COMPOSER_ARG + +script: + - composer test diff --git a/vendor/oscarotero/html-parser/CHANGELOG.md b/vendor/oscarotero/html-parser/CHANGELOG.md new file mode 100644 index 00000000..afb32090 --- /dev/null +++ b/vendor/oscarotero/html-parser/CHANGELOG.md @@ -0,0 +1,44 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + +## [0.1.6] - 2020-11-19 +### Added +- Added a second argument to `parse` and `parseFragment` to specify the encoding instead autodetect [#2] [#3] + +## [0.1.5] - 2020-08-31 +### Fixed +- Support for PHP 8 [#1] + +## [0.1.4] - 2019-12-15 +### Fixed +- Changed the way to handle different encodings detecting the and elements + +## [0.1.3] - 2019-07-20 +### Fixed +- UTF-8 econding issues + +## [0.1.2] - 2019-05-25 +### Fixed +- Improved encoding detection + +## [0.1.1] - 2019-04-21 +### Fixed +- `parseFragment` was returning a fragment containing only the first element + +## 0.1.0 - 2019-04-21 +First version + +[#1]: https://github.com/oscarotero/html-parser/issues/1 +[#2]: https://github.com/oscarotero/html-parser/issues/2 +[#3]: https://github.com/oscarotero/html-parser/issues/3 + +[0.1.6]: https://github.com/oscarotero/html-parser/compare/v0.1.5...v0.1.6 +[0.1.5]: https://github.com/oscarotero/html-parser/compare/v0.1.4...v0.1.5 +[0.1.4]: https://github.com/oscarotero/html-parser/compare/v0.1.3...v0.1.4 +[0.1.3]: https://github.com/oscarotero/html-parser/compare/v0.1.2...v0.1.3 +[0.1.2]: https://github.com/oscarotero/html-parser/compare/v0.1.1...v0.1.2 +[0.1.1]: https://github.com/oscarotero/html-parser/compare/v0.1.0...v0.1.1 diff --git a/vendor/oscarotero/html-parser/LICENSE b/vendor/oscarotero/html-parser/LICENSE new file mode 100644 index 00000000..604fe28d --- /dev/null +++ b/vendor/oscarotero/html-parser/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Oscar Otero + +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/oscarotero/html-parser/README.md b/vendor/oscarotero/html-parser/README.md new file mode 100644 index 00000000..1ca5462b --- /dev/null +++ b/vendor/oscarotero/html-parser/README.md @@ -0,0 +1,25 @@ +# HTML parser + +Simple utility to parse html strings to DOMDocument. + +```sh +composer require oscarotero/html-parser +``` + +## Usage + +```php +use HtmlParser\Parser; + +$html = 'Hello world'; + +//Convert a string to a DOMDocument +$document = Parser::parse($html); + +//Convert a string to a DOMDocumentFragment +$fragment = Parser::parseFragment('

Hello world

'); + +//Convert a DOMDocument or DOMDocumentFragment to a string +echo Parser::stringify($document); +echo Parser::stringify($fragment); +``` diff --git a/vendor/oscarotero/html-parser/composer.json b/vendor/oscarotero/html-parser/composer.json new file mode 100644 index 00000000..21707dfe --- /dev/null +++ b/vendor/oscarotero/html-parser/composer.json @@ -0,0 +1,41 @@ +{ + "name": "oscarotero/html-parser", + "type": "library", + "description": "Parse html strings to DOMDocument", + "keywords": ["html", "parser", "dom"], + "homepage": "https://github.com/oscarotero/html-parser", + "license": "MIT", + "authors": [ + { + "name": "Oscar Otero", + "email": "oom@oscarotero.com", + "homepage": "http://oscarotero.com", + "role": "Developer" + } + ], + "support": { + "email": "oom@oscarotero.com", + "issues": "https://github.com/oscarotero/html-parser/issues" + }, + "require": { + "php": "^7.2 || ^8" + }, + "autoload": { + "psr-4": { + "HtmlParser\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "HtmlParser\\Tests\\": "tests" + } + }, + "require-dev": { + "phpunit/phpunit": "^8.0", + "friendsofphp/php-cs-fixer": "^2.11" + }, + "scripts": { + "test": "phpunit", + "cs-fix": "php-cs-fixer fix ." + } +} diff --git a/vendor/oscarotero/html-parser/src/Parser.php b/vendor/oscarotero/html-parser/src/Parser.php new file mode 100644 index 00000000..f2b1a9cb --- /dev/null +++ b/vendor/oscarotero/html-parser/src/Parser.php @@ -0,0 +1,95 @@ +saveHTML($node); + } + + return $node->ownerDocument->saveHTML($node); + } + + public static function parse(string $html, ?string $encoding = null): DOMDocument + { + $detected = $encoding ?? mb_detect_encoding($html); + + if ($detected) { + $html = mb_convert_encoding($html, 'HTML-ENTITIES', $detected); + } + + $document = self::createDOMDocument($html); + $xpath = new DOMXPath($document); + + $charset = $xpath->query('.//meta[@charset]')->item(0); + $httpEquiv = $xpath->query('.//meta[@http-equiv]')->item(0); + + if ($charset || $httpEquiv) { + $charset = $charset ? self::stringify($charset) : null; + $httpEquiv = $httpEquiv ? self::stringify($httpEquiv) : null; + + $html = preg_replace( + '/]*>/', + ''.$charset.$httpEquiv, + $html + ); + + return self::createDOMDocument($html); + } + + return $document; + } + + public static function parseFragment(string $html, ?string $encoding = null): DOMDocumentFragment + { + $html = "{$html}"; + $document = static::parse($html, $encoding); + $fragment = $document->createDocumentFragment(); + + $body = $document->getElementsByTagName('body')->item(0); + + $nodes = []; + + foreach ($body->childNodes as $node) { + $nodes[] = $node; + } + + foreach ($nodes as $node) { + $fragment->appendChild($node); + } + + return $fragment; + } + + private static function createDOMDocument(string $code): DOMDocument + { + $errors = libxml_use_internal_errors(true); + + // Enabled by default in PHP 8 + if (PHP_MAJOR_VERSION < 8) { + $entities = libxml_disable_entity_loader(true); + } + + $document = new DOMDocument(); + $document->loadHTML($code); + + libxml_use_internal_errors($errors); + + if (PHP_MAJOR_VERSION < 8) { + libxml_disable_entity_loader($entities); + } + + return $document; + } +} diff --git a/vendor/php-http/cache-plugin/CHANGELOG.md b/vendor/php-http/cache-plugin/CHANGELOG.md new file mode 100644 index 00000000..6f006059 --- /dev/null +++ b/vendor/php-http/cache-plugin/CHANGELOG.md @@ -0,0 +1,117 @@ +# Change Log + +## 1.7.5 - 2022-01-18 + +- Allow installation with psr/cache 3.0 (1.0 and 2.0 are still allowed too) + +## 1.7.4 - 2021-11-30 + +### Added + +- Allow installation with Symfony 6 + +## 1.7.3 - 2021-11-03 + +### Changed + +- Be more defensive about cache hits. A cache entry can technically contain `null`. + +## 1.7.2 - 2021-04-14 + +### Added + +- Allow installation with psr/cache 2.0 (1.0 still allowed too) + +## 1.7.1 - 2020-07-13 + +### Added + +- Support for PHP 8 + +## 1.7.0 - 2019-12-17 + +### Added + +* Support for Symfony 5. +* Support for PSR-17 `StreamFactoryInterface`. +* Added `blacklisted_paths` option, which takes an array of `strings` (regular expressions) and allows to define paths, that shall not be cached in any case. + +## 1.6.0 - 2019-01-23 + +### Added + +* Support for HTTPlug 2 / PSR-18 +* Added `cache_listeners` option, which takes an array of `CacheListener`s, who get notified and can optionally act on a Response based on a cache hit or miss event. An implementation, `AddHeaderCacheListener`, is provided which will add an `X-Cache` header to the response with this information. + +## 1.5.0 - 2017-11-29 + +### Added + +* Support for Symfony 4 + +### Changed + +* Removed check if etag is a string. Etag can never be a string, it is always an array. + +## 1.4.0 - 2017-04-05 + +### Added + +- `CacheKeyGenerator` interface that allow you to configure how the PSR-6 cache key is created. There are two implementations +of this interface: `SimpleGenerator` (default) and `HeaderCacheKeyGenerator`. + +### Fixed + +- Issue where deprecation warning always was triggered. Not it is just triggered if `respect_cache_headers` is used. + +## 1.3.0 - 2017-03-28 + +### Added + +- New `methods` option which allows to configure the request methods which can be cached. +- New `respect_response_cache_directives` option to define specific cache directives to respect when handling responses. +- Introduced `CachePlugin::clientCache` and `CachePlugin::serverCache` factory methods to easily setup the plugin with + the correct config settigns for each usecase. + +### Changed + +- The `no-cache` directive is now respected by the plugin and will not cache the response. If you need the previous behaviour, configure `respect_response_cache_directives`. +- We always rewind the stream after loading response from cache. + +### Deprecated + +- The `respect_cache_headers` option is deprecated and will be removed in 2.0. This option is replaced by the new `respect_response_cache_directives` option. + If you had set `respect_cache_headers` to `false`, set the directives to `[]` to ignore all directives. + + +## 1.2.0 - 2016-08-16 + +### Changed + +- The default value for `default_ttl` is changed from `null` to `0`. + +### Fixed + +- Issue when you use `respect_cache_headers=>false` in combination with `default_ttl=>null`. +- We allow `cache_lifetime` to be set to `null`. + + +## 1.1.0 - 2016-08-04 + +### Added + +- Support for cache validation with ETag and Last-Modified headers. (Enabled automatically when the server sends the relevant headers.) +- `hash_algo` config option used for cache key generation (defaults to **sha1**). + +### Changed + +- Default hash algo used for cache generation (from **md5** to **sha1**). + +### Fixed + +- Cast max age header to integer in order to get valid expiration value. + + +## 1.0.0 - 2016-05-05 + +- Initial release diff --git a/vendor/php-http/cache-plugin/LICENSE b/vendor/php-http/cache-plugin/LICENSE new file mode 100644 index 00000000..4558d6f0 --- /dev/null +++ b/vendor/php-http/cache-plugin/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-2016 PHP HTTP Team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/php-http/cache-plugin/README.md b/vendor/php-http/cache-plugin/README.md new file mode 100644 index 00000000..cef5dab6 --- /dev/null +++ b/vendor/php-http/cache-plugin/README.md @@ -0,0 +1,46 @@ +# Cache Plugin + +[![Latest Version](https://img.shields.io/github/release/php-http/cache-plugin.svg?style=flat-square)](https://github.com/php-http/cache-plugin/releases) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) +[![Build Status](https://github.com/php-http/cache-plugin/actions/workflows/tests.yml/badge.svg)](https://github.com/php-http/cache-plugin/actions/workflows/tests.yml) +[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/cache-plugin.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/cache-plugin) +[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/cache-plugin.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/cache-plugin) +[![Total Downloads](https://img.shields.io/packagist/dt/php-http/cache-plugin.svg?style=flat-square)](https://packagist.org/packages/php-http/cache-plugin) + +**PSR-6 Cache plugin for HTTPlug.** + + +## Install + +Via Composer + +``` bash +$ composer require php-http/cache-plugin +``` + + +## Documentation + +Please see the [official documentation](http://docs.php-http.org/en/latest/plugins/cache.html). + + +## Testing + +``` bash +$ composer test +``` + + +## Contributing + +Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html). + + +## Security + +If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). + + +## License + +The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/cache-plugin/composer.json b/vendor/php-http/cache-plugin/composer.json new file mode 100644 index 00000000..08dc4bf8 --- /dev/null +++ b/vendor/php-http/cache-plugin/composer.json @@ -0,0 +1,42 @@ +{ + "name": "php-http/cache-plugin", + "description": "PSR-6 Cache plugin for HTTPlug", + "license": "MIT", + "keywords": ["cache", "http", "httplug", "plugin"], + "homepage": "http://httplug.io", + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "require": { + "php": "^7.1 || ^8.0", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "php-http/client-common": "^1.9 || ^2.0", + "php-http/message-factory": "^1.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + }, + "require-dev": { + "phpspec/phpspec": "^5.1 || ^6.0" + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\Plugin\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "spec\\Http\\Client\\Common\\Plugin\\": "spec/" + } + }, + "scripts": { + "test": "vendor/bin/phpspec run", + "test-ci": "vendor/bin/phpspec run -c phpspec.ci.yml" + }, + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + } +} diff --git a/vendor/php-http/cache-plugin/phpstan.neon.dist b/vendor/php-http/cache-plugin/phpstan.neon.dist new file mode 100644 index 00000000..ac454e0f --- /dev/null +++ b/vendor/php-http/cache-plugin/phpstan.neon.dist @@ -0,0 +1,5 @@ +parameters: + level: 8 + paths: + - src + treatPhpDocTypesAsCertain: false diff --git a/vendor/php-http/cache-plugin/src/Cache/Generator/CacheKeyGenerator.php b/vendor/php-http/cache-plugin/src/Cache/Generator/CacheKeyGenerator.php new file mode 100644 index 00000000..30102566 --- /dev/null +++ b/vendor/php-http/cache-plugin/src/Cache/Generator/CacheKeyGenerator.php @@ -0,0 +1,20 @@ + + */ +interface CacheKeyGenerator +{ + /** + * Generate a cache key from a Request. + * + * @return string + */ + public function generate(RequestInterface $request); +} diff --git a/vendor/php-http/cache-plugin/src/Cache/Generator/HeaderCacheKeyGenerator.php b/vendor/php-http/cache-plugin/src/Cache/Generator/HeaderCacheKeyGenerator.php new file mode 100644 index 00000000..16587beb --- /dev/null +++ b/vendor/php-http/cache-plugin/src/Cache/Generator/HeaderCacheKeyGenerator.php @@ -0,0 +1,38 @@ + + */ +class HeaderCacheKeyGenerator implements CacheKeyGenerator +{ + /** + * The header names we should take into account when creating the cache key. + * + * @var string[] + */ + private $headerNames; + + /** + * @param string[] $headerNames + */ + public function __construct(array $headerNames) + { + $this->headerNames = $headerNames; + } + + public function generate(RequestInterface $request) + { + $concatenatedHeaders = []; + foreach ($this->headerNames as $headerName) { + $concatenatedHeaders[] = sprintf(' %s:"%s"', $headerName, $request->getHeaderLine($headerName)); + } + + return $request->getMethod().' '.$request->getUri().implode('', $concatenatedHeaders).' '.$request->getBody(); + } +} diff --git a/vendor/php-http/cache-plugin/src/Cache/Generator/SimpleGenerator.php b/vendor/php-http/cache-plugin/src/Cache/Generator/SimpleGenerator.php new file mode 100644 index 00000000..4f0ee903 --- /dev/null +++ b/vendor/php-http/cache-plugin/src/Cache/Generator/SimpleGenerator.php @@ -0,0 +1,23 @@ + + */ +class SimpleGenerator implements CacheKeyGenerator +{ + public function generate(RequestInterface $request) + { + $body = (string) $request->getBody(); + if (!empty($body)) { + $body = ' '.$body; + } + + return $request->getMethod().' '.$request->getUri().$body; + } +} diff --git a/vendor/php-http/cache-plugin/src/Cache/Listener/AddHeaderCacheListener.php b/vendor/php-http/cache-plugin/src/Cache/Listener/AddHeaderCacheListener.php new file mode 100644 index 00000000..282a8a33 --- /dev/null +++ b/vendor/php-http/cache-plugin/src/Cache/Listener/AddHeaderCacheListener.php @@ -0,0 +1,40 @@ + + */ +class AddHeaderCacheListener implements CacheListener +{ + /** @var string */ + private $headerName; + + /** + * @param string $headerName + */ + public function __construct($headerName = 'X-Cache') + { + $this->headerName = $headerName; + } + + /** + * Called before the cache plugin returns the response, with information on whether that response came from cache. + * + * @param bool $fromCache Whether the `$response` was from the cache or not. + * Note that checking `$cacheItem->isHit()` is not sufficent to determine this. + * @param CacheItemInterface|null $cacheItem + * + * @return ResponseInterface + */ + public function onCacheResponse(RequestInterface $request, ResponseInterface $response, $fromCache, $cacheItem) + { + return $response->withHeader($this->headerName, $fromCache ? 'HIT' : 'MISS'); + } +} diff --git a/vendor/php-http/cache-plugin/src/Cache/Listener/CacheListener.php b/vendor/php-http/cache-plugin/src/Cache/Listener/CacheListener.php new file mode 100644 index 00000000..01b953c2 --- /dev/null +++ b/vendor/php-http/cache-plugin/src/Cache/Listener/CacheListener.php @@ -0,0 +1,28 @@ + + */ +interface CacheListener +{ + /** + * Called before the cache plugin returns the response, with information on whether that response came from cache. + * + * @param bool $fromCache Whether the `$response` was from the cache or not. + * Note that checking `$cacheItem->isHit()` is not sufficent to determine this. + * @param CacheItemInterface|null $cacheItem + * + * @return ResponseInterface + */ + public function onCacheResponse(RequestInterface $request, ResponseInterface $response, $fromCache, $cacheItem); +} diff --git a/vendor/php-http/cache-plugin/src/CachePlugin.php b/vendor/php-http/cache-plugin/src/CachePlugin.php new file mode 100644 index 00000000..5318dc81 --- /dev/null +++ b/vendor/php-http/cache-plugin/src/CachePlugin.php @@ -0,0 +1,464 @@ + + */ +final class CachePlugin implements Plugin +{ + use VersionBridgePlugin; + + /** + * @var CacheItemPoolInterface + */ + private $pool; + + /** + * @var StreamFactory|StreamFactoryInterface + */ + private $streamFactory; + + /** + * @var mixed[] + */ + private $config; + + /** + * Cache directives indicating if a response can not be cached. + * + * @var string[] + */ + private $noCacheFlags = ['no-cache', 'private', 'no-store']; + + /** + * @param StreamFactory|StreamFactoryInterface $streamFactory + * @param mixed[] $config + * + * bool respect_cache_headers: Whether to look at the cache directives or ignore them + * int default_ttl: (seconds) If we do not respect cache headers or can't calculate a good ttl, use this value + * string hash_algo: The hashing algorithm to use when generating cache keys + * int cache_lifetime: (seconds) To support serving a previous stale response when the server answers 304 + * we have to store the cache for a longer time than the server originally says it is valid for. + * We store a cache item for $cache_lifetime + max age of the response. + * string[] methods: list of request methods which can be cached + * string[] blacklisted_paths: list of regex for URLs explicitly not to be cached + * string[] respect_response_cache_directives: list of cache directives this plugin will respect while caching responses + * CacheKeyGenerator cache_key_generator: an object to generate the cache key. Defaults to a new instance of SimpleGenerator + * CacheListener[] cache_listeners: an array of objects to act on the response based on the results of the cache check. + * Defaults to an empty array + * } + */ + public function __construct(CacheItemPoolInterface $pool, $streamFactory, array $config = []) + { + if (!($streamFactory instanceof StreamFactory) && !($streamFactory instanceof StreamFactoryInterface)) { + throw new \TypeError(\sprintf('Argument 2 passed to %s::__construct() must be of type %s|%s, %s given.', self::class, StreamFactory::class, StreamFactoryInterface::class, \is_object($streamFactory) ? \get_class($streamFactory) : \gettype($streamFactory))); + } + + $this->pool = $pool; + $this->streamFactory = $streamFactory; + + if (\array_key_exists('respect_cache_headers', $config) && \array_key_exists('respect_response_cache_directives', $config)) { + throw new \InvalidArgumentException('You can\'t provide config option "respect_cache_headers" and "respect_response_cache_directives". Use "respect_response_cache_directives" instead.'); + } + + $optionsResolver = new OptionsResolver(); + $this->configureOptions($optionsResolver); + $this->config = $optionsResolver->resolve($config); + + if (null === $this->config['cache_key_generator']) { + $this->config['cache_key_generator'] = new SimpleGenerator(); + } + } + + /** + * This method will setup the cachePlugin in client cache mode. When using the client cache mode the plugin will + * cache responses with `private` cache directive. + * + * @param StreamFactory|StreamFactoryInterface $streamFactory + * @param mixed[] $config For all possible config options see the constructor docs + * + * @return CachePlugin + */ + public static function clientCache(CacheItemPoolInterface $pool, $streamFactory, array $config = []) + { + // Allow caching of private requests + if (\array_key_exists('respect_response_cache_directives', $config)) { + $config['respect_response_cache_directives'][] = 'no-cache'; + $config['respect_response_cache_directives'][] = 'max-age'; + $config['respect_response_cache_directives'] = array_unique($config['respect_response_cache_directives']); + } else { + $config['respect_response_cache_directives'] = ['no-cache', 'max-age']; + } + + return new self($pool, $streamFactory, $config); + } + + /** + * This method will setup the cachePlugin in server cache mode. This is the default caching behavior it refuses to + * cache responses with the `private`or `no-cache` directives. + * + * @param StreamFactory|StreamFactoryInterface $streamFactory + * @param mixed[] $config For all possible config options see the constructor docs + * + * @return CachePlugin + */ + public static function serverCache(CacheItemPoolInterface $pool, $streamFactory, array $config = []) + { + return new self($pool, $streamFactory, $config); + } + + /** + * {@inheritdoc} + * + * @return Promise Resolves a PSR-7 Response or fails with an Http\Client\Exception (The same as HttpAsyncClient) + */ + protected function doHandleRequest(RequestInterface $request, callable $next, callable $first) + { + $method = strtoupper($request->getMethod()); + // if the request not is cachable, move to $next + if (!in_array($method, $this->config['methods'])) { + return $next($request)->then(function (ResponseInterface $response) use ($request) { + $response = $this->handleCacheListeners($request, $response, false, null); + + return $response; + }); + } + + // If we can cache the request + $key = $this->createCacheKey($request); + $cacheItem = $this->pool->getItem($key); + + if ($cacheItem->isHit()) { + $data = $cacheItem->get(); + if (is_array($data)) { + // The array_key_exists() is to be removed in 2.0. + if (array_key_exists('expiresAt', $data) && (null === $data['expiresAt'] || time() < $data['expiresAt'])) { + // This item is still valid according to previous cache headers + $response = $this->createResponseFromCacheItem($cacheItem); + $response = $this->handleCacheListeners($request, $response, true, $cacheItem); + + return new FulfilledPromise($response); + } + + // Add headers to ask the server if this cache is still valid + if ($modifiedSinceValue = $this->getModifiedSinceHeaderValue($cacheItem)) { + $request = $request->withHeader('If-Modified-Since', $modifiedSinceValue); + } + + if ($etag = $this->getETag($cacheItem)) { + $request = $request->withHeader('If-None-Match', $etag); + } + } + } + + return $next($request)->then(function (ResponseInterface $response) use ($request, $cacheItem) { + if (304 === $response->getStatusCode()) { + if (!$cacheItem->isHit()) { + /* + * We do not have the item in cache. This plugin did not add If-Modified-Since + * or If-None-Match headers. Return the response from server. + */ + return $this->handleCacheListeners($request, $response, false, $cacheItem); + } + + // The cached response we have is still valid + $data = $cacheItem->get(); + $maxAge = $this->getMaxAge($response); + $data['expiresAt'] = $this->calculateResponseExpiresAt($maxAge); + $cacheItem->set($data)->expiresAfter($this->calculateCacheItemExpiresAfter($maxAge)); + $this->pool->save($cacheItem); + + return $this->handleCacheListeners($request, $this->createResponseFromCacheItem($cacheItem), true, $cacheItem); + } + + if ($this->isCacheable($response) && $this->isCacheableRequest($request)) { + $bodyStream = $response->getBody(); + $body = $bodyStream->__toString(); + if ($bodyStream->isSeekable()) { + $bodyStream->rewind(); + } else { + $response = $response->withBody($this->streamFactory->createStream($body)); + } + + $maxAge = $this->getMaxAge($response); + $cacheItem + ->expiresAfter($this->calculateCacheItemExpiresAfter($maxAge)) + ->set([ + 'response' => $response, + 'body' => $body, + 'expiresAt' => $this->calculateResponseExpiresAt($maxAge), + 'createdAt' => time(), + 'etag' => $response->getHeader('ETag'), + ]); + $this->pool->save($cacheItem); + } + + return $this->handleCacheListeners($request, $response, false, $cacheItem); + }); + } + + /** + * Calculate the timestamp when this cache item should be dropped from the cache. The lowest value that can be + * returned is $maxAge. + * + * @return int|null Unix system time passed to the PSR-6 cache + */ + private function calculateCacheItemExpiresAfter(?int $maxAge): ?int + { + if (null === $this->config['cache_lifetime'] && null === $maxAge) { + return null; + } + + return $this->config['cache_lifetime'] + $maxAge; + } + + /** + * Calculate the timestamp when a response expires. After that timestamp, we need to send a + * If-Modified-Since / If-None-Match request to validate the response. + * + * @return int|null Unix system time. A null value means that the response expires when the cache item expires + */ + private function calculateResponseExpiresAt(?int $maxAge): ?int + { + if (null === $maxAge) { + return null; + } + + return time() + $maxAge; + } + + /** + * Verify that we can cache this response. + * + * @return bool + */ + protected function isCacheable(ResponseInterface $response) + { + if (!in_array($response->getStatusCode(), [200, 203, 300, 301, 302, 404, 410])) { + return false; + } + + $nocacheDirectives = array_intersect($this->config['respect_response_cache_directives'], $this->noCacheFlags); + foreach ($nocacheDirectives as $nocacheDirective) { + if ($this->getCacheControlDirective($response, $nocacheDirective)) { + return false; + } + } + + return true; + } + + /** + * Verify that we can cache this request. + */ + private function isCacheableRequest(RequestInterface $request): bool + { + $uri = $request->getUri()->__toString(); + foreach ($this->config['blacklisted_paths'] as $regex) { + if (1 === preg_match($regex, $uri)) { + return false; + } + } + + return true; + } + + /** + * Get the value of a parameter in the cache control header. + * + * @param string $name The field of Cache-Control to fetch + * + * @return bool|string The value of the directive, true if directive without value, false if directive not present + */ + private function getCacheControlDirective(ResponseInterface $response, string $name) + { + $headers = $response->getHeader('Cache-Control'); + foreach ($headers as $header) { + if (preg_match(sprintf('|%s=?([0-9]+)?|i', $name), $header, $matches)) { + // return the value for $name if it exists + if (isset($matches[1])) { + return $matches[1]; + } + + return true; + } + } + + return false; + } + + private function createCacheKey(RequestInterface $request): string + { + $key = $this->config['cache_key_generator']->generate($request); + + return hash($this->config['hash_algo'], $key); + } + + /** + * Get a ttl in seconds. + * + * Returns null if we do not respect cache headers and got no defaultTtl. + */ + private function getMaxAge(ResponseInterface $response): ?int + { + if (!in_array('max-age', $this->config['respect_response_cache_directives'], true)) { + return $this->config['default_ttl']; + } + + // check for max age in the Cache-Control header + $maxAge = $this->getCacheControlDirective($response, 'max-age'); + if (!is_bool($maxAge)) { + $ageHeaders = $response->getHeader('Age'); + foreach ($ageHeaders as $age) { + return ((int) $maxAge) - ((int) $age); + } + + return (int) $maxAge; + } + + // check for ttl in the Expires header + $headers = $response->getHeader('Expires'); + foreach ($headers as $header) { + return (new \DateTime($header))->getTimestamp() - (new \DateTime())->getTimestamp(); + } + + return $this->config['default_ttl']; + } + + /** + * Configure an options resolver. + */ + private function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'cache_lifetime' => 86400 * 30, // 30 days + 'default_ttl' => 0, + //Deprecated as of v1.3, to be removed in v2.0. Use respect_response_cache_directives instead + 'respect_cache_headers' => null, + 'hash_algo' => 'sha1', + 'methods' => ['GET', 'HEAD'], + 'respect_response_cache_directives' => ['no-cache', 'private', 'max-age', 'no-store'], + 'cache_key_generator' => null, + 'cache_listeners' => [], + 'blacklisted_paths' => [], + ]); + + $resolver->setAllowedTypes('cache_lifetime', ['int', 'null']); + $resolver->setAllowedTypes('default_ttl', ['int', 'null']); + $resolver->setAllowedTypes('respect_cache_headers', ['bool', 'null']); + $resolver->setAllowedTypes('methods', 'array'); + $resolver->setAllowedTypes('cache_key_generator', ['null', 'Http\Client\Common\Plugin\Cache\Generator\CacheKeyGenerator']); + $resolver->setAllowedTypes('blacklisted_paths', 'array'); + $resolver->setAllowedValues('hash_algo', hash_algos()); + $resolver->setAllowedValues('methods', function ($value) { + /* RFC7230 sections 3.1.1 and 3.2.6 except limited to uppercase characters. */ + $matches = preg_grep('/[^A-Z0-9!#$%&\'*+\-.^_`|~]/', $value); + + return empty($matches); + }); + $resolver->setAllowedTypes('cache_listeners', ['array']); + + $resolver->setNormalizer('respect_cache_headers', function (Options $options, $value) { + if (null !== $value) { + @trigger_error('The option "respect_cache_headers" is deprecated since version 1.3 and will be removed in 2.0. Use "respect_response_cache_directives" instead.', E_USER_DEPRECATED); + } + + return null === $value ? true : $value; + }); + + $resolver->setNormalizer('respect_response_cache_directives', function (Options $options, $value) { + if (false === $options['respect_cache_headers']) { + return []; + } + + return $value; + }); + } + + private function createResponseFromCacheItem(CacheItemInterface $cacheItem): ResponseInterface + { + $data = $cacheItem->get(); + + /** @var ResponseInterface $response */ + $response = $data['response']; + $stream = $this->streamFactory->createStream($data['body']); + + try { + $stream->rewind(); + } catch (\Exception $e) { + throw new RewindStreamException('Cannot rewind stream.', 0, $e); + } + + return $response->withBody($stream); + } + + /** + * Get the value for the "If-Modified-Since" header. + */ + private function getModifiedSinceHeaderValue(CacheItemInterface $cacheItem): ?string + { + $data = $cacheItem->get(); + // The isset() is to be removed in 2.0. + if (!isset($data['createdAt'])) { + return null; + } + + $modified = new \DateTime('@'.$data['createdAt']); + $modified->setTimezone(new \DateTimeZone('GMT')); + + return sprintf('%s GMT', $modified->format('l, d-M-y H:i:s')); + } + + /** + * Get the ETag from the cached response. + */ + private function getETag(CacheItemInterface $cacheItem): ?string + { + $data = $cacheItem->get(); + // The isset() is to be removed in 2.0. + if (!isset($data['etag'])) { + return null; + } + + foreach ($data['etag'] as $etag) { + if (!empty($etag)) { + return $etag; + } + } + + return null; + } + + /** + * Call the registered cache listeners. + */ + private function handleCacheListeners(RequestInterface $request, ResponseInterface $response, bool $cacheHit, ?CacheItemInterface $cacheItem): ResponseInterface + { + foreach ($this->config['cache_listeners'] as $cacheListener) { + $response = $cacheListener->onCacheResponse($request, $response, $cacheHit, $cacheItem); + } + + return $response; + } +} diff --git a/vendor/php-http/cache-plugin/src/Exception/RewindStreamException.php b/vendor/php-http/cache-plugin/src/Exception/RewindStreamException.php new file mode 100644 index 00000000..1b9eaee3 --- /dev/null +++ b/vendor/php-http/cache-plugin/src/Exception/RewindStreamException.php @@ -0,0 +1,12 @@ + + */ +class RewindStreamException extends \RuntimeException implements Exception +{ +} diff --git a/vendor/php-http/client-common/.php_cs.dist b/vendor/php-http/client-common/.php_cs.dist new file mode 100644 index 00000000..24e9bb9e --- /dev/null +++ b/vendor/php-http/client-common/.php_cs.dist @@ -0,0 +1,24 @@ +in('src') + ->in('spec') +; +return PhpCsFixer\Config::create() + ->setRules([ + '@PSR2' => true, + '@Symfony' => true, + 'array_syntax' => [ + 'syntax' => 'short', + ], + 'no_empty_phpdoc' => true, + 'phpdoc_to_comment' => false, + 'single_line_throw' => false, + ]) + ->setFinder($finder); diff --git a/vendor/php-http/client-common/CHANGELOG.md b/vendor/php-http/client-common/CHANGELOG.md new file mode 100644 index 00000000..9b031deb --- /dev/null +++ b/vendor/php-http/client-common/CHANGELOG.md @@ -0,0 +1,276 @@ +# Change Log + +## 2.5.0 - 2021-11-26 + +### Added + +- Support for Symfony 6 +- Support for PHP 8.1 + +### Changed + +- Dropped support for Symfony 2 and 3 - please keep using version 2.4.0 of this library if you can't update Symfony. + +## 2.4.0 - 2021-07-05 + +### Added + +- `strict` option to `RedirectPlugin` to allow preserving the request method on redirections with status 300, 301 and 302. + +## 2.3.0 - 2020-07-21 + +### Fixed + +- HttpMethodsClient with PSR RequestFactory +- Bug in the cookie plugin with empty cookies +- Bug when parsing null-valued date headers + +### Changed + +- Deprecation when constructing a HttpMethodsClient with PSR RequestFactory but without a StreamFactory + +## 2.2.1 - 2020-07-13 + +### Fixed + +- Support for PHP 8 +- Plugin callable phpdoc + +## 2.2.0 - 2020-07-02 + +### Added + +- Plugin client builder for making a `PluginClient` +- Support for the PSR-17 request factory in `HttpMethodsClient` + +### Changed + +- Restored support for `symfony/options-resolver: ^2.6` +- Consistent implementation of union type checking + +### Fixed + +- Memory leak when using the `PluginClient` with plugins + +## 2.1.0 - 2019-11-18 + +### Added + +- Support Symfony 5 + +## 2.0.0 - 2019-02-03 + +### Changed + +- HttpClientRouter now throws a HttpClientNoMatchException instead of a RequestException if it can not find a client for the request. +- RetryPlugin will only retry exceptions when there is no response, or a response in the 5xx HTTP code range. +- RetryPlugin also retries when no exception is thrown if the responses has HTTP code in the 5xx range. + The callbacks for exception handling have been renamed and callbacks for response handling have been added. +- Abstract method `HttpClientPool::chooseHttpClient()` has now an explicit return type (`Http\Client\Common\HttpClientPoolItem`) +- Interface method `Plugin::handleRequest(...)` has now an explicit return type (`Http\Promise\Promise`) +- Made classes final that are not intended to be extended. +- Added interfaces for BatchClient, HttpClientRouter and HttpMethodsClient. + (These interfaces use the `Interface` suffix to avoid name collisions.) +- Added an interface for HttpClientPool and moved the abstract class to the HttpClientPool sub namespace. +- AddPathPlugin: Do not add the prefix if the URL already has the same prefix. +- All exceptions in `Http\Client\Common\Exception` are final. + +### Removed + +- Deprecated option `debug_plugins` has been removed from `PluginClient` +- Deprecated options `decider` and `delay` have been removed from `RetryPlugin`, use `exception_decider` and `exception_delay` instead. + +## 1.11.0 - 2021-07-11 + +### Changed + +- Backported from version 2: AddPathPlugin: Do not add the prefix if the URL already has the same prefix. + +## 1.10.0 - 2019-11-18 + +### Added + +- Support for Symfony 5 + +## 1.9.1 - 2019-02-02 + +### Added + +- Updated type hints in doc blocks. + +## 1.9.0 - 2019-01-03 + +### Added + +- Support for PSR-18 clients +- Added traits `VersionBridgePlugin` and `VersionBridgeClient` to help plugins and clients to support both + 1.x and 2.x version of `php-http/client-common` and `php-http/httplug`. + +### Changed + +- RetryPlugin: Renamed the configuration options for the exception retry callback from `decider` to `exception_decider` + and `delay` to `exception_delay`. The old names still work but are deprecated. + +## 1.8.2 - 2018-12-14 + +### Changed + +- When multiple cookies exist, a single header with all cookies is sent as per RFC 6265 Section 5.4 +- AddPathPlugin will now trim of ending slashes in paths + +## 1.8.1 - 2018-10-09 + +### Fixed + +- Reverted change to RetryPlugin so it again waits when retrying to avoid "can only throw objects" error. + +## 1.8.0 - 2018-09-21 + +### Added + + - Add an option on ErrorPlugin to only throw exception on response with 5XX status code. + +### Changed + +- AddPathPlugin no longer add prefix multiple times if a request is restarted - it now only adds the prefix if that request chain has not yet passed through the AddPathPlugin +- RetryPlugin no longer wait for retried requests and use a deferred promise instead + +### Fixed + +- Decoder plugin will now remove header when there is no more encoding, instead of setting to an empty array + +## 1.7.0 - 2017-11-30 + +### Added + +- Symfony 4 support + +### Changed + +- Strict comparison in DecoderPlugin + +## 1.6.0 - 2017-10-16 + +### Added + +- Add HttpClientPool client to leverage load balancing and fallback mechanism [see the documentation](http://docs.php-http.org/en/latest/components/client-common.html) for more details. +- `PluginClientFactory` to create `PluginClient` instances. +- Added new option 'delay' for `RetryPlugin`. +- Added new option 'decider' for `RetryPlugin`. +- Supports more cookie date formats in the Cookie Plugin + +### Changed + +- The `RetryPlugin` does now wait between retries. To disable/change this feature you must write something like: + +```php +$plugin = new RetryPlugin(['delay' => function(RequestInterface $request, Exception $e, $retries) { + return 0; +}); +``` + +### Deprecated + +- The `debug_plugins` option for `PluginClient` is deprecated and will be removed in 2.0. Use the decorator design pattern instead like in [ProfilePlugin](https://github.com/php-http/HttplugBundle/blob/de33f9c14252f22093a5ec7d84f17535ab31a384/Collector/ProfilePlugin.php). + +## 1.5.0 - 2017-03-30 + +### Added + +- `QueryDefaultsPlugin` to add default query parameters. + +## 1.4.2 - 2017-03-18 + +### Deprecated + +- `DecoderPlugin` does not longer claim to support `compress` content encoding + +### Fixed + +- `CookiePlugin` allows main domain cookies to be sent/stored for subdomains +- `DecoderPlugin` uses the right `FilteredStream` to handle `deflate` content encoding + + +## 1.4.1 - 2017-02-20 + +### Fixed + +- Cast return value of `StreamInterface::getSize` to string in `ContentLengthPlugin` + + +## 1.4.0 - 2016-11-04 + +### Added + +- Add Path plugin +- Base URI plugin that combines Add Host and Add Path plugins + + +## 1.3.0 - 2016-10-16 + +### Changed + +- Fix Emulated Trait to use Http based promise which respect the HttpAsyncClient interface +- Require Httplug 1.1 where we use HTTP specific promises. +- RedirectPlugin: use the full URL instead of the URI to properly keep track of redirects +- Add AddPathPlugin for API URLs with base path +- Add BaseUriPlugin that combines AddHostPlugin and AddPathPlugin + + +## 1.2.1 - 2016-07-26 + +### Changed + +- AddHostPlugin also sets the port if specified + + +## 1.2.0 - 2016-07-14 + +### Added + +- Suggest separate plugins in composer.json +- Introduced `debug_plugins` option for `PluginClient` + + +## 1.1.0 - 2016-05-04 + +### Added + +- Add a flexible http client providing both contract, and only emulating what's necessary +- HTTP Client Router: route requests to underlying clients +- Plugin client and core plugins moved here from `php-http/plugins` + +### Deprecated + +- Extending client classes, they will be made final in version 2.0 + + +## 1.0.0 - 2016-01-27 + +### Changed + +- Remove useless interface in BatchException + + +## 0.2.0 - 2016-01-12 + +### Changed + +- Updated package files +- Updated HTTPlug to RC1 + + +## 0.1.1 - 2015-12-26 + +### Added + +- Emulated clients + + +## 0.1.0 - 2015-12-25 + +### Added + +- Batch client from utils +- Methods client from utils +- Emulators and decorators from client-tools diff --git a/vendor/php-http/client-common/LICENSE b/vendor/php-http/client-common/LICENSE new file mode 100644 index 00000000..4558d6f0 --- /dev/null +++ b/vendor/php-http/client-common/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-2016 PHP HTTP Team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/php-http/client-common/README.md b/vendor/php-http/client-common/README.md new file mode 100644 index 00000000..7d136587 --- /dev/null +++ b/vendor/php-http/client-common/README.md @@ -0,0 +1,55 @@ +# HTTP Client Common + +[![Latest Version](https://img.shields.io/github/release/php-http/client-common.svg?style=flat-square)](https://github.com/php-http/client-common/releases) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) +[![Build Status](https://img.shields.io/travis/php-http/client-common/master.svg?style=flat-square)](https://travis-ci.org/php-http/client-common) +[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/client-common.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/client-common) +[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/client-common.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/client-common) +[![Total Downloads](https://img.shields.io/packagist/dt/php-http/client-common.svg?style=flat-square)](https://packagist.org/packages/php-http/client-common) + +**Common HTTP Client implementations and tools for HTTPlug.** + + +## Install + +Via Composer + +``` bash +$ composer require php-http/client-common +``` + + +## Usage + +This package provides common tools for HTTP Clients: + +- BatchClient to handle sending requests in parallel +- A convenience client with HTTP method names as class methods +- Emulator, decorator layers for sync/async clients + + +## Documentation + +Please see the [official documentation](http://docs.php-http.org/en/latest/components/client-common.html). + + +## Testing + +``` bash +$ composer test +``` + + +## Contributing + +Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html). + + +## Security + +If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). + + +## License + +The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/client-common/composer.json b/vendor/php-http/client-common/composer.json new file mode 100644 index 00000000..2ea45aa6 --- /dev/null +++ b/vendor/php-http/client-common/composer.json @@ -0,0 +1,67 @@ +{ + "name": "php-http/client-common", + "description": "Common HTTP Client implementations and tools for HTTPlug", + "license": "MIT", + "keywords": ["http", "client", "httplug", "common"], + "homepage": "http://httplug.io", + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "require": { + "php": "^7.1 || ^8.0", + "php-http/httplug": "^2.0", + "php-http/message": "^1.6", + "php-http/message-factory": "^1.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0", + "symfony/polyfill-php80": "^1.17" + }, + "require-dev": { + "doctrine/instantiator": "^1.1", + "guzzlehttp/psr7": "^1.4", + "nyholm/psr7": "^1.2", + "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", + "phpspec/prophecy": "^1.10.2", + "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" + }, + "suggest": { + "ext-json": "To detect JSON responses with the ContentTypePlugin", + "ext-libxml": "To detect XML responses with the ContentTypePlugin", + "php-http/logger-plugin": "PSR-3 Logger plugin", + "php-http/cache-plugin": "PSR-6 Cache plugin", + "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "spec\\Http\\Client\\Common\\": "spec/" + } + }, + "scripts": { + "test": [ + "vendor/bin/phpspec run", + "vendor/bin/phpunit" + ], + "test-ci": [ + "vendor/bin/phpspec run -c phpspec.ci.yml", + "vendor/bin/phpunit" + ] + }, + "config": { + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + } +} diff --git a/vendor/php-http/client-common/src/BatchClient.php b/vendor/php-http/client-common/src/BatchClient.php new file mode 100644 index 00000000..51f13ff6 --- /dev/null +++ b/vendor/php-http/client-common/src/BatchClient.php @@ -0,0 +1,42 @@ +client = $client; + } + + public function sendRequests(array $requests): BatchResult + { + $batchResult = new BatchResult(); + + foreach ($requests as $request) { + try { + $response = $this->client->sendRequest($request); + $batchResult = $batchResult->addResponse($request, $response); + } catch (ClientExceptionInterface $e) { + $batchResult = $batchResult->addException($request, $e); + } + } + + if ($batchResult->hasExceptions()) { + throw new BatchException($batchResult); + } + + return $batchResult; + } +} diff --git a/vendor/php-http/client-common/src/BatchClientInterface.php b/vendor/php-http/client-common/src/BatchClientInterface.php new file mode 100644 index 00000000..d42eb2d4 --- /dev/null +++ b/vendor/php-http/client-common/src/BatchClientInterface.php @@ -0,0 +1,34 @@ + + */ +interface BatchClientInterface +{ + /** + * Send several requests. + * + * You may not assume that the requests are executed in a particular order. If the order matters + * for your application, use sendRequest sequentially. + * + * @param RequestInterface[] $requests The requests to send + * + * @return BatchResult Containing one result per request + * + * @throws BatchException If one or more requests fails. The exception gives access to the + * BatchResult with a map of request to result for success, request to + * exception for failures + */ + public function sendRequests(array $requests): BatchResult; +} diff --git a/vendor/php-http/client-common/src/BatchResult.php b/vendor/php-http/client-common/src/BatchResult.php new file mode 100644 index 00000000..ccaf83cb --- /dev/null +++ b/vendor/php-http/client-common/src/BatchResult.php @@ -0,0 +1,157 @@ + + */ +final class BatchResult +{ + /** + * @var \SplObjectStorage + */ + private $responses; + + /** + * @var \SplObjectStorage + */ + private $exceptions; + + public function __construct() + { + $this->responses = new \SplObjectStorage(); + $this->exceptions = new \SplObjectStorage(); + } + + /** + * Checks if there are any successful responses at all. + */ + public function hasResponses(): bool + { + return $this->responses->count() > 0; + } + + /** + * Returns all successful responses. + * + * @return ResponseInterface[] + */ + public function getResponses(): array + { + $responses = []; + + foreach ($this->responses as $request) { + $responses[] = $this->responses[$request]; + } + + return $responses; + } + + /** + * Checks if there is a successful response for a request. + */ + public function isSuccessful(RequestInterface $request): bool + { + return $this->responses->contains($request); + } + + /** + * Returns the response for a successful request. + * + * @throws \UnexpectedValueException If request was not part of the batch or failed + */ + public function getResponseFor(RequestInterface $request): ResponseInterface + { + try { + return $this->responses[$request]; + } catch (\UnexpectedValueException $e) { + throw new \UnexpectedValueException('Request not found', $e->getCode(), $e); + } + } + + /** + * Adds a response in an immutable way. + * + * @return BatchResult the new BatchResult with this request-response pair added to it + */ + public function addResponse(RequestInterface $request, ResponseInterface $response): self + { + $new = clone $this; + $new->responses->attach($request, $response); + + return $new; + } + + /** + * Checks if there are any unsuccessful requests at all. + */ + public function hasExceptions(): bool + { + return $this->exceptions->count() > 0; + } + + /** + * Returns all exceptions for the unsuccessful requests. + * + * @return ClientExceptionInterface[] + */ + public function getExceptions(): array + { + $exceptions = []; + + foreach ($this->exceptions as $request) { + $exceptions[] = $this->exceptions[$request]; + } + + return $exceptions; + } + + /** + * Checks if there is an exception for a request, meaning the request failed. + */ + public function isFailed(RequestInterface $request): bool + { + return $this->exceptions->contains($request); + } + + /** + * Returns the exception for a failed request. + * + * @throws \UnexpectedValueException If request was not part of the batch or was successful + */ + public function getExceptionFor(RequestInterface $request): ClientExceptionInterface + { + try { + return $this->exceptions[$request]; + } catch (\UnexpectedValueException $e) { + throw new \UnexpectedValueException('Request not found', $e->getCode(), $e); + } + } + + /** + * Adds an exception in an immutable way. + * + * @return BatchResult the new BatchResult with this request-exception pair added to it + */ + public function addException(RequestInterface $request, ClientExceptionInterface $exception): self + { + $new = clone $this; + $new->exceptions->attach($request, $exception); + + return $new; + } + + public function __clone() + { + $this->responses = clone $this->responses; + $this->exceptions = clone $this->exceptions; + } +} diff --git a/vendor/php-http/client-common/src/Deferred.php b/vendor/php-http/client-common/src/Deferred.php new file mode 100644 index 00000000..ef2b3098 --- /dev/null +++ b/vendor/php-http/client-common/src/Deferred.php @@ -0,0 +1,152 @@ +waitCallback = $waitCallback; + $this->state = Promise::PENDING; + $this->onFulfilledCallbacks = []; + $this->onRejectedCallbacks = []; + } + + /** + * {@inheritdoc} + */ + public function then(callable $onFulfilled = null, callable $onRejected = null): Promise + { + $deferred = new self($this->waitCallback); + + $this->onFulfilledCallbacks[] = function (ResponseInterface $response) use ($onFulfilled, $deferred) { + try { + if (null !== $onFulfilled) { + $response = $onFulfilled($response); + } + $deferred->resolve($response); + } catch (ClientExceptionInterface $exception) { + $deferred->reject($exception); + } + }; + + $this->onRejectedCallbacks[] = function (ClientExceptionInterface $exception) use ($onRejected, $deferred) { + try { + if (null !== $onRejected) { + $response = $onRejected($exception); + $deferred->resolve($response); + + return; + } + $deferred->reject($exception); + } catch (ClientExceptionInterface $newException) { + $deferred->reject($newException); + } + }; + + return $deferred; + } + + /** + * {@inheritdoc} + */ + public function getState(): string + { + return $this->state; + } + + /** + * Resolve this deferred with a Response. + */ + public function resolve(ResponseInterface $response): void + { + if (Promise::PENDING !== $this->state) { + return; + } + + $this->value = $response; + $this->state = Promise::FULFILLED; + + foreach ($this->onFulfilledCallbacks as $onFulfilledCallback) { + $onFulfilledCallback($response); + } + } + + /** + * Reject this deferred with an Exception. + */ + public function reject(ClientExceptionInterface $exception): void + { + if (Promise::PENDING !== $this->state) { + return; + } + + $this->failure = $exception; + $this->state = Promise::REJECTED; + + foreach ($this->onRejectedCallbacks as $onRejectedCallback) { + $onRejectedCallback($exception); + } + } + + /** + * {@inheritdoc} + */ + public function wait($unwrap = true) + { + if (Promise::PENDING === $this->state) { + $callback = $this->waitCallback; + $callback(); + } + + if (!$unwrap) { + return null; + } + + if (Promise::FULFILLED === $this->state) { + return $this->value; + } + + /** @var ClientExceptionInterface */ + throw $this->failure; + } +} diff --git a/vendor/php-http/client-common/src/EmulatedHttpAsyncClient.php b/vendor/php-http/client-common/src/EmulatedHttpAsyncClient.php new file mode 100644 index 00000000..008f8880 --- /dev/null +++ b/vendor/php-http/client-common/src/EmulatedHttpAsyncClient.php @@ -0,0 +1,25 @@ + + */ +final class EmulatedHttpAsyncClient implements HttpClient, HttpAsyncClient +{ + use HttpAsyncClientEmulator; + use HttpClientDecorator; + + public function __construct(ClientInterface $httpClient) + { + $this->httpClient = $httpClient; + } +} diff --git a/vendor/php-http/client-common/src/EmulatedHttpClient.php b/vendor/php-http/client-common/src/EmulatedHttpClient.php new file mode 100644 index 00000000..5c2d8c48 --- /dev/null +++ b/vendor/php-http/client-common/src/EmulatedHttpClient.php @@ -0,0 +1,24 @@ + + */ +final class EmulatedHttpClient implements HttpClient, HttpAsyncClient +{ + use HttpAsyncClientDecorator; + use HttpClientEmulator; + + public function __construct(HttpAsyncClient $httpAsyncClient) + { + $this->httpAsyncClient = $httpAsyncClient; + } +} diff --git a/vendor/php-http/client-common/src/Exception/BatchException.php b/vendor/php-http/client-common/src/Exception/BatchException.php new file mode 100644 index 00000000..a9cb08c8 --- /dev/null +++ b/vendor/php-http/client-common/src/Exception/BatchException.php @@ -0,0 +1,37 @@ + + */ +final class BatchException extends TransferException +{ + /** + * @var BatchResult + */ + private $result; + + public function __construct(BatchResult $result) + { + $this->result = $result; + parent::__construct(); + } + + /** + * Returns the BatchResult that contains all responses and exceptions. + */ + public function getResult(): BatchResult + { + return $this->result; + } +} diff --git a/vendor/php-http/client-common/src/Exception/CircularRedirectionException.php b/vendor/php-http/client-common/src/Exception/CircularRedirectionException.php new file mode 100644 index 00000000..9db927c2 --- /dev/null +++ b/vendor/php-http/client-common/src/Exception/CircularRedirectionException.php @@ -0,0 +1,16 @@ + + */ +final class CircularRedirectionException extends HttpException +{ +} diff --git a/vendor/php-http/client-common/src/Exception/ClientErrorException.php b/vendor/php-http/client-common/src/Exception/ClientErrorException.php new file mode 100644 index 00000000..c657a3f8 --- /dev/null +++ b/vendor/php-http/client-common/src/Exception/ClientErrorException.php @@ -0,0 +1,16 @@ + + */ +final class ClientErrorException extends HttpException +{ +} diff --git a/vendor/php-http/client-common/src/Exception/HttpClientNoMatchException.php b/vendor/php-http/client-common/src/Exception/HttpClientNoMatchException.php new file mode 100644 index 00000000..682c5dd0 --- /dev/null +++ b/vendor/php-http/client-common/src/Exception/HttpClientNoMatchException.php @@ -0,0 +1,33 @@ + + */ +final class HttpClientNoMatchException extends TransferException +{ + /** + * @var RequestInterface + */ + private $request; + + public function __construct(string $message, RequestInterface $request, \Exception $previous = null) + { + $this->request = $request; + + parent::__construct($message, 0, $previous); + } + + public function getRequest(): RequestInterface + { + return $this->request; + } +} diff --git a/vendor/php-http/client-common/src/Exception/HttpClientNotFoundException.php b/vendor/php-http/client-common/src/Exception/HttpClientNotFoundException.php new file mode 100644 index 00000000..509daa53 --- /dev/null +++ b/vendor/php-http/client-common/src/Exception/HttpClientNotFoundException.php @@ -0,0 +1,16 @@ + + */ +final class HttpClientNotFoundException extends TransferException +{ +} diff --git a/vendor/php-http/client-common/src/Exception/LoopException.php b/vendor/php-http/client-common/src/Exception/LoopException.php new file mode 100644 index 00000000..f4e173f3 --- /dev/null +++ b/vendor/php-http/client-common/src/Exception/LoopException.php @@ -0,0 +1,16 @@ + + */ +final class LoopException extends RequestException +{ +} diff --git a/vendor/php-http/client-common/src/Exception/MultipleRedirectionException.php b/vendor/php-http/client-common/src/Exception/MultipleRedirectionException.php new file mode 100644 index 00000000..bf6c9f73 --- /dev/null +++ b/vendor/php-http/client-common/src/Exception/MultipleRedirectionException.php @@ -0,0 +1,16 @@ + + */ +final class MultipleRedirectionException extends HttpException +{ +} diff --git a/vendor/php-http/client-common/src/Exception/ServerErrorException.php b/vendor/php-http/client-common/src/Exception/ServerErrorException.php new file mode 100644 index 00000000..774b97f0 --- /dev/null +++ b/vendor/php-http/client-common/src/Exception/ServerErrorException.php @@ -0,0 +1,16 @@ + + */ +final class ServerErrorException extends HttpException +{ +} diff --git a/vendor/php-http/client-common/src/FlexibleHttpClient.php b/vendor/php-http/client-common/src/FlexibleHttpClient.php new file mode 100644 index 00000000..c1e327fd --- /dev/null +++ b/vendor/php-http/client-common/src/FlexibleHttpClient.php @@ -0,0 +1,36 @@ + + */ +final class FlexibleHttpClient implements HttpClient, HttpAsyncClient +{ + use HttpClientDecorator; + use HttpAsyncClientDecorator; + + /** + * @param ClientInterface|HttpAsyncClient $client + */ + public function __construct($client) + { + if (!$client instanceof ClientInterface && !$client instanceof HttpAsyncClient) { + throw new \TypeError( + sprintf('%s::__construct(): Argument #1 ($client) must be of type %s|%s, %s given', self::class, ClientInterface::class, HttpAsyncClient::class, get_debug_type($client)) + ); + } + + $this->httpClient = $client instanceof ClientInterface ? $client : new EmulatedHttpClient($client); + $this->httpAsyncClient = $client instanceof HttpAsyncClient ? $client : new EmulatedHttpAsyncClient($client); + } +} diff --git a/vendor/php-http/client-common/src/HttpAsyncClientDecorator.php b/vendor/php-http/client-common/src/HttpAsyncClientDecorator.php new file mode 100644 index 00000000..2714b4ac --- /dev/null +++ b/vendor/php-http/client-common/src/HttpAsyncClientDecorator.php @@ -0,0 +1,31 @@ + + */ +trait HttpAsyncClientDecorator +{ + /** + * @var HttpAsyncClient + */ + protected $httpAsyncClient; + + /** + * {@inheritdoc} + * + * @see HttpAsyncClient::sendAsyncRequest + */ + public function sendAsyncRequest(RequestInterface $request) + { + return $this->httpAsyncClient->sendAsyncRequest($request); + } +} diff --git a/vendor/php-http/client-common/src/HttpAsyncClientEmulator.php b/vendor/php-http/client-common/src/HttpAsyncClientEmulator.php new file mode 100644 index 00000000..53c2535f --- /dev/null +++ b/vendor/php-http/client-common/src/HttpAsyncClientEmulator.php @@ -0,0 +1,39 @@ + + */ +trait HttpAsyncClientEmulator +{ + /** + * {@inheritdoc} + * + * @see HttpClient::sendRequest + */ + abstract public function sendRequest(RequestInterface $request): ResponseInterface; + + /** + * {@inheritdoc} + * + * @see HttpAsyncClient::sendAsyncRequest + */ + public function sendAsyncRequest(RequestInterface $request) + { + try { + return new Promise\HttpFulfilledPromise($this->sendRequest($request)); + } catch (Exception $e) { + return new Promise\HttpRejectedPromise($e); + } + } +} diff --git a/vendor/php-http/client-common/src/HttpClientDecorator.php b/vendor/php-http/client-common/src/HttpClientDecorator.php new file mode 100644 index 00000000..c00ba6f3 --- /dev/null +++ b/vendor/php-http/client-common/src/HttpClientDecorator.php @@ -0,0 +1,32 @@ + + */ +trait HttpClientDecorator +{ + /** + * @var ClientInterface + */ + protected $httpClient; + + /** + * {@inheritdoc} + * + * @see ClientInterface::sendRequest + */ + public function sendRequest(RequestInterface $request): ResponseInterface + { + return $this->httpClient->sendRequest($request); + } +} diff --git a/vendor/php-http/client-common/src/HttpClientEmulator.php b/vendor/php-http/client-common/src/HttpClientEmulator.php new file mode 100644 index 00000000..51e2c058 --- /dev/null +++ b/vendor/php-http/client-common/src/HttpClientEmulator.php @@ -0,0 +1,35 @@ + + */ +trait HttpClientEmulator +{ + /** + * {@inheritdoc} + * + * @see HttpClient::sendRequest + */ + public function sendRequest(RequestInterface $request): ResponseInterface + { + $promise = $this->sendAsyncRequest($request); + + return $promise->wait(); + } + + /** + * {@inheritdoc} + * + * @see HttpAsyncClient::sendAsyncRequest + */ + abstract public function sendAsyncRequest(RequestInterface $request); +} diff --git a/vendor/php-http/client-common/src/HttpClientPool.php b/vendor/php-http/client-common/src/HttpClientPool.php new file mode 100644 index 00000000..24ab4211 --- /dev/null +++ b/vendor/php-http/client-common/src/HttpClientPool.php @@ -0,0 +1,24 @@ +clientPool[] = $client; + } + + /** + * Return an http client given a specific strategy. + * + * @throws HttpClientNotFoundException When no http client has been found into the pool + * + * @return HttpClientPoolItem Return a http client that can do both sync or async + */ + abstract protected function chooseHttpClient(): HttpClientPoolItem; + + /** + * {@inheritdoc} + */ + public function sendAsyncRequest(RequestInterface $request) + { + return $this->chooseHttpClient()->sendAsyncRequest($request); + } + + /** + * {@inheritdoc} + */ + public function sendRequest(RequestInterface $request): ResponseInterface + { + return $this->chooseHttpClient()->sendRequest($request); + } +} diff --git a/vendor/php-http/client-common/src/HttpClientPool/HttpClientPoolItem.php b/vendor/php-http/client-common/src/HttpClientPool/HttpClientPoolItem.php new file mode 100644 index 00000000..f29d0655 --- /dev/null +++ b/vendor/php-http/client-common/src/HttpClientPool/HttpClientPoolItem.php @@ -0,0 +1,181 @@ + + */ +class HttpClientPoolItem implements HttpClient, HttpAsyncClient +{ + /** + * @var int Number of request this client is currently sending + */ + private $sendingRequestCount = 0; + + /** + * @var \DateTime|null Time when this client has been disabled or null if enable + */ + private $disabledAt; + + /** + * Number of seconds until this client is enabled again after an error. + * + * null: never reenable this client. + * + * @var int|null + */ + private $reenableAfter; + + /** + * @var FlexibleHttpClient A http client responding to async and sync request + */ + private $client; + + /** + * @param ClientInterface|HttpAsyncClient $client + * @param int|null $reenableAfter Number of seconds until this client is enabled again after an error + */ + public function __construct($client, int $reenableAfter = null) + { + if (!$client instanceof ClientInterface && !$client instanceof HttpAsyncClient) { + throw new \TypeError( + sprintf('%s::__construct(): Argument #1 ($client) must be of type %s|%s, %s given', self::class, ClientInterface::class, HttpAsyncClient::class, get_debug_type($client)) + ); + } + + $this->client = new FlexibleHttpClient($client); + $this->reenableAfter = $reenableAfter; + } + + /** + * {@inheritdoc} + */ + public function sendRequest(RequestInterface $request): ResponseInterface + { + if ($this->isDisabled()) { + throw new Exception\RequestException('Cannot send the request as this client has been disabled', $request); + } + + try { + $this->incrementRequestCount(); + $response = $this->client->sendRequest($request); + $this->decrementRequestCount(); + } catch (Exception $e) { + $this->disable(); + $this->decrementRequestCount(); + + throw $e; + } + + return $response; + } + + /** + * {@inheritdoc} + */ + public function sendAsyncRequest(RequestInterface $request) + { + if ($this->isDisabled()) { + throw new Exception\RequestException('Cannot send the request as this client has been disabled', $request); + } + + $this->incrementRequestCount(); + + return $this->client->sendAsyncRequest($request)->then(function ($response) { + $this->decrementRequestCount(); + + return $response; + }, function ($exception) { + $this->disable(); + $this->decrementRequestCount(); + + throw $exception; + }); + } + + /** + * Whether this client is disabled or not. + * + * If the client was disabled, calling this method checks if the client can + * be reenabled and if so enables it. + */ + public function isDisabled(): bool + { + if (null !== $this->reenableAfter && null !== $this->disabledAt) { + // Reenable after a certain time + $now = new \DateTime(); + + if (($now->getTimestamp() - $this->disabledAt->getTimestamp()) >= $this->reenableAfter) { + $this->enable(); + + return false; + } + + return true; + } + + return null !== $this->disabledAt; + } + + /** + * Get current number of request that are currently being sent by the underlying HTTP client. + */ + public function getSendingRequestCount(): int + { + return $this->sendingRequestCount; + } + + /** + * Increment the request count. + */ + private function incrementRequestCount(): void + { + ++$this->sendingRequestCount; + } + + /** + * Decrement the request count. + */ + private function decrementRequestCount(): void + { + --$this->sendingRequestCount; + } + + /** + * Enable the current client. + */ + private function enable(): void + { + $this->disabledAt = null; + } + + /** + * Disable the current client. + */ + private function disable(): void + { + $this->disabledAt = new \DateTime('now'); + } +} diff --git a/vendor/php-http/client-common/src/HttpClientPool/LeastUsedClientPool.php b/vendor/php-http/client-common/src/HttpClientPool/LeastUsedClientPool.php new file mode 100644 index 00000000..789c3579 --- /dev/null +++ b/vendor/php-http/client-common/src/HttpClientPool/LeastUsedClientPool.php @@ -0,0 +1,45 @@ + + */ +final class LeastUsedClientPool extends HttpClientPool +{ + /** + * {@inheritdoc} + */ + protected function chooseHttpClient(): HttpClientPoolItem + { + $clientPool = array_filter($this->clientPool, function (HttpClientPoolItem $clientPoolItem) { + return !$clientPoolItem->isDisabled(); + }); + + if (0 === count($clientPool)) { + throw new HttpClientNotFoundException('Cannot choose a http client as there is no one present in the pool'); + } + + usort($clientPool, function (HttpClientPoolItem $clientA, HttpClientPoolItem $clientB) { + if ($clientA->getSendingRequestCount() === $clientB->getSendingRequestCount()) { + return 0; + } + + if ($clientA->getSendingRequestCount() < $clientB->getSendingRequestCount()) { + return -1; + } + + return 1; + }); + + return reset($clientPool); + } +} diff --git a/vendor/php-http/client-common/src/HttpClientPool/RandomClientPool.php b/vendor/php-http/client-common/src/HttpClientPool/RandomClientPool.php new file mode 100644 index 00000000..789ba42f --- /dev/null +++ b/vendor/php-http/client-common/src/HttpClientPool/RandomClientPool.php @@ -0,0 +1,31 @@ + + */ +final class RandomClientPool extends HttpClientPool +{ + /** + * {@inheritdoc} + */ + protected function chooseHttpClient(): HttpClientPoolItem + { + $clientPool = array_filter($this->clientPool, function (HttpClientPoolItem $clientPoolItem) { + return !$clientPoolItem->isDisabled(); + }); + + if (0 === count($clientPool)) { + throw new HttpClientNotFoundException('Cannot choose a http client as there is no one present in the pool'); + } + + return $clientPool[array_rand($clientPool)]; + } +} diff --git a/vendor/php-http/client-common/src/HttpClientPool/RoundRobinClientPool.php b/vendor/php-http/client-common/src/HttpClientPool/RoundRobinClientPool.php new file mode 100644 index 00000000..7c7b1910 --- /dev/null +++ b/vendor/php-http/client-common/src/HttpClientPool/RoundRobinClientPool.php @@ -0,0 +1,42 @@ + + */ +final class RoundRobinClientPool extends HttpClientPool +{ + /** + * {@inheritdoc} + */ + protected function chooseHttpClient(): HttpClientPoolItem + { + $last = current($this->clientPool); + + do { + $client = next($this->clientPool); + + if (false === $client) { + $client = reset($this->clientPool); + + if (false === $client) { + throw new HttpClientNotFoundException('Cannot choose a http client as there is no one present in the pool'); + } + } + + // Case when there is only one and the last one has been disabled + if ($last === $client && $client->isDisabled()) { + throw new HttpClientNotFoundException('Cannot choose a http client as there is no one enabled in the pool'); + } + } while ($client->isDisabled()); + + return $client; + } +} diff --git a/vendor/php-http/client-common/src/HttpClientRouter.php b/vendor/php-http/client-common/src/HttpClientRouter.php new file mode 100644 index 00000000..040d893a --- /dev/null +++ b/vendor/php-http/client-common/src/HttpClientRouter.php @@ -0,0 +1,74 @@ + + */ +final class HttpClientRouter implements HttpClientRouterInterface +{ + /** + * @var (array{matcher: RequestMatcher, client: FlexibleHttpClient})[] + */ + private $clients = []; + + /** + * {@inheritdoc} + */ + public function sendRequest(RequestInterface $request): ResponseInterface + { + return $this->chooseHttpClient($request)->sendRequest($request); + } + + /** + * {@inheritdoc} + */ + public function sendAsyncRequest(RequestInterface $request) + { + return $this->chooseHttpClient($request)->sendAsyncRequest($request); + } + + /** + * Add a client to the router. + * + * @param ClientInterface|HttpAsyncClient $client + */ + public function addClient($client, RequestMatcher $requestMatcher): void + { + if (!$client instanceof ClientInterface && !$client instanceof HttpAsyncClient) { + throw new \TypeError( + sprintf('%s::addClient(): Argument #1 ($client) must be of type %s|%s, %s given', self::class, ClientInterface::class, HttpAsyncClient::class, get_debug_type($client)) + ); + } + + $this->clients[] = [ + 'matcher' => $requestMatcher, + 'client' => new FlexibleHttpClient($client), + ]; + } + + /** + * Choose an HTTP client given a specific request. + */ + private function chooseHttpClient(RequestInterface $request): FlexibleHttpClient + { + foreach ($this->clients as $client) { + if ($client['matcher']->matches($request)) { + return $client['client']; + } + } + + throw new HttpClientNoMatchException('No client found for the specified request', $request); + } +} diff --git a/vendor/php-http/client-common/src/HttpClientRouterInterface.php b/vendor/php-http/client-common/src/HttpClientRouterInterface.php new file mode 100644 index 00000000..ae012cf4 --- /dev/null +++ b/vendor/php-http/client-common/src/HttpClientRouterInterface.php @@ -0,0 +1,27 @@ + + */ +interface HttpClientRouterInterface extends HttpClient, HttpAsyncClient +{ + /** + * Add a client to the router. + * + * @param ClientInterface|HttpAsyncClient $client + */ + public function addClient($client, RequestMatcher $requestMatcher): void; +} diff --git a/vendor/php-http/client-common/src/HttpMethodsClient.php b/vendor/php-http/client-common/src/HttpMethodsClient.php new file mode 100644 index 00000000..497921b1 --- /dev/null +++ b/vendor/php-http/client-common/src/HttpMethodsClient.php @@ -0,0 +1,150 @@ +httpClient = $httpClient; + $this->requestFactory = $requestFactory; + $this->streamFactory = $streamFactory; + } + + public function get($uri, array $headers = []): ResponseInterface + { + return $this->send('GET', $uri, $headers, null); + } + + public function head($uri, array $headers = []): ResponseInterface + { + return $this->send('HEAD', $uri, $headers, null); + } + + public function trace($uri, array $headers = []): ResponseInterface + { + return $this->send('TRACE', $uri, $headers, null); + } + + public function post($uri, array $headers = [], $body = null): ResponseInterface + { + return $this->send('POST', $uri, $headers, $body); + } + + public function put($uri, array $headers = [], $body = null): ResponseInterface + { + return $this->send('PUT', $uri, $headers, $body); + } + + public function patch($uri, array $headers = [], $body = null): ResponseInterface + { + return $this->send('PATCH', $uri, $headers, $body); + } + + public function delete($uri, array $headers = [], $body = null): ResponseInterface + { + return $this->send('DELETE', $uri, $headers, $body); + } + + public function options($uri, array $headers = [], $body = null): ResponseInterface + { + return $this->send('OPTIONS', $uri, $headers, $body); + } + + public function send(string $method, $uri, array $headers = [], $body = null): ResponseInterface + { + if (!is_string($uri) && !$uri instanceof UriInterface) { + throw new \TypeError( + sprintf('%s::send(): Argument #2 ($uri) must be of type string|%s, %s given', self::class, UriInterface::class, get_debug_type($uri)) + ); + } + + if (!is_string($body) && !$body instanceof StreamInterface && null !== $body) { + throw new \TypeError( + sprintf('%s::send(): Argument #4 ($body) must be of type string|%s|null, %s given', self::class, StreamInterface::class, get_debug_type($body)) + ); + } + + return $this->sendRequest( + self::createRequest($method, $uri, $headers, $body) + ); + } + + /** + * @param string|UriInterface $uri + * @param string|StreamInterface|null $body + */ + private function createRequest(string $method, $uri, array $headers = [], $body = null): RequestInterface + { + if ($this->requestFactory instanceof RequestFactory) { + return $this->requestFactory->createRequest( + $method, + $uri, + $headers, + $body + ); + } + + $request = $this->requestFactory->createRequest($method, $uri); + + foreach ($headers as $key => $value) { + $request = $request->withHeader($key, $value); + } + + if (null !== $body && '' !== $body) { + if (null === $this->streamFactory) { + throw new \RuntimeException('Cannot create request: A stream factory is required to create a request with a non-empty string body.'); + } + + $request = $request->withBody( + is_string($body) ? $this->streamFactory->createStream($body) : $body + ); + } + + return $request; + } + + public function sendRequest(RequestInterface $request): ResponseInterface + { + return $this->httpClient->sendRequest($request); + } +} diff --git a/vendor/php-http/client-common/src/HttpMethodsClientInterface.php b/vendor/php-http/client-common/src/HttpMethodsClientInterface.php new file mode 100644 index 00000000..bc0829ae --- /dev/null +++ b/vendor/php-http/client-common/src/HttpMethodsClientInterface.php @@ -0,0 +1,116 @@ +get('/foo') + * ->post('/bar') + * ; + * + * The client also exposes the sendRequest methods of the wrapped HttpClient. + * + * @author Márk Sági-Kazár + * @author David Buchmann + */ +interface HttpMethodsClientInterface extends HttpClient +{ + /** + * Sends a GET request. + * + * @param string|UriInterface $uri + * + * @throws Exception + */ + public function get($uri, array $headers = []): ResponseInterface; + + /** + * Sends an HEAD request. + * + * @param string|UriInterface $uri + * + * @throws Exception + */ + public function head($uri, array $headers = []): ResponseInterface; + + /** + * Sends a TRACE request. + * + * @param string|UriInterface $uri + * + * @throws Exception + */ + public function trace($uri, array $headers = []): ResponseInterface; + + /** + * Sends a POST request. + * + * @param string|UriInterface $uri + * @param string|StreamInterface|null $body + * + * @throws Exception + */ + public function post($uri, array $headers = [], $body = null): ResponseInterface; + + /** + * Sends a PUT request. + * + * @param string|UriInterface $uri + * @param string|StreamInterface|null $body + * + * @throws Exception + */ + public function put($uri, array $headers = [], $body = null): ResponseInterface; + + /** + * Sends a PATCH request. + * + * @param string|UriInterface $uri + * @param string|StreamInterface|null $body + * + * @throws Exception + */ + public function patch($uri, array $headers = [], $body = null): ResponseInterface; + + /** + * Sends a DELETE request. + * + * @param string|UriInterface $uri + * @param string|StreamInterface|null $body + * + * @throws Exception + */ + public function delete($uri, array $headers = [], $body = null): ResponseInterface; + + /** + * Sends an OPTIONS request. + * + * @param string|UriInterface $uri + * @param string|StreamInterface|null $body + * + * @throws Exception + */ + public function options($uri, array $headers = [], $body = null): ResponseInterface; + + /** + * Sends a request with any HTTP method. + * + * @param string $method HTTP method to use + * @param string|UriInterface $uri + * @param string|StreamInterface|null $body + * + * @throws Exception + */ + public function send(string $method, $uri, array $headers = [], $body = null): ResponseInterface; +} diff --git a/vendor/php-http/client-common/src/Plugin.php b/vendor/php-http/client-common/src/Plugin.php new file mode 100644 index 00000000..99898b92 --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin.php @@ -0,0 +1,33 @@ + + */ +interface Plugin +{ + /** + * Handle the request and return the response coming from the next callable. + * + * @see http://docs.php-http.org/en/latest/plugins/build-your-own.html + * + * @param callable(RequestInterface): Promise $next Next middleware in the chain, the request is passed as the first argument + * @param callable(RequestInterface): Promise $first First middleware in the chain, used to to restart a request + * + * @return Promise Resolves a PSR-7 Response or fails with an Http\Client\Exception (The same as HttpAsyncClient) + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise; +} diff --git a/vendor/php-http/client-common/src/Plugin/AddHostPlugin.php b/vendor/php-http/client-common/src/Plugin/AddHostPlugin.php new file mode 100644 index 00000000..c7fb05a1 --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/AddHostPlugin.php @@ -0,0 +1,76 @@ + + */ +final class AddHostPlugin implements Plugin +{ + /** + * @var UriInterface + */ + private $host; + + /** + * @var bool + */ + private $replace; + + /** + * @param array{'replace'?: bool} $config + * + * Configuration options: + * - replace: True will replace all hosts, false will only add host when none is specified. + */ + public function __construct(UriInterface $host, array $config = []) + { + if ('' === $host->getHost()) { + throw new \LogicException('Host can not be empty'); + } + + $this->host = $host; + + $resolver = new OptionsResolver(); + $this->configureOptions($resolver); + $options = $resolver->resolve($config); + + $this->replace = $options['replace']; + } + + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + if ($this->replace || '' === $request->getUri()->getHost()) { + $uri = $request->getUri() + ->withHost($this->host->getHost()) + ->withScheme($this->host->getScheme()) + ->withPort($this->host->getPort()) + ; + + $request = $request->withUri($uri); + } + + return $next($request); + } + + private function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'replace' => false, + ]); + $resolver->setAllowedTypes('replace', 'bool'); + } +} diff --git a/vendor/php-http/client-common/src/Plugin/AddPathPlugin.php b/vendor/php-http/client-common/src/Plugin/AddPathPlugin.php new file mode 100644 index 00000000..9d43104f --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/AddPathPlugin.php @@ -0,0 +1,78 @@ + + */ +final class AddPathPlugin implements Plugin +{ + /** + * @var UriInterface + */ + private $uri; + + public function __construct(UriInterface $uri) + { + if ('' === $uri->getPath()) { + throw new \LogicException('URI path cannot be empty'); + } + + if ('/' === substr($uri->getPath(), -1)) { + $uri = $uri->withPath(rtrim($uri->getPath(), '/')); + } + + $this->uri = $uri; + } + + /** + * Adds a prefix in the beginning of the URL's path. + * + * The prefix is not added if that prefix is already on the URL's path. This will fail on the edge + * case of the prefix being repeated, for example if `https://example.com/api/api/foo` is a valid + * URL on the server and the configured prefix is `/api`. + * + * We looked at other solutions, but they are all much more complicated, while still having edge + * cases: + * - Doing an spl_object_hash on `$first` will lead to collisions over time because over time the + * hash can collide. + * - Have the PluginClient provide a magic header to identify the request chain and only apply + * this plugin once. + * + * There are 2 reasons for the AddPathPlugin to be executed twice on the same request: + * - A plugin can restart the chain by calling `$first`, e.g. redirect + * - A plugin can call `$next` more than once, e.g. retry + * + * Depending on the scenario, the path should or should not be added. E.g. `$first` could + * be called after a redirect response from the server. The server likely already has the + * correct path. + * + * No solution fits all use cases. This implementation will work fine for the common use cases. + * If you have a specific situation where this is not the right thing, you can build a custom plugin + * that does exactly what you need. + * + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + $prepend = $this->uri->getPath(); + $path = $request->getUri()->getPath(); + + if (substr($path, 0, strlen($prepend)) !== $prepend) { + $request = $request->withUri($request->getUri() + ->withPath($prepend.$path) + ); + } + + return $next($request); + } +} diff --git a/vendor/php-http/client-common/src/Plugin/AuthenticationPlugin.php b/vendor/php-http/client-common/src/Plugin/AuthenticationPlugin.php new file mode 100644 index 00000000..ce9d4bd1 --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/AuthenticationPlugin.php @@ -0,0 +1,38 @@ + + */ +final class AuthenticationPlugin implements Plugin +{ + /** + * @var Authentication An authentication system + */ + private $authentication; + + public function __construct(Authentication $authentication) + { + $this->authentication = $authentication; + } + + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + $request = $this->authentication->authenticate($request); + + return $next($request); + } +} diff --git a/vendor/php-http/client-common/src/Plugin/BaseUriPlugin.php b/vendor/php-http/client-common/src/Plugin/BaseUriPlugin.php new file mode 100644 index 00000000..34c3b641 --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/BaseUriPlugin.php @@ -0,0 +1,57 @@ + + */ +final class BaseUriPlugin implements Plugin +{ + /** + * @var AddHostPlugin + */ + private $addHostPlugin; + + /** + * @var AddPathPlugin|null + */ + private $addPathPlugin = null; + + /** + * @param UriInterface $uri Has to contain a host name and can have a path + * @param array $hostConfig Config for AddHostPlugin. @see AddHostPlugin::configureOptions + */ + public function __construct(UriInterface $uri, array $hostConfig = []) + { + $this->addHostPlugin = new AddHostPlugin($uri, $hostConfig); + + if (rtrim($uri->getPath(), '/')) { + $this->addPathPlugin = new AddPathPlugin($uri); + } + } + + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + $addHostNext = function (RequestInterface $request) use ($next, $first) { + return $this->addHostPlugin->handleRequest($request, $next, $first); + }; + + if ($this->addPathPlugin) { + return $this->addPathPlugin->handleRequest($request, $addHostNext, $first); + } + + return $addHostNext($request); + } +} diff --git a/vendor/php-http/client-common/src/Plugin/ContentLengthPlugin.php b/vendor/php-http/client-common/src/Plugin/ContentLengthPlugin.php new file mode 100644 index 00000000..f313c330 --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/ContentLengthPlugin.php @@ -0,0 +1,39 @@ + + */ +final class ContentLengthPlugin implements Plugin +{ + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + if (!$request->hasHeader('Content-Length')) { + $stream = $request->getBody(); + + // Cannot determine the size so we use a chunk stream + if (null === $stream->getSize()) { + $stream = new ChunkStream($stream); + $request = $request->withBody($stream); + $request = $request->withAddedHeader('Transfer-Encoding', 'chunked'); + } else { + $request = $request->withHeader('Content-Length', (string) $stream->getSize()); + } + } + + return $next($request); + } +} diff --git a/vendor/php-http/client-common/src/Plugin/ContentTypePlugin.php b/vendor/php-http/client-common/src/Plugin/ContentTypePlugin.php new file mode 100644 index 00000000..9a87f99e --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/ContentTypePlugin.php @@ -0,0 +1,122 @@ + + */ +final class ContentTypePlugin implements Plugin +{ + /** + * Allow to disable the content type detection when stream is too large (as it can consume a lot of resource). + * + * @var bool + * + * true skip the content type detection + * false detect the content type (default value) + */ + private $skipDetection; + + /** + * Determine the size stream limit for which the detection as to be skipped (default to 16Mb). + * + * @var int + */ + private $sizeLimit; + + /** + * @param array{'skip_detection'?: bool, 'size_limit'?: int} $config + * + * Configuration options: + * - skip_detection: true skip detection if stream size is bigger than $size_limit + * - size_limit: size stream limit for which the detection as to be skipped. + */ + public function __construct(array $config = []) + { + $resolver = new OptionsResolver(); + $resolver->setDefaults([ + 'skip_detection' => false, + 'size_limit' => 16000000, + ]); + $resolver->setAllowedTypes('skip_detection', 'bool'); + $resolver->setAllowedTypes('size_limit', 'int'); + + $options = $resolver->resolve($config); + + $this->skipDetection = $options['skip_detection']; + $this->sizeLimit = $options['size_limit']; + } + + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + if (!$request->hasHeader('Content-Type')) { + $stream = $request->getBody(); + $streamSize = $stream->getSize(); + + if (!$stream->isSeekable()) { + return $next($request); + } + + if (0 === $streamSize) { + return $next($request); + } + + if ($this->skipDetection && (null === $streamSize || $streamSize >= $this->sizeLimit)) { + return $next($request); + } + + if ($this->isJson($stream)) { + $request = $request->withHeader('Content-Type', 'application/json'); + + return $next($request); + } + + if ($this->isXml($stream)) { + $request = $request->withHeader('Content-Type', 'application/xml'); + + return $next($request); + } + } + + return $next($request); + } + + private function isJson(StreamInterface $stream): bool + { + if (!function_exists('json_decode')) { + return false; + } + $stream->rewind(); + + json_decode($stream->getContents()); + + return JSON_ERROR_NONE === json_last_error(); + } + + private function isXml(StreamInterface $stream): bool + { + if (!function_exists('simplexml_load_string')) { + return false; + } + $stream->rewind(); + + $previousValue = libxml_use_internal_errors(true); + $isXml = simplexml_load_string($stream->getContents()); + libxml_use_internal_errors($previousValue); + + return false !== $isXml; + } +} diff --git a/vendor/php-http/client-common/src/Plugin/CookiePlugin.php b/vendor/php-http/client-common/src/Plugin/CookiePlugin.php new file mode 100644 index 00000000..aa4d5d7e --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/CookiePlugin.php @@ -0,0 +1,180 @@ + + */ +final class CookiePlugin implements Plugin +{ + /** + * Cookie storage. + * + * @var CookieJar + */ + private $cookieJar; + + public function __construct(CookieJar $cookieJar) + { + $this->cookieJar = $cookieJar; + } + + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + $cookies = []; + foreach ($this->cookieJar->getCookies() as $cookie) { + if ($cookie->isExpired()) { + continue; + } + + if (!$cookie->matchDomain($request->getUri()->getHost())) { + continue; + } + + if (!$cookie->matchPath($request->getUri()->getPath())) { + continue; + } + + if ($cookie->isSecure() && ('https' !== $request->getUri()->getScheme())) { + continue; + } + + $cookies[] = sprintf('%s=%s', $cookie->getName(), $cookie->getValue()); + } + + if (!empty($cookies)) { + $request = $request->withAddedHeader('Cookie', implode('; ', array_unique($cookies))); + } + + return $next($request)->then(function (ResponseInterface $response) use ($request) { + if ($response->hasHeader('Set-Cookie')) { + $setCookies = $response->getHeader('Set-Cookie'); + + foreach ($setCookies as $setCookie) { + $cookie = $this->createCookie($request, $setCookie); + + // Cookie invalid do not use it + if (null === $cookie) { + continue; + } + + // Restrict setting cookie from another domain + if (!preg_match("/\.{$cookie->getDomain()}$/", '.'.$request->getUri()->getHost())) { + continue; + } + + $this->cookieJar->addCookie($cookie); + } + } + + return $response; + }); + } + + /** + * Creates a cookie from a string. + * + * @throws TransferException + */ + private function createCookie(RequestInterface $request, string $setCookieHeader): ?Cookie + { + $parts = array_map('trim', explode(';', $setCookieHeader)); + + if ('' === $parts[0] || false === strpos($parts[0], '=')) { + return null; + } + + list($name, $cookieValue) = $this->createValueKey(array_shift($parts)); + + $maxAge = null; + $expires = null; + $domain = $request->getUri()->getHost(); + $path = $request->getUri()->getPath(); + $secure = false; + $httpOnly = false; + + // Add the cookie pieces into the parsed data array + foreach ($parts as $part) { + list($key, $value) = $this->createValueKey($part); + + switch (strtolower($key)) { + case 'expires': + try { + $expires = CookieUtil::parseDate((string) $value); + } catch (UnexpectedValueException $e) { + throw new TransferException( + sprintf( + 'Cookie header `%s` expires value `%s` could not be converted to date', + $name, + $value + ), + 0, + $e + ); + } + + break; + + case 'max-age': + $maxAge = (int) $value; + + break; + + case 'domain': + $domain = $value; + + break; + + case 'path': + $path = $value; + + break; + + case 'secure': + $secure = true; + + break; + + case 'httponly': + $httpOnly = true; + + break; + } + } + + return new Cookie($name, $cookieValue, $maxAge, $domain, $path, $secure, $httpOnly, $expires); + } + + /** + * Separates key/value pair from cookie. + * + * @param string $part A single cookie value in format key=value + * + * @return array{0:string, 1:?string} + */ + private function createValueKey(string $part): array + { + $parts = explode('=', $part, 2); + $key = trim($parts[0]); + $value = isset($parts[1]) ? trim($parts[1]) : null; + + return [$key, $value]; + } +} diff --git a/vendor/php-http/client-common/src/Plugin/DecoderPlugin.php b/vendor/php-http/client-common/src/Plugin/DecoderPlugin.php new file mode 100644 index 00000000..b685967d --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/DecoderPlugin.php @@ -0,0 +1,135 @@ + + */ +final class DecoderPlugin implements Plugin +{ + /** + * @var bool Whether this plugin decode stream with value in the Content-Encoding header (default to true). + * + * If set to false only the Transfer-Encoding header will be used + */ + private $useContentEncoding; + + /** + * @param array{'use_content_encoding'?: bool} $config + * + * Configuration options: + * - use_content_encoding: Whether this plugin should look at the Content-Encoding header first or only at the Transfer-Encoding (defaults to true). + */ + public function __construct(array $config = []) + { + $resolver = new OptionsResolver(); + $resolver->setDefaults([ + 'use_content_encoding' => true, + ]); + $resolver->setAllowedTypes('use_content_encoding', 'bool'); + $options = $resolver->resolve($config); + + $this->useContentEncoding = $options['use_content_encoding']; + } + + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + $encodings = extension_loaded('zlib') ? ['gzip', 'deflate'] : ['identity']; + + if ($this->useContentEncoding) { + $request = $request->withHeader('Accept-Encoding', $encodings); + } + $encodings[] = 'chunked'; + $request = $request->withHeader('TE', $encodings); + + return $next($request)->then(function (ResponseInterface $response) { + return $this->decodeResponse($response); + }); + } + + /** + * Decode a response body given its Transfer-Encoding or Content-Encoding value. + */ + private function decodeResponse(ResponseInterface $response): ResponseInterface + { + $response = $this->decodeOnEncodingHeader('Transfer-Encoding', $response); + + if ($this->useContentEncoding) { + $response = $this->decodeOnEncodingHeader('Content-Encoding', $response); + } + + return $response; + } + + /** + * Decode a response on a specific header (content encoding or transfer encoding mainly). + */ + private function decodeOnEncodingHeader(string $headerName, ResponseInterface $response): ResponseInterface + { + if ($response->hasHeader($headerName)) { + $encodings = $response->getHeader($headerName); + $newEncodings = []; + + while ($encoding = array_pop($encodings)) { + $stream = $this->decorateStream($encoding, $response->getBody()); + + if (false === $stream) { + array_unshift($newEncodings, $encoding); + + continue; + } + + $response = $response->withBody($stream); + } + + if (\count($newEncodings) > 0) { + $response = $response->withHeader($headerName, $newEncodings); + } else { + $response = $response->withoutHeader($headerName); + } + } + + return $response; + } + + /** + * Decorate a stream given an encoding. + * + * @return StreamInterface|false A new stream interface or false if encoding is not supported + */ + private function decorateStream(string $encoding, StreamInterface $stream) + { + if ('chunked' === strtolower($encoding)) { + return new Encoding\DechunkStream($stream); + } + + if ('deflate' === strtolower($encoding)) { + return new Encoding\DecompressStream($stream); + } + + if ('gzip' === strtolower($encoding)) { + return new Encoding\GzipDecodeStream($stream); + } + + return false; + } +} diff --git a/vendor/php-http/client-common/src/Plugin/ErrorPlugin.php b/vendor/php-http/client-common/src/Plugin/ErrorPlugin.php new file mode 100644 index 00000000..06c795f5 --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/ErrorPlugin.php @@ -0,0 +1,92 @@ + + */ +final class ErrorPlugin implements Plugin +{ + /** + * @var bool Whether this plugin should only throw 5XX Exceptions (default to false). + * + * If set to true 4XX Responses code will never throw an exception + */ + private $onlyServerException; + + /** + * @param array{'only_server_exception'?: bool} $config + * + * Configuration options: + * - only_server_exception: Whether this plugin should only throw 5XX Exceptions (default to false). + */ + public function __construct(array $config = []) + { + $resolver = new OptionsResolver(); + $resolver->setDefaults([ + 'only_server_exception' => false, + ]); + $resolver->setAllowedTypes('only_server_exception', 'bool'); + $options = $resolver->resolve($config); + + $this->onlyServerException = $options['only_server_exception']; + } + + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + $promise = $next($request); + + return $promise->then(function (ResponseInterface $response) use ($request) { + return $this->transformResponseToException($request, $response); + }); + } + + /** + * Transform response to an error if possible. + * + * @param RequestInterface $request Request of the call + * @param ResponseInterface $response Response of the call + * + * @throws ClientErrorException If response status code is a 4xx + * @throws ServerErrorException If response status code is a 5xx + * + * @return ResponseInterface If status code is not in 4xx or 5xx return response + */ + private function transformResponseToException(RequestInterface $request, ResponseInterface $response): ResponseInterface + { + if (!$this->onlyServerException && $response->getStatusCode() >= 400 && $response->getStatusCode() < 500) { + throw new ClientErrorException($response->getReasonPhrase(), $request, $response); + } + + if ($response->getStatusCode() >= 500 && $response->getStatusCode() < 600) { + throw new ServerErrorException($response->getReasonPhrase(), $request, $response); + } + + return $response; + } +} diff --git a/vendor/php-http/client-common/src/Plugin/HeaderAppendPlugin.php b/vendor/php-http/client-common/src/Plugin/HeaderAppendPlugin.php new file mode 100644 index 00000000..95ea673c --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/HeaderAppendPlugin.php @@ -0,0 +1,48 @@ + + */ +final class HeaderAppendPlugin implements Plugin +{ + /** + * @var array + */ + private $headers; + + /** + * @param array $headers Hashmap of header name to header value + */ + public function __construct(array $headers) + { + $this->headers = $headers; + } + + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + foreach ($this->headers as $header => $headerValue) { + $request = $request->withAddedHeader($header, $headerValue); + } + + return $next($request); + } +} diff --git a/vendor/php-http/client-common/src/Plugin/HeaderDefaultsPlugin.php b/vendor/php-http/client-common/src/Plugin/HeaderDefaultsPlugin.php new file mode 100644 index 00000000..bf580700 --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/HeaderDefaultsPlugin.php @@ -0,0 +1,46 @@ + + */ +final class HeaderDefaultsPlugin implements Plugin +{ + /** + * @var array + */ + private $headers = []; + + /** + * @param array $headers Hashmap of header name to header value + */ + public function __construct(array $headers) + { + $this->headers = $headers; + } + + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + foreach ($this->headers as $header => $headerValue) { + if (!$request->hasHeader($header)) { + $request = $request->withHeader($header, $headerValue); + } + } + + return $next($request); + } +} diff --git a/vendor/php-http/client-common/src/Plugin/HeaderRemovePlugin.php b/vendor/php-http/client-common/src/Plugin/HeaderRemovePlugin.php new file mode 100644 index 00000000..9f4ca44e --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/HeaderRemovePlugin.php @@ -0,0 +1,44 @@ + + */ +final class HeaderRemovePlugin implements Plugin +{ + /** + * @var array + */ + private $headers = []; + + /** + * @param array $headers List of header names to remove from the request + */ + public function __construct(array $headers) + { + $this->headers = $headers; + } + + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + foreach ($this->headers as $header) { + if ($request->hasHeader($header)) { + $request = $request->withoutHeader($header); + } + } + + return $next($request); + } +} diff --git a/vendor/php-http/client-common/src/Plugin/HeaderSetPlugin.php b/vendor/php-http/client-common/src/Plugin/HeaderSetPlugin.php new file mode 100644 index 00000000..06f00eb8 --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/HeaderSetPlugin.php @@ -0,0 +1,44 @@ + + */ +final class HeaderSetPlugin implements Plugin +{ + /** + * @var array + */ + private $headers; + + /** + * @param array $headers Hashmap of header name to header value + */ + public function __construct(array $headers) + { + $this->headers = $headers; + } + + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + foreach ($this->headers as $header => $headerValue) { + $request = $request->withHeader($header, $headerValue); + } + + return $next($request); + } +} diff --git a/vendor/php-http/client-common/src/Plugin/HistoryPlugin.php b/vendor/php-http/client-common/src/Plugin/HistoryPlugin.php new file mode 100644 index 00000000..a1796a6f --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/HistoryPlugin.php @@ -0,0 +1,49 @@ + + */ +final class HistoryPlugin implements Plugin +{ + /** + * Journal use to store request / responses / exception. + * + * @var Journal + */ + private $journal; + + public function __construct(Journal $journal) + { + $this->journal = $journal; + } + + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + $journal = $this->journal; + + return $next($request)->then(function (ResponseInterface $response) use ($request, $journal) { + $journal->addSuccess($request, $response); + + return $response; + }, function (ClientExceptionInterface $exception) use ($request, $journal) { + $journal->addFailure($request, $exception); + + throw $exception; + }); + } +} diff --git a/vendor/php-http/client-common/src/Plugin/Journal.php b/vendor/php-http/client-common/src/Plugin/Journal.php new file mode 100644 index 00000000..9faa9381 --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/Journal.php @@ -0,0 +1,33 @@ + + */ +interface Journal +{ + /** + * Record a successful call. + * + * @param RequestInterface $request Request use to make the call + * @param ResponseInterface $response Response returned by the call + */ + public function addSuccess(RequestInterface $request, ResponseInterface $response); + + /** + * Record a failed call. + * + * @param RequestInterface $request Request use to make the call + * @param ClientExceptionInterface $exception Exception returned by the call + */ + public function addFailure(RequestInterface $request, ClientExceptionInterface $exception); +} diff --git a/vendor/php-http/client-common/src/Plugin/QueryDefaultsPlugin.php b/vendor/php-http/client-common/src/Plugin/QueryDefaultsPlugin.php new file mode 100644 index 00000000..4c8087c4 --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/QueryDefaultsPlugin.php @@ -0,0 +1,50 @@ + + */ +final class QueryDefaultsPlugin implements Plugin +{ + /** + * @var array + */ + private $queryParams = []; + + /** + * @param array $queryParams Hashmap of query name to query value. Names and values must not be url encoded as + * this plugin will encode them + */ + public function __construct(array $queryParams) + { + $this->queryParams = $queryParams; + } + + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + $uri = $request->getUri(); + + parse_str($uri->getQuery(), $query); + $query += $this->queryParams; + + $request = $request->withUri( + $uri->withQuery(http_build_query($query)) + ); + + return $next($request); + } +} diff --git a/vendor/php-http/client-common/src/Plugin/RedirectPlugin.php b/vendor/php-http/client-common/src/Plugin/RedirectPlugin.php new file mode 100644 index 00000000..5b45826e --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/RedirectPlugin.php @@ -0,0 +1,265 @@ + + */ +final class RedirectPlugin implements Plugin +{ + /** + * Rule on how to redirect, change method for the new request. + * + * @var array + */ + private $redirectCodes = [ + 300 => [ + 'switch' => [ + 'unless' => ['GET', 'HEAD'], + 'to' => 'GET', + ], + 'multiple' => true, + 'permanent' => false, + ], + 301 => [ + 'switch' => [ + 'unless' => ['GET', 'HEAD'], + 'to' => 'GET', + ], + 'multiple' => false, + 'permanent' => true, + ], + 302 => [ + 'switch' => [ + 'unless' => ['GET', 'HEAD'], + 'to' => 'GET', + ], + 'multiple' => false, + 'permanent' => false, + ], + 303 => [ + 'switch' => [ + 'unless' => ['GET', 'HEAD'], + 'to' => 'GET', + ], + 'multiple' => false, + 'permanent' => false, + ], + 307 => [ + 'switch' => false, + 'multiple' => false, + 'permanent' => false, + ], + 308 => [ + 'switch' => false, + 'multiple' => false, + 'permanent' => true, + ], + ]; + + /** + * Determine how header should be preserved from old request. + * + * @var bool|array + * + * true will keep all previous headers (default value) + * false will ditch all previous headers + * string[] will keep only headers with the specified names + */ + private $preserveHeader; + + /** + * Store all previous redirect from 301 / 308 status code. + * + * @var array + */ + private $redirectStorage = []; + + /** + * Whether the location header must be directly used for a multiple redirection status code (300). + * + * @var bool + */ + private $useDefaultForMultiple; + + /** + * @var string[][] Chain identifier => list of URLs for this chain + */ + private $circularDetection = []; + + /** + * @param array{'preserve_header'?: bool|string[], 'use_default_for_multiple'?: bool, 'strict'?: bool} $config + * + * Configuration options: + * - preserve_header: True keeps all headers, false remove all of them, an array is interpreted as a list of header names to keep + * - use_default_for_multiple: Whether the location header must be directly used for a multiple redirection status code (300) + * - strict: When true, redirect codes 300, 301, 302 will not modify request method and body. + */ + public function __construct(array $config = []) + { + $resolver = new OptionsResolver(); + $resolver->setDefaults([ + 'preserve_header' => true, + 'use_default_for_multiple' => true, + 'strict' => false, + ]); + $resolver->setAllowedTypes('preserve_header', ['bool', 'array']); + $resolver->setAllowedTypes('use_default_for_multiple', 'bool'); + $resolver->setAllowedTypes('strict', 'bool'); + $resolver->setNormalizer('preserve_header', function (OptionsResolver $resolver, $value) { + if (is_bool($value) && false === $value) { + return []; + } + + return $value; + }); + $options = $resolver->resolve($config); + + $this->preserveHeader = $options['preserve_header']; + $this->useDefaultForMultiple = $options['use_default_for_multiple']; + + if ($options['strict']) { + $this->redirectCodes[300]['switch'] = false; + $this->redirectCodes[301]['switch'] = false; + $this->redirectCodes[302]['switch'] = false; + } + } + + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + // Check in storage + if (array_key_exists((string) $request->getUri(), $this->redirectStorage)) { + $uri = $this->redirectStorage[(string) $request->getUri()]['uri']; + $statusCode = $this->redirectStorage[(string) $request->getUri()]['status']; + $redirectRequest = $this->buildRedirectRequest($request, $uri, $statusCode); + + return $first($redirectRequest); + } + + return $next($request)->then(function (ResponseInterface $response) use ($request, $first): ResponseInterface { + $statusCode = $response->getStatusCode(); + + if (!array_key_exists($statusCode, $this->redirectCodes)) { + return $response; + } + + $uri = $this->createUri($response, $request); + $redirectRequest = $this->buildRedirectRequest($request, $uri, $statusCode); + $chainIdentifier = spl_object_hash((object) $first); + + if (!array_key_exists($chainIdentifier, $this->circularDetection)) { + $this->circularDetection[$chainIdentifier] = []; + } + + $this->circularDetection[$chainIdentifier][] = (string) $request->getUri(); + + if (in_array((string) $redirectRequest->getUri(), $this->circularDetection[$chainIdentifier])) { + throw new CircularRedirectionException('Circular redirection detected', $request, $response); + } + + if ($this->redirectCodes[$statusCode]['permanent']) { + $this->redirectStorage[(string) $request->getUri()] = [ + 'uri' => $uri, + 'status' => $statusCode, + ]; + } + + // Call redirect request synchronously + return $first($redirectRequest)->wait(); + }); + } + + private function buildRedirectRequest(RequestInterface $originalRequest, UriInterface $targetUri, int $statusCode): RequestInterface + { + $originalRequest = $originalRequest->withUri($targetUri); + + if (false !== $this->redirectCodes[$statusCode]['switch'] && !in_array($originalRequest->getMethod(), $this->redirectCodes[$statusCode]['switch']['unless'])) { + $originalRequest = $originalRequest->withMethod($this->redirectCodes[$statusCode]['switch']['to']); + } + + if (is_array($this->preserveHeader)) { + $headers = array_keys($originalRequest->getHeaders()); + + foreach ($headers as $name) { + if (!in_array($name, $this->preserveHeader)) { + $originalRequest = $originalRequest->withoutHeader($name); + } + } + } + + return $originalRequest; + } + + /** + * Creates a new Uri from the old request and the location header. + * + * @throws HttpException If location header is not usable (missing or incorrect) + * @throws MultipleRedirectionException If a 300 status code is received and default location cannot be resolved (doesn't use the location header or not present) + */ + private function createUri(ResponseInterface $redirectResponse, RequestInterface $originalRequest): UriInterface + { + if ($this->redirectCodes[$redirectResponse->getStatusCode()]['multiple'] && (!$this->useDefaultForMultiple || !$redirectResponse->hasHeader('Location'))) { + throw new MultipleRedirectionException('Cannot choose a redirection', $originalRequest, $redirectResponse); + } + + if (!$redirectResponse->hasHeader('Location')) { + throw new HttpException('Redirect status code, but no location header present in the response', $originalRequest, $redirectResponse); + } + + $location = $redirectResponse->getHeaderLine('Location'); + $parsedLocation = parse_url($location); + + if (false === $parsedLocation) { + throw new HttpException(sprintf('Location %s could not be parsed', $location), $originalRequest, $redirectResponse); + } + + $uri = $originalRequest->getUri(); + + if (array_key_exists('scheme', $parsedLocation)) { + $uri = $uri->withScheme($parsedLocation['scheme']); + } + + if (array_key_exists('host', $parsedLocation)) { + $uri = $uri->withHost($parsedLocation['host']); + } + + if (array_key_exists('port', $parsedLocation)) { + $uri = $uri->withPort($parsedLocation['port']); + } + + if (array_key_exists('path', $parsedLocation)) { + $uri = $uri->withPath($parsedLocation['path']); + } + + if (array_key_exists('query', $parsedLocation)) { + $uri = $uri->withQuery($parsedLocation['query']); + } else { + $uri = $uri->withQuery(''); + } + + if (array_key_exists('fragment', $parsedLocation)) { + $uri = $uri->withFragment($parsedLocation['fragment']); + } else { + $uri = $uri->withFragment(''); + } + + return $uri; + } +} diff --git a/vendor/php-http/client-common/src/Plugin/RequestMatcherPlugin.php b/vendor/php-http/client-common/src/Plugin/RequestMatcherPlugin.php new file mode 100644 index 00000000..45d4375d --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/RequestMatcherPlugin.php @@ -0,0 +1,56 @@ + + */ +final class RequestMatcherPlugin implements Plugin +{ + /** + * @var RequestMatcher + */ + private $requestMatcher; + + /** + * @var Plugin|null + */ + private $successPlugin; + + /** + * @var Plugin|null + */ + private $failurePlugin; + + public function __construct(RequestMatcher $requestMatcher, ?Plugin $delegateOnMatch, Plugin $delegateOnNoMatch = null) + { + $this->requestMatcher = $requestMatcher; + $this->successPlugin = $delegateOnMatch; + $this->failurePlugin = $delegateOnNoMatch; + } + + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + if ($this->requestMatcher->matches($request)) { + if (null !== $this->successPlugin) { + return $this->successPlugin->handleRequest($request, $next, $first); + } + } elseif (null !== $this->failurePlugin) { + return $this->failurePlugin->handleRequest($request, $next, $first); + } + + return $next($request); + } +} diff --git a/vendor/php-http/client-common/src/Plugin/RequestSeekableBodyPlugin.php b/vendor/php-http/client-common/src/Plugin/RequestSeekableBodyPlugin.php new file mode 100644 index 00000000..1b6c5289 --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/RequestSeekableBodyPlugin.php @@ -0,0 +1,29 @@ + + */ +final class RequestSeekableBodyPlugin extends SeekableBodyPlugin +{ + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + if (!$request->getBody()->isSeekable()) { + $request = $request->withBody(new BufferedStream($request->getBody(), $this->useFileBuffer, $this->memoryBufferSize)); + } + + return $next($request); + } +} diff --git a/vendor/php-http/client-common/src/Plugin/ResponseSeekableBodyPlugin.php b/vendor/php-http/client-common/src/Plugin/ResponseSeekableBodyPlugin.php new file mode 100644 index 00000000..6f941b65 --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/ResponseSeekableBodyPlugin.php @@ -0,0 +1,32 @@ + + */ +final class ResponseSeekableBodyPlugin extends SeekableBodyPlugin +{ + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + return $next($request)->then(function (ResponseInterface $response) { + if ($response->getBody()->isSeekable()) { + return $response; + } + + return $response->withBody(new BufferedStream($response->getBody(), $this->useFileBuffer, $this->memoryBufferSize)); + }); + } +} diff --git a/vendor/php-http/client-common/src/Plugin/RetryPlugin.php b/vendor/php-http/client-common/src/Plugin/RetryPlugin.php new file mode 100644 index 00000000..144679ea --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/RetryPlugin.php @@ -0,0 +1,179 @@ + + */ +final class RetryPlugin implements Plugin +{ + /** + * Number of retry before sending an exception. + * + * @var int + */ + private $retry; + + /** + * @var callable + */ + private $errorResponseDelay; + + /** + * @var callable + */ + private $errorResponseDecider; + + /** + * @var callable + */ + private $exceptionDecider; + + /** + * @var callable + */ + private $exceptionDelay; + + /** + * Store the retry counter for each request. + * + * @var array + */ + private $retryStorage = []; + + /** + * @param array{'retries'?: int, 'error_response_decider'?: callable, 'exception_decider'?: callable, 'error_response_delay'?: callable, 'exception_delay'?: callable} $config + * + * Configuration options: + * - retries: Number of retries to attempt if an exception occurs before letting the exception bubble up + * - error_response_decider: A callback that gets a request and response to decide whether the request should be retried + * - exception_decider: A callback that gets a request and an exception to decide after a failure whether the request should be retried + * - error_response_delay: A callback that gets a request and response and the current number of retries and returns how many microseconds we should wait before trying again + * - exception_delay: A callback that gets a request, an exception and the current number of retries and returns how many microseconds we should wait before trying again + */ + public function __construct(array $config = []) + { + $resolver = new OptionsResolver(); + $resolver->setDefaults([ + 'retries' => 1, + 'error_response_decider' => function (RequestInterface $request, ResponseInterface $response) { + // do not retry client errors + return $response->getStatusCode() >= 500 && $response->getStatusCode() < 600; + }, + 'exception_decider' => function (RequestInterface $request, ClientExceptionInterface $e) { + // do not retry client errors + return !$e instanceof HttpException || $e->getCode() >= 500 && $e->getCode() < 600; + }, + 'error_response_delay' => __CLASS__.'::defaultErrorResponseDelay', + 'exception_delay' => __CLASS__.'::defaultExceptionDelay', + ]); + + $resolver->setAllowedTypes('retries', 'int'); + $resolver->setAllowedTypes('error_response_decider', 'callable'); + $resolver->setAllowedTypes('exception_decider', 'callable'); + $resolver->setAllowedTypes('error_response_delay', 'callable'); + $resolver->setAllowedTypes('exception_delay', 'callable'); + $options = $resolver->resolve($config); + + $this->retry = $options['retries']; + $this->errorResponseDecider = $options['error_response_decider']; + $this->errorResponseDelay = $options['error_response_delay']; + $this->exceptionDecider = $options['exception_decider']; + $this->exceptionDelay = $options['exception_delay']; + } + + /** + * {@inheritdoc} + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + $chainIdentifier = spl_object_hash((object) $first); + + return $next($request)->then(function (ResponseInterface $response) use ($request, $next, $first, $chainIdentifier) { + if (!array_key_exists($chainIdentifier, $this->retryStorage)) { + $this->retryStorage[$chainIdentifier] = 0; + } + + if ($this->retryStorage[$chainIdentifier] >= $this->retry) { + unset($this->retryStorage[$chainIdentifier]); + + return $response; + } + + if (call_user_func($this->errorResponseDecider, $request, $response)) { + /** @var int $time */ + $time = call_user_func($this->errorResponseDelay, $request, $response, $this->retryStorage[$chainIdentifier]); + $response = $this->retry($request, $next, $first, $chainIdentifier, $time); + } + + if (array_key_exists($chainIdentifier, $this->retryStorage)) { + unset($this->retryStorage[$chainIdentifier]); + } + + return $response; + }, function (ClientExceptionInterface $exception) use ($request, $next, $first, $chainIdentifier) { + if (!array_key_exists($chainIdentifier, $this->retryStorage)) { + $this->retryStorage[$chainIdentifier] = 0; + } + + if ($this->retryStorage[$chainIdentifier] >= $this->retry) { + unset($this->retryStorage[$chainIdentifier]); + + throw $exception; + } + + if (!call_user_func($this->exceptionDecider, $request, $exception)) { + throw $exception; + } + + /** @var int $time */ + $time = call_user_func($this->exceptionDelay, $request, $exception, $this->retryStorage[$chainIdentifier]); + + return $this->retry($request, $next, $first, $chainIdentifier, $time); + }); + } + + /** + * @param int $retries The number of retries we made before. First time this get called it will be 0. + */ + public static function defaultErrorResponseDelay(RequestInterface $request, ResponseInterface $response, int $retries): int + { + return pow(2, $retries) * 500000; + } + + /** + * @param int $retries The number of retries we made before. First time this get called it will be 0. + */ + public static function defaultExceptionDelay(RequestInterface $request, ClientExceptionInterface $e, int $retries): int + { + return pow(2, $retries) * 500000; + } + + /** + * @throws \Exception if retrying returns a failed promise + */ + private function retry(RequestInterface $request, callable $next, callable $first, string $chainIdentifier, int $delay): ResponseInterface + { + usleep($delay); + + // Retry synchronously + ++$this->retryStorage[$chainIdentifier]; + $promise = $this->handleRequest($request, $next, $first); + + return $promise->wait(); + } +} diff --git a/vendor/php-http/client-common/src/Plugin/SeekableBodyPlugin.php b/vendor/php-http/client-common/src/Plugin/SeekableBodyPlugin.php new file mode 100644 index 00000000..1be2cdeb --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/SeekableBodyPlugin.php @@ -0,0 +1,47 @@ +setDefaults([ + 'use_file_buffer' => true, + 'memory_buffer_size' => 2097152, + ]); + $resolver->setAllowedTypes('use_file_buffer', 'bool'); + $resolver->setAllowedTypes('memory_buffer_size', 'int'); + + $options = $resolver->resolve($config); + + $this->useFileBuffer = $options['use_file_buffer']; + $this->memoryBufferSize = $options['memory_buffer_size']; + } +} diff --git a/vendor/php-http/client-common/src/Plugin/VersionBridgePlugin.php b/vendor/php-http/client-common/src/Plugin/VersionBridgePlugin.php new file mode 100644 index 00000000..0a2c714b --- /dev/null +++ b/vendor/php-http/client-common/src/Plugin/VersionBridgePlugin.php @@ -0,0 +1,24 @@ + + */ +trait VersionBridgePlugin +{ + abstract protected function doHandleRequest(RequestInterface $request, callable $next, callable $first); + + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + return $this->doHandleRequest($request, $next, $first); + } +} diff --git a/vendor/php-http/client-common/src/PluginChain.php b/vendor/php-http/client-common/src/PluginChain.php new file mode 100644 index 00000000..fcb19141 --- /dev/null +++ b/vendor/php-http/client-common/src/PluginChain.php @@ -0,0 +1,62 @@ +plugins = $plugins; + $this->clientCallable = $clientCallable; + $this->maxRestarts = (int) ($options['max_restarts'] ?? 0); + } + + private function createChain(): callable + { + $lastCallable = $this->clientCallable; + $reversedPlugins = array_reverse($this->plugins); + + foreach ($reversedPlugins as $plugin) { + $lastCallable = function (RequestInterface $request) use ($plugin, $lastCallable) { + return $plugin->handleRequest($request, $lastCallable, $this); + }; + } + + return $lastCallable; + } + + public function __invoke(RequestInterface $request): Promise + { + if ($this->restarts > $this->maxRestarts) { + throw new LoopException('Too many restarts in plugin client', $request); + } + + ++$this->restarts; + + return $this->createChain()($request); + } +} diff --git a/vendor/php-http/client-common/src/PluginClient.php b/vendor/php-http/client-common/src/PluginClient.php new file mode 100644 index 00000000..d67145df --- /dev/null +++ b/vendor/php-http/client-common/src/PluginClient.php @@ -0,0 +1,130 @@ + + */ +final class PluginClient implements HttpClient, HttpAsyncClient +{ + /** + * An HTTP async client. + * + * @var HttpAsyncClient + */ + private $client; + + /** + * The plugin chain. + * + * @var Plugin[] + */ + private $plugins; + + /** + * A list of options. + * + * @var array + */ + private $options; + + /** + * @param ClientInterface|HttpAsyncClient $client An HTTP async client + * @param Plugin[] $plugins A plugin chain + * @param array{'max_restarts'?: int} $options + */ + public function __construct($client, array $plugins = [], array $options = []) + { + if ($client instanceof HttpAsyncClient) { + $this->client = $client; + } elseif ($client instanceof ClientInterface) { + $this->client = new EmulatedHttpAsyncClient($client); + } else { + throw new \TypeError( + sprintf('%s::__construct(): Argument #1 ($client) must be of type %s|%s, %s given', self::class, ClientInterface::class, HttpAsyncClient::class, get_debug_type($client)) + ); + } + + $this->plugins = $plugins; + $this->options = $this->configure($options); + } + + /** + * {@inheritdoc} + */ + public function sendRequest(RequestInterface $request): ResponseInterface + { + // If the client doesn't support sync calls, call async + if (!$this->client instanceof ClientInterface) { + return $this->sendAsyncRequest($request)->wait(); + } + + // Else we want to use the synchronous call of the underlying client, + // and not the async one in the case we have both an async and sync call + $pluginChain = $this->createPluginChain($this->plugins, function (RequestInterface $request) { + try { + return new HttpFulfilledPromise($this->client->sendRequest($request)); + } catch (HttplugException $exception) { + return new HttpRejectedPromise($exception); + } + }); + + return $pluginChain($request)->wait(); + } + + /** + * {@inheritdoc} + */ + public function sendAsyncRequest(RequestInterface $request) + { + $pluginChain = $this->createPluginChain($this->plugins, function (RequestInterface $request) { + return $this->client->sendAsyncRequest($request); + }); + + return $pluginChain($request); + } + + /** + * Configure the plugin client. + */ + private function configure(array $options = []): array + { + $resolver = new OptionsResolver(); + $resolver->setDefaults([ + 'max_restarts' => 10, + ]); + + $resolver->setAllowedTypes('max_restarts', 'int'); + + return $resolver->resolve($options); + } + + /** + * Create the plugin chain. + * + * @param Plugin[] $plugins A plugin chain + * @param callable $clientCallable Callable making the HTTP call + * + * @return callable(RequestInterface): Promise + */ + private function createPluginChain(array $plugins, callable $clientCallable): callable + { + /** @var callable(RequestInterface): Promise */ + return new PluginChain($plugins, $clientCallable, $this->options); + } +} diff --git a/vendor/php-http/client-common/src/PluginClientBuilder.php b/vendor/php-http/client-common/src/PluginClientBuilder.php new file mode 100644 index 00000000..87464982 --- /dev/null +++ b/vendor/php-http/client-common/src/PluginClientBuilder.php @@ -0,0 +1,76 @@ + + */ +final class PluginClientBuilder +{ + /** @var Plugin[][] List of plugins ordered by priority [priority => Plugin[]]). */ + private $plugins = []; + + /** @var array Array of options to give to the plugin client */ + private $options = []; + + /** + * @param int $priority Priority of the plugin. The higher comes first. + */ + public function addPlugin(Plugin $plugin, int $priority = 0): self + { + $this->plugins[$priority][] = $plugin; + + return $this; + } + + /** + * @param mixed $value + */ + public function setOption(string $name, $value): self + { + $this->options[$name] = $value; + + return $this; + } + + public function removeOption(string $name): self + { + unset($this->options[$name]); + + return $this; + } + + /** + * @param ClientInterface|HttpAsyncClient $client + */ + public function createClient($client): PluginClient + { + if (!$client instanceof ClientInterface && !$client instanceof HttpAsyncClient) { + throw new \TypeError( + sprintf('%s::createClient(): Argument #1 ($client) must be of type %s|%s, %s given', self::class, ClientInterface::class, HttpAsyncClient::class, get_debug_type($client)) + ); + } + + $plugins = $this->plugins; + + if (0 === count($plugins)) { + $plugins[] = []; + } + + krsort($plugins); + $plugins = array_merge(...$plugins); + + return new PluginClient( + $client, + array_values($plugins), + $this->options + ); + } +} diff --git a/vendor/php-http/client-common/src/PluginClientFactory.php b/vendor/php-http/client-common/src/PluginClientFactory.php new file mode 100644 index 00000000..f7e93e37 --- /dev/null +++ b/vendor/php-http/client-common/src/PluginClientFactory.php @@ -0,0 +1,68 @@ + + */ +final class PluginClientFactory +{ + /** + * @var (callable(ClientInterface|HttpAsyncClient, Plugin[], array): PluginClient)|null + */ + private static $factory; + + /** + * Set the factory to use. + * The callable to provide must have the same arguments and return type as PluginClientFactory::createClient. + * This is used by the HTTPlugBundle to provide a better Symfony integration. + * Unlike the createClient method, this one is static to allow zero configuration profiling by hooking into early + * application execution. + * + * @internal + * + * @param callable(ClientInterface|HttpAsyncClient, Plugin[], array): PluginClient $factory + */ + public static function setFactory(callable $factory): void + { + static::$factory = $factory; + } + + /** + * @param ClientInterface|HttpAsyncClient $client + * @param Plugin[] $plugins + * @param array{'client_name'?: string} $options + * + * Configuration options: + * - client_name: to give client a name which may be used when displaying client information + * like in the HTTPlugBundle profiler. + * + * @see PluginClient constructor for PluginClient specific $options. + */ + public function createClient($client, array $plugins = [], array $options = []): PluginClient + { + if (!$client instanceof ClientInterface && !$client instanceof HttpAsyncClient) { + throw new \TypeError( + sprintf('%s::createClient(): Argument #1 ($client) must be of type %s|%s, %s given', self::class, ClientInterface::class, HttpAsyncClient::class, get_debug_type($client)) + ); + } + + if (static::$factory) { + $factory = static::$factory; + + return $factory($client, $plugins, $options); + } + + unset($options['client_name']); + + return new PluginClient($client, $plugins, $options); + } +} diff --git a/vendor/php-http/client-common/src/VersionBridgeClient.php b/vendor/php-http/client-common/src/VersionBridgeClient.php new file mode 100644 index 00000000..a608edd7 --- /dev/null +++ b/vendor/php-http/client-common/src/VersionBridgeClient.php @@ -0,0 +1,24 @@ + + */ +trait VersionBridgeClient +{ + abstract protected function doSendRequest(RequestInterface $request); + + public function sendRequest(RequestInterface $request): ResponseInterface + { + return $this->doSendRequest($request); + } +} diff --git a/vendor/php-http/discovery/CHANGELOG.md b/vendor/php-http/discovery/CHANGELOG.md new file mode 100644 index 00000000..f896866a --- /dev/null +++ b/vendor/php-http/discovery/CHANGELOG.md @@ -0,0 +1,315 @@ +# Change Log + +## 1.14.1 - 2021-09-18 + +- [#199](https://github.com/php-http/discovery/pull/199) - Fixes message factory discovery for `laminas-diactoros ^2.7` + +## 1.14.0 - 2021-06-21 + +- Deprecate puli as it has been unmaintained for a long time and is not compatible with composer 2 https://github.com/php-http/discovery/pull/195 + +## 1.13.0 - 2020-11-27 + +- Support discovering PSR-17 factories of `slim/psr7` package https://github.com/php-http/discovery/pull/192 + +## 1.12.0 - 2020-09-22 + +- Support discovering HttpClient of `php-http/guzzle7-adapter` https://github.com/php-http/discovery/pull/189 + +## 1.11.0 - 2020-09-22 + +- Use correct method name to find Uri Factory in PSR17 https://github.com/php-http/discovery/pull/181 + +## 1.10.0 - 2020-09-04 + +- Discover PSR-18 implementation of phalcon + +## 1.9.1 - 2020-07-13 + +### Fixed + +- Support PHP 7.4 and 8.0 + +## 1.9.0 - 2020-07-02 + +### Added + +- Support discovering PSR-18 factories of `guzzlehttp/guzzle` 7+ + +## 1.8.0 - 2020-06-14 + +### Added + +- Support discovering PSR-17 factories of `guzzlehttp/psr7` package +- Support discovering PSR-17 factories of `laminas/laminas-diactoros` package +- `ClassDiscovery::getStrategies()` to retrieve the list of current strategies. + +### Fixed + +- Ignore exception during discovery when Symfony HttplugClient checks if HTTPlug is available. + +## 1.7.4 - 2020-01-03 + +### Fixed + +- Improve conditions on Symfony's async HTTPlug client. + +## 1.7.3 - 2019-12-27 + +### Fixed + +- Enough conditions to only use Symfony HTTP client if all needed components are available. + +## 1.7.2 - 2019-12-27 + +### Fixed + +- Allow a condition to specify an interface and not just classes. + +## 1.7.1 - 2019-12-26 + +### Fixed + +- Better conditions to see if Symfony's HTTP clients are available. + +## 1.7.0 - 2019-06-30 + +### Added + +- Dropped support for PHP < 7.1 +- Support for `symfony/http-client` + +## 1.6.1 - 2019-02-23 + +### Fixed + +- MockClientStrategy also provides the mock client when requesting an async client + +## 1.6.0 - 2019-01-23 + +### Added + +- Support for PSR-17 factories +- Support for PSR-18 clients + +## 1.5.2 - 2018-12-31 + +Corrected mistakes in 1.5.1. The different between 1.5.2 and 1.5.0 is that +we removed some PHP 7 code. + +https://github.com/php-http/discovery/compare/1.5.0...1.5.2 + +## 1.5.1 - 2018-12-31 + +This version added new features by mistake. These are reverted in 1.5.2. + +Do not use 1.5.1. + +### Fixed + +- Removed PHP 7 code + +## 1.5.0 - 2018-12-30 + +### Added + +- Support for `nyholm/psr7` version 1.0. +- `ClassDiscovery::safeClassExists` which will help Magento users. +- Support for HTTPlug 2.0 +- Support for Buzz 1.0 +- Better error message when nothing found by introducing a new exception: `NoCandidateFoundException`. + +### Fixed + +- Fixed condition evaluation, it should stop after first invalid condition. + +## 1.4.0 - 2018-02-06 + +### Added + +- Discovery support for nyholm/psr7 + +## 1.3.0 - 2017-08-03 + +### Added + +- Discovery support for CakePHP adapter +- Discovery support for Zend adapter +- Discovery support for Artax adapter + +## 1.2.1 - 2017-03-02 + +### Fixed + +- Fixed minor issue with `MockClientStrategy`, also added more tests. + +## 1.2.0 - 2017-02-12 + +### Added + +- MockClientStrategy class. + +## 1.1.1 - 2016-11-27 + +### Changed + +- Made exception messages clearer. `StrategyUnavailableException` is no longer the previous exception to `DiscoveryFailedException`. +- `CommonClassesStrategy` is using `self` instead of `static`. Using `static` makes no sense when `CommonClassesStrategy` is final. + +## 1.1.0 - 2016-10-20 + +### Added + +- Discovery support for Slim Framework factories + +## 1.0.0 - 2016-07-18 + +### Added + +- Added back `Http\Discovery\NotFoundException` to preserve BC with 0.8 version. You may upgrade from 0.8.x and 0.9.x to 1.0.0 without any BC breaks. +- Added interface `Http\Discovery\Exception` which is implemented by all our exceptions + +### Changed + +- Puli strategy renamed to Puli Beta strategy to prevent incompatibility with a future Puli stable + +### Deprecated + +- For BC reasons, the old `Http\Discovery\NotFoundException` (extending the new exception) will be thrown until version 2.0 + + +## 0.9.1 - 2016-06-28 + +### Changed + +- Dropping PHP 5.4 support because we use the ::class constant. + + +## 0.9.0 - 2016-06-25 + +### Added + +- Discovery strategies to find classes + +### Changed + +- [Puli](http://puli.io) made optional +- Improved exceptions +- **[BC] `NotFoundException` moved to `Http\Discovery\Exception\NotFoundException`** + + +## 0.8.0 - 2016-02-11 + +### Changed + +- Puli composer plugin must be installed separately + + +## 0.7.0 - 2016-01-15 + +### Added + +- Temporary puli.phar (Beta 10) executable + +### Changed + +- Updated HTTPlug dependencies +- Updated Puli dependencies +- Local configuration to make tests passing + +### Removed + +- Puli CLI dependency + + +## 0.6.4 - 2016-01-07 + +### Fixed + +- Puli [not working](https://twitter.com/PuliPHP/status/685132540588507137) with the latest json-schema + + +## 0.6.3 - 2016-01-04 + +### Changed + +- Adjust Puli dependencies + + +## 0.6.2 - 2016-01-04 + +### Changed + +- Make Puli CLI a requirement + + +## 0.6.1 - 2016-01-03 + +### Changed + +- More flexible Puli requirement + + +## 0.6.0 - 2015-12-30 + +### Changed + +- Use [Puli](http://puli.io) for discovery +- Improved exception messages + + +## 0.5.0 - 2015-12-25 + +### Changed + +- Updated message factory dependency (php-http/message) + + +## 0.4.0 - 2015-12-17 + +### Added + +- Array condition evaluation in the Class Discovery + +### Removed + +- Message factories (moved to php-http/utils) + + +## 0.3.0 - 2015-11-18 + +### Added + +- HTTP Async Client Discovery +- Stream factories + +### Changed + +- Discoveries and Factories are final +- Message and Uri factories have the type in their names +- Diactoros Message factory uses Stream factory internally + +### Fixed + +- Improved docblocks for API documentation generation + + +## 0.2.0 - 2015-10-31 + +### Changed + +- Renamed AdapterDiscovery to ClientDiscovery + + +## 0.1.1 - 2015-06-13 + +### Fixed + +- Bad HTTP Adapter class name for Guzzle 5 + + +## 0.1.0 - 2015-06-12 + +### Added + +- Initial release diff --git a/vendor/php-http/discovery/LICENSE b/vendor/php-http/discovery/LICENSE new file mode 100644 index 00000000..4558d6f0 --- /dev/null +++ b/vendor/php-http/discovery/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-2016 PHP HTTP Team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/php-http/discovery/README.md b/vendor/php-http/discovery/README.md new file mode 100644 index 00000000..6a3d18bc --- /dev/null +++ b/vendor/php-http/discovery/README.md @@ -0,0 +1,46 @@ +# HTTPlug Discovery + +[![Latest Version](https://img.shields.io/github/release/php-http/discovery.svg?style=flat-square)](https://github.com/php-http/discovery/releases) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) +[![Build Status](https://img.shields.io/travis/php-http/discovery/master.svg?style=flat-square)](https://travis-ci.org/php-http/discovery) +[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/discovery.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/discovery) +[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/discovery.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/discovery) +[![Total Downloads](https://img.shields.io/packagist/dt/php-http/discovery.svg?style=flat-square)](https://packagist.org/packages/php-http/discovery) + +**Finds installed HTTPlug implementations and PSR-7 message factories.** + + +## Install + +Via Composer + +``` bash +$ composer require php-http/discovery +``` + + +## Documentation + +Please see the [official documentation](http://php-http.readthedocs.org/en/latest/discovery.html). + + +## Testing + +``` bash +$ composer test +``` + + +## Contributing + +Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html). + + +## Security + +If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). + + +## License + +The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/discovery/composer.json b/vendor/php-http/discovery/composer.json new file mode 100644 index 00000000..5ded29e1 --- /dev/null +++ b/vendor/php-http/discovery/composer.json @@ -0,0 +1,50 @@ +{ + "name": "php-http/discovery", + "description": "Finds installed HTTPlug implementations and PSR-7 message factories", + "license": "MIT", + "keywords": ["http", "discovery", "client", "adapter", "message", "factory", "psr7"], + "homepage": "http://php-http.org", + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "graham-campbell/phpspec-skip-example-extension": "^5.0", + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^5.1 || ^6.1", + "puli/composer-plugin": "1.0.0-beta10" + }, + "suggest": { + "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories" + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "spec\\Http\\Discovery\\": "spec/" + } + }, + "scripts": { + "test": "vendor/bin/phpspec run", + "test-ci": "vendor/bin/phpspec run -c phpspec.ci.yml" + }, + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "conflict": { + "nyholm/psr7": "<1.0" + }, + "prefer-stable": true, + "minimum-stability": "beta" +} diff --git a/vendor/php-http/discovery/src/ClassDiscovery.php b/vendor/php-http/discovery/src/ClassDiscovery.php new file mode 100644 index 00000000..43529850 --- /dev/null +++ b/vendor/php-http/discovery/src/ClassDiscovery.php @@ -0,0 +1,252 @@ + + * @author Márk Sági-Kazár + * @author Tobias Nyholm + */ +abstract class ClassDiscovery +{ + /** + * A list of strategies to find classes. + * + * @var array + */ + private static $strategies = [ + Strategy\CommonClassesStrategy::class, + Strategy\CommonPsr17ClassesStrategy::class, + Strategy\PuliBetaStrategy::class, + ]; + + private static $deprecatedStrategies = [ + Strategy\PuliBetaStrategy::class => true, + ]; + + /** + * Discovery cache to make the second time we use discovery faster. + * + * @var array + */ + private static $cache = []; + + /** + * Finds a class. + * + * @param string $type + * + * @return string|\Closure + * + * @throws DiscoveryFailedException + */ + protected static function findOneByType($type) + { + // Look in the cache + if (null !== ($class = self::getFromCache($type))) { + return $class; + } + + $exceptions = []; + foreach (self::$strategies as $strategy) { + try { + $candidates = call_user_func($strategy.'::getCandidates', $type); + } catch (StrategyUnavailableException $e) { + if (!isset(self::$deprecatedStrategies[$strategy])) { + $exceptions[] = $e; + } + + continue; + } + + foreach ($candidates as $candidate) { + if (isset($candidate['condition'])) { + if (!self::evaluateCondition($candidate['condition'])) { + continue; + } + } + + // save the result for later use + self::storeInCache($type, $candidate); + + return $candidate['class']; + } + + $exceptions[] = new NoCandidateFoundException($strategy, $candidates); + } + + throw DiscoveryFailedException::create($exceptions); + } + + /** + * Get a value from cache. + * + * @param string $type + * + * @return string|null + */ + private static function getFromCache($type) + { + if (!isset(self::$cache[$type])) { + return; + } + + $candidate = self::$cache[$type]; + if (isset($candidate['condition'])) { + if (!self::evaluateCondition($candidate['condition'])) { + return; + } + } + + return $candidate['class']; + } + + /** + * Store a value in cache. + * + * @param string $type + * @param string $class + */ + private static function storeInCache($type, $class) + { + self::$cache[$type] = $class; + } + + /** + * Set new strategies and clear the cache. + * + * @param array $strategies string array of fully qualified class name to a DiscoveryStrategy + */ + public static function setStrategies(array $strategies) + { + self::$strategies = $strategies; + self::clearCache(); + } + + /** + * Returns the currently configured discovery strategies as fully qualified class names. + * + * @return string[] + */ + public static function getStrategies(): iterable + { + return self::$strategies; + } + + /** + * Append a strategy at the end of the strategy queue. + * + * @param string $strategy Fully qualified class name to a DiscoveryStrategy + */ + public static function appendStrategy($strategy) + { + self::$strategies[] = $strategy; + self::clearCache(); + } + + /** + * Prepend a strategy at the beginning of the strategy queue. + * + * @param string $strategy Fully qualified class name to a DiscoveryStrategy + */ + public static function prependStrategy($strategy) + { + array_unshift(self::$strategies, $strategy); + self::clearCache(); + } + + /** + * Clear the cache. + */ + public static function clearCache() + { + self::$cache = []; + } + + /** + * Evaluates conditions to boolean. + * + * @param mixed $condition + * + * @return bool + */ + protected static function evaluateCondition($condition) + { + if (is_string($condition)) { + // Should be extended for functions, extensions??? + return self::safeClassExists($condition); + } + if (is_callable($condition)) { + return (bool) $condition(); + } + if (is_bool($condition)) { + return $condition; + } + if (is_array($condition)) { + foreach ($condition as $c) { + if (false === static::evaluateCondition($c)) { + // Immediately stop execution if the condition is false + return false; + } + } + + return true; + } + + return false; + } + + /** + * Get an instance of the $class. + * + * @param string|\Closure $class A FQCN of a class or a closure that instantiate the class. + * + * @return object + * + * @throws ClassInstantiationFailedException + */ + protected static function instantiateClass($class) + { + try { + if (is_string($class)) { + return new $class(); + } + + if (is_callable($class)) { + return $class(); + } + } catch (\Exception $e) { + throw new ClassInstantiationFailedException('Unexpected exception when instantiating class.', 0, $e); + } + + throw new ClassInstantiationFailedException('Could not instantiate class because parameter is neither a callable nor a string'); + } + + /** + * We want to do a "safe" version of PHP's "class_exists" because Magento has a bug + * (or they call it a "feature"). Magento is throwing an exception if you do class_exists() + * on a class that ends with "Factory" and if that file does not exits. + * + * This function will catch all potential exceptions and make sure it returns a boolean. + * + * @param string $class + * @param bool $autoload + * + * @return bool + */ + public static function safeClassExists($class) + { + try { + return class_exists($class) || interface_exists($class); + } catch (\Exception $e) { + return false; + } + } +} diff --git a/vendor/php-http/discovery/src/Exception.php b/vendor/php-http/discovery/src/Exception.php new file mode 100644 index 00000000..973c9087 --- /dev/null +++ b/vendor/php-http/discovery/src/Exception.php @@ -0,0 +1,12 @@ + + */ +interface Exception +{ +} diff --git a/vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php b/vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php new file mode 100644 index 00000000..e95bf5d8 --- /dev/null +++ b/vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php @@ -0,0 +1,14 @@ + + */ +final class ClassInstantiationFailedException extends \RuntimeException implements Exception +{ +} diff --git a/vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php b/vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php new file mode 100644 index 00000000..304b7276 --- /dev/null +++ b/vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php @@ -0,0 +1,51 @@ + + */ +final class DiscoveryFailedException extends \Exception implements Exception +{ + /** + * @var \Exception[] + */ + private $exceptions; + + /** + * @param string $message + * @param \Exception[] $exceptions + */ + public function __construct($message, array $exceptions = []) + { + $this->exceptions = $exceptions; + + parent::__construct($message); + } + + /** + * @param \Exception[] $exceptions + */ + public static function create($exceptions) + { + $message = 'Could not find resource using any discovery strategy. Find more information at http://docs.php-http.org/en/latest/discovery.html#common-errors'; + foreach ($exceptions as $e) { + $message .= "\n - ".$e->getMessage(); + } + $message .= "\n\n"; + + return new self($message, $exceptions); + } + + /** + * @return \Exception[] + */ + public function getExceptions() + { + return $this->exceptions; + } +} diff --git a/vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php b/vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php new file mode 100644 index 00000000..32f65db7 --- /dev/null +++ b/vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php @@ -0,0 +1,47 @@ + + */ +final class NoCandidateFoundException extends \Exception implements Exception +{ + /** + * @param string $strategy + */ + public function __construct($strategy, array $candidates) + { + $classes = array_map( + function ($a) { + return $a['class']; + }, + $candidates + ); + + $message = sprintf( + 'No valid candidate found using strategy "%s". We tested the following candidates: %s.', + $strategy, + implode(', ', array_map([$this, 'stringify'], $classes)) + ); + + parent::__construct($message); + } + + private function stringify($mixed) + { + if (is_string($mixed)) { + return $mixed; + } + + if (is_array($mixed) && 2 === count($mixed)) { + return sprintf('%s::%s', $this->stringify($mixed[0]), $mixed[1]); + } + + return is_object($mixed) ? get_class($mixed) : gettype($mixed); + } +} diff --git a/vendor/php-http/discovery/src/Exception/NotFoundException.php b/vendor/php-http/discovery/src/Exception/NotFoundException.php new file mode 100644 index 00000000..befbf488 --- /dev/null +++ b/vendor/php-http/discovery/src/Exception/NotFoundException.php @@ -0,0 +1,16 @@ + + */ +/*final */class NotFoundException extends \RuntimeException implements Exception +{ +} diff --git a/vendor/php-http/discovery/src/Exception/PuliUnavailableException.php b/vendor/php-http/discovery/src/Exception/PuliUnavailableException.php new file mode 100644 index 00000000..a6ade733 --- /dev/null +++ b/vendor/php-http/discovery/src/Exception/PuliUnavailableException.php @@ -0,0 +1,12 @@ + + */ +final class PuliUnavailableException extends StrategyUnavailableException +{ +} diff --git a/vendor/php-http/discovery/src/Exception/StrategyUnavailableException.php b/vendor/php-http/discovery/src/Exception/StrategyUnavailableException.php new file mode 100644 index 00000000..89ecf352 --- /dev/null +++ b/vendor/php-http/discovery/src/Exception/StrategyUnavailableException.php @@ -0,0 +1,15 @@ + + */ +class StrategyUnavailableException extends \RuntimeException implements Exception +{ +} diff --git a/vendor/php-http/discovery/src/HttpAsyncClientDiscovery.php b/vendor/php-http/discovery/src/HttpAsyncClientDiscovery.php new file mode 100644 index 00000000..a0c4d5b7 --- /dev/null +++ b/vendor/php-http/discovery/src/HttpAsyncClientDiscovery.php @@ -0,0 +1,32 @@ + + */ +final class HttpAsyncClientDiscovery extends ClassDiscovery +{ + /** + * Finds an HTTP Async Client. + * + * @return HttpAsyncClient + * + * @throws Exception\NotFoundException + */ + public static function find() + { + try { + $asyncClient = static::findOneByType(HttpAsyncClient::class); + } catch (DiscoveryFailedException $e) { + throw new NotFoundException('No HTTPlug async clients found. Make sure to install a package providing "php-http/async-client-implementation". Example: "php-http/guzzle6-adapter".', 0, $e); + } + + return static::instantiateClass($asyncClient); + } +} diff --git a/vendor/php-http/discovery/src/HttpClientDiscovery.php b/vendor/php-http/discovery/src/HttpClientDiscovery.php new file mode 100644 index 00000000..2072b94d --- /dev/null +++ b/vendor/php-http/discovery/src/HttpClientDiscovery.php @@ -0,0 +1,32 @@ + + */ +final class HttpClientDiscovery extends ClassDiscovery +{ + /** + * Finds an HTTP Client. + * + * @return HttpClient + * + * @throws Exception\NotFoundException + */ + public static function find() + { + try { + $client = static::findOneByType(HttpClient::class); + } catch (DiscoveryFailedException $e) { + throw new NotFoundException('No HTTPlug clients found. Make sure to install a package providing "php-http/client-implementation". Example: "php-http/guzzle6-adapter".', 0, $e); + } + + return static::instantiateClass($client); + } +} diff --git a/vendor/php-http/discovery/src/MessageFactoryDiscovery.php b/vendor/php-http/discovery/src/MessageFactoryDiscovery.php new file mode 100644 index 00000000..659916dc --- /dev/null +++ b/vendor/php-http/discovery/src/MessageFactoryDiscovery.php @@ -0,0 +1,34 @@ + + * + * @deprecated This will be removed in 2.0. Consider using Psr17FactoryDiscovery. + */ +final class MessageFactoryDiscovery extends ClassDiscovery +{ + /** + * Finds a Message Factory. + * + * @return MessageFactory + * + * @throws Exception\NotFoundException + */ + public static function find() + { + try { + $messageFactory = static::findOneByType(MessageFactory::class); + } catch (DiscoveryFailedException $e) { + throw new NotFoundException('No message factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message and the chosen message implementation.', 0, $e); + } + + return static::instantiateClass($messageFactory); + } +} diff --git a/vendor/php-http/discovery/src/NotFoundException.php b/vendor/php-http/discovery/src/NotFoundException.php new file mode 100644 index 00000000..d59dadbf --- /dev/null +++ b/vendor/php-http/discovery/src/NotFoundException.php @@ -0,0 +1,14 @@ + + * + * @deprecated since since version 1.0, and will be removed in 2.0. Use {@link \Http\Discovery\Exception\NotFoundException} instead. + */ +final class NotFoundException extends \Http\Discovery\Exception\NotFoundException +{ +} diff --git a/vendor/php-http/discovery/src/Psr17FactoryDiscovery.php b/vendor/php-http/discovery/src/Psr17FactoryDiscovery.php new file mode 100644 index 00000000..a73c6414 --- /dev/null +++ b/vendor/php-http/discovery/src/Psr17FactoryDiscovery.php @@ -0,0 +1,136 @@ + + */ +final class Psr17FactoryDiscovery extends ClassDiscovery +{ + private static function createException($type, Exception $e) + { + return new \Http\Discovery\Exception\NotFoundException( + 'No PSR-17 '.$type.' found. Install a package from this list: https://packagist.org/providers/psr/http-factory-implementation', + 0, + $e + ); + } + + /** + * @return RequestFactoryInterface + * + * @throws Exception\NotFoundException + */ + public static function findRequestFactory() + { + try { + $messageFactory = static::findOneByType(RequestFactoryInterface::class); + } catch (DiscoveryFailedException $e) { + throw self::createException('request factory', $e); + } + + return static::instantiateClass($messageFactory); + } + + /** + * @return ResponseFactoryInterface + * + * @throws Exception\NotFoundException + */ + public static function findResponseFactory() + { + try { + $messageFactory = static::findOneByType(ResponseFactoryInterface::class); + } catch (DiscoveryFailedException $e) { + throw self::createException('response factory', $e); + } + + return static::instantiateClass($messageFactory); + } + + /** + * @return ServerRequestFactoryInterface + * + * @throws Exception\NotFoundException + */ + public static function findServerRequestFactory() + { + try { + $messageFactory = static::findOneByType(ServerRequestFactoryInterface::class); + } catch (DiscoveryFailedException $e) { + throw self::createException('server request factory', $e); + } + + return static::instantiateClass($messageFactory); + } + + /** + * @return StreamFactoryInterface + * + * @throws Exception\NotFoundException + */ + public static function findStreamFactory() + { + try { + $messageFactory = static::findOneByType(StreamFactoryInterface::class); + } catch (DiscoveryFailedException $e) { + throw self::createException('stream factory', $e); + } + + return static::instantiateClass($messageFactory); + } + + /** + * @return UploadedFileFactoryInterface + * + * @throws Exception\NotFoundException + */ + public static function findUploadedFileFactory() + { + try { + $messageFactory = static::findOneByType(UploadedFileFactoryInterface::class); + } catch (DiscoveryFailedException $e) { + throw self::createException('uploaded file factory', $e); + } + + return static::instantiateClass($messageFactory); + } + + /** + * @return UriFactoryInterface + * + * @throws Exception\NotFoundException + */ + public static function findUriFactory() + { + try { + $messageFactory = static::findOneByType(UriFactoryInterface::class); + } catch (DiscoveryFailedException $e) { + throw self::createException('url factory', $e); + } + + return static::instantiateClass($messageFactory); + } + + /** + * @return UriFactoryInterface + * + * @throws Exception\NotFoundException + * + * @deprecated This will be removed in 2.0. Consider using the findUriFactory() method. + */ + public static function findUrlFactory() + { + return static::findUriFactory(); + } +} diff --git a/vendor/php-http/discovery/src/Psr18ClientDiscovery.php b/vendor/php-http/discovery/src/Psr18ClientDiscovery.php new file mode 100644 index 00000000..7fcdb17a --- /dev/null +++ b/vendor/php-http/discovery/src/Psr18ClientDiscovery.php @@ -0,0 +1,32 @@ + + */ +final class Psr18ClientDiscovery extends ClassDiscovery +{ + /** + * Finds a PSR-18 HTTP Client. + * + * @return ClientInterface + * + * @throws Exception\NotFoundException + */ + public static function find() + { + try { + $client = static::findOneByType(ClientInterface::class); + } catch (DiscoveryFailedException $e) { + throw new \Http\Discovery\Exception\NotFoundException('No PSR-18 clients found. Make sure to install a package providing "psr/http-client-implementation". Example: "php-http/guzzle6-adapter".', 0, $e); + } + + return static::instantiateClass($client); + } +} diff --git a/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php b/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php new file mode 100644 index 00000000..e82bcb1d --- /dev/null +++ b/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php @@ -0,0 +1,185 @@ + + */ +final class CommonClassesStrategy implements DiscoveryStrategy +{ + /** + * @var array + */ + private static $classes = [ + MessageFactory::class => [ + ['class' => NyholmHttplugFactory::class, 'condition' => [NyholmHttplugFactory::class]], + ['class' => GuzzleMessageFactory::class, 'condition' => [GuzzleRequest::class, GuzzleMessageFactory::class]], + ['class' => DiactorosMessageFactory::class, 'condition' => [ZendDiactorosRequest::class, DiactorosMessageFactory::class]], + ['class' => DiactorosMessageFactory::class, 'condition' => [DiactorosRequest::class, DiactorosMessageFactory::class]], + ['class' => SlimMessageFactory::class, 'condition' => [SlimRequest::class, SlimMessageFactory::class]], + ], + StreamFactory::class => [ + ['class' => NyholmHttplugFactory::class, 'condition' => [NyholmHttplugFactory::class]], + ['class' => GuzzleStreamFactory::class, 'condition' => [GuzzleRequest::class, GuzzleStreamFactory::class]], + ['class' => DiactorosStreamFactory::class, 'condition' => [ZendDiactorosRequest::class, DiactorosStreamFactory::class]], + ['class' => DiactorosStreamFactory::class, 'condition' => [DiactorosRequest::class, DiactorosStreamFactory::class]], + ['class' => SlimStreamFactory::class, 'condition' => [SlimRequest::class, SlimStreamFactory::class]], + ], + UriFactory::class => [ + ['class' => NyholmHttplugFactory::class, 'condition' => [NyholmHttplugFactory::class]], + ['class' => GuzzleUriFactory::class, 'condition' => [GuzzleRequest::class, GuzzleUriFactory::class]], + ['class' => DiactorosUriFactory::class, 'condition' => [ZendDiactorosRequest::class, DiactorosUriFactory::class]], + ['class' => DiactorosUriFactory::class, 'condition' => [DiactorosRequest::class, DiactorosUriFactory::class]], + ['class' => SlimUriFactory::class, 'condition' => [SlimRequest::class, SlimUriFactory::class]], + ], + HttpAsyncClient::class => [ + ['class' => SymfonyHttplug::class, 'condition' => [SymfonyHttplug::class, Promise::class, RequestFactory::class, [self::class, 'isPsr17FactoryInstalled']]], + ['class' => Guzzle7::class, 'condition' => Guzzle7::class], + ['class' => Guzzle6::class, 'condition' => Guzzle6::class], + ['class' => Curl::class, 'condition' => Curl::class], + ['class' => React::class, 'condition' => React::class], + ], + HttpClient::class => [ + ['class' => SymfonyHttplug::class, 'condition' => [SymfonyHttplug::class, RequestFactory::class, [self::class, 'isPsr17FactoryInstalled']]], + ['class' => Guzzle7::class, 'condition' => Guzzle7::class], + ['class' => Guzzle6::class, 'condition' => Guzzle6::class], + ['class' => Guzzle5::class, 'condition' => Guzzle5::class], + ['class' => Curl::class, 'condition' => Curl::class], + ['class' => Socket::class, 'condition' => Socket::class], + ['class' => Buzz::class, 'condition' => Buzz::class], + ['class' => React::class, 'condition' => React::class], + ['class' => Cake::class, 'condition' => Cake::class], + ['class' => Zend::class, 'condition' => Zend::class], + ['class' => Artax::class, 'condition' => Artax::class], + [ + 'class' => [self::class, 'buzzInstantiate'], + 'condition' => [\Buzz\Client\FileGetContents::class, \Buzz\Message\ResponseBuilder::class], + ], + ], + Psr18Client::class => [ + [ + 'class' => [self::class, 'symfonyPsr18Instantiate'], + 'condition' => [SymfonyPsr18::class, Psr17RequestFactory::class], + ], + [ + 'class' => GuzzleHttp::class, + 'condition' => [self::class, 'isGuzzleImplementingPsr18'], + ], + [ + 'class' => [self::class, 'buzzInstantiate'], + 'condition' => [\Buzz\Client\FileGetContents::class, \Buzz\Message\ResponseBuilder::class], + ], + ], + ]; + + /** + * {@inheritdoc} + */ + public static function getCandidates($type) + { + if (Psr18Client::class === $type) { + return self::getPsr18Candidates(); + } + + return self::$classes[$type] ?? []; + } + + /** + * @return array The return value is always an array with zero or more elements. Each + * element is an array with two keys ['class' => string, 'condition' => mixed]. + */ + private static function getPsr18Candidates() + { + $candidates = self::$classes[Psr18Client::class]; + + // HTTPlug 2.0 clients implements PSR18Client too. + foreach (self::$classes[HttpClient::class] as $c) { + try { + if (is_subclass_of($c['class'], Psr18Client::class)) { + $candidates[] = $c; + } + } catch (\Throwable $e) { + trigger_error(sprintf('Got exception "%s (%s)" while checking if a PSR-18 Client is available', get_class($e), $e->getMessage()), E_USER_WARNING); + } + } + + return $candidates; + } + + public static function buzzInstantiate() + { + return new \Buzz\Client\FileGetContents(MessageFactoryDiscovery::find()); + } + + public static function symfonyPsr18Instantiate() + { + return new SymfonyPsr18(null, Psr17FactoryDiscovery::findResponseFactory(), Psr17FactoryDiscovery::findStreamFactory()); + } + + public static function isGuzzleImplementingPsr18() + { + return defined('GuzzleHttp\ClientInterface::MAJOR_VERSION'); + } + + /** + * Can be used as a condition. + * + * @return bool + */ + public static function isPsr17FactoryInstalled() + { + try { + Psr17FactoryDiscovery::findResponseFactory(); + } catch (NotFoundException $e) { + return false; + } catch (\Throwable $e) { + trigger_error(sprintf('Got exception "%s (%s)" while checking if a PSR-17 ResponseFactory is available', get_class($e), $e->getMessage()), E_USER_WARNING); + + return false; + } + + return true; + } +} diff --git a/vendor/php-http/discovery/src/Strategy/CommonPsr17ClassesStrategy.php b/vendor/php-http/discovery/src/Strategy/CommonPsr17ClassesStrategy.php new file mode 100644 index 00000000..fc26778f --- /dev/null +++ b/vendor/php-http/discovery/src/Strategy/CommonPsr17ClassesStrategy.php @@ -0,0 +1,105 @@ + + */ +final class CommonPsr17ClassesStrategy implements DiscoveryStrategy +{ + /** + * @var array + */ + private static $classes = [ + RequestFactoryInterface::class => [ + 'Phalcon\Http\Message\RequestFactory', + 'Nyholm\Psr7\Factory\Psr17Factory', + 'Zend\Diactoros\RequestFactory', + 'GuzzleHttp\Psr7\HttpFactory', + 'Http\Factory\Diactoros\RequestFactory', + 'Http\Factory\Guzzle\RequestFactory', + 'Http\Factory\Slim\RequestFactory', + 'Laminas\Diactoros\RequestFactory', + 'Slim\Psr7\Factory\RequestFactory', + ], + ResponseFactoryInterface::class => [ + 'Phalcon\Http\Message\ResponseFactory', + 'Nyholm\Psr7\Factory\Psr17Factory', + 'Zend\Diactoros\ResponseFactory', + 'GuzzleHttp\Psr7\HttpFactory', + 'Http\Factory\Diactoros\ResponseFactory', + 'Http\Factory\Guzzle\ResponseFactory', + 'Http\Factory\Slim\ResponseFactory', + 'Laminas\Diactoros\ResponseFactory', + 'Slim\Psr7\Factory\ResponseFactory', + ], + ServerRequestFactoryInterface::class => [ + 'Phalcon\Http\Message\ServerRequestFactory', + 'Nyholm\Psr7\Factory\Psr17Factory', + 'Zend\Diactoros\ServerRequestFactory', + 'GuzzleHttp\Psr7\HttpFactory', + 'Http\Factory\Diactoros\ServerRequestFactory', + 'Http\Factory\Guzzle\ServerRequestFactory', + 'Http\Factory\Slim\ServerRequestFactory', + 'Laminas\Diactoros\ServerRequestFactory', + 'Slim\Psr7\Factory\ServerRequestFactory', + ], + StreamFactoryInterface::class => [ + 'Phalcon\Http\Message\StreamFactory', + 'Nyholm\Psr7\Factory\Psr17Factory', + 'Zend\Diactoros\StreamFactory', + 'GuzzleHttp\Psr7\HttpFactory', + 'Http\Factory\Diactoros\StreamFactory', + 'Http\Factory\Guzzle\StreamFactory', + 'Http\Factory\Slim\StreamFactory', + 'Laminas\Diactoros\StreamFactory', + 'Slim\Psr7\Factory\StreamFactory', + ], + UploadedFileFactoryInterface::class => [ + 'Phalcon\Http\Message\UploadedFileFactory', + 'Nyholm\Psr7\Factory\Psr17Factory', + 'Zend\Diactoros\UploadedFileFactory', + 'GuzzleHttp\Psr7\HttpFactory', + 'Http\Factory\Diactoros\UploadedFileFactory', + 'Http\Factory\Guzzle\UploadedFileFactory', + 'Http\Factory\Slim\UploadedFileFactory', + 'Laminas\Diactoros\UploadedFileFactory', + 'Slim\Psr7\Factory\UploadedFileFactory', + ], + UriFactoryInterface::class => [ + 'Phalcon\Http\Message\UriFactory', + 'Nyholm\Psr7\Factory\Psr17Factory', + 'Zend\Diactoros\UriFactory', + 'GuzzleHttp\Psr7\HttpFactory', + 'Http\Factory\Diactoros\UriFactory', + 'Http\Factory\Guzzle\UriFactory', + 'Http\Factory\Slim\UriFactory', + 'Laminas\Diactoros\UriFactory', + 'Slim\Psr7\Factory\UriFactory', + ], + ]; + + /** + * {@inheritdoc} + */ + public static function getCandidates($type) + { + $candidates = []; + if (isset(self::$classes[$type])) { + foreach (self::$classes[$type] as $class) { + $candidates[] = ['class' => $class, 'condition' => [$class]]; + } + } + + return $candidates; + } +} diff --git a/vendor/php-http/discovery/src/Strategy/DiscoveryStrategy.php b/vendor/php-http/discovery/src/Strategy/DiscoveryStrategy.php new file mode 100644 index 00000000..641485a6 --- /dev/null +++ b/vendor/php-http/discovery/src/Strategy/DiscoveryStrategy.php @@ -0,0 +1,23 @@ + + */ +interface DiscoveryStrategy +{ + /** + * Find a resource of a specific type. + * + * @param string $type + * + * @return array The return value is always an array with zero or more elements. Each + * element is an array with two keys ['class' => string, 'condition' => mixed]. + * + * @throws StrategyUnavailableException if we cannot use this strategy. + */ + public static function getCandidates($type); +} diff --git a/vendor/php-http/discovery/src/Strategy/MockClientStrategy.php b/vendor/php-http/discovery/src/Strategy/MockClientStrategy.php new file mode 100644 index 00000000..0cee3f7e --- /dev/null +++ b/vendor/php-http/discovery/src/Strategy/MockClientStrategy.php @@ -0,0 +1,27 @@ + + */ +final class MockClientStrategy implements DiscoveryStrategy +{ + /** + * {@inheritdoc} + */ + public static function getCandidates($type) + { + if (is_a(HttpClient::class, $type, true) || is_a(HttpAsyncClient::class, $type, true)) { + return [['class' => Mock::class, 'condition' => Mock::class]]; + } + + return []; + } +} diff --git a/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php b/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php new file mode 100644 index 00000000..c1e1fb7e --- /dev/null +++ b/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php @@ -0,0 +1,92 @@ + + * @author Márk Sági-Kazár + */ +class PuliBetaStrategy implements DiscoveryStrategy +{ + /** + * @var GeneratedPuliFactory + */ + protected static $puliFactory; + + /** + * @var Discovery + */ + protected static $puliDiscovery; + + /** + * @return GeneratedPuliFactory + * + * @throws PuliUnavailableException + */ + private static function getPuliFactory() + { + if (null === self::$puliFactory) { + if (!defined('PULI_FACTORY_CLASS')) { + throw new PuliUnavailableException('Puli Factory is not available'); + } + + $puliFactoryClass = PULI_FACTORY_CLASS; + + if (!ClassDiscovery::safeClassExists($puliFactoryClass)) { + throw new PuliUnavailableException('Puli Factory class does not exist'); + } + + self::$puliFactory = new $puliFactoryClass(); + } + + return self::$puliFactory; + } + + /** + * Returns the Puli discovery layer. + * + * @return Discovery + * + * @throws PuliUnavailableException + */ + private static function getPuliDiscovery() + { + if (!isset(self::$puliDiscovery)) { + $factory = self::getPuliFactory(); + $repository = $factory->createRepository(); + + self::$puliDiscovery = $factory->createDiscovery($repository); + } + + return self::$puliDiscovery; + } + + /** + * {@inheritdoc} + */ + public static function getCandidates($type) + { + $returnData = []; + $bindings = self::getPuliDiscovery()->findBindings($type); + + foreach ($bindings as $binding) { + $condition = true; + if ($binding->hasParameterValue('depends')) { + $condition = $binding->getParameterValue('depends'); + } + $returnData[] = ['class' => $binding->getClassName(), 'condition' => $condition]; + } + + return $returnData; + } +} diff --git a/vendor/php-http/discovery/src/StreamFactoryDiscovery.php b/vendor/php-http/discovery/src/StreamFactoryDiscovery.php new file mode 100644 index 00000000..e11c49ae --- /dev/null +++ b/vendor/php-http/discovery/src/StreamFactoryDiscovery.php @@ -0,0 +1,34 @@ + + * + * @deprecated This will be removed in 2.0. Consider using Psr17FactoryDiscovery. + */ +final class StreamFactoryDiscovery extends ClassDiscovery +{ + /** + * Finds a Stream Factory. + * + * @return StreamFactory + * + * @throws Exception\NotFoundException + */ + public static function find() + { + try { + $streamFactory = static::findOneByType(StreamFactory::class); + } catch (DiscoveryFailedException $e) { + throw new NotFoundException('No stream factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message and the chosen message implementation.', 0, $e); + } + + return static::instantiateClass($streamFactory); + } +} diff --git a/vendor/php-http/discovery/src/UriFactoryDiscovery.php b/vendor/php-http/discovery/src/UriFactoryDiscovery.php new file mode 100644 index 00000000..db3add20 --- /dev/null +++ b/vendor/php-http/discovery/src/UriFactoryDiscovery.php @@ -0,0 +1,34 @@ + + * + * @deprecated This will be removed in 2.0. Consider using Psr17FactoryDiscovery. + */ +final class UriFactoryDiscovery extends ClassDiscovery +{ + /** + * Finds a URI Factory. + * + * @return UriFactory + * + * @throws Exception\NotFoundException + */ + public static function find() + { + try { + $uriFactory = static::findOneByType(UriFactory::class); + } catch (DiscoveryFailedException $e) { + throw new NotFoundException('No uri factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message and the chosen message implementation.', 0, $e); + } + + return static::instantiateClass($uriFactory); + } +} diff --git a/vendor/php-http/httplug/CHANGELOG.md b/vendor/php-http/httplug/CHANGELOG.md new file mode 100644 index 00000000..29b03e0c --- /dev/null +++ b/vendor/php-http/httplug/CHANGELOG.md @@ -0,0 +1,129 @@ +# Change Log + + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + + +## [Unreleased] + +## [2.2.0] - 2020-07-13 + +### Changed + +- Support PHP 7.1-8.0 + +## [2.1.0] - 2019-12-27 + +### Changed + +- `Http\Client\Exception\NetworkException` no longer extends `Http\Client\Exception\RequestException`, + in accordance with [PSR-18](https://www.php-fig.org/psr/psr-18/) + +## [2.0.0] - 2018-10-31 + +This version is no BC break for consumers using HTTPlug. However, HTTP clients that +implement HTTPlug need to adjust because we add return type declarations. + +### Added + +- Support for PSR-18 (HTTP client). + +### Changed + +- **BC Break:** `HttpClient::sendRequest(RequestInterface $request)` has a return type annotation. The new +signature is `HttpClient::sendRequest(RequestInterface $request): ResponseInterface`. +- **BC Break:** `RequestException::getRequest()` has a return type annotation. The new +signature is `RequestException::getRequest(): RequestInterface`. + +### Removed + +- PHP 5 support + + +## [1.1.0] - 2016-08-31 + +### Added + +- HttpFulfilledPromise and HttpRejectedPromise which respect the HttpAsyncClient interface + + +## [1.0.0] - 2016-01-26 + +### Removed + +- Stability configuration from composer + + +## [1.0.0-RC1] - 2016-01-12 + +### Changed + +- Updated package files +- Updated promise dependency to RC1 + + +## [1.0.0-beta] - 2015-12-17 + +### Added + +- Puli configuration and binding types + +### Changed + +- Exception concept + + +## [1.0.0-alpha3] - 2015-12-13 + +### Changed + +- Async client does not throw exceptions + +### Removed + +- Promise interface moved to its own repository: [php-http/promise](https://github.com/php-http/promise) + + +## [1.0.0-alpha2] - 2015-11-16 + +### Added + +- Async client and Promise interface + + +## [1.0.0-alpha] - 2015-10-26 + +### Added + +- Better domain exceptions. + +### Changed + +- Purpose of the library: general HTTP CLient abstraction. + +### Removed + +- Request options: they should be configured at construction time. +- Multiple request sending: should be done asynchronously using Async Client. +- `getName` method + + +## 0.1.0 - 2015-06-03 + +### Added + +- Initial release + + +[Unreleased]: https://github.com/php-http/httplug/compare/v2.0.0...HEAD +[2.0.0]: https://github.com/php-http/httplug/compare/v1.1.0...HEAD +[1.1.0]: https://github.com/php-http/httplug/compare/v1.0.0...v1.1.0 +[1.0.0]: https://github.com/php-http/httplug/compare/v1.0.0-RC1...v1.0.0 +[1.0.0-RC1]: https://github.com/php-http/httplug/compare/v1.0.0-beta...v1.0.0-RC1 +[1.0.0-beta]: https://github.com/php-http/httplug/compare/v1.0.0-alpha3...v1.0.0-beta +[1.0.0-alpha3]: https://github.com/php-http/httplug/compare/v1.0.0-alpha2...v1.0.0-alpha3 +[1.0.0-alpha2]: https://github.com/php-http/httplug/compare/v1.0.0-alpha...v1.0.0-alpha2 +[1.0.0-alpha]: https://github.com/php-http/httplug/compare/v0.1.0...v1.0.0-alpha diff --git a/vendor/php-http/httplug/LICENSE b/vendor/php-http/httplug/LICENSE new file mode 100644 index 00000000..8cd264c6 --- /dev/null +++ b/vendor/php-http/httplug/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2014 Eric GELOEN +Copyright (c) 2015 PHP HTTP Team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/php-http/httplug/README.md b/vendor/php-http/httplug/README.md new file mode 100644 index 00000000..aabcf258 --- /dev/null +++ b/vendor/php-http/httplug/README.md @@ -0,0 +1,63 @@ +# HTTPlug + +[![Latest Version](https://img.shields.io/github/release/php-http/httplug.svg?style=flat-square)](https://github.com/php-http/httplug/releases) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) +[![Build Status](https://img.shields.io/travis/php-http/httplug/master.svg?style=flat-square)](https://travis-ci.org/php-http/httplug) +[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/httplug.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/httplug) +[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/httplug.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/httplug) +[![Total Downloads](https://img.shields.io/packagist/dt/php-http/httplug.svg?style=flat-square)](https://packagist.org/packages/php-http/httplug) + +[![Slack Status](http://slack.httplug.io/badge.svg)](http://slack.httplug.io) +[![Email](https://img.shields.io/badge/email-team@httplug.io-blue.svg?style=flat-square)](mailto:team@httplug.io) + +**HTTPlug, the HTTP client abstraction for PHP.** + + +## Intro + +HTTP client standard built on [PSR-7](http://www.php-fig.org/psr/psr-7/) HTTP +messages. The HTTPlug client interface is compatible with the official standard +for the HTTP client interface, [PSR-18](http://www.php-fig.org/psr/psr-18/). +HTTPlug adds an interface for asynchronous HTTP requests, which PSR-18 does not +cover. + +Since HTTPlug has already been widely adopted and a whole ecosystem has been +built around it, we will keep maintaining this package for the time being. +HTTPlug 2.0 and newer extend the PSR-18 interface to allow for a convenient +migration path. + +New client implementations and consumers should use the PSR-18 interfaces +directly. In the long term, we expect PSR-18 to completely replace the need +for HTTPlug. + + +## History + +HTTPlug is the official successor of the [ivory http adapter](https://github.com/egeloen/ivory-http-adapter). +HTTPlug is a predecessor of [PSR-18](http://www.php-fig.org/psr/psr-18/) + + +## Install + +Via Composer + +``` bash +$ composer require php-http/httplug +``` + + +## Documentation + +Please see the [official documentation](http://docs.php-http.org). + + +## Testing + +``` bash +$ composer test +``` + + +## License + +The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/httplug/composer.json b/vendor/php-http/httplug/composer.json new file mode 100644 index 00000000..268b27ec --- /dev/null +++ b/vendor/php-http/httplug/composer.json @@ -0,0 +1,45 @@ +{ + "name": "php-http/httplug", + "description": "HTTPlug, the HTTP client abstraction for PHP", + "keywords": [ + "http", + "client" + ], + "homepage": "http://httplug.io", + "license": "MIT", + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "require": { + "php": "^7.1 || ^8.0", + "php-http/promise": "^1.1", + "psr/http-client": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.1", + "phpspec/phpspec": "^5.1 || ^6.0" + }, + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\": "src/" + } + }, + "scripts": { + "test": "vendor/bin/phpspec run", + "test-ci": "vendor/bin/phpspec run -c phpspec.ci.yml" + } +} diff --git a/vendor/php-http/httplug/puli.json b/vendor/php-http/httplug/puli.json new file mode 100644 index 00000000..41683315 --- /dev/null +++ b/vendor/php-http/httplug/puli.json @@ -0,0 +1,12 @@ +{ + "version": "1.0", + "name": "php-http/httplug", + "binding-types": { + "Http\\Client\\HttpAsyncClient": { + "description": "Async HTTP Client" + }, + "Http\\Client\\HttpClient": { + "description": "HTTP Client" + } + } +} diff --git a/vendor/php-http/httplug/src/Exception.php b/vendor/php-http/httplug/src/Exception.php new file mode 100644 index 00000000..4df164c9 --- /dev/null +++ b/vendor/php-http/httplug/src/Exception.php @@ -0,0 +1,14 @@ + + */ +interface Exception extends PsrClientException +{ +} diff --git a/vendor/php-http/httplug/src/Exception/HttpException.php b/vendor/php-http/httplug/src/Exception/HttpException.php new file mode 100644 index 00000000..6c2a007a --- /dev/null +++ b/vendor/php-http/httplug/src/Exception/HttpException.php @@ -0,0 +1,65 @@ + + */ +class HttpException extends RequestException +{ + /** + * @var ResponseInterface + */ + protected $response; + + /** + * @param string $message + */ + public function __construct( + $message, + RequestInterface $request, + ResponseInterface $response, + \Exception $previous = null + ) { + parent::__construct($message, $request, $previous); + + $this->response = $response; + $this->code = $response->getStatusCode(); + } + + /** + * Returns the response. + * + * @return ResponseInterface + */ + public function getResponse() + { + return $this->response; + } + + /** + * Factory method to create a new exception with a normalized error message. + */ + public static function create( + RequestInterface $request, + ResponseInterface $response, + \Exception $previous = null + ) { + $message = sprintf( + '[url] %s [http method] %s [status code] %s [reason phrase] %s', + $request->getRequestTarget(), + $request->getMethod(), + $response->getStatusCode(), + $response->getReasonPhrase() + ); + + return new static($message, $request, $response, $previous); + } +} diff --git a/vendor/php-http/httplug/src/Exception/NetworkException.php b/vendor/php-http/httplug/src/Exception/NetworkException.php new file mode 100644 index 00000000..9b4f1e8f --- /dev/null +++ b/vendor/php-http/httplug/src/Exception/NetworkException.php @@ -0,0 +1,28 @@ + + */ +class NetworkException extends TransferException implements PsrNetworkException +{ + use RequestAwareTrait; + + /** + * @param string $message + */ + public function __construct($message, RequestInterface $request, \Exception $previous = null) + { + $this->setRequest($request); + + parent::__construct($message, 0, $previous); + } +} diff --git a/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php b/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php new file mode 100644 index 00000000..71b4bb8c --- /dev/null +++ b/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php @@ -0,0 +1,26 @@ +request = $request; + } + + /** + * {@inheritdoc} + */ + public function getRequest(): RequestInterface + { + return $this->request; + } +} diff --git a/vendor/php-http/httplug/src/Exception/RequestException.php b/vendor/php-http/httplug/src/Exception/RequestException.php new file mode 100644 index 00000000..f6c60ce5 --- /dev/null +++ b/vendor/php-http/httplug/src/Exception/RequestException.php @@ -0,0 +1,29 @@ + + */ +class RequestException extends TransferException implements PsrRequestException +{ + use RequestAwareTrait; + + /** + * @param string $message + */ + public function __construct($message, RequestInterface $request, \Exception $previous = null) + { + $this->setRequest($request); + + parent::__construct($message, 0, $previous); + } +} diff --git a/vendor/php-http/httplug/src/Exception/TransferException.php b/vendor/php-http/httplug/src/Exception/TransferException.php new file mode 100644 index 00000000..a858cf5e --- /dev/null +++ b/vendor/php-http/httplug/src/Exception/TransferException.php @@ -0,0 +1,14 @@ + + */ +class TransferException extends \RuntimeException implements Exception +{ +} diff --git a/vendor/php-http/httplug/src/HttpAsyncClient.php b/vendor/php-http/httplug/src/HttpAsyncClient.php new file mode 100644 index 00000000..c3b9d61a --- /dev/null +++ b/vendor/php-http/httplug/src/HttpAsyncClient.php @@ -0,0 +1,25 @@ + + */ +interface HttpAsyncClient +{ + /** + * Sends a PSR-7 request in an asynchronous way. + * + * Exceptions related to processing the request are available from the returned Promise. + * + * @return Promise resolves a PSR-7 Response or fails with an Http\Client\Exception + * + * @throws \Exception If processing the request is impossible (eg. bad configuration). + */ + public function sendAsyncRequest(RequestInterface $request); +} diff --git a/vendor/php-http/httplug/src/HttpClient.php b/vendor/php-http/httplug/src/HttpClient.php new file mode 100644 index 00000000..4442bd01 --- /dev/null +++ b/vendor/php-http/httplug/src/HttpClient.php @@ -0,0 +1,15 @@ +response = $response; + } + + /** + * {@inheritdoc} + */ + public function then(callable $onFulfilled = null, callable $onRejected = null) + { + if (null === $onFulfilled) { + return $this; + } + + try { + return new self($onFulfilled($this->response)); + } catch (Exception $e) { + return new HttpRejectedPromise($e); + } + } + + /** + * {@inheritdoc} + */ + public function getState() + { + return Promise::FULFILLED; + } + + /** + * {@inheritdoc} + */ + public function wait($unwrap = true) + { + if ($unwrap) { + return $this->response; + } + } +} diff --git a/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php b/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php new file mode 100644 index 00000000..8af97dea --- /dev/null +++ b/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php @@ -0,0 +1,53 @@ +exception = $exception; + } + + /** + * {@inheritdoc} + */ + public function then(callable $onFulfilled = null, callable $onRejected = null) + { + if (null === $onRejected) { + return $this; + } + + try { + return new HttpFulfilledPromise($onRejected($this->exception)); + } catch (Exception $e) { + return new self($e); + } + } + + /** + * {@inheritdoc} + */ + public function getState() + { + return Promise::REJECTED; + } + + /** + * {@inheritdoc} + */ + public function wait($unwrap = true) + { + if ($unwrap) { + throw $this->exception; + } + } +} diff --git a/vendor/php-http/message-factory/CHANGELOG.md b/vendor/php-http/message-factory/CHANGELOG.md new file mode 100644 index 00000000..4711924c --- /dev/null +++ b/vendor/php-http/message-factory/CHANGELOG.md @@ -0,0 +1,65 @@ +# Change Log + + +## 1.0.2 - 2015-12-19 + +### Added + +- Request and Response factory binding types to Puli + + +## 1.0.1 - 2015-12-17 + +### Added + +- Puli configuration and binding types + + +## 1.0.0 - 2015-12-15 + +### Added + +- Response Factory in order to be reused in Message and Server Message factories +- Request Factory + +### Changed + +- Message Factory extends Request and Response factories + + +## 1.0.0-RC1 - 2015-12-14 + +### Added + +- CS check + +### Changed + +- RuntimeException is thrown when the StreamFactory cannot write to the underlying stream + + +## 0.3.0 - 2015-11-16 + +### Removed + +- Client Context Factory +- Factory Awares and Templates + + +## 0.2.0 - 2015-11-16 + +### Changed + +- Reordered the parameters when creating a message to have the protocol last, +as its the least likely to need to be changed. + + +## 0.1.0 - 2015-06-01 + +### Added + +- Initial release + +### Changed + +- Helpers are renamed to templates diff --git a/vendor/php-http/message-factory/LICENSE b/vendor/php-http/message-factory/LICENSE new file mode 100644 index 00000000..8e2c4a0b --- /dev/null +++ b/vendor/php-http/message-factory/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015 PHP HTTP Team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/php-http/message-factory/README.md b/vendor/php-http/message-factory/README.md new file mode 100644 index 00000000..4654495a --- /dev/null +++ b/vendor/php-http/message-factory/README.md @@ -0,0 +1,36 @@ +# PSR-7 Message Factory + +[![Latest Version](https://img.shields.io/github/release/php-http/message-factory.svg?style=flat-square)](https://github.com/php-http/message-factory/releases) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) +[![Total Downloads](https://img.shields.io/packagist/dt/php-http/message-factory.svg?style=flat-square)](https://packagist.org/packages/php-http/message-factory) + +**Factory interfaces for PSR-7 HTTP Message.** + + +## Install + +Via Composer + +``` bash +$ composer require php-http/message-factory +``` + + +## Documentation + +Please see the [official documentation](http://php-http.readthedocs.org/en/latest/message-factory/). + + +## Contributing + +Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details. + + +## Security + +If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). + + +## License + +The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/message-factory/composer.json b/vendor/php-http/message-factory/composer.json new file mode 100644 index 00000000..7c72febe --- /dev/null +++ b/vendor/php-http/message-factory/composer.json @@ -0,0 +1,27 @@ +{ + "name": "php-http/message-factory", + "description": "Factory interfaces for PSR-7 HTTP Message", + "license": "MIT", + "keywords": ["http", "factory", "message", "stream", "uri"], + "homepage": "http://php-http.org", + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "require": { + "php": ">=5.4", + "psr/http-message": "^1.0" + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + } +} diff --git a/vendor/php-http/message-factory/puli.json b/vendor/php-http/message-factory/puli.json new file mode 100644 index 00000000..08d37627 --- /dev/null +++ b/vendor/php-http/message-factory/puli.json @@ -0,0 +1,43 @@ +{ + "version": "1.0", + "binding-types": { + "Http\\Message\\MessageFactory": { + "description": "PSR-7 Message Factory", + "parameters": { + "depends": { + "description": "Optional class dependency which can be checked by consumers" + } + } + }, + "Http\\Message\\RequestFactory": { + "parameters": { + "depends": { + "description": "Optional class dependency which can be checked by consumers" + } + } + }, + "Http\\Message\\ResponseFactory": { + "parameters": { + "depends": { + "description": "Optional class dependency which can be checked by consumers" + } + } + }, + "Http\\Message\\StreamFactory": { + "description": "PSR-7 Stream Factory", + "parameters": { + "depends": { + "description": "Optional class dependency which can be checked by consumers" + } + } + }, + "Http\\Message\\UriFactory": { + "description": "PSR-7 URI Factory", + "parameters": { + "depends": { + "description": "Optional class dependency which can be checked by consumers" + } + } + } + } +} diff --git a/vendor/php-http/message-factory/src/MessageFactory.php b/vendor/php-http/message-factory/src/MessageFactory.php new file mode 100644 index 00000000..965aaa80 --- /dev/null +++ b/vendor/php-http/message-factory/src/MessageFactory.php @@ -0,0 +1,12 @@ + + */ +interface MessageFactory extends RequestFactory, ResponseFactory +{ +} diff --git a/vendor/php-http/message-factory/src/RequestFactory.php b/vendor/php-http/message-factory/src/RequestFactory.php new file mode 100644 index 00000000..624e82f3 --- /dev/null +++ b/vendor/php-http/message-factory/src/RequestFactory.php @@ -0,0 +1,34 @@ + + */ +interface RequestFactory +{ + /** + * Creates a new PSR-7 request. + * + * @param string $method + * @param string|UriInterface $uri + * @param array $headers + * @param resource|string|StreamInterface|null $body + * @param string $protocolVersion + * + * @return RequestInterface + */ + public function createRequest( + $method, + $uri, + array $headers = [], + $body = null, + $protocolVersion = '1.1' + ); +} diff --git a/vendor/php-http/message-factory/src/ResponseFactory.php b/vendor/php-http/message-factory/src/ResponseFactory.php new file mode 100644 index 00000000..2411ed3a --- /dev/null +++ b/vendor/php-http/message-factory/src/ResponseFactory.php @@ -0,0 +1,35 @@ + + */ +interface ResponseFactory +{ + /** + * Creates a new PSR-7 response. + * + * @param int $statusCode + * @param string|null $reasonPhrase + * @param array $headers + * @param resource|string|StreamInterface|null $body + * @param string $protocolVersion + * + * @return ResponseInterface + */ + public function createResponse( + $statusCode = 200, + $reasonPhrase = null, + array $headers = [], + $body = null, + $protocolVersion = '1.1' + ); +} diff --git a/vendor/php-http/message-factory/src/StreamFactory.php b/vendor/php-http/message-factory/src/StreamFactory.php new file mode 100644 index 00000000..327a902f --- /dev/null +++ b/vendor/php-http/message-factory/src/StreamFactory.php @@ -0,0 +1,25 @@ + + */ +interface StreamFactory +{ + /** + * Creates a new PSR-7 stream. + * + * @param string|resource|StreamInterface|null $body + * + * @return StreamInterface + * + * @throws \InvalidArgumentException If the stream body is invalid. + * @throws \RuntimeException If creating the stream from $body fails. + */ + public function createStream($body = null); +} diff --git a/vendor/php-http/message-factory/src/UriFactory.php b/vendor/php-http/message-factory/src/UriFactory.php new file mode 100644 index 00000000..f05e6252 --- /dev/null +++ b/vendor/php-http/message-factory/src/UriFactory.php @@ -0,0 +1,24 @@ + + */ +interface UriFactory +{ + /** + * Creates an PSR-7 URI. + * + * @param string|UriInterface $uri + * + * @return UriInterface + * + * @throws \InvalidArgumentException If the $uri argument can not be converted into a valid URI. + */ + public function createUri($uri); +} diff --git a/vendor/php-http/message/CHANGELOG.md b/vendor/php-http/message/CHANGELOG.md new file mode 100644 index 00000000..d3eb840b --- /dev/null +++ b/vendor/php-http/message/CHANGELOG.md @@ -0,0 +1,249 @@ +# Change Log + + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [1.12.0] - 2021-08-29 + +- Added support for adjusting binary detection regex in FullHttpMessageFormatter + +## [1.11.2] - 2021-08-03 + +- Support GuzzleHttp/Psr7 version 2.0 in the (deprecated) GuzzleStreamFactory. + +## [1.11.1] - 2021-05-24 + +- Support GuzzleHttp/Psr7 version 2.0 in the (deprecated) GuzzleUriFactory. + +## [1.11.0] - 2020-02-01 + +- Migrated from `zendframework/zend-diactoros` to `laminas/laminas-diactoros`. + Users are encouraged to update their dependencies by simply replacing the Zend package with the Laminas package. + Due to the [laminas-zendframework-brige](https://github.com/laminas/laminas-zendframework-bridge), BC changes + are not expected and legacy code does not need to be refactored (though it is + [recommended and simple](https://docs.laminas.dev/migration/)). +- The diactoros factories of `php-http/message` will return objects from the `Laminas\Diactoros\` namespace, if + the respective classes are available via autoloading, but continue to return objects from `Zend\Diactoros\` + namespace otherwise. + +- Allow to specify the hashing algorithm for WSSE authentication. + +## [1.10.0] - 2020-11-11 + +- Added support for PHP 8.0. + +## [1.9.1] - 2020-10-13 + +- Improved detection of binary stream to not consider newlines, carriage return or tabs as binary. + +## [1.9.0] - 2020-08-17 + +- Omitted binary body in FullHttpMessageFormatter and CurlCommandFormatter. + `[binary stream omitted]` will be shown instead. + +### Added + +- New Header authentication method for arbitrary header authentication. + +## [1.8.0] - 2019-08-05 + +### Changed + +- Raised minimum PHP version to 7.1 + +### Fixed + +- Fatal error on `CurlCommandFormatter` when body is larger than `escapeshellarg` allowed length. +- Do not read stream in message formatter if stream is not seekable. + +## [1.7.2] - 2018-10-30 + +### Fixed + +- FilteredStream uses `@trigger_error` instead of throwing exceptions to not + break careless users. You still need to fix your stream code to respect + `isSeekable`. Seeking does not work as expected, and we will add exceptions + in version 2. + +## [1.7.1] - 2018-10-29 + +### Fixed + +- FilteredStream is not actually seekable + + +## [1.7.0] - 2018-08-15 + +### Fixed + +- Fix CurlCommandFormatter for binary request payloads +- Fix QueryParam authentication to assemble proper URL regardless of PHP `arg_separator.output` directive +- Do not pass `null` parameters to `Clue\StreamFilter\fun` + +### Changed + +- Dropped tests on HHVM + + +## [1.6.0] - 2017-07-05 + +### Added + +- CookieUtil::parseDate to create a date from cookie date string + +### Fixed + +- Fix curl command of CurlFormatter when there is an user-agent header + + +## [1.5.0] - 2017-02-14 + +### Added + +- Check for empty string in Stream factories +- Cookie::createWithoutValidation Static constructor to create a cookie. Will not perform any attribute validation during instantiation. +- Cookie::isValid Method to check if cookie attributes are valid. + +### Fixed + +- FilteredStream::getSize returns null because the contents size is unknown. +- Stream factories does not rewinds streams. The previous behavior was not coherent between factories and inputs. + +### Deprecated + +- FilteredStream::getReadFilter The read filter is internal and should never be used by consuming code. +- FilteredStream::getWriteFilter We did not implement writing to the streams at all. And if we do, the filter is an internal information and should not be used by consuming code. + + +## [1.4.1] - 2016-12-16 + +### Fixed + +- Cookie::matchPath Cookie with root path (`/`) will not match sub path (e.g. `/cookie`). + + +## [1.4.0] - 2016-10-20 + +### Added + +- Message, stream and URI factories for [Slim Framework](https://github.com/slimphp/Slim) +- BufferedStream that allow you to decorate a non-seekable stream with a seekable one. +- cUrlFormatter to be able to redo the request with a cURL command + + +## [1.3.1] - 2016-07-15 + +### Fixed + +- FullHttpMessageFormatter will not read from streams that you cannot rewind (non-seekable) +- FullHttpMessageFormatter will not read from the stream if $maxBodyLength is zero +- FullHttpMessageFormatter rewinds streams after they are read + + +## [1.3.0] - 2016-07-14 + +### Added + +- FullHttpMessageFormatter to include headers and body in the formatted message + +### Fixed + +- #41: Response builder broke header value + + +## [1.2.0] - 2016-03-29 + +### Added + +- The RequestMatcher is built after the Symfony RequestMatcher and separates + scheme, host and path expressions and provides an option to filter on the + method +- New RequestConditional authentication method using request matchers +- Add automatic basic auth info detection based on the URL + +### Changed + +- Improved ResponseBuilder + +### Deprecated + +- RegexRequestMatcher, use RequestMatcher instead +- Matching authenitcation method, use RequestConditional instead + + +## [1.1.0] - 2016-02-25 + +### Added + + - Add a request matcher interface and regex implementation + - Add a callback request matcher implementation + - Add a ResponseBuilder, to create PSR7 Response from a string + +### Fixed + + - Fix casting string on a FilteredStream not filtering the output + + +## [1.0.0] - 2016-01-27 + + +## [0.2.0] - 2015-12-29 + +### Added + +- Autoregistration of stream filters using Composer autoload +- Cookie +- [Apigen](http://www.apigen.org/) configuration + + +## [0.1.2] - 2015-12-26 + +### Added + +- Request and response factory bindings + +### Fixed + +- Chunk filter namespace in Dechunk stream + + +## [0.1.1] - 2015-12-25 + +### Added + +- Formatter + + +## 0.1.0 - 2015-12-24 + +### Added + +- Authentication +- Encoding +- Message decorator +- Message factory (Guzzle, Diactoros) + + +[Unreleased]: https://github.com/php-http/message/compare/1.10.0...HEAD +[1.10.0]: https://github.com/php-http/message/compare/1.9.1...1.10.0 +[1.9.1]: https://github.com/php-http/message/compare/1.9.0...1.9.1 +[1.9.0]: https://github.com/php-http/message/compare/1.8.0...1.9.0 +[1.8.0]: https://github.com/php-http/message/compare/1.7.2...1.8.0 +[1.7.2]: https://github.com/php-http/message/compare/v1.7.1...1.7.2 +[1.7.1]: https://github.com/php-http/message/compare/1.7.0...v1.7.1 +[1.7.0]: https://github.com/php-http/message/compare/1.6.0...1.7.0 +[1.6.0]: https://github.com/php-http/message/compare/1.5.0...1.6.0 +[1.5.0]: https://github.com/php-http/message/compare/v1.4.1...1.5.0 +[1.4.1]: https://github.com/php-http/message/compare/v1.4.0...v1.4.1 +[1.4.0]: https://github.com/php-http/message/compare/v1.3.1...v1.4.0 +[1.3.1]: https://github.com/php-http/message/compare/v1.3.0...v1.3.1 +[1.3.0]: https://github.com/php-http/message/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/php-http/message/compare/v1.1.0...v1.2.0 +[1.1.0]: https://github.com/php-http/message/compare/v1.0.0...v1.1.0 +[1.0.0]: https://github.com/php-http/message/compare/0.2.0...v1.0.0 +[0.2.0]: https://github.com/php-http/message/compare/v0.1.2...0.2.0 +[0.1.2]: https://github.com/php-http/message/compare/v0.1.1...v0.1.2 +[0.1.1]: https://github.com/php-http/message/compare/v0.1.0...v0.1.1 diff --git a/vendor/php-http/message/LICENSE b/vendor/php-http/message/LICENSE new file mode 100644 index 00000000..4558d6f0 --- /dev/null +++ b/vendor/php-http/message/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-2016 PHP HTTP Team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/php-http/message/README.md b/vendor/php-http/message/README.md new file mode 100644 index 00000000..df1a7d55 --- /dev/null +++ b/vendor/php-http/message/README.md @@ -0,0 +1,51 @@ +# HTTP Message + +[![Latest Version](https://img.shields.io/github/release/php-http/message.svg?style=flat-square)](https://github.com/php-http/message/releases) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) +[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/php-http/message/CI?style=flat-square)](https://github.com/php-http/message/actions?query=workflow%3ACI+branch%3Amaster) +[![Total Downloads](https://img.shields.io/packagist/dt/php-http/message.svg?style=flat-square)](https://packagist.org/packages/php-http/message) + +**HTTP Message related tools.** + + +## Install + +Via Composer + +``` bash +$ composer require php-http/message +``` + + +## Intro + +This package contains various PSR-7 tools which might be useful in an HTTP workflow: + +- Authentication method implementations +- Various Stream encoding tools +- Message decorators +- Message factory implementations for Guzzle PSR-7 and Diactoros +- Cookie implementation +- Request matchers + + +## Documentation + +Please see the [official documentation](http://docs.php-http.org/en/latest/message.html). + + +## Testing + +``` bash +$ composer test +``` + + +## Credits + +Thanks to [Cuzzle](https://github.com/namshi/cuzzle) for inpiration for the `CurlCommandFormatter`. + + +## License + +The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/message/apigen.neon b/vendor/php-http/message/apigen.neon new file mode 100644 index 00000000..0ba1a185 --- /dev/null +++ b/vendor/php-http/message/apigen.neon @@ -0,0 +1,6 @@ +source: + - src/ + +destination: build/api/ + +templateTheme: bootstrap diff --git a/vendor/php-http/message/composer.json b/vendor/php-http/message/composer.json new file mode 100644 index 00000000..fc67cd04 --- /dev/null +++ b/vendor/php-http/message/composer.json @@ -0,0 +1,65 @@ +{ + "name": "php-http/message", + "description": "HTTP Message related tools", + "keywords": [ + "message", + "http", + "psr-7" + ], + "homepage": "http://php-http.org", + "license": "MIT", + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "require": { + "php": "^7.1 || ^8.0", + "clue/stream-filter": "^1.5", + "php-http/message-factory": "^1.0.2", + "psr/http-message": "^1.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0" + }, + "require-dev": { + "ext-zlib": "*", + "ergebnis/composer-normalize": "^2.6", + "guzzlehttp/psr7": "^1.0", + "phpspec/phpspec": "^5.1 || ^6.3", + "slim/slim": "^3.0", + "laminas/laminas-diactoros": "^2.0" + }, + "suggest": { + "ext-zlib": "Used with compressor/decompressor streams", + "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", + "laminas/laminas-diactoros": "Used with Diactoros Factories", + "slim/slim": "Used with Slim Framework PSR-7 implementation" + }, + "config": { + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + }, + "files": [ + "src/filters.php" + ] + }, + "autoload-dev": { + "psr-4": { + "spec\\Http\\Message\\": "spec/" + } + }, + "scripts": { + "test": "vendor/bin/phpspec run", + "test-ci": "vendor/bin/phpspec run -c phpspec.ci.yml" + } +} diff --git a/vendor/php-http/message/puli.json b/vendor/php-http/message/puli.json new file mode 100644 index 00000000..024a85d9 --- /dev/null +++ b/vendor/php-http/message/puli.json @@ -0,0 +1,111 @@ +{ + "version": "1.0", + "name": "php-http/message", + "bindings": { + "064d003d-78a1-48c4-8f3b-1f92ff25da69": { + "_class": "Puli\\Discovery\\Binding\\ClassBinding", + "class": "Http\\Message\\MessageFactory\\DiactorosMessageFactory", + "type": "Http\\Message\\MessageFactory", + "parameters": { + "depends": "Zend\\Diactoros\\Request" + } + }, + "0836751e-6558-4d1b-8993-4a52012947c3": { + "_class": "Puli\\Discovery\\Binding\\ClassBinding", + "class": "Http\\Message\\MessageFactory\\SlimMessageFactory", + "type": "Http\\Message\\ResponseFactory" + }, + "1d127622-dc61-4bfa-b9da-d221548d72c3": { + "_class": "Puli\\Discovery\\Binding\\ClassBinding", + "class": "Http\\Message\\MessageFactory\\SlimMessageFactory", + "type": "Http\\Message\\RequestFactory" + }, + "2438c2d0-0658-441f-8855-ddaf0f87d54d": { + "_class": "Puli\\Discovery\\Binding\\ClassBinding", + "class": "Http\\Message\\MessageFactory\\GuzzleMessageFactory", + "type": "Http\\Message\\MessageFactory", + "parameters": { + "depends": "GuzzleHttp\\Psr7\\Request" + } + }, + "253aa08c-d705-46e7-b1d2-e28c97eef792": { + "_class": "Puli\\Discovery\\Binding\\ClassBinding", + "class": "Http\\Message\\MessageFactory\\GuzzleMessageFactory", + "type": "Http\\Message\\RequestFactory", + "parameters": { + "depends": "GuzzleHttp\\Psr7\\Request" + } + }, + "273a34f9-62f4-4ba1-9801-b1284d49ff89": { + "_class": "Puli\\Discovery\\Binding\\ClassBinding", + "class": "Http\\Message\\StreamFactory\\GuzzleStreamFactory", + "type": "Http\\Message\\StreamFactory", + "parameters": { + "depends": "GuzzleHttp\\Psr7\\Stream" + } + }, + "304b83db-b594-4d83-ae75-1f633adf92f7": { + "_class": "Puli\\Discovery\\Binding\\ClassBinding", + "class": "Http\\Message\\UriFactory\\GuzzleUriFactory", + "type": "Http\\Message\\UriFactory", + "parameters": { + "depends": "GuzzleHttp\\Psr7\\Uri" + } + }, + "3f4bc1cd-aa95-4702-9fa7-65408e471691": { + "_class": "Puli\\Discovery\\Binding\\ClassBinding", + "class": "Http\\Message\\UriFactory\\DiactorosUriFactory", + "type": "Http\\Message\\UriFactory", + "parameters": { + "depends": "Zend\\Diactoros\\Uri" + } + }, + "4672a6ee-ad9e-4109-a5d1-b7d46f26c7a1": { + "_class": "Puli\\Discovery\\Binding\\ClassBinding", + "class": "Http\\Message\\MessageFactory\\SlimMessageFactory", + "type": "Http\\Message\\MessageFactory" + }, + "6234e947-d3bd-43eb-97d5-7f9e22e6bb1b": { + "_class": "Puli\\Discovery\\Binding\\ClassBinding", + "class": "Http\\Message\\MessageFactory\\DiactorosMessageFactory", + "type": "Http\\Message\\ResponseFactory", + "parameters": { + "depends": "Zend\\Diactoros\\Response" + } + }, + "6a9ad6ce-d82c-470f-8e30-60f21d9d95bf": { + "_class": "Puli\\Discovery\\Binding\\ClassBinding", + "class": "Http\\Message\\UriFactory\\SlimUriFactory", + "type": "Http\\Message\\UriFactory" + }, + "72c2afa0-ea56-4d03-adb6-a9f241a8a734": { + "_class": "Puli\\Discovery\\Binding\\ClassBinding", + "class": "Http\\Message\\StreamFactory\\SlimStreamFactory", + "type": "Http\\Message\\StreamFactory" + }, + "95c1be8f-39fe-4abd-8351-92cb14379a75": { + "_class": "Puli\\Discovery\\Binding\\ClassBinding", + "class": "Http\\Message\\StreamFactory\\DiactorosStreamFactory", + "type": "Http\\Message\\StreamFactory", + "parameters": { + "depends": "Zend\\Diactoros\\Stream" + } + }, + "a018af27-7590-4dcf-83a1-497f95604cd6": { + "_class": "Puli\\Discovery\\Binding\\ClassBinding", + "class": "Http\\Message\\MessageFactory\\GuzzleMessageFactory", + "type": "Http\\Message\\ResponseFactory", + "parameters": { + "depends": "GuzzleHttp\\Psr7\\Response" + } + }, + "c07955b1-de46-43db-923b-d07fae9382cb": { + "_class": "Puli\\Discovery\\Binding\\ClassBinding", + "class": "Http\\Message\\MessageFactory\\DiactorosMessageFactory", + "type": "Http\\Message\\RequestFactory", + "parameters": { + "depends": "Zend\\Diactoros\\Request" + } + } + } +} diff --git a/vendor/php-http/message/src/Authentication.php b/vendor/php-http/message/src/Authentication.php new file mode 100644 index 00000000..0fe0cb3a --- /dev/null +++ b/vendor/php-http/message/src/Authentication.php @@ -0,0 +1,25 @@ + + */ +interface Authentication +{ + /** + * Alter the request to add the authentication credentials. + * + * To do that, the implementation might use pre-stored credentials or do + * separate HTTP requests to obtain a valid token. + * + * @param RequestInterface $request The request without authentication information + * + * @return RequestInterface The request with added authentication information + */ + public function authenticate(RequestInterface $request); +} diff --git a/vendor/php-http/message/src/Authentication/AutoBasicAuth.php b/vendor/php-http/message/src/Authentication/AutoBasicAuth.php new file mode 100644 index 00000000..7b6a4294 --- /dev/null +++ b/vendor/php-http/message/src/Authentication/AutoBasicAuth.php @@ -0,0 +1,48 @@ + + */ +final class AutoBasicAuth implements Authentication +{ + /** + * Whether user info should be removed from the URI. + * + * @var bool + */ + private $shouldRemoveUserInfo; + + /** + * @param bool|true $shouldRremoveUserInfo + */ + public function __construct($shouldRremoveUserInfo = true) + { + $this->shouldRemoveUserInfo = (bool) $shouldRremoveUserInfo; + } + + /** + * {@inheritdoc} + */ + public function authenticate(RequestInterface $request) + { + $uri = $request->getUri(); + $userInfo = $uri->getUserInfo(); + + if (!empty($userInfo)) { + if ($this->shouldRemoveUserInfo) { + $request = $request->withUri($uri->withUserInfo('')); + } + + $request = $request->withHeader('Authorization', sprintf('Basic %s', base64_encode($userInfo))); + } + + return $request; + } +} diff --git a/vendor/php-http/message/src/Authentication/BasicAuth.php b/vendor/php-http/message/src/Authentication/BasicAuth.php new file mode 100644 index 00000000..23618a53 --- /dev/null +++ b/vendor/php-http/message/src/Authentication/BasicAuth.php @@ -0,0 +1,44 @@ + + */ +final class BasicAuth implements Authentication +{ + /** + * @var string + */ + private $username; + + /** + * @var string + */ + private $password; + + /** + * @param string $username + * @param string $password + */ + public function __construct($username, $password) + { + $this->username = $username; + $this->password = $password; + } + + /** + * {@inheritdoc} + */ + public function authenticate(RequestInterface $request) + { + $header = sprintf('Basic %s', base64_encode(sprintf('%s:%s', $this->username, $this->password))); + + return $request->withHeader('Authorization', $header); + } +} diff --git a/vendor/php-http/message/src/Authentication/Bearer.php b/vendor/php-http/message/src/Authentication/Bearer.php new file mode 100644 index 00000000..a8fb21a1 --- /dev/null +++ b/vendor/php-http/message/src/Authentication/Bearer.php @@ -0,0 +1,37 @@ + + */ +final class Bearer implements Authentication +{ + /** + * @var string + */ + private $token; + + /** + * @param string $token + */ + public function __construct($token) + { + $this->token = $token; + } + + /** + * {@inheritdoc} + */ + public function authenticate(RequestInterface $request) + { + $header = sprintf('Bearer %s', $this->token); + + return $request->withHeader('Authorization', $header); + } +} diff --git a/vendor/php-http/message/src/Authentication/Chain.php b/vendor/php-http/message/src/Authentication/Chain.php new file mode 100644 index 00000000..71002bb1 --- /dev/null +++ b/vendor/php-http/message/src/Authentication/Chain.php @@ -0,0 +1,47 @@ + + */ +final class Chain implements Authentication +{ + /** + * @var Authentication[] + */ + private $authenticationChain = []; + + /** + * @param Authentication[] $authenticationChain + */ + public function __construct(array $authenticationChain = []) + { + foreach ($authenticationChain as $authentication) { + if (!$authentication instanceof Authentication) { + throw new \InvalidArgumentException( + 'Members of the authentication chain must be of type Http\Message\Authentication' + ); + } + } + + $this->authenticationChain = $authenticationChain; + } + + /** + * {@inheritdoc} + */ + public function authenticate(RequestInterface $request) + { + foreach ($this->authenticationChain as $authentication) { + $request = $authentication->authenticate($request); + } + + return $request; + } +} diff --git a/vendor/php-http/message/src/Authentication/Header.php b/vendor/php-http/message/src/Authentication/Header.php new file mode 100644 index 00000000..97a04dd4 --- /dev/null +++ b/vendor/php-http/message/src/Authentication/Header.php @@ -0,0 +1,33 @@ +name = $name; + $this->value = $value; + } + + /** + * {@inheritdoc} + */ + public function authenticate(RequestInterface $request) + { + return $request->withHeader($this->name, $this->value); + } +} diff --git a/vendor/php-http/message/src/Authentication/Matching.php b/vendor/php-http/message/src/Authentication/Matching.php new file mode 100644 index 00000000..7a5c247b --- /dev/null +++ b/vendor/php-http/message/src/Authentication/Matching.php @@ -0,0 +1,69 @@ + + * + * @deprecated since since version 1.2, and will be removed in 2.0. Use {@link RequestConditional} instead. + */ +final class Matching implements Authentication +{ + /** + * @var Authentication + */ + private $authentication; + + /** + * @var CallbackRequestMatcher + */ + private $matcher; + + public function __construct(Authentication $authentication, callable $matcher = null) + { + if (is_null($matcher)) { + $matcher = function () { + return true; + }; + } + + $this->authentication = $authentication; + $this->matcher = new CallbackRequestMatcher($matcher); + } + + /** + * {@inheritdoc} + */ + public function authenticate(RequestInterface $request) + { + if ($this->matcher->matches($request)) { + return $this->authentication->authenticate($request); + } + + return $request; + } + + /** + * Creates a matching authentication for an URL. + * + * @param string $url + * + * @return self + */ + public static function createUrlMatcher(Authentication $authentication, $url) + { + $matcher = function (RequestInterface $request) use ($url) { + return preg_match($url, $request->getRequestTarget()); + }; + + return new static($authentication, $matcher); + } +} diff --git a/vendor/php-http/message/src/Authentication/QueryParam.php b/vendor/php-http/message/src/Authentication/QueryParam.php new file mode 100644 index 00000000..243efef3 --- /dev/null +++ b/vendor/php-http/message/src/Authentication/QueryParam.php @@ -0,0 +1,47 @@ + + */ +final class QueryParam implements Authentication +{ + /** + * @var array + */ + private $params = []; + + public function __construct(array $params) + { + $this->params = $params; + } + + /** + * {@inheritdoc} + */ + public function authenticate(RequestInterface $request) + { + $uri = $request->getUri(); + $query = $uri->getQuery(); + $params = []; + + parse_str($query, $params); + + $params = array_merge($params, $this->params); + + $query = http_build_query($params, '', '&'); + + $uri = $uri->withQuery($query); + + return $request->withUri($uri); + } +} diff --git a/vendor/php-http/message/src/Authentication/RequestConditional.php b/vendor/php-http/message/src/Authentication/RequestConditional.php new file mode 100644 index 00000000..01062cf6 --- /dev/null +++ b/vendor/php-http/message/src/Authentication/RequestConditional.php @@ -0,0 +1,43 @@ + + */ +final class RequestConditional implements Authentication +{ + /** + * @var RequestMatcher + */ + private $requestMatcher; + + /** + * @var Authentication + */ + private $authentication; + + public function __construct(RequestMatcher $requestMatcher, Authentication $authentication) + { + $this->requestMatcher = $requestMatcher; + $this->authentication = $authentication; + } + + /** + * {@inheritdoc} + */ + public function authenticate(RequestInterface $request) + { + if ($this->requestMatcher->matches($request)) { + return $this->authentication->authenticate($request); + } + + return $request; + } +} diff --git a/vendor/php-http/message/src/Authentication/Wsse.php b/vendor/php-http/message/src/Authentication/Wsse.php new file mode 100644 index 00000000..f343633d --- /dev/null +++ b/vendor/php-http/message/src/Authentication/Wsse.php @@ -0,0 +1,68 @@ + + */ +final class Wsse implements Authentication +{ + /** + * @var string + */ + private $username; + + /** + * @var string + */ + private $password; + + /** + * @var string + */ + private $hashAlgorithm; + + /** + * @param string $username + * @param string $password + * @param string $hashAlgorithm To use a better hashing algorithm than the weak sha1, pass the algorithm to use, e.g. "sha512" + */ + public function __construct($username, $password, $hashAlgorithm = 'sha1') + { + $this->username = $username; + $this->password = $password; + if (false === in_array($hashAlgorithm, hash_algos())) { + throw new InvalidArgumentException(sprintf('Unaccepted hashing algorithm: %s', $hashAlgorithm)); + } + $this->hashAlgorithm = $hashAlgorithm; + } + + /** + * {@inheritdoc} + */ + public function authenticate(RequestInterface $request) + { + $nonce = substr(md5(uniqid(uniqid().'_', true)), 0, 16); + $created = date('c'); + $digest = base64_encode(hash($this->hashAlgorithm, base64_decode($nonce).$created.$this->password, true)); + + $wsse = sprintf( + 'UsernameToken Username="%s", PasswordDigest="%s", Nonce="%s", Created="%s"', + $this->username, + $digest, + $nonce, + $created + ); + + return $request + ->withHeader('Authorization', 'WSSE profile="UsernameToken"') + ->withHeader('X-WSSE', $wsse) + ; + } +} diff --git a/vendor/php-http/message/src/Builder/ResponseBuilder.php b/vendor/php-http/message/src/Builder/ResponseBuilder.php new file mode 100644 index 00000000..4c3ecfc4 --- /dev/null +++ b/vendor/php-http/message/src/Builder/ResponseBuilder.php @@ -0,0 +1,146 @@ +response = $response; + } + + /** + * Return response. + * + * @return ResponseInterface + */ + public function getResponse() + { + return $this->response; + } + + /** + * Add headers represented by an array of header lines. + * + * @param string[] $headers response headers as array of header lines + * + * @return $this + * + * @throws \UnexpectedValueException for invalid header values + * @throws \InvalidArgumentException for invalid status code arguments + */ + public function setHeadersFromArray(array $headers) + { + $status = array_shift($headers); + $this->setStatus($status); + + foreach ($headers as $headerLine) { + $headerLine = trim($headerLine); + if ('' === $headerLine) { + continue; + } + + $this->addHeader($headerLine); + } + + return $this; + } + + /** + * Add headers represented by a single string. + * + * @param string $headers response headers as single string + * + * @return $this + * + * @throws \InvalidArgumentException if $headers is not a string on object with __toString() + * @throws \UnexpectedValueException for invalid header values + */ + public function setHeadersFromString($headers) + { + if (!(is_string($headers) + || (is_object($headers) && method_exists($headers, '__toString'))) + ) { + throw new \InvalidArgumentException( + sprintf( + '%s expects parameter 1 to be a string, %s given', + __METHOD__, + is_object($headers) ? get_class($headers) : gettype($headers) + ) + ); + } + + $this->setHeadersFromArray(explode("\r\n", $headers)); + + return $this; + } + + /** + * Set response status from a status string. + * + * @param string $statusLine response status as a string + * + * @return $this + * + * @throws \InvalidArgumentException for invalid status line + */ + public function setStatus($statusLine) + { + $parts = explode(' ', $statusLine, 3); + if (count($parts) < 2 || 0 !== strpos(strtolower($parts[0]), 'http/')) { + throw new \InvalidArgumentException( + sprintf('"%s" is not a valid HTTP status line', $statusLine) + ); + } + + $reasonPhrase = count($parts) > 2 ? $parts[2] : ''; + $this->response = $this->response + ->withStatus((int) $parts[1], $reasonPhrase) + ->withProtocolVersion(substr($parts[0], 5)); + + return $this; + } + + /** + * Add header represented by a string. + * + * @param string $headerLine response header as a string + * + * @return $this + * + * @throws \InvalidArgumentException for invalid header names or values + */ + public function addHeader($headerLine) + { + $parts = explode(':', $headerLine, 2); + if (2 !== count($parts)) { + throw new \InvalidArgumentException( + sprintf('"%s" is not a valid HTTP header line', $headerLine) + ); + } + $name = trim($parts[0]); + $value = trim($parts[1]); + if ($this->response->hasHeader($name)) { + $this->response = $this->response->withAddedHeader($name, $value); + } else { + $this->response = $this->response->withHeader($name, $value); + } + + return $this; + } +} diff --git a/vendor/php-http/message/src/Cookie.php b/vendor/php-http/message/src/Cookie.php new file mode 100644 index 00000000..0cc2d43c --- /dev/null +++ b/vendor/php-http/message/src/Cookie.php @@ -0,0 +1,524 @@ + + * + * @see http://tools.ietf.org/search/rfc6265 + */ +final class Cookie +{ + /** + * @var string + */ + private $name; + + /** + * @var string|null + */ + private $value; + + /** + * @var int|null + */ + private $maxAge; + + /** + * @var string|null + */ + private $domain; + + /** + * @var string + */ + private $path; + + /** + * @var bool + */ + private $secure; + + /** + * @var bool + */ + private $httpOnly; + + /** + * Expires attribute is HTTP 1.0 only and should be avoided. + * + * @var \DateTime|null + */ + private $expires; + + /** + * @param string $name + * @param string|null $value + * @param int|null $maxAge + * @param string|null $domain + * @param string|null $path + * @param bool $secure + * @param bool $httpOnly + * @param \DateTime|null $expires Expires attribute is HTTP 1.0 only and should be avoided. + * + * @throws \InvalidArgumentException if name, value or max age is not valid + */ + public function __construct( + $name, + $value = null, + $maxAge = null, + $domain = null, + $path = null, + $secure = false, + $httpOnly = false, + \DateTime $expires = null + ) { + $this->validateName($name); + $this->validateValue($value); + $this->validateMaxAge($maxAge); + + $this->name = $name; + $this->value = $value; + $this->maxAge = $maxAge; + $this->expires = $expires; + $this->domain = $this->normalizeDomain($domain); + $this->path = $this->normalizePath($path); + $this->secure = (bool) $secure; + $this->httpOnly = (bool) $httpOnly; + } + + /** + * Creates a new cookie without any attribute validation. + * + * @param string $name + * @param string|null $value + * @param int $maxAge + * @param string|null $domain + * @param string|null $path + * @param bool $secure + * @param bool $httpOnly + * @param \DateTime|null $expires Expires attribute is HTTP 1.0 only and should be avoided. + */ + public static function createWithoutValidation( + $name, + $value = null, + $maxAge = null, + $domain = null, + $path = null, + $secure = false, + $httpOnly = false, + \DateTime $expires = null + ) { + $cookie = new self('name', null, null, $domain, $path, $secure, $httpOnly, $expires); + $cookie->name = $name; + $cookie->value = $value; + $cookie->maxAge = $maxAge; + + return $cookie; + } + + /** + * Returns the name. + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Returns the value. + * + * @return string|null + */ + public function getValue() + { + return $this->value; + } + + /** + * Checks if there is a value. + * + * @return bool + */ + public function hasValue() + { + return isset($this->value); + } + + /** + * Sets the value. + * + * @param string|null $value + * + * @return Cookie + */ + public function withValue($value) + { + $this->validateValue($value); + + $new = clone $this; + $new->value = $value; + + return $new; + } + + /** + * Returns the max age. + * + * @return int|null + */ + public function getMaxAge() + { + return $this->maxAge; + } + + /** + * Checks if there is a max age. + * + * @return bool + */ + public function hasMaxAge() + { + return isset($this->maxAge); + } + + /** + * Sets the max age. + * + * @param int|null $maxAge + * + * @return Cookie + */ + public function withMaxAge($maxAge) + { + $this->validateMaxAge($maxAge); + + $new = clone $this; + $new->maxAge = $maxAge; + + return $new; + } + + /** + * Returns the expiration time. + * + * @return \DateTime|null + */ + public function getExpires() + { + return $this->expires; + } + + /** + * Checks if there is an expiration time. + * + * @return bool + */ + public function hasExpires() + { + return isset($this->expires); + } + + /** + * Sets the expires. + * + * @return Cookie + */ + public function withExpires(\DateTime $expires = null) + { + $new = clone $this; + $new->expires = $expires; + + return $new; + } + + /** + * Checks if the cookie is expired. + * + * @return bool + */ + public function isExpired() + { + return isset($this->expires) and $this->expires < new \DateTime(); + } + + /** + * Returns the domain. + * + * @return string|null + */ + public function getDomain() + { + return $this->domain; + } + + /** + * Checks if there is a domain. + * + * @return bool + */ + public function hasDomain() + { + return isset($this->domain); + } + + /** + * Sets the domain. + * + * @param string|null $domain + * + * @return Cookie + */ + public function withDomain($domain) + { + $new = clone $this; + $new->domain = $this->normalizeDomain($domain); + + return $new; + } + + /** + * Checks whether this cookie is meant for this domain. + * + * @see http://tools.ietf.org/html/rfc6265#section-5.1.3 + * + * @param string $domain + * + * @return bool + */ + public function matchDomain($domain) + { + // Domain is not set or exact match + if (!$this->hasDomain() || 0 === strcasecmp($domain, $this->domain)) { + return true; + } + + // Domain is not an IP address + if (filter_var($domain, FILTER_VALIDATE_IP)) { + return false; + } + + return (bool) preg_match(sprintf('/\b%s$/i', preg_quote($this->domain)), $domain); + } + + /** + * Returns the path. + * + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Sets the path. + * + * @param string|null $path + * + * @return Cookie + */ + public function withPath($path) + { + $new = clone $this; + $new->path = $this->normalizePath($path); + + return $new; + } + + /** + * Checks whether this cookie is meant for this path. + * + * @see http://tools.ietf.org/html/rfc6265#section-5.1.4 + * + * @param string $path + * + * @return bool + */ + public function matchPath($path) + { + return $this->path === $path || (0 === strpos($path, rtrim($this->path, '/').'/')); + } + + /** + * Checks whether this cookie may only be sent over HTTPS. + * + * @return bool + */ + public function isSecure() + { + return $this->secure; + } + + /** + * Sets whether this cookie should only be sent over HTTPS. + * + * @param bool $secure + * + * @return Cookie + */ + public function withSecure($secure) + { + $new = clone $this; + $new->secure = (bool) $secure; + + return $new; + } + + /** + * Check whether this cookie may not be accessed through Javascript. + * + * @return bool + */ + public function isHttpOnly() + { + return $this->httpOnly; + } + + /** + * Sets whether this cookie may not be accessed through Javascript. + * + * @param bool $httpOnly + * + * @return Cookie + */ + public function withHttpOnly($httpOnly) + { + $new = clone $this; + $new->httpOnly = (bool) $httpOnly; + + return $new; + } + + /** + * Checks if this cookie represents the same cookie as $cookie. + * + * This does not compare the values, only name, domain and path. + * + * @param Cookie $cookie + * + * @return bool + */ + public function match(self $cookie) + { + return $this->name === $cookie->name && $this->domain === $cookie->domain and $this->path === $cookie->path; + } + + /** + * Validates cookie attributes. + * + * @return bool + */ + public function isValid() + { + try { + $this->validateName($this->name); + $this->validateValue($this->value); + $this->validateMaxAge($this->maxAge); + } catch (\InvalidArgumentException $e) { + return false; + } + + return true; + } + + /** + * Validates the name attribute. + * + * @see http://tools.ietf.org/search/rfc2616#section-2.2 + * + * @param string $name + * + * @throws \InvalidArgumentException if the name is empty or contains invalid characters + */ + private function validateName($name) + { + if (strlen($name) < 1) { + throw new \InvalidArgumentException('The name cannot be empty'); + } + + // Name attribute is a token as per spec in RFC 2616 + if (preg_match('/[\x00-\x20\x22\x28-\x29\x2C\x2F\x3A-\x40\x5B-\x5D\x7B\x7D\x7F]/', $name)) { + throw new \InvalidArgumentException(sprintf('The cookie name "%s" contains invalid characters.', $name)); + } + } + + /** + * Validates a value. + * + * @see http://tools.ietf.org/html/rfc6265#section-4.1.1 + * + * @param string|null $value + * + * @throws \InvalidArgumentException if the value contains invalid characters + */ + private function validateValue($value) + { + if (isset($value)) { + if (preg_match('/[^\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]/', $value)) { + throw new \InvalidArgumentException(sprintf('The cookie value "%s" contains invalid characters.', $value)); + } + } + } + + /** + * Validates a Max-Age attribute. + * + * @param int|null $maxAge + * + * @throws \InvalidArgumentException if the Max-Age is not an empty or integer value + */ + private function validateMaxAge($maxAge) + { + if (isset($maxAge)) { + if (!is_int($maxAge)) { + throw new \InvalidArgumentException('Max-Age must be integer'); + } + } + } + + /** + * Remove the leading '.' and lowercase the domain as per spec in RFC 6265. + * + * @see http://tools.ietf.org/html/rfc6265#section-4.1.2.3 + * @see http://tools.ietf.org/html/rfc6265#section-5.1.3 + * @see http://tools.ietf.org/html/rfc6265#section-5.2.3 + * + * @param string|null $domain + * + * @return string + */ + private function normalizeDomain($domain) + { + if (isset($domain)) { + $domain = ltrim(strtolower($domain), '.'); + } + + return $domain; + } + + /** + * Processes path as per spec in RFC 6265. + * + * @see http://tools.ietf.org/html/rfc6265#section-5.1.4 + * @see http://tools.ietf.org/html/rfc6265#section-5.2.4 + * + * @param string|null $path + * + * @return string + */ + private function normalizePath($path) + { + $path = rtrim($path, '/'); + + if (empty($path) or '/' !== substr($path, 0, 1)) { + $path = '/'; + } + + return $path; + } +} diff --git a/vendor/php-http/message/src/CookieJar.php b/vendor/php-http/message/src/CookieJar.php new file mode 100644 index 00000000..1479cc68 --- /dev/null +++ b/vendor/php-http/message/src/CookieJar.php @@ -0,0 +1,210 @@ + + */ +final class CookieJar implements \Countable, \IteratorAggregate +{ + /** + * @var \SplObjectStorage + */ + private $cookies; + + public function __construct() + { + $this->cookies = new \SplObjectStorage(); + } + + /** + * Checks if there is a cookie. + * + * @return bool + */ + public function hasCookie(Cookie $cookie) + { + return $this->cookies->contains($cookie); + } + + /** + * Adds a cookie. + */ + public function addCookie(Cookie $cookie) + { + if (!$this->hasCookie($cookie)) { + $cookies = $this->getMatchingCookies($cookie); + + foreach ($cookies as $matchingCookie) { + if ($cookie->getValue() !== $matchingCookie->getValue() || $cookie->getMaxAge() > $matchingCookie->getMaxAge()) { + $this->removeCookie($matchingCookie); + + continue; + } + } + + if ($cookie->hasValue()) { + $this->cookies->attach($cookie); + } + } + } + + /** + * Removes a cookie. + */ + public function removeCookie(Cookie $cookie) + { + $this->cookies->detach($cookie); + } + + /** + * Returns the cookies. + * + * @return Cookie[] + */ + public function getCookies() + { + $match = function ($matchCookie) { + return true; + }; + + return $this->findMatchingCookies($match); + } + + /** + * Returns all matching cookies. + * + * @return Cookie[] + */ + public function getMatchingCookies(Cookie $cookie) + { + $match = function ($matchCookie) use ($cookie) { + return $matchCookie->match($cookie); + }; + + return $this->findMatchingCookies($match); + } + + /** + * Finds matching cookies based on a callable. + * + * @return Cookie[] + */ + private function findMatchingCookies(callable $match) + { + $cookies = []; + + foreach ($this->cookies as $cookie) { + if ($match($cookie)) { + $cookies[] = $cookie; + } + } + + return $cookies; + } + + /** + * Checks if there are cookies. + * + * @return bool + */ + public function hasCookies() + { + return $this->cookies->count() > 0; + } + + /** + * Sets the cookies and removes any previous one. + * + * @param Cookie[] $cookies + */ + public function setCookies(array $cookies) + { + $this->clear(); + $this->addCookies($cookies); + } + + /** + * Adds some cookies. + * + * @param Cookie[] $cookies + */ + public function addCookies(array $cookies) + { + foreach ($cookies as $cookie) { + $this->addCookie($cookie); + } + } + + /** + * Removes some cookies. + * + * @param Cookie[] $cookies + */ + public function removeCookies(array $cookies) + { + foreach ($cookies as $cookie) { + $this->removeCookie($cookie); + } + } + + /** + * Removes cookies which match the given parameters. + * + * Null means that parameter should not be matched + * + * @param string|null $name + * @param string|null $domain + * @param string|null $path + */ + public function removeMatchingCookies($name = null, $domain = null, $path = null) + { + $match = function ($cookie) use ($name, $domain, $path) { + $match = true; + + if (isset($name)) { + $match = $match && ($cookie->getName() === $name); + } + + if (isset($domain)) { + $match = $match && $cookie->matchDomain($domain); + } + + if (isset($path)) { + $match = $match && $cookie->matchPath($path); + } + + return $match; + }; + + $cookies = $this->findMatchingCookies($match); + + $this->removeCookies($cookies); + } + + /** + * Removes all cookies. + */ + public function clear() + { + $this->cookies = new \SplObjectStorage(); + } + + /** + * {@inheritdoc} + */ + public function count() + { + return $this->cookies->count(); + } + + /** + * {@inheritdoc} + */ + public function getIterator() + { + return clone $this->cookies; + } +} diff --git a/vendor/php-http/message/src/CookieUtil.php b/vendor/php-http/message/src/CookieUtil.php new file mode 100644 index 00000000..44c53145 --- /dev/null +++ b/vendor/php-http/message/src/CookieUtil.php @@ -0,0 +1,53 @@ + + */ +trait MessageDecorator +{ + /** + * @var MessageInterface + */ + private $message; + + /** + * Returns the decorated message. + * + * Since the underlying Message is immutable as well + * exposing it is not an issue, because it's state cannot be altered + * + * @return MessageInterface + */ + public function getMessage() + { + return $this->message; + } + + /** + * {@inheritdoc} + */ + public function getProtocolVersion() + { + return $this->message->getProtocolVersion(); + } + + /** + * {@inheritdoc} + */ + public function withProtocolVersion($version) + { + $new = clone $this; + $new->message = $this->message->withProtocolVersion($version); + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getHeaders() + { + return $this->message->getHeaders(); + } + + /** + * {@inheritdoc} + */ + public function hasHeader($header) + { + return $this->message->hasHeader($header); + } + + /** + * {@inheritdoc} + */ + public function getHeader($header) + { + return $this->message->getHeader($header); + } + + /** + * {@inheritdoc} + */ + public function getHeaderLine($header) + { + return $this->message->getHeaderLine($header); + } + + /** + * {@inheritdoc} + */ + public function withHeader($header, $value) + { + $new = clone $this; + $new->message = $this->message->withHeader($header, $value); + + return $new; + } + + /** + * {@inheritdoc} + */ + public function withAddedHeader($header, $value) + { + $new = clone $this; + $new->message = $this->message->withAddedHeader($header, $value); + + return $new; + } + + /** + * {@inheritdoc} + */ + public function withoutHeader($header) + { + $new = clone $this; + $new->message = $this->message->withoutHeader($header); + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getBody() + { + return $this->message->getBody(); + } + + /** + * {@inheritdoc} + */ + public function withBody(StreamInterface $body) + { + $new = clone $this; + $new->message = $this->message->withBody($body); + + return $new; + } +} diff --git a/vendor/php-http/message/src/Decorator/RequestDecorator.php b/vendor/php-http/message/src/Decorator/RequestDecorator.php new file mode 100644 index 00000000..bd254a8f --- /dev/null +++ b/vendor/php-http/message/src/Decorator/RequestDecorator.php @@ -0,0 +1,86 @@ + + */ +trait RequestDecorator +{ + use MessageDecorator { + getMessage as getRequest; + } + + /** + * Exchanges the underlying request with another. + * + * @return self + */ + public function withRequest(RequestInterface $request) + { + $new = clone $this; + $new->message = $request; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getRequestTarget() + { + return $this->message->getRequestTarget(); + } + + /** + * {@inheritdoc} + */ + public function withRequestTarget($requestTarget) + { + $new = clone $this; + $new->message = $this->message->withRequestTarget($requestTarget); + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getMethod() + { + return $this->message->getMethod(); + } + + /** + * {@inheritdoc} + */ + public function withMethod($method) + { + $new = clone $this; + $new->message = $this->message->withMethod($method); + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getUri() + { + return $this->message->getUri(); + } + + /** + * {@inheritdoc} + */ + public function withUri(UriInterface $uri, $preserveHost = false) + { + $new = clone $this; + $new->message = $this->message->withUri($uri, $preserveHost); + + return $new; + } +} diff --git a/vendor/php-http/message/src/Decorator/ResponseDecorator.php b/vendor/php-http/message/src/Decorator/ResponseDecorator.php new file mode 100644 index 00000000..20319ed3 --- /dev/null +++ b/vendor/php-http/message/src/Decorator/ResponseDecorator.php @@ -0,0 +1,55 @@ + + */ +trait ResponseDecorator +{ + use MessageDecorator { + getMessage as getResponse; + } + + /** + * Exchanges the underlying response with another. + * + * @return self + */ + public function withResponse(ResponseInterface $response) + { + $new = clone $this; + $new->message = $response; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getStatusCode() + { + return $this->message->getStatusCode(); + } + + /** + * {@inheritdoc} + */ + public function withStatus($code, $reasonPhrase = '') + { + $new = clone $this; + $new->message = $this->message->withStatus($code, $reasonPhrase); + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getReasonPhrase() + { + return $this->message->getReasonPhrase(); + } +} diff --git a/vendor/php-http/message/src/Decorator/StreamDecorator.php b/vendor/php-http/message/src/Decorator/StreamDecorator.php new file mode 100644 index 00000000..f405c7af --- /dev/null +++ b/vendor/php-http/message/src/Decorator/StreamDecorator.php @@ -0,0 +1,138 @@ + + */ +trait StreamDecorator +{ + /** + * @var StreamInterface + */ + protected $stream; + + /** + * {@inheritdoc} + */ + public function __toString() + { + return $this->stream->__toString(); + } + + /** + * {@inheritdoc} + */ + public function close() + { + $this->stream->close(); + } + + /** + * {@inheritdoc} + */ + public function detach() + { + return $this->stream->detach(); + } + + /** + * {@inheritdoc} + */ + public function getSize() + { + return $this->stream->getSize(); + } + + /** + * {@inheritdoc} + */ + public function tell() + { + return $this->stream->tell(); + } + + /** + * {@inheritdoc} + */ + public function eof() + { + return $this->stream->eof(); + } + + /** + * {@inheritdoc} + */ + public function isSeekable() + { + return $this->stream->isSeekable(); + } + + /** + * {@inheritdoc} + */ + public function seek($offset, $whence = SEEK_SET) + { + $this->stream->seek($offset, $whence); + } + + /** + * {@inheritdoc} + */ + public function rewind() + { + $this->stream->rewind(); + } + + /** + * {@inheritdoc} + */ + public function isWritable() + { + return $this->stream->isWritable(); + } + + /** + * {@inheritdoc} + */ + public function write($string) + { + return $this->stream->write($string); + } + + /** + * {@inheritdoc} + */ + public function isReadable() + { + return $this->stream->isReadable(); + } + + /** + * {@inheritdoc} + */ + public function read($length) + { + return $this->stream->read($length); + } + + /** + * {@inheritdoc} + */ + public function getContents() + { + return $this->stream->getContents(); + } + + /** + * {@inheritdoc} + */ + public function getMetadata($key = null) + { + return $this->stream->getMetadata($key); + } +} diff --git a/vendor/php-http/message/src/Encoding/ChunkStream.php b/vendor/php-http/message/src/Encoding/ChunkStream.php new file mode 100644 index 00000000..74c2fbd0 --- /dev/null +++ b/vendor/php-http/message/src/Encoding/ChunkStream.php @@ -0,0 +1,39 @@ + + */ +class ChunkStream extends FilteredStream +{ + /** + * {@inheritdoc} + */ + protected function readFilter() + { + return 'chunk'; + } + + /** + * {@inheritdoc} + */ + protected function writeFilter() + { + return 'dechunk'; + } + + /** + * {@inheritdoc} + */ + protected function fill() + { + parent::fill(); + + if ($this->stream->eof()) { + $this->buffer .= "0\r\n\r\n"; + } + } +} diff --git a/vendor/php-http/message/src/Encoding/CompressStream.php b/vendor/php-http/message/src/Encoding/CompressStream.php new file mode 100644 index 00000000..bdb740a9 --- /dev/null +++ b/vendor/php-http/message/src/Encoding/CompressStream.php @@ -0,0 +1,45 @@ + + */ +class CompressStream extends FilteredStream +{ + /** + * @param int $level + */ + public function __construct(StreamInterface $stream, $level = -1) + { + if (!extension_loaded('zlib')) { + throw new \RuntimeException('The zlib extension must be enabled to use this stream'); + } + + parent::__construct($stream, ['window' => 15, 'level' => $level]); + + // @deprecated will be removed in 2.0 + $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => 15]); + } + + /** + * {@inheritdoc} + */ + protected function readFilter() + { + return 'zlib.deflate'; + } + + /** + * {@inheritdoc} + */ + protected function writeFilter() + { + return 'zlib.inflate'; + } +} diff --git a/vendor/php-http/message/src/Encoding/DechunkStream.php b/vendor/php-http/message/src/Encoding/DechunkStream.php new file mode 100644 index 00000000..4cade835 --- /dev/null +++ b/vendor/php-http/message/src/Encoding/DechunkStream.php @@ -0,0 +1,29 @@ + + */ +class DechunkStream extends FilteredStream +{ + /** + * {@inheritdoc} + */ + protected function readFilter() + { + return 'dechunk'; + } + + /** + * {@inheritdoc} + */ + protected function writeFilter() + { + return 'chunk'; + } +} diff --git a/vendor/php-http/message/src/Encoding/DecompressStream.php b/vendor/php-http/message/src/Encoding/DecompressStream.php new file mode 100644 index 00000000..ab3a3454 --- /dev/null +++ b/vendor/php-http/message/src/Encoding/DecompressStream.php @@ -0,0 +1,45 @@ + + */ +class DecompressStream extends FilteredStream +{ + /** + * @param int $level + */ + public function __construct(StreamInterface $stream, $level = -1) + { + if (!extension_loaded('zlib')) { + throw new \RuntimeException('The zlib extension must be enabled to use this stream'); + } + + parent::__construct($stream, ['window' => 15]); + + // @deprecated will be removed in 2.0 + $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => 15, 'level' => $level]); + } + + /** + * {@inheritdoc} + */ + protected function readFilter() + { + return 'zlib.inflate'; + } + + /** + * {@inheritdoc} + */ + protected function writeFilter() + { + return 'zlib.deflate'; + } +} diff --git a/vendor/php-http/message/src/Encoding/DeflateStream.php b/vendor/php-http/message/src/Encoding/DeflateStream.php new file mode 100644 index 00000000..2ab3e003 --- /dev/null +++ b/vendor/php-http/message/src/Encoding/DeflateStream.php @@ -0,0 +1,41 @@ + + */ +class DeflateStream extends FilteredStream +{ + /** + * @param int $level + */ + public function __construct(StreamInterface $stream, $level = -1) + { + parent::__construct($stream, ['window' => -15, 'level' => $level]); + + // @deprecated will be removed in 2.0 + $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => -15]); + } + + /** + * {@inheritdoc} + */ + protected function readFilter() + { + return 'zlib.deflate'; + } + + /** + * {@inheritdoc} + */ + protected function writeFilter() + { + return 'zlib.inflate'; + } +} diff --git a/vendor/php-http/message/src/Encoding/Filter/Chunk.php b/vendor/php-http/message/src/Encoding/Filter/Chunk.php new file mode 100644 index 00000000..0f8f53b3 --- /dev/null +++ b/vendor/php-http/message/src/Encoding/Filter/Chunk.php @@ -0,0 +1,30 @@ + + */ +class Chunk extends \php_user_filter +{ + /** + * {@inheritdoc} + */ + public function filter($in, $out, &$consumed, $closing) + { + while ($bucket = stream_bucket_make_writeable($in)) { + $lenbucket = stream_bucket_new($this->stream, dechex($bucket->datalen)."\r\n"); + stream_bucket_append($out, $lenbucket); + + $consumed += $bucket->datalen; + stream_bucket_append($out, $bucket); + + $lenbucket = stream_bucket_new($this->stream, "\r\n"); + stream_bucket_append($out, $lenbucket); + } + + return PSFS_PASS_ON; + } +} diff --git a/vendor/php-http/message/src/Encoding/FilteredStream.php b/vendor/php-http/message/src/Encoding/FilteredStream.php new file mode 100644 index 00000000..a937c82f --- /dev/null +++ b/vendor/php-http/message/src/Encoding/FilteredStream.php @@ -0,0 +1,234 @@ + + */ +abstract class FilteredStream implements StreamInterface +{ + use StreamDecorator { + rewind as private doRewind; + seek as private doSeek; + } + const BUFFER_SIZE = 8192; + + /** + * @var callable + */ + protected $readFilterCallback; + + /** + * @var resource + * + * @deprecated since version 1.5, will be removed in 2.0 + */ + protected $readFilter; + + /** + * @var callable + * + * @deprecated since version 1.5, will be removed in 2.0 + */ + protected $writeFilterCallback; + + /** + * @var resource + * + * @deprecated since version 1.5, will be removed in 2.0 + */ + protected $writeFilter; + + /** + * Internal buffer. + * + * @var string + */ + protected $buffer = ''; + + /** + * @param mixed|null $readFilterOptions + * @param mixed|null $writeFilterOptions deprecated since 1.5, will be removed in 2.0 + */ + public function __construct(StreamInterface $stream, $readFilterOptions = null, $writeFilterOptions = null) + { + if (null !== $readFilterOptions) { + $this->readFilterCallback = Filter\fun($this->readFilter(), $readFilterOptions); + } else { + $this->readFilterCallback = Filter\fun($this->readFilter()); + } + + if (null !== $writeFilterOptions) { + $this->writeFilterCallback = Filter\fun($this->writeFilter(), $writeFilterOptions); + + @trigger_error('The $writeFilterOptions argument is deprecated since version 1.5 and will be removed in 2.0.', E_USER_DEPRECATED); + } else { + $this->writeFilterCallback = Filter\fun($this->writeFilter()); + } + + $this->stream = $stream; + } + + /** + * {@inheritdoc} + */ + public function read($length) + { + if (strlen($this->buffer) >= $length) { + $read = substr($this->buffer, 0, $length); + $this->buffer = substr($this->buffer, $length); + + return $read; + } + + if ($this->stream->eof()) { + $buffer = $this->buffer; + $this->buffer = ''; + + return $buffer; + } + + $read = $this->buffer; + $this->buffer = ''; + $this->fill(); + + return $read.$this->read($length - strlen($read)); + } + + /** + * {@inheritdoc} + */ + public function eof() + { + return $this->stream->eof() && '' === $this->buffer; + } + + /** + * Buffer is filled by reading underlying stream. + * + * Callback is reading once more even if the stream is ended. + * This allow to get last data in the PHP buffer otherwise this + * bug is present : https://bugs.php.net/bug.php?id=48725 + */ + protected function fill() + { + $readFilterCallback = $this->readFilterCallback; + $this->buffer .= $readFilterCallback($this->stream->read(self::BUFFER_SIZE)); + + if ($this->stream->eof()) { + $this->buffer .= $readFilterCallback(); + } + } + + /** + * {@inheritdoc} + */ + public function getContents() + { + $buffer = ''; + + while (!$this->eof()) { + $buf = $this->read(self::BUFFER_SIZE); + // Using a loose equality here to match on '' and false. + if (null == $buf) { + break; + } + + $buffer .= $buf; + } + + return $buffer; + } + + /** + * Always returns null because we can't tell the size of a stream when we filter. + */ + public function getSize() + { + return null; + } + + /** + * {@inheritdoc} + */ + public function __toString() + { + return $this->getContents(); + } + + /** + * Filtered streams are not seekable. + * + * We would need to buffer and process everything to allow seeking. + */ + public function isSeekable() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function rewind() + { + @trigger_error('Filtered streams are not seekable. This method will start raising an exception in the next major version', E_USER_DEPRECATED); + $this->doRewind(); + } + + /** + * {@inheritdoc} + */ + public function seek($offset, $whence = SEEK_SET) + { + @trigger_error('Filtered streams are not seekable. This method will start raising an exception in the next major version', E_USER_DEPRECATED); + $this->doSeek($offset, $whence); + } + + /** + * Returns the read filter name. + * + * @return string + * + * @deprecated since version 1.5, will be removed in 2.0 + */ + public function getReadFilter() + { + @trigger_error('The '.__CLASS__.'::'.__METHOD__.' method is deprecated since version 1.5 and will be removed in 2.0.', E_USER_DEPRECATED); + + return $this->readFilter(); + } + + /** + * Returns the write filter name. + * + * @return string + */ + abstract protected function readFilter(); + + /** + * Returns the write filter name. + * + * @return string + * + * @deprecated since version 1.5, will be removed in 2.0 + */ + public function getWriteFilter() + { + @trigger_error('The '.__CLASS__.'::'.__METHOD__.' method is deprecated since version 1.5 and will be removed in 2.0.', E_USER_DEPRECATED); + + return $this->writeFilter(); + } + + /** + * Returns the write filter name. + * + * @return string + */ + abstract protected function writeFilter(); +} diff --git a/vendor/php-http/message/src/Encoding/GzipDecodeStream.php b/vendor/php-http/message/src/Encoding/GzipDecodeStream.php new file mode 100644 index 00000000..92b5dad5 --- /dev/null +++ b/vendor/php-http/message/src/Encoding/GzipDecodeStream.php @@ -0,0 +1,45 @@ + + */ +class GzipDecodeStream extends FilteredStream +{ + /** + * @param int $level + */ + public function __construct(StreamInterface $stream, $level = -1) + { + if (!extension_loaded('zlib')) { + throw new \RuntimeException('The zlib extension must be enabled to use this stream'); + } + + parent::__construct($stream, ['window' => 31]); + + // @deprecated will be removed in 2.0 + $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => 31, 'level' => $level]); + } + + /** + * {@inheritdoc} + */ + protected function readFilter() + { + return 'zlib.inflate'; + } + + /** + * {@inheritdoc} + */ + protected function writeFilter() + { + return 'zlib.deflate'; + } +} diff --git a/vendor/php-http/message/src/Encoding/GzipEncodeStream.php b/vendor/php-http/message/src/Encoding/GzipEncodeStream.php new file mode 100644 index 00000000..13f097a8 --- /dev/null +++ b/vendor/php-http/message/src/Encoding/GzipEncodeStream.php @@ -0,0 +1,45 @@ + + */ +class GzipEncodeStream extends FilteredStream +{ + /** + * @param int $level + */ + public function __construct(StreamInterface $stream, $level = -1) + { + if (!extension_loaded('zlib')) { + throw new \RuntimeException('The zlib extension must be enabled to use this stream'); + } + + parent::__construct($stream, ['window' => 31, 'level' => $level]); + + // @deprecated will be removed in 2.0 + $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => 31]); + } + + /** + * {@inheritdoc} + */ + protected function readFilter() + { + return 'zlib.deflate'; + } + + /** + * {@inheritdoc} + */ + protected function writeFilter() + { + return 'zlib.inflate'; + } +} diff --git a/vendor/php-http/message/src/Encoding/InflateStream.php b/vendor/php-http/message/src/Encoding/InflateStream.php new file mode 100644 index 00000000..06c51875 --- /dev/null +++ b/vendor/php-http/message/src/Encoding/InflateStream.php @@ -0,0 +1,45 @@ + + */ +class InflateStream extends FilteredStream +{ + /** + * @param int $level + */ + public function __construct(StreamInterface $stream, $level = -1) + { + if (!extension_loaded('zlib')) { + throw new \RuntimeException('The zlib extension must be enabled to use this stream'); + } + + parent::__construct($stream, ['window' => -15]); + + // @deprecated will be removed in 2.0 + $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => -15, 'level' => $level]); + } + + /** + * {@inheritdoc} + */ + protected function readFilter() + { + return 'zlib.inflate'; + } + + /** + * {@inheritdoc} + */ + protected function writeFilter() + { + return 'zlib.deflate'; + } +} diff --git a/vendor/php-http/message/src/Exception.php b/vendor/php-http/message/src/Exception.php new file mode 100644 index 00000000..80d4cd9d --- /dev/null +++ b/vendor/php-http/message/src/Exception.php @@ -0,0 +1,10 @@ + + */ +interface Formatter +{ + /** + * Formats a request. + * + * @return string + */ + public function formatRequest(RequestInterface $request); + + /** + * Formats a response. + * + * @return string + */ + public function formatResponse(ResponseInterface $response); +} diff --git a/vendor/php-http/message/src/Formatter/CurlCommandFormatter.php b/vendor/php-http/message/src/Formatter/CurlCommandFormatter.php new file mode 100644 index 00000000..78b1d55b --- /dev/null +++ b/vendor/php-http/message/src/Formatter/CurlCommandFormatter.php @@ -0,0 +1,93 @@ + + */ +class CurlCommandFormatter implements Formatter +{ + /** + * {@inheritdoc} + */ + public function formatRequest(RequestInterface $request) + { + $command = sprintf('curl %s', escapeshellarg((string) $request->getUri()->withFragment(''))); + if ('1.0' === $request->getProtocolVersion()) { + $command .= ' --http1.0'; + } elseif ('2.0' === $request->getProtocolVersion()) { + $command .= ' --http2'; + } + + $method = strtoupper($request->getMethod()); + if ('HEAD' === $method) { + $command .= ' --head'; + } elseif ('GET' !== $method) { + $command .= ' --request '.$method; + } + + $command .= $this->getHeadersAsCommandOptions($request); + + $body = $request->getBody(); + if ($body->getSize() > 0) { + // escapeshellarg argument max length on Windows, but longer body in curl command would be impractical anyways + if ($body->getSize() > 8192) { + $data = '[too long stream omitted]'; + } elseif ($body->isSeekable()) { + $data = $body->__toString(); + $body->rewind(); + // all non-printable ASCII characters and except for \t, \r, \n + if (preg_match('/([\x00-\x09\x0C\x0E-\x1F\x7F])/', $data)) { + $data = '[binary stream omitted]'; + } + } else { + $data = '[non-seekable stream omitted]'; + } + $escapedData = @escapeshellarg($data); + if (empty($escapedData)) { + $escapedData = 'We couldn\'t not escape the data properly'; + } + + $command .= sprintf(' --data %s', $escapedData); + } + + return $command; + } + + /** + * {@inheritdoc} + */ + public function formatResponse(ResponseInterface $response) + { + return ''; + } + + /** + * @return string + */ + private function getHeadersAsCommandOptions(RequestInterface $request) + { + $command = ''; + foreach ($request->getHeaders() as $name => $values) { + if ('host' === strtolower($name) && $values[0] === $request->getUri()->getHost()) { + continue; + } + + if ('user-agent' === strtolower($name)) { + $command .= sprintf(' -A %s', escapeshellarg($values[0])); + + continue; + } + + $command .= sprintf(' -H %s', escapeshellarg($name.': '.$request->getHeaderLine($name))); + } + + return $command; + } +} diff --git a/vendor/php-http/message/src/Formatter/FullHttpMessageFormatter.php b/vendor/php-http/message/src/Formatter/FullHttpMessageFormatter.php new file mode 100644 index 00000000..bb22efe2 --- /dev/null +++ b/vendor/php-http/message/src/Formatter/FullHttpMessageFormatter.php @@ -0,0 +1,106 @@ + + */ +class FullHttpMessageFormatter implements Formatter +{ + /** + * The maximum length of the body. + * + * @var int|null + */ + private $maxBodyLength; + + /** + * @var string + */ + private $binaryDetectionRegex; + + /** + * @param int|null $maxBodyLength + * @param string $binaryDetectionRegex By default, this is all non-printable ASCII characters and except for \t, \r, \n + */ + public function __construct($maxBodyLength = 1000, string $binaryDetectionRegex = '/([\x00-\x09\x0C\x0E-\x1F\x7F])/') + { + $this->maxBodyLength = $maxBodyLength; + $this->binaryDetectionRegex = $binaryDetectionRegex; + } + + /** + * {@inheritdoc} + */ + public function formatRequest(RequestInterface $request) + { + $message = sprintf( + "%s %s HTTP/%s\n", + $request->getMethod(), + $request->getRequestTarget(), + $request->getProtocolVersion() + ); + + foreach ($request->getHeaders() as $name => $values) { + $message .= $name.': '.implode(', ', $values)."\n"; + } + + return $this->addBody($request, $message); + } + + /** + * {@inheritdoc} + */ + public function formatResponse(ResponseInterface $response) + { + $message = sprintf( + "HTTP/%s %s %s\n", + $response->getProtocolVersion(), + $response->getStatusCode(), + $response->getReasonPhrase() + ); + + foreach ($response->getHeaders() as $name => $values) { + $message .= $name.': '.implode(', ', $values)."\n"; + } + + return $this->addBody($response, $message); + } + + /** + * Add the message body if the stream is seekable. + * + * @param string $message + * + * @return string + */ + private function addBody(MessageInterface $request, $message) + { + $message .= "\n"; + $stream = $request->getBody(); + if (!$stream->isSeekable() || 0 === $this->maxBodyLength) { + // Do not read the stream + return $message; + } + + $data = $stream->__toString(); + $stream->rewind(); + + if (preg_match($this->binaryDetectionRegex, $data)) { + return $message.'[binary stream omitted]'; + } + + if (null === $this->maxBodyLength) { + return $message.$data; + } + + return $message.mb_substr($data, 0, $this->maxBodyLength); + } +} diff --git a/vendor/php-http/message/src/Formatter/SimpleFormatter.php b/vendor/php-http/message/src/Formatter/SimpleFormatter.php new file mode 100644 index 00000000..b1fcabdb --- /dev/null +++ b/vendor/php-http/message/src/Formatter/SimpleFormatter.php @@ -0,0 +1,42 @@ + + * @author Márk Sági-Kazár + */ +class SimpleFormatter implements Formatter +{ + /** + * {@inheritdoc} + */ + public function formatRequest(RequestInterface $request) + { + return sprintf( + '%s %s %s', + $request->getMethod(), + $request->getUri()->__toString(), + $request->getProtocolVersion() + ); + } + + /** + * {@inheritdoc} + */ + public function formatResponse(ResponseInterface $response) + { + return sprintf( + '%s %s %s', + $response->getStatusCode(), + $response->getReasonPhrase(), + $response->getProtocolVersion() + ); + } +} diff --git a/vendor/php-http/message/src/MessageFactory/DiactorosMessageFactory.php b/vendor/php-http/message/src/MessageFactory/DiactorosMessageFactory.php new file mode 100644 index 00000000..6d54d351 --- /dev/null +++ b/vendor/php-http/message/src/MessageFactory/DiactorosMessageFactory.php @@ -0,0 +1,82 @@ + + * + * @deprecated This will be removed in php-http/message2.0. Consider using the official Diactoros PSR-17 factory + */ +final class DiactorosMessageFactory implements MessageFactory +{ + /** + * @var DiactorosStreamFactory + */ + private $streamFactory; + + public function __construct() + { + $this->streamFactory = new DiactorosStreamFactory(); + } + + /** + * {@inheritdoc} + */ + public function createRequest( + $method, + $uri, + array $headers = [], + $body = null, + $protocolVersion = '1.1' + ) { + if (class_exists(LaminasRequest::class)) { + return (new LaminasRequest( + $uri, + $method, + $this->streamFactory->createStream($body), + $headers + ))->withProtocolVersion($protocolVersion); + } + + return (new ZendRequest( + $uri, + $method, + $this->streamFactory->createStream($body), + $headers + ))->withProtocolVersion($protocolVersion); + } + + /** + * {@inheritdoc} + */ + public function createResponse( + $statusCode = 200, + $reasonPhrase = null, + array $headers = [], + $body = null, + $protocolVersion = '1.1' + ) { + if (class_exists(LaminasResponse::class)) { + return (new LaminasResponse( + $this->streamFactory->createStream($body), + $statusCode, + $headers + ))->withProtocolVersion($protocolVersion); + } + + return (new ZendResponse( + $this->streamFactory->createStream($body), + $statusCode, + $headers + ))->withProtocolVersion($protocolVersion); + } +} diff --git a/vendor/php-http/message/src/MessageFactory/GuzzleMessageFactory.php b/vendor/php-http/message/src/MessageFactory/GuzzleMessageFactory.php new file mode 100644 index 00000000..02989d9f --- /dev/null +++ b/vendor/php-http/message/src/MessageFactory/GuzzleMessageFactory.php @@ -0,0 +1,55 @@ + + * + * @deprecated This will be removed in php-http/message2.0. Consider using the official Guzzle PSR-17 factory + */ +final class GuzzleMessageFactory implements MessageFactory +{ + /** + * {@inheritdoc} + */ + public function createRequest( + $method, + $uri, + array $headers = [], + $body = null, + $protocolVersion = '1.1' + ) { + return new Request( + $method, + $uri, + $headers, + $body, + $protocolVersion + ); + } + + /** + * {@inheritdoc} + */ + public function createResponse( + $statusCode = 200, + $reasonPhrase = null, + array $headers = [], + $body = null, + $protocolVersion = '1.1' + ) { + return new Response( + $statusCode, + $headers, + $body, + $protocolVersion, + $reasonPhrase + ); + } +} diff --git a/vendor/php-http/message/src/MessageFactory/SlimMessageFactory.php b/vendor/php-http/message/src/MessageFactory/SlimMessageFactory.php new file mode 100644 index 00000000..bee93228 --- /dev/null +++ b/vendor/php-http/message/src/MessageFactory/SlimMessageFactory.php @@ -0,0 +1,74 @@ + + * + * @deprecated This will be removed in php-http/message2.0. Consider using the official Slim PSR-17 factory + */ +final class SlimMessageFactory implements MessageFactory +{ + /** + * @var SlimStreamFactory + */ + private $streamFactory; + + /** + * @var SlimUriFactory + */ + private $uriFactory; + + public function __construct() + { + $this->streamFactory = new SlimStreamFactory(); + $this->uriFactory = new SlimUriFactory(); + } + + /** + * {@inheritdoc} + */ + public function createRequest( + $method, + $uri, + array $headers = [], + $body = null, + $protocolVersion = '1.1' + ) { + return (new Request( + $method, + $this->uriFactory->createUri($uri), + new Headers($headers), + [], + [], + $this->streamFactory->createStream($body), + [] + ))->withProtocolVersion($protocolVersion); + } + + /** + * {@inheritdoc} + */ + public function createResponse( + $statusCode = 200, + $reasonPhrase = null, + array $headers = [], + $body = null, + $protocolVersion = '1.1' + ) { + return (new Response( + $statusCode, + new Headers($headers), + $this->streamFactory->createStream($body) + ))->withProtocolVersion($protocolVersion); + } +} diff --git a/vendor/php-http/message/src/RequestMatcher.php b/vendor/php-http/message/src/RequestMatcher.php new file mode 100644 index 00000000..94fe5324 --- /dev/null +++ b/vendor/php-http/message/src/RequestMatcher.php @@ -0,0 +1,26 @@ + + */ +interface RequestMatcher +{ + /** + * Decides whether the rule(s) implemented by the strategy matches the supplied request. + * + * @param RequestInterface $request The PSR7 request to check for a match + * + * @return bool true if the request matches, false otherwise + */ + public function matches(RequestInterface $request); +} diff --git a/vendor/php-http/message/src/RequestMatcher/CallbackRequestMatcher.php b/vendor/php-http/message/src/RequestMatcher/CallbackRequestMatcher.php new file mode 100644 index 00000000..1197dd95 --- /dev/null +++ b/vendor/php-http/message/src/RequestMatcher/CallbackRequestMatcher.php @@ -0,0 +1,32 @@ + + */ +final class CallbackRequestMatcher implements RequestMatcher +{ + /** + * @var callable + */ + private $callback; + + public function __construct(callable $callback) + { + $this->callback = $callback; + } + + /** + * {@inheritdoc} + */ + public function matches(RequestInterface $request) + { + return (bool) call_user_func($this->callback, $request); + } +} diff --git a/vendor/php-http/message/src/RequestMatcher/RegexRequestMatcher.php b/vendor/php-http/message/src/RequestMatcher/RegexRequestMatcher.php new file mode 100644 index 00000000..91f3729e --- /dev/null +++ b/vendor/php-http/message/src/RequestMatcher/RegexRequestMatcher.php @@ -0,0 +1,41 @@ + + * + * @deprecated since version 1.2 and will be removed in 2.0. Use {@link RequestMatcher} instead. + */ +final class RegexRequestMatcher implements RequestMatcher +{ + /** + * Matching regex. + * + * @var string + */ + private $regex; + + /** + * @param string $regex + */ + public function __construct($regex) + { + $this->regex = $regex; + } + + /** + * {@inheritdoc} + */ + public function matches(RequestInterface $request) + { + return (bool) preg_match($this->regex, (string) $request->getUri()); + } +} diff --git a/vendor/php-http/message/src/RequestMatcher/RequestMatcher.php b/vendor/php-http/message/src/RequestMatcher/RequestMatcher.php new file mode 100644 index 00000000..e2aa0212 --- /dev/null +++ b/vendor/php-http/message/src/RequestMatcher/RequestMatcher.php @@ -0,0 +1,78 @@ + + * @author Joel Wurtz + */ +final class RequestMatcher implements RequestMatcherInterface +{ + /** + * @var string + */ + private $path; + + /** + * @var string + */ + private $host; + + /** + * @var array + */ + private $methods = []; + + /** + * @var string[] + */ + private $schemes = []; + + /** + * The regular expressions used for path or host must be specified without delimiter. + * You do not need to escape the forward slash / to match it. + * + * @param string|null $path Regular expression for the path + * @param string|null $host Regular expression for the hostname + * @param string|string[]|null $methods Method or list of methods to match + * @param string|string[]|null $schemes Scheme or list of schemes to match (e.g. http or https) + */ + public function __construct($path = null, $host = null, $methods = [], $schemes = []) + { + $this->path = $path; + $this->host = $host; + $this->methods = array_map('strtoupper', (array) $methods); + $this->schemes = array_map('strtolower', (array) $schemes); + } + + /** + * {@inheritdoc} + * + * @api + */ + public function matches(RequestInterface $request) + { + if ($this->schemes && !in_array($request->getUri()->getScheme(), $this->schemes)) { + return false; + } + + if ($this->methods && !in_array($request->getMethod(), $this->methods)) { + return false; + } + + if (null !== $this->path && !preg_match('{'.$this->path.'}', rawurldecode($request->getUri()->getPath()))) { + return false; + } + + if (null !== $this->host && !preg_match('{'.$this->host.'}i', $request->getUri()->getHost())) { + return false; + } + + return true; + } +} diff --git a/vendor/php-http/message/src/Stream/BufferedStream.php b/vendor/php-http/message/src/Stream/BufferedStream.php new file mode 100644 index 00000000..1eac9747 --- /dev/null +++ b/vendor/php-http/message/src/Stream/BufferedStream.php @@ -0,0 +1,270 @@ +stream = $stream; + $this->size = $stream->getSize(); + + if ($useFileBuffer) { + $this->resource = fopen('php://temp/maxmemory:'.$memoryBuffer, 'rw+'); + } else { + $this->resource = fopen('php://memory', 'rw+'); + } + + if (false === $this->resource) { + throw new \RuntimeException('Cannot create a resource over temp or memory implementation'); + } + } + + /** + * {@inheritdoc} + */ + public function __toString() + { + try { + $this->rewind(); + + return $this->getContents(); + } catch (\Throwable $throwable) { + return ''; + } catch (\Exception $exception) { // Layer to be BC with PHP 5, remove this when we only support PHP 7+ + return ''; + } + } + + /** + * {@inheritdoc} + */ + public function close() + { + if (null === $this->resource) { + throw new \RuntimeException('Cannot close on a detached stream'); + } + + $this->stream->close(); + fclose($this->resource); + } + + /** + * {@inheritdoc} + */ + public function detach() + { + if (null === $this->resource) { + return; + } + + // Force reading the remaining data of the stream + $this->getContents(); + + $resource = $this->resource; + $this->stream->close(); + $this->stream = null; + $this->resource = null; + + return $resource; + } + + /** + * {@inheritdoc} + */ + public function getSize() + { + if (null === $this->resource) { + return; + } + + if (null === $this->size && $this->stream->eof()) { + return $this->written; + } + + return $this->size; + } + + /** + * {@inheritdoc} + */ + public function tell() + { + if (null === $this->resource) { + throw new \RuntimeException('Cannot tell on a detached stream'); + } + + return ftell($this->resource); + } + + /** + * {@inheritdoc} + */ + public function eof() + { + if (null === $this->resource) { + throw new \RuntimeException('Cannot call eof on a detached stream'); + } + + // We are at the end only when both our resource and underlying stream are at eof + return $this->stream->eof() && (ftell($this->resource) === $this->written); + } + + /** + * {@inheritdoc} + */ + public function isSeekable() + { + return null !== $this->resource; + } + + /** + * {@inheritdoc} + */ + public function seek($offset, $whence = SEEK_SET) + { + if (null === $this->resource) { + throw new \RuntimeException('Cannot seek on a detached stream'); + } + + fseek($this->resource, $offset, $whence); + } + + /** + * {@inheritdoc} + */ + public function rewind() + { + if (null === $this->resource) { + throw new \RuntimeException('Cannot rewind on a detached stream'); + } + + rewind($this->resource); + } + + /** + * {@inheritdoc} + */ + public function isWritable() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function write($string) + { + throw new \RuntimeException('Cannot write on this stream'); + } + + /** + * {@inheritdoc} + */ + public function isReadable() + { + return null !== $this->resource; + } + + /** + * {@inheritdoc} + */ + public function read($length) + { + if (null === $this->resource) { + throw new \RuntimeException('Cannot read on a detached stream'); + } + + $read = ''; + + // First read from the resource + if (ftell($this->resource) !== $this->written) { + $read = fread($this->resource, $length); + } + + $bytesRead = strlen($read); + + if ($bytesRead < $length) { + $streamRead = $this->stream->read($length - $bytesRead); + + // Write on the underlying stream what we read + $this->written += fwrite($this->resource, $streamRead); + $read .= $streamRead; + } + + return $read; + } + + /** + * {@inheritdoc} + */ + public function getContents() + { + if (null === $this->resource) { + throw new \RuntimeException('Cannot read on a detached stream'); + } + + $read = ''; + + while (!$this->eof()) { + $read .= $this->read(8192); + } + + return $read; + } + + /** + * {@inheritdoc} + */ + public function getMetadata($key = null) + { + if (null === $this->resource) { + if (null === $key) { + return []; + } + + return; + } + + $metadata = stream_get_meta_data($this->resource); + + if (null === $key) { + return $metadata; + } + + if (!array_key_exists($key, $metadata)) { + return; + } + + return $metadata[$key]; + } +} diff --git a/vendor/php-http/message/src/StreamFactory/DiactorosStreamFactory.php b/vendor/php-http/message/src/StreamFactory/DiactorosStreamFactory.php new file mode 100644 index 00000000..8ae2b288 --- /dev/null +++ b/vendor/php-http/message/src/StreamFactory/DiactorosStreamFactory.php @@ -0,0 +1,48 @@ + + * + * @deprecated This will be removed in php-http/message2.0. Consider using the official Diactoros PSR-17 factory + */ +final class DiactorosStreamFactory implements StreamFactory +{ + /** + * {@inheritdoc} + */ + public function createStream($body = null) + { + if ($body instanceof StreamInterface) { + return $body; + } + + if (is_resource($body)) { + if (class_exists(LaminasStream::class)) { + return new LaminasStream($body); + } + + return new ZendStream($body); + } + + if (class_exists(LaminasStream::class)) { + $stream = new LaminasStream('php://memory', 'rw'); + } else { + $stream = new ZendStream('php://memory', 'rw'); + } + + if (null !== $body && '' !== $body) { + $stream->write((string) $body); + } + + return $stream; + } +} diff --git a/vendor/php-http/message/src/StreamFactory/GuzzleStreamFactory.php b/vendor/php-http/message/src/StreamFactory/GuzzleStreamFactory.php new file mode 100644 index 00000000..14d83e94 --- /dev/null +++ b/vendor/php-http/message/src/StreamFactory/GuzzleStreamFactory.php @@ -0,0 +1,28 @@ + + * + * @deprecated This will be removed in php-http/message2.0. Consider using the official Guzzle PSR-17 factory + */ +final class GuzzleStreamFactory implements StreamFactory +{ + /** + * {@inheritdoc} + */ + public function createStream($body = null) + { + if (class_exists(Utils::class)) { + return Utils::streamFor($body); + } + + return \GuzzleHttp\Psr7\stream_for($body); + } +} diff --git a/vendor/php-http/message/src/StreamFactory/SlimStreamFactory.php b/vendor/php-http/message/src/StreamFactory/SlimStreamFactory.php new file mode 100644 index 00000000..9274aaee --- /dev/null +++ b/vendor/php-http/message/src/StreamFactory/SlimStreamFactory.php @@ -0,0 +1,39 @@ + + * + * @deprecated This will be removed in php-http/message2.0. Consider using the official Slim PSR-17 factory + */ +final class SlimStreamFactory implements StreamFactory +{ + /** + * {@inheritdoc} + */ + public function createStream($body = null) + { + if ($body instanceof StreamInterface) { + return $body; + } + + if (is_resource($body)) { + return new Stream($body); + } + + $resource = fopen('php://memory', 'r+'); + $stream = new Stream($resource); + if (null !== $body && '' !== $body) { + $stream->write((string) $body); + } + + return $stream; + } +} diff --git a/vendor/php-http/message/src/UriFactory/DiactorosUriFactory.php b/vendor/php-http/message/src/UriFactory/DiactorosUriFactory.php new file mode 100644 index 00000000..be883def --- /dev/null +++ b/vendor/php-http/message/src/UriFactory/DiactorosUriFactory.php @@ -0,0 +1,36 @@ + + * + * @deprecated This will be removed in php-http/message2.0. Consider using the official Diactoros PSR-17 factory + */ +final class DiactorosUriFactory implements UriFactory +{ + /** + * {@inheritdoc} + */ + public function createUri($uri) + { + if ($uri instanceof UriInterface) { + return $uri; + } elseif (is_string($uri)) { + if (class_exists(LaminasUri::class)) { + return new LaminasUri($uri); + } + + return new ZendUri($uri); + } + + throw new \InvalidArgumentException('URI must be a string or UriInterface'); + } +} diff --git a/vendor/php-http/message/src/UriFactory/GuzzleUriFactory.php b/vendor/php-http/message/src/UriFactory/GuzzleUriFactory.php new file mode 100644 index 00000000..e09ac61e --- /dev/null +++ b/vendor/php-http/message/src/UriFactory/GuzzleUriFactory.php @@ -0,0 +1,29 @@ + + * + * @deprecated This will be removed in php-http/message2.0. Consider using the official Guzzle PSR-17 factory + */ +final class GuzzleUriFactory implements UriFactory +{ + /** + * {@inheritdoc} + */ + public function createUri($uri) + { + if (class_exists(Utils::class)) { + return Utils::uriFor($uri); + } + + return uri_for($uri); + } +} diff --git a/vendor/php-http/message/src/UriFactory/SlimUriFactory.php b/vendor/php-http/message/src/UriFactory/SlimUriFactory.php new file mode 100644 index 00000000..e5bef036 --- /dev/null +++ b/vendor/php-http/message/src/UriFactory/SlimUriFactory.php @@ -0,0 +1,33 @@ + + * + * @deprecated This will be removed in php-http/message2.0. Consider using the official Slim PSR-17 factory + */ +final class SlimUriFactory implements UriFactory +{ + /** + * {@inheritdoc} + */ + public function createUri($uri) + { + if ($uri instanceof UriInterface) { + return $uri; + } + + if (is_string($uri)) { + return Uri::createFromString($uri); + } + + throw new \InvalidArgumentException('URI must be a string or UriInterface'); + } +} diff --git a/vendor/php-http/message/src/filters.php b/vendor/php-http/message/src/filters.php new file mode 100644 index 00000000..15ed73de --- /dev/null +++ b/vendor/php-http/message/src/filters.php @@ -0,0 +1,6 @@ + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/php-http/multipart-stream-builder/README.md b/vendor/php-http/multipart-stream-builder/README.md new file mode 100644 index 00000000..764ff73c --- /dev/null +++ b/vendor/php-http/multipart-stream-builder/README.md @@ -0,0 +1,38 @@ +# PSR-7 Multipart Stream Builder + +[![Latest Version](https://img.shields.io/github/release/php-http/multipart-stream-builder.svg?style=flat-square)](https://github.com/php-http/multipart-stream-builder/releases) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) +[![Build Status](https://img.shields.io/travis/php-http/multipart-stream-builder/master.svg?style=flat-square)](https://travis-ci.org/php-http/multipart-stream-builder) +[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/multipart-stream-builder.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/multipart-stream-builder) +[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/multipart-stream-builder.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/multipart-stream-builder) +[![Total Downloads](https://img.shields.io/packagist/dt/php-http/multipart-stream-builder.svg?style=flat-square)](https://packagist.org/packages/php-http/multipart-stream-builder) + +**A builder for Multipart PSR-7 Streams. The builder create streams independenly form any PSR-7 implementation.** + + +## Install + +Via Composer + +``` bash +$ composer require php-http/multipart-stream-builder +``` + +## Documentation + +Please see the [official documentation](http://php-http.readthedocs.org/en/latest/components/multipart-stream-builder.html). + + +## Contributing + +Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details. + + +## Security + +If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). + + +## License + +The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/multipart-stream-builder/composer.json b/vendor/php-http/multipart-stream-builder/composer.json new file mode 100644 index 00000000..5baa4af1 --- /dev/null +++ b/vendor/php-http/multipart-stream-builder/composer.json @@ -0,0 +1,44 @@ +{ + "name": "php-http/multipart-stream-builder", + "description": "A builder class that help you create a multipart stream", + "license": "MIT", + "keywords": ["http", "factory", "message", "stream", "multipart stream"], + "homepage": "http://php-http.org", + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + } + ], + "require": { + "php": "^7.1 || ^8.0", + "psr/http-message": "^1.0", + "psr/http-factory": "^1.0", + "php-http/message-factory": "^1.0.2", + "php-http/discovery": "^1.7" + }, + "require-dev": { + "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3", + "php-http/message": "^1.5", + "nyholm/psr7": "^1.0" + }, + "autoload": { + "psr-4": { + "Http\\Message\\MultipartStream\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "tests\\Http\\Message\\MultipartStream\\": "tests/" + } + }, + "scripts": { + "test": "vendor/bin/phpunit", + "test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml" + }, + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + } +} diff --git a/vendor/php-http/multipart-stream-builder/src/ApacheMimetypeHelper.php b/vendor/php-http/multipart-stream-builder/src/ApacheMimetypeHelper.php new file mode 100644 index 00000000..6e4ca660 --- /dev/null +++ b/vendor/php-http/multipart-stream-builder/src/ApacheMimetypeHelper.php @@ -0,0 +1,142 @@ + + */ +class ApacheMimetypeHelper implements MimetypeHelper +{ + /** + * {@inheritdoc} + * + * @see http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types + */ + public function getMimetypeFromFilename($filename) + { + return $this->getMimetypeFromExtension(pathinfo($filename, PATHINFO_EXTENSION)); + } + + /** + * {@inheritdoc} + * + * @see http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types + */ + public function getMimetypeFromExtension($extension) + { + static $mimetypes = [ + '7z' => 'application/x-7z-compressed', + 'aac' => 'audio/x-aac', + 'ai' => 'application/postscript', + 'aif' => 'audio/x-aiff', + 'asc' => 'text/plain', + 'asf' => 'video/x-ms-asf', + 'atom' => 'application/atom+xml', + 'avi' => 'video/x-msvideo', + 'bmp' => 'image/bmp', + 'bz2' => 'application/x-bzip2', + 'cer' => 'application/pkix-cert', + 'crl' => 'application/pkix-crl', + 'crt' => 'application/x-x509-ca-cert', + 'css' => 'text/css', + 'csv' => 'text/csv', + 'cu' => 'application/cu-seeme', + 'deb' => 'application/x-debian-package', + 'doc' => 'application/msword', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'dvi' => 'application/x-dvi', + 'eot' => 'application/vnd.ms-fontobject', + 'eps' => 'application/postscript', + 'epub' => 'application/epub+zip', + 'etx' => 'text/x-setext', + 'flac' => 'audio/flac', + 'flv' => 'video/x-flv', + 'gif' => 'image/gif', + 'gz' => 'application/gzip', + 'htm' => 'text/html', + 'html' => 'text/html', + 'ico' => 'image/x-icon', + 'ics' => 'text/calendar', + 'ini' => 'text/plain', + 'iso' => 'application/x-iso9660-image', + 'jar' => 'application/java-archive', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'js' => 'text/javascript', + 'json' => 'application/json', + 'latex' => 'application/x-latex', + 'log' => 'text/plain', + 'm4a' => 'audio/mp4', + 'm4v' => 'video/mp4', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mov' => 'video/quicktime', + 'mp3' => 'audio/mpeg', + 'mp4' => 'video/mp4', + 'mp4a' => 'audio/mp4', + 'mp4v' => 'video/mp4', + 'mpe' => 'video/mpeg', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpg4' => 'video/mp4', + 'oga' => 'audio/ogg', + 'ogg' => 'audio/ogg', + 'ogv' => 'video/ogg', + 'ogx' => 'application/ogg', + 'pbm' => 'image/x-portable-bitmap', + 'pdf' => 'application/pdf', + 'pgm' => 'image/x-portable-graymap', + 'png' => 'image/png', + 'pnm' => 'image/x-portable-anymap', + 'ppm' => 'image/x-portable-pixmap', + 'ppt' => 'application/vnd.ms-powerpoint', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'ps' => 'application/postscript', + 'qt' => 'video/quicktime', + 'rar' => 'application/x-rar-compressed', + 'ras' => 'image/x-cmu-raster', + 'rss' => 'application/rss+xml', + 'rtf' => 'application/rtf', + 'sgm' => 'text/sgml', + 'sgml' => 'text/sgml', + 'svg' => 'image/svg+xml', + 'swf' => 'application/x-shockwave-flash', + 'tar' => 'application/x-tar', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'torrent' => 'application/x-bittorrent', + 'ttf' => 'application/x-font-ttf', + 'txt' => 'text/plain', + 'wav' => 'audio/x-wav', + 'webm' => 'video/webm', + 'wma' => 'audio/x-ms-wma', + 'wmv' => 'video/x-ms-wmv', + 'woff' => 'application/x-font-woff', + 'wsdl' => 'application/wsdl+xml', + 'xbm' => 'image/x-xbitmap', + 'xls' => 'application/vnd.ms-excel', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xml' => 'application/xml', + 'xpm' => 'image/x-xpixmap', + 'xwd' => 'image/x-xwindowdump', + 'yaml' => 'text/yaml', + 'yml' => 'text/yaml', + 'zip' => 'application/zip', + + // Non-Apache standard + 'pkpass' => 'application/vnd.apple.pkpass', + 'msg' => 'application/vnd.ms-outlook', + ]; + + $extension = strtolower($extension); + + return isset($mimetypes[$extension]) + ? $mimetypes[$extension] + : null; + } +} diff --git a/vendor/php-http/multipart-stream-builder/src/CustomMimetypeHelper.php b/vendor/php-http/multipart-stream-builder/src/CustomMimetypeHelper.php new file mode 100644 index 00000000..9f3f0d92 --- /dev/null +++ b/vendor/php-http/multipart-stream-builder/src/CustomMimetypeHelper.php @@ -0,0 +1,51 @@ + + */ +class CustomMimetypeHelper extends ApacheMimetypeHelper +{ + /** + * @var array + */ + private $mimetypes = []; + + /** + * @param array $mimetypes should be of type extension => mimetype + */ + public function __construct(array $mimetypes = []) + { + $this->mimetypes = $mimetypes; + } + + /** + * @param string $extension + * @param string $mimetype + * + * @return $this + */ + public function addMimetype($extension, $mimetype) + { + $this->mimetypes[$extension] = $mimetype; + + return $this; + } + + /** + * {@inheritdoc} + * + * Check if we have any defined mimetypes and of not fallback to ApacheMimetypeHelper + */ + public function getMimetypeFromExtension($extension) + { + $extension = strtolower($extension); + + return isset($this->mimetypes[$extension]) + ? $this->mimetypes[$extension] + : parent::getMimetypeFromExtension($extension); + } +} diff --git a/vendor/php-http/multipart-stream-builder/src/MimetypeHelper.php b/vendor/php-http/multipart-stream-builder/src/MimetypeHelper.php new file mode 100644 index 00000000..7b5917ff --- /dev/null +++ b/vendor/php-http/multipart-stream-builder/src/MimetypeHelper.php @@ -0,0 +1,27 @@ + + */ +interface MimetypeHelper +{ + /** + * Determines the mimetype of a file by looking at its extension. + * + * @param string $filename + * + * @return string|null + */ + public function getMimetypeFromFilename($filename); + + /** + * Maps a file extensions to a mimetype. + * + * @param string $extension The file extension + * + * @return string|null + */ + public function getMimetypeFromExtension($extension); +} diff --git a/vendor/php-http/multipart-stream-builder/src/MultipartStreamBuilder.php b/vendor/php-http/multipart-stream-builder/src/MultipartStreamBuilder.php new file mode 100644 index 00000000..6f94dbef --- /dev/null +++ b/vendor/php-http/multipart-stream-builder/src/MultipartStreamBuilder.php @@ -0,0 +1,355 @@ + + */ +class MultipartStreamBuilder +{ + /** + * @var HttplugStreamFactory|StreamFactoryInterface + */ + private $streamFactory; + + /** + * @var MimetypeHelper + */ + private $mimetypeHelper; + + /** + * @var string + */ + private $boundary; + + /** + * @var array Element where each Element is an array with keys ['contents', 'headers'] + */ + private $data = []; + + /** + * @param HttplugStreamFactory|StreamFactoryInterface|null $streamFactory + */ + public function __construct($streamFactory = null) + { + if ($streamFactory instanceof StreamFactoryInterface || $streamFactory instanceof HttplugStreamFactory) { + $this->streamFactory = $streamFactory; + + return; + } + + if (null !== $streamFactory) { + throw new \LogicException(sprintf( + 'First arguemnt to the constructor of "%s" must be of type "%s", "%s" or null. Got %s', + __CLASS__, + StreamFactoryInterface::class, + HttplugStreamFactory::class, + \is_object($streamFactory) ? \get_class($streamFactory) : \gettype($streamFactory) + )); + } + + // Try to find a stream factory. + try { + $this->streamFactory = Psr17FactoryDiscovery::findStreamFactory(); + } catch (NotFoundException $psr17Exception) { + try { + $this->streamFactory = StreamFactoryDiscovery::find(); + } catch (NotFoundException $httplugException) { + // we could not find any factory. + throw $psr17Exception; + } + } + } + + /** + * Add a resource to the Multipart Stream. + * + * @param string|resource|\Psr\Http\Message\StreamInterface $resource the filepath, resource or StreamInterface of the data + * @param array $headers additional headers array: ['header-name' => 'header-value'] + * + * @return MultipartStreamBuilder + */ + public function addData($resource, array $headers = []) + { + $stream = $this->createStream($resource); + $this->data[] = ['contents' => $stream, 'headers' => $headers]; + + return $this; + } + + /** + * Add a resource to the Multipart Stream. + * + * @param string $name the formpost name + * @param string|resource|StreamInterface $resource + * @param array $options { + * + * @var array $headers additional headers ['header-name' => 'header-value'] + * @var string $filename + * } + * + * @return MultipartStreamBuilder + */ + public function addResource($name, $resource, array $options = []) + { + $stream = $this->createStream($resource); + + // validate options['headers'] exists + if (!isset($options['headers'])) { + $options['headers'] = []; + } + + // Try to add filename if it is missing + if (empty($options['filename'])) { + $options['filename'] = null; + $uri = $stream->getMetadata('uri'); + if ('php://' !== substr($uri, 0, 6)) { + $options['filename'] = $uri; + } + } + + $this->prepareHeaders($name, $stream, $options['filename'], $options['headers']); + + return $this->addData($stream, $options['headers']); + } + + /** + * Build the stream. + * + * @return StreamInterface + */ + public function build() + { + // Open a temporary read-write stream as buffer. + // If the size is less than predefined limit, things will stay in memory. + // If the size is more than that, things will be stored in temp file. + $buffer = fopen('php://temp', 'r+'); + foreach ($this->data as $data) { + // Add start and headers + fwrite($buffer, "--{$this->getBoundary()}\r\n". + $this->getHeaders($data['headers'])."\r\n"); + + /** @var $contentStream StreamInterface */ + $contentStream = $data['contents']; + + // Read stream into buffer + if ($contentStream->isSeekable()) { + $contentStream->rewind(); // rewind to beginning. + } + if ($contentStream->isReadable()) { + while (!$contentStream->eof()) { + // Read 1MB chunk into buffer until reached EOF. + fwrite($buffer, $contentStream->read(1048576)); + } + } else { + fwrite($buffer, $contentStream->__toString()); + } + fwrite($buffer, "\r\n"); + } + + // Append end + fwrite($buffer, "--{$this->getBoundary()}--\r\n"); + + // Rewind to starting position for reading. + fseek($buffer, 0); + + return $this->createStream($buffer); + } + + /** + * Add extra headers if they are missing. + * + * @param string $name + * @param string $filename + * @param array &$headers + */ + private function prepareHeaders($name, StreamInterface $stream, $filename, array &$headers) + { + $hasFilename = '0' === $filename || $filename; + + // Set a default content-disposition header if one was not provided + if (!$this->hasHeader($headers, 'content-disposition')) { + $headers['Content-Disposition'] = sprintf('form-data; name="%s"', $name); + if ($hasFilename) { + $headers['Content-Disposition'] .= sprintf('; filename="%s"', $this->basename($filename)); + } + } + + // Set a default content-length header if one was not provided + if (!$this->hasHeader($headers, 'content-length')) { + if ($length = $stream->getSize()) { + $headers['Content-Length'] = (string) $length; + } + } + + // Set a default Content-Type if one was not provided + if (!$this->hasHeader($headers, 'content-type') && $hasFilename) { + if ($type = $this->getMimetypeHelper()->getMimetypeFromFilename($filename)) { + $headers['Content-Type'] = $type; + } + } + } + + /** + * Get the headers formatted for the HTTP message. + * + * @return string + */ + private function getHeaders(array $headers) + { + $str = ''; + foreach ($headers as $key => $value) { + $str .= sprintf("%s: %s\r\n", $key, $value); + } + + return $str; + } + + /** + * Check if header exist. + * + * @param string $key case insensitive + * + * @return bool + */ + private function hasHeader(array $headers, $key) + { + $lowercaseHeader = strtolower($key); + foreach ($headers as $k => $v) { + if (strtolower($k) === $lowercaseHeader) { + return true; + } + } + + return false; + } + + /** + * Get the boundary that separates the streams. + * + * @return string + */ + public function getBoundary() + { + if (null === $this->boundary) { + $this->boundary = uniqid('', true); + } + + return $this->boundary; + } + + /** + * @param string $boundary + * + * @return MultipartStreamBuilder + */ + public function setBoundary($boundary) + { + $this->boundary = $boundary; + + return $this; + } + + /** + * @return MimetypeHelper + */ + private function getMimetypeHelper() + { + if (null === $this->mimetypeHelper) { + $this->mimetypeHelper = new ApacheMimetypeHelper(); + } + + return $this->mimetypeHelper; + } + + /** + * If you have custom file extension you may overwrite the default MimetypeHelper with your own. + * + * @return MultipartStreamBuilder + */ + public function setMimetypeHelper(MimetypeHelper $mimetypeHelper) + { + $this->mimetypeHelper = $mimetypeHelper; + + return $this; + } + + /** + * Reset and clear all stored data. This allows you to use builder for a subsequent request. + * + * @return MultipartStreamBuilder + */ + public function reset() + { + $this->data = []; + $this->boundary = null; + + return $this; + } + + /** + * Gets the filename from a given path. + * + * PHP's basename() does not properly support streams or filenames beginning with a non-US-ASCII character. + * + * @author Drupal 8.2 + * + * @param string $path + * + * @return string + */ + private function basename($path) + { + $separators = '/'; + if (DIRECTORY_SEPARATOR != '/') { + // For Windows OS add special separator. + $separators .= DIRECTORY_SEPARATOR; + } + + // Remove right-most slashes when $path points to directory. + $path = rtrim($path, $separators); + + // Returns the trailing part of the $path starting after one of the directory separators. + $filename = preg_match('@[^'.preg_quote($separators, '@').']+$@', $path, $matches) ? $matches[0] : ''; + + return $filename; + } + + /** + * @param string|resource|StreamInterface $resource + * + * @return StreamInterface + */ + private function createStream($resource) + { + if ($resource instanceof StreamInterface) { + return $resource; + } + + if ($this->streamFactory instanceof HttplugStreamFactory) { + return $this->streamFactory->createStream($resource); + } + + // Assert: We are using a PSR17 stream factory. + if (\is_string($resource)) { + return $this->streamFactory->createStream($resource); + } + + if (\is_resource($resource)) { + return $this->streamFactory->createStreamFromResource($resource); + } + + throw new \InvalidArgumentException(sprintf('First argument to "%s::createStream()" must be a string, resource or StreamInterface.', __CLASS__)); + } +} diff --git a/vendor/php-http/promise/CHANGELOG.md b/vendor/php-http/promise/CHANGELOG.md new file mode 100644 index 00000000..479deb8a --- /dev/null +++ b/vendor/php-http/promise/CHANGELOG.md @@ -0,0 +1,48 @@ +# Change Log + +## 1.1.0 - 2020-07-07 + +### Added + +- Test with PHP 7.1, 7.2, 7.3, 7.4 and 8.0 + +### Removed + +- PHP 5 and 7.0 support + +### Fixed + +- Fixed PHPDoc for `Promise::then` + +## 1.0.0 - 2016-01-26 + +### Removed + +- PSR-7 dependency + + +## 1.0.0-RC1 - 2016-01-12 + +### Added + +- Tests for full coverage + +## Changed + +- Updated package files +- Clarified wait method behavior +- Contributing guide moved to the documentation + + +## 0.1.1 - 2015-12-24 + +## Added + +- Fulfilled and Rejected promise implementations + + +## 0.1.0 - 2015-12-13 + +## Added + +- Promise interface diff --git a/vendor/php-http/promise/LICENSE b/vendor/php-http/promise/LICENSE new file mode 100644 index 00000000..4558d6f0 --- /dev/null +++ b/vendor/php-http/promise/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-2016 PHP HTTP Team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/php-http/promise/README.md b/vendor/php-http/promise/README.md new file mode 100644 index 00000000..ee95e093 --- /dev/null +++ b/vendor/php-http/promise/README.md @@ -0,0 +1,48 @@ +# Promise + +[![Latest Version](https://img.shields.io/github/release/php-http/promise.svg?style=flat-square)](https://github.com/php-http/promise/releases) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) +[![Build Status](https://img.shields.io/travis/php-http/promise.svg?style=flat-square)](https://travis-ci.org/php-http/promise) +[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/promise.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/promise) +[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/promise.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/promise) +[![Total Downloads](https://img.shields.io/packagist/dt/php-http/promise.svg?style=flat-square)](https://packagist.org/packages/php-http/promise) + +**Promise used for asynchronous HTTP requests.** + +**Note:** This will eventually be removed/deprecated and replaced with the upcoming Promise PSR. + + +## Install + +Via Composer + +``` bash +$ composer require php-http/promise +``` + + +## Documentation + +Please see the [official documentation](http://docs.php-http.org/en/latest/components/promise.html). + + +## Testing + +``` bash +$ composer test +``` + + +## Contributing + +Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html). + + +## Security + +If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). + + +## License + +The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/promise/composer.json b/vendor/php-http/promise/composer.json new file mode 100644 index 00000000..812167bc --- /dev/null +++ b/vendor/php-http/promise/composer.json @@ -0,0 +1,38 @@ +{ + "name": "php-http/promise", + "description": "Promise used for asynchronous HTTP requests", + "license": "MIT", + "keywords": ["promise"], + "homepage": "http://httplug.io", + "authors": [ + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "require": { + "php" : "^7.1 || ^8.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage" : "^4.3.2", + "phpspec/phpspec": "^5.1.2 || ^6.2" + }, + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "scripts": { + "test": "vendor/bin/phpspec run", + "test-ci": "vendor/bin/phpspec run -c phpspec.yml.ci" + }, + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + } +} diff --git a/vendor/php-http/promise/src/FulfilledPromise.php b/vendor/php-http/promise/src/FulfilledPromise.php new file mode 100644 index 00000000..f60f686a --- /dev/null +++ b/vendor/php-http/promise/src/FulfilledPromise.php @@ -0,0 +1,58 @@ + + */ +final class FulfilledPromise implements Promise +{ + /** + * @var mixed + */ + private $result; + + /** + * @param $result + */ + public function __construct($result) + { + $this->result = $result; + } + + /** + * {@inheritdoc} + */ + public function then(callable $onFulfilled = null, callable $onRejected = null) + { + if (null === $onFulfilled) { + return $this; + } + + try { + return new self($onFulfilled($this->result)); + } catch (\Exception $e) { + return new RejectedPromise($e); + } + } + + /** + * {@inheritdoc} + */ + public function getState() + { + return Promise::FULFILLED; + } + + /** + * {@inheritdoc} + */ + public function wait($unwrap = true) + { + if ($unwrap) { + return $this->result; + } + } +} diff --git a/vendor/php-http/promise/src/Promise.php b/vendor/php-http/promise/src/Promise.php new file mode 100644 index 00000000..3258ed0d --- /dev/null +++ b/vendor/php-http/promise/src/Promise.php @@ -0,0 +1,69 @@ + + * @author Márk Sági-Kazár + */ +interface Promise +{ + /** + * Promise has not been fulfilled or rejected. + */ + const PENDING = 'pending'; + + /** + * Promise has been fulfilled. + */ + const FULFILLED = 'fulfilled'; + + /** + * Promise has been rejected. + */ + const REJECTED = 'rejected'; + + /** + * Adds behavior for when the promise is resolved or rejected (response will be available, or error happens). + * + * If you do not care about one of the cases, you can set the corresponding callable to null + * The callback will be called when the value arrived and never more than once. + * + * @param callable|null $onFulfilled called when a response will be available + * @param callable|null $onRejected called when an exception occurs + * + * @return Promise a new resolved promise with value of the executed callback (onFulfilled / onRejected) + */ + public function then(callable $onFulfilled = null, callable $onRejected = null); + + /** + * Returns the state of the promise, one of PENDING, FULFILLED or REJECTED. + * + * @return string + */ + public function getState(); + + /** + * Wait for the promise to be fulfilled or rejected. + * + * When this method returns, the request has been resolved and if callables have been + * specified, the appropriate one has terminated. + * + * When $unwrap is true (the default), the response is returned, or the exception thrown + * on failure. Otherwise, nothing is returned or thrown. + * + * @param bool $unwrap Whether to return resolved value / throw reason or not + * + * @return mixed Resolved value, null if $unwrap is set to false + * + * @throws \Exception the rejection reason if $unwrap is set to true and the request failed + */ + public function wait($unwrap = true); +} diff --git a/vendor/php-http/promise/src/RejectedPromise.php b/vendor/php-http/promise/src/RejectedPromise.php new file mode 100644 index 00000000..e396a40f --- /dev/null +++ b/vendor/php-http/promise/src/RejectedPromise.php @@ -0,0 +1,58 @@ + + */ +final class RejectedPromise implements Promise +{ + /** + * @var \Exception + */ + private $exception; + + /** + * @param \Exception $exception + */ + public function __construct(\Exception $exception) + { + $this->exception = $exception; + } + + /** + * {@inheritdoc} + */ + public function then(callable $onFulfilled = null, callable $onRejected = null) + { + if (null === $onRejected) { + return $this; + } + + try { + return new FulfilledPromise($onRejected($this->exception)); + } catch (\Exception $e) { + return new self($e); + } + } + + /** + * {@inheritdoc} + */ + public function getState() + { + return Promise::REJECTED; + } + + /** + * {@inheritdoc} + */ + public function wait($unwrap = true) + { + if ($unwrap) { + throw $this->exception; + } + } +} diff --git a/vendor/psr/cache/CHANGELOG.md b/vendor/psr/cache/CHANGELOG.md new file mode 100644 index 00000000..58ddab05 --- /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 00000000..b1c2c97b --- /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 00000000..9855a318 --- /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 00000000..4b687971 --- /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 00000000..bb785f46 --- /dev/null +++ b/vendor/psr/cache/src/CacheException.php @@ -0,0 +1,10 @@ +=7.0.0", + "psr/http-message": "^1.0" + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} diff --git a/vendor/psr/http-factory/src/RequestFactoryInterface.php b/vendor/psr/http-factory/src/RequestFactoryInterface.php new file mode 100644 index 00000000..cb39a08b --- /dev/null +++ b/vendor/psr/http-factory/src/RequestFactoryInterface.php @@ -0,0 +1,18 @@ +=5.3.0" + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} diff --git a/vendor/psr/http-message/src/MessageInterface.php b/vendor/psr/http-message/src/MessageInterface.php new file mode 100644 index 00000000..dd46e5ec --- /dev/null +++ b/vendor/psr/http-message/src/MessageInterface.php @@ -0,0 +1,187 @@ +getHeaders() as $name => $values) { + * echo $name . ": " . implode(", ", $values); + * } + * + * // Emit headers iteratively: + * foreach ($message->getHeaders() as $name => $values) { + * foreach ($values as $value) { + * header(sprintf('%s: %s', $name, $value), false); + * } + * } + * + * While header names are not case-sensitive, getHeaders() will preserve the + * exact case in which headers were originally specified. + * + * @return string[][] Returns an associative array of the message's headers. Each + * key MUST be a header name, and each value MUST be an array of strings + * for that header. + */ + public function getHeaders(); + + /** + * Checks if a header exists by the given case-insensitive name. + * + * @param string $name Case-insensitive header field name. + * @return bool Returns true if any header names match the given header + * name using a case-insensitive string comparison. Returns false if + * no matching header name is found in the message. + */ + public function hasHeader($name); + + /** + * Retrieves a message header value by the given case-insensitive name. + * + * This method returns an array of all the header values of the given + * case-insensitive header name. + * + * If the header does not appear in the message, this method MUST return an + * empty array. + * + * @param string $name Case-insensitive header field name. + * @return string[] An array of string values as provided for the given + * header. If the header does not appear in the message, this method MUST + * return an empty array. + */ + public function getHeader($name); + + /** + * Retrieves a comma-separated string of the values for a single header. + * + * This method returns all of the header values of the given + * case-insensitive header name as a string concatenated together using + * a comma. + * + * NOTE: Not all header values may be appropriately represented using + * comma concatenation. For such headers, use getHeader() instead + * and supply your own delimiter when concatenating. + * + * If the header does not appear in the message, this method MUST return + * an empty string. + * + * @param string $name Case-insensitive header field name. + * @return string A string of values as provided for the given header + * concatenated together using a comma. If the header does not appear in + * the message, this method MUST return an empty string. + */ + public function getHeaderLine($name); + + /** + * Return an instance with the provided value replacing the specified header. + * + * While header names are case-insensitive, the casing of the header will + * be preserved by this function, and returned from getHeaders(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * new and/or updated header and value. + * + * @param string $name Case-insensitive header field name. + * @param string|string[] $value Header value(s). + * @return static + * @throws \InvalidArgumentException for invalid header names or values. + */ + public function withHeader($name, $value); + + /** + * Return an instance with the specified header appended with the given value. + * + * Existing values for the specified header will be maintained. The new + * value(s) will be appended to the existing list. If the header did not + * exist previously, it will be added. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * new header and/or value. + * + * @param string $name Case-insensitive header field name to add. + * @param string|string[] $value Header value(s). + * @return static + * @throws \InvalidArgumentException for invalid header names or values. + */ + public function withAddedHeader($name, $value); + + /** + * Return an instance without the specified header. + * + * Header resolution MUST be done without case-sensitivity. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that removes + * the named header. + * + * @param string $name Case-insensitive header field name to remove. + * @return static + */ + public function withoutHeader($name); + + /** + * Gets the body of the message. + * + * @return StreamInterface Returns the body as a stream. + */ + public function getBody(); + + /** + * Return an instance with the specified message body. + * + * The body MUST be a StreamInterface object. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return a new instance that has the + * new body stream. + * + * @param StreamInterface $body Body. + * @return static + * @throws \InvalidArgumentException When the body is not valid. + */ + public function withBody(StreamInterface $body); +} diff --git a/vendor/psr/http-message/src/RequestInterface.php b/vendor/psr/http-message/src/RequestInterface.php new file mode 100644 index 00000000..a96d4fd6 --- /dev/null +++ b/vendor/psr/http-message/src/RequestInterface.php @@ -0,0 +1,129 @@ +getQuery()` + * or from the `QUERY_STRING` server param. + * + * @return array + */ + public function getQueryParams(); + + /** + * Return an instance with the specified query string arguments. + * + * These values SHOULD remain immutable over the course of the incoming + * request. They MAY be injected during instantiation, such as from PHP's + * $_GET superglobal, or MAY be derived from some other value such as the + * URI. In cases where the arguments are parsed from the URI, the data + * MUST be compatible with what PHP's parse_str() would return for + * purposes of how duplicate query parameters are handled, and how nested + * sets are handled. + * + * Setting query string arguments MUST NOT change the URI stored by the + * request, nor the values in the server params. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated query string arguments. + * + * @param array $query Array of query string arguments, typically from + * $_GET. + * @return static + */ + public function withQueryParams(array $query); + + /** + * Retrieve normalized file upload data. + * + * This method returns upload metadata in a normalized tree, with each leaf + * an instance of Psr\Http\Message\UploadedFileInterface. + * + * These values MAY be prepared from $_FILES or the message body during + * instantiation, or MAY be injected via withUploadedFiles(). + * + * @return array An array tree of UploadedFileInterface instances; an empty + * array MUST be returned if no data is present. + */ + public function getUploadedFiles(); + + /** + * Create a new instance with the specified uploaded files. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated body parameters. + * + * @param array $uploadedFiles An array tree of UploadedFileInterface instances. + * @return static + * @throws \InvalidArgumentException if an invalid structure is provided. + */ + public function withUploadedFiles(array $uploadedFiles); + + /** + * Retrieve any parameters provided in the request body. + * + * If the request Content-Type is either application/x-www-form-urlencoded + * or multipart/form-data, and the request method is POST, this method MUST + * return the contents of $_POST. + * + * Otherwise, this method may return any results of deserializing + * the request body content; as parsing returns structured content, the + * potential types MUST be arrays or objects only. A null value indicates + * the absence of body content. + * + * @return null|array|object The deserialized body parameters, if any. + * These will typically be an array or object. + */ + public function getParsedBody(); + + /** + * Return an instance with the specified body parameters. + * + * These MAY be injected during instantiation. + * + * If the request Content-Type is either application/x-www-form-urlencoded + * or multipart/form-data, and the request method is POST, use this method + * ONLY to inject the contents of $_POST. + * + * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of + * deserializing the request body content. Deserialization/parsing returns + * structured data, and, as such, this method ONLY accepts arrays or objects, + * or a null value if nothing was available to parse. + * + * As an example, if content negotiation determines that the request data + * is a JSON payload, this method could be used to create a request + * instance with the deserialized parameters. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated body parameters. + * + * @param null|array|object $data The deserialized body data. This will + * typically be in an array or object. + * @return static + * @throws \InvalidArgumentException if an unsupported argument type is + * provided. + */ + public function withParsedBody($data); + + /** + * Retrieve attributes derived from the request. + * + * The request "attributes" may be used to allow injection of any + * parameters derived from the request: e.g., the results of path + * match operations; the results of decrypting cookies; the results of + * deserializing non-form-encoded message bodies; etc. Attributes + * will be application and request specific, and CAN be mutable. + * + * @return array Attributes derived from the request. + */ + public function getAttributes(); + + /** + * Retrieve a single derived request attribute. + * + * Retrieves a single derived request attribute as described in + * getAttributes(). If the attribute has not been previously set, returns + * the default value as provided. + * + * This method obviates the need for a hasAttribute() method, as it allows + * specifying a default value to return if the attribute is not found. + * + * @see getAttributes() + * @param string $name The attribute name. + * @param mixed $default Default value to return if the attribute does not exist. + * @return mixed + */ + public function getAttribute($name, $default = null); + + /** + * Return an instance with the specified derived request attribute. + * + * This method allows setting a single derived request attribute as + * described in getAttributes(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated attribute. + * + * @see getAttributes() + * @param string $name The attribute name. + * @param mixed $value The value of the attribute. + * @return static + */ + public function withAttribute($name, $value); + + /** + * Return an instance that removes the specified derived request attribute. + * + * This method allows removing a single derived request attribute as + * described in getAttributes(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that removes + * the attribute. + * + * @see getAttributes() + * @param string $name The attribute name. + * @return static + */ + public function withoutAttribute($name); +} diff --git a/vendor/psr/http-message/src/StreamInterface.php b/vendor/psr/http-message/src/StreamInterface.php new file mode 100644 index 00000000..f68f3912 --- /dev/null +++ b/vendor/psr/http-message/src/StreamInterface.php @@ -0,0 +1,158 @@ + + * [user-info@]host[:port] + * + * + * If the port component is not set or is the standard port for the current + * scheme, it SHOULD NOT be included. + * + * @see https://tools.ietf.org/html/rfc3986#section-3.2 + * @return string The URI authority, in "[user-info@]host[:port]" format. + */ + public function getAuthority(); + + /** + * Retrieve the user information component of the URI. + * + * If no user information is present, this method MUST return an empty + * string. + * + * If a user is present in the URI, this will return that value; + * additionally, if the password is also present, it will be appended to the + * user value, with a colon (":") separating the values. + * + * The trailing "@" character is not part of the user information and MUST + * NOT be added. + * + * @return string The URI user information, in "username[:password]" format. + */ + public function getUserInfo(); + + /** + * Retrieve the host component of the URI. + * + * If no host is present, this method MUST return an empty string. + * + * The value returned MUST be normalized to lowercase, per RFC 3986 + * Section 3.2.2. + * + * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 + * @return string The URI host. + */ + public function getHost(); + + /** + * Retrieve the port component of the URI. + * + * If a port is present, and it is non-standard for the current scheme, + * this method MUST return it as an integer. If the port is the standard port + * used with the current scheme, this method SHOULD return null. + * + * If no port is present, and no scheme is present, this method MUST return + * a null value. + * + * If no port is present, but a scheme is present, this method MAY return + * the standard port for that scheme, but SHOULD return null. + * + * @return null|int The URI port. + */ + public function getPort(); + + /** + * Retrieve the path component of the URI. + * + * The path can either be empty or absolute (starting with a slash) or + * rootless (not starting with a slash). Implementations MUST support all + * three syntaxes. + * + * Normally, the empty path "" and absolute path "/" are considered equal as + * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically + * do this normalization because in contexts with a trimmed base path, e.g. + * the front controller, this difference becomes significant. It's the task + * of the user to handle both "" and "/". + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.3. + * + * As an example, if the value should include a slash ("/") not intended as + * delimiter between path segments, that value MUST be passed in encoded + * form (e.g., "%2F") to the instance. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.3 + * @return string The URI path. + */ + public function getPath(); + + /** + * Retrieve the query string of the URI. + * + * If no query string is present, this method MUST return an empty string. + * + * The leading "?" character is not part of the query and MUST NOT be + * added. + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.4. + * + * As an example, if a value in a key/value pair of the query string should + * include an ampersand ("&") not intended as a delimiter between values, + * that value MUST be passed in encoded form (e.g., "%26") to the instance. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.4 + * @return string The URI query string. + */ + public function getQuery(); + + /** + * Retrieve the fragment component of the URI. + * + * If no fragment is present, this method MUST return an empty string. + * + * The leading "#" character is not part of the fragment and MUST NOT be + * added. + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.5. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.5 + * @return string The URI fragment. + */ + public function getFragment(); + + /** + * Return an instance with the specified scheme. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified scheme. + * + * Implementations MUST support the schemes "http" and "https" case + * insensitively, and MAY accommodate other schemes if required. + * + * An empty scheme is equivalent to removing the scheme. + * + * @param string $scheme The scheme to use with the new instance. + * @return static A new instance with the specified scheme. + * @throws \InvalidArgumentException for invalid or unsupported schemes. + */ + public function withScheme($scheme); + + /** + * Return an instance with the specified user information. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified user information. + * + * Password is optional, but the user information MUST include the + * user; an empty string for the user is equivalent to removing user + * information. + * + * @param string $user The user name to use for authority. + * @param null|string $password The password associated with $user. + * @return static A new instance with the specified user information. + */ + public function withUserInfo($user, $password = null); + + /** + * Return an instance with the specified host. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified host. + * + * An empty host value is equivalent to removing the host. + * + * @param string $host The hostname to use with the new instance. + * @return static A new instance with the specified host. + * @throws \InvalidArgumentException for invalid hostnames. + */ + public function withHost($host); + + /** + * Return an instance with the specified port. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified port. + * + * Implementations MUST raise an exception for ports outside the + * established TCP and UDP port ranges. + * + * A null value provided for the port is equivalent to removing the port + * information. + * + * @param null|int $port The port to use with the new instance; a null value + * removes the port information. + * @return static A new instance with the specified port. + * @throws \InvalidArgumentException for invalid ports. + */ + public function withPort($port); + + /** + * Return an instance with the specified path. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified path. + * + * The path can either be empty or absolute (starting with a slash) or + * rootless (not starting with a slash). Implementations MUST support all + * three syntaxes. + * + * If the path is intended to be domain-relative rather than path relative then + * it must begin with a slash ("/"). Paths not starting with a slash ("/") + * are assumed to be relative to some base path known to the application or + * consumer. + * + * Users can provide both encoded and decoded path characters. + * Implementations ensure the correct encoding as outlined in getPath(). + * + * @param string $path The path to use with the new instance. + * @return static A new instance with the specified path. + * @throws \InvalidArgumentException for invalid paths. + */ + public function withPath($path); + + /** + * Return an instance with the specified query string. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified query string. + * + * Users can provide both encoded and decoded query characters. + * Implementations ensure the correct encoding as outlined in getQuery(). + * + * An empty query string value is equivalent to removing the query string. + * + * @param string $query The query string to use with the new instance. + * @return static A new instance with the specified query string. + * @throws \InvalidArgumentException for invalid query strings. + */ + public function withQuery($query); + + /** + * Return an instance with the specified URI fragment. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified URI fragment. + * + * Users can provide both encoded and decoded fragment characters. + * Implementations ensure the correct encoding as outlined in getFragment(). + * + * An empty fragment value is equivalent to removing the fragment. + * + * @param string $fragment The fragment to use with the new instance. + * @return static A new instance with the specified fragment. + */ + public function withFragment($fragment); + + /** + * Return the string representation as a URI reference. + * + * Depending on which components of the URI are present, the resulting + * string is either a full URI or relative reference according to RFC 3986, + * Section 4.1. The method concatenates the various components of the URI, + * using the appropriate delimiters: + * + * - If a scheme is present, it MUST be suffixed by ":". + * - If an authority is present, it MUST be prefixed by "//". + * - The path can be concatenated without delimiters. But there are two + * cases where the path has to be adjusted to make the URI reference + * valid as PHP does not allow to throw an exception in __toString(): + * - If the path is rootless and an authority is present, the path MUST + * be prefixed by "/". + * - If the path is starting with more than one "/" and no authority is + * present, the starting slashes MUST be reduced to one. + * - If a query is present, it MUST be prefixed by "?". + * - If a fragment is present, it MUST be prefixed by "#". + * + * @see http://tools.ietf.org/html/rfc3986#section-4.1 + * @return string + */ + public function __toString(); +} diff --git a/vendor/ralouphie/getallheaders/LICENSE b/vendor/ralouphie/getallheaders/LICENSE new file mode 100644 index 00000000..be5540c2 --- /dev/null +++ b/vendor/ralouphie/getallheaders/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Ralph Khattar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/ralouphie/getallheaders/README.md b/vendor/ralouphie/getallheaders/README.md new file mode 100644 index 00000000..9430d76b --- /dev/null +++ b/vendor/ralouphie/getallheaders/README.md @@ -0,0 +1,27 @@ +getallheaders +============= + +PHP `getallheaders()` polyfill. Compatible with PHP >= 5.3. + +[![Build Status](https://travis-ci.org/ralouphie/getallheaders.svg?branch=master)](https://travis-ci.org/ralouphie/getallheaders) +[![Coverage Status](https://coveralls.io/repos/ralouphie/getallheaders/badge.png?branch=master)](https://coveralls.io/r/ralouphie/getallheaders?branch=master) +[![Latest Stable Version](https://poser.pugx.org/ralouphie/getallheaders/v/stable.png)](https://packagist.org/packages/ralouphie/getallheaders) +[![Latest Unstable Version](https://poser.pugx.org/ralouphie/getallheaders/v/unstable.png)](https://packagist.org/packages/ralouphie/getallheaders) +[![License](https://poser.pugx.org/ralouphie/getallheaders/license.png)](https://packagist.org/packages/ralouphie/getallheaders) + + +This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/function.getallheaders.php). + +## Install + +For PHP version **`>= 5.6`**: + +``` +composer require ralouphie/getallheaders +``` + +For PHP version **`< 5.6`**: + +``` +composer require ralouphie/getallheaders "^2" +``` diff --git a/vendor/ralouphie/getallheaders/composer.json b/vendor/ralouphie/getallheaders/composer.json new file mode 100644 index 00000000..de8ce62e --- /dev/null +++ b/vendor/ralouphie/getallheaders/composer.json @@ -0,0 +1,26 @@ +{ + "name": "ralouphie/getallheaders", + "description": "A polyfill for getallheaders.", + "license": "MIT", + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "^5 || ^6.5", + "php-coveralls/php-coveralls": "^2.1" + }, + "autoload": { + "files": ["src/getallheaders.php"] + }, + "autoload-dev": { + "psr-4": { + "getallheaders\\Tests\\": "tests/" + } + } +} diff --git a/vendor/ralouphie/getallheaders/src/getallheaders.php b/vendor/ralouphie/getallheaders/src/getallheaders.php new file mode 100644 index 00000000..c7285a5b --- /dev/null +++ b/vendor/ralouphie/getallheaders/src/getallheaders.php @@ -0,0 +1,46 @@ + 'Content-Type', + 'CONTENT_LENGTH' => 'Content-Length', + 'CONTENT_MD5' => 'Content-Md5', + ); + + foreach ($_SERVER as $key => $value) { + if (substr($key, 0, 5) === 'HTTP_') { + $key = substr($key, 5); + if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) { + $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key)))); + $headers[$key] = $value; + } + } elseif (isset($copy_server[$key])) { + $headers[$copy_server[$key]] = $value; + } + } + + if (!isset($headers['Authorization'])) { + if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) { + $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; + } elseif (isset($_SERVER['PHP_AUTH_USER'])) { + $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; + $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); + } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { + $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; + } + } + + return $headers; + } + +} diff --git a/vendor/symfony/deprecation-contracts/.gitignore b/vendor/symfony/deprecation-contracts/.gitignore new file mode 100644 index 00000000..c49a5d8d --- /dev/null +++ b/vendor/symfony/deprecation-contracts/.gitignore @@ -0,0 +1,3 @@ +vendor/ +composer.lock +phpunit.xml diff --git a/vendor/symfony/deprecation-contracts/CHANGELOG.md b/vendor/symfony/deprecation-contracts/CHANGELOG.md new file mode 100644 index 00000000..7932e261 --- /dev/null +++ b/vendor/symfony/deprecation-contracts/CHANGELOG.md @@ -0,0 +1,5 @@ +CHANGELOG +========= + +The changelog is maintained for all Symfony contracts at the following URL: +https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/vendor/symfony/deprecation-contracts/LICENSE b/vendor/symfony/deprecation-contracts/LICENSE new file mode 100644 index 00000000..ad85e173 --- /dev/null +++ b/vendor/symfony/deprecation-contracts/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020-2021 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/symfony/deprecation-contracts/README.md b/vendor/symfony/deprecation-contracts/README.md new file mode 100644 index 00000000..4957933a --- /dev/null +++ b/vendor/symfony/deprecation-contracts/README.md @@ -0,0 +1,26 @@ +Symfony Deprecation Contracts +============================= + +A generic function and convention to trigger deprecation notices. + +This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices. + +By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component, +the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments. + +The function requires at least 3 arguments: + - the name of the Composer package that is triggering the deprecation + - the version of the package that introduced the deprecation + - the message of the deprecation + - more arguments can be provided: they will be inserted in the message using `printf()` formatting + +Example: +```php +trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin'); +``` + +This will generate the following message: +`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.` + +While not necessarily recommended, the deprecation notices can be completely ignored by declaring an empty +`function trigger_deprecation() {}` in your application. diff --git a/vendor/symfony/deprecation-contracts/composer.json b/vendor/symfony/deprecation-contracts/composer.json new file mode 100644 index 00000000..cc7cc123 --- /dev/null +++ b/vendor/symfony/deprecation-contracts/composer.json @@ -0,0 +1,35 @@ +{ + "name": "symfony/deprecation-contracts", + "type": "library", + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1" + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + } +} diff --git a/vendor/symfony/deprecation-contracts/function.php b/vendor/symfony/deprecation-contracts/function.php new file mode 100644 index 00000000..d4371504 --- /dev/null +++ b/vendor/symfony/deprecation-contracts/function.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (!function_exists('trigger_deprecation')) { + /** + * Triggers a silenced deprecation notice. + * + * @param string $package The name of the Composer package that is triggering the deprecation + * @param string $version The version of the package that introduced the deprecation + * @param string $message The message of the deprecation + * @param mixed ...$args Values to insert in the message using printf() formatting + * + * @author Nicolas Grekas + */ + function trigger_deprecation(string $package, string $version, string $message, ...$args): void + { + @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); + } +} diff --git a/vendor/symfony/options-resolver/CHANGELOG.md b/vendor/symfony/options-resolver/CHANGELOG.md new file mode 100644 index 00000000..791a402f --- /dev/null +++ b/vendor/symfony/options-resolver/CHANGELOG.md @@ -0,0 +1,86 @@ +CHANGELOG +========= + +6.0 +--- + + * Remove `OptionsResolverIntrospector::getDeprecationMessage()` + +5.3 +--- + + * Add prototype definition for nested options + +5.1.0 +----- + + * added fluent configuration of options using `OptionResolver::define()` + * added `setInfo()` and `getInfo()` methods + * updated the signature of method `OptionsResolver::setDeprecated()` to `OptionsResolver::setDeprecation(string $option, string $package, string $version, $message)` + * deprecated `OptionsResolverIntrospector::getDeprecationMessage()`, use `OptionsResolverIntrospector::getDeprecation()` instead + +5.0.0 +----- + + * added argument `$triggerDeprecation` to `OptionsResolver::offsetGet()` + +4.3.0 +----- + + * added `OptionsResolver::addNormalizer` method + +4.2.0 +----- + + * added support for nested options definition + * added `setDeprecated` and `isDeprecated` methods + +3.4.0 +----- + + * added `OptionsResolverIntrospector` to inspect options definitions inside an `OptionsResolver` instance + * added array of types support in allowed types (e.g int[]) + +2.6.0 +----- + + * deprecated OptionsResolverInterface + * [BC BREAK] removed "array" type hint from OptionsResolverInterface methods + setRequired(), setAllowedValues(), addAllowedValues(), setAllowedTypes() and + addAllowedTypes() + * added OptionsResolver::setDefault() + * added OptionsResolver::hasDefault() + * added OptionsResolver::setNormalizer() + * added OptionsResolver::isRequired() + * added OptionsResolver::getRequiredOptions() + * added OptionsResolver::isMissing() + * added OptionsResolver::getMissingOptions() + * added OptionsResolver::setDefined() + * added OptionsResolver::isDefined() + * added OptionsResolver::getDefinedOptions() + * added OptionsResolver::remove() + * added OptionsResolver::clear() + * deprecated OptionsResolver::replaceDefaults() + * deprecated OptionsResolver::setOptional() in favor of setDefined() + * deprecated OptionsResolver::isKnown() in favor of isDefined() + * [BC BREAK] OptionsResolver::isRequired() returns true now if a required + option has a default value set + * [BC BREAK] merged Options into OptionsResolver and turned Options into an + interface + * deprecated Options::overload() (now in OptionsResolver) + * deprecated Options::set() (now in OptionsResolver) + * deprecated Options::get() (now in OptionsResolver) + * deprecated Options::has() (now in OptionsResolver) + * deprecated Options::replace() (now in OptionsResolver) + * [BC BREAK] Options::get() (now in OptionsResolver) can only be used within + lazy option/normalizer closures now + * [BC BREAK] removed Traversable interface from Options since using within + lazy option/normalizer closures resulted in exceptions + * [BC BREAK] removed Options::all() since using within lazy option/normalizer + closures resulted in exceptions + * [BC BREAK] OptionDefinitionException now extends LogicException instead of + RuntimeException + * [BC BREAK] normalizers are not executed anymore for unset options + * normalizers are executed after validating the options now + * [BC BREAK] an UndefinedOptionsException is now thrown instead of an + InvalidOptionsException when non-existing options are passed diff --git a/vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php b/vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php new file mode 100644 index 00000000..837fae08 --- /dev/null +++ b/vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php @@ -0,0 +1,104 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\OptionsResolver\Debug; + +use Symfony\Component\OptionsResolver\Exception\NoConfigurationException; +use Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException; +use Symfony\Component\OptionsResolver\OptionsResolver; + +/** + * @author Maxime Steinhausser + * + * @final + */ +class OptionsResolverIntrospector +{ + private $get; + + public function __construct(OptionsResolver $optionsResolver) + { + $this->get = \Closure::bind(function ($property, $option, $message) { + /** @var OptionsResolver $this */ + if (!$this->isDefined($option)) { + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist.', $option)); + } + + if (!\array_key_exists($option, $this->{$property})) { + throw new NoConfigurationException($message); + } + + return $this->{$property}[$option]; + }, $optionsResolver, $optionsResolver); + } + + /** + * @throws NoConfigurationException on no configured value + */ + public function getDefault(string $option): mixed + { + return ($this->get)('defaults', $option, sprintf('No default value was set for the "%s" option.', $option)); + } + + /** + * @return \Closure[] + * + * @throws NoConfigurationException on no configured closures + */ + public function getLazyClosures(string $option): array + { + return ($this->get)('lazy', $option, sprintf('No lazy closures were set for the "%s" option.', $option)); + } + + /** + * @return string[] + * + * @throws NoConfigurationException on no configured types + */ + public function getAllowedTypes(string $option): array + { + return ($this->get)('allowedTypes', $option, sprintf('No allowed types were set for the "%s" option.', $option)); + } + + /** + * @return mixed[] + * + * @throws NoConfigurationException on no configured values + */ + public function getAllowedValues(string $option): array + { + return ($this->get)('allowedValues', $option, sprintf('No allowed values were set for the "%s" option.', $option)); + } + + /** + * @throws NoConfigurationException on no configured normalizer + */ + public function getNormalizer(string $option): \Closure + { + return current($this->getNormalizers($option)); + } + + /** + * @throws NoConfigurationException when no normalizer is configured + */ + public function getNormalizers(string $option): array + { + return ($this->get)('normalizers', $option, sprintf('No normalizer was set for the "%s" option.', $option)); + } + + /** + * @throws NoConfigurationException on no configured deprecation + */ + public function getDeprecation(string $option): array + { + return ($this->get)('deprecated', $option, sprintf('No deprecation was set for the "%s" option.', $option)); + } +} diff --git a/vendor/symfony/options-resolver/Exception/AccessException.php b/vendor/symfony/options-resolver/Exception/AccessException.php new file mode 100644 index 00000000..c12b6806 --- /dev/null +++ b/vendor/symfony/options-resolver/Exception/AccessException.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\OptionsResolver\Exception; + +/** + * Thrown when trying to read an option outside of or write it inside of + * {@link \Symfony\Component\OptionsResolver\Options::resolve()}. + * + * @author Bernhard Schussek + */ +class AccessException extends \LogicException implements ExceptionInterface +{ +} diff --git a/vendor/symfony/options-resolver/Exception/ExceptionInterface.php b/vendor/symfony/options-resolver/Exception/ExceptionInterface.php new file mode 100644 index 00000000..ea99d050 --- /dev/null +++ b/vendor/symfony/options-resolver/Exception/ExceptionInterface.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\OptionsResolver\Exception; + +/** + * Marker interface for all exceptions thrown by the OptionsResolver component. + * + * @author Bernhard Schussek + */ +interface ExceptionInterface extends \Throwable +{ +} diff --git a/vendor/symfony/options-resolver/Exception/InvalidArgumentException.php b/vendor/symfony/options-resolver/Exception/InvalidArgumentException.php new file mode 100644 index 00000000..6d421d68 --- /dev/null +++ b/vendor/symfony/options-resolver/Exception/InvalidArgumentException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\OptionsResolver\Exception; + +/** + * Thrown when an argument is invalid. + * + * @author Bernhard Schussek + */ +class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface +{ +} diff --git a/vendor/symfony/options-resolver/Exception/InvalidOptionsException.php b/vendor/symfony/options-resolver/Exception/InvalidOptionsException.php new file mode 100644 index 00000000..6fd4f125 --- /dev/null +++ b/vendor/symfony/options-resolver/Exception/InvalidOptionsException.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\OptionsResolver\Exception; + +/** + * Thrown when the value of an option does not match its validation rules. + * + * You should make sure a valid value is passed to the option. + * + * @author Bernhard Schussek + */ +class InvalidOptionsException extends InvalidArgumentException +{ +} diff --git a/vendor/symfony/options-resolver/Exception/MissingOptionsException.php b/vendor/symfony/options-resolver/Exception/MissingOptionsException.php new file mode 100644 index 00000000..faa487f1 --- /dev/null +++ b/vendor/symfony/options-resolver/Exception/MissingOptionsException.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\OptionsResolver\Exception; + +/** + * Exception thrown when a required option is missing. + * + * Add the option to the passed options array. + * + * @author Bernhard Schussek + */ +class MissingOptionsException extends InvalidArgumentException +{ +} diff --git a/vendor/symfony/options-resolver/Exception/NoConfigurationException.php b/vendor/symfony/options-resolver/Exception/NoConfigurationException.php new file mode 100644 index 00000000..6693ec14 --- /dev/null +++ b/vendor/symfony/options-resolver/Exception/NoConfigurationException.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\OptionsResolver\Exception; + +use Symfony\Component\OptionsResolver\Debug\OptionsResolverIntrospector; + +/** + * Thrown when trying to introspect an option definition property + * for which no value was configured inside the OptionsResolver instance. + * + * @see OptionsResolverIntrospector + * + * @author Maxime Steinhausser + */ +class NoConfigurationException extends \RuntimeException implements ExceptionInterface +{ +} diff --git a/vendor/symfony/options-resolver/Exception/NoSuchOptionException.php b/vendor/symfony/options-resolver/Exception/NoSuchOptionException.php new file mode 100644 index 00000000..4c3280f4 --- /dev/null +++ b/vendor/symfony/options-resolver/Exception/NoSuchOptionException.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\OptionsResolver\Exception; + +/** + * Thrown when trying to read an option that has no value set. + * + * When accessing optional options from within a lazy option or normalizer you should first + * check whether the optional option is set. You can do this with `isset($options['optional'])`. + * In contrast to the {@link UndefinedOptionsException}, this is a runtime exception that can + * occur when evaluating lazy options. + * + * @author Tobias Schultze + */ +class NoSuchOptionException extends \OutOfBoundsException implements ExceptionInterface +{ +} diff --git a/vendor/symfony/options-resolver/Exception/OptionDefinitionException.php b/vendor/symfony/options-resolver/Exception/OptionDefinitionException.php new file mode 100644 index 00000000..e8e339d4 --- /dev/null +++ b/vendor/symfony/options-resolver/Exception/OptionDefinitionException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\OptionsResolver\Exception; + +/** + * Thrown when two lazy options have a cyclic dependency. + * + * @author Bernhard Schussek + */ +class OptionDefinitionException extends \LogicException implements ExceptionInterface +{ +} diff --git a/vendor/symfony/options-resolver/Exception/UndefinedOptionsException.php b/vendor/symfony/options-resolver/Exception/UndefinedOptionsException.php new file mode 100644 index 00000000..6ca3fce4 --- /dev/null +++ b/vendor/symfony/options-resolver/Exception/UndefinedOptionsException.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\OptionsResolver\Exception; + +/** + * Exception thrown when an undefined option is passed. + * + * You should remove the options in question from your code or define them + * beforehand. + * + * @author Bernhard Schussek + */ +class UndefinedOptionsException extends InvalidArgumentException +{ +} diff --git a/vendor/symfony/options-resolver/LICENSE b/vendor/symfony/options-resolver/LICENSE new file mode 100644 index 00000000..9ff2d0d6 --- /dev/null +++ b/vendor/symfony/options-resolver/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2021 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/symfony/options-resolver/OptionConfigurator.php b/vendor/symfony/options-resolver/OptionConfigurator.php new file mode 100644 index 00000000..37d51384 --- /dev/null +++ b/vendor/symfony/options-resolver/OptionConfigurator.php @@ -0,0 +1,137 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\OptionsResolver; + +use Symfony\Component\OptionsResolver\Exception\AccessException; + +final class OptionConfigurator +{ + private $name; + private $resolver; + + public function __construct(string $name, OptionsResolver $resolver) + { + $this->name = $name; + $this->resolver = $resolver; + $this->resolver->setDefined($name); + } + + /** + * Adds allowed types for this option. + * + * @return $this + * + * @throws AccessException If called from a lazy option or normalizer + */ + public function allowedTypes(string ...$types): static + { + $this->resolver->setAllowedTypes($this->name, $types); + + return $this; + } + + /** + * Sets allowed values for this option. + * + * @param mixed ...$values One or more acceptable values/closures + * + * @return $this + * + * @throws AccessException If called from a lazy option or normalizer + */ + public function allowedValues(mixed ...$values): static + { + $this->resolver->setAllowedValues($this->name, $values); + + return $this; + } + + /** + * Sets the default value for this option. + * + * @return $this + * + * @throws AccessException If called from a lazy option or normalizer + */ + public function default(mixed $value): static + { + $this->resolver->setDefault($this->name, $value); + + return $this; + } + + /** + * Defines an option configurator with the given name. + */ + public function define(string $option): self + { + return $this->resolver->define($option); + } + + /** + * Marks this option as deprecated. + * + * @param string $package The name of the composer package that is triggering the deprecation + * @param string $version The version of the package that introduced the deprecation + * @param string|\Closure $message The deprecation message to use + * + * @return $this + */ + public function deprecated(string $package, string $version, string|\Closure $message = 'The option "%name%" is deprecated.'): static + { + $this->resolver->setDeprecated($this->name, $package, $version, $message); + + return $this; + } + + /** + * Sets the normalizer for this option. + * + * @return $this + * + * @throws AccessException If called from a lazy option or normalizer + */ + public function normalize(\Closure $normalizer): static + { + $this->resolver->setNormalizer($this->name, $normalizer); + + return $this; + } + + /** + * Marks this option as required. + * + * @return $this + * + * @throws AccessException If called from a lazy option or normalizer + */ + public function required(): static + { + $this->resolver->setRequired($this->name); + + return $this; + } + + /** + * Sets an info message for an option. + * + * @return $this + * + * @throws AccessException If called from a lazy option or normalizer + */ + public function info(string $info): static + { + $this->resolver->setInfo($this->name, $info); + + return $this; + } +} diff --git a/vendor/symfony/options-resolver/Options.php b/vendor/symfony/options-resolver/Options.php new file mode 100644 index 00000000..d444ec42 --- /dev/null +++ b/vendor/symfony/options-resolver/Options.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\OptionsResolver; + +/** + * Contains resolved option values. + * + * @author Bernhard Schussek + * @author Tobias Schultze + */ +interface Options extends \ArrayAccess, \Countable +{ +} diff --git a/vendor/symfony/options-resolver/OptionsResolver.php b/vendor/symfony/options-resolver/OptionsResolver.php new file mode 100644 index 00000000..fe776447 --- /dev/null +++ b/vendor/symfony/options-resolver/OptionsResolver.php @@ -0,0 +1,1300 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\OptionsResolver; + +use Symfony\Component\OptionsResolver\Exception\AccessException; +use Symfony\Component\OptionsResolver\Exception\InvalidArgumentException; +use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; +use Symfony\Component\OptionsResolver\Exception\MissingOptionsException; +use Symfony\Component\OptionsResolver\Exception\NoSuchOptionException; +use Symfony\Component\OptionsResolver\Exception\OptionDefinitionException; +use Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException; + +/** + * Validates options and merges them with default values. + * + * @author Bernhard Schussek + * @author Tobias Schultze + */ +class OptionsResolver implements Options +{ + private const VALIDATION_FUNCTIONS = [ + 'bool' => 'is_bool', + 'boolean' => 'is_bool', + 'int' => 'is_int', + 'integer' => 'is_int', + 'long' => 'is_int', + 'float' => 'is_float', + 'double' => 'is_float', + 'real' => 'is_float', + 'numeric' => 'is_numeric', + 'string' => 'is_string', + 'scalar' => 'is_scalar', + 'array' => 'is_array', + 'iterable' => 'is_iterable', + 'countable' => 'is_countable', + 'callable' => 'is_callable', + 'object' => 'is_object', + 'resource' => 'is_resource', + ]; + + /** + * The names of all defined options. + */ + private $defined = []; + + /** + * The default option values. + */ + private $defaults = []; + + /** + * A list of closure for nested options. + * + * @var \Closure[][] + */ + private $nested = []; + + /** + * The names of required options. + */ + private $required = []; + + /** + * The resolved option values. + */ + private $resolved = []; + + /** + * A list of normalizer closures. + * + * @var \Closure[][] + */ + private $normalizers = []; + + /** + * A list of accepted values for each option. + */ + private $allowedValues = []; + + /** + * A list of accepted types for each option. + */ + private $allowedTypes = []; + + /** + * A list of info messages for each option. + */ + private $info = []; + + /** + * A list of closures for evaluating lazy options. + */ + private $lazy = []; + + /** + * A list of lazy options whose closure is currently being called. + * + * This list helps detecting circular dependencies between lazy options. + */ + private $calling = []; + + /** + * A list of deprecated options. + */ + private $deprecated = []; + + /** + * The list of options provided by the user. + */ + private $given = []; + + /** + * Whether the instance is locked for reading. + * + * Once locked, the options cannot be changed anymore. This is + * necessary in order to avoid inconsistencies during the resolving + * process. If any option is changed after being read, all evaluated + * lazy options that depend on this option would become invalid. + */ + private $locked = false; + + private $parentsOptions = []; + + /** + * Whether the whole options definition is marked as array prototype. + */ + private $prototype; + + /** + * The prototype array's index that is being read. + */ + private $prototypeIndex; + + /** + * Sets the default value of a given option. + * + * If the default value should be set based on other options, you can pass + * a closure with the following signature: + * + * function (Options $options) { + * // ... + * } + * + * The closure will be evaluated when {@link resolve()} is called. The + * closure has access to the resolved values of other options through the + * passed {@link Options} instance: + * + * function (Options $options) { + * if (isset($options['port'])) { + * // ... + * } + * } + * + * If you want to access the previously set default value, add a second + * argument to the closure's signature: + * + * $options->setDefault('name', 'Default Name'); + * + * $options->setDefault('name', function (Options $options, $previousValue) { + * // 'Default Name' === $previousValue + * }); + * + * This is mostly useful if the configuration of the {@link Options} object + * is spread across different locations of your code, such as base and + * sub-classes. + * + * If you want to define nested options, you can pass a closure with the + * following signature: + * + * $options->setDefault('database', function (OptionsResolver $resolver) { + * $resolver->setDefined(['dbname', 'host', 'port', 'user', 'pass']); + * } + * + * To get access to the parent options, add a second argument to the closure's + * signature: + * + * function (OptionsResolver $resolver, Options $parent) { + * // 'default' === $parent['connection'] + * } + * + * @return $this + * + * @throws AccessException If called from a lazy option or normalizer + */ + public function setDefault(string $option, mixed $value): static + { + // Setting is not possible once resolving starts, because then lazy + // options could manipulate the state of the object, leading to + // inconsistent results. + if ($this->locked) { + throw new AccessException('Default values cannot be set from a lazy option or normalizer.'); + } + + // If an option is a closure that should be evaluated lazily, store it + // in the "lazy" property. + if ($value instanceof \Closure) { + $reflClosure = new \ReflectionFunction($value); + $params = $reflClosure->getParameters(); + + if (isset($params[0]) && Options::class === $this->getParameterClassName($params[0])) { + // Initialize the option if no previous value exists + if (!isset($this->defaults[$option])) { + $this->defaults[$option] = null; + } + + // Ignore previous lazy options if the closure has no second parameter + if (!isset($this->lazy[$option]) || !isset($params[1])) { + $this->lazy[$option] = []; + } + + // Store closure for later evaluation + $this->lazy[$option][] = $value; + $this->defined[$option] = true; + + // Make sure the option is processed and is not nested anymore + unset($this->resolved[$option], $this->nested[$option]); + + return $this; + } + + if (isset($params[0]) && null !== ($type = $params[0]->getType()) && self::class === $type->getName() && (!isset($params[1]) || (($type = $params[1]->getType()) instanceof \ReflectionNamedType && Options::class === $type->getName()))) { + // Store closure for later evaluation + $this->nested[$option][] = $value; + $this->defaults[$option] = []; + $this->defined[$option] = true; + + // Make sure the option is processed and is not lazy anymore + unset($this->resolved[$option], $this->lazy[$option]); + + return $this; + } + } + + // This option is not lazy nor nested anymore + unset($this->lazy[$option], $this->nested[$option]); + + // Yet undefined options can be marked as resolved, because we only need + // to resolve options with lazy closures, normalizers or validation + // rules, none of which can exist for undefined options + // If the option was resolved before, update the resolved value + if (!isset($this->defined[$option]) || \array_key_exists($option, $this->resolved)) { + $this->resolved[$option] = $value; + } + + $this->defaults[$option] = $value; + $this->defined[$option] = true; + + return $this; + } + + /** + * @return $this + * + * @throws AccessException If called from a lazy option or normalizer + */ + public function setDefaults(array $defaults): static + { + foreach ($defaults as $option => $value) { + $this->setDefault($option, $value); + } + + return $this; + } + + /** + * Returns whether a default value is set for an option. + * + * Returns true if {@link setDefault()} was called for this option. + * An option is also considered set if it was set to null. + */ + public function hasDefault(string $option): bool + { + return \array_key_exists($option, $this->defaults); + } + + /** + * Marks one or more options as required. + * + * @param string|string[] $optionNames One or more option names + * + * @return $this + * + * @throws AccessException If called from a lazy option or normalizer + */ + public function setRequired(string|array $optionNames): static + { + if ($this->locked) { + throw new AccessException('Options cannot be made required from a lazy option or normalizer.'); + } + + foreach ((array) $optionNames as $option) { + $this->defined[$option] = true; + $this->required[$option] = true; + } + + return $this; + } + + /** + * Returns whether an option is required. + * + * An option is required if it was passed to {@link setRequired()}. + */ + public function isRequired(string $option): bool + { + return isset($this->required[$option]); + } + + /** + * Returns the names of all required options. + * + * @return string[] + * + * @see isRequired() + */ + public function getRequiredOptions(): array + { + return array_keys($this->required); + } + + /** + * Returns whether an option is missing a default value. + * + * An option is missing if it was passed to {@link setRequired()}, but not + * to {@link setDefault()}. This option must be passed explicitly to + * {@link resolve()}, otherwise an exception will be thrown. + */ + public function isMissing(string $option): bool + { + return isset($this->required[$option]) && !\array_key_exists($option, $this->defaults); + } + + /** + * Returns the names of all options missing a default value. + * + * @return string[] + */ + public function getMissingOptions(): array + { + return array_keys(array_diff_key($this->required, $this->defaults)); + } + + /** + * Defines a valid option name. + * + * Defines an option name without setting a default value. The option will + * be accepted when passed to {@link resolve()}. When not passed, the + * option will not be included in the resolved options. + * + * @param string|string[] $optionNames One or more option names + * + * @return $this + * + * @throws AccessException If called from a lazy option or normalizer + */ + public function setDefined(string|array $optionNames): static + { + if ($this->locked) { + throw new AccessException('Options cannot be defined from a lazy option or normalizer.'); + } + + foreach ((array) $optionNames as $option) { + $this->defined[$option] = true; + } + + return $this; + } + + /** + * Returns whether an option is defined. + * + * Returns true for any option passed to {@link setDefault()}, + * {@link setRequired()} or {@link setDefined()}. + */ + public function isDefined(string $option): bool + { + return isset($this->defined[$option]); + } + + /** + * Returns the names of all defined options. + * + * @return string[] + * + * @see isDefined() + */ + public function getDefinedOptions(): array + { + return array_keys($this->defined); + } + + public function isNested(string $option): bool + { + return isset($this->nested[$option]); + } + + /** + * Deprecates an option, allowed types or values. + * + * Instead of passing the message, you may also pass a closure with the + * following signature: + * + * function (Options $options, $value): string { + * // ... + * } + * + * The closure receives the value as argument and should return a string. + * Return an empty string to ignore the option deprecation. + * + * The closure is invoked when {@link resolve()} is called. The parameter + * passed to the closure is the value of the option after validating it + * and before normalizing it. + * + * @param string $package The name of the composer package that is triggering the deprecation + * @param string $version The version of the package that introduced the deprecation + * @param string|\Closure $message The deprecation message to use + * + * @return $this + */ + public function setDeprecated(string $option, string $package, string $version, string|\Closure $message = 'The option "%name%" is deprecated.'): static + { + if ($this->locked) { + throw new AccessException('Options cannot be deprecated from a lazy option or normalizer.'); + } + + if (!isset($this->defined[$option])) { + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist, defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + } + + if (!\is_string($message) && !$message instanceof \Closure) { + throw new InvalidArgumentException(sprintf('Invalid type for deprecation message argument, expected string or \Closure, but got "%s".', get_debug_type($message))); + } + + // ignore if empty string + if ('' === $message) { + return $this; + } + + $this->deprecated[$option] = [ + 'package' => $package, + 'version' => $version, + 'message' => $message, + ]; + + // Make sure the option is processed + unset($this->resolved[$option]); + + return $this; + } + + public function isDeprecated(string $option): bool + { + return isset($this->deprecated[$option]); + } + + /** + * Sets the normalizer for an option. + * + * The normalizer should be a closure with the following signature: + * + * function (Options $options, $value) { + * // ... + * } + * + * The closure is invoked when {@link resolve()} is called. The closure + * has access to the resolved values of other options through the passed + * {@link Options} instance. + * + * The second parameter passed to the closure is the value of + * the option. + * + * The resolved option value is set to the return value of the closure. + * + * @return $this + * + * @throws UndefinedOptionsException If the option is undefined + * @throws AccessException If called from a lazy option or normalizer + */ + public function setNormalizer(string $option, \Closure $normalizer) + { + if ($this->locked) { + throw new AccessException('Normalizers cannot be set from a lazy option or normalizer.'); + } + + if (!isset($this->defined[$option])) { + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + } + + $this->normalizers[$option] = [$normalizer]; + + // Make sure the option is processed + unset($this->resolved[$option]); + + return $this; + } + + /** + * Adds a normalizer for an option. + * + * The normalizer should be a closure with the following signature: + * + * function (Options $options, $value): mixed { + * // ... + * } + * + * The closure is invoked when {@link resolve()} is called. The closure + * has access to the resolved values of other options through the passed + * {@link Options} instance. + * + * The second parameter passed to the closure is the value of + * the option. + * + * The resolved option value is set to the return value of the closure. + * + * @return $this + * + * @throws UndefinedOptionsException If the option is undefined + * @throws AccessException If called from a lazy option or normalizer + */ + public function addNormalizer(string $option, \Closure $normalizer, bool $forcePrepend = false): static + { + if ($this->locked) { + throw new AccessException('Normalizers cannot be set from a lazy option or normalizer.'); + } + + if (!isset($this->defined[$option])) { + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + } + + if ($forcePrepend) { + $this->normalizers[$option] = $this->normalizers[$option] ?? []; + array_unshift($this->normalizers[$option], $normalizer); + } else { + $this->normalizers[$option][] = $normalizer; + } + + // Make sure the option is processed + unset($this->resolved[$option]); + + return $this; + } + + /** + * Sets allowed values for an option. + * + * Instead of passing values, you may also pass a closures with the + * following signature: + * + * function ($value) { + * // return true or false + * } + * + * The closure receives the value as argument and should return true to + * accept the value and false to reject the value. + * + * @param mixed $allowedValues One or more acceptable values/closures + * + * @return $this + * + * @throws UndefinedOptionsException If the option is undefined + * @throws AccessException If called from a lazy option or normalizer + */ + public function setAllowedValues(string $option, mixed $allowedValues) + { + if ($this->locked) { + throw new AccessException('Allowed values cannot be set from a lazy option or normalizer.'); + } + + if (!isset($this->defined[$option])) { + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + } + + $this->allowedValues[$option] = \is_array($allowedValues) ? $allowedValues : [$allowedValues]; + + // Make sure the option is processed + unset($this->resolved[$option]); + + return $this; + } + + /** + * Adds allowed values for an option. + * + * The values are merged with the allowed values defined previously. + * + * Instead of passing values, you may also pass a closures with the + * following signature: + * + * function ($value) { + * // return true or false + * } + * + * The closure receives the value as argument and should return true to + * accept the value and false to reject the value. + * + * @param mixed $allowedValues One or more acceptable values/closures + * + * @return $this + * + * @throws UndefinedOptionsException If the option is undefined + * @throws AccessException If called from a lazy option or normalizer + */ + public function addAllowedValues(string $option, mixed $allowedValues) + { + if ($this->locked) { + throw new AccessException('Allowed values cannot be added from a lazy option or normalizer.'); + } + + if (!isset($this->defined[$option])) { + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + } + + if (!\is_array($allowedValues)) { + $allowedValues = [$allowedValues]; + } + + if (!isset($this->allowedValues[$option])) { + $this->allowedValues[$option] = $allowedValues; + } else { + $this->allowedValues[$option] = array_merge($this->allowedValues[$option], $allowedValues); + } + + // Make sure the option is processed + unset($this->resolved[$option]); + + return $this; + } + + /** + * Sets allowed types for an option. + * + * Any type for which a corresponding is_() function exists is + * acceptable. Additionally, fully-qualified class or interface names may + * be passed. + * + * @param string|string[] $allowedTypes One or more accepted types + * + * @return $this + * + * @throws UndefinedOptionsException If the option is undefined + * @throws AccessException If called from a lazy option or normalizer + */ + public function setAllowedTypes(string $option, string|array $allowedTypes) + { + if ($this->locked) { + throw new AccessException('Allowed types cannot be set from a lazy option or normalizer.'); + } + + if (!isset($this->defined[$option])) { + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + } + + $this->allowedTypes[$option] = (array) $allowedTypes; + + // Make sure the option is processed + unset($this->resolved[$option]); + + return $this; + } + + /** + * Adds allowed types for an option. + * + * The types are merged with the allowed types defined previously. + * + * Any type for which a corresponding is_() function exists is + * acceptable. Additionally, fully-qualified class or interface names may + * be passed. + * + * @param string|string[] $allowedTypes One or more accepted types + * + * @return $this + * + * @throws UndefinedOptionsException If the option is undefined + * @throws AccessException If called from a lazy option or normalizer + */ + public function addAllowedTypes(string $option, string|array $allowedTypes) + { + if ($this->locked) { + throw new AccessException('Allowed types cannot be added from a lazy option or normalizer.'); + } + + if (!isset($this->defined[$option])) { + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + } + + if (!isset($this->allowedTypes[$option])) { + $this->allowedTypes[$option] = (array) $allowedTypes; + } else { + $this->allowedTypes[$option] = array_merge($this->allowedTypes[$option], (array) $allowedTypes); + } + + // Make sure the option is processed + unset($this->resolved[$option]); + + return $this; + } + + /** + * Defines an option configurator with the given name. + */ + public function define(string $option): OptionConfigurator + { + if (isset($this->defined[$option])) { + throw new OptionDefinitionException(sprintf('The option "%s" is already defined.', $option)); + } + + return new OptionConfigurator($option, $this); + } + + /** + * Sets an info message for an option. + * + * @return $this + * + * @throws UndefinedOptionsException If the option is undefined + * @throws AccessException If called from a lazy option or normalizer + */ + public function setInfo(string $option, string $info): static + { + if ($this->locked) { + throw new AccessException('The Info message cannot be set from a lazy option or normalizer.'); + } + + if (!isset($this->defined[$option])) { + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + } + + $this->info[$option] = $info; + + return $this; + } + + /** + * Gets the info message for an option. + */ + public function getInfo(string $option): ?string + { + if (!isset($this->defined[$option])) { + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + } + + return $this->info[$option] ?? null; + } + + /** + * Marks the whole options definition as array prototype. + * + * @return $this + * + * @throws AccessException If called from a lazy option, a normalizer or a root definition + */ + public function setPrototype(bool $prototype): static + { + if ($this->locked) { + throw new AccessException('The prototype property cannot be set from a lazy option or normalizer.'); + } + + if (null === $this->prototype && $prototype) { + throw new AccessException('The prototype property cannot be set from a root definition.'); + } + + $this->prototype = $prototype; + + return $this; + } + + public function isPrototype(): bool + { + return $this->prototype ?? false; + } + + /** + * Removes the option with the given name. + * + * Undefined options are ignored. + * + * @param string|string[] $optionNames One or more option names + * + * @return $this + * + * @throws AccessException If called from a lazy option or normalizer + */ + public function remove(string|array $optionNames): static + { + if ($this->locked) { + throw new AccessException('Options cannot be removed from a lazy option or normalizer.'); + } + + foreach ((array) $optionNames as $option) { + unset($this->defined[$option], $this->defaults[$option], $this->required[$option], $this->resolved[$option]); + unset($this->lazy[$option], $this->normalizers[$option], $this->allowedTypes[$option], $this->allowedValues[$option], $this->info[$option]); + } + + return $this; + } + + /** + * Removes all options. + * + * @return $this + * + * @throws AccessException If called from a lazy option or normalizer + */ + public function clear(): static + { + if ($this->locked) { + throw new AccessException('Options cannot be cleared from a lazy option or normalizer.'); + } + + $this->defined = []; + $this->defaults = []; + $this->nested = []; + $this->required = []; + $this->resolved = []; + $this->lazy = []; + $this->normalizers = []; + $this->allowedTypes = []; + $this->allowedValues = []; + $this->deprecated = []; + $this->info = []; + + return $this; + } + + /** + * Merges options with the default values stored in the container and + * validates them. + * + * Exceptions are thrown if: + * + * - Undefined options are passed; + * - Required options are missing; + * - Options have invalid types; + * - Options have invalid values. + * + * @throws UndefinedOptionsException If an option name is undefined + * @throws InvalidOptionsException If an option doesn't fulfill the + * specified validation rules + * @throws MissingOptionsException If a required option is missing + * @throws OptionDefinitionException If there is a cyclic dependency between + * lazy options and/or normalizers + * @throws NoSuchOptionException If a lazy option reads an unavailable option + * @throws AccessException If called from a lazy option or normalizer + */ + public function resolve(array $options = []): array + { + if ($this->locked) { + throw new AccessException('Options cannot be resolved from a lazy option or normalizer.'); + } + + // Allow this method to be called multiple times + $clone = clone $this; + + // Make sure that no unknown options are passed + $diff = array_diff_key($options, $clone->defined); + + if (\count($diff) > 0) { + ksort($clone->defined); + ksort($diff); + + throw new UndefinedOptionsException(sprintf((\count($diff) > 1 ? 'The options "%s" do not exist.' : 'The option "%s" does not exist.').' Defined options are: "%s".', $this->formatOptions(array_keys($diff)), implode('", "', array_keys($clone->defined)))); + } + + // Override options set by the user + foreach ($options as $option => $value) { + $clone->given[$option] = true; + $clone->defaults[$option] = $value; + unset($clone->resolved[$option], $clone->lazy[$option]); + } + + // Check whether any required option is missing + $diff = array_diff_key($clone->required, $clone->defaults); + + if (\count($diff) > 0) { + ksort($diff); + + throw new MissingOptionsException(sprintf(\count($diff) > 1 ? 'The required options "%s" are missing.' : 'The required option "%s" is missing.', $this->formatOptions(array_keys($diff)))); + } + + // Lock the container + $clone->locked = true; + + // Now process the individual options. Use offsetGet(), which resolves + // the option itself and any options that the option depends on + foreach ($clone->defaults as $option => $_) { + $clone->offsetGet($option); + } + + return $clone->resolved; + } + + /** + * Returns the resolved value of an option. + * + * @param bool $triggerDeprecation Whether to trigger the deprecation or not (true by default) + * + * @throws AccessException If accessing this method outside of + * {@link resolve()} + * @throws NoSuchOptionException If the option is not set + * @throws InvalidOptionsException If the option doesn't fulfill the + * specified validation rules + * @throws OptionDefinitionException If there is a cyclic dependency between + * lazy options and/or normalizers + */ + public function offsetGet(mixed $option, bool $triggerDeprecation = true): mixed + { + if (!$this->locked) { + throw new AccessException('Array access is only supported within closures of lazy options and normalizers.'); + } + + // Shortcut for resolved options + if (isset($this->resolved[$option]) || \array_key_exists($option, $this->resolved)) { + if ($triggerDeprecation && isset($this->deprecated[$option]) && (isset($this->given[$option]) || $this->calling) && \is_string($this->deprecated[$option]['message'])) { + trigger_deprecation($this->deprecated[$option]['package'], $this->deprecated[$option]['version'], strtr($this->deprecated[$option]['message'], ['%name%' => $option])); + } + + return $this->resolved[$option]; + } + + // Check whether the option is set at all + if (!isset($this->defaults[$option]) && !\array_key_exists($option, $this->defaults)) { + if (!isset($this->defined[$option])) { + throw new NoSuchOptionException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + } + + throw new NoSuchOptionException(sprintf('The optional option "%s" has no value set. You should make sure it is set with "isset" before reading it.', $this->formatOptions([$option]))); + } + + $value = $this->defaults[$option]; + + // Resolve the option if it is a nested definition + if (isset($this->nested[$option])) { + // If the closure is already being called, we have a cyclic dependency + if (isset($this->calling[$option])) { + throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); + } + + if (!\is_array($value)) { + throw new InvalidOptionsException(sprintf('The nested option "%s" with value %s is expected to be of type array, but is of type "%s".', $this->formatOptions([$option]), $this->formatValue($value), get_debug_type($value))); + } + + // The following section must be protected from cyclic calls. + $this->calling[$option] = true; + try { + $resolver = new self(); + $resolver->prototype = false; + $resolver->parentsOptions = $this->parentsOptions; + $resolver->parentsOptions[] = $option; + foreach ($this->nested[$option] as $closure) { + $closure($resolver, $this); + } + + if ($resolver->prototype) { + $values = []; + foreach ($value as $index => $prototypeValue) { + if (!\is_array($prototypeValue)) { + throw new InvalidOptionsException(sprintf('The value of the option "%s" is expected to be of type array of array, but is of type array of "%s".', $this->formatOptions([$option]), get_debug_type($prototypeValue))); + } + + $resolver->prototypeIndex = $index; + $values[$index] = $resolver->resolve($prototypeValue); + } + $value = $values; + } else { + $value = $resolver->resolve($value); + } + } finally { + $resolver->prototypeIndex = null; + unset($this->calling[$option]); + } + } + + // Resolve the option if the default value is lazily evaluated + if (isset($this->lazy[$option])) { + // If the closure is already being called, we have a cyclic + // dependency + if (isset($this->calling[$option])) { + throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); + } + + // The following section must be protected from cyclic + // calls. Set $calling for the current $option to detect a cyclic + // dependency + // BEGIN + $this->calling[$option] = true; + try { + foreach ($this->lazy[$option] as $closure) { + $value = $closure($this, $value); + } + } finally { + unset($this->calling[$option]); + } + // END + } + + // Validate the type of the resolved option + if (isset($this->allowedTypes[$option])) { + $valid = true; + $invalidTypes = []; + + foreach ($this->allowedTypes[$option] as $type) { + if ($valid = $this->verifyTypes($type, $value, $invalidTypes)) { + break; + } + } + + if (!$valid) { + $fmtActualValue = $this->formatValue($value); + $fmtAllowedTypes = implode('" or "', $this->allowedTypes[$option]); + $fmtProvidedTypes = implode('|', array_keys($invalidTypes)); + $allowedContainsArrayType = \count(array_filter($this->allowedTypes[$option], static function ($item) { + return str_ends_with($item, '[]'); + })) > 0; + + if (\is_array($value) && $allowedContainsArrayType) { + throw new InvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but one of the elements is of type "%s".', $this->formatOptions([$option]), $fmtActualValue, $fmtAllowedTypes, $fmtProvidedTypes)); + } + + throw new InvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but is of type "%s".', $this->formatOptions([$option]), $fmtActualValue, $fmtAllowedTypes, $fmtProvidedTypes)); + } + } + + // Validate the value of the resolved option + if (isset($this->allowedValues[$option])) { + $success = false; + $printableAllowedValues = []; + + foreach ($this->allowedValues[$option] as $allowedValue) { + if ($allowedValue instanceof \Closure) { + if ($allowedValue($value)) { + $success = true; + break; + } + + // Don't include closures in the exception message + continue; + } + + if ($value === $allowedValue) { + $success = true; + break; + } + + $printableAllowedValues[] = $allowedValue; + } + + if (!$success) { + $message = sprintf( + 'The option "%s" with value %s is invalid.', + $option, + $this->formatValue($value) + ); + + if (\count($printableAllowedValues) > 0) { + $message .= sprintf( + ' Accepted values are: %s.', + $this->formatValues($printableAllowedValues) + ); + } + + if (isset($this->info[$option])) { + $message .= sprintf(' Info: %s.', $this->info[$option]); + } + + throw new InvalidOptionsException($message); + } + } + + // Check whether the option is deprecated + // and it is provided by the user or is being called from a lazy evaluation + if ($triggerDeprecation && isset($this->deprecated[$option]) && (isset($this->given[$option]) || ($this->calling && \is_string($this->deprecated[$option]['message'])))) { + $deprecation = $this->deprecated[$option]; + $message = $this->deprecated[$option]['message']; + + if ($message instanceof \Closure) { + // If the closure is already being called, we have a cyclic dependency + if (isset($this->calling[$option])) { + throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); + } + + $this->calling[$option] = true; + try { + if (!\is_string($message = $message($this, $value))) { + throw new InvalidOptionsException(sprintf('Invalid type for deprecation message, expected string but got "%s", return an empty string to ignore.', get_debug_type($message))); + } + } finally { + unset($this->calling[$option]); + } + } + + if ('' !== $message) { + trigger_deprecation($deprecation['package'], $deprecation['version'], strtr($message, ['%name%' => $option])); + } + } + + // Normalize the validated option + if (isset($this->normalizers[$option])) { + // If the closure is already being called, we have a cyclic + // dependency + if (isset($this->calling[$option])) { + throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); + } + + // The following section must be protected from cyclic + // calls. Set $calling for the current $option to detect a cyclic + // dependency + // BEGIN + $this->calling[$option] = true; + try { + foreach ($this->normalizers[$option] as $normalizer) { + $value = $normalizer($this, $value); + } + } finally { + unset($this->calling[$option]); + } + // END + } + + // Mark as resolved + $this->resolved[$option] = $value; + + return $value; + } + + private function verifyTypes(string $type, mixed $value, array &$invalidTypes, int $level = 0): bool + { + if (\is_array($value) && '[]' === substr($type, -2)) { + $type = substr($type, 0, -2); + $valid = true; + + foreach ($value as $val) { + if (!$this->verifyTypes($type, $val, $invalidTypes, $level + 1)) { + $valid = false; + } + } + + return $valid; + } + + if (('null' === $type && null === $value) || (isset(self::VALIDATION_FUNCTIONS[$type]) ? self::VALIDATION_FUNCTIONS[$type]($value) : $value instanceof $type)) { + return true; + } + + if (!$invalidTypes || $level > 0) { + $invalidTypes[get_debug_type($value)] = true; + } + + return false; + } + + /** + * Returns whether a resolved option with the given name exists. + * + * @throws AccessException If accessing this method outside of {@link resolve()} + * + * @see \ArrayAccess::offsetExists() + */ + public function offsetExists(mixed $option): bool + { + if (!$this->locked) { + throw new AccessException('Array access is only supported within closures of lazy options and normalizers.'); + } + + return \array_key_exists($option, $this->defaults); + } + + /** + * Not supported. + * + * @throws AccessException + */ + public function offsetSet(mixed $option, mixed $value): void + { + throw new AccessException('Setting options via array access is not supported. Use setDefault() instead.'); + } + + /** + * Not supported. + * + * @throws AccessException + */ + public function offsetUnset(mixed $option): void + { + throw new AccessException('Removing options via array access is not supported. Use remove() instead.'); + } + + /** + * Returns the number of set options. + * + * This may be only a subset of the defined options. + * + * @throws AccessException If accessing this method outside of {@link resolve()} + * + * @see \Countable::count() + */ + public function count(): int + { + if (!$this->locked) { + throw new AccessException('Counting is only supported within closures of lazy options and normalizers.'); + } + + return \count($this->defaults); + } + + /** + * Returns a string representation of the value. + * + * This method returns the equivalent PHP tokens for most scalar types + * (i.e. "false" for false, "1" for 1 etc.). Strings are always wrapped + * in double quotes ("). + */ + private function formatValue(mixed $value): string + { + if (\is_object($value)) { + return \get_class($value); + } + + if (\is_array($value)) { + return 'array'; + } + + if (\is_string($value)) { + return '"'.$value.'"'; + } + + if (\is_resource($value)) { + return 'resource'; + } + + if (null === $value) { + return 'null'; + } + + if (false === $value) { + return 'false'; + } + + if (true === $value) { + return 'true'; + } + + return (string) $value; + } + + /** + * Returns a string representation of a list of values. + * + * Each of the values is converted to a string using + * {@link formatValue()}. The values are then concatenated with commas. + * + * @see formatValue() + */ + private function formatValues(array $values): string + { + foreach ($values as $key => $value) { + $values[$key] = $this->formatValue($value); + } + + return implode(', ', $values); + } + + private function formatOptions(array $options): string + { + if ($this->parentsOptions) { + $prefix = array_shift($this->parentsOptions); + if ($this->parentsOptions) { + $prefix .= sprintf('[%s]', implode('][', $this->parentsOptions)); + } + + if ($this->prototype && null !== $this->prototypeIndex) { + $prefix .= sprintf('[%s]', $this->prototypeIndex); + } + + $options = array_map(static function (string $option) use ($prefix): string { + return sprintf('%s[%s]', $prefix, $option); + }, $options); + } + + return implode('", "', $options); + } + + private function getParameterClassName(\ReflectionParameter $parameter): ?string + { + if (!($type = $parameter->getType()) instanceof \ReflectionNamedType || $type->isBuiltin()) { + return null; + } + + return $type->getName(); + } +} diff --git a/vendor/symfony/options-resolver/README.md b/vendor/symfony/options-resolver/README.md new file mode 100644 index 00000000..c63b9005 --- /dev/null +++ b/vendor/symfony/options-resolver/README.md @@ -0,0 +1,15 @@ +OptionsResolver Component +========================= + +The OptionsResolver component is `array_replace` on steroids. It allows you to +create an options system with required options, defaults, validation (type, +value), normalization and more. + +Resources +--------- + + * [Documentation](https://symfony.com/doc/current/components/options_resolver.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/vendor/symfony/options-resolver/composer.json b/vendor/symfony/options-resolver/composer.json new file mode 100644 index 00000000..4fd80d95 --- /dev/null +++ b/vendor/symfony/options-resolver/composer.json @@ -0,0 +1,29 @@ +{ + "name": "symfony/options-resolver", + "type": "library", + "description": "Provides an improved replacement for the array_replace PHP function", + "keywords": ["options", "config", "configuration"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=8.0.2", + "symfony/deprecation-contracts": "^2.1|^3" + }, + "autoload": { + "psr-4": { "Symfony\\Component\\OptionsResolver\\": "" }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "minimum-stability": "dev" +} diff --git a/vendor/symfony/polyfill-php80/LICENSE b/vendor/symfony/polyfill-php80/LICENSE new file mode 100644 index 00000000..5593b1d8 --- /dev/null +++ b/vendor/symfony/polyfill-php80/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/symfony/polyfill-php80/Php80.php b/vendor/symfony/polyfill-php80/Php80.php new file mode 100644 index 00000000..5fef5118 --- /dev/null +++ b/vendor/symfony/polyfill-php80/Php80.php @@ -0,0 +1,105 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php80; + +/** + * @author Ion Bazan + * @author Nico Oelgart + * @author Nicolas Grekas + * + * @internal + */ +final class Php80 +{ + public static function fdiv(float $dividend, float $divisor): float + { + return @($dividend / $divisor); + } + + public static function get_debug_type($value): string + { + switch (true) { + case null === $value: return 'null'; + case \is_bool($value): return 'bool'; + case \is_string($value): return 'string'; + case \is_array($value): return 'array'; + case \is_int($value): return 'int'; + case \is_float($value): return 'float'; + case \is_object($value): break; + case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; + default: + if (null === $type = @get_resource_type($value)) { + return 'unknown'; + } + + if ('Unknown' === $type) { + $type = 'closed'; + } + + return "resource ($type)"; + } + + $class = \get_class($value); + + if (false === strpos($class, '@')) { + return $class; + } + + return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; + } + + public static function get_resource_id($res): int + { + if (!\is_resource($res) && null === @get_resource_type($res)) { + throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); + } + + return (int) $res; + } + + public static function preg_last_error_msg(): string + { + switch (preg_last_error()) { + case \PREG_INTERNAL_ERROR: + return 'Internal error'; + case \PREG_BAD_UTF8_ERROR: + return 'Malformed UTF-8 characters, possibly incorrectly encoded'; + case \PREG_BAD_UTF8_OFFSET_ERROR: + return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; + case \PREG_BACKTRACK_LIMIT_ERROR: + return 'Backtrack limit exhausted'; + case \PREG_RECURSION_LIMIT_ERROR: + return 'Recursion limit exhausted'; + case \PREG_JIT_STACKLIMIT_ERROR: + return 'JIT stack limit exhausted'; + case \PREG_NO_ERROR: + return 'No error'; + default: + return 'Unknown error'; + } + } + + public static function str_contains(string $haystack, string $needle): bool + { + return '' === $needle || false !== strpos($haystack, $needle); + } + + public static function str_starts_with(string $haystack, string $needle): bool + { + return 0 === strncmp($haystack, $needle, \strlen($needle)); + } + + public static function str_ends_with(string $haystack, string $needle): bool + { + return '' === $needle || ('' !== $haystack && 0 === substr_compare($haystack, $needle, -\strlen($needle))); + } +} diff --git a/vendor/symfony/polyfill-php80/README.md b/vendor/symfony/polyfill-php80/README.md new file mode 100644 index 00000000..10b8ee49 --- /dev/null +++ b/vendor/symfony/polyfill-php80/README.md @@ -0,0 +1,24 @@ +Symfony Polyfill / Php80 +======================== + +This component provides features added to PHP 8.0 core: + +- `Stringable` interface +- [`fdiv`](https://php.net/fdiv) +- `ValueError` class +- `UnhandledMatchError` class +- `FILTER_VALIDATE_BOOL` constant +- [`get_debug_type`](https://php.net/get_debug_type) +- [`preg_last_error_msg`](https://php.net/preg_last_error_msg) +- [`str_contains`](https://php.net/str_contains) +- [`str_starts_with`](https://php.net/str_starts_with) +- [`str_ends_with`](https://php.net/str_ends_with) +- [`get_resource_id`](https://php.net/get_resource_id) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php new file mode 100644 index 00000000..7ea6d277 --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php @@ -0,0 +1,22 @@ +flags = $flags; + } +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php new file mode 100644 index 00000000..77e037cb --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php @@ -0,0 +1,11 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php80 as p; + +if (\PHP_VERSION_ID >= 80000) { + return; +} + +if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { + define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); +} + +if (!function_exists('fdiv')) { + function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } +} +if (!function_exists('preg_last_error_msg')) { + function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } +} +if (!function_exists('str_contains')) { + function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('str_starts_with')) { + function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('str_ends_with')) { + function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('get_debug_type')) { + function get_debug_type($value): string { return p\Php80::get_debug_type($value); } +} +if (!function_exists('get_resource_id')) { + function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } +} diff --git a/vendor/symfony/polyfill-php80/composer.json b/vendor/symfony/polyfill-php80/composer.json new file mode 100644 index 00000000..5fe679db --- /dev/null +++ b/vendor/symfony/polyfill-php80/composer.json @@ -0,0 +1,40 @@ +{ + "name": "symfony/polyfill-php80", + "type": "library", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "keywords": ["polyfill", "shim", "compatibility", "portable"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +}